# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1262873936 -7200 # Node ID 1ddebce53859dfb91a3044c46889b8ee871c991c Revision: 200951 Kit: 201001 diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/active_palette_2_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/active_palette_2_api.metaxml Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,14 @@ + + +Active Palette 2 API +Active Palette 2 implements a toolbar UI component. The toolbar consists of items, which are represented by a graphical icons. Each item has also an associated identifier, which may be used by the client application to associate the item with a certain command, for example. The component is used through the Active Palette 2 API. +c++ +camerauis + + + + +no +no + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for Active Palette 2 API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/activepalette2eventdata.h APP_LAYER_PLATFORM_EXPORT_PATH(activepalette2eventdata.h) +../inc/activepalette2factory.h APP_LAYER_PLATFORM_EXPORT_PATH(activepalette2factory.h) +../inc/activepalette2genericpluginint.h APP_LAYER_PLATFORM_EXPORT_PATH(activepalette2genericpluginint.h) +../inc/activepalette2itemvisible.h APP_LAYER_PLATFORM_EXPORT_PATH(activepalette2itemvisible.h) +../inc/activepalette2navigationkeys.h APP_LAYER_PLATFORM_EXPORT_PATH(activepalette2navigationkeys.h) +../inc/activepalette2observer.h APP_LAYER_PLATFORM_EXPORT_PATH(activepalette2observer.h) +../inc/activepalette2ui.h APP_LAYER_PLATFORM_EXPORT_PATH(activepalette2ui.h) + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/inc/activepalette2eventdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/inc/activepalette2eventdata.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains an event's data +* +*/ + + +/** + * @file ActivePalette2EventData.h + * Contains an event's data + */ + + +#ifndef _ACTIVE_PALETTE_2_EVENT_DATA_H +#define _ACTIVE_PALETTE_2_EVENT_DATA_H + +#include + +/** + * Container for the data generated when a user selects an item + */ +class TActivePalette2EventData + { + public: + + /** + * Constructor + * @param aResult The result + * @param aCurItem The current item + * @param aPrevItem The previous item + * @param aServingItem The serving item + * @param aServingPlugin A reference to the serving plugin's UID + */ + TActivePalette2EventData(TInt aResult, + TInt aCurItem, + TInt aPrevItem, + TInt aServingItem, + const TUid& aServingPlugin); + + /** + * Returns the result + * @return The result + */ + IMPORT_C TInt Result(void) const; + + /** + * Returns the current item + * @return The current item + */ + IMPORT_C TInt CurItem(void) const; + + /** + * Returns the previous item + * @return The previous item + */ + IMPORT_C TInt PrevItem(void) const; + + /** + * Returns the serving item + * @return The serving item + */ + IMPORT_C TInt ServingItem(void) const; + + /** + * Returns the serving plugin's UID + * @return The serving plugin's UID + */ + IMPORT_C TUid ServingPlugin(void) const; + + private: + /// The result code + TInt iResult; + + /// The current item ID + TInt iCurItem; + + /// The previous item ID + TInt iPrevItem; + + /// The serving item ID + TInt iServingItem; + + /// The serving plugin's UID + TUid iServingPlugin; + }; + + +#endif // _ACTIVE_PALETTE_2_EVENT_DATA_H diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/inc/activepalette2factory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/inc/activepalette2factory.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Creates concrete implementation of AP +* +*/ + + +/** + * @file ActivePalette2Factory.h + * Creates concrete implementation of AP + */ + +#ifndef _ACTIVE_PALETTE_2_FACTORY_H +#define _ACTIVE_PALETTE_2_FACTORY_H + +#include +#include + +class MActivePalette2UI; +class CHuiEnv; +class MGui; + +/** + * Describes how the standard CCoeControl-based Active Palette will be rendered + */ +enum TActivePalette2DrawMode + { + EAP2DrawModeSemiTransparent = 0, ///< Semi-transparent, alpha-blended background + EAP2DrawModeCheckerboard, ///< With a checkerboard background. Alpha values will either be fully opaque or fully transparent. + EAP2DrawModeOpaque, ///< No tranparency. Not officially supported + + EAP2DrawModeSemiTransparentTooltipModeFading ///< Semi-transparent, alpha-blended background, fading tooltip + }; + +/** + * Factory class for Active Palette 2. Use these static functions to create AP2 objects. + * Class should not be instantiated. + */ +class ActivePalette2Factory + { +public: + /** + * Creates a legacy-style, CCoeControl-based Active Palette. + * The control created is NOT a window-owning control. Set the container window and Mop parent using + * the CoeControl() function. + * @param aDrawMode The drawing style used to render the AP + * @return The constructed Active Palette + */ + IMPORT_C static MActivePalette2UI* CreateActivePaletteUIL(TActivePalette2DrawMode aDrawMode); + + /** + * Creates a new-style, CHuiControl-based Active Palette. + * The control should be added to a control group using + * the CoeControl() function. + * @param aHuiEnv The client app's Hui environment + * @return The constructed Active Palette + */ + IMPORT_C static MActivePalette2UI* CreateHUIActivePaletteUIL(CHuiEnv& aHuiEnv); + + /** + * Creates a new-style, GuiLib-based Active Palette. + * @param aGui The client app's Gui environment + * @return The constructed Active Palette + */ + IMPORT_C static MActivePalette2UI* CreateGuiActivePaletteUIL(MGui* aGui); + +protected: + /** + * Constructor - not for external use + */ + ActivePalette2Factory() {} + }; + + +#endif // _ACTIVE_PALETTE_2_FACTORY_H diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/inc/activepalette2genericpluginint.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/inc/activepalette2genericpluginint.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette generic plugin public interface +* +*/ + + +/** + * @file ActivePalette2GenericPluginInt.h + * Active Palette generic plugin public interface + */ + +#ifndef ACTIVE_PALETTE_2_GENERIC_PLUGIN_INT_H +#define ACTIVE_PALETTE_2_GENERIC_PLUGIN_INT_H + +// INCLUDES +#include + +/// UID for generic plugin +#define KActivePalette2GenericPluginUID 0x10208A6D + +// CONSTANTS +/// Maximum tooltip length, in characters +const TInt KMaxTooltipLen = 256; + +// FORWARD DECLARATIONS + +/** + * Generic plugin parameters + */ +class TAP2GenericPluginParams + { +public: + /** + * Use to signify the resource file type + */ + enum TAP2GenericPluginResFileType + { + EGenericStdResFile = 1, ///< Use the inbuilt icons + EGenericCustomResFile = 2 ///< Use a custom graphics file + }; + + /** + * The IDs for the inbuilt icons + */ + enum TAP2GenericPluginIconId + { + // No built-in graphics supported + }; + +public: + + /** + * Constructor + */ + TAP2GenericPluginParams(); + + /** + * Constructor + * @param aResFileType Resource file type + * @param aGraphicsFileName Graphics file name + * @param aIconId Bitmap UD for the item's icon + * @param aMaskId Bitmap UD for the item's mask + * @param aTooltipText Tooltip text + * @param aMessageId Message ID + * @param aMsgCustomParam Message custom parameter + */ + IMPORT_C TAP2GenericPluginParams(const TInt aResFileType, + const TDesC& aGraphicsFileName, + const TInt aIconId, + const TInt aMaskId, + const TDesC& aTooltipText, + const TInt aMessageId, + const TInt aMsgCustomParam); + + /// Current graphics file type in use + TInt iResFileType; + /// Current graphics file in use + TFileName iGraphicsFileName; + /// The icon ID + TInt iIconId; + /// The mask ID + TInt iMaskId; + /// Tooltip text for the item + TBuf iTooltipText; + /// Message ID + TInt iMessageId; + /// Custom parameter + TInt iMsgCustomParam; + }; + + +/** + * Message IDs used by generic plugin + */ +enum TAP2GenericPluginMessageIDs + { + EAPGenericPluginChangeIcon, ///< Change the current icon + EAPGenericPluginChangeParams ///< Change the general parameters + }; + +/** + * Describes an icon and its mask, for the generic plugin + */ +class TAP2GenericPluginIcon + { +public: + + /** + * Constructor + */ + TAP2GenericPluginIcon(); + + /** + * Constructor + * @param aIconId Bitmap ID for the icon + * @param aMaskId Bitmap ID for the mask + */ + IMPORT_C TAP2GenericPluginIcon(const TInt aIconId, + const TInt aMaskId); + + /// The icon ID + TInt iIconId; + /// The mask ID + TInt iMaskId; + }; + +#endif // ACTIVE_PALETTE_2_GENERIC_PLUGIN_INT_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/inc/activepalette2itemvisible.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/inc/activepalette2itemvisible.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains (item id, visible) pairs used by AP2 +* +*/ + + +/** + * @file ActivePalette2ItemVisible.h + * Contains (item id, visible) pairs used by AP2 + */ + +#ifndef _ACTIVE_PALETTE_2_ITEM_VISIBLE_H +#define _ACTIVE_PALETTE_2_ITEM_VISIBLE_H + +#include + +/** + * Container class to describe (Item ID, visibility) pairs. + */ +class TActivePalette2ItemVisible + { + public: + /** + * Constructor + * @param aItemId The Item ID + * @param aVisible Whether the item is / should be visible + */ + IMPORT_C TActivePalette2ItemVisible(TInt aItemId, TBool aVisible); + + /** + * Returns the item ID + * @return The item ID + */ + IMPORT_C TInt ItemId() const; + + /** + * Returns the visibility + * @return The visibility of the item + */ + IMPORT_C TBool Visible() const; + + private: + /** + * Constructor. Not for external use. + */ + TActivePalette2ItemVisible(); + + /// The item ID + TInt iItemId; + + /// The visibility + TBool iVisible; + }; + + +#endif // _ACTIVE_PALETTE_2_ITEM_VISIBLE_H diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/inc/activepalette2navigationkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/inc/activepalette2navigationkeys.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains the key definitions used for navigation in AP +* +*/ + + +/** + * @file ActivePalette2NavigationKeys.h + * Contains the key definitions used for navigation in AP + */ + +#ifndef _ACTIVE_PALETTE_2_NAVIGATION_KEYS_H +#define _ACTIVE_PALETTE_2_NAVIGATION_KEYS_H + +#include + +/** + * Navigation key type + */ +class TActivePalette2NavigationKeys + { + public: + /** + * Constructor + * @param aNaviPrev The scancode of the previous key + * @param aNaviNext The scancode of the next key + * @param aNaviSelect The scancode of the select key + */ + IMPORT_C TActivePalette2NavigationKeys(TInt aNaviPrev, + TInt aNaviNext, + TInt aNaviSelect); + + /** + * Constructor + * Assumes default navigation keys + */ + IMPORT_C TActivePalette2NavigationKeys(void); + + /// The "Previous" key's scancode + TInt iNaviPrev; + /// The "Next" key's scancode + TInt iNaviNext; + /// The "Select" key's scancode + TInt iNaviSelect; + }; + + +#endif // _ACTIVE_PALETTE_2_NAVIGATION_KEYS_H diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/inc/activepalette2observer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/inc/activepalette2observer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface used by AP to report events and request services +* from client application +* +*/ + + + +/** + * @file ActivePalette2Observer.h + * Interface used by AP to report events and request services from + * client application + */ + + +#ifndef _ACTIVE_PALETTE_2_OBSERVER_H +#define _ACTIVE_PALETTE_2_OBSERVER_H + +#include + +class TActivePalette2EventData; + +/** + * Interface for an Active Palette 2 observer. The AP will use this interface to inform the client app + * about certain events, and to request services. + */ +class MActivePalette2Observer + { + public: + /** + * Called when a new item is focused + * @param aPrevItem Item ID of previously focused item + * @param aFocusedItem Item ID of newly focused item + */ + virtual void NotifyItemFocused(TInt aPrevItem, TInt aFocusedItem) = 0; + + /** + * Called when the user has selected an item from the AP, before the plugin is informed + * @param aEvent The event data + */ + virtual void NotifyItemSelected(const TActivePalette2EventData& aEvent) = 0; + + /** + * Called when the user has selected an item from the AP, after the relevant plugin + * has completed processing the event + * @param aEvent The event data + * @param aDataDes Data descriptor + * @param aDataInt Data integer + */ + virtual void NotifyItemComplete(const TActivePalette2EventData& aEvent, + const TDesC8& aDataDes, + TInt aDataInt) = 0; + + /** + * Called when a plugin generates a message for the client app. + * @param aEvent The event data + * @param aMessageID The ID of the message + * @param aDataDes Data descriptor + * @param aDataInt Data integer + */ + virtual void NotifyMessage(const TActivePalette2EventData& aEvent, + TInt aMessageID, + const TDesC8& aDataDes, + TInt aDataInt) = 0; + + /** + * Request for the client app to redraw the given area underneath the AP. Used to support semi-transparency. + * It is important that this completes quickly. This will only be called if a CCoeControl-derived AP is + * in use. + * @param aArea The area to redraw. + */ + virtual void Redraw(const TRect& aArea) = 0; + + /** + * Informs the observer that the AP has been updated in some way. Includes animations. + * Only called if SetGc() has previously been called on the AP with a non-NULL parameter, and if the AP + * in use is a CCoeControl. + */ + virtual void ActivePaletteUpdated(void) = 0; + }; + +#endif // _ACTIVE_PALETTE_2_OBSERVER_H diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/inc/activepalette2ui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/inc/activepalette2ui.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,275 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface class for AP2 +* +*/ + + +/** + * @file ActivePalette2UI.h + * Interface class for AP2 + */ + +#ifndef _ACTIVE_PALETTE_2_UI_H +#define _ACTIVE_PALETTE_2_UI_H + + +#include + +class CCoeControl; +class CHuiControl; +class CBitmapContext; +class MActivePalette2Observer; +class TActivePalette2NavigationKeys; +class TActivePalette2ItemVisible; + +/** +* The interface for the Active Palette. The ActivePalette2Factory is used to instantiate +* objects that provide this interface. +*/ +class MActivePalette2UI + { +public: + /** + * Installs an item to the AP. + * @param aItemVisible The ID and visibility of the new item + * @param aPluginUid The UID of the plugin to handle this item + * @param aCustomDataDes Descriptor data to pass to the plugin + * @return Standard error code + */ + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + const TDesC8& aCustomDataDes) = 0; + + /** + * Installs an item to the AP. + * @param aItemVisible The ID and visibility of the new item + * @param aPluginUid The UID of the plugin to handle this item + * @param aCustomDataInt Integer data to pass to the plugin + * @return Standard error code + */ + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt = 0) = 0; + + /** + * Installs an item to the AP. + * @param aItemVisible The ID and visibility of the new item + * @param aPluginUid The UID of the plugin to handle this item + * @param aCustomDataInt Integer data to pass to the plugin + * @param aCustomDataDes Descriptor data to pass to the plugin + * @return Standard error code + */ + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt, + const TDesC8& aCustomDataDes) = 0; + + /** + * Removes an item + * @param aItemId The resource ID of the item to install + * @return Standard error code + */ + virtual TInt RemoveItem(TInt aItemId) = 0; + + /** + * Sets the visibility of an item + * @param aItemId The item's ID + * @param aIsVisible The visibility state + * @return Standard error code + */ + virtual TInt SetItemVisibility(TInt aItemId, TBool aIsVisible) = 0; + + /** + * Find out the visibility of a specified item + * @param aItemId The item's ID + * @param aIsVisible On return, indicates the visibility of the item + * @return Standard error code + */ + virtual TInt GetItemVisibility(TInt aItemId, TBool& aIsVisible) const = 0; + + /** + * Gets the list of currently installed items. + * The list will include all items, both visible and invisible. + * @see SetItemList() + * + * @param aItemVisibleList On return, will contain the item list. + * @return Standard error code + */ + virtual TInt GetItemList(RArray& aItemVisibleList) const = 0; + + /** + * Sets the order and visibility of installed items. + * aItemVisibleList may be incomplete (i.e. not all installed item IDs must be present). + * In this case, the non-specified items will be shuffled down to the end of the AP, + * whilst retaining their relative order. + * If the item that was in focus before the call is still visible, it retains the focus, + * else the first visible item gains focus. + * + * @see GetItemList() + * + * @param aItemVisibleList The list describing the order and visibility of the items + * @return Standard error code + */ + virtual TInt SetItemList(const RArray& aItemVisibleList) = 0; + + /** + * Sends a message to the specified item's handling plugin + * @param aItemId The item's ID + * @param aMessageId Message ID + * @param aDataDes Custom data passed as a descriptor + * @return Error code + */ + virtual TInt SendMessage(TInt aItemId, TInt aMessageId, const TDesC8& aDataDes) = 0; + + /** + * Sends a message to the specified item's handling plugin + * @param aItemId The item's ID + * @param aMessageId Message ID + * @param aDataInt Custom data passed as an integer + * @return Standard error code + */ + virtual TInt SendMessage(TInt aItemId, TInt aMessageId, TInt aDataInt) = 0; + + /** + * Gets the currently focussed item + * @param aItemId On return, will contain the ID of the item in focus + * @return Standard error code + */ + virtual TInt GetCurrentItem(TInt& aItemId) const = 0; + + /** + * Sets the currently focussed item + * @param aItemId The ID of the item to focus + * @return Standard error code + */ + virtual TInt SetCurrentItem(TInt aItemId) = 0; + + /** + * Hides or shows the palette. + * After calling this function, and until the transition (if any) is complete, the AP will + * not accept any user input. + * + * @see SetPaletteVisibilityAnimationDuration() + * @see GetPaletteVisibilityAnimationDuration() + * + * @param aVisible If ETrue, shows the AP, otherwise hides it + * @param aAnimated Whether the transition should be animated. If not, the change is made as soon + * as aDelayedStartMilliseconds has passed + * @param aDelayedStartMilliseconds An optional pause before the transition begins. + * @return Standard error code + */ + virtual TInt SetPaletteVisibility(TBool aVisible, TBool aAnimated, TInt aDelayedStartMilliseconds = 0) = 0; + + /** + * Sets the duration of the SetPaletteVisibility animation. + * + * @see SetPaletteVisibility() + * @see GetPaletteVisibilityAnimationDuration() + * + * @param aTimeInMilliseconds How long the animation should take, in milliseconds + * @return Standard error code + */ + virtual TInt SetPaletteVisibilityAnimationDuration(TInt aTimeInMilliseconds) = 0; + + /** + * Gets the duration of the SetPaletteVisibility animation. + * + * @see SetPaletteVisibility() + * @see SetPaletteVisibilityAnimationDuration() + * + * @param aTimeInMilliseconds On return, will contain how long the animation will take, in milliseconds + * @return Standard error code + */ + virtual TInt GetPaletteVisibilityAnimationDuration(TInt& aTimeInMilliseconds) const = 0; + + /** + * Move the AP. + * @param aTopLeft Point specifying where to move the AP to + */ + virtual void LocateTo(const TPoint& aTopLeft) = 0; + + /** + * Returns the top left point of the AP + * @return A TPoint indicating the top left point of the AP + */ + virtual TPoint Location() const = 0; + + /** + * Returns the underlying CCoeControl, if any. + * @return A valid CCoeControl pointer if the underlying implementation is a CCoeControl; NULL otherwise. + */ + virtual CCoeControl* CoeControl() = 0; + + /** + * Returns the underlying CHuiControl, if any. + * @return A valid CHuiControl pointer if the underlying implementation is a CHuiControl; NULL otherwise. + */ + virtual CHuiControl* HuiControl() = 0; + + /** + * Sets the graphics context to draw to. + * If called with aGc being non-NULL, the AP will be rendered to the supplied context + * in future drawing operations. If called with NULL, the screen's GC will be used instead. + * Calls to this will only have an effect if a CCoeControl-based AP has been created. + * + * @see RenderActivePalette() + * + * @param aGc The graphics context to draw to + */ + virtual void SetGc(CBitmapContext* aGc = NULL) = 0; + + /** + * Forces the AP to draw itself to the supplied aRect. + * Uses the context previously set by SetGc, if any; uses the screen's context otherwise. + * Calls to this will only have an effect if a CCoeControl-based AP has been created. + * + * @see SetGc() + * + * @param aRect The rect to render to + */ + virtual void RenderActivePalette(const TRect& aRect) const = 0; + + /** + * Sets the active palette observer used for callbacks. Calls to this function replace the previously + * set observer. SetObserver(NULL) may be called to remove the previously set observer without specifying + * a new observer + * + * @param aObserver The new observer to use + */ + virtual void SetObserver(MActivePalette2Observer* aObserver) = 0; + + /** + * Gets a list of available external plugins. + * + * @param aPluginList On return, will contain a list a valid plugin UIDs + * @return Standard error code + */ + virtual TInt GetAvailablePlugins(RArray& aPluginList) const = 0; + + /** + * Sets the keys the user will press to navigate the AP. This sets the scancodes responded to when + * CCoeControl::OfferKeyEvent, CHuiControl::OfferEvent or similar are called. + * + * @param aNavigationKeys The new navigation keys + */ + virtual void SetNavigationKeys(const TActivePalette2NavigationKeys& aNavigationKeys) = 0; + + /** + * Destructor. Will clean up all installed plugins. + */ + virtual ~MActivePalette2UI() {}; +}; + +#endif // _ACTIVE_PALETTE_2_UI_H diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/Bmarm/ActivePalette2ApiTestU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/Bmarm/ActivePalette2ApiTestU.DEF Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/Bwins/ActivePalette2ApiTestU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/Bwins/ActivePalette2ApiTestU.DEF Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/EABI/ActivePalette2ApiTestU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/EABI/ActivePalette2ApiTestU.def Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,5 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI23CActivePaletteContainer @ 2 NONAME ; ## + _ZTV23CActivePaletteContainer @ 3 NONAME ; ## + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/conf/ui_ActivePalette2ApiTest.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/conf/ui_ActivePalette2ApiTest.cfg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 API tests +* +*/ + +// ---------------------------------------------------------------------------- +// Constants +// ---------------------------------------------------------------------------- + +[Define] +KPaletteSlideInDelay 100 +KPaletteSlideInDuration 1000 +KPaletteSlideOutDelay 0 +KPaletteSlideOutDuration 500 +KPaletteShowUpDelay 100 + + +KPosition1X 50 +KPosition1Y 50 +KPosition2X 100 +KPosition2Y 100 + + +[Enddefine] + +// ---------------------------------------------------------------------------- +// Test cases +// ---------------------------------------------------------------------------- + +[Test] +title ActivePalette2 Api Test: Basic UI Construction + +create ActivePalette2ApiTest test +test CreateUi +test DisposeUi +delete test +[Endtest] + + +[Test] +title ActivePalette2 Api Test: Full API testing + +create ActivePalette2ApiTest test + +test CreateUi + +test ListPlugins +test SetNavigationKeys +test SetPaletteVisibility false 0 false 0 +test AddItems 0 1 2 3 4 5 6 7 8 9 10 11 12 +test SetCurrentItem 0 +test SetPaletteVisibility true KPaletteSlideInDelay true KPaletteSlideInDuration +pause 2000 +test SetPaletteVisibility false 0 true KPaletteSlideOutDuration +pause 2000 +test SetPaletteVisibility true KPaletteShowUpDelay false 0 +pause 1000 + +test MovePalette KPosition1X KPosition1Y +pause 1000 +test MovePalette KPosition2X KPosition2Y +pause 1000 + +test CheckItemList 0 1 2 3 4 5 6 7 8 9 10 11 12 +test CheckCurrentItem 0 +test SetCurrentItem 12 +pause 2000 +test SetCurrentItem 5 +test CheckCurrentItem 5 +pause 2000 + +test RemoveItems 0 2 4 6 8 10 12 +test CheckItemList 1 3 5 7 9 11 +pause 2000 + +test HideItems 1 5 9 +test CheckItemVisibilities 1 false 3 true 5 false 7 true 9 false 11 true +pause 2000 +test ShowItems 1 5 9 +test CheckItemVisibilities 1 true 3 true 5 true 7 true 9 true 11 true +pause 2000 + +test TestKeyPrevious +pause 1000 +test TestKeyNext +pause 5000 +test TestKeySelect +pause 1000 + +test TestOffscreenDrawing +pause 500 + +test DisposeUi +delete test +[Endtest] + + +// ---------------------------------------------------------------------------- +// End of file +// ---------------------------------------------------------------------------- diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/data/eighth.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/data/eighth.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,18 @@ + + + + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/data/fifth.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/data/fifth.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,19 @@ + + + + + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/data/first.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/data/first.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,18 @@ + + + + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/data/fourth.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/data/fourth.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,18 @@ + + + + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/data/ninth.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/data/ninth.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,18 @@ + + + + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/data/second.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/data/second.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,18 @@ + + + + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/data/seventh.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/data/seventh.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,18 @@ + + + + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/data/sixth.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/data/sixth.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,19 @@ + + + + + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/data/third.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/data/third.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,18 @@ + + + + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/data/zeroth.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/data/zeroth.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,19 @@ + + + + + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/group/ActivePalette2ApiTest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/group/ActivePalette2ApiTest.mmp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,45 @@ +/*TYPE TESTCLASS*/ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 API tests +* +*/ + +#include + +TARGET ActivePalette2ApiTest.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB +VENDORID VID_DEFAULT +DEFFILE ActivePalette2ApiTest.def + + +APP_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc + +SOURCEPATH ../src +SOURCE ActivePalette2ApiTest.cpp +SOURCE ActivePalette2ApiTestBlocks.cpp ActivePaletteContainer.cpp + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib cone.lib activepalette.lib eikcore.lib apgrfx.lib ws32.lib +LIBRARY fbscli.lib bitgdi.lib + +LANG SC + +// End of File diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/group/ActivePalette2ApiTest.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/group/ActivePalette2ApiTest.pkg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,63 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: Active Palette 2 API tests +; + +; Languages +&EN + +; Provide value for uid +#{"ActivePalette2ApiTest"},(0x101FB3E3),1,1,0,TYPE=SA + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Logo +; None + +; Package signature - Optional +; None + +; Start of Package body + +; Condition blocks +; None + +; Options list +; None + +; Install files +; Files To Copy +"\epoc32\release\armv5\urel\ActivePalette2ApiTest.dll" - "C:\Sys\Bin\ActivePalette2ApiTest.dll" +"\epoc32\data\z\resource\apps\ActivePalette2ApiTest.mif" - "C:\Resource\Apps\ActivePalette2ApiTest.mif" +"..\conf\ui_ActivePalette2ApiTest.cfg" - "C:\TestFramework\ui_ActivePalette2ApiTest.cfg" +"..\init\ActivePalette2ApiTest.ini" - "C:\TestFramework\ActivePalette2ApiTest.ini" + + +; Embedded SIS +; None + +; End of Package body + +; PKG dependencies +; None + +; PKG capabilities +; None diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/group/ActivePalette2ApiTestIconList.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/group/ActivePalette2ApiTestIconList.txt Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,10 @@ +-c8,1 zeroth.svg +-c8,1 first.svg +-c8,1 second.svg +-c8,1 third.svg +-c8,1 fourth.svg +-c8,1 fifth.svg +-c8,1 sixth.svg +-c8,1 seventh.svg +-c8,1 eighth.svg +-c8,1 ninth.svg diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/group/ActivePalette2ApiTestIcons.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/group/ActivePalette2ApiTestIcons.mk Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,63 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) + ZDIR = $(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z +else + ZDIR = $(EPOCROOT)epoc32\data\z +endif + +# --------------------------------------- +# Source and target folders +# +SOURCEDIR = ..\data +TARGETDIR = $(ZDIR)\Resource\Apps +HEADERDIR = $(EPOCROOT)epoc32\include +TRG_FILENAME = ActivePalette2ApiTest.mif +HDR_FILENAME = ActivePalette2ApiTest.mbg +OPTIONS = /c8,1 + + + +do_nothing : + @rem do_nothing +MAKMAKE : do_nothing +BLD : do_nothing +CLEAN : + if exist $(HEADERDIR)\$(HDR_FILENAME) @del $(HEADERDIR)\$(HDR_FILENAME) + if exist $(TARGETDIR)\$(TRG_FILENAME) @del $(TARGETDIR)\$(TRG_FILENAME) +LIB : do_nothing +CLEANLIB : do_nothing +RESOURCE : + + mifconv $(TARGETDIR)\$(TRG_FILENAME) -H$(HEADERDIR)\$(HDR_FILENAME) \ + $(OPTIONS) $(SOURCEDIR)\zeroth.svg \ + $(OPTIONS) $(SOURCEDIR)\first.svg \ + $(OPTIONS) $(SOURCEDIR)\second.svg \ + $(OPTIONS) $(SOURCEDIR)\third.svg \ + $(OPTIONS) $(SOURCEDIR)\fourth.svg \ + $(OPTIONS) $(SOURCEDIR)\fifth.svg \ + $(OPTIONS) $(SOURCEDIR)\sixth.svg \ + $(OPTIONS) $(SOURCEDIR)\seventh.svg \ + $(OPTIONS) $(SOURCEDIR)\eighth.svg \ + $(OPTIONS) $(SOURCEDIR)\ninth.svg + +FREEZE : do_nothing +SAVESPACE : do_nothing +RELEASABLES : + @echo $(HEADERDIR)\$(HDR_FILENAME) && \ + @echo $(TARGETDIR)\$(TRG_FILENAME) +FINAL : do_nothing diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 API tests +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS +../conf/ui_ActivePalette2ApiTest.cfg /epoc32/winscw/c/TestFramework/ui_ActivePalette2ApiTest.cfg +../init/ActivePalette2ApiTest.ini /epoc32/winscw/c/TestFramework/ActivePalette2ApiTest.ini +../init/ActivePalette2ApiTest.ini /epoc32/winscw/c/TestFramework/TestFramework.ini +/* +../data/zeroth.svg /epoc32/s60/icons/zeroth.svg +../data/first.svg /epoc32/s60/icons/first.svg +../data/second.svg /epoc32/s60/icons/second.svg +../data/third.svg /epoc32/s60/icons/third.svg +../data/fourth.svg /epoc32/s60/icons/fourth.svg +../data/fifth.svg /epoc32/s60/icons/fifth.svg +../data/sixth.svg /epoc32/s60/icons/sixth.svg +../data/seventh.svg /epoc32/s60/icons/seventh.svg +../data/eighth.svg /epoc32/s60/icons/eighth.svg +../data/ninth.svg /epoc32/s60/icons/ninth.svg +*/ + +PRJ_TESTMMPFILES +ActivePalette2ApiTest.mmp +gnumakefile ActivePalette2ApiTestIcons.mk + +/* +PRJ_TESTEXTENSIONS +START EXTENSION s60/mifconv +OPTION TARGETFILE ActivePalette2ApiTest.mif +OPTION HEADERFILE ActivePalette2ApiTest.mbg +OPTION SOURCEFILE ActivePalette2ApiTestIconList.txt +END +*/ + + +PRJ_MMPFILES +// End of File diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/inc/ActivePalette2ApiTest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/inc/ActivePalette2ApiTest.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,202 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: STIF testclass declaration +* +*/ + +#ifndef ACTIVEPALETTE2APITEST_H +#define ACTIVEPALETTE2APITEST_H + +// INCLUDES +#include +#include +#include +#include + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 + +// Logging path +_LIT( KActivePalette2ApiTestLogPath, "\\logs\\testframework\\ActivePalette2ApiTest\\" ); +// Log file +_LIT( KActivePalette2ApiTestLogFile, "ActivePalette2ApiTest.txt" ); +_LIT( KActivePalette2ApiTestLogFileWithTitle, "ActivePalette2ApiTest_[%S].txt" ); + +// FUNCTION PROTOTYPES +//?type ?function_name(?arg_list); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; +class CActivePalette2ApiTest; +class CActivePaletteContainer; + +// DATA TYPES +//enum ?declaration +//typedef ?declaration +//extern ?data_type; + +// CLASS DECLARATION + +/** +* CActivePalette2ApiTest test class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CActivePalette2ApiTest) : public CScriptBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CActivePalette2ApiTest* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CActivePalette2ApiTest(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + CStifLogger* Log() const; + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CActivePalette2ApiTest( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Test methods are listed below. + */ + virtual TInt CreateUiL( CStifItemParser& aItem ); + virtual TInt DisposeUiL( CStifItemParser& aItem ); + virtual TInt SetNavigationKeysL( CStifItemParser& aItem ); + virtual TInt ListPluginsL( CStifItemParser& aItem ); + + virtual TInt SetPaletteVisibilityL( CStifItemParser& aItem ); + virtual TInt MovePaletteL( CStifItemParser& aItem ); + + virtual TInt AddItemsL( CStifItemParser& aItem ); + virtual TInt RemoveItemsL( CStifItemParser& aItem ); + virtual TInt ShowItemsL( CStifItemParser& aItem ); + virtual TInt HideItemsL( CStifItemParser& aItem ); + virtual TInt SetCurrentItemL( CStifItemParser& aItem ); + virtual TInt CheckCurrentItemL( CStifItemParser& aItem ); + virtual TInt CheckItemListL( CStifItemParser& aItem ); + virtual TInt CheckItemVisibilitiesL( CStifItemParser& aItem ); + + virtual TInt TestOffscreenDrawingL( CStifItemParser& aItem ); + + virtual TInt TestKeyPreviousL( CStifItemParser& aItem ); + virtual TInt TestKeyNextL( CStifItemParser& aItem ); + virtual TInt TestKeySelectL( CStifItemParser& aItem ); + + TBool GetNextBooleanFromString( CStifItemParser& aItem, TBool& aValue ); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + //ADD NEW METHOD DEC HERE + //[TestMethods] - Do not remove + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + + // ?one_line_short_description_of_data + //?data_declaration; + CActivePaletteContainer* iContainer; + + // Reserved pointer for future extension + //TAny* iReserved; + + public: // Friend classes + //?friend_class_declaration; + protected: // Friend classes + //?friend_class_declaration; + private: // Friend classes + //?friend_class_declaration; + }; + +#endif // ACTIVEPALETTE2APITEST_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/inc/ActivePaletteContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/inc/ActivePaletteContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -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: CCActivePaletteContainer declaration. +* +*/ + +#ifndef ACTIVEPALETTECONTAINER_H +#define ACTIVEPALETTECONTAINER_H + +// INCLUDES +#include +#include +#include +#include +#include + + +// FORWARD DECLARATIONS +class CActivePalette2ApiTest; +class MActivePalette2UI; + + +// CLASS DECLARATION + +/** + * CCActivePaletteContainer + * + */ +class CActivePaletteContainer : public CCoeControl, + public MCoeView, + public MActivePalette2Observer + { +public: + + // Constructors and destructor + void ConstructL(CActivePalette2ApiTest* aTest); + + /** + * Destructor. + */ + ~CActivePaletteContainer(); + + // ------------------------------------------------------------------------- + // From CCoeControl +public: + virtual TInt CountComponentControls() const; + virtual CCoeControl* ComponentControl(TInt aIndex) const; + virtual void Draw(const TRect &aRect) const; + + virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); +protected: + virtual void SizeChanged(); + + // ------------------------------------------------------------------------- + // From MCoeView +public: + virtual TVwsViewId ViewId() const; +private: + virtual void ViewActivatedL(const TVwsViewId &aPrevViewId, TUid aCustomMessageId, const TDesC8 &aCustomMessage); + virtual void ViewDeactivated(); + + // ------------------------------------------------------------------------- + // From MActivePalette2Observer +public: + /** + * Called when a new item is focused + * @param aPrevItem Item ID of previously focused item + * @param aFocusedItem Item ID of newly focused item + */ + virtual void NotifyItemFocused(TInt aPrevItem, TInt aFocusedItem); + + /** + * Called when the user has selected an item from the AP, before the plugin is informed + * @param aEvent The event data + */ + virtual void NotifyItemSelected(const TActivePalette2EventData& aEvent); + + /** + * Called when the user has selected an item from the AP, after the relevant plugin + * has completed processing the event + * @param aEvent The event data + * @param aDataDes Data descriptor + * @param aDataInt Data integer + */ + virtual void NotifyItemComplete(const TActivePalette2EventData& aEvent, + const TDesC8& aDataDes, + TInt aDataInt); + + /** + * Called when a plugin generates a message for the client app. + * @param aEvent The event data + * @param aMessageID The ID of the message + * @param aDataDes Data descriptor + * @param aDataInt Data integer + */ + virtual void NotifyMessage(const TActivePalette2EventData& aEvent, + TInt aMessageID, + const TDesC8& aDataDes, + TInt aDataInt); + + /** + * Request for the client app to redraw the given area underneath the AP. Used to support semi-transparency. + * It is important that this completes quickly. This will only be called if a CCoeControl-derived AP is + * in use. + * @param aArea The area to redraw. + */ + virtual void Redraw(const TRect& aArea); + + /** + * Informs the observer that the AP has been updated in some way. Includes animations. + * Only called if SetGc() has previously been called on the AP with a non-NULL parameter, and if the AP + * in use is a CCoeControl. + */ + virtual void ActivePaletteUpdated(void); + + // ------------------------------------------------------------------------- + // New methods +public: + + /** + * Get the Active Palette instance. + */ + MActivePalette2UI* ActivePalette() const; + +private: + + /** + * Create Active Palette. + */ + void CreateActivePaletteL(); + + /** + * Helper method to trace the Active Palette Event details. + * @param aEvent The event. + */ + void CheckActivePaletteEvent( const TActivePalette2EventData& aEvent ); + + // ------------------------------------------------------------------------- + // Data +private: + + CActivePalette2ApiTest* iTest; + MActivePalette2UI* iActivePalette; + TUid iAppUid; + + // ------------------------------------------------------------------------- + }; + +#endif // ACTIVEPALETTECONTAINER_H diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/init/ActivePalette2ApiTest.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/init/ActivePalette2ApiTest.ini Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,199 @@ +# +# This is STIF initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. +# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation +# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 +# + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + # 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\LOGS\TestFramework\ +TestReportFileName= TestReport + +TestReportFormat= TXT # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +DisableMeasurement= stifmeasurementdisablenone # Possible values are: + # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' + # 'stifmeasurementplugin01', 'stifmeasurementplugin02', + # 'stifmeasurementplugin03', 'stifmeasurementplugin04', + # 'stifmeasurementplugin05' or 'stifbappeaprofiler' + +Timeout= 0 # Default timeout value for each test case. In milliseconds +UITestingSupport= YES +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + + +[New_Module] +ModuleName= testscripter +TestCaseFile= C:\TestFramework\ui_ActivePalette2ApiTest.cfg +[End_Module] + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +#[New_Module] +#ModuleName= testmodulexxx + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) +#TestCaseFile= c:\testframework\testcases1.cfg +#TestCaseFile= c:\testframework\testcases2.cfg +#TestCaseFile= c:\testframework\manualtestcases.cfg + +#[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIF logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# +# - Will write log file in unicode format. +# + YES, Log file will be written in unicode format +# + NO, Log will be written as normal, not unicode, file. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' +#NOTE: TestEngine and TestServer logging settings cannot change here + +CreateLogDirectories= YES # Possible values: YES or NO + +EmulatorBasePath= C:\LOGS\TestFramework\ +EmulatorFormat= HTML # Possible values: TXT or HTML +EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +HardwareBasePath= D:\LOGS\TestFramework\ +HardwareFormat= HTML # Possible values: TXT or HTML +HardwareOutput= FILE # Possible values: FILE or RDEBUG + +FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +ThreadIdToLogFile= YES # Possible values: YES or NO +WithTimeStamp= YES # Possible values: YES or NO +WithLineBreak= YES # Possible values: YES or NO +WithEventRanking= YES # Possible values: YES or NO + +FileUnicode= YES # Possible values: YES or NO + +AddTestCaseTitle= NO +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/src/ActivePalette2ApiTest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/src/ActivePalette2ApiTest.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// INCLUDE FILES +#include +#include "ActivePalette2ApiTest.h" +#include + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::CActivePalette2ApiTest +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CActivePalette2ApiTest::CActivePalette2ApiTest( + CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CActivePalette2ApiTest::ConstructL() + { + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if(loggerSettings.iAddTestCaseTitle) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KActivePalette2ApiTestLogFileWithTitle, &title); + } + else + { + logFileName.Copy(KActivePalette2ApiTestLogFile); + } + + iLog = CStifLogger::NewL( KActivePalette2ApiTestLogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CActivePalette2ApiTest* CActivePalette2ApiTest::NewL( + CTestModuleIf& aTestModuleIf ) + { + CActivePalette2ApiTest* self = new (ELeave) CActivePalette2ApiTest( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CActivePalette2ApiTest::~CActivePalette2ApiTest() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + } + +//----------------------------------------------------------------------------- +// CActivePalette2ApiTest::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CActivePalette2ApiTest::SendTestClassVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("ActivePalette2ApiTest.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CActivePalette2ApiTest::NewL( aTestModuleIf ); + + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/src/ActivePalette2ApiTestBlocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/src/ActivePalette2ApiTestBlocks.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,882 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains testclass implementation. +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include + +#include // CFbsBitGc +#include // CFbsBitmap +#include // CFbsBitmapDevice + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "ActivePalette2ApiTest.h" +#include "ActivePaletteContainer.h" + + + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +//const ?type ?constant_var = ?constant; + +// MACROS +//#define ?macro ?macro_def +#define LOG(text) iLog->Log(_L(text)) +#define LOG1(text, param) iLog->Log(_L(text), param) +#define LOG2(text, param1, param2) iLog->Log(_L(text), param1, param2) +#define LOG3(text, param1, param2, param3) iLog->Log(_L(text), param1, param2, param3) + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +namespace { + static const TInt KNaviPrevious = EKeyUpArrow; + static const TInt KNaviNext = EKeyDownArrow; + static const TInt KNaviSelect = EKeyEnter; + + _LIT( KTrueString, "true" ); + _LIT( KFalseString, "false" ); + + _LIT( KIconFileName, "\\resource\\apps\\ActivePalette2ApiTest.mif" ); + + static const TInt KIconIds[] = { + EMbmActivepalette2apitestZeroth, + EMbmActivepalette2apitestFirst, + EMbmActivepalette2apitestSecond, + EMbmActivepalette2apitestThird, + EMbmActivepalette2apitestFourth, + EMbmActivepalette2apitestFifth, + EMbmActivepalette2apitestSixth, + EMbmActivepalette2apitestSeventh, + EMbmActivepalette2apitestEighth, + EMbmActivepalette2apitestNinth + }; + + static const TInt KMaskIds[] = { + EMbmActivepalette2apitestZeroth_mask, + EMbmActivepalette2apitestFirst_mask, + EMbmActivepalette2apitestSecond_mask, + EMbmActivepalette2apitestThird_mask, + EMbmActivepalette2apitestFourth_mask, + EMbmActivepalette2apitestFifth_mask, + EMbmActivepalette2apitestSixth_mask, + EMbmActivepalette2apitestSeventh_mask, + EMbmActivepalette2apitestEighth_mask, + EMbmActivepalette2apitestNinth_mask + }; + + static const TInt KIconCount = sizeof(KIconIds)/sizeof(TInt); +} + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// ?function_name ?description. +// ?description +// Returns: ?value_1: ?description +// ?value_n: ?description_line1 +// ?description_line2 +// ----------------------------------------------------------------------------- +// +/* +?type ?function_name( + ?arg_type arg, // ?description + ?arg_type arg) // ?description + { + + ?code // ?comment + + // ?comment + ?code + } +*/ + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CActivePalette2ApiTest::Delete() + { + // Make sure this is released, although DisposeUi is supposed to be + // called within the test case. + delete iContainer; + iContainer = NULL; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2ApiTest::RunMethodL( + CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "CreateUi", CActivePalette2ApiTest::CreateUiL ), + ENTRY( "DisposeUi", CActivePalette2ApiTest::DisposeUiL ), + ENTRY( "SetNavigationKeys", CActivePalette2ApiTest::SetNavigationKeysL ), + ENTRY( "ListPlugins", CActivePalette2ApiTest::ListPluginsL ), + ENTRY( "SetPaletteVisibility", CActivePalette2ApiTest::SetPaletteVisibilityL ), + ENTRY( "MovePalette", CActivePalette2ApiTest::MovePaletteL ), + ENTRY( "AddItems", CActivePalette2ApiTest::AddItemsL ), + ENTRY( "RemoveItems", CActivePalette2ApiTest::RemoveItemsL ), + ENTRY( "ShowItems", CActivePalette2ApiTest::ShowItemsL ), + ENTRY( "HideItems", CActivePalette2ApiTest::HideItemsL ), + ENTRY( "SetCurrentItem", CActivePalette2ApiTest::SetCurrentItemL ), + ENTRY( "CheckCurrentItem", CActivePalette2ApiTest::CheckCurrentItemL ), + ENTRY( "CheckItemList", CActivePalette2ApiTest::CheckItemListL ), + ENTRY( "CheckItemVisibilities", CActivePalette2ApiTest::CheckItemVisibilitiesL ), + + ENTRY( "TestOffscreenDrawing", CActivePalette2ApiTest::TestOffscreenDrawingL ), + + ENTRY( "TestKeyPrevious", CActivePalette2ApiTest::TestKeyPreviousL ), + ENTRY( "TestKeyNext", CActivePalette2ApiTest::TestKeyNextL ), + ENTRY( "TestKeySelect", CActivePalette2ApiTest::TestKeySelectL ), + + //ADD NEW ENTRY HERE + // [test cases entries] - Do not remove + + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::Log +// Get logger instance. +// ----------------------------------------------------------------------------- +// +CStifLogger* +CActivePalette2ApiTest::Log() const + { + return iLog; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::CreateUiL +// Create Container instance, add it to the view stack and ask Container +// to create the Active Palette instance. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::CreateUiL( CStifItemParser& /*aItem*/ ) + { + LOG("=> CActivePalette2ApiTest::CreateUiL"); + delete iContainer; + iContainer = NULL; + iContainer = new (ELeave) CActivePaletteContainer(); + LOG("<> CActivePalette2ApiTest::CreateUiL 1"); + iContainer->ConstructL(this); + LOG("<> CActivePalette2ApiTest::CreateUiL 2"); + CCoeEnv::Static()->AppUi()->RegisterViewL(*iContainer); + LOG("<> CActivePalette2ApiTest::CreateUiL 3"); + CCoeEnv::Static()->AppUi()->AddToViewStackL(*iContainer, iContainer); + LOG("<> CActivePalette2ApiTest::CreateUiL 4"); + CCoeEnv::Static()->AppUi()->ActivateViewL(iContainer->ViewId()); + LOG("<= CActivePalette2ApiTest::CreateUiL, status"); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::DisposeUiL +// Ask Container to dispose the Active Palette and remove the container from +// view stack. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::DisposeUiL( CStifItemParser& /*aItem*/ ) + { + LOG("=> CActivePalette2ApiTest::DisposeUiL"); + if( iContainer != NULL ) + { + CCoeEnv::Static()->AppUi()->DeregisterView(*iContainer); + CCoeEnv::Static()->AppUi()->RemoveFromViewStack(*iContainer, iContainer); + delete iContainer; + iContainer = NULL; + } + LOG("<= CActivePalette2ApiTest::DisposeUiL"); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::SetNavigationKeysL +// Set the Active Palette navigation keys. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::SetNavigationKeysL( CStifItemParser& /*aItem*/ ) + { + LOG3("=> CActivePalette2ApiTest::SetNavigationKeysL - prev[%d] next[%d] select[%d]", + KNaviPrevious, KNaviNext, KNaviSelect); + + // Cover also the TActivePalette2NavigationKeys default constructor. + TActivePalette2NavigationKeys keys; + keys = TActivePalette2NavigationKeys(KNaviPrevious,KNaviNext,KNaviSelect); + + // Set navigation keys. + iContainer->ActivePalette()->SetNavigationKeys( keys ); + + LOG("<= CActivePalette2ApiTest::SetNavigationKeysL"); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::ListPluginsL +// Ask the available plugins from Active Palette. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::ListPluginsL( CStifItemParser& /*aItem*/ ) + { + LOG("=> CActivePalette2ApiTest::ListPluginsL"); + RArray list; + CleanupClosePushL(list); + + User::LeaveIfError( iContainer->ActivePalette()->GetAvailablePlugins(list) ); + for( TInt i = 0; i < list.Count(); i++ ) + { + LOG1("<> CActivePalette2ApiTest::ListPluginsL - available plugin uid[0x%08X]", list[i].iUid ); + } + CleanupStack::PopAndDestroy(&list); + LOG("<= CActivePalette2ApiTest::ListPluginsL"); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::SetPaletteVisibilityL +// Show or hide the whole Active Palette. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::SetPaletteVisibilityL( CStifItemParser& aItem ) + { + // Define test case as + // "instance teststepname " + // where + // = "true" or "false" for whether to show or hide palette. + // = integer, defining the delay for showing or hiding in [ms] + // = "true" or "false" for whether to use animation effect + // = integer, defining the animation (if any) duration in [ms] + LOG("=> CActivePalette2ApiTest::SetPaletteVisibilityL"); + + MActivePalette2UI* ap = iContainer->ActivePalette(); + + TBool visible( false ); + TBool animate( false ); + TInt delay( 0 ); + TInt duration( 0 ); + TInt test( 0 ); + + LOG("<> CActivePalette2ApiTest::SetPaletteVisibilityL - read visibility parameter.."); + User::LeaveIfError( GetNextBooleanFromString(aItem, visible) ); + LOG("<> CActivePalette2ApiTest::SetPaletteVisibilityL - read delay parameter.."); + User::LeaveIfError( aItem.GetNextInt(delay) ); + LOG("<> CActivePalette2ApiTest::SetPaletteVisibilityL - read animation parameter.."); + User::LeaveIfError( GetNextBooleanFromString(aItem, animate) ); + LOG("<> CActivePalette2ApiTest::SetPaletteVisibilityL - read duration parameter.."); + User::LeaveIfError( aItem.GetNextInt(duration) ); + + LOG("<> CActivePalette2ApiTest::SetPaletteVisibilityL - set animation duration.."); + User::LeaveIfError( ap->SetPaletteVisibilityAnimationDuration(duration) ); + User::LeaveIfError( ap->GetPaletteVisibilityAnimationDuration(test) ); + + if( test != duration ) + { + User::Leave(KErrGeneral); + } + + LOG("<> CActivePalette2ApiTest::SetPaletteVisibilityL - set visibility.."); + User::LeaveIfError( ap->SetPaletteVisibility(visible, animate, delay) ); + + LOG("<= CActivePalette2ApiTest::SetPaletteVisibilityL"); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::MovePaletteL +// Move the Active Palette to given location. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::MovePaletteL( CStifItemParser& aItem ) + { + // Define test case as + // "instance teststepname " + // where + // = integer, defining the x coordinate for target location + // = integer, defining the y coordinate for target location + LOG("=> CActivePalette2ApiTest::MovePaletteL"); + + MActivePalette2UI* ap = iContainer->ActivePalette(); + + TInt x; + TInt y; + + LOG("<> CActivePalette2ApiTest::MovePaletteL - read x coordinate.."); + User::LeaveIfError( aItem.GetNextInt(x) ); + LOG("<> CActivePalette2ApiTest::MovePaletteL - read y coordinate.."); + User::LeaveIfError( aItem.GetNextInt(y) ); + + LOG2("<> CActivePalette2ApiTest::MovePaletteL - set location to[%d,%d]", x, y); + ap->LocateTo( TPoint(x,y) ); + iContainer->DrawNow(); + LOG("<> CActivePalette2ApiTest::MovePaletteL - check location.."); + TPoint moved = ap->Location(); + if( moved.iX != x || moved.iY != y ) + { + User::Leave(KErrGeneral); + } + + LOG("<= CActivePalette2ApiTest::MovePaletteL"); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::AddItemsL +// Add items to the Active Palette. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::AddItemsL( CStifItemParser& aItem ) + { + // Define test case as + // "instance teststepname ..." + // where + // , , ... = integers, id for an item to be added. + LOG("=> CActivePalette2ApiTest::AddItemsL"); + MActivePalette2UI* ap = iContainer->ActivePalette(); + + _LIT(KTooltipFormat, "Tooltip: %d"); + TBuf<20> buffer; + int id; + + while( aItem.GetNextInt(id) == KErrNone ) + { + LOG1("<> CActivePalette2ApiTest::AddItemsL - got id[%d]", id); + buffer.Format(KTooltipFormat, id); + + TAP2GenericPluginParams params( + TAP2GenericPluginParams::EGenericCustomResFile, + KIconFileName, // Icon file name + KIconIds[id%KIconCount], // Icon id + KMaskIds[id%KIconCount], // Mask id + buffer, // Tooltip text + id, // msg id + 0); // custom param + TPckg params_buf(params); + + const TBool visibility = true; + + TActivePalette2ItemVisible itemVisible(id, visibility); + + if( itemVisible.ItemId() != id && + itemVisible.Visible() != visibility ) + { + LOG("<> CActivePalette2ApiTest::AddItemsL - id or visibility setting failed!"); + User::Leave(KErrGeneral); + } + + LOG("<> CActivePalette2ApiTest::AddItemsL - install item.."); + ap->InstallItemL(itemVisible, + TUid::Uid(KActivePalette2GenericPluginUID), + params_buf); + + LOG("<> CActivePalette2ApiTest::AddItemsL - test sending message, for updating icon.."); + TAP2GenericPluginIcon icon(KIconIds[id%KIconCount], KMaskIds[id%KIconCount]); + TPckgC update_buf(icon); + LOG("<> CActivePalette2ApiTest::AddItemsL - send the message.."); + User::LeaveIfError( ap->SendMessage( id, EAPGenericPluginChangeIcon, update_buf) ); + } + + // This constructor is exported, although we have no use for it. + // Try this method also. + LOG("<> CActivePalette2ApiTest::AddItemsL - test TAP2GenericPluginIcon.."); + TAP2GenericPluginIcon tmp( 101, 102 ); + if( tmp.iIconId != 101 && tmp.iMaskId != 102 ) + { + LOG("<> CActivePalette2ApiTest::AddItemsL - TAP2GenericPluginIcon constructor error!"); + User::Leave( KErrGeneral); + } + + + LOG("<= CActivePalette2ApiTest::AddItemsL"); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::RemoveItemsL +// Remove given items from the Active Palette. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::RemoveItemsL( CStifItemParser& aItem ) + { + // Define test case as + // "instance teststepname ..." + // where + // , , ... = integers, id for an item to be removed. + LOG("=> CActivePalette2ApiTest::RemoveItemsL"); + MActivePalette2UI* ap = iContainer->ActivePalette(); + TInt id = 0; + while ( aItem.GetNextInt(id) == KErrNone ) + { + LOG1("<> CActivePalette2ApiTest::RemoveItemsL - removing id[%d]", id ); + User::LeaveIfError( ap->RemoveItem(id) ); + } + LOG("<= CActivePalette2ApiTest::RemoveItemsL"); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::ShowItemsL +// Show given Active Palette items. +// Items must already be added to Active Palette. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::ShowItemsL( CStifItemParser& aItem ) + { + // Define test case as + // "instance teststepname ..." + // where + // , , ... = integers, id for an item to be shown. + // + LOG("=> CActivePalette2ApiTest::ShowItemsL"); + MActivePalette2UI* ap = iContainer->ActivePalette(); + TInt id = 0; + while ( aItem.GetNextInt(id) == KErrNone ) + { + LOG1("<> CActivePalette2ApiTest::ShowItemsL - showing id[%d]", id ); + User::LeaveIfError( ap->SetItemVisibility(id, true) ); + } + LOG("<= CActivePalette2ApiTest::ShowItemsL"); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::HideItemsL +// Hide given Active Palette items. +// Items must already be added to Active Palette. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::HideItemsL( CStifItemParser& aItem ) + { + // Define test case as + // "instance teststepname ..." + // where + // , , ... = integers, id for an item to be hidden. + // + LOG("=> CActivePalette2ApiTest::HideItemsL"); + MActivePalette2UI* ap = iContainer->ActivePalette(); + TInt id = 0; + while ( aItem.GetNextInt(id) == KErrNone ) + { + LOG1("<> CActivePalette2ApiTest::HideItemsL - hiding id[%d]", id ); + User::LeaveIfError( ap->SetItemVisibility(id, false) ); + } + LOG("<= CActivePalette2ApiTest::HideItemsL"); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::SetCurrentItemL +// Set the currently focused Active Palette item. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::SetCurrentItemL( CStifItemParser& aItem ) + { + // Define test case as + // "instance teststepname " + // where + // = integer, id for an item to be set focused. + // + LOG("=> CActivePalette2ApiTest::SetCurrentItemL"); + TInt id = 0; + User::LeaveIfError( aItem.GetNextInt(id) ); + LOG1("<> CActivePalette2ApiTest::SetCurrentItemL - focusing id[%d]", id ); + User::LeaveIfError( iContainer->ActivePalette()->SetCurrentItem(id) ); + LOG("<= CActivePalette2ApiTest::SetCurrentItemL"); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::CheckCurrentItemL +// Check the currently focused Active Palette item. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::CheckCurrentItemL( CStifItemParser& aItem ) + { + // Define test case as + // "instance teststepname " + // where + // = integer, id of the item that is expected to be focused. + // + LOG("=> CActivePalette2ApiTest::CheckCurrentItemL"); + TInt expected = 0; + TInt current = 0; + + User::LeaveIfError( aItem.GetNextInt(expected) ); + LOG1("<> CActivePalette2ApiTest::CheckCurrentItemL - expecting focused id[%d]", expected ); + + User::LeaveIfError( iContainer->ActivePalette()->GetCurrentItem(current) ); + LOG1("<> CActivePalette2ApiTest::CheckCurrentItemL - actually focused id[%d]", current ); + + const TInt status = expected == current ? KErrNone : KErrGeneral; + LOG1("<= CActivePalette2ApiTest::CheckCurrentItemL - return %d", status); + return status; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::CheckItemListL +// Check the items currently contained in Active Palette. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::CheckItemListL( CStifItemParser& aItem ) + { + // Define test case as + // "instance teststepname ..." + // where + // , , ... = integers, ids of the items that, and only that, + // are expected to be contained in Active Palette. + // + LOG("=> CActivePalette2ApiTest::CheckItemListL"); + RArray expected; + CleanupClosePushL(expected); + + LOG("<> CActivePalette2ApiTest::CheckItemListL - get expected items.."); + TInt id = 0; + while ( aItem.GetNextInt(id) == KErrNone ) + { + expected.Append(id); + } + + LOG("<> CActivePalette2ApiTest::CheckItemListL - get current items.."); + RArray current; + CleanupClosePushL(current); + User::LeaveIfError( iContainer->ActivePalette()->GetItemList(current) ); + + if( current.Count() != expected.Count() ) + { + LOG2("<> CActivePalette2ApiTest::CheckItemListL - counts do not match, currently[%d] expected[%d]!", + current.Count(), expected.Count()); + User::Leave(KErrGeneral); + } + for( int i = 0; i < current.Count(); i++ ) + { + if( expected[i] != current[i].ItemId() ) + { + LOG3("<> CActivePalette2ApiTest::CheckItemListL - item at[%d] has id[%d] expected id[%d] !", + i, current[i].ItemId(), expected[i]); + User::Leave(KErrGeneral); + } + } + + LOG("<> CActivePalette2ApiTest::CheckItemListL - set current items again.."); + User::LeaveIfError( iContainer->ActivePalette()->SetItemList(current) ); + + CleanupStack::PopAndDestroy(¤t); + CleanupStack::PopAndDestroy(&expected); + + LOG("<= CActivePalette2ApiTest::CheckItemListL"); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::CheckItemVisibilitiesL +// Check the items currently visible in Active Palette. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::CheckItemVisibilitiesL( CStifItemParser& aItem ) + { + // In test case definition, use the following format + // "instance teststepname ..." + // Where + // , ... = integer, defining the id for item to be checked. + // = "true" or "false", defines the expected visibility + // of item with the id number given just before. + // + // Note: All items currently contained in Active Palette must be mentioned. + // + LOG("=> CActivePalette2ApiTest::CheckItemVisibilitiesL"); + + MActivePalette2UI* ap = iContainer->ActivePalette(); + + LOG("<> CActivePalette2ApiTest::CheckItemVisibilitiesL - get expected items.."); + TInt count = 0; + TInt id = 0; + TBool expectVisible = false; + TBool isVisible = false; + + + while( aItem.GetNextInt(id) == KErrNone ) + { + LOG1("<> CActivePalette2ApiTest::CheckItemVisibilitiesL - get expected visibility for id[%d]", id); + User::LeaveIfError( GetNextBooleanFromString(aItem, expectVisible) ); + + LOG1("<> CActivePalette2ApiTest::CheckItemVisibilitiesL - get current visibility for id[%d]", id); + User::LeaveIfError( ap->GetItemVisibility(id, isVisible) ); + if( isVisible != expectVisible ) + { + LOG("<> CActivePalette2ApiTest::CheckItemVisibilitiesL - visibilities do not match!"); + User::Leave(KErrGeneral); + } + + // Count the items so we can make sure all are checked. + count++; + } + + // Check now that all items were checked. + LOG("<> CActivePalette2ApiTest::CheckItemVisibilitiesL - get current items.."); + RArray current; + CleanupClosePushL(current); + User::LeaveIfError( iContainer->ActivePalette()->GetItemList(current) ); + if( current.Count() != count ) + { + LOG2("<> CActivePalette2ApiTest::CheckItemVisibilitiesL - counts do not match, currently[%d] expected[%d]!", + current.Count(), count); + User::Leave(KErrGeneral); + } + CleanupStack::PopAndDestroy(¤t); + + LOG("<= CActivePalette2ApiTest::CheckItemVisibilitiesL"); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::TestOffscreenDrawingL +// Test the use of offscreen buffer for Active Palette rendering. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::TestOffscreenDrawingL( CStifItemParser& /*aItem*/ ) + { + LOG("=> CActivePalette2ApiTest::TestOffscreenDrawingL"); + MActivePalette2UI* ap = iContainer->ActivePalette(); + + LOG("<> CActivePalette2ApiTest::TestOffscreenDrawingL - create bitmap.."); + CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap(); + CleanupStack::PushL( bitmap ); + User::LeaveIfError( bitmap->Create( iContainer->Size(), EColor16MU ) ); + + LOG("<> CActivePalette2ApiTest::TestOffscreenDrawingL - create device.."); + CFbsBitmapDevice* device = CFbsBitmapDevice::NewL( bitmap ); + CleanupStack::PushL( device ); + + LOG("<> CActivePalette2ApiTest::TestOffscreenDrawingL - create context.."); + CFbsBitGc* context = NULL; + User::LeaveIfError( device->CreateContext( context ) ); + CleanupStack::PushL( context ); + + LOG("<> CActivePalette2ApiTest::TestOffscreenDrawingL - test rendering.."); + ap->SetGc( context ); + ap->RenderActivePalette( TRect( TPoint(0,0), bitmap->SizeInPixels() ) ); + ap->SetGc(); + + CleanupStack::PopAndDestroy( context ); + CleanupStack::PopAndDestroy( device ); + CleanupStack::PopAndDestroy( bitmap ); + + LOG("<= CActivePalette2ApiTest::TestOffscreenDrawingL"); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::TestKeyPreviousL +// Test handling key event for moving to previous item. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::TestKeyPreviousL( CStifItemParser& /*aItem*/ ) + { + LOG("=> CActivePalette2ApiTest::TestKeyPreviousL"); + TKeyEvent event; + event.iCode = KNaviPrevious; + event.iScanCode = KNaviPrevious; + + TKeyResponse response = iContainer->OfferKeyEventL(event, EEventKey); + LOG("<= CActivePalette2ApiTest::TestKeyPreviousL"); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::TestKeyNextL +// Test handling key event for moving to next item. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::TestKeyNextL( CStifItemParser& /*aItem*/ ) + { + LOG("=> CActivePalette2ApiTest::TestKeyNextL"); + TKeyEvent event; + event.iCode = KNaviNext; + event.iScanCode = KNaviNext; + + TKeyResponse response = iContainer->OfferKeyEventL(event, EEventKey); + LOG("<= CActivePalette2ApiTest::TestKeyNextL"); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::TestKeySelectL +// Test handling key event for selecting item. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::TestKeySelectL( CStifItemParser& /*aItem*/ ) + { + LOG("=> CActivePalette2ApiTest::TestKeySelectL"); + TKeyEvent event; + event.iCode = KNaviSelect; + event.iScanCode = KNaviSelect; + event.iRepeats = 0; + + TKeyResponse response = iContainer->OfferKeyEventL(event, EEventKey); + + + LOG("<= CActivePalette2ApiTest::TestKeySelectL"); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::GetNextBooleanFromString +// Helper method for reading a string with expected values of +// "true" and "false" and converting them to a TBool value. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2ApiTest::GetNextBooleanFromString( CStifItemParser& aItem, TBool& aValue ) + { + LOG("=> CActivePalette2ApiTest::GetNextBooleanFromString"); + + TPtrC content; + TInt status = aItem.GetNextString(content); + + if( status == KErrNone ) + { + LOG("<> CActivePalette2ApiTest::GetNextBooleanFromString - about to trace string.."); + LOG1("<> CActivePalette2ApiTest::GetNextBooleanFromString - got [%S]", &content ); + if( content.Compare(KTrueString) == 0 ) + { + aValue = ETrue; + } + else if( content.Compare(KFalseString) == 0 ) + { + aValue = EFalse; + } + else + { + User::Panic(_L("Test case not valid!"), 1); + } + } + + LOG("<= CActivePalette2ApiTest::GetNextBooleanFromString"); + return status; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2ApiTest::?member_function +// ?implementation_description +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +/* +TInt CActivePalette2ApiTest::?member_function( + CItemParser& aItem ) + { + + ?code + + } +*/ + +// ========================== OTHER EXPORTED FUNCTIONS ========================= +// None + +// [End of File] - Do not remove diff -r 000000000000 -r 1ddebce53859 camera_plat/active_palette_2_api/tsrc/src/ActivePaletteContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/active_palette_2_api/tsrc/src/ActivePaletteContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,393 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CCActivePaletteContainer implementation. +* +*/ + +#include +#include +#include +//#include +//#include +//#include + + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "activepalette2apitest.h" +#include "ActivePaletteContainer.h" + + +#define LOG(text) iTest->Log()->Log(_L(text)) +#define LOG1(text, param) iTest->Log()->Log(_L(text), param) +#define LOG2(text, param1, param2) iTest->Log()->Log(_L(text), param1, param2) +#define LOG3(text, param1, param2, param3) iTest->Log()->Log(_L(text), param1, param2, param3) + +namespace + { + _LIT( KTrueString, "true" ); + _LIT( KFalseString, "false" ); + } + + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::~CActivePaletteContainer +// Destructor. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CActivePaletteContainer::~CActivePaletteContainer() + { + if( iActivePalette != NULL ) + { + iActivePalette->SetPaletteVisibility(ETrue, EFalse); + delete iActivePalette; + iActivePalette = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::ConstructL +// Second phase constructor. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::ConstructL(CActivePalette2ApiTest* aTest) + { + iTest = aTest; + + LOG("=> CActivePaletteContainer::ConstructL"); + CreateWindowL(); + + TVwsViewId viewId; + CCoeEnv::Static()->AppUi()->GetDefaultViewId(viewId); + iAppUid = viewId.iAppUid; + LOG1("<> CActivePalette2ApiTest::ConstructL: GetDefaultViewId() appuid: %d", iAppUid.iUid ); + LOG("<> CActivePaletteContainer::ConstructL 1"); + SetRect(CCoeEnv::Static()->ScreenDevice()->SizeInPixels()); + LOG("<> CActivePaletteContainer::ConstructL 2"); + CreateActivePaletteL(); + LOG("<> CActivePaletteContainer::ConstructL 3"); + ActivateL(); + LOG("<= CActivePaletteContainer::ConstructL"); + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::CountComponentControls +// From CCoeControl. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt +CActivePaletteContainer::CountComponentControls() const + { + if( iActivePalette != NULL ) + return 1; + else + return 0; + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::ComponentControl +// From CCoeControl. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +CCoeControl* +CActivePaletteContainer::ComponentControl(TInt aIndex) const + { + if( aIndex == 0 ) + return iActivePalette != NULL ? iActivePalette->CoeControl() : NULL; + else + return NULL; + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::Draw +// From CCoeControl. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::Draw(const TRect &aRect) const + { + LOG("=> CActivePaletteContainer::Draw"); + + CWindowGc& gc = SystemGc(); + gc.Reset(); + gc.SetBrushStyle(CGraphicsContext::ESolidBrush); + gc.SetBrushColor(TRgb(0xE0,0xE0,0xFF)); + gc.Clear(aRect); + + LOG("<> CActivePaletteContainer::Draw 1"); + + //iActivePalette->RenderActivePalette( TRect(iPosition,iSize) ); + + LOG("<= CActivePaletteContainer::Draw"); + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::OfferKeyEventL +// From CCoeControl. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TKeyResponse +CActivePaletteContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) + { + LOG3("=> CActivePaletteContainer::OfferKeyEventL - keycode[%d] scancode[%d] type[%d]", + aKeyEvent.iCode, aKeyEvent.iScanCode, aType); + + TKeyResponse response = EKeyWasNotConsumed; + if( iActivePalette + && iActivePalette->CoeControl() ) + { + response = iActivePalette->CoeControl()->OfferKeyEventL(aKeyEvent,aType); + LOG1("<> CActivePaletteContainer::OfferKeyEventL - Active Palette consumed ? %S", + response == EKeyWasConsumed ? &KTrueString : &KFalseString ); + } + if( EKeyWasNotConsumed == response ) + { + response = CCoeControl::OfferKeyEventL(aKeyEvent, aType); + } + + LOG("<= CActivePaletteContainer::OfferKeyEventL"); + return response; + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::SizeChanged +// From CCoeControl. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::SizeChanged() + { + LOG("=> CActivePaletteContainer::SizeChanged"); + CCoeControl::SizeChanged(); + LOG("<= CActivePaletteContainer::SizeChanged"); + } + + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::ViewId +// From MCoeView. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TVwsViewId +CActivePaletteContainer::ViewId() const + { + LOG("=> CActivePaletteContainer::ViewId"); + TVwsViewId id; + id.iAppUid = iAppUid; + id.iViewUid = TUid::Uid(1234567890); + LOG("<= CActivePaletteContainer::ViewId"); + return id; + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::ViewActivatedL +// From MCoeView. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::ViewActivatedL( + const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + LOG("=><= CActivePaletteContainer::ViewActivatedL"); + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::ViewDeactivated +// From MCoeView. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::ViewDeactivated() + { + LOG("=><= CActivePaletteContainer::ViewDeactivated"); + } + + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::NotifyItemFocused +// From MActivePalette2Observer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::NotifyItemFocused(TInt /*aPrevItem*/, TInt /*aFocusedItem*/) + { + LOG("=><= CActivePaletteContainer::NotifyItemFocused"); + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::NotifyItemSelected +// From MActivePalette2Observer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::NotifyItemSelected(const TActivePalette2EventData& aEvent) + { + LOG("=> CActivePaletteContainer::NotifyItemSelected"); + CheckActivePaletteEvent(aEvent); + LOG("<= CActivePaletteContainer::NotifyItemSelected"); + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::NotifyItemComplete +// From MActivePalette2Observer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::NotifyItemComplete(const TActivePalette2EventData& aEvent, + const TDesC8& aDataDes, + TInt aDataInt) + { + LOG ("=> CActivePaletteContainer::NotifyItemComplete"); + CheckActivePaletteEvent(aEvent); + LOG1("<> CActivePaletteContainer::NotifyItemComplete - data descr: %S", &aDataDes); + LOG1("<> CActivePaletteContainer::NotifyItemComplete - data int: %d", aDataInt); + LOG ("<= CActivePaletteContainer::NotifyItemComplete"); + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::NotifyMessage +// From MActivePalette2Observer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::NotifyMessage(const TActivePalette2EventData& aEvent, + TInt aMessageID, + const TDesC8& aDataDes, + TInt aDataInt) + { + LOG ("=> CActivePaletteContainer::NotifyMessage"); + CheckActivePaletteEvent(aEvent); + LOG1("<> CActivePaletteContainer::NotifyMessage - message id: %d", aMessageID); + LOG1("<> CActivePaletteContainer::NotifyMessage - data descr: %S", &aDataDes); + LOG1("<> CActivePaletteContainer::NotifyMessage - data int: %d", aDataInt); + LOG ("<= CActivePaletteContainer::NotifyMessage"); + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::Redraw +// From MActivePalette2Observer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::Redraw(const TRect& aArea) + { + LOG("=> CActivePaletteContainer::Redraw"); + /* + CWindowGc& gc = SystemGc(); + gc.SetBrushStyle(CGraphicsContext::ESolidBrush); + gc.SetBrushColor(TRgb(0x00,0x00,0xFF)); + gc.Clear(aArea); + */ + Draw(aArea); + LOG("<= CActivePaletteContainer::Redraw"); + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::ActivePaletteUpdated +// From MActivePalette2Observer. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::ActivePaletteUpdated(void) + { + LOG("=> CActivePaletteContainer::ActivePaletteUpdated"); + DrawDeferred(); + LOG("<= CActivePaletteContainer::ActivePaletteUpdated"); + } + + + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::CreateActivePaletteL +// Helper method for creating ActivePalette. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::CreateActivePaletteL() + { + delete iActivePalette; + iActivePalette = NULL; + + iActivePalette = ActivePalette2Factory::CreateActivePaletteUIL( EAP2DrawModeSemiTransparent ); + + iActivePalette->SetObserver( this ); + iActivePalette->CoeControl()->SetContainerWindowL( *this ); + iActivePalette->CoeControl()->SetMopParent( this ); + iActivePalette->SetPaletteVisibility(ETrue, EFalse); + TRect rect( Rect() ); + iActivePalette->LocateTo( TPoint(rect.Width()/4, rect.Height()/4) ); + } + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::ActivePalette +// Get the Active Palette instance. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +MActivePalette2UI* +CActivePaletteContainer::ActivePalette() const + { + return iActivePalette; + } + + +// ----------------------------------------------------------------------------- +// CActivePaletteContainer::CheckActivePaletteEvent +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CActivePaletteContainer::CheckActivePaletteEvent( const TActivePalette2EventData& aEvent ) + { + TInt resultCode( aEvent.Result() ); + TInt currentItem( aEvent.CurItem() ); + TInt previousItem( aEvent.PrevItem() ); + TInt servingItem( aEvent.ServingItem() ); + TUid servingPluginUid( aEvent.ServingPlugin() ); + + iTest->Log()->Log( _L("=><= CActivePaletteContainer::CheckActivePaletteEvent - got: code[%d] items[current:%d previous:%d serving:%d] plugin[%d]"), + resultCode, currentItem, previousItem, servingItem, servingPluginUid.iUid); + } + + + diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/camcorder_ui_constants_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/camcorder_ui_constants_api.metaxml Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,17 @@ + + + Camcorder UI Constants API + Constants for controlling Camcorder using CMediaSharedDocument + c++ + camerauis + + + + + + + + no + no + + diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File that exports the files belonging to +: Camcorder UI Constants API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/CcorUiConstants.h APP_LAYER_PLATFORM_EXPORT_PATH(CcorUiConstants.h) +../inc/cameraplatpskeys.h APP_LAYER_PLATFORM_EXPORT_PATH(cameraplatpskeys.h) diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/inc/CcorUiConstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/inc/CcorUiConstants.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Constants for controlling Camcorder. +* +*/ + + +#ifndef CCORUICONSTANTS_H +#define CCORUICONSTANTS_H + +// INCLUDES +#include + +// CONSTANTS +const TUid KUidCamcorder = { 0x101F857A }; +const TInt KCcorMsk = 3; +const TInt KCcorLsk = 0; + +const TInt KSilentProfile = 1; +const TInt KMeetingProfile = 2; + +/** +* Constants for use in embedding. +*/ +enum TCcorAppData + { + ECcorNormal = 0, + ECcorEmbedStartUp, // Starting embed mode + ECcorForceStillMode, // Force still image mode + ECcorForceVideoMode, // Force video mode + ECcorForceMMSVideoMode // Force video mode with MMS size limit for videos + }; + +/** +* Image/video storage constants +*/ +enum TCcorMemory + { + ECcorPhoneMemory, + ECcorMemoryCard + }; + +#endif + +// End of File + diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/inc/cameraplatpskeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/inc/cameraplatpskeys.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: P&S keys defined in Camcorder area. +* +*/ + +#ifndef CAMERAPLATPSKEYS_H +#define CAMERAPLATPSKEYS_H + +/** + * A namespace container for Camera related P&S keys. + * + * + * In a practical usecase a product has camera slider and it must configure + * cenrep value of CameraPlatPSKeys::KPSCameraPlatUid. + * + * When camera slider is opened , It must call + * + * RProperty::Set( CameraPlatPSKeys::KPSCameraPlatUid, + * CameraPlatPSKeys::KLenscoverStatus, + * ( TInt ) CcorUiPropertiesApi::EOpen ); + * + * When camera slider is closed , It must call + * + * RProperty::Set( CameraPlatPSKeys::KPSCameraPlatUid, + * CameraPlatPSKeys::KLenscoverStatus, + * ( TInt ) CcorUiPropertiesApi::EClosed ); + * + */ +namespace CameraPlatPSKeys + { + /** The category of this P&S keys. */ + const TUid KPSCameraPlatUid = { 0x101F857A }; // UID3 of Cameraapp + + /** Contains the availability state of camera resource. + * It can have one of the values of TStatus. + */ + const TUint32 KLensCoverStatus = 0x00000001; + + /** + * Indicates the status of KLenscoverStatus + * + * Possible values are: + * + * 1: Lens cover is open and camera is usable + * 2: Lens cover is closed and camera cannot be used + * + */ + enum TStatus + { + EOpen = 1, + EClosed + }; + } + +#endif // CAMERAPLATPSKEYS_H diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/tsrc/Bwins/CamAppPerfTestU.DEF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/tsrc/Bwins/CamAppPerfTestU.DEF Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + ?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * __cdecl LibEntryL(void) + ?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int __cdecl SetRequirements(class CTestModuleParam * &,unsigned long &) + diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/tsrc/EABI/CamAppPerfTestU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/tsrc/EABI/CamAppPerfTestU.def Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,4 @@ +EXPORTS + _Z9LibEntryLv @ 1 NONAME + _Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME + diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/tsrc/group/CamAppPerfTest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/tsrc/group/CamAppPerfTest.mmp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2002 - 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MMP file for CamAppPerfTest +* +*/ + + +#include + +TARGET CamAppPerfTest.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E7 + +CAPABILITY ALL -TCB + +DEFFILE CamAppPerfTest.def + +APP_LAYER_SYSTEMINCLUDE +USERINCLUDE ../inc + +SOURCEPATH ../src +SOURCE CamAppPerfTest.cpp +SOURCE CamAppPerfTestCases.cpp + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY apgrfx.lib +LIBRARY apparc.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY avkon.lib +LIBRARY commonengine.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY ws32.lib + +LANG SC + diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/tsrc/group/CamAppPerfTest.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/tsrc/group/CamAppPerfTest.pkg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,34 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: +; +; Languages +; ========= +&EN + +; Name, UID for installation, Maj.Ver., Min.Ver., Variant, FLAG TO SPECIFY UNICODE, System component +; ================================================================================================== +#{"STIFCAETEST"},(0x101FB3E7),1,0,1,TYPE=SA + + +; Localised Vendor name +%{"Nokia-EN"} + +; Unique Vendor name +:"Nokia" + +"\epoc32\release\armv5\urel\CamAppPerfTest.dll" -"$:\sys\bin\CamAppPerfTest.dll" + +; eof + diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/tsrc/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2002 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +CamAppPerfTest.mmp + +PRJ_MMPFILES + +// End of File \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/tsrc/inc/CamAppPerfTest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/tsrc/inc/CamAppPerfTest.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,327 @@ +/* +* Copyright (c) 2002 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CamAppPerfTest test module. +* +*/ + + + +#ifndef CAMAPPPERFTEST_H +#define CAMAPPPERFTEST_H + +// INCLUDES +#include "StifTestModule.h" +#include + + +// MACROS +#define TEST_MODULE_VERSION_MAJOR 0 +#define TEST_MODULE_VERSION_MINOR 0 +#define TEST_MODULE_VERSION_BUILD 0 + +// Logging path +_LIT( KCamAppPerfTestLogPath, "\\logs\\testframework\\CamAppPerfTest\\" ); +// Log file +_LIT( KCamAppPerfTestLogFile, "CamAppPerfTest.txt" ); +_LIT( KCamAppPerfTestLogFileWithTitle, "CamAppPerfTest_[%S].txt" ); + +#define GETPTR & +#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0} +#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0} +#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c} +#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c} + +// FORWARD DECLARATIONS +class CCamAppPerfTest; + +// DATA TYPES +// A typedef for function that does the actual testing, +// function is a type +// TInt CCamAppPerfTest:: ( TTestResult& aResult ) +typedef TInt (CCamAppPerfTest::* TestFunction)(TTestResult&); + +// CLASS DECLARATION + +/** +* An internal structure containing a test case name and +* the pointer to function doing the test +* +* @lib ?library +* @since ?Series60_version +*/ +class TCaseInfoInternal + { + public: + const TText* iCaseName; + TestFunction iMethod; + TBool iIsOOMTest; + TInt iFirstMemoryAllocation; + TInt iLastMemoryAllocation; + }; + +// CLASS DECLARATION + +/** +* A structure containing a test case name and +* the pointer to function doing the test +* +* @lib ?library +* @since ?Series60_version +*/ +class TCaseInfo + { + public: + TPtrC iCaseName; + TestFunction iMethod; + TBool iIsOOMTest; + TInt iFirstMemoryAllocation; + TInt iLastMemoryAllocation; + + TCaseInfo( const TText* a ) : iCaseName( (TText*) a ) + { + }; + + }; + + +// CLASS DECLARATION + +/** +* This a CamAppPerfTest class. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CCamAppPerfTest) : public CTestModuleBase + { + public: // Constructors and destructor + + + /** + * Two-phased constructor. + */ + static CCamAppPerfTest* NewL(); + + /** + * Destructor. + */ + virtual ~CCamAppPerfTest(); + + public: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + public: // Functions from base classes + + /** + * From CTestModuleBase InitL is used to initialize the + * CamAppPerfTest. It is called once for every instance of + * TestModuleCamAppPerfTest after its creation. + * @since ?Series60_version + * @param aIniFile Initialization file for the test module (optional) + * @param aFirstTime Flag is true when InitL is executed for first + * created instance of CamAppPerfTest. + * @return Symbian OS error code + */ + TInt InitL( TFileName& aIniFile, TBool aFirstTime ); + + /** + * From CTestModuleBase GetTestCasesL is used to inquiry test cases + * from CamAppPerfTest. + * @since ?Series60_version + * @param aTestCaseFile Test case file (optional) + * @param aTestCases Array of TestCases returned to test framework + * @return Symbian OS error code + */ + TInt GetTestCasesL( const TFileName& aTestCaseFile, + RPointerArray& aTestCases ); + + /** + * From CTestModuleBase RunTestCaseL is used to run an individual + * test case. + * @since ?Series60_version + * @param aCaseNumber Test case number + * @param aTestCaseFile Test case file (optional) + * @param aResult Test case result returned to test framework (PASS/FAIL) + * @return Symbian OS error code (test case execution error, which is + * not reported in aResult parameter as test case failure). + */ + TInt RunTestCaseL( const TInt aCaseNumber, + const TFileName& aTestCaseFile, + TTestResult& aResult ); + + /** + * From CTestModuleBase; OOMTestQueryL is used to specify is particular + * test case going to be executed using OOM conditions + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @param aFailureType OOM failure type (optional) + * @param aFirstMemFailure The first heap memory allocation failure value (optional) + * @param aLastMemFailure The last heap memory allocation failure value (optional) + * @return TBool + */ + virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */, + TOOMFailureType& aFailureType, + TInt& /* aFirstMemFailure */, + TInt& /* aLastMemFailure */ ); + + /** + * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM + * test environment + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @return None + */ + virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ); + + /** + * From CTestModuleBase; OOMHandleWarningL + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @param aFailNextValue FailNextValue for OOM test execution (optional) + * @return None + * + * User may add implementation for OOM test warning handling. Usually no + * implementation is required. + */ + virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */, + TInt& /* aFailNextValue */); + + /** + * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM + * test environment + * @param aTestCaseFile Test case file (optional) + * @param aCaseNumber Test case number (optional) + * @return None + * + */ + virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ); + + /** + * Method used to log version of test module + */ + void SendTestModuleVersion(); + + protected: // New functions + + /** + * ?member_description. + * @since ?Series60_version + * @param ?arg1 ?description + * @return ?description + */ + //?type ?member_function( ?type ?arg1 ); + + protected: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + //?type ?member_function(); + + private: + + /** + * C++ default constructor. + */ + CCamAppPerfTest(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Function returning test case name and pointer to test case function. + * @since ?Series60_version + * @param aCaseNumber test case number + * @return TCaseInfo + */ + const TCaseInfo Case ( const TInt aCaseNumber ) const; + + /** + * [test case declarations] - do not remove + */ + //ADD NEW METHOD DEC HERE" + + /** + * Camera App Performance Test + * @since ?Series60_version + * @param aResult Test case result (PASS/FAIL) + * @return Symbian OS error code (test case execution error + * that is not returned as test case result in aResult) + */ + TInt PerfTest( TTestResult& aResult ); + void StartWaiting( TInt period ); + void KillIfAlive(); + void SendCaptureKeyEventToCamApp(); + void SendExitKeyEventToCamApp(); + + /** + * Printing test case. + * @since ?Series60_version + * @param aResult Test case result (PASS/FAIL) + * @return Symbian OS error code (test case execution error + * that is not returned as test case result in aResult) + */ + TInt PrintTest( TTestResult& aResult ); + + /** + * Printing loop test case. + * @since ?Series60_version + * @param aResult Test case result (PASS/FAIL) + * @return Symbian OS error code (test case execution error + * that is not returned as test case result in aResult) + */ + TInt LoopTest( TTestResult& aResult ); + + private: // Data + // Pointer to test (function) to be executed + TestFunction iMethod; + + // Pointer to logger + CStifLogger * iLog; + + // Normal logger + CStifLogger* iStdLog; + + // Test case logger + CStifLogger* iTCLog; + + // Flag saying if test case title should be added to log file name + TBool iAddTestCaseTitleToLogName; + + // Flag saying if version of test module was already sent + TBool iVersionLogged; + }; + +#endif // CAMAPPPERFTEST_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/tsrc/src/CamAppPerfTest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/tsrc/src/CamAppPerfTest.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,358 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CamAppPerfTest class member functions +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include "CamAppPerfTest.h" +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::CCamAppPerfTest +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamAppPerfTest::CCamAppPerfTest() + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::ConstructL +// Symbian 2nd phase constructor can leave. +// +// Note: If OOM test case uses STIF Logger, then STIF Logger must be created +// with static buffer size parameter (aStaticBufferSize). Otherwise Logger +// allocates memory from heap and therefore causes error situations with OOM +// testing. For more information about STIF Logger construction, see STIF Users +// Guide. +// ----------------------------------------------------------------------------- +// +void CCamAppPerfTest::ConstructL() + { + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + iAddTestCaseTitleToLogName = loggerSettings.iAddTestCaseTitle; + + iStdLog = CStifLogger::NewL( KCamAppPerfTestLogPath, + KCamAppPerfTestLogFile); + iLog = iStdLog; + + // Sample how to use logging + _LIT( KLogStart, "CamAppPerfTest logging starts!" ); + iLog->Log( KLogStart ); + + iVersionLogged = EFalse; + } + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamAppPerfTest* CCamAppPerfTest::NewL() + { + CCamAppPerfTest* self = new (ELeave) CCamAppPerfTest; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + + } + +// Destructor +CCamAppPerfTest::~CCamAppPerfTest() + { + iLog = NULL; + delete iStdLog; + iStdLog = NULL; + delete iTCLog; + iTCLog = NULL; + } + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::InitL +// InitL is used to initialize the Test Module. +// ----------------------------------------------------------------------------- +// +TInt CCamAppPerfTest::InitL( + TFileName& /*aIniFile*/, + TBool /*aFirstTime*/ ) + { + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::GetTestCasesL +// GetTestCases is used to inquire test cases from the Test Module. Test +// cases are stored to array of test cases. The Test Framework will be +// the owner of the data in the RPointerArray after GetTestCases return +// and it does the memory deallocation. +// ----------------------------------------------------------------------------- +// +TInt CCamAppPerfTest::GetTestCasesL( + const TFileName& /*aConfig*/, + RPointerArray& aTestCases ) + { + + // Loop through all test cases and create new + // TTestCaseInfo items and append items to aTestCase array + for( TInt i = 0; Case(i).iMethod != NULL; i++ ) + { + + // Allocate new TTestCaseInfo from heap for a testcase definition. + TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo(); + + // PushL TTestCaseInfo to CleanupStack. + CleanupStack::PushL( newCase ); + + // Set number for the testcase. + // When the testcase is run, this comes as a parameter to RunTestCaseL. + newCase->iCaseNumber = i; + + // Set title for the test case. This is shown in UI to user. + newCase->iTitle.Copy( Case(i).iCaseName ); + + // Append TTestCaseInfo to the testcase array. After appended + // successfully the TTestCaseInfo object is owned (and freed) + // by the TestServer. + User::LeaveIfError(aTestCases.Append ( newCase ) ); + + // Pop TTestCaseInfo from the CleanupStack. + CleanupStack::Pop( newCase ); + + } + + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::RunTestCaseL +// RunTestCaseL is used to run an individual test case specified +// by aTestCase. Test cases that can be run may be requested from +// Test Module by GetTestCases method before calling RunTestCase. +// ----------------------------------------------------------------------------- +// +TInt CCamAppPerfTest::RunTestCaseL( + const TInt aCaseNumber, + const TFileName& /*aConfig*/, + TTestResult& aResult ) + { + if(!iVersionLogged) + { + SendTestModuleVersion(); + iVersionLogged = ETrue; + } + + // Return value + TInt execStatus = KErrNone; + + // Get the pointer to test case function + TCaseInfo tmp = Case ( aCaseNumber ); + + _LIT( KLogStartTC, "Starting testcase [%S]" ); + iLog->Log( KLogStartTC, &tmp.iCaseName); + + // Check that case number was valid + if ( tmp.iMethod != NULL ) + { + //Open new log file with test case title in file name + if(iAddTestCaseTitleToLogName) + { + //Delete test case logger if exists + if(iTCLog) + { + delete iTCLog; + iTCLog = NULL; + } + + TFileName logFileName; + TName title; + TestModuleIf().GetTestCaseTitleL(title); + + logFileName.Format(KCamAppPerfTestLogFileWithTitle, &title); + + iTCLog = CStifLogger::NewL(KCamAppPerfTestLogPath, + logFileName); + iLog = iTCLog; + } + + // Valid case was found, call it via function pointer + iMethod = tmp.iMethod; + //execStatus = ( this->*iMethod )( aResult ); + TRAPD(err, execStatus = ( this->*iMethod )( aResult )); + if(iAddTestCaseTitleToLogName) + { + //Restore standard log and destroy test case logger + iLog = iStdLog; + delete iTCLog; //Close test case log + iTCLog = NULL; + } + User::LeaveIfError(err); + } + else + { + // Valid case was not found, return error. + execStatus = KErrNotFound; + } + + // Return case execution status (not the result of the case execution) + return execStatus; + + } + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::OOMTestQueryL +// Used to check if a particular test case should be run in OOM conditions and +// which memory allocations should fail. +// ----------------------------------------------------------------------------- +// +TBool CCamAppPerfTest::OOMTestQueryL( + const TFileName& /* aTestCaseFile */, + const TInt aCaseNumber, + TOOMFailureType& /* aFailureType */, + TInt& aFirstMemFailure, + TInt& aLastMemFailure ) + { + _LIT( KLogOOMTestQueryL, "CCamAppPerfTest::OOMTestQueryL" ); + iLog->Log( KLogOOMTestQueryL ); + + aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation; + aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation; + + return Case( aCaseNumber ).iIsOOMTest; + + } + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::OOMTestInitializeL +// Used to perform the test environment setup for a particular OOM test case. +// Test Modules may use the initialization file to read parameters for Test +// Module initialization but they can also have their own configure file or +// some other routine to initialize themselves. +// +// NOTE: User may add implementation for OOM test environment initialization. +// Usually no implementation is required. +// ----------------------------------------------------------------------------- +// +void CCamAppPerfTest::OOMTestInitializeL( + const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ) + { + } + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::OOMHandleWarningL +// In some cases the heap memory allocation should be skipped, either due to +// problems in the OS code or components used by the code being tested, or even +// inside the tested components which are implemented this way on purpose (by +// design), so it is important to give the tester a way to bypass allocation +// failures. +// +// NOTE: User may add implementation for OOM test warning handling. Usually no +// implementation is required. +// ----------------------------------------------------------------------------- +// +void CCamAppPerfTest::OOMHandleWarningL( + const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */, + TInt& /* aFailNextValue */ ) + { + } + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::OOMTestFinalizeL +// Used to perform the test environment cleanup for a particular OOM test case. +// +// NOTE: User may add implementation for OOM test environment finalization. +// Usually no implementation is required. +// ----------------------------------------------------------------------------- +// +void CCamAppPerfTest::OOMTestFinalizeL( + const TFileName& /* aTestCaseFile */, + const TInt /* aCaseNumber */ ) + { + } + +//----------------------------------------------------------------------------- +// CCamAppPerfTest::SendTestModuleVersion +// Method used to send version of test module +//----------------------------------------------------------------------------- +// +void CCamAppPerfTest::SendTestModuleVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR; + moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR; + moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("CamAppPerfTest.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point +// Returns: CTestModuleBase*: Pointer to Test Module object +// ----------------------------------------------------------------------------- +// +EXPORT_C CTestModuleBase* LibEntryL() + { + return CCamAppPerfTest::NewL(); + + } + +// ----------------------------------------------------------------------------- +// SetRequirements handles test module parameters(implements evolution +// version 1 for test module's heap and stack sizes configuring). +// Returns: TInt: Symbian error code. +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, + TUint32& /*aParameterValid*/ ) + { + return KErrNone; + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camera_plat/camcorder_ui_constants_api/tsrc/src/CamAppPerfTestCases.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/camcorder_ui_constants_api/tsrc/src/CamAppPerfTestCases.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,477 @@ +/* +* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CamAppPerfTest test cases +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include +#include +#include // for UI components + +#include "CamAppPerfTest.h" + +#define EProductKeyCapture EStdKeyDevice7 + + +// CONSTANTS +_LIT( KCamAppName, "Z:\\sys\\bin\\cameraapp.exe" ); + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::Case +// Returns a test case by number. +// +// This function contains an array of all available test cases +// i.e pair of case name and test function. If case specified by parameter +// aCaseNumber is found from array, then that item is returned. +// +// The reason for this rather complicated function is to specify all the +// test cases only in one place. It is not necessary to understand how +// function pointers to class member functions works when adding new test +// cases. See function body for instructions how to add new test case. +// ----------------------------------------------------------------------------- +// +const TCaseInfo CCamAppPerfTest::Case ( + const TInt aCaseNumber ) const + { + + /** + * To add new test cases, implement new test case function and add new + * line to KCases array specify the name of the case and the function + * doing the test case + * In practice, do following + * 1) Make copy of existing test case function and change its name + * and functionality. Note that the function must be added to + * CamAppPerfTest.cpp file and to CamAppPerfTest.h + * header file. + * + * 2) Add entry to following KCases array either by using: + * + * 2.1: FUNCENTRY or ENTRY macro + * ENTRY macro takes two parameters: test case name and test case + * function name. + * + * FUNCENTRY macro takes only test case function name as a parameter and + * uses that as a test case name and test case function name. + * + * Or + * + * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used + * only with OOM (Out-Of-Memory) testing! + * + * OOM_ENTRY macro takes five parameters: test case name, test case + * function name, TBool which specifies is method supposed to be run using + * OOM conditions, TInt value for first heap memory allocation failure and + * TInt value for last heap memory allocation failure. + * + * OOM_FUNCENTRY macro takes test case function name as a parameter and uses + * that as a test case name, TBool which specifies is method supposed to be + * run using OOM conditions, TInt value for first heap memory allocation + * failure and TInt value for last heap memory allocation failure. + */ + + static TCaseInfoInternal const KCases[] = + { + // [test cases entries] - do not remove + + // NOTE: When compiled to GCCE, there must be Classname:: + // declaration in front of the method name, e.g. + // CCamAppPerfTest::PrintTest. Otherwise the compiler + // gives errors. + + FUNCENTRY( CCamAppPerfTest::PerfTest ) + + //FUNCENTRY( CCamAppPerfTest::PrintTest ) + //ENTRY( "Loop testzzz", CCamAppPerfTest::LoopTest ), + // Example how to use OOM functionality + //OOM_ENTRY( "Loop test with OOM", CCamAppPerfTest::LoopTest, ETrue, 2, 3), + //OOM_FUNCENTRY( CCamAppPerfTest::PrintTest, ETrue, 1, 3 ), + }; + + // Verify that case number is valid + if( (TUint) aCaseNumber >= sizeof( KCases ) / + sizeof( TCaseInfoInternal ) ) + { + // Invalid case, construct empty object + TCaseInfo null( (const TText*) L"" ); + null.iMethod = NULL; + null.iIsOOMTest = EFalse; + null.iFirstMemoryAllocation = 0; + null.iLastMemoryAllocation = 0; + return null; + } + + // Construct TCaseInfo object and return it + TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName ); + tmp.iMethod = KCases[ aCaseNumber ].iMethod; + tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest; + tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation; + tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation; + return tmp; + + } + + +////////////////////////////WORKSPACE START///////////////////////////////////// + + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::PerfTest +// CameraApp Performance Test. +// ----------------------------------------------------------------------------- +// +TInt CCamAppPerfTest::PerfTest( + TTestResult& aResult ) + { + // The purpose of this performance test is just to launch the cameraapp and get + // the related RD_SYMBIAN_TRACES. This test should never fail. + + /* Simple print test */ + _LIT( KPerfTest, "PerfTest" ); + _LIT( KEnter, "Enter" ); + _LIT( KOnGoing, "On-going" ); + _LIT( KExit, "Exit" ); + + TestModuleIf().Printf( 0, KPerfTest, KEnter ); + TestModuleIf().Printf( 1, KPerfTest, KOnGoing ); + + //////////////////////////////////////////////////////////////////////// + + // Start test + RDebug::Print( _L( "[cam launcher] in" ) ); + + + RDebug::Print( _L( "[cam launcher] ECPCloseCheck" )); + // make sure camera app is closed + KillIfAlive(); + // announce that we are sure camera is closed, + // and now we can start testing + StartWaiting( 5000000 ); // 5 seconds + + + RDebug::Print( _L( "[cam launcher] ECPTestStart" )); + // launch first instance of camera app + RProcess process; + process.Create(_L("cameraapp.exe"), _L("PerformanceTest")); + RDebug::Print( _L( "[cam launcher] resuming" ) ); + process.Resume(); + RDebug::Print( _L( "[cam launcher] resumed" ) ); + // announce that we are waiting for the first startup to finish + StartWaiting( 15000000 ); // 15 seconds + + + RDebug::Print( _L( "[cam launcher] ECPTestWaitFirstStartupFinished" )); + // fake the capture key event + SendCaptureKeyEventToCamApp(); + // announce that we are waiting for the first capture to finish + StartWaiting( 10000000 ); // 10 seconds + + + RDebug::Print( _L( "[cam launcher] ECPTestWaitFirstCaptureFinished" )); + // fake the red end key event + SendExitKeyEventToCamApp(); + // announce that we are waiting for the first close to finish + StartWaiting( 15000000 ); // 15 seconds + + + RDebug::Print( _L( "[cam launcher] ECPTestSecondStartup" )); + // launch second instance of camera app + RProcess process2; + process2.Create(_L("cameraapp.exe"), _L("CameraPerformanceTest")); + RDebug::Print( _L( "[cam launcher] resuming" ) ); + process2.Resume(); + RDebug::Print( _L( "[cam launcher] resumed" ) ); + // announce that we are waiting for the second startup to finish + StartWaiting( 15000000 ); // 15 seconds + + + RDebug::Print( _L( "[cam launcher] ECPTestWaitSecondStartupFinished" )); + // fake the capture key event + SendCaptureKeyEventToCamApp(); + // announce that we are waiting for the second capture to finish + StartWaiting( 10000000 ); // 10 seconds + + + RDebug::Print( _L( "[cam launcher] ECPTestWaitFirstCaptureFinished" )); + // fake the red end key event + SendExitKeyEventToCamApp(); + // announce that we are waiting for the second close to finish + StartWaiting( 15000000 ); // 15 seconds + + + // Test done + RDebug::Print( _L( "[cam launcher] close process" ) ); + process.Close(); + RDebug::Print( _L( "[cam launcher] close process2" ) ); + process2.Close(); + RDebug::Print( _L( "[cam launcher] out" ) ); + + + //////////////////////////////////////////////////////////////////////// + + TestModuleIf().Printf( 0, KPerfTest, KExit ); + + RDebug::Print( _L( "[cam launcher] final" ) ); + + // Test case passed + // This test should never fail. + + // Sets test case result and description(Maximum size is KStifMaxResultDes) + _LIT( KDescription, "PerfTest passed" ); + aResult.SetResult( KErrNone, KDescription ); + + // Case was executed + return KErrNone; + + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCamAppPerfTest::StartWaiting( TInt period ) + { + RDebug::Print( _L( "[cam launcher]::StartWaiting in" ) ); + User::After( period ); + RDebug::Print( _L( "[cam launcher]::StartWaiting out" ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCamAppPerfTest::KillIfAlive() + { + RDebug::Print( _L( "[cam launcher]::KillIfAlive in" ) ); + + RApaLsSession RSession; + TInt AAppCount = 0;//get the number of applications + RSession.Connect(); + RSession.AppCount(AAppCount);//number of tasks + RSession.GetAllApps();//get all the tasks in the RApaLsSession obj + + RDebug::Print( _L( "[cam launcher]::KillIfAlive test-> KCamAppName=%S" ), + &KCamAppName ); + + + if(AAppCount > 0) + { + RDebug::Print( _L( "[cam launcher]::KillIfAlive there are apps, count=%d" ),AAppCount ); + //if the task is present get info about it in AppInfo + TApaAppInfo AppInfo; + + RDebug::Print( _L( "[cam launcher]::KillIfAlive making CCoeEnv" ) ); + CCoeEnv* coeEnv = new (ELeave) CCoeEnv(); + RDebug::Print( _L( "[cam launcher]::KillIfAlive made CCoeEnv" ) ); + + TRAPD(coeEnvErr, + { + RDebug::Print( _L( "[cam launcher]::KillIfAlive constructing CCoeEnv" ) ); + coeEnv->ConstructL(); + RDebug::Print( _L( "[cam launcher]::KillIfAlive getting WsSession from CCoeEnv" ) ); + TApaTaskList aList(coeEnv->WsSession()); + RDebug::Print( _L( "[cam launcher]::KillIfAlive got WsSession from CCoeEnv" ) ); + + for(TInt i=0;iDestroyEnvironment(); + RDebug::Print( _L( "[cam launcher]::KillIfAlive coeEnv destroyed" ) ); + + } // if + + RSession.Close(); + + RDebug::Print( _L( "[cam launcher]::KillIfAlive out" ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCamAppPerfTest::SendCaptureKeyEventToCamApp() + { + RDebug::Print( _L( "[cam launcher]::SendCaptureKeyEventToCamApp in" ) ); + + TKeyEvent keyEvent; + keyEvent.iCode = 0; + keyEvent.iScanCode = EProductKeyCapture; + keyEvent.iModifiers = 0; + keyEvent.iRepeats = 0; + TWsEvent wsEvent; + *(wsEvent.Key()) = keyEvent; + wsEvent.SetType(EEventKeyDown); + wsEvent.SetTimeNow(); + + RDebug::Print( _L( "[cam launcher]::SendCaptureKeyEventToCamApp making CCoeEnv" ) ); + CCoeEnv* coeEnv = new (ELeave) CCoeEnv(); + RDebug::Print( _L( "[cam launcher]::SendCaptureKeyEventToCamApp made CCoeEnv" ) ); + + TRAPD(coeEnvErr, + { + RDebug::Print( _L( "[cam launcher]::SendCaptureKeyEventToCamApp constructing CCoeEnv" ) ); + coeEnv->ConstructL(); + RDebug::Print( _L( "[cam launcher]::SendCaptureKeyEventToCamApp getting WsSession from CCoeEnv" ) ); + coeEnv->WsSession().SendEventToWindowGroup(coeEnv->WsSession().GetFocusWindowGroup(), wsEvent); + RDebug::Print( _L( "[cam launcher]::SendCaptureKeyEventToCamApp got WsSession from CCoeEnv" ) ); + }); // TRAPD + + RDebug::Print( _L( "[cam launcher]::SendCaptureKeyEventToCamApp coeEnvErr=%d" ),coeEnvErr ); + coeEnv->DestroyEnvironment(); + RDebug::Print( _L( "[cam launcher]::SendCaptureKeyEventToCamApp coeEnv destroyed" ) ); + + RDebug::Print( _L( "[cam launcher]::SendCaptureKeyEventToCamApp out" ) ); + } + + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCamAppPerfTest::SendExitKeyEventToCamApp() + { + RDebug::Print( _L( "[cam launcher]::SendExitKeyEventToCamApp in" ) ); + + TKeyEvent keyEvent; + keyEvent.iCode = 0; + keyEvent.iScanCode = EStdKeyNo; + keyEvent.iModifiers = 0; + keyEvent.iRepeats = 0; + TWsEvent wsEvent; + *(wsEvent.Key()) = keyEvent; + wsEvent.SetType(EEventKeyDown); + wsEvent.SetTimeNow(); + + RDebug::Print( _L( "[cam launcher]::SendExitKeyEventToCamApp making CCoeEnv" ) ); + CCoeEnv* coeEnv = new (ELeave) CCoeEnv(); + RDebug::Print( _L( "[cam launcher]::SendExitKeyEventToCamApp made CCoeEnv" ) ); + + TRAPD(coeEnvErr, + { + RDebug::Print( _L( "[cam launcher]::SendExitKeyEventToCamApp constructing CCoeEnv" ) ); + coeEnv->ConstructL(); + RDebug::Print( _L( "[cam launcher]::SendExitKeyEventToCamApp getting WsSession from CCoeEnv" ) ); + coeEnv->WsSession().SendEventToWindowGroup(coeEnv->WsSession().GetFocusWindowGroup(), wsEvent); + RDebug::Print( _L( "[cam launcher]::SendExitKeyEventToCamApp got WsSession from CCoeEnv" ) ); + }); // TRAPD + + RDebug::Print( _L( "[cam launcher]::SendExitKeyEventToCamApp coeEnvErr=%d" ),coeEnvErr ); + coeEnv->DestroyEnvironment(); + RDebug::Print( _L( "[cam launcher]::SendExitKeyEventToCamApp coeEnv destroyed" ) ); + + RDebug::Print( _L( "[cam launcher]::SendExitKeyEventToCamApp out" ) ); + } + + +////////////////////////////WORKSPACE END/////////////////////////////////////// + + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::PrintTest +// Simple printing to UI test. +// ----------------------------------------------------------------------------- +// +TInt CCamAppPerfTest::PrintTest( + TTestResult& aResult ) + { + /* Simple print test */ + _LIT( KPrintTest, "PrintTest" ); + _LIT( KEnter, "Enter" ); + _LIT( KOnGoing, "On-going" ); + _LIT( KExit, "Exit" ); + + TestModuleIf().Printf( 0, KPrintTest, KEnter ); + + TestModuleIf().Printf( 1, KPrintTest, KOnGoing ); + + TestModuleIf().Printf( 0, KPrintTest, KExit ); + + // Test case passed + + // Sets test case result and description(Maximum size is KStifMaxResultDes) + _LIT( KDescription, "PrintTest passed" ); + aResult.SetResult( KErrNone, KDescription ); + + // Case was executed + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// CCamAppPerfTest::LoopTest +// Another printing to UI test. +// ----------------------------------------------------------------------------- +// +TInt CCamAppPerfTest::LoopTest( TTestResult& aResult ) + { + + /* Simple print and wait loop */ + _LIT( KState, "State" ); + _LIT( KLooping, "Looping" ); + + TestModuleIf().Printf( 0, KState, KLooping ); + + _LIT( KRunning, "Running" ); + _LIT( KLoop, "%d" ); + for( TInt i=0; i<10; i++) + { + TestModuleIf().Printf( 1, KRunning, KLoop, i); + User::After( 1000000 ); + } + + _LIT( KFinished, "Finished" ); + TestModuleIf().Printf( 0, KState, KFinished ); + + // Test case passed + + // Sets test case result and description(Maximum size is KStifMaxResultDes) + _LIT( KDescription, "LoopTest passed" ); + aResult.SetResult( KErrNone, KDescription ); + + // Case was executed + return KErrNone; + + } + +// [End of File] - do not remove diff -r 000000000000 -r 1ddebce53859 camera_plat/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camera_plat/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Includes all the platform API specific bld.inf files, which +* export files. +* +*/ + + + +#include "../camcorder_ui_constants_api/group/bld.inf" +#include "../active_palette_2_api/group/bld.inf" diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/BWINS/ActivePalette2U.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/BWINS/ActivePalette2U.def Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,28 @@ +EXPORTS + ??0CActivePalettePluginBase@@IAE@ABVTPluginCreationParams@NActivePalettePluginFactory@@@Z @ 1 NONAME ; CActivePalettePluginBase::CActivePalettePluginBase(class NActivePalettePluginFactory::TPluginCreationParams const &) + ??0TAP2GenericPluginIcon@@QAE@HH@Z @ 2 NONAME ; TAP2GenericPluginIcon::TAP2GenericPluginIcon(int, int) + ??0TAP2GenericPluginParams@@QAE@HABVTDesC16@@HH0HH@Z @ 3 NONAME ; TAP2GenericPluginParams::TAP2GenericPluginParams(int, class TDesC16 const &, int, int, class TDesC16 const &, int, int) + ??0TActivePalette2ItemVisible@@QAE@HH@Z @ 4 NONAME ; TActivePalette2ItemVisible::TActivePalette2ItemVisible(int, int) + ??0TActivePalette2NavigationKeys@@QAE@HHH@Z @ 5 NONAME ; TActivePalette2NavigationKeys::TActivePalette2NavigationKeys(int, int, int) + ??0TActivePalette2NavigationKeys@@QAE@XZ @ 6 NONAME ; TActivePalette2NavigationKeys::TActivePalette2NavigationKeys(void) + ??0TPluginCreationParams@NActivePalettePluginFactory@@QAE@AAVMActivePalettePluginObserver@@ABVTSize@@@Z @ 7 NONAME ; NActivePalettePluginFactory::TPluginCreationParams::TPluginCreationParams(class MActivePalettePluginObserver &, class TSize const &) + ??1CActivePalettePluginBase@@UAE@XZ @ 8 NONAME ; CActivePalettePluginBase::~CActivePalettePluginBase(void) + ?ConstructL@CActivePalettePluginBase@@UAEXABVTPluginCreationParams@NActivePalettePluginFactory@@ABVTDesC8@@H@Z @ 9 NONAME ; void CActivePalettePluginBase::ConstructL(class NActivePalettePluginFactory::TPluginCreationParams const &, class TDesC8 const &, int) + ?CreateActivePaletteUIL@ActivePalette2Factory@@SAPAVMActivePalette2UI@@W4TActivePalette2DrawMode@@@Z @ 10 NONAME ; class MActivePalette2UI * ActivePalette2Factory::CreateActivePaletteUIL(enum TActivePalette2DrawMode) + ?CreateHUIActivePaletteUIL@ActivePalette2Factory@@SAPAVMActivePalette2UI@@AAVCHuiEnv@@@Z @ 11 NONAME ; class MActivePalette2UI * ActivePalette2Factory::CreateHUIActivePaletteUIL(class CHuiEnv &) + ?CurItem@TActivePalette2EventData@@QBEHXZ @ 12 NONAME ; int TActivePalette2EventData::CurItem(void) const + ?Dimensions@TPluginCreationParams@NActivePalettePluginFactory@@QBE?AVTSize@@XZ @ 13 NONAME ; class TSize NActivePalettePluginFactory::TPluginCreationParams::Dimensions(void) const + ?HandleMessageL@CActivePalettePluginBase@@UAEXHABVTDesC8@@H@Z @ 14 NONAME ; void CActivePalettePluginBase::HandleMessageL(int, class TDesC8 const &, int) + ?ItemId@TActivePalette2ItemVisible@@QBEHXZ @ 15 NONAME ; int TActivePalette2ItemVisible::ItemId(void) const + ?PluginObserver@TPluginCreationParams@NActivePalettePluginFactory@@QBEAAVMActivePalettePluginObserver@@XZ @ 16 NONAME ; class MActivePalettePluginObserver & NActivePalettePluginFactory::TPluginCreationParams::PluginObserver(void) const + ?PrepareAniFramesL@CActivePalettePluginBase@@UAEXHAAVTPluginAnimationInfo@1@ABV21@ABVCFbsBitmap@@PBV3@@Z @ 17 NONAME ; void CActivePalettePluginBase::PrepareAniFramesL(int, class CActivePalettePluginBase::TPluginAnimationInfo &, class CActivePalettePluginBase::TPluginAnimationInfo const &, class CFbsBitmap const &, class CFbsBitmap const *) + ?PrevItem@TActivePalette2EventData@@QBEHXZ @ 18 NONAME ; int TActivePalette2EventData::PrevItem(void) const + ?ProduceAniFrame@CActivePalettePluginBase@@UAEXHHABVTPluginAnimationInfo@1@ABVCFbsBitmap@@PBV3@PAPAV3@3AAH4@Z @ 19 NONAME ; void CActivePalettePluginBase::ProduceAniFrame(int, int, class CActivePalettePluginBase::TPluginAnimationInfo const &, class CFbsBitmap const &, class CFbsBitmap const *, class CFbsBitmap * *, class CFbsBitmap * *, int &, int &) + ?ReleaseAniFrames@CActivePalettePluginBase@@UAEXH@Z @ 20 NONAME ; void CActivePalettePluginBase::ReleaseAniFrames(int) + ?Result@TActivePalette2EventData@@QBEHXZ @ 21 NONAME ; int TActivePalette2EventData::Result(void) const + ?ServingItem@TActivePalette2EventData@@QBEHXZ @ 22 NONAME ; int TActivePalette2EventData::ServingItem(void) const + ?ServingPlugin@TActivePalette2EventData@@QBE?AVTUid@@XZ @ 23 NONAME ; class TUid TActivePalette2EventData::ServingPlugin(void) const + ?Shutdown@CActivePalettePluginBase@@UAEXXZ @ 24 NONAME ; void CActivePalettePluginBase::Shutdown(void) + ?Visible@TActivePalette2ItemVisible@@QBEHXZ @ 25 NONAME ; int TActivePalette2ItemVisible::Visible(void) const + ?CreateGuiActivePaletteUIL@ActivePalette2Factory@@SAPAVMActivePalette2UI@@PAVMGui@@@Z @ 26 NONAME ; class MActivePalette2UI * ActivePalette2Factory::CreateGuiActivePaletteUIL(class MGui *) + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/BWINS/ActivePalette2_2d_3dU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/BWINS/ActivePalette2_2d_3dU.def Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,28 @@ +EXPORTS + ??0CActivePalettePluginBase@@IAE@ABVTPluginCreationParams@NActivePalettePluginFactory@@@Z @ 1 NONAME ; CActivePalettePluginBase::CActivePalettePluginBase(class NActivePalettePluginFactory::TPluginCreationParams const &) + ??0TAP2GenericPluginIcon@@QAE@HH@Z @ 2 NONAME ; TAP2GenericPluginIcon::TAP2GenericPluginIcon(int, int) + ??0TAP2GenericPluginParams@@QAE@HABVTDesC16@@HH0HH@Z @ 3 NONAME ; TAP2GenericPluginParams::TAP2GenericPluginParams(int, class TDesC16 const &, int, int, class TDesC16 const &, int, int) + ??0TActivePalette2ItemVisible@@QAE@HH@Z @ 4 NONAME ; TActivePalette2ItemVisible::TActivePalette2ItemVisible(int, int) + ??0TActivePalette2NavigationKeys@@QAE@HHH@Z @ 5 NONAME ; TActivePalette2NavigationKeys::TActivePalette2NavigationKeys(int, int, int) + ??0TActivePalette2NavigationKeys@@QAE@XZ @ 6 NONAME ; TActivePalette2NavigationKeys::TActivePalette2NavigationKeys(void) + ??0TPluginCreationParams@NActivePalettePluginFactory@@QAE@AAVMActivePalettePluginObserver@@ABVTSize@@@Z @ 7 NONAME ; NActivePalettePluginFactory::TPluginCreationParams::TPluginCreationParams(class MActivePalettePluginObserver &, class TSize const &) + ??1CActivePalettePluginBase@@UAE@XZ @ 8 NONAME ; CActivePalettePluginBase::~CActivePalettePluginBase(void) + ?ConstructL@CActivePalettePluginBase@@UAEXABVTPluginCreationParams@NActivePalettePluginFactory@@ABVTDesC8@@H@Z @ 9 NONAME ; void CActivePalettePluginBase::ConstructL(class NActivePalettePluginFactory::TPluginCreationParams const &, class TDesC8 const &, int) + ?CreateActivePaletteUIL@ActivePalette2Factory@@SAPAVMActivePalette2UI@@W4TActivePalette2DrawMode@@@Z @ 10 NONAME ; class MActivePalette2UI * ActivePalette2Factory::CreateActivePaletteUIL(enum TActivePalette2DrawMode) + ?CreateHUIActivePaletteUIL@ActivePalette2Factory@@SAPAVMActivePalette2UI@@AAVCHuiEnv@@@Z @ 11 NONAME ; class MActivePalette2UI * ActivePalette2Factory::CreateHUIActivePaletteUIL(class CHuiEnv &) + ?CurItem@TActivePalette2EventData@@QBEHXZ @ 12 NONAME ; int TActivePalette2EventData::CurItem(void) const + ?Dimensions@TPluginCreationParams@NActivePalettePluginFactory@@QBE?AVTSize@@XZ @ 13 NONAME ; class TSize NActivePalettePluginFactory::TPluginCreationParams::Dimensions(void) const + ?HandleMessageL@CActivePalettePluginBase@@UAEXHABVTDesC8@@H@Z @ 14 NONAME ; void CActivePalettePluginBase::HandleMessageL(int, class TDesC8 const &, int) + ?ItemId@TActivePalette2ItemVisible@@QBEHXZ @ 15 NONAME ; int TActivePalette2ItemVisible::ItemId(void) const + ?PluginObserver@TPluginCreationParams@NActivePalettePluginFactory@@QBEAAVMActivePalettePluginObserver@@XZ @ 16 NONAME ; class MActivePalettePluginObserver & NActivePalettePluginFactory::TPluginCreationParams::PluginObserver(void) const + ?PrepareAniFramesL@CActivePalettePluginBase@@UAEXHAAVTPluginAnimationInfo@1@ABV21@ABVCFbsBitmap@@PBV3@@Z @ 17 NONAME ; void CActivePalettePluginBase::PrepareAniFramesL(int, class CActivePalettePluginBase::TPluginAnimationInfo &, class CActivePalettePluginBase::TPluginAnimationInfo const &, class CFbsBitmap const &, class CFbsBitmap const *) + ?PrevItem@TActivePalette2EventData@@QBEHXZ @ 18 NONAME ; int TActivePalette2EventData::PrevItem(void) const + ?ProduceAniFrame@CActivePalettePluginBase@@UAEXHHABVTPluginAnimationInfo@1@ABVCFbsBitmap@@PBV3@PAPAV3@3AAH4@Z @ 19 NONAME ; void CActivePalettePluginBase::ProduceAniFrame(int, int, class CActivePalettePluginBase::TPluginAnimationInfo const &, class CFbsBitmap const &, class CFbsBitmap const *, class CFbsBitmap * *, class CFbsBitmap * *, int &, int &) + ?ReleaseAniFrames@CActivePalettePluginBase@@UAEXH@Z @ 20 NONAME ; void CActivePalettePluginBase::ReleaseAniFrames(int) + ?Result@TActivePalette2EventData@@QBEHXZ @ 21 NONAME ; int TActivePalette2EventData::Result(void) const + ?ServingItem@TActivePalette2EventData@@QBEHXZ @ 22 NONAME ; int TActivePalette2EventData::ServingItem(void) const + ?ServingPlugin@TActivePalette2EventData@@QBE?AVTUid@@XZ @ 23 NONAME ; class TUid TActivePalette2EventData::ServingPlugin(void) const + ?Shutdown@CActivePalettePluginBase@@UAEXXZ @ 24 NONAME ; void CActivePalettePluginBase::Shutdown(void) + ?Visible@TActivePalette2ItemVisible@@QBEHXZ @ 25 NONAME ; int TActivePalette2ItemVisible::Visible(void) const + ?CreateGuiActivePaletteUIL@ActivePalette2Factory@@SAPAVMActivePalette2UI@@PAVMGui@@@Z @ 26 NONAME ; class MActivePalette2UI * ActivePalette2Factory::CreateGuiActivePaletteUIL(class MGui *) + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/BWINS/ActivePalette2_2du.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/BWINS/ActivePalette2_2du.def Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,28 @@ +EXPORTS + ??0CActivePalettePluginBase@@IAE@ABVTPluginCreationParams@NActivePalettePluginFactory@@@Z @ 1 NONAME ; CActivePalettePluginBase::CActivePalettePluginBase(class NActivePalettePluginFactory::TPluginCreationParams const &) + ??0TAP2GenericPluginIcon@@QAE@HH@Z @ 2 NONAME ; TAP2GenericPluginIcon::TAP2GenericPluginIcon(int, int) + ??0TAP2GenericPluginParams@@QAE@HABVTDesC16@@HH0HH@Z @ 3 NONAME ; TAP2GenericPluginParams::TAP2GenericPluginParams(int, class TDesC16 const &, int, int, class TDesC16 const &, int, int) + ??0TActivePalette2ItemVisible@@QAE@HH@Z @ 4 NONAME ; TActivePalette2ItemVisible::TActivePalette2ItemVisible(int, int) + ??0TActivePalette2NavigationKeys@@QAE@HHH@Z @ 5 NONAME ; TActivePalette2NavigationKeys::TActivePalette2NavigationKeys(int, int, int) + ??0TActivePalette2NavigationKeys@@QAE@XZ @ 6 NONAME ; TActivePalette2NavigationKeys::TActivePalette2NavigationKeys(void) + ??0TPluginCreationParams@NActivePalettePluginFactory@@QAE@AAVMActivePalettePluginObserver@@ABVTSize@@@Z @ 7 NONAME ; NActivePalettePluginFactory::TPluginCreationParams::TPluginCreationParams(class MActivePalettePluginObserver &, class TSize const &) + ??1CActivePalettePluginBase@@UAE@XZ @ 8 NONAME ; CActivePalettePluginBase::~CActivePalettePluginBase(void) + ?ConstructL@CActivePalettePluginBase@@UAEXABVTPluginCreationParams@NActivePalettePluginFactory@@ABVTDesC8@@H@Z @ 9 NONAME ; void CActivePalettePluginBase::ConstructL(class NActivePalettePluginFactory::TPluginCreationParams const &, class TDesC8 const &, int) + ?CreateActivePaletteUIL@ActivePalette2Factory@@SAPAVMActivePalette2UI@@W4TActivePalette2DrawMode@@@Z @ 10 NONAME ; class MActivePalette2UI * ActivePalette2Factory::CreateActivePaletteUIL(enum TActivePalette2DrawMode) + ?CreateGuiActivePaletteUIL@ActivePalette2Factory@@SAPAVMActivePalette2UI@@PAVMGui@@@Z @ 11 NONAME ; class MActivePalette2UI * ActivePalette2Factory::CreateGuiActivePaletteUIL(class MGui *) + ?CreateHUIActivePaletteUIL@ActivePalette2Factory@@SAPAVMActivePalette2UI@@AAVCHuiEnv@@@Z @ 12 NONAME ; class MActivePalette2UI * ActivePalette2Factory::CreateHUIActivePaletteUIL(class CHuiEnv &) + ?CurItem@TActivePalette2EventData@@QBEHXZ @ 13 NONAME ; int TActivePalette2EventData::CurItem(void) const + ?Dimensions@TPluginCreationParams@NActivePalettePluginFactory@@QBE?AVTSize@@XZ @ 14 NONAME ; class TSize NActivePalettePluginFactory::TPluginCreationParams::Dimensions(void) const + ?HandleMessageL@CActivePalettePluginBase@@UAEXHABVTDesC8@@H@Z @ 15 NONAME ; void CActivePalettePluginBase::HandleMessageL(int, class TDesC8 const &, int) + ?ItemId@TActivePalette2ItemVisible@@QBEHXZ @ 16 NONAME ; int TActivePalette2ItemVisible::ItemId(void) const + ?PluginObserver@TPluginCreationParams@NActivePalettePluginFactory@@QBEAAVMActivePalettePluginObserver@@XZ @ 17 NONAME ; class MActivePalettePluginObserver & NActivePalettePluginFactory::TPluginCreationParams::PluginObserver(void) const + ?PrepareAniFramesL@CActivePalettePluginBase@@UAEXHAAVTPluginAnimationInfo@1@ABV21@ABVCFbsBitmap@@PBV3@@Z @ 18 NONAME ; void CActivePalettePluginBase::PrepareAniFramesL(int, class CActivePalettePluginBase::TPluginAnimationInfo &, class CActivePalettePluginBase::TPluginAnimationInfo const &, class CFbsBitmap const &, class CFbsBitmap const *) + ?PrevItem@TActivePalette2EventData@@QBEHXZ @ 19 NONAME ; int TActivePalette2EventData::PrevItem(void) const + ?ProduceAniFrame@CActivePalettePluginBase@@UAEXHHABVTPluginAnimationInfo@1@ABVCFbsBitmap@@PBV3@PAPAV3@3AAH4@Z @ 20 NONAME ; void CActivePalettePluginBase::ProduceAniFrame(int, int, class CActivePalettePluginBase::TPluginAnimationInfo const &, class CFbsBitmap const &, class CFbsBitmap const *, class CFbsBitmap * *, class CFbsBitmap * *, int &, int &) + ?ReleaseAniFrames@CActivePalettePluginBase@@UAEXH@Z @ 21 NONAME ; void CActivePalettePluginBase::ReleaseAniFrames(int) + ?Result@TActivePalette2EventData@@QBEHXZ @ 22 NONAME ; int TActivePalette2EventData::Result(void) const + ?ServingItem@TActivePalette2EventData@@QBEHXZ @ 23 NONAME ; int TActivePalette2EventData::ServingItem(void) const + ?ServingPlugin@TActivePalette2EventData@@QBE?AVTUid@@XZ @ 24 NONAME ; class TUid TActivePalette2EventData::ServingPlugin(void) const + ?Shutdown@CActivePalettePluginBase@@UAEXXZ @ 25 NONAME ; void CActivePalettePluginBase::Shutdown(void) + ?Visible@TActivePalette2ItemVisible@@QBEHXZ @ 26 NONAME ; int TActivePalette2ItemVisible::Visible(void) const + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/EABI/ActivePalette2U.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/EABI/ActivePalette2U.def Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,60 @@ +EXPORTS + _ZN21ActivePalette2Factory22CreateActivePaletteUILE23TActivePalette2DrawMode @ 1 NONAME + _ZN21ActivePalette2Factory25CreateHUIActivePaletteUILER7CHuiEnv @ 2 NONAME + _ZN21TAP2GenericPluginIconC1Eii @ 3 NONAME + _ZN21TAP2GenericPluginIconC2Eii @ 4 NONAME + _ZN23TAP2GenericPluginParamsC1EiRK7TDesC16iiS2_ii @ 5 NONAME + _ZN23TAP2GenericPluginParamsC2EiRK7TDesC16iiS2_ii @ 6 NONAME + _ZN24CActivePalettePluginBase10ConstructLERKN27NActivePalettePluginFactory21TPluginCreationParamsERK6TDesC8i @ 7 NONAME + _ZN24CActivePalettePluginBase14HandleMessageLEiRK6TDesC8i @ 8 NONAME + _ZN24CActivePalettePluginBase15ProduceAniFrameEiiRKNS_20TPluginAnimationInfoERK10CFbsBitmapPS4_PPS3_S8_RiS9_ @ 9 NONAME + _ZN24CActivePalettePluginBase16ReleaseAniFramesEi @ 10 NONAME + _ZN24CActivePalettePluginBase17PrepareAniFramesLEiRNS_20TPluginAnimationInfoERKS0_RK10CFbsBitmapPS5_ @ 11 NONAME + _ZN24CActivePalettePluginBase8ShutdownEv @ 12 NONAME + _ZN24CActivePalettePluginBaseC2ERKN27NActivePalettePluginFactory21TPluginCreationParamsE @ 13 NONAME + _ZN24CActivePalettePluginBaseD0Ev @ 14 NONAME + _ZN24CActivePalettePluginBaseD1Ev @ 15 NONAME + _ZN24CActivePalettePluginBaseD2Ev @ 16 NONAME + _ZN26TActivePalette2ItemVisibleC1Eii @ 17 NONAME + _ZN26TActivePalette2ItemVisibleC2Eii @ 18 NONAME + _ZN27NActivePalettePluginFactory21TPluginCreationParamsC1ER28MActivePalettePluginObserverRK5TSize @ 19 NONAME + _ZN27NActivePalettePluginFactory21TPluginCreationParamsC2ER28MActivePalettePluginObserverRK5TSize @ 20 NONAME + _ZN29TActivePalette2NavigationKeysC1Eiii @ 21 NONAME + _ZN29TActivePalette2NavigationKeysC1Ev @ 22 NONAME + _ZN29TActivePalette2NavigationKeysC2Eiii @ 23 NONAME + _ZN29TActivePalette2NavigationKeysC2Ev @ 24 NONAME + _ZNK24TActivePalette2EventData11ServingItemEv @ 25 NONAME + _ZNK24TActivePalette2EventData13ServingPluginEv @ 26 NONAME + _ZNK24TActivePalette2EventData6ResultEv @ 27 NONAME + _ZNK24TActivePalette2EventData7CurItemEv @ 28 NONAME + _ZNK24TActivePalette2EventData8PrevItemEv @ 29 NONAME + _ZNK26TActivePalette2ItemVisible6ItemIdEv @ 30 NONAME + _ZNK26TActivePalette2ItemVisible7VisibleEv @ 31 NONAME + _ZNK27NActivePalettePluginFactory21TPluginCreationParams10DimensionsEv @ 32 NONAME + _ZNK27NActivePalettePluginFactory21TPluginCreationParams14PluginObserverEv @ 33 NONAME + _ZTI16CAnimationHelper @ 34 NONAME ; ## + _ZTI17CAP2GenericPlugin @ 35 NONAME ; ## + _ZTI19CActivePalette2Item @ 36 NONAME ; ## + _ZTI20CActivePalette2BasicUI @ 37 NONAME ; ## + _ZTI20CActivePalette2Model @ 38 NONAME ; ## + _ZTI21CActivePalette2Styler @ 39 NONAME ; ## + _ZTI22CActivePalette2Tooltip @ 40 NONAME ; ## + _ZTI24CActivePalettePluginBase @ 41 NONAME ; ## + _ZTI27CActivePalette2OpaqueStyler @ 42 NONAME ; ## + _ZTI33CActivePalette2CheckerboardStyler @ 43 NONAME ; ## + _ZTI36CActivePalette2SemiTransparentStyler @ 44 NONAME ; ## + _ZTV16CAnimationHelper @ 45 NONAME ; ## + _ZTV17CAP2GenericPlugin @ 46 NONAME ; ## + _ZTV19CActivePalette2Item @ 47 NONAME ; ## + _ZTV20CActivePalette2BasicUI @ 48 NONAME ; ## + _ZTV20CActivePalette2Model @ 49 NONAME ; ## + _ZTV21CActivePalette2Styler @ 50 NONAME ; ## + _ZTV22CActivePalette2Tooltip @ 51 NONAME ; ## + _ZTV24CActivePalettePluginBase @ 52 NONAME ; ## + _ZTV27CActivePalette2OpaqueStyler @ 53 NONAME ; ## + _ZTV33CActivePalette2CheckerboardStyler @ 54 NONAME ; ## + _ZTV36CActivePalette2SemiTransparentStyler @ 55 NONAME ; ## + _ZN21ActivePalette2Factory25CreateGuiActivePaletteUILEP4MGui @ 56 NONAME + _ZTI21CActivePalette2HUI @ 57 NONAME ; ## + _ZTV21CActivePalette2HUI @ 58 NONAME ; ## + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/EABI/ActivePalette2_2d_3du.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/EABI/ActivePalette2_2d_3du.def Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,66 @@ +EXPORTS + _ZN21ActivePalette2Factory22CreateActivePaletteUILE23TActivePalette2DrawMode @ 1 NONAME + _ZN21ActivePalette2Factory25CreateHUIActivePaletteUILER7CHuiEnv @ 2 NONAME + _ZN21TAP2GenericPluginIconC1Eii @ 3 NONAME + _ZN21TAP2GenericPluginIconC2Eii @ 4 NONAME + _ZN23TAP2GenericPluginParamsC1EiRK7TDesC16iiS2_ii @ 5 NONAME + _ZN23TAP2GenericPluginParamsC2EiRK7TDesC16iiS2_ii @ 6 NONAME + _ZN24CActivePalettePluginBase10ConstructLERKN27NActivePalettePluginFactory21TPluginCreationParamsERK6TDesC8i @ 7 NONAME + _ZN24CActivePalettePluginBase14HandleMessageLEiRK6TDesC8i @ 8 NONAME + _ZN24CActivePalettePluginBase15ProduceAniFrameEiiRKNS_20TPluginAnimationInfoERK10CFbsBitmapPS4_PPS3_S8_RiS9_ @ 9 NONAME + _ZN24CActivePalettePluginBase16ReleaseAniFramesEi @ 10 NONAME + _ZN24CActivePalettePluginBase17PrepareAniFramesLEiRNS_20TPluginAnimationInfoERKS0_RK10CFbsBitmapPS5_ @ 11 NONAME + _ZN24CActivePalettePluginBase8ShutdownEv @ 12 NONAME + _ZN24CActivePalettePluginBaseC2ERKN27NActivePalettePluginFactory21TPluginCreationParamsE @ 13 NONAME + _ZN24CActivePalettePluginBaseD0Ev @ 14 NONAME + _ZN24CActivePalettePluginBaseD1Ev @ 15 NONAME + _ZN24CActivePalettePluginBaseD2Ev @ 16 NONAME + _ZN26TActivePalette2ItemVisibleC1Eii @ 17 NONAME + _ZN26TActivePalette2ItemVisibleC2Eii @ 18 NONAME + _ZN27NActivePalettePluginFactory21TPluginCreationParamsC1ER28MActivePalettePluginObserverRK5TSize @ 19 NONAME + _ZN27NActivePalettePluginFactory21TPluginCreationParamsC2ER28MActivePalettePluginObserverRK5TSize @ 20 NONAME + _ZN29TActivePalette2NavigationKeysC1Eiii @ 21 NONAME + _ZN29TActivePalette2NavigationKeysC1Ev @ 22 NONAME + _ZN29TActivePalette2NavigationKeysC2Eiii @ 23 NONAME + _ZN29TActivePalette2NavigationKeysC2Ev @ 24 NONAME + _ZNK24TActivePalette2EventData11ServingItemEv @ 25 NONAME + _ZNK24TActivePalette2EventData13ServingPluginEv @ 26 NONAME + _ZNK24TActivePalette2EventData6ResultEv @ 27 NONAME + _ZNK24TActivePalette2EventData7CurItemEv @ 28 NONAME + _ZNK24TActivePalette2EventData8PrevItemEv @ 29 NONAME + _ZNK26TActivePalette2ItemVisible6ItemIdEv @ 30 NONAME + _ZNK26TActivePalette2ItemVisible7VisibleEv @ 31 NONAME + _ZNK27NActivePalettePluginFactory21TPluginCreationParams10DimensionsEv @ 32 NONAME + _ZNK27NActivePalettePluginFactory21TPluginCreationParams14PluginObserverEv @ 33 NONAME + _ZTI16CAnimationHelper @ 34 NONAME ; ## + _ZTI17CAP2GenericPlugin @ 35 NONAME ; ## + _ZTI19CActivePalette2Item @ 36 NONAME ; ## + _ZTI20CActivePalette2BasicUI @ 37 NONAME ; ## + _ZTI20CActivePalette2Model @ 38 NONAME ; ## + _ZTI21CActivePalette2Styler @ 39 NONAME ; ## + _ZTI22CActivePalette2Tooltip @ 40 NONAME ; ## + _ZTI24CActivePalettePluginBase @ 41 NONAME ; ## + _ZTI27CActivePalette2OpaqueStyler @ 42 NONAME ; ## + _ZTI33CActivePalette2CheckerboardStyler @ 43 NONAME ; ## + _ZTI36CActivePalette2SemiTransparentStyler @ 44 NONAME ; ## + _ZTV16CAnimationHelper @ 45 NONAME ; ## + _ZTV17CAP2GenericPlugin @ 46 NONAME ; ## + _ZTV19CActivePalette2Item @ 47 NONAME ; ## + _ZTV20CActivePalette2BasicUI @ 48 NONAME ; ## + _ZTV20CActivePalette2Model @ 49 NONAME ; ## + _ZTV21CActivePalette2Styler @ 50 NONAME ; ## + _ZTV22CActivePalette2Tooltip @ 51 NONAME ; ## + _ZTV24CActivePalettePluginBase @ 52 NONAME ; ## + _ZTV27CActivePalette2OpaqueStyler @ 53 NONAME ; ## + _ZTV33CActivePalette2CheckerboardStyler @ 54 NONAME ; ## + _ZTV36CActivePalette2SemiTransparentStyler @ 55 NONAME ; ## + _ZN21ActivePalette2Factory25CreateGuiActivePaletteUILEP4MGui @ 56 NONAME + _ZTI21CActivePalette2HUI @ 57 NONAME ; ## + _ZTV21CActivePalette2HUI @ 58 NONAME ; ## + _ZTI28CActivePalette2Configuration @ 59 NONAME ; ## + _ZTI28CActivePalette2TooltipFading @ 60 NONAME ; ## + _ZTI42CActivePalette2SemiTransparentFadingStyler @ 61 NONAME ; ## + _ZTV28CActivePalette2Configuration @ 62 NONAME ; ## + _ZTV28CActivePalette2TooltipFading @ 63 NONAME ; ## + _ZTV42CActivePalette2SemiTransparentFadingStyler @ 64 NONAME ; ## + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/EABI/ActivePalette2_2du.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/EABI/ActivePalette2_2du.def Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,64 @@ +EXPORTS + _ZN21ActivePalette2Factory22CreateActivePaletteUILE23TActivePalette2DrawMode @ 1 NONAME + _ZN21ActivePalette2Factory25CreateGuiActivePaletteUILEP4MGui @ 2 NONAME + _ZN21ActivePalette2Factory25CreateHUIActivePaletteUILER7CHuiEnv @ 3 NONAME + _ZN21TAP2GenericPluginIconC1Eii @ 4 NONAME + _ZN21TAP2GenericPluginIconC2Eii @ 5 NONAME + _ZN23TAP2GenericPluginParamsC1EiRK7TDesC16iiS2_ii @ 6 NONAME + _ZN23TAP2GenericPluginParamsC2EiRK7TDesC16iiS2_ii @ 7 NONAME + _ZN24CActivePalettePluginBase10ConstructLERKN27NActivePalettePluginFactory21TPluginCreationParamsERK6TDesC8i @ 8 NONAME + _ZN24CActivePalettePluginBase14HandleMessageLEiRK6TDesC8i @ 9 NONAME + _ZN24CActivePalettePluginBase15ProduceAniFrameEiiRKNS_20TPluginAnimationInfoERK10CFbsBitmapPS4_PPS3_S8_RiS9_ @ 10 NONAME + _ZN24CActivePalettePluginBase16ReleaseAniFramesEi @ 11 NONAME + _ZN24CActivePalettePluginBase17PrepareAniFramesLEiRNS_20TPluginAnimationInfoERKS0_RK10CFbsBitmapPS5_ @ 12 NONAME + _ZN24CActivePalettePluginBase8ShutdownEv @ 13 NONAME + _ZN24CActivePalettePluginBaseC2ERKN27NActivePalettePluginFactory21TPluginCreationParamsE @ 14 NONAME + _ZN24CActivePalettePluginBaseD0Ev @ 15 NONAME + _ZN24CActivePalettePluginBaseD1Ev @ 16 NONAME + _ZN24CActivePalettePluginBaseD2Ev @ 17 NONAME + _ZN26TActivePalette2ItemVisibleC1Eii @ 18 NONAME + _ZN26TActivePalette2ItemVisibleC2Eii @ 19 NONAME + _ZN27NActivePalettePluginFactory21TPluginCreationParamsC1ER28MActivePalettePluginObserverRK5TSize @ 20 NONAME + _ZN27NActivePalettePluginFactory21TPluginCreationParamsC2ER28MActivePalettePluginObserverRK5TSize @ 21 NONAME + _ZN29TActivePalette2NavigationKeysC1Eiii @ 22 NONAME + _ZN29TActivePalette2NavigationKeysC1Ev @ 23 NONAME + _ZN29TActivePalette2NavigationKeysC2Eiii @ 24 NONAME + _ZN29TActivePalette2NavigationKeysC2Ev @ 25 NONAME + _ZNK24TActivePalette2EventData11ServingItemEv @ 26 NONAME + _ZNK24TActivePalette2EventData13ServingPluginEv @ 27 NONAME + _ZNK24TActivePalette2EventData6ResultEv @ 28 NONAME + _ZNK24TActivePalette2EventData7CurItemEv @ 29 NONAME + _ZNK24TActivePalette2EventData8PrevItemEv @ 30 NONAME + _ZNK26TActivePalette2ItemVisible6ItemIdEv @ 31 NONAME + _ZNK26TActivePalette2ItemVisible7VisibleEv @ 32 NONAME + _ZNK27NActivePalettePluginFactory21TPluginCreationParams10DimensionsEv @ 33 NONAME + _ZNK27NActivePalettePluginFactory21TPluginCreationParams14PluginObserverEv @ 34 NONAME + _ZTI16CAnimationHelper @ 35 NONAME ; ## + _ZTI17CAP2GenericPlugin @ 36 NONAME ; ## + _ZTI19CActivePalette2Item @ 37 NONAME ; ## + _ZTI20CActivePalette2Model @ 38 NONAME ; ## + _ZTI21CActivePalette2Styler @ 39 NONAME ; ## + _ZTI22CActivePalette2BasicUI @ 40 NONAME ; ## + _ZTI22CActivePalette2Tooltip @ 41 NONAME ; ## + _ZTI24CActivePalettePluginBase @ 42 NONAME ; ## + _ZTI27CActivePalette2OpaqueStyler @ 43 NONAME ; ## + _ZTI28CActivePalette2Configuration @ 44 NONAME ; ## + _ZTI28CActivePalette2TooltipFading @ 45 NONAME ; ## + _ZTI33CActivePalette2CheckerboardStyler @ 46 NONAME ; ## + _ZTI36CActivePalette2SemiTransparentStyler @ 47 NONAME ; ## + _ZTI42CActivePalette2SemiTransparentFadingStyler @ 48 NONAME ; ## + _ZTV16CAnimationHelper @ 49 NONAME ; ## + _ZTV17CAP2GenericPlugin @ 50 NONAME ; ## + _ZTV19CActivePalette2Item @ 51 NONAME ; ## + _ZTV20CActivePalette2Model @ 52 NONAME ; ## + _ZTV21CActivePalette2Styler @ 53 NONAME ; ## + _ZTV22CActivePalette2BasicUI @ 54 NONAME ; ## + _ZTV22CActivePalette2Tooltip @ 55 NONAME ; ## + _ZTV24CActivePalettePluginBase @ 56 NONAME ; ## + _ZTV27CActivePalette2OpaqueStyler @ 57 NONAME ; ## + _ZTV28CActivePalette2Configuration @ 58 NONAME ; ## + _ZTV28CActivePalette2TooltipFading @ 59 NONAME ; ## + _ZTV33CActivePalette2CheckerboardStyler @ 60 NONAME ; ## + _ZTV36CActivePalette2SemiTransparentStyler @ 61 NONAME ; ## + _ZTV42CActivePalette2SemiTransparentFadingStyler @ 62 NONAME ; ## + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Group/ActivePalette2.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Group/ActivePalette2.mmp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project Active Palette +* +*/ + + +// =========================================================================== +// Target definition +TARGET ActivePalette.dll +TARGETTYPE dll +UID 0x1000008d 0x10208A6D +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +// --------------------------------------------------------------------------- +// Includes +#include +#include +#include +#include "../Inc/ActivePalette2BuildConfig.h" + +// --------------------------------------------------------------------------- +// Sources +SOURCEPATH ../Src + +#ifdef AP2_USE_3D_RENDERING +SOURCE ActivePalette2HUI.cpp +#endif + +#ifdef AP2_USE_2D_RENDERING +SOURCE ActivePalette2BasicUI.cpp +SOURCE ActivePalette2Tooltip.cpp +SOURCE activepalette2tooltipfading.cpp +SOURCE activepalette2tooltipfactory.cpp +SOURCE ActivePalette2StylerFactory.cpp +SOURCE ActivePalette2Styler.cpp +SOURCE ActivePalette2OpaqueStyler.cpp +SOURCE ActivePalette2SemiTransparentStyler.cpp +SOURCE ActivePalette2SemiTransparentFadingStyler.cpp +SOURCE ActivePalette2CheckerboardStyler.cpp +#endif + +SOURCE ActivePalette2Factory.cpp +SOURCE ActivePalette2EventData.cpp +SOURCE ActivePalette2NavigationKeys.cpp +SOURCE ActivePalette2DllMain.cpp +SOURCE ActivePalette2GenericPlugin.cpp +SOURCE ActivePalette2Item.cpp +SOURCE ActivePalette2Model.cpp +SOURCE activepalette2configuration.cpp +SOURCE ActivePalette2Utils.cpp +SOURCE ActivePalette2ItemVisible.cpp +SOURCE CActivePalettePluginBase.cpp + +// --------------------------------------------------------------------------- +// Headers +USERINCLUDE ../Inc + +// --------------------------------------------------------------------------- +// Libraries +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib cone.lib bitgdi.lib fbscli.lib ws32.lib gdi.lib flogger.lib +LIBRARY bafl.lib avkon.lib egul.lib AknSkins.lib AknIcon.lib +#ifdef AP2_USE_3D_RENDERING +LIBRARY hitchcock.lib +#endif +#ifdef AP2_USE_GUILIB_RENDERING +LIBRARY guilib.lib +#endif + +// --------------------------------------------------------------------------- +// Def-files +#ifdef AP2_USE_3D_RENDERING +DEFFILE ActivePalette2_2d_3d.def +#else +DEFFILE ActivePalette2_2d.def +#endif + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Group/Doxyfile.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Group/Doxyfile.txt Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,268 @@ +# +# Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Doxygen 1.3.6 configuration file for Active Palette 2 +# +# + +# +# INSTRUCTIONS: How to Customize the Doxyfile for Your Component +# +# The following settings need to be customized: +# - PROJECT_NAME (name of your component) +# - PROJECT_NUMBER (if a version number has been assigned for the component) +# +# Other useful settings: +# - IGNORE_PREFIX (prefixes ignored in the alphabetical index) +# + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "Active Palette 2" +PROJECT_NUMBER = +OUTPUT_DIRECTORY = "../docs/api" +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = YES +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 4 +ALIASES = panic=@exception \ + leave=@exception \ + "internalTechnology=@par Internal technology" \ + "internalComponent=@par Internal component" \ + "internalAll=@par Internal all" \ + "publishedPartner=@par Published-partner" \ + "publishedAll=@par Published-all" \ + "prototype=@par Prototype" \ + "interim=@par Interim" \ + "released=@par Released" \ + "removed=@par Removed" \ + "test=@par Test" \ + "realtime=@par Realtime" \ + "beginAPI=@name Exported API\n @{" \ + "endAPI=@}" +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = NO +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = YES +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../inc ../src +FILE_PATTERNS = *.c \ + *.cc \ + *.cpp \ + *.h \ + *.hh \ + *.hrh \ + *.dox +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 2 +IGNORE_PREFIX = "TActivePalette2" "NActivePalette2" "CActivePalette2" "RActivePalette2" "MActivePalette2" "TAP2" "NAP2" "CAP2" "ActivePalette2" "MActivePalette" "CActivePalette" "T" "M" "C" "N" +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = YES +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = NO +UML_LOOK = YES +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 0 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project activepalette +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../rom/activepalette2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(activepalette2.iby) + +PRJ_MMPFILES +../Group/ActivePalette2.mmp + +PRJ_EXTENSIONS + +START EXTENSION s60/mifconv +OPTION TARGETFILE activepalette2graphics.mif +OPTION HEADERFILE activepalette2graphics.mbg +OPTION SOURCEFILE iconlist.txt +END diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Group/iconlist.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Group/iconlist.txt Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,9 @@ +-c8,1 qgn_graf_cam4_tb_top.svg +-c8,1 qgn_graf_cam4_tb_arrow_down.svg +-c8,1 qgn_graf_cam4_tb_arrow_up.svg +-c8,1 qgn_graf_cam4_tb_body.svg +-c8,1 qgn_graf_cam4_tb_bottom.svg +-c8,1 qgn_graf_cam4_tb_focus.svg +-c8,1 qgn_graf_cam4_tb_tooltip_body.svg +-c8,1 qgn_graf_cam4_tb_tooltip_end.svg +-c8,1 qgn_graf_cam4_tb_gap.svg \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2BasicUI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2BasicUI.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,324 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: AP implementation using standard Symbian controls* +*/ + + +/** + * @file ActivePalette2BasicUI.h + * AP implementation using standard Symbian controls + */ + + +#ifndef _ACTIVE_PALETTE_2_BASIC_UI_H +#define _ACTIVE_PALETTE_2_BASIC_UI_H + +#include +#include +#include +#include +#include +#include +#include + +#include "CActivePalettePluginBase.h" +#include "ActivePalette2ModelObserver.h" +#include "ActivePalette2Const.h" + +// FORWARD DECLARATIONS +class MActivePalette2Observer; + +class CFbsBitmap; +class CFbsBitmapDevice; +class CFbsBitGc; +class CPeriodic; + +class CAknsBasicBackgroundControlContext; + +class TActivePalette2NavigationKeys; +class CActivePalette2Item; +class TActivePalette2EventData; +class CActivePalette2Model; +class CActivePalette2Styler; +class CActivePalette2Model; +class CActivePalette2Tooltip; +class CActivePalette2Configuration; + +/** + * 2D renderer for Active Palette 2. + * + * @warning application SHOULD NOT use directly SetSize(), + * SetRect() and SetLocation() of Active Palette object. + * Active palette object will adjust its size automatically + * when showing / hiding items. Position should be set using + * LocateTo(). + */ +class CActivePalette2BasicUI : public CCoeControl, + public MActivePalette2UI, + public MActivePalette2ModelObserver, + public MActivePalette2TooltipTimerObserver, + public MActivePalette2FocusTimerObserver, + public MActivePalette2ItemScrollTimerObserver, + public MActivePalette2AppearanceTimerObserver + { + +public: +/// @name Object creation and deletion +//@{ + /** + * 2-stage construction + * @param aDrawMode The drawing mode required + * @return The newly-created object + */ + static CActivePalette2BasicUI* NewL(TActivePalette2DrawMode aDrawMode); + + /** + * Destructor + */ + virtual ~CActivePalette2BasicUI(); +//@} + +public: +/// @name From CoeControl +//@{ + TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); + void SetContainerWindowL(const CCoeControl& aContainer); +//@} + +private: +/// @name From CoeControl +//@{ + TInt CountComponentControls() const; + CCoeControl* ComponentControl(TInt aIndex) const; + void Draw(const TRect& aRect) const; + void SizeChanged(void); + + /** + * Allow AP to respond to layout/orientation changes + * @param aType event type + */ + void HandleResourceChange( TInt aType ); +//@} + +public: +/// @name From MActivePalette2UI +//@{ + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + const TDesC8& aCustomDataDes); + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt = 0); + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt, + const TDesC8& aCustomDataDes); + virtual TInt RemoveItem(TInt aItemId); + virtual TInt SetItemVisibility(TInt aItemId, TBool aIsVisible); + virtual TInt GetItemVisibility(TInt aItemId, TBool &aIsVisible) const; + virtual TInt GetItemList(RArray& aItemVisibleList) const; + virtual TInt SetItemList(const RArray& aItemVisibleList); + virtual TInt SendMessage(TInt aItemId, TInt aMessageId, const TDesC8& aDataDes); + virtual TInt SendMessage(TInt aItemId, TInt aMessageId, TInt aDataInt); + virtual TInt GetCurrentItem(TInt& aItemId) const; + virtual TInt SetCurrentItem(TInt aItemId); + virtual TInt SetPaletteVisibility(TBool aVisible, TBool aAnimated, TInt aDelayedStartMilliseconds = 0); + virtual TInt SetPaletteVisibilityAnimationDuration(TInt aTimeInMilliseconds); + virtual TInt GetPaletteVisibilityAnimationDuration(TInt& aTimeInMilliseconds) const; + virtual void LocateTo(const TPoint& aTopLeft); + virtual TPoint Location() const; + virtual CCoeControl* CoeControl(); + virtual CHuiControl* HuiControl(); + virtual void SetGc(CBitmapContext* aGc = NULL); + virtual void RenderActivePalette(const TRect& aRect) const; + virtual void SetObserver(MActivePalette2Observer* aObserver); + virtual TInt GetAvailablePlugins(RArray& aPluginList) const; + virtual void SetNavigationKeys(const TActivePalette2NavigationKeys& aNavigationKeys); +//@} + +public: +/// @name From MActivePalette2ModelObserver +//@{ + virtual TInt TooltipUpdated(); + virtual void ItemsUpdated(); + virtual void ItemAnimated(TInt aScreenPos, CActivePalette2Item* aItem, TInt aAnimFrame); + virtual void ItemAnimationComplete(TInt aScreenPos, CActivePalette2Item* aItem); + virtual void FocusUpdated(); + virtual void PaletteAppearingUpdated(); + virtual MActivePalette2Observer* APObserver() const; + virtual void ShowTooltipUpdated(); +//@} + +public: +/// @name From MActivePalette2TooltipTimerObserver +//@{ + virtual void TooltipAnimated(); +//@} + +public: +/// @name From MActivePalette2FocusTimerObserver +//@{ + virtual void FocusAnimated(); +//@} + +public: +/// @name From MActivePalette2ItemScrollTimerObserver +//@{ + virtual void ItemsScrolled(); +//@} + +public: +/// @name From MActivePalette2AppearanceTimerObserver +//@{ + virtual void PaletteAppearingAnimated(); +//@} + +private: +/// @name Object creation helpers +//@{ + /** + * Constructor + */ + CActivePalette2BasicUI(); + + /** + * Leaving constructor + * @param aDrawMode The rendering style for the AP + */ + void ConstructL(TActivePalette2DrawMode aDrawMode); +//@} + +/// @name New functions +//@{ + /** + * Flush the draw buffer in the specified area + * @param aRectToFlush The area to flush + */ + void FlushBufNow(const TRect& aRectToFlush); + + /** + * Recalculate the size of the AP + */ + void ReCalcAutoSizeL(); + + /** + * Draw palette + * @param aForceDisplayUpdate Indicates whether to force display update + */ + void RedrawIdle(TBool aForceDisplayUpdate = ETrue) const; + + /** + * Produce the palette on the screen + * @param aRect Rectangle in which to display the palette + */ + void ProducePaletteToScreen(const TRect& aRect) const; + + /** + * Translates a draw buffer rect to it's on-screen position + * @param aDrawBufRect The buffer rect + * @return The on-screen rect + */ + TRect DrawBufRectToScreenRect(TRect aDrawBufRect) const; + + /** + * Translates a screen rect to it's in-buffer position + * @param aScreenRect The on-screen rect + * @return The buffer rect + */ + TRect ScreenRectToDrawBufRect(TRect aScreenRect) const; + + /** + * The palette's current screen position + * @return The palette's current screen position + */ + TPoint PalettePosition() const; + + /** + * Draws a range of items, including the gaps between them. + * @param aStartIndex The item index to begin drawing from + * @param aFinishIndex The item index to finish with + */ + void DrawItemRange(TInt aStartIndex, TInt aFinishIndex) const; + + /** + * Draws a particular item + * @param aIndex The item index to draw + * @param aAnimOnly Whether to only draw the item's icon area, for use when animating + */ + void DrawItem(TInt aIndex, TBool aAnimOnly = EFalse) const; + + /** + * Draws the separator below the given item index. + * @param aIndex The item index. If -1, the top scroll-arrow portion is drawn. If the same as the + * last shown item index, the bottom scroll-arrow portion is drawn. + */ + void DrawSeparator(TInt aIndex) const; + + /** + * Redraw to screen the portion of the AP most recently updated. + */ + void FlushDirtyRect(); +//@} + + + + +private: // data + + /// The model. Owned. + CActivePalette2Model* iModel; + + /// The observer; may be NULL. Not owned. + MActivePalette2Observer* iAPObserver; + + /// The position of a fully-displayed palette. + TPoint iTopLeftCorner; + /// The current size of the palette + TSize iOverallSize; + + /// The tooltip note. Owned + CActivePalette2Tooltip* iTooltipNote; + + /// Current navigation keys + TActivePalette2NavigationKeys iNavigationKeys; + + /// Focused item's animation info + CActivePalettePluginBase::TPluginAnimationInfo iFocusPluginAniInfo; + + /// Stores the current screen size. + TSize iScreenSize; + + /// The rendering style + TActivePalette2DrawMode iDrawMode; + + /// The context to render to. If NULL (default), the screen is used. Not owned + CBitmapContext* iRenderGc; + + /// The style to render with + CActivePalette2Styler* iStyler; + + // Configuration provider + CActivePalette2Configuration* iConfiguration; + + /// Remeber which items are (partially) covered by focus + mutable TInt iFocusedItem1; + /// Remeber which items are (partially) covered by focus + mutable TInt iFocusedItem2; + + /// Where the palette was last rendered + mutable TRect iRenderedRect; + }; + + +#endif // _ACTIVE_PALETTE_2_BASIC_UI_H diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2BuildConfig.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2BuildConfig.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Configures the build for AP2* +*/ + + +/** + * @file ActivePalette2BuildConfig.h + * Configures the build for AP2 + */ + +#ifndef _ACTIVE_PALETTE_2_BUILD_CONFIG_H +#define _ACTIVE_PALETTE_2_BUILD_CONFIG_H + +/// Define this if 2D rendering is required +#define AP2_USE_2D_RENDERING + +/// Define this if 3D rendering is required +//#define AP2_USE_3D_RENDERING + +/// Define this if GuiLib rendering is required +//#define AP2_USE_GUILIB_RENDERING + +#endif // _ACTIVE_PALETTE_2_BUILD_CONFIG_H diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2Cfg.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2Cfg.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,249 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette internal configuration and constants* +*/ + + +/** + * @file ActivePalette2Cfg.h + * Active Palette internal configuration and constants + */ + +/** + * @mainpage Active Palette 2 + * + * @section sec1 Introduction + * + * Active Palette 2 is a library that can be used to provide an icon-based menu UI component. + * + * + * + * This is the documentation for all the code. For just the public API, see + * @ref sec_info. + * + * @section sec2 Typical Usage + * + * Initialization: + * - Create the AP2 control using a ActivePalette2Factory function + * - If a CCoeControl is created, set the container window and Mop parent + * - Or, if a CHuiControl is created, add it to a control group + * - Register an instance of MActivePalette2Observer to receive callbacks + * - Install the required plugins + * + * Normal runtime behaviour: + * - Manipulate the control using the MActivePalette2UI interface + * - Respond to callbacks to the registered MActivePalette2Observer + * + * Cleanup: + * - Delete the control + * + * @section sec_groups Classes + * + * The following classes comprise the public API of the Active Palette 2. + * + * - ActivePalette2Factory + * - MActivePalette2UI + * - MActivePalette2Observer + * - TActivePalette2NavigationKeys + * - TActivePalette2ItemVisible + * - TActivePalette2EventData + * + * A generic, general-purpose plugin is provided. + * + * - TAP2GenericPluginParams + * - TAP2GenericPluginIcon + * + * Plugin developers will use the following APIs: + * + * - CActivePalettePluginBase + * - MActivePalettePluginObserver + * - NActivePalettePluginFactory::TPluginCreationParams + * + * @section sec_info More Information + * + * More information is available in the docs/ directory of this release. + * + * + */ + + +#ifndef _ACTIVE_PALETTE_2_CFG_H +#define _ACTIVE_PALETTE_2_CFG_H + +#include "ActivePalette2Const.h" +#include + +/// For converting between milliseconds and microseconds +const TInt KMicrosecondsPerMillisecond = 1000; + +/// Used in event data if Item ID is unknown +const TInt KInvalidId = -1; +/// Used internally for invalid Item indices +const TInt KInvalidItemIndex = -1; +/// Used internally for invalid screen position +const TInt KInvalidScreenPos = -2; + +/// Return value from timer callbacks signalling that no future callbacks are necessary +const TInt KCallbackFinished = 0; +/// Return value from timer callbacks signalling that future callbacks are required +const TInt KCallbackCallAgain = 1; + +/// Opacity value for "fully opaque" +const TReal KOpacityFull = 1.0; +/// Opacity value for "fully transparent" +const TReal KOpacityNone = 0.0; + +namespace NAP2Cfg + { + // General AP dimensions + /// Item icon width, in pixels + const TInt KItemWidth = 23; + /// Item icon height, in pixels + const TInt KItemHeight = 23; + /// Width of the AP + const TInt KPaletteWidth = 33; + /// Height of the top section + const TInt KTopSectionHeight = 11; + /// Height of the bottom section + const TInt KBottomSectionHeight = 11; + /// The height of the gap between items + const TInt KGapBetweenItems = 4; + /// X offset for the items + const TInt KItemXOffset = 5; + /// Width of the focus ring + const TInt KFocusRingWidth = 29; + /// Height of the focus ring + const TInt KFocusRingHeight = 29; + /// X offset from the focused item for the focus ring + const TInt KFocusRingXOffset = -3; + /// Y offset from the focused item for the focus ring + const TInt KFocusRingYOffset = -3; + /// Y offset from the focused item for the tooltip + const TInt KTooltipYOffset = 2; + /// Height of 2D tooltips + const TInt KTooltipHeight = 17; + /// Width of 2D tooltips + const TInt KTooltipWidth = 16; + /// Factor for tooltip size + const TReal KTooltipFactor = 1.3; + /// 2D tooltips: baseline for font + const TInt KTooltipBaseline = 13; + /// 2D tooltips: width of right, blank area + const TInt KTooltipTail = 4; + /// 2D tooltips: with of left, blank area + const TInt KTooltipNose = 4; + + // 2D-specific constants + /// 2D Tooltip colour + const TInt KColourTooltipText = 215; // black + + // 3D-specific constants + /// 3D tooltips: YOffset for text + const TInt K3dTooltipTextYOffset = 2; + /// 3D tooltips: max width of tooltip + const TInt K3dTooltipMaxWidth = 320; + + /// Default timer tick length + const TInt KDefaultTimerTickLength = 40 * KMicrosecondsPerMillisecond; + + /// Focus change tick length + const TInt KFocusChangeTimerTickLength = KDefaultTimerTickLength; + /// Total time for a focus change to complete, in microseconds + const TInt KFocusChangeTotalTime = 200 * KMicrosecondsPerMillisecond; + /// Number of frames needed for a complete focus change + const TInt KFocusChangeFrames = KFocusChangeTotalTime / KFocusChangeTimerTickLength; + + /// Item scroll tick length + const TInt KItemScrollTimerTickLength = KFocusChangeTimerTickLength; + /// Total time for an item scroll to complete, in microseconds + const TInt KItemScrollTotalTime = KFocusChangeTotalTime; + /// Number of frames needed for a complete item scroll + const TInt KItemScrollFrames = KItemScrollTotalTime / KItemScrollTimerTickLength; + + /// Palette appearance tick length + const TInt KPaletteAppearTimerTickLength = 100 * KMicrosecondsPerMillisecond; + /// Total time for a palette appearance to complete, in microseconds + const TInt KPaletteAppearTotalTime = 400 * KMicrosecondsPerMillisecond; + /// Number of frames needed for a complete palette appearance + const TInt KPaletteAppearFrames = KPaletteAppearTotalTime / KPaletteAppearTimerTickLength; + + /// Tooltip change tick length + const TInt KTooltipTimerTickLength = KDefaultTimerTickLength; + const TInt KTooltipTimerTickLengthFading = 40 * KMicrosecondsPerMillisecond; + /// Delay between an item being focused, and the tooltip being shown (in microseconds) + const TInt KTooltipPreshowDelay = 800 * KMicrosecondsPerMillisecond; + const TInt KTooltipPreshowDelayFading = 50 * KMicrosecondsPerMillisecond; + /// Delay between the tooltip being fully shown, and beginning to disappear (in microseconds) + const TInt KTooltipFullshowPeriod = 3000 * KMicrosecondsPerMillisecond; + const TInt KTooltipFullshowPeriodFading = 800 * KMicrosecondsPerMillisecond; + /// The speed the scrolling tooltips should move, in pixels per timer tick + const TInt KTooltipShowSpeed = 40; + /// Fading tooltip, shade steps in full in or out animation. + const TInt KTooltipFadingSteps = 32; // 1..255 + + /// The number of frames in an item animation + const TInt KItemAnimNoFrames = 8; + /// The frame duration for the item animation + const TInt KItemAnimFrameDuration = (800 * KMicrosecondsPerMillisecond) / KItemAnimNoFrames; + + /// Time for arrow indicators to fade in/out: 7/10 of the change animation. In milliseconds + const TInt K3dScrollIndicatorFadeTime = (7 * KFocusChangeTotalTime) / (10 * KMicrosecondsPerMillisecond); + + /// Max number of items that can be shown + const TInt KMaxNofItemsInView = 6; + + /// The virtual screen position above the topmost item + const TInt KScreenPosAboveTop = -1; + + /// SVG background icon file + _LIT(KUIGraphics, "z:\\resource\\apps\\activepalette2graphics.mif"); + } + +/// The item's icon size +#define KItemSize TSize(NAP2Cfg::KItemWidth, NAP2Cfg::KItemHeight) +/// The colour of the 2D focus ring +#define KColourFocus AKN_LAF_COLOR_STATIC(198) +/// Colour of the whole-palette background +#define KColourArea AKN_LAF_COLOR_STATIC(0) +/// Colour of the palette's border +#define KColourAreaBorder AKN_LAF_COLOR_STATIC(0) +/// Default 2D offset +#define KDefault2dPaletteOffset TPoint(-50, 6) +/// Default 3D offset +#define KDefault3dPaletteOffset TPoint(-50, 20) +/// Default texture size for 3D palette/tooltip background +#define K3dPaletteTextureSize TSize(32, 32) +/// Background colour for 3D AP +#define K3dPaletteBackgroundColour TRgb(0xFFFFFF) +/// 3D scroll arrow bitmap size +#define K3dScrollIconSize TSize(7, 4) +/// 3D scroll arrow offset +#define K3dScrollIconOffset TPoint(13, 3) +/// 3D focus ring bitmap size +#define K3dFocusRingSize TSize(29, 29) +/// 3D focus ring offset +#define K3dFocusRingOffset TPoint(-2, -2) +/// 3D tooltip offset +#define K3dTooltipOffset TPoint(-NAP2Cfg::KItemXOffset, 3) +/// Colour of 2D tooltip background +#define KColourTooltipBackground AKN_LAF_COLOR_STATIC(0) +/// Colour of 2D tooltip border +#define KColourTooltipBorder AKN_LAF_COLOR_STATIC(215) +/// Colour of 2D tooltip mask transparency +#define KColourTooltipTransparency TRgb::Gray256(215) + + +#endif // _ACTIVE_PALETTE_2_CFG_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2CheckerboardStyler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2CheckerboardStyler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Checkerboard Styler* +*/ + + +/** + * @file ActivePalette2CheckerboardStyler.h + * Active Palette Checkerboard Styler + */ + +#ifndef _ACTIVE_PALETTE_2_CHECKERBOARD_STYLER_H +#define _ACTIVE_PALETTE_2_CHECKERBOARD_STYLER_H + +#include "ActivePalette2Styler.h" + +/** + * Renders the checkerboard drawing style 2D AP + */ +class CActivePalette2CheckerboardStyler : public CActivePalette2Styler + { +public: + /** + * 2-stage construction + * @return The newly-created object + */ + static CActivePalette2CheckerboardStyler* NewL(); + + /** + * Destructor + */ + ~CActivePalette2CheckerboardStyler(); + +/// @name From CActivePalette2Styler +//@{ + void ConstructL(); + virtual void DrawItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask, TInt aOffsetFrame, TInt aOffsetTotal); + virtual void DrawGap(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal); + virtual void AnimItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask); + virtual void DrawTopScrollArrowSection(TBool aShowArrow); + virtual void DrawBottomScrollArrowSection(TBool aShowArrow); +//@} + void LoadAndScaleCheckerboardL( CFbsBitmap* aTargetBitmap, const TDesC& aFileName, TInt32 aId, TInt32 aMaskId, TSize aSize ); + +private: + /// The mask for the top section + CFbsBitmap* iAPTopSectionMask; + +/** + * @name Alternate masks + * A note about different masks: as the checkerboard pattern repeats over an even number of pixels, + * and the difference in y-positions of two consecutive items is odd, two masks are required for some elements. + * For example, to keep the pattern consistent, you should use ItemMaskA, GapMaskA, ItemMaskB, GapMaskB, BottomSectionMaskB + */ +//@{ + /// Item mask for even items. Owned + CFbsBitmap* iAPItemMaskA; + /// Item mask for odd items. Owned + CFbsBitmap* iAPItemMaskB; + /// Gap mask for even items. Owned + CFbsBitmap* iAPGapMaskA; + /// Gap mask for odd items. Owned + CFbsBitmap* iAPGapMaskB; + /// Bottom section mask for when the total number of items is odd. Owned + CFbsBitmap* iAPBottomSectionMaskA; + /// Bottom section mask for when the total number of items is even. Owned + CFbsBitmap* iAPBottomSectionMaskB; +//@} + TBool iLineCheckerCounter; + }; + +#endif // _ACTIVE_PALETTE_2_CHECKERBOARD_STYLER_H diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2Const.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2Const.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette constants* +*/ + + +/** + * @file ActivePalette2Const.h + * Active Palette exported constants + */ + +#ifndef ACTIVEPLAETTERESDEFCONST_RH +#define ACTIVEPLAETTERESDEFCONST_RH + +// CONSTANTS + +/// Used to specify "no data" to plugins +#define KActivePaletteNoDataInt 0 + +#endif // ACTIVEPLAETTERESDEFCONST_RH +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2GenericPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2GenericPlugin.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette generic plugin* +*/ + + +/** + * @file ActivePalette2GenericPlugin.h + * Active Palette generic plugin + */ + +#ifndef _ACTIVE_PALETTE_2_GENERIC_PLUGIN_H +#define _ACTIVE_PALETTE_2_GENERIC_PLUGIN_H + +// INCLUDES +#include +#include + +#include "CActivePalettePluginBase.h" + + +/** + * General-purpose, generic plugin + */ +class CAP2GenericPlugin : public CActivePalettePluginBase + { +public: + + /** + * Constructor + * @param aCreationParams Creation parameters + */ + CAP2GenericPlugin(const NActivePalettePluginFactory::TPluginCreationParams & aCreationParams); + +private: + + /** + * Destructor + */ + virtual ~CAP2GenericPlugin(); + +/// @name From CActivePalettePluginBase +//@{ + void ConstructL(const NActivePalettePluginFactory::TPluginCreationParams& aCreationParams, + const TDesC8& aCustomDataDes, + const TInt aCustomDataInt); + void HandleItemSelectedL(void); + void HandleMessageL(const TInt aMessageID, const TDesC8& aDataDes, const TInt aDataInt); +//@} + + /** + * Sets the icon and tooltip text for this item + * @param aParams Reference to the parameters structure + */ + void SetIconAndTooltipL(TAP2GenericPluginParams& aParams); + + /** + * Creates an icon from bitmap IDs for the icon and mask + * @param aIconId Bitmap ID for the icon + * @param aMaskId Bitmap ID for the mask + * @return A pointer to the created icon + */ + CGulIcon* CreateIconL(TInt aIconId, TInt aMaskId); + + private: // Member variables + /// Current message ID being serviced + TInt iMessageId; + /// The current message data + TInt iMsgCustomParam; + /// The size of icons to provide + TSize iDimensions; + /// The file containing the icon graphics + TFileName iGraphicsFileName; + }; + +/** +* Instantiaites the plugin +* @param aPluginUid The UID +* @param aCreationParams Reference to the parameters structure +* @return A pointer to the plugin +*/ +extern CActivePalettePluginBase* InstantiateGenericPluginL(const TUid& aPluginUid, + const NActivePalettePluginFactory::TPluginCreationParams& aCreationParams); + +#endif // _ACTIVE_PALETTE_2_GENERIC_PLUGIN_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2HUI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2HUI.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,390 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: AP implementation using HUITK* +*/ + + +/** + * @file ActivePalette2HUI.h + * AP implementation using HUITK + */ + + +#ifndef _ACTIVE_PALETTE_2_HUI_H +#define _ACTIVE_PALETTE_2_HUI_H + +#include +#include +#include +#include +#include + +#include "ActivePalette2ModelObserver.h" + +class CHuiEnv; +class CHuiLayout; +class CHuiImageVisual; +class CHuiMeshVisual; +class CHuiTextVisual; +class CHuiTexture; +class TActivePalette2EventData; +class MActivePalette2Observer; +class CActivePalette2Item; +class CActivePalette2Model; + +/** + * 3D renderer for Active Palette 2. + */ +class CActivePalette2HUI : public CHuiControl, + public MActivePalette2UI, + public MActivePalette2ModelObserver, + public MActivePalette2TooltipDescriptiveObserver, + public MActivePalette2FocusDescriptiveObserver, + public MActivePalette2ItemScrollDescriptiveObserver, + public MActivePalette2AppearanceDescriptiveObserver + { +public: +/// @name Object creation & deletion +//@{ + + /** + * 2-stage construction + * @param aEnv The Hui environment the control should be created in + * @return The newly-created object + */ + static CActivePalette2HUI* NewL(CHuiEnv& aEnv); + + /** + * Destructor + */ + ~CActivePalette2HUI(); +//@} + +private: +/// @name Object creation helpers +//@{ + /** + * Constructor + * @param aEnv The Hui environment the control should be created in + */ + CActivePalette2HUI(CHuiEnv& aEnv); + + /** + * Second-stage construction + */ + void ConstructL(); + +//@} + +public: +/// @name From CHuiControl +//@{ + virtual TBool OfferEventL(const THuiEvent& aEvent); + virtual void VisualLayoutUpdated(CHuiVisual &aVisual); +//@} + +public: +/// @name From MActivePalette2UI +//@{ + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + const TDesC8& aCustomDataDes); + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt = 0); + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt, + const TDesC8& aCustomDataDes); + virtual TInt RemoveItem(TInt aItemId); + virtual TInt SetItemVisibility(TInt aItemId, TBool aIsVisible); + virtual TInt GetItemVisibility(TInt aItemId, TBool &aIsVisible) const; + virtual TInt GetItemList(RArray& aItemVisibleList) const; + virtual TInt SetItemList(const RArray& aItemVisibleList); + virtual TInt SendMessage(TInt aItemId, TInt aMessageId, const TDesC8& aDataDes); + virtual TInt SendMessage(TInt aItemId, TInt aMessageId, TInt aDataInt); + virtual TInt GetCurrentItem(TInt& aItemId) const; + virtual TInt SetCurrentItem(TInt aItemId); + virtual TInt SetPaletteVisibility(TBool aVisible, TBool aAnimated, TInt aDelayedStartMilliseconds = 0); + virtual TInt SetPaletteVisibilityAnimationDuration(TInt aTimeInMilliseconds); + virtual TInt GetPaletteVisibilityAnimationDuration(TInt& aTimeInMilliseconds) const; + virtual void LocateTo(const TPoint& aTopLeft); + virtual TPoint Location() const; + virtual CCoeControl* CoeControl(); + virtual CHuiControl* HuiControl(); + virtual void SetGc(CBitmapContext* aGc = NULL); + virtual void RenderActivePalette(const TRect& aRect) const; + virtual void SetObserver(MActivePalette2Observer* aObserver); + virtual TInt GetAvailablePlugins(RArray& aPluginList) const; + virtual void SetNavigationKeys(const TActivePalette2NavigationKeys& aNavigationKeys); +//@} + +public: +/// @name From MActivePalette2ModelObserver +//@{ + virtual TInt TooltipUpdated(); + virtual void ItemsUpdated(); + virtual void ItemAnimated(TInt aScreenPos, CActivePalette2Item* aItem, TInt aAnimFrame); + virtual void ItemAnimationComplete(TInt aScreenPos, CActivePalette2Item* aItem); + virtual void PaletteAppearingUpdated(); + virtual MActivePalette2Observer* APObserver() const; + virtual void ShowTooltipUpdated(); +//@} + +public: +/// @name From MActivePalette2TooltipDescriptiveObserver +//@{ + virtual void AnimateTooltip(TBool aToShow, TInt aTimeInMilliseconds); +//@} + +public: +/// @name From MActivePalette2FocusDescriptiveObserver +//@{ + virtual void AnimateFocus(TInt aCurrentPos, TInt aTargetPos, TInt aTimeInMilliseconds); +//@} + +public: +/// @name From MActivePalette2ItemScrollDescriptiveObserver +//@{ + virtual void AnimateItemScroll(TInt aDirection, TInt aTimeInMilliseconds); +//@} + +public: +/// @name From MActivePalette2AppearanceDescriptiveObserver +//@{ + virtual void AnimateAppearance(TBool aVisible, TInt aTimeInMilliseconds); + virtual TInt GuessCurrentAppearanceFrame(); +//@} + +private: +/// @name New functions +//@{ + /** + * Renders the main section of the palette. It repositions all objects within it's layout, + * and updates all textures. + */ + void Render(); + + /** + * Returns the current screen position of the AP. + * @return The screen position of the AP + */ + TPoint PalettePosition() const; + + /** + * Updates state when a focus-change animation is completed + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + TInt AnimateFocusTimerComplete(); + + /** + * Updates state when a palette-appearance animation is completed + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + TInt AnimateAppearanceTimerComplete(); + + /** + * Updates state when a item-scroll animation is completed + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + TInt AnimateItemScrollTimerComplete(); + + /** + * Updates state when a tooltip animation is completed + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + TInt AnimateTooltipTimerComplete(); + + /** + * Returns the palette offset for an item at the given screen position + * @param aScreenPos The screen postion + * @return The item offset + */ + TPoint ItemPosition(TInt aScreenPos) const; + + /** + * The offset for the area of the palette that contains the top scroll arrow + * @return The offset + */ + TPoint TopScrollPanePosition() const; + + /** + * The offset for the area of the palette that contains the bottom scroll arrow + * @return The offset + */ + TPoint BottomScrollPanePosition() const; + + /** + * The overall size of the palette + * @return The size + */ + TSize PaletteSize() const; + + /** + * Returns the current offset to be applied to all items due to item-scrolling + * @return The item scroll offset + */ + TPoint CurrentScrollOffset() const; + + /** + * Set the correct opacities for the top & bottom items during an item-scroll animation + */ + void ItemsScrolledSetItemOpacities(); + + /** + * Updates the position and opacity of the focus ring, with immediate effect + */ + void UpdateFocus(); + + /** + * Updates iScreenSize, iTopLeftCorner based on current screen size + */ + void UpdateTopLeftCornerWithScreenSize(); +//@} + +/// @name New functions +//@{ + /** + * Timer callback for focus-change animation + * @param aPtr Pointer to object that started the timer + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + static TInt AnimateFocusTimerCallback(TAny* aPtr); + + /** + * Timer callback for palette-appearance animation + * @param aPtr Pointer to object that started the timer + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + static TInt AnimateAppearanceTimerCallback(TAny* aPtr); + + /** + * Timer callback for item-scroll animation + * @param aPtr Pointer to object that started the timer + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + static TInt AnimateItemScrollTimerCallback(TAny* aPtr); + + /** + * Timer callback for tooltip animation + * @param aPtr Pointer to object that started the timer + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + static TInt AnimateTooltipTimerCallback(TAny* aPtr); + +//@} + +private: // data + /// The model used + CActivePalette2Model* iModel; + + /// The observer to use for callbacks + MActivePalette2Observer* iObserver; + + /// The keys to respond to in OfferEventL + TActivePalette2NavigationKeys iNavigationKeys; + + /// Where the AP should be when fully shown + TPoint iTopLeftCorner; + + + /// The full-screen layout - to get VisualLayoutUpdated on + /// screen orientation change + CHuiLayout* iFullScreenLayout; + + /// The palette layout + CHuiLayout* iPaletteLayout; + + /// The top section background layout + CHuiLayout* iBackgroundTopSectionLayout; + /// The top section background visual + CHuiImageVisual* iBackgroundTopSectionVisual; + /// The top section background texture + CHuiTexture* iBackgroundTopSectionTexture; + + /// The mid section background layout + CHuiLayout* iBackgroundMidSectionLayout; + /// The mid section background visual + CHuiImageVisual* iBackgroundMidSectionVisual; + /// The mid section background texture + CHuiTexture* iBackgroundMidSectionTexture; + + /// The bottom section background layout + CHuiLayout* iBackgroundBottomSectionLayout; + /// The bottom section background visual + CHuiImageVisual* iBackgroundBottomSectionVisual; + /// The bottom section background texture + CHuiTexture* iBackgroundBottomSectionTexture; + + /// The top-arrow layout + CHuiLayout* iTopScrollLayout; + /// The top-arrow visual + CHuiImageVisual* iTopScrollVisual; + /// The top-arrow texture + CHuiTexture* iTopScrollTexture; + + /// The bottom-arrow layout + CHuiLayout* iBottomScrollLayout; + /// The bottom-arrow visual + CHuiImageVisual* iBottomScrollVisual; + /// The bottom-arrow texture + CHuiTexture* iBottomScrollTexture; + + /// The focus ring layout + CHuiLayout* iFocusRingLayout; + /// The focus ring texture + CHuiTexture* iFocusRingTexture; + /// The focus ring visual + CHuiImageVisual* iFocusRingVisual; + + /// The layouts for the items + RPointerArray iItemLayout; + /// The visuals for the items + RPointerArray iItemVisual; + /// The textures for the items + RPointerArray iItemTexture; + + /// The tooltip layout + CHuiLayout* iTooltipLayout; + + /// The tooltip text layout + CHuiLayout* iTooltipTextLayout; + /// The tooltip text visual + CHuiTextVisual* iTooltipTextVisual; + + /// The nose section tooltip background layout + CHuiLayout* iTooltipBackgroundNoseLayout; + /// The nose section tooltip background visual + CHuiImageVisual* iTooltipBackgroundNoseVisual; + /// The nose section tooltip background texture + CHuiTexture* iTooltipBackgroundNoseTexture; + + /// The body section tooltip background layout + CHuiLayout* iTooltipBackgroundBodyLayout; + /// The body section tooltip background visual + CHuiImageVisual* iTooltipBackgroundBodyVisual; + /// The body section tooltip background texture + CHuiTexture* iTooltipBackgroundBodyTexture; + + + /// A general purpose timer. Used for synchronizing with animations. + CPeriodic* iGeneralTimer; + + /// Stores the current screen size. + TSize iScreenSize; + }; + + +#endif // _ACTIVE_PALETTE_2_HUI_H + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2Item.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2Item.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,250 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette item* +*/ + + +/** + * @file ActivePalette2Item.h + * Active Palette item + */ + +#ifndef _ACTIVE_PALETTE_2_ITEM_H +#define _ACTIVE_PALETTE_2_ITEM_H + +// INCLUDES +#include + +#include "CActivePalettePluginBase.h" + + +// FORWARD DECLARATIONS +class CActivePalettePluginBase; +class CActivePalette2Model; +class CGulIcon; +class CFbsBitmap; + +// CONSTANTS +/// The print plugin UID +const TInt KPrintPluginUid = 0x200009E2; +/// The print plugin DLL filename +_LIT(KPrintPluginDLLName,"PrintActivePalette.dll"); + +/// The print intent plugin UID +const TInt KPrintIntentPluginUid = 0x200009CE; +/// The print intent plugin DLL filename +_LIT(KPrintIntentPluginDLLName,"PrintIntentActivePalette.dll"); + +/// The online sharing plugin UID +const TInt KOnlineSharingPluginUid = 0x20007189; +/// The print intent plugin DLL filename +_LIT(KOnlineSharingPluginDLLName,"OnlineSharingActivePalette.dll"); + + +#ifdef ACTIVEPALETTE_SUPPORT_PLUGIN_CAM +/// The cam plugin UID +const TInt KCamAPPluginUid = static_cast(0x8000FFFF); +/// The cam plugin DLL filename +_LIT(KCamAPluginDLLName,"CamAPPlugin.dll"); +#endif // ACTIVEPALETTE_SUPPORT_PLUGIN_CAM + + +// CLASS DECLARATIONS + +/** + * Stores the Item ID + */ +class CActivePalette2IDHolder : public CBase + { +public: + + /** + * Constructor + * @param aItemId item ID + */ + CActivePalette2IDHolder(TInt aItemId); + + /** + * Constructor + */ + CActivePalette2IDHolder(); + + /** + * Returns the item ID + * @return The item ID + */ + inline TInt ItemId(void) const; + + /** + * Sets the item ID + * @param aItemId The item ID + */ + void SetItemId(TInt aItemId); + +private: // Data + /// The item ID + TInt iItemId; + }; + +/** + * Item for use in the AP + */ +class CActivePalette2Item : public CActivePalette2IDHolder, + private MActivePalettePluginObserver + { +public: + + /** + * Public constructor + * @param aItemId The item ID + * @param aPluginUid The plugin UID + * @param aModel The model being used + * @return Newly constructed object + */ + static CActivePalette2Item * NewLC(TInt aItemId, + const TUid& aPluginUid, + CActivePalette2Model& aModel); + + /** + * Destructor + */ + virtual ~CActivePalette2Item(); + + /** + * Returns the UID of the plugin handling this item + * @return The UID of the plugin handling this item + */ + TUid PluginUid(void) const; + + /** + * Returns a reference to the plugin handling this item + * @return A reference to the plugin handling this item + */ + CActivePalettePluginBase& Plugin(void) const; + + /** + * Returns a reference to the item's icon as a bitmap + * @return A reference to the item's icon as a bitmap + */ + CFbsBitmap& Icon(void) const; + + /** + * Returns a pointer to the item's mask as a bitmap + * @return A pointer to the item's mask as a bitmap + */ + CFbsBitmap* Mask(void) const; + + /** + * Returns a pointer to the item's tooltip text + * @return A pointer to the item's tooltip text + */ + HBufC* Tooltip(void) const; + + /** + * Sets the item position + * @param aItemPosition The new position + */ + void SetItemPosition(TInt aItemPosition); + + /** + * Sets the visibility of the item + * @param aIsVisible The new visibility + */ + void SetItemVisible(TBool aIsVisible); + + /** + * Initialise the plugin handling this item + * @param aCustomDataDes Custom data descriptor + * @param aCustomDataInt Custom data integer + */ + void InitPluginL(const TDesC8& aCustomDataDes, TInt aCustomDataInt); + +private: + + /** + * Constructor + * @param aItemId The item's ID + * @param aPluginUid The UID of the plugin to handle this item + * @param aModel A reference to the active palette model + */ + CActivePalette2Item(TInt aItemId, + const TUid& aPluginUid, + CActivePalette2Model& aModel); + + /** + * 2 phase construction + */ + void ConstructL(void); + + /** + * Returns a plugin factory from a given UID + * @param aUid The UID of the plugin + * @return A pointer to the plugin instantiation method + */ + NActivePalettePluginFactory::TInstantiatePluginLFunc FindPluginFactoryL(const TUid aUid); + + /** + * Returns the plugin creation parameters + * @return The plugin creation parameters + */ + NActivePalettePluginFactory::TPluginCreationParams GetPluginCreationParams(void); + + /** + * Performs the setting of an icon to this item + * @param aIcon A pointer to the icon + * @param aOnwershipTransfer Whether to transfer ownership of the icon + */ + void DoSetItemIcon(CGulIcon* aIcon, TBool aOnwershipTransfer); + +private: +/// @name From MActivePalettePluginObserver +//@{ + void SetItemIconAndTooltipL(CGulIcon* aIcon, + TBool aOnwershipTransfer, + const TDesC& aTooltipText); + void SetItemIcon(CGulIcon* aIcon, TBool aOnwershipTransfer); + void SetItemTooltipL(const TDesC& aTooltipText); + void NotifyItemComplete(const TDesC8& aDataDes); + void NotifyItemComplete(TInt aDataInt); + void NotifyPluginDestroyed(CActivePalettePluginBase* aPlugin); + void NotifyPluginCreated(CActivePalettePluginBase* aPlugin); + void SendMessage(TInt aMessageID, const TDesC8& aDataDes); + void SendMessage(TInt aMessageID, TInt aDataInt); +//@} + +private: + /// The plugin UID used for the item + TUid iPluginUid; + /// The model + CActivePalette2Model& iModel; + + /// Plug-in instance. Owned. + CActivePalettePluginBase* iPlugin; + /// The plugin library + RLibrary iDLL; + + /// Current icon information. @see iOwnsIcon + CGulIcon* iIcon; + /// Whether this instance owns the icon data + TBool iOwnsIcon; + + /// The current tooltip. Owned. + HBufC* iTooltip; // owned + }; + +#include "ActivePalette2Item.inl" + +#endif // _ACTIVE_PALETTE_2_ITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2Item.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2Item.inl Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of active palette item inline methods* +*/ + + +/** + * @file ActivePalette2Item.inl + * Implementation of active palette item inline methods + */ + +// ----------------------------------------------------------------------------- +// CActivePalette2IDHolder::ItemId() +// ----------------------------------------------------------------------------- +// +inline TInt CActivePalette2IDHolder::ItemId(void) const + { + return iItemId; + }; + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2Logger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2Logger.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette logger* +*/ + + +/** + * @file ActivePalette2Logger.h + * Active Palette logger + */ + +#ifndef _ACTIVE_PALETTE_2_LOGGER_H +#define _ACTIVE_PALETTE_2_LOGGER_H + +#ifdef _DEBUG + +#include + +/// Debug logger +#define LOGTEXT(a) { RDebug::Print(a); } +/// Debug logger, takes 1 extra param +#define LOGTEXT1(a,b) { RDebug::Print(a,b); } +/// Debug logger, takes 2 extra params +#define LOGTEXT2(a,b,c) { RDebug::Print(a,b,c); } +/// Debug logger, takes 3 extra params +#define LOGTEXT3(a,b,c,d) { RDebug::Print(a,b,c,d); } + +#else + +#define LOGTEXT(a) +#define LOGTEXT1(a,b) +#define LOGTEXT2(a,b,c) +#define LOGTEXT3(a,b,c,d) + +#endif // _DEBUG + +#endif //_ACTIVE_PALETTE_2_LOGGER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2Model.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2Model.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,806 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette model* +*/ + + +/** + * @file ActivePalette2Model.h + * Active Palette model + */ + +#ifndef _ACTIVE_PALETTE_2_MODEL_H +#define _ACTIVE_PALETTE_2_MODEL_H + +// INCLUDES +#include + +#include +#include "CActivePalettePluginBase.h" +#include "ActivePalette2Cfg.h" +#include "activepalette2configuration.h" + +// FORWARD DECLARATIONS +class CActivePalette2Item; +class CActivePalette2IDHolder; +class TActivePalette2EventData; +class MActivePalette2Observer; +class TActivePalette2ItemVisible; +class MActivePalette2ModelObserver; +class MActivePalette2TooltipTimerObserver; +class MActivePalette2FocusTimerObserver; +class MActivePalette2ItemScrollTimerObserver; +class MActivePalette2AppearanceTimerObserver; +class MActivePalette2TooltipDescriptiveObserver; +class MActivePalette2FocusDescriptiveObserver; +class MActivePalette2ItemScrollDescriptiveObserver; +class MActivePalette2AppearanceDescriptiveObserver; + +/** + * The type of user input detected. + * @see CActivePalette2Model::ProcessInputEvent() + */ +enum TActivePalette2InputEvent { + EAP2InputUp, ///< User pressed up + EAP2InputDown, ///< User pressed down + EAP2InputSelect ///< User selected +}; + +// CLASS DECLARATIONS + + +/** + * Describes the type of callback the renderer would like for all animations + * @see CActivePalette2Model::NewL() + */ +class TRendererCallBacks + { +public: + /** + * Constructor + * By default, all categories are set to TRendererCallBackApiType::ERendererCallBackApiTypeTimer + */ + TRendererCallBacks(); + + MActivePalette2TooltipTimerObserver* iTooltipTimer; + MActivePalette2FocusTimerObserver* iFocusTimer; + MActivePalette2ItemScrollTimerObserver* iItemScrollTimer; + MActivePalette2AppearanceTimerObserver* iAppearanceTimer; + MActivePalette2TooltipDescriptiveObserver* iTooltipDescriptive; + MActivePalette2FocusDescriptiveObserver* iFocusDescriptive; + MActivePalette2ItemScrollDescriptiveObserver* iItemScrollDescriptive; + MActivePalette2AppearanceDescriptiveObserver* iAppearanceDescriptive; + }; + + +/** + * Active Palette model. Contains all internal logic of the AP. + */ +class CActivePalette2Model : public CBase, public MActivePalette2UI + { +public: +/// @name Object construction & deletion +//@{ + /** + * Destructor + */ + virtual ~CActivePalette2Model(); + + + /** + * 2 phase construction + * @param aModelObserver A reference to the observer + * @param aItemSize The size of the item icons + * @param aCallbacks The callback styles to use + * @param aConfiguration The runtime configuration provider. Can be NULL. + * @return The newly-constructed object + */ + static CActivePalette2Model* NewL( + MActivePalette2ModelObserver& aModelObserver, + TSize aItemSize, + const TRendererCallBacks& aCallbacks, + CActivePalette2Configuration* aConfiguration = NULL ); + +//@} + +public: +/// @name From MActivePalette2UI +//@{ + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + const TDesC8& aCustomDataDes); + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt = 0); + virtual TInt InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt, + const TDesC8& aCustomDataDes); + virtual TInt RemoveItem(TInt aItemId); + virtual TInt SetItemVisibility(TInt aItemId, TBool aIsVisible); + virtual TInt GetItemVisibility(TInt aItemId, TBool &aIsVisible) const; + virtual TInt GetItemList(RArray& aItemVisibleList) const; + virtual TInt SetItemList(const RArray& aItemVisibleList); + virtual TInt SendMessage(TInt aItemId, TInt aMessageId, const TDesC8& aDataDes); + virtual TInt SendMessage(TInt aItemId, TInt aMessageId, TInt aDataInt); + virtual TInt GetCurrentItem(TInt& aItemId) const; + virtual TInt SetCurrentItem(TInt aItemId); + virtual TInt SetPaletteVisibility(TBool aVisible, TBool aAnimated, TInt aDelayedStartMilliseconds = 0); + virtual TInt SetPaletteVisibilityAnimationDuration(TInt aTimeInMilliseconds); + virtual TInt GetPaletteVisibilityAnimationDuration(TInt& aTimeInMilliseconds) const; + virtual TInt GetAvailablePlugins(RArray& aPluginList) const; + virtual void LocateTo(const TPoint& aTopLeft); + virtual TPoint Location() const; + virtual CCoeControl* CoeControl(); + virtual CHuiControl* HuiControl(); + virtual void SetGc(CBitmapContext* aGc = NULL); + virtual void RenderActivePalette(const TRect& aRect) const; + virtual void SetObserver(MActivePalette2Observer* aObserver); + virtual void SetNavigationKeys(const TActivePalette2NavigationKeys& aNavigationKeys); +//@} + + +public: +/// @name Renderer interrogation +//@{ + /** + * Returns the number of items on-screen + * @return The number of items on-screen + */ + TInt CountItemsOnScreen(void); + + /** + * Whether to show the top scroll indicator + * @return Whether to show the top scroll indicator + */ + TBool ShowTopScrollIndicator(void); + + /** + * Whether to show the bottom scroll indicator + * @return Whether to show the bottom scroll indicator + */ + TBool ShowBottomScrollIndicator(void); + + /** + * Gets the item at the given screen position + * @return The item at that position + */ + CActivePalette2Item* ItemFromScreenPos(TInt aScreenPos); + + /** + * The current tooltip text + * @return The current tooltip text + */ + TDesC* TooltipText(); + + /** + * Whether any tooltip should be currently shown + * @return Whether any tooltip should be currently shown + */ + TBool ShowTooltip(); + + /** + * The current tooltip frame. + * The entire animation will consist of frames 0 to TooltipTotalFrames(), and may be played backwards + * as well as forwards. + * @return Current frame of tooltip animation to show + */ + TInt TooltipCurrentFrame(); + + /** + * Total number of frames in a complete tooltip animation + * @return Total frames + */ + TInt TooltipTotalFrames(); + + /** + * The screen position of the item showing a tooltip + * @return The Screen pos + */ + TInt TooltipScreenPosition(); + + /** + * The currently focused item + * @return The focused item + */ + TInt FocusedItem(); + + /** + * The current focus offset. + * The entire animation will consist of frames 0 to FocusCurrentTotalOffsetFrames(), and may be played backwards + * as well as forwards. + * The focus ring's position should be the position of FocusedItem() + this offset, correctly scaled + * @return Current offset of focus ring animation to show + */ + TInt FocusCurrentOffset(); + + /** + * Total number of frames in a complete focus-change animation + * @return Total frames + */ + TInt FocusCurrentTotalOffsetFrames(); + + /** + * The current item scroll offset. + * The entire animation will consist of frames 0 to ItemScrollTotalFrames(), and may be played backwards + * as well as forwards. + * The top item's offset should be moved upwards an amount calculated from this offset. + * @return Current offset of item scroll animation to show + */ + TInt ItemScrollOffset(); + + /** + * Total number of frames in a complete item-scroll animation + * @return Total frames + */ + TInt ItemScrollTotalFrames(); + + /** + * Whether the palette is open for user input or not + * @return Whether user input is accepted + */ + TBool PaletteActive(); + + /** + * The current appearance frame. + * The entire animation will consist of frames 0 to PaletteAppearingTotalFrames(), and may be played backwards + * as well as forwards. + * @return Current frame of appearance animation to show + */ + TInt PaletteAppearingCurrentFrame(); + + /** + * Total number of frames in a complete appearance animation + * @return Total frames + */ + TInt PaletteAppearingTotalFrames(); + + /** + * The current item's animation info + * @return The current item's animation info + */ + CActivePalettePluginBase::TPluginAnimationInfo ItemAnimInfo(); +//@} + +public: +/// @name User input +//@{ + /** + * Process a user input event + * @param aEvent The event to process + * @return Whether the input has been consumed + */ + TBool ProcessInputEvent(TActivePalette2InputEvent aEvent); +//@} + +public: +/// @name Descriptive callbacks +//@{ + /** + * Signal that the focus-change animation has completed + */ + void AnimateFocusRendererComplete(); + + /** + * Signal that the palette-appearance animation has completed + */ + void AnimateAppearanceRendererComplete(); + + /** + * Signal that the item-scroll animation has completed + */ + void AnimateItemScrollRendererComplete(); + + /** + * Signal that the tooltip animation has completed + */ + void AnimateTooltipRendererComplete(); +//@} + +public: +/// @name Item collaboration +//@{ + /** + * Returns the model observer + * @return A reference to the model observer + */ + MActivePalette2ModelObserver& Observer(void) const; + + /** + * Returns the item icon dimensions + * @return The item size + */ + TSize ItemSize(); + + /** + * Item selection + * @param aItem A reference to the item + * @param aResult The result value + * @param aDataDes Data descriptor + * @param aDataInt Data integer + */ + void NotifyItemComplete(const CActivePalette2Item& aItem, + TInt aResult, + const TDesC8& aDataDes, + TInt aDataInt); + + /** + * Message arrived + * @param aItem A reference to the item + * @param aResult The result value + * @param aMessageID The message ID + * @param aDataDes Data descriptor + * @param aDataInt Data integer + */ + void NotifyMessage(const CActivePalette2Item& aItem, + const TInt aResult, + const TInt aMessageID, + const TDesC8& aDataDes, + TInt aDataInt); + + /** + * Graphics changes + * @param aItem A reference to the item + * @param aIsIconChanged Indicates if the icon has changed + * @param aIsTooltipChanged Indicates if the toolip text has chaned + */ + void NotifyGraphicsChanged(const CActivePalette2Item& aItem, + const TBool aIsIconChanged, + const TBool aIsTooltipChanged); +//@} + + +private: +/// @name Object construction helpers +//@{ + /** + * Constructor + */ + CActivePalette2Model( MActivePalette2ModelObserver& aModelObserver, + TSize aItemSize, + const TRendererCallBacks& aCallbacks, + CActivePalette2Configuration* aConfiguration ); + + /** + * Leaving constructor + */ + void ConstructL(void); +//@} + + +private: +/// @name Item manipulation +//@{ + /** + * Returns an item from a given ID + * @param aItemId The item ID to be found + * @return A pointer to the item + */ + CActivePalette2Item* FindItem(TInt aItemId) const; + + /** + * Handles the selection of an item + * @param aItemIndex The item ID + */ + void HandleItemSelected(TInt aItemIndex); + + /** + * Installs an item + * @param aItemId The item's ID + * @param aVisible Whether the item is installed as visible + * @param aPluginUid The UID of the plugin to handle this item + * @param aCustomDataDes Custom data descriptor for the plugin + * @param aCustomDataInt Custom data integer for the plugin + * @return System-wide error code + */ + TInt DoInstallItemL(TInt aItemId, + TBool aVisible, + const TUid& aPluginUid, + const TDesC8& aCustomDataDes, + TInt aCustomDataInt); + + /** + * Sends a message to the plugin handling the specified item + * @param aItemId The item's ID + * @param aMessageID The ID of the message to send + * @param aDataDes Custom data descriptor for the plugin + * @param aDataInt Custom data integer for the plugin + * @return System-wide error code + */ + TInt DispatchMessage(TInt aItemId, + TInt aMessageID, + const TDesC8& aDataDes, + TInt aDataInt); + + /** + * Initialize the model's state + */ + void InitialiseConstraints(void); + + /** + * Ensure that the model's state is self-consistent and valid. + * Call this after the item or visibility array is changed. May resize the palette, scroll it, + * move the focus to a valid item. + */ + void EnforceConstraints(void); + + /** + * Finds the next visible item index, including aStartingItem. + * @return The next visible item, or KInvalidItemIndex if none found + */ + TInt FindVisibleItem(TInt aStartingItem); + + /** + * Finds the previous visible item index, including aStartingItem. + * @return The previous visible item, or KInvalidItemIndex if none found + */ + TInt PreviousVisibleItem(TInt aStartingItem); + + /** + * Returns the total number of visible items + * @return The total number of visible items + */ + TInt CountVisibleItems(TInt aStartingItem); + + /** + * Returns the item index of the given screen position + * @param aScreenPos The screen position + * @return The item index, or KInvalidItemIndex if none + */ + TInt ItemIndexFromScreenPos(TInt aScreenPos); + + /** + * Given an item index, work out where it is on screen + * @param aItem The item index + * @return The screen pos + */ + TInt ScreenPosFromItemIndex(TInt aItem); + + /** + * Given an item ID, work out the item index + * @param aItemId The item ID + * @return The item index, or KInvalidItemIndex + */ + TInt ItemIndexFromId(const TInt aItemId) const; + + /** + * The item index of the lowermost item on-screen. + * @return The item index + */ + TInt BottomItemOnScreen(void); + + /** + * Call whenever the items or visibility arrays are updated + */ + void ItemsUpdated(); + + /** + * Returns whether a given item index is valid or not + * @return Item index validity + */ + TBool ValidItemIndex(TInt aItemIndex) const; +//@} + + +private: +/// @name Tooltips +//@{ + /** + * Tooltip animation state + */ + enum TTooltipState + { + ETooltipInvalid, ///< Invalid state + ETooltipNone = 2, ///< Tooltip hidden + ETooltipSteady, ///< Tooltip fully shown + ETooltipRise, ///< Tooltip appearing + ETooltipSet ///< Tooltip disappearing + }; + + /** + * Removes the tooltip + */ + void RemoveTooltip(); + + /** + * Start a new tooltip animation + */ + void CompelTooltip(); + + /** + * Begin the steady animation phase (where the tooltip is fully visible) + * @return Error code + */ + TInt TooltipSteadyAniAction(); + + /** + * Begin the rising animation phase (where the tooltip slides out) + * @return Error code + */ + TInt TooltipRiseAniAction(); + + /** + * Begin the rising animation phase (where the tooltip slides in) + * @return Error code + */ + TInt TooltipDisappearAniAction(); + + /** + * Sets the tooltip's state + * @param aState New state + */ + void TooltipSetState(TTooltipState aState); + + /** + * Called on tooltip timer tick + * @param aPtr Pointer to object that started the timer + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + static TInt TooltipTimerCallback(TAny * aPtr); + +private: + /// Current tooltip animation state + TTooltipState iTooltipState; + + /// Tooltip animation timer. Owned + CPeriodic* iTooltipTimer; + + /// Total number of frames in animation + TInt iTooltipTotalFrames; + /// Current animation frame + TInt iTooltipCurrentFrame; + /// Whether the tooltip is currently being shown or not + TBool iShowTooltip; + /// Screen position of the tooltip + TInt iTooltipPos; +//@} + + +private: +/// @name Animation functions +//@{ + /** + * The current animation state of the palette + */ + enum TPaletteAnimState + { + EPaletteAnimIdle, ///< No animation + EPaletteAnimItemScroll, ///< Item scroll + EPaletteAnimFocusChange, ///< Focus change + EPaletteAnimItemAnim, ///< Item animation + EPaletteAnimAppearing ///< Whole-palette appearance + }; + + /** + * Set current animation state. Stops previous animation (if necessary) and starts new animation (if necessary) + * @param aNewState The new animation state + */ + void SetAnimState(TPaletteAnimState aNewState); + + /** + * If any animations are taking place that involves individual items (item-scroll, item-anim, focus-change), + * this completes them immediately. + */ + void CompleteAnyItemBasedAnimations(); + + /** + * Start a change focus item. + * Uses iFocusedItem and iFocusChangeTargetItem to work out what the animation should be + */ + void ChangeFocus(); + + /** + * Begin the scroll-items animation + * @param aDirection +1 to move the items downwards, -1 to move them upwards + */ + void ScrollItems(TInt aDirection); + + /** + * Called on focus-change timer tick + * @param aPtr Pointer to object that started the timer + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + static TInt FocusChangeTimerCallback(TAny * aPtr); + + /** + * Perform action for focus-change animation timer tick. + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + TInt FocusChangeAction(); + + /** + * Called when focus-change animation has completed + */ + void FocusChangeComplete(); + + /** + * Called on item-scroll timer tick + * @param aPtr Pointer to object that started the timer + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + static TInt ItemScrollTimerCallback(TAny * aPtr); + + /** + * Perform action for item-scroll animation timer tick. + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + TInt ItemScrollAction(); + + /** + * Called when item-scroll animation has completed + */ + void ItemScrollComplete(); + + /** + * Called when item-animation is starting + */ + void StartItemAnimation(); + + /** + * Called on item-animation timer tick + * @param aPtr Pointer to object that started the timer + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + static TInt ItemAnimTimerCallback(TAny* aPtr); + + /** + * Perform action for item-animation animation timer tick. + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + TInt ItemAnimAction(); + + /** + * Called when item-animation animation has completed + */ + void ItemAnimationComplete(); + + /** + * Called on palette-appearance timer tick + * @param aPtr Pointer to object that started the timer + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + static TInt PaletteAnimTimerCallback(TAny* aPtr); + + /** + * Perform action for palette-appearance animation timer tick. + * @return 0 to signal that further callbacks are unnecessary, 1 otherwise + */ + TInt PaletteAnimAction(); + + /** + * Called when palette-appearance animation has completed + */ + void PaletteAnimComplete(); + + /** + * Called whenever a new item gains focus + */ + void FocusedItemUpdated(); +//@} + + /** + * Prepares a TActivePalette2EventData object + * @param aItem The item the event concerns + * @param aResult The result of the event + * @return The initialized TActivePalette2EventData object + */ + TActivePalette2EventData PrepareEventData(const CActivePalette2Item& aItem, TInt aResult); + + /** + * Appends a plugin's UID to an array, if the plugin can be found on the device. + * @param aPluginList The array to append to + * @param aDllUid The UID to add if found + * @param aDllFileName The filename of the DLL to look for + */ + void AppendPluginIdIfAvailable(RArray& aPluginList, const TUid aDllUid, const TFileName aDllFileName) const; + +private: +/// @name Item information +//@{ + /// The currently installed items + RPointerArray iItemsArray; + /// The visibility of each installed item. + RArray iVisibilityArray; + /// The index of the top item on the screen + TInt iTopItemOnScreen; + /// How many items are currently on the screen + TInt iNoItemsOnScreen; + /// The total number of visible items + TInt iNoVisibleItems; + /// Currently focused item index + TInt iFocusedItem; + /// Previously focused item ID + TInt iPreviousItemID; + /// Currently focused item ID + TInt iFocusedItemID; +//@} + +private: +/// @name Animation information +//@{ + /// Timer for focus-change animation. Owned + CPeriodic* iFocusChangeTimer; + /// The item index being moved to + TInt iFocusChangeTargetItem; + /// The velocity of the focus-change animation + TInt iFocusChangeDirection; + /// The current focus-change frame + TInt iFocusedCurrentOffset; + + /// Timer for item-scroll animation. Owned + CPeriodic* iItemScrollTimer; + /// The velocity of the item-scroll animation + TInt iItemScrollDirection; + /// The current item-scroll frame + TInt iItemScrollCurrentOffset; + + /// The item being animated + CActivePalette2Item* iAniItem; + /// The screen position of the item being animated + TInt iAniItemScreenPos; + /// The animation info for the animated item + CActivePalettePluginBase::TPluginAnimationInfo iAniItemInfo; + /// The item animation timer. Owned. + CPeriodic* iItemAnimTimer; + /// The current item animation frame number + TInt iAnimationFrame; + + /// The current appearance animation frame + TInt iPaletteMoveCurrentOffset; + /// The total number of appearance animation frames + TInt iPaletteMoveOffsetTotalFrames; + /// The velocity of the appearance animation + TInt iPaletteMoveAnimationDirection; + /// The timer for the appearance animation. Owned + CPeriodic* iPaletteMoveTimer; + /// The duration of the appearance animation, in milliseconds + TInt iPaletteMoveAnimationDuration; + + /// The current animation state + TPaletteAnimState iAnimState; +//@} + +private: +/// @name Cached information, for speed +//@{ + /// The indices of the items shown on-screen + TInt iOnScreenItemIndex[NAP2Cfg::KMaxNofItemsInView + 1]; + + /// Whether the top scroll arrow should be shown + TBool iShowTopScrollArrow; + + /// Whether the bottom scroll arrow should be shown + TBool iShowBottomScrollArrow; +//@} + +private: + /// The callback styles requested + TRendererCallBacks iCallbacks; + + /// The model observer (renderer) + MActivePalette2ModelObserver& iModelObserver; + + // Configuration provider + //CActivePalette2Configuration& iConfiguration; + + /// The dimensions of each item's icon + TSize iItemSize; + + // Tooltip details + TActivePalette2TooltipConfig iTooltipConfig; +}; + +#endif // _ACTIVE_PALETTE_2_MODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2ModelObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2ModelObserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette model observers* +*/ + + +/** + * @file ActivePalette2ModelObserver.h + * Active Palette model observers + */ + +#ifndef _ACTIVE_PALETTE_2_MODEL_OBSERVER_H +#define _ACTIVE_PALETTE_2_MODEL_OBSERVER_H + +class CActivePalette2Item; +class MActivePalette2Observer; + + +/** + * Model observer interface. Used by the model to update the renderer. + */ +class MActivePalette2ModelObserver + { +public: + /** + * Called when a new tooltip is about to be shown for the first time. This allows the renderer + * to pre-render the tooltip if necessary + * @return The width, in pixels, of the entire tooltip + */ + virtual TInt TooltipUpdated() = 0; + + /** + * Called when the items have been updated. + */ + virtual void ItemsUpdated() = 0; + + /** + * Called when the palette-appearance animation needs to be updated + */ + virtual void PaletteAppearingUpdated() = 0; + + /** + * Called when an item animation needs to be updated + * @param aScreenPos The screen position of the item + * @param aItem pointer to the item object + * @param aAnimFrame The frame to be displayed + */ + virtual void ItemAnimated(TInt aScreenPos, CActivePalette2Item* aItem, TInt aAnimFrame) = 0; + + /** + * Called when an item's animation is complete + * @param aScreenPos The screen position of the item + * @param aItem pointer to the item object + */ + virtual void ItemAnimationComplete(TInt aScreenPos, CActivePalette2Item* aItem) = 0; + + /** + * Called when a tooltip should appear or disappear + */ + virtual void ShowTooltipUpdated() = 0; + + /** + * Should return the currently registered observer, or NULL if none. + * @return The AP observer + */ + virtual MActivePalette2Observer* APObserver() const = 0; + }; + + +/** + * Timer-style callbacks for tooltip animation + */ +class MActivePalette2TooltipTimerObserver + { +public: + /** + * Called when the tooltip animation needs to be updated + */ + virtual void TooltipAnimated() = 0; + }; + + +/** + * Timer-style callbacks for focus-change animation + */ +class MActivePalette2FocusTimerObserver + { +public: + /** + * Called when a new item has been focused + */ + virtual void FocusUpdated() = 0; + + /** + * Called when the focus-change animation needs to be updated + */ + virtual void FocusAnimated() = 0; + }; + + +/** + * Timer-style callbacks for item-scroll animation + */ +class MActivePalette2ItemScrollTimerObserver + { +public: + /** + * Called when an item-scroll animation needs to be updated + */ + virtual void ItemsScrolled() = 0; + }; + + +/** + * Timer-style callbacks for appearance animation + */ +class MActivePalette2AppearanceTimerObserver + { +public: + /** + * Called when the palette-appearance animation needs to be updated + */ + virtual void PaletteAppearingAnimated() = 0; + }; + + +/** + * Descriptive-style callbacks for tooltip animation + */ +class MActivePalette2TooltipDescriptiveObserver + { +public: + /** + * Called when a tooltip animation is required + * @param aToShow If ETrue, the tooltip should be fully shown at the end of the animation; if EFalse, it should + * be fully hidden + * @param aTimeInMilliseconds The length of time the animation should take, in milliseconds + * @see CActivePalette2Model::AnimateTooltipRendererComplete + */ + virtual void AnimateTooltip(TBool aToShow, TInt aTimeInMilliseconds) = 0; + }; + + +/** + * Descriptive-style callbacks for focus-change animation + */ +class MActivePalette2FocusDescriptiveObserver + { +public: + /** + * Called when a focus-change animation is required + * @param aCurrentPos The screen position to start from + * @param aTargetPos The destination screen position + * @param aTimeInMilliseconds The duration of the animation, in milliseconds + * @see CActivePalette2Model::AnimateFocusRendererComplete() + */ + virtual void AnimateFocus(TInt aCurrentPos, TInt aTargetPos, TInt aTimeInMilliseconds) = 0; + }; + + +/** + * Descriptive-style callbacks for item-scroll animation + */ +class MActivePalette2ItemScrollDescriptiveObserver + { +public: + /** + * Called when an item-scroll animation is required + * @param aDirection +1 to move the items downwards, -1 to move them upwards + * @param aTimeInMilliseconds The length of time the animation should take, in milliseconds + * @see CActivePalette2Model::AnimateItemScrollRendererComplete + */ + virtual void AnimateItemScroll(TInt aDirection, TInt aTimeInMilliseconds) = 0; + }; + + +/** + * Descriptive-style callbacks for appearance animation + */ +class MActivePalette2AppearanceDescriptiveObserver + { +public: + /** + * Called when a palette-appearance animation is required + * @param aVisible The target state + * @param aTimeInMilliseconds The duration of the animation, in milliseconds + * @see CActivePalette2Model::AnimateAppearanceRendererComplete() + */ + virtual void AnimateAppearance(TBool aVisible, TInt aTimeInMilliseconds) = 0; + + /** + * Asks the implementing renderer to estimate where the appearance animation is up to + * @return The frame number, in relation to CActivePalette2Model::PaletteAppearingTotalFrames() + */ + virtual TInt GuessCurrentAppearanceFrame() = 0; + }; + +#endif //_ACTIVE_PALETTE_2_MODEL_OBSERVER_H diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2OpaqueStyler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2OpaqueStyler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Opaque Styler* +*/ + + +/** + * @file ActivePalette2OpaqueStyler.h + * Active Palette Opaque Styler + */ + +#ifndef _ACTIVE_PALETTE_2_OPAQUE_STYLER_H +#define _ACTIVE_PALETTE_2_OPAQUE_STYLER_H + +#include "ActivePalette2Styler.h" + +/** + * Renders the opaque drawing style 2D AP + */ +class CActivePalette2OpaqueStyler : public CActivePalette2Styler + { +public: + /** + * 2-stage construction + * @return The newly-created object + */ + static CActivePalette2OpaqueStyler* NewL(); + +/// @name From CActivePalette2Styler +//@{ + virtual void ConstructL(); + virtual void DrawItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask, TInt aOffsetFrame, TInt aOffsetTotal); + virtual void DrawGap(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal); + virtual void AnimItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask); + virtual void DrawTopScrollArrowSection(TBool aShowArrow); + virtual void DrawBottomScrollArrowSection(TBool aShowArrow); +//@} + }; + +#endif // _ACTIVE_PALETTE_2_OPAQUE_STYLER_H diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2SemiTransparentFadingStyler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2SemiTransparentFadingStyler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef ACTIVE_PALETTE_2_SEMI_TRANSPARENT_FADING_STYLER_H +#define ACTIVE_PALETTE_2_SEMI_TRANSPARENT_FADING_STYLER_H + + +// =========================================================================== +// Includes +#include "ActivePalette2SemiTransparentStyler.h" + + +// =========================================================================== +// Forward declarations +class CFbsBitmap; +class CFbsBitmapDevice; +class CBitmapContext; + + +// =========================================================================== +// Class declarations +class CActivePalette2SemiTransparentFadingStyler + : public CActivePalette2SemiTransparentStyler + { + public: + + static CActivePalette2SemiTransparentFadingStyler* NewL(); + + virtual ~CActivePalette2SemiTransparentFadingStyler(); + + public: + + virtual void BlitTooltip( CBitmapContext* aGc, + const TPoint& aPos, + TInt aCurrentPhase, + TInt aTotalPhases ); + + protected: + + virtual TInt TooltipNoseMaskId(); + virtual TInt TooltipBodyMaskId(); + + virtual void AllocateTooltipBufL(); + virtual void ReleaseTooltipBuf(); + + private: + + CFbsBitmap* iTooltipAlphaBitmap; + CFbsBitmapDevice* iTooltipAlphaDevice; + CBitmapContext* iTooltipAlphaContext; + + CFbsBitmap* iTooltipBlendedMaskBitmap; + CFbsBitmapDevice* iTooltipBlendedMaskDevice; + CBitmapContext* iTooltipBlendedMaskContext; + }; +#endif // ACTIVE_PALETTE_2_SEMI_TRANSPARENT_FADING_STYLER_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2SemiTransparentStyler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2SemiTransparentStyler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Styler* +*/ + + +/** + * @file ActivePalette2SemiTransparentStyler.h + * Active Palette Semi-transparent Styler + */ + + +#ifndef _ACTIVE_PALETTE_2_SEMI_TRANSPARENT_STYLER_H +#define _ACTIVE_PALETTE_2_SEMI_TRANSPARENT_STYLER_H + +#include "ActivePalette2Styler.h" + +/** + * Renders the semi-transparent drawing style 2D AP + */ +class CActivePalette2SemiTransparentStyler : public CActivePalette2Styler + { +public: + /** + * 2-stage construction + * @return The newly-created object + */ + static CActivePalette2SemiTransparentStyler* NewL(); + + /** + * Destructor + */ + ~CActivePalette2SemiTransparentStyler(); + +/// @name From CActivePalette2Styler +//@{ + virtual void ConstructL(); + virtual void DrawItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask, TInt aOffsetFrame, TInt aOffsetTotal); + virtual void DrawGap(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal); + virtual void AnimItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask); + virtual void DrawTopScrollArrowSection(TBool aShowArrow); + virtual void DrawBottomScrollArrowSection(TBool aShowArrow); +//@} + +protected: +/// @name From CActivePalette2Styler +//@{ + virtual TInt TooltipNoseMaskId(); + virtual TInt TooltipBodyMaskId(); +//@} + +private: + /// Mask for top section. Owned + CFbsBitmap* iAPTopSectionMask; + /// Mask for items. Owned + CFbsBitmap* iAPItemMask; + /// Mask for gaps. Owned + CFbsBitmap* iAPGapMask; + /// Mask for bottom section. Owned + CFbsBitmap* iAPBottomSectionMask; + }; + +#endif // _ACTIVE_PALETTE_2_SEMI_TRANSPARENT_STYLER_H diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2Styler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2Styler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,366 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Styler* +*/ + + +/** + * @file ActivePalette2Styler.h + * Active Palette Styler + */ + +#ifndef _ACTIVE_PALETTE_2_STYLER_H +#define _ACTIVE_PALETTE_2_STYLER_H + +#include +#include + +// Forward declarations +class CFbsBitmap; +class CFbsBitmapDevice; +class CFbsBitGc; +class CBitmapContext; +class CFont; + +/** + * Used to apply different rendering styles to the 2D Active Palette. + * Can not be directly instantiated: used as a base for further sub-classing + */ +class CActivePalette2Styler : public CBase + { + public: + + /** + * Draw the entire background for the item, and the supplied item on top + * @param aScreenPos The screen index of the item + * @param aIcon The item's icon + * @param aMask The item's mask + * @param aOffsetFrame The offset frame, in case of item-scrolling + * @param aOffsetTotal Total number of offset frames, in case of item-scrolling + */ + virtual void DrawItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask, TInt aOffsetFrame, TInt aOffsetTotal) = 0; + + /** + * Draw the between-item gap following the item at aScreenPos + * @param aScreenPos The screen index of the item + * @param aOffsetFrame The offset frame, in case of item-scrolling + * @param aOffsetTotal Total number of offset frames, in case of item-scrolling + */ + virtual void DrawGap(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal) = 0; + + /** + * Update only the area covered by the item graphic with an animation frame + * @param aScreenPos The screen index of the item + * @param aIcon The item's icon + * @param aMask The item's mask + */ + virtual void AnimItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask) = 0; + + /** + * Draws the top section of the AP, with optional arrow + * @param aShowArrow Whether to display the scroll indicator + */ + virtual void DrawTopScrollArrowSection(TBool aShowArrow) = 0; + + /** + * Draws the bottom section of the AP, with optional arrow + * @param aShowArrow Whether to display the scroll indicator + */ + virtual void DrawBottomScrollArrowSection(TBool aShowArrow) = 0; + + /** + * Draw the focus ring + * @param aScreenPos The screen index of the item + * @param aOffsetFrame The offset frame, in case of focus-moving + * @param aOffsetTotal Total number of offset frames, in case of focus-moving + */ + void DrawFocusRing(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal); + + /** + * Render a new tooltip to the buffer + * @param aText The tooltip text + * @return The total width of the tooltip, in pixels + */ + virtual TInt DrawTooltip(TDesC* aText); + + /** + * Sets the number of items shown on-screen + * @param aItems The new number of items + */ + void SetNumberOfItemsL(TInt aItems); + + /** + * The current size of the entire active palette + * @return Size of the active palette, in pixels + */ + TSize Size() const; + + /** + * Give the current "dirty" rect, i.e. the minimal rectangle that contains all updated regions + * since previous ClearDirtyRect + * @return Dirty rect + * @see ClearDirtyRect() + */ + TRect DirtyRect(); + + /** + * Resets the dirty rect + * @see DirtyRect() + */ + void ClearDirtyRect(); + + /** + * Blits the current AP buffer to the supplied context + * @param aGc The context to blit to + * @param aPos Where to blit to (the top-left corner of the AP) + * @param aClippingRect The portion of the AP to blit + */ + void BlitPalette(CBitmapContext* aGc, TPoint aPos, TRect aClippingRect) const; + + /** + * Blits the current tooltip buffer to the supplied context + * @param aGc The context to blit to + * @param aPos Where to blit to (the top-left corner of the tooltip) + * @param aClippingRect The portion of the tooltip to blit + */ + virtual void BlitTooltip(CBitmapContext* aGc, const TPoint& aPos, TRect aClippingRect); + + /** + * Blits the current tooltip to the supplied context. + * Phase of the tooltip is given and also the total number of phases. + * The effect of these depends on the styler, but e.g. the phase could + * determine the degree of visibility for the tooltip. + * @param aGc The context to blit to + * @param aPos Where to blit to (the top-left corner of the tooltip) + * @param aCurrentPhase The phase of the tooltip. + * @param aTotalPhases The amount of tooltip phases in total. + */ + virtual void BlitTooltip( CBitmapContext* aGc, const TPoint& aPos, TInt aCurrentPhase, TInt aTotalPhases ); + + /** + * Where the tooltip should appear, relative to the position of the AP + * @param aScreenPos The on-screen index of the item the tooltip is for + * @return The Y-offset of the tooltip + */ + TInt TootipYOffset(TInt aScreenPos); + + /** + * The total size of the rendered tooltip + * @return The total size of the rendered tooltip + */ + TSize TooltipSize(); + + /** + * Destructor + */ + ~CActivePalette2Styler(); + + protected: + + /** + * Constructor + */ + CActivePalette2Styler(); + + /** + * Second-phase leaving constructor + */ + virtual void ConstructL(); + + /** + * Add a rectangle to the current dirty rectangle + * @param aNewRect The rect to add + */ + void AddToDirtyRect(TRect aNewRect); + + /** + * General-purpose graphic-blitting method + * @param aPos Where to blit to + * @param aGraphicGc The context for the foreground + * @param aMaskGc The context for the mask + * @param aGraphic The image to blit + * @param aGraphicMask The mask for the image + * @param aMaskGraphic Whether to mask the image when blitting to aGraphicGc. + * @param aMaskMask Whether to mask the mask when blitting to aMaskGc. Mask is applied to itself. + */ + void BlitGraphic(TPoint aPos, CBitmapContext* aGraphicGc, CBitmapContext* aMaskGc, CFbsBitmap* aGraphic, CFbsBitmap* aGraphicMask, TBool aMaskGraphic, TBool aMaskMask); + + /** + * Blits a graphic to the centre of a given area + * @param aArea The area to blit inside + * @param aGraphicGc The context for the foreground + * @param aMaskGc The context for the mask + * @param aGraphic The image to blit + * @param aGraphicMask The mask for the image + * @param aMaskGraphic Whether to mask the image when blitting to aGraphicGc. + * @param aMaskMask Whether to mask the mask when blitting to aMaskGc. Mask is applied to itself. + */ + void CentreGraphic(TRect aArea, CBitmapContext* aGraphicGc, CBitmapContext* aMaskGc, CFbsBitmap* aGraphic, CFbsBitmap* aGraphicMask, TBool aMaskGraphic, TBool aMaskMask); + + /** + * The mask to use for the tooltip nose + * @return The mask to use for the tooltip nose + */ + virtual TInt TooltipNoseMaskId(); + + /** + * The mask to use for the tooltip body + * @return The mask to use for the tooltip body + */ + virtual TInt TooltipBodyMaskId(); + + /** + * The rectangle of the top section, relative to the top-left of the AP + * @return The top section area + */ + inline TRect TopSectionRect(); + + /** + * The rectangle of the bottom section, relative to the top-left of the AP + * @return The bottom section area + */ + inline TRect BottomSectionRect(); + + /** + * The rectangle of the given item number, relative to the top-left of the AP + * @param aScreenPos The screen index of the item + * @param aOffsetFrame The offset frame, in case of item-scrolling + * @param aOffsetTotal Total number of offset frames, in case of item-scrolling + * @return The item area + */ + inline TRect ItemRect(TInt aScreenPos, TInt aOffsetFrame = 0, TInt aOffsetTotal = 1); + + /** + * The rectangle of the gap following the given item number, relative to the top-left of the AP + * @param aScreenPos The screen index of the item + * @param aOffsetFrame The offset frame, in case of item-scrolling + * @param aOffsetTotal Total number of offset frames, in case of item-scrolling + * @return The gap area + */ + inline TRect GapRect(TInt aScreenPos, TInt aOffsetFrame = 0, TInt aOffsetTotal = 1); + + /** + * Allocate the tooltip draw buffers + */ + virtual void AllocateTooltipBufL(void); + + /** + * Release the tooltip draw buffers + */ + virtual void ReleaseTooltipBuf(void); + + private: + + /** + * Renders the complete tooltip + * @param aText The tooltip text + */ + void RenderTooltip(TDesC* aText); + + /** + * Allocate all the AP draw buffers + */ + void AllocateDrawBufL(void); + + /** + * Release the AP draw buffers + */ + void ReleaseDrawBuf(void); + + protected: + + /// The draw buffer bitmap. Owned + CFbsBitmap* iDrawBufBitmap; + /// The draw buffer device. Owned + CFbsBitmapDevice* iDrawBufDevice; + /// The draw buffer context. Owned + CBitmapContext* iDrawBufContext; + + /// The draw buffer mask bitmap. Owned + CFbsBitmap* iDrawBufMaskBitmap; + /// The draw buffer mask device. Owned + CFbsBitmapDevice* iDrawBufMaskDevice; + /// The draw buffer mask context. Owned + CBitmapContext* iDrawBufMaskContext; + + /// Tooltip buffer bitmap. Owned + CFbsBitmap* iTooltipBufBitmap; + /// Tooltip buffer device. Owned + CFbsBitmapDevice* iTooltipBufDevice; + /// Tooltip buffer context. Owned + CBitmapContext* iTooltipBufContext; + + /// Tooltip mask buffer bitmap. Owned + CFbsBitmap* iTooltipBufMaskBitmap; + /// Tooltip mask buffer device. Owned + CFbsBitmapDevice* iTooltipBufMaskDevice; + /// Tooltip mask buffer context. Owned + CBitmapContext* iTooltipBufMaskContext; + + /// Number of items on-screen + TInt iNumItems; + /// Number of gaps inbetweeen the items + TInt iNumGaps; + + /// Current dirty rectangle + TRect iDirtyRect; + /// Whether the dirty rect has yet been written to + TBool iDirtyRectExists; + + /// The font used for the tooltip text. Not owned. + const CFont* iFont; + + /// The width of the tooltip text alone + TInt iTextWidth; + + /// The up-arrow bitmap. Owned + CFbsBitmap* iScrollUpIcon; + /// The up-arrow bitmap mask. Owned + CFbsBitmap* iScrollUpIconMask; + + /// The down-arrow bitmap. Owned + CFbsBitmap* iScrollDownIcon; + /// The down-arrow bitmap mask. Owned + CFbsBitmap* iScrollDownIconMask; + + /// The focus-ring bitmap. Owned + CFbsBitmap* iFocusRing; + /// The focus-ring bitmap mask. Owned + CFbsBitmap* iFocusRingMask; + + /// The tooltip-nose bitmap. Owned + CFbsBitmap* iTooltipNose; + /// The tooltip-nose bitmap mask. Owned + CFbsBitmap* iTooltipNoseMask; + /// The tooltip-body bitmap. Owned + CFbsBitmap* iTooltipBody; + /// The tooltip-body bitmap mask. Owned + CFbsBitmap* iTooltipBodyMask; + + /// The top-section bitmap. Owned + CFbsBitmap* iAPTopSection; + /// The item background bitmap. Owned + CFbsBitmap* iAPItem; + /// The gap bitmap. Owned + CFbsBitmap* iAPGap; + /// The bottom-section bitmap. Owned + CFbsBitmap* iAPBottomSection; + + /// The current rectangle that encompasses only the items + TRect iItemsRect; + }; + +#include "ActivePalette2Styler.inl" + +#endif // #ifdef _ACTIVE_PALETTE_2_STYLER_H diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2Styler.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2Styler.inl Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Styler inline methods* +*/ + + +/** + * @file ActivePalette2Styler.inl + * Active Palette Styler inline methods + */ + +#include "ActivePalette2Cfg.h" +#include "ActivePalette2Utils.h" + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::TopSectionRect() +// ----------------------------------------------------------------------------- +// +inline TRect CActivePalette2Styler::TopSectionRect() + { + return TRect(TPoint(0,0), TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight))); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::BottomSectionRect() +// ----------------------------------------------------------------------------- +// +inline TRect CActivePalette2Styler::BottomSectionRect() + { + return TRect(TPoint(0, ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) + iNumItems * ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + iNumGaps * ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)), + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EBottomSectionHeight))); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::ItemRect() +// ----------------------------------------------------------------------------- +// +inline TRect CActivePalette2Styler::ItemRect(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal) + { + TInt offset = ((ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) * aOffsetFrame) / aOffsetTotal; + return TRect(TPoint(0, ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) + aScreenPos * (ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) - offset), + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight))); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::GapRect() +// ----------------------------------------------------------------------------- +// +inline TRect CActivePalette2Styler::GapRect(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal) + { + TInt offset = ((ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) * aOffsetFrame) / aOffsetTotal; + return TRect(TPoint(0, ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) + (aScreenPos+1) * (ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) - ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems) - offset), + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems))); + } + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2StylerFactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2StylerFactory.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Styler Factory* +*/ + + +/** + * @file ActivePalette2StylerFactory.h + * Active Palette Styler Factory + */ + +#ifndef _ACTIVE_PALETTE_2_STYLER_FACTORY_H +#define _ACTIVE_PALETTE_2_STYLER_FACTORY_H + + +#include + +class CActivePalette2Styler; + +/** + * Factory class to generate CActivePalette2Styler instances. + */ +class ActivePalette2StylerFactory + { +public: + /** + * Creates a styler based on the supplied draw mode + * @param aDrawMode The draw mode to implement + * @return The instantiated styler + */ + static CActivePalette2Styler* CreateStylerL(TActivePalette2DrawMode aDrawMode); + }; + +#endif // _ACTIVE_PALETTE_2_STYLER_FACTORY_H diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2Tooltip.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2Tooltip.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Tooltip interface* +*/ + + +/** + * @file ActivePalette2Tooltip.h + * Active Palette Tooltip interface + */ + +#ifndef _ACTIVE_PALETTE_2_TOOLTIP_H +#define _ACTIVE_PALETTE_2_TOOLTIP_H + +// INCLUDES +#include +#include +#include + +#include "ActivePalette2Const.h" + +// FORWARD DECLARATIONS +class CActivePalette2Model; +class CActivePalette2BasicUI; +class CActivePalette2Styler; + +// CLASS DECLARATIONS + +/** + * 2D tooltip renderer for Active Palette 2. + */ +class CActivePalette2Tooltip : public CCoeControl + { + public: + + /** + * 2-stage construction + * @param aParent Parent renderer + * @param aModel Model driving the animation + * @param aStyler Rendering styler to use + */ + static CActivePalette2Tooltip * NewL( const CActivePalette2BasicUI* aParent, + CActivePalette2Model* aModel, + CActivePalette2Styler* aStyler ); + + /** + * Destructor + */ + virtual ~CActivePalette2Tooltip(); + + public: // From CCoeControl + + /** + * Draw's the tooltip within the specified rectangle + * @param aRect The rectangle to draw within + */ + virtual void Draw( const TRect& aRect ) const; + + public: // New methods + + /** + * Sets the on-screen postion of the AP. The tooltip is drawn relative to this point. + * @param aAnchor The AP position + */ + virtual void SetAnchor( TPoint aAnchor ); + + /** + * Called when a new tooltip is first required + * @return Total length, in pixels, of tooltip + */ + virtual TInt TooltipUpdated(); + + /** + * Called when tooltip animation requires an update + */ + virtual void TooltipAnimated(); + + /** + * Sets the graphics context to draw to. + * @param aGc The graphics context to draw to + */ + virtual void SetGc( CBitmapContext* aGc = NULL ); + + /** + * Draw the pre-rendered tooltip to the screen + */ + virtual void ProduceTooltipToScreen( TBool aActivateGc ) const; + + protected: + + /** + * Returns where the tooltip should currently be on-screen + * @return Where the tooltip should currently be on-screen + */ + virtual TRect TooltipRect() const; + + protected: // Methods + + /** + * Constructor + * @param aModel Model driving the animation + * @param aStyler Rendering styler to use + */ + CActivePalette2Tooltip( CActivePalette2Model* aModel, + CActivePalette2Styler* aStyler ); + + /** + * Leaving constructor + */ + void ConstructL( const CActivePalette2BasicUI* aParent ); + + protected: // Data + + /// The position of the parent AP + TPoint iAnchor; + + /// The controlling model. Not owned. + CActivePalette2Model* iModel; + + /// The parent renderer. Not owned. + const CActivePalette2BasicUI* iParent; + + /// The rendering styler to use. + CActivePalette2Styler* iStyler; + + /// The context to render to. If NULL (default), the screen is used. Not owned + CBitmapContext* iRenderGc; + + /// Where the palette was last rendered + mutable TRect iRenderedRect; + }; + +#endif // _ACTIVE_PALETTE_2_TOOLTIP_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/ActivePalette2Utils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/ActivePalette2Utils.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette utilities* +*/ + + +/** + * @file ActivePalette2Utils.h + * Active Palette utilities + */ + +#ifndef _ACTIVE_PALETTE_2_UTILS_H +#define _ACTIVE_PALETTE_2_UTILS_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CFbsBitmap; +class CFbsBitmapDevice; +class CBitmapContext; + + +// CLASS DECLARATIONS + +/** + * General utility class for Active Palette + */ +class ActivePalette2Utils + { +public: + // Enum declarations + // General AP dimensions + enum TAPDimension + { + EItemWidth, + EItemHeight, + EPaletteWidth, + ETopSectionHeight, + EBottomSectionHeight, + EGapBetweenItems, + EItemXOffset, + EFocusRingWidth, + EFocusRingHeight, + EFocusRingXOffset, + EFocusRingYOffset, + ETooltipYOffset, + ETooltipHeight, + ETooltipWidth, + ETooltipBaseline, + ETooltipTail, + ETooltipNose, + E3dTooltipTextYOffset, + E3dTooltipMaxWidth, + EGenericParam + }; + + // Size AP dimensions + enum TAPDimensionSize + { + EItemSize, + E3dPaletteTextureSize, + E3dScrollIconSize, + E3dFocusRingSize + }; + + // Point AP dimensions + enum TAPDimensionPoint + { + EDefault2dPaletteOffset, + EDefault3dPaletteOffset, + E3dScrollIconOffset, + E3dFocusRingOffset, + E3dTooltipOffset + }; + +public: + /* + * Create drawing objects + * @param aSize Bitmap size + * @param aBitmap Pointer in which to store created CFbsBitmap + * @param aDevice Pointer in which to store created aDevice + * @param aGc Pointer in which to store created aGc + */ + static void CreateDrawingObjectsL(const TSize aSize, + CFbsBitmap** aBitmap, + CFbsBitmapDevice** aDevice, + CBitmapContext** aGc); + + /* + * Create drawing objects + * @param aDisplayMode The colour depth to use + * @param aSize Bitmap size + * @param aBitmap Pointer in which to store created CFbsBitmap + * @param aDevice Pointer in which to store created aDevice + * @param aGc Pointer in which to store created aGc + */ + static void CreateDrawingObjectsL(const TDisplayMode aDisplayMode, + const TSize aSize, + CFbsBitmap** aBitmap, + CFbsBitmapDevice** aDevice, + CBitmapContext** aGc); + + /* + * Create drawing objects and push created items onto the cleanup stack + * @param aSize Bitmap size + * @param aBitmap Pointer in which to store created CFbsBitmap + * @param aDevice Pointer in which to store created aDevice + * @param aGc Pointer in which to store created aGc + */ + static void CreateDrawingObjectsLC(const TDisplayMode aDisplayMode, + const TSize aSize, + CFbsBitmap** aBitmap, + CFbsBitmapDevice** aDevice, + CBitmapContext** aGc); + + /* + * Delete drawing objects + * @param aBitmap Pointer to CFbsBitmap to delete + * @param aDevice Pointer to aDevice to delete + * @param aGc Pointer to aGc to delete + */ + static void DeleteDrawingObjects(CFbsBitmap** aBitmap, + CFbsBitmapDevice** aDevice, + CBitmapContext** aGc); + + /* + * Return the dimension of a requested type of active palette + * part. Dimensions scale according to device resolution. + * @param aDimensionType a type which determines which dimension to return + * @param aGeneric a parameter to convert any TInt to the correct size + */ + static TInt APDimension( TAPDimension aDimensionType, TInt aGeneric = 0 ); + + /* + * Return the dimension size of a requested type of active palette + * part. Dimensions scale according to device resolution. + * @param aDimensionSizeType type which determines which dimension to return + */ + static TSize APDimensionSize( TAPDimensionSize aDimensionSize ); + + /* + * Return the dimension point of a requested type of active palette + * part. Dimensions scale according to device resolution. + * @param aDimensionPoint type which determines which point to return + */ + static TPoint APDimensionPoint( TAPDimensionPoint aDimensionPoint ); + + + }; + +#endif // _ACTIVE_PALETTE_2_UTILS_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/CActivePalettePluginBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/CActivePalettePluginBase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,350 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette plugin base class* +*/ + + +/** + * @file CActivePalettePluginBase.h + * Active Palette plugin base class + */ + +#ifndef CACTIVEPALETTEPLUGINBASE_H +#define CACTIVEPALETTEPLUGINBASE_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CActivePalettePluginBase; +class CGulIcon; +class CFbsBitmap; +class CFbsBitmapDevice; +class CBitmapContext; + +// CLASS DECLARATIONS + +/** + * Plugin observer class. + * Plugins should use this to communicate with the Active Palette. + */ +class MActivePalettePluginObserver + { + public: + /** + * Notifies of the creation of the plugin + * @param aPlugin A pointer to the plugin + */ + virtual void NotifyPluginCreated(CActivePalettePluginBase* aPlugin) = 0; + + /** + * Notifies of the destruction of the plugin + * @param aPlugin A pointer to the plugin + */ + virtual void NotifyPluginDestroyed(CActivePalettePluginBase* aPlugin) = 0; + + /** + * Assign icon for plugin obect's item + * @param aIcon A pointer to the icon + * @param aOnwershipTransfer Whether to transfer ownership + */ + virtual void SetItemIcon(CGulIcon* aIcon, TBool aOnwershipTransfer) = 0; + + /** + * Assign tool tip for plugin obect's item + * @param aTooltipText A descriptor containing the new tooltip text + */ + virtual void SetItemTooltipL(const TDesC& aTooltipText) = 0; + + /** + * Assign icon and tooltip for plugin obect's item + * @param aIcon The new icon + * @param aOnwershipTransfer Whether the AP should take ownership of the icon + * @param aTooltipText The new tooltip text + */ + virtual void SetItemIconAndTooltipL(CGulIcon* aIcon, + TBool aOnwershipTransfer, + const TDesC& aTooltipText) = 0; + + /** + * Notify comletion of handling of user's item selection + * @param aDataDes Data descriptor + */ + virtual void NotifyItemComplete(const TDesC8& aDataDes) = 0; + + /** + * Notify comletion of handling of user's item selection + * @param aDataInt Data integer + */ + virtual void NotifyItemComplete(TInt aDataInt) = 0; + + /** + * Send message to application + * @param aMessageID The message ID + * @param aDataDes Data descriptor + */ + virtual void SendMessage(TInt aMessageID, const TDesC8& aDataDes) = 0; + + /** + * Send message to application + * @param aMessageID The message ID + * @param aDataInt Data integer + */ + virtual void SendMessage(TInt aMessageID, TInt aDataInt) = 0; + }; + +/** + * Namespace for the plugin factory + */ +namespace NActivePalettePluginFactory + { + /** + * Definition for data that PLUGIN gets upon its creation + */ + class TPluginCreationParams + { + public: + /** + * Return a reference to the observer + * @return A reference to the observer + */ + IMPORT_C MActivePalettePluginObserver& PluginObserver(void) const; + + /** + * Return the dimensions + * @return The dimensions + */ + IMPORT_C TSize Dimensions(void) const; + + /** + * Constructor + * @param aObserver A reference to the observer + * @param aDimensions The dimensions + */ + IMPORT_C TPluginCreationParams(MActivePalettePluginObserver &aObserver, + const TSize& aDimensions); + + private: + /// The observer + MActivePalettePluginObserver& iObserver; + /// Size of the icons used + TSize iDimensions; + }; + + /** + * Prototype for plugin DLL factory function + */ + typedef CActivePalettePluginBase * (* TInstantiatePluginLFunc)(const TUid& aPluginUid, + const TPluginCreationParams& aCreationParams); + + /// Entry ordinal to use for plugin creation + const TInt KFactoryEntryOrdinal = 1; + } + + +/** + * Animation helper for plugins. + * Contains default icon animation (shrinks, then returns to normal) + */ +class CAnimationHelper : public CBase + { + private: + /** + * Constructor + */ + CAnimationHelper(); + + /** + * Symbian leaving constructor + * @param aSize Size + * @param aMaskNeeded Indicates if a mask is needed or not + */ + void ConstructL(const TSize aSize, const TBool aMaskNeeded); + + public: + /** + * Destructor + */ + ~CAnimationHelper(); + + /** + * Constructor + * @param aSize Size + * @param aMaskNeeded Indicates if a mask is needed or not + */ + static CAnimationHelper* NewL(const TSize aSize, const TBool aMaskNeeded); + + public: + /// Current frame bitmap. + CFbsBitmap* iFrame; + /// Current frame device. + CFbsBitmapDevice* iFrameDevice; + /// Current frame context. + CBitmapContext* iFrameGc; + + /// Current frame mask bitmap. + CFbsBitmap* iFrameMask; + /// Current frame mask device. + CFbsBitmapDevice* iFrameMaskDevice; + /// Current frame mask context. + CBitmapContext* iFrameMaskGc; + }; + +/** + * Plugin base class + */ +class CActivePalettePluginBase : public CBase + { + public: + /** + * Reserved for internal use in this version + */ + class TPluginAnimationInfo + { + public: + /// Number of frames in animation + TInt iNofFrames; + /// Interval between frames + TInt iFrameTimeGapMs; + /// Dimensions of icons + TSize iFrameSize; + }; + + /** + * The type of animation to perform + */ + enum TPluginAnimationType + { + EAniInvalid, ///< Invalid animation + EAniFocused = 2 ///< Focus animation + }; + + protected: + + /** + * Constructor + */ + IMPORT_C CActivePalettePluginBase(const NActivePalettePluginFactory::TPluginCreationParams& aCreationParams); + + /** + * Returns a reference to the plugin observer + * @return A reference to the plugin observer + */ + inline MActivePalettePluginObserver& PluginObserver(void) const; + + public: + + /** + * Destructor + */ + IMPORT_C virtual ~CActivePalettePluginBase(void); + + /** + * Handling of user's item selection + * @warning MUST BE IMPLEMENTED BY PLUGIN + */ + IMPORT_C virtual void HandleItemSelectedL(void) = 0; + + /** + * Handling of message from application + * @warning SHOULD BE IMPLEMENTED BY PLUGIN + * @param aMessageID The message ID + * @param aDataDes Data descriptor + * @param aDataInt Data integer + */ + IMPORT_C virtual void HandleMessageL(TInt aMessageID, + const TDesC8& aDataDes, + TInt aDataInt); + + /** + * 2nd phase constructor + * @warning MUST BE IMPLEMENTED BY PLUGIN + * @param aCreationParams A reference to the construction parameter class to use + * @param aCustomDataDes Data descriptor + * @param aCustomDataInt Data integer + */ + IMPORT_C virtual void ConstructL(const NActivePalettePluginFactory::TPluginCreationParams& aCreationParams, + const TDesC8& aCustomDataDes, + TInt aCustomDataInt); + + /** + * Resource destruction + * @warning MAY BE IMPLEMENTED BY PLUGIN + * (possible to use AP services) + */ + IMPORT_C virtual void Shutdown(void); + + /** + * Reserved for internal use in this version + * @param aAniType + * @param aAniInfo + * @param aDefaultAniInfo + * @param aItemIcon + * @param aItemIconMask + */ + IMPORT_C virtual void PrepareAniFramesL(TInt aAniType, + TPluginAnimationInfo& aAniInfo, + const TPluginAnimationInfo& aDefaultAniInfo, + const CFbsBitmap & aItemIcon, + const CFbsBitmap * aItemIconMask); + + /** + * Release the frames used in the animation + * @param aAniType + */ + IMPORT_C virtual void ReleaseAniFrames(TInt aAniType); + + /** + * Produces an animation frame + * @param aAniType + * @param aFrameNo + * @param aAniInfo + * @param aItemIcon + * @param aItemIconMask + * @param aFrame + * @param aFrameMask + * @param aOwnershipTransferForFrame + * @param aOwnershipTransferForMask + */ + IMPORT_C virtual void ProduceAniFrame(TInt aAniType, + TInt aFrameNo, + const TPluginAnimationInfo& aAniInfo, + const CFbsBitmap & aItemIcon, + const CFbsBitmap * aItemIconMask, + CFbsBitmap** aFrame, + CFbsBitmap** aFrameMask, + TBool& aOwnershipTransferForFrame, + TBool& aOwnershipTransferForMask); + + private: + /// The plugin observer + MActivePalettePluginObserver& iPluginObserver; + + /// The animation helper + CBase* iAnimationHelper; + }; + +// ----------------------------------------------------------------------------- +// CActivePalettePluginBase::PluginObserver() +// ----------------------------------------------------------------------------- +// +inline MActivePalettePluginObserver & CActivePalettePluginBase::PluginObserver(void) const + { + return iPluginObserver; + }; + +#endif // CACTIVEPALETTEPLUGINBASE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/activepalette2configuration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/activepalette2configuration.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 Configuration details +* +*/ + + +#ifndef ACTIVE_PALETTE_2_CONFIGURATION_H +#define ACTIVE_PALETTE_2_CONFIGURATION_H + +// =========================================================================== +// Includes +#include +#include // for TActivePalette2DrawMode + + +// =========================================================================== +// Declarations +struct TActivePalette2TooltipConfig + { + TActivePalette2TooltipConfig() + : iPreshowDelay ( -1 ) + , iFullshowPeriod ( -1 ) + , iTimerTickLength ( -1 ) + , iTransitionSpeed ( -1 ) + , iTransitionFrames( -1 ) + {}; + + TInt iPreshowDelay; + TInt iFullshowPeriod; + TInt iTimerTickLength; + TInt iTransitionSpeed; // For scrolling tooltip + TInt iTransitionFrames; // For fading tooltip + }; + +class CActivePalette2Configuration : public CBase + { + // ======================================================= + // Methods + public: + + static CActivePalette2Configuration* NewL( TActivePalette2DrawMode aDrawMode ); + virtual ~CActivePalette2Configuration(); + + protected: + + void ConstructL(); + CActivePalette2Configuration( TActivePalette2DrawMode aDrawMode ); + + public: + + /** + * Return the Tooltip details. + * @param aTooltipTimes Structure where the details are filled. + */ + void TooltipConfiguration( TActivePalette2TooltipConfig& aTooltipTimes ); + + // ======================================================= + // Data + protected: + + TActivePalette2DrawMode iDrawMode; + + // ======================================================= + }; +#endif // ACTIVE_PALETTE_2_CONFIGURATION_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/activepalette2tooltipfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/activepalette2tooltipfactory.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 Tooltip Factory class +* +*/ + + +#ifndef ACTIVE_PALETTE_2_TOOLTIP_FACTORY_H +#define ACTIVE_PALETTE_2_TOOLTIP_FACTORY_H + + +// =========================================================================== +// Includes +#include + + +// =========================================================================== +// Forward declarations +class CActivePalette2Tooltip; +class CActivePalette2BasicUI; +class CActivePalette2Model; +class CActivePalette2Styler; + + +// =========================================================================== +// Class declarations +/** +* Factory class to generate Tooltip instances. +*/ +class ActivePalette2TooltipFactory + { + public: + + /** + * Creates a tooltip based on the supplied draw mode + * @param aDrawMode The draw mode to implement + * @return The instantiated tooltip + */ + static CActivePalette2Tooltip* CreateTooltipL( TActivePalette2DrawMode aDrawMode, + const CActivePalette2BasicUI* aParent, + CActivePalette2Model* aModel, + CActivePalette2Styler* aStyler ); + }; + +#endif // ACTIVE_PALETTE_2_TOOLTIP_FACTORY_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Inc/activepalette2tooltipfading.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Inc/activepalette2tooltipfading.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 Tooltip that fades in and out +* +*/ + + +#ifndef ACTIVE_PALETTE_2_TOOLTIP_FADING_H +#define ACTIVE_PALETTE_2_TOOLTIP_FADING_H + +// =========================================================================== +// Includes +#include "ActivePalette2Tooltip.h" + + +// =========================================================================== +// Forward declarations +class CActivePalette2Model; +class CActivePalette2BasicUI; +class CActivePalette2Styler; + + +// =========================================================================== +// Class declarations +class CActivePalette2TooltipFading : public CActivePalette2Tooltip + { + // ======================================================= + // Methods + + // ------------------------------------------------------- + // Constructors and destructor + public: + + static CActivePalette2TooltipFading* NewL( const CActivePalette2BasicUI* aParent, + CActivePalette2Model* aModel, + CActivePalette2Styler* aStyler ); + virtual ~CActivePalette2TooltipFading(); + + protected: + + void ConstructL( const CActivePalette2BasicUI* aParent ); + + CActivePalette2TooltipFading( CActivePalette2Model* aModel, + CActivePalette2Styler* aStyler ); + + // ------------------------------------------------------- + // From CActivePalette2Tooltip + public: + + /** + * Draw the tooltip. + */ + virtual void ProduceTooltipToScreen( TBool aActivateGc ) const; + + protected: + + /** + * Current tooltip rectangle. + */ + virtual TRect TooltipRect() const; + + // ======================================================= + // Data + protected: + + // ======================================================= + }; + +#endif // ACTIVE_PALETTE_2_TOOLTIP_FADING_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2BasicUI.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2BasicUI.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,990 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: AP implementation using standard Symbian controls* +*/ + + +/** + * @file ActivePalette2BasicUI.cpp + * AP implementation using standard Symbian controls + */ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ActivePalette2BasicUI.h" +#include "ActivePalette2Styler.h" +#include "ActivePalette2StylerFactory.h" +#include "ActivePalette2Item.h" +#include "ActivePalette2Cfg.h" +#include "activepalette2configuration.h" +#include "ActivePalette2Logger.h" +#include "ActivePalette2Utils.h" +#include "ActivePalette2Model.h" +#include "ActivePalette2Const.h" +#include "ActivePalette2Tooltip.h" +#include "activepalette2tooltipfactory.h" + + +// ================= MEMBER FUNCTIONS ======================= + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::NewL() +// Symbian 2 phase constructor +// ----------------------------------------------------------------------------- +// +CActivePalette2BasicUI* CActivePalette2BasicUI::NewL(TActivePalette2DrawMode aDrawMode) + { + CActivePalette2BasicUI* self = new (ELeave) CActivePalette2BasicUI(); + CleanupStack::PushL(self); + self->ConstructL(aDrawMode); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::CActivePalette2BasicUI() +// C++ constructor +// ----------------------------------------------------------------------------- +// + +CActivePalette2BasicUI::CActivePalette2BasicUI(): + iNavigationKeys() // default navigation keys + { + LOGTEXT( _L( "CActivePalette2BasicUI::CActivePalette2BasicUI")); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::ConstructL +// Leaving constructor +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::ConstructL(TActivePalette2DrawMode aDrawMode ) + { + LOGTEXT( _L( "CActivePalette2BasicUI::ConstructL entered")); + + // UI sizes and dimensions + AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, iScreenSize ); + + iTopLeftCorner.iX = iScreenSize.iWidth + ActivePalette2Utils::APDimensionPoint(ActivePalette2Utils::EDefault2dPaletteOffset).iX; + iTopLeftCorner.iY = ActivePalette2Utils::APDimensionPoint(ActivePalette2Utils::EDefault2dPaletteOffset).iY; + + iDrawMode = aDrawMode; + + iStyler = ActivePalette2StylerFactory::CreateStylerL(aDrawMode); + + TRendererCallBacks callBacks; + callBacks.iTooltipTimer = this; + callBacks.iFocusTimer = this; + callBacks.iItemScrollTimer = this; + callBacks.iAppearanceTimer = this; + + // Configuration provider + iConfiguration = CActivePalette2Configuration::NewL( aDrawMode ); + + // model + iModel = CActivePalette2Model::NewL( *this, + ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::EItemSize ), + callBacks, + iConfiguration ); + // valid model required from this point + + iTooltipNote = ActivePalette2TooltipFactory::CreateTooltipL( aDrawMode, this, iModel, iStyler ); + iTooltipNote->SetAnchor(iTopLeftCorner); + + ReCalcAutoSizeL(); + + // enter idle + RedrawIdle(EFalse); + + ActivateL(); + + LOGTEXT( _L( "CActivePalette2BasicUI::ConstructL left")); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::~CActivePalette2BasicUI() +// Destructor +// ----------------------------------------------------------------------------- +// +CActivePalette2BasicUI::~CActivePalette2BasicUI() + { + LOGTEXT( _L( "CActivePalette2BasicUI::~CActivePalette2BasicUI entered")); + + delete iTooltipNote; + iTooltipNote = NULL; + + delete iStyler; + iStyler = NULL; + + delete iConfiguration; + iConfiguration = NULL; + + delete iModel; + iModel = NULL; + + LOGTEXT( _L( "CActivePalette2BasicUI::~CActivePalette2BasicUI left")); + } + + + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::Draw() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::Draw(const TRect& aRect) const + { + LOGTEXT( _L( "CActivePalette2BasicUI::Draw entered" )); + + if ( !iRenderGc ) + { + // Flush buf to the screen + ProducePaletteToScreen(aRect); + + if ( iTooltipNote ) + { + iTooltipNote->Draw(aRect); + } + } + + LOGTEXT( _L( "CActivePalette2BasicUI::Draw left" )); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::RedrawIdle() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::RedrawIdle(TBool aForceDisplayUpdate) const + { + const TRect rect(TPoint(0,0),TPoint(Rect().Width(), Rect().Height())); + + // Invalidating and redrawing the toolbar background at this point causes + // blinking and is unnecessary. Background will be redrawn with the toolbar. + /* + if ( iAPObserver ) + { + TRect rectToFlush(DrawBufRectToScreenRect(rect)); + + if ( rectToFlush.Size().iWidth > 0 && rectToFlush.Size().iHeight > 0 ) + { + if ( !iRenderGc ) + { + Window().Invalidate(rectToFlush); + ActivateGc(); + Window().BeginRedraw(rectToFlush); + } + + iAPObserver->Redraw(rectToFlush); + + if ( !iRenderGc ) + { + Window().EndRedraw(); + DeactivateGc(); + } + } + } + */ + + iStyler->DrawTopScrollArrowSection(iModel->ShowTopScrollIndicator()); + + TInt num_items = iModel->CountItemsOnScreen(); + if ( iModel->ItemScrollOffset() != 0 ) + { + num_items++; + } + + TInt index; + for (index = 0; index < num_items; index++) + { + CActivePalette2Item* item = iModel->ItemFromScreenPos(index); + + if ( item ) + { + iStyler->DrawItem(index, &item->Icon(), item->Mask(), iModel->ItemScrollOffset(), iModel->ItemScrollTotalFrames()); + if (index+1 < num_items) + { + iStyler->DrawGap(index, iModel->ItemScrollOffset(), iModel->ItemScrollTotalFrames()); + } + } + } + + iStyler->DrawBottomScrollArrowSection(iModel->ShowBottomScrollIndicator()); + + if ( iModel->PaletteActive() + && iModel->CountItemsOnScreen() > 0 ) + { + TInt focusedItem = iModel->FocusedItem(); + iStyler->DrawFocusRing(focusedItem, iModel->FocusCurrentOffset(), iModel->FocusCurrentTotalOffsetFrames()); + iFocusedItem1 = focusedItem; + iFocusedItem2 = focusedItem + 1; + } + + if (aForceDisplayUpdate) + { + DrawDeferred(); + + if ( iRenderGc && iAPObserver ) + { + iAPObserver->ActivePaletteUpdated(); + } + } + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::ProducePaletteToScreen() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::ProducePaletteToScreen(const TRect& aRect) const + { + if ( iAPObserver ) + { + TRect redrawRect(aRect); + redrawRect.Intersection(iRenderedRect); + if ( redrawRect.Size().iHeight > 0 && redrawRect.Size().iWidth > 0 ) + { + iAPObserver->Redraw(redrawRect); + } + } + + iRenderedRect = TRect(PalettePosition(), iStyler->Size()); + + if ( iRenderGc ) + { + iStyler->BlitPalette(iRenderGc, PalettePosition(), ScreenRectToDrawBufRect(aRect)); + } + else + { + iStyler->BlitPalette(&SystemGc(), PalettePosition(), ScreenRectToDrawBufRect(aRect)); + } + + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::FlushBufNow() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::FlushBufNow(const TRect& aRectToFlush) + { + if ( !iRenderGc ) + { + Window().Invalidate(aRectToFlush); + ActivateGc(); + Window().BeginRedraw(aRectToFlush); + } + + ProducePaletteToScreen(aRectToFlush); + + if ( !iRenderGc ) + { + Window().EndRedraw(); + DeactivateGc(); + } + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SetCurrentItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::SetCurrentItem(const TInt aItemId) + { + return iModel->SetCurrentItem(aItemId); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::GetCurrentItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::GetCurrentItem(TInt & aItemId) const + { + return iModel->GetCurrentItem(aItemId); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SizeChanged() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::SizeChanged(void) + { + LOGTEXT( _L( "CActivePalette2BasicUI::SizeChanged") ); + CCoeControl::SizeChanged(); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SetNavigationKeys() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::SetNavigationKeys(const TActivePalette2NavigationKeys & aNavigationKeys) + { + iNavigationKeys = aNavigationKeys; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SetObserver() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::SetObserver(MActivePalette2Observer * aObserver) + { + iAPObserver = aObserver; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SendMessage() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::SendMessage(TInt aItemId, TInt aMessageId, const TDesC8& aDataDes) + { + return iModel->SendMessage(aItemId, aMessageId, aDataDes); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SendMessage() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::SendMessage(const TInt aItemId, const TInt aMessageId, const TInt aDataInt) + { + return iModel->SendMessage(aItemId, aMessageId, aDataInt); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::ReCalcAutoSizeL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::ReCalcAutoSizeL(void) + { + iStyler->SetNumberOfItemsL(iModel->CountItemsOnScreen()); + + TRect newRect(TPoint(0,0),iStyler->Size()); + newRect.Move(PalettePosition()); + SetRect(newRect); + } + + +// ----------------------------------------------------------------------------- +// TInt CActivePalette2BasicUI::InstallItemL() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + const TDesC8& aCustomDataDes) + { + return iModel->InstallItemL(aItemVisible, aPluginUid, aCustomDataDes); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::InstallItemL() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt) + { + return iModel->InstallItemL(aItemVisible, aPluginUid, aCustomDataInt); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::InstallItemL() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt, + const TDesC8& aCustomDataDes) + { + return iModel->InstallItemL(aItemVisible, aPluginUid, aCustomDataInt, aCustomDataDes); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::RemoveItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::RemoveItem(const TInt aItemId) + { + return iModel->RemoveItem(aItemId); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::LocateTo() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::LocateTo(const TPoint& aTopLeft) + { + iTopLeftCorner = aTopLeft; + iTooltipNote->SetAnchor(aTopLeft); + + TRect newRect(PalettePosition(),Rect().Size()); + SetRect(newRect); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::Location() +// ----------------------------------------------------------------------------- +// +TPoint CActivePalette2BasicUI::Location(void) const + { + return iTopLeftCorner; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::OfferKeyEventL( +// ----------------------------------------------------------------------------- +// +TKeyResponse CActivePalette2BasicUI::OfferKeyEventL(const TKeyEvent& aKeyEvent, + TEventCode aType) + { + LOGTEXT2( _L( "CActivePalette2BasicUI::OfferKeyEventL entered, type : %d, scancode : %d"), + aType, aKeyEvent.iScanCode); + + TKeyResponse res = EKeyWasNotConsumed; + if (EEventKey == aType && iModel) + { + if (aKeyEvent.iScanCode == iNavigationKeys.iNaviPrev) + { + // go to previous + if ( iModel->ProcessInputEvent(EAP2InputUp) ) + { + res = EKeyWasConsumed; + } + } + else if (aKeyEvent.iScanCode == iNavigationKeys.iNaviNext) + { + // go to next + if ( iModel->ProcessInputEvent(EAP2InputDown) ) + { + res = EKeyWasConsumed; + } + } + else if ( aKeyEvent.iScanCode == iNavigationKeys.iNaviSelect && + aKeyEvent.iRepeats == 0 ) + { + // select item + if ( iModel->ProcessInputEvent(EAP2InputSelect) ) + { + res = EKeyWasConsumed; + } + } + else + { + // Lint! + } + } + + LOGTEXT1( _L( "CActivePalette2BasicUI::OfferKeyEventL left, res : %d"),res); + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::DrawBufRectToScreenRect() +// ----------------------------------------------------------------------------- +// +TRect CActivePalette2BasicUI::DrawBufRectToScreenRect(TRect aDrawBufRect) const + { + TRect screenRect(aDrawBufRect); + screenRect.Move(PalettePosition()); + return screenRect; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::ScreenRectToDrawBufRect() +// ----------------------------------------------------------------------------- +// +TRect CActivePalette2BasicUI::ScreenRectToDrawBufRect(TRect aScreenRect) const + { + TRect bufRect(aScreenRect); + bufRect.Move(-PalettePosition()); + return bufRect; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SetContainerWindowL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::SetContainerWindowL(const CCoeControl& aContainer) + { + CCoeControl::SetContainerWindowL(aContainer); + + if(iTooltipNote) + { + iTooltipNote->SetContainerWindowL(aContainer); + } + + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::CountComponentControls() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::CountComponentControls() const + { + return 1; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::ComponentControl() +// ----------------------------------------------------------------------------- +// +CCoeControl* CActivePalette2BasicUI::ComponentControl(TInt aIndex) const + { + switch ( aIndex ) + { + case 0: + return iTooltipNote; + default: + return NULL; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::TooltipUpdated() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::TooltipUpdated() + { + return iTooltipNote->TooltipUpdated(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::TooltipAnimated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::TooltipAnimated() + { + iTooltipNote->TooltipAnimated(); + + if ( iRenderGc && iAPObserver ) + { + iAPObserver->ActivePaletteUpdated(); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::ShowTooltipUpdated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::ShowTooltipUpdated() + { + TooltipAnimated(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::ItemsUpdated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::ItemsUpdated() + { + TRAP_IGNORE(ReCalcAutoSizeL()); + + RedrawIdle(ETrue); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::ItemAnimated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::ItemAnimated(TInt aScreenPos, CActivePalette2Item* aItem, TInt aAnimFrame) + { + // animation frame + TBool ownershipTransferForFrame; + TBool ownershipTransferForMask; + CFbsBitmap* frame = NULL; + CFbsBitmap* frameMask = NULL; + + aItem->Plugin().ProduceAniFrame( + CActivePalettePluginBase::EAniFocused, + aAnimFrame, + iModel->ItemAnimInfo(), + aItem->Icon(), + aItem->Mask(), + &frame, + &frameMask, + ownershipTransferForFrame, + ownershipTransferForMask); + + iStyler->AnimItem(aScreenPos, frame, frameMask); + + // release resources + if (ownershipTransferForFrame) + { + delete frame; + } + if (ownershipTransferForMask) + { + delete frameMask; + } + + // flush + FlushDirtyRect(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::ItemAnimationComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::ItemAnimationComplete(TInt aScreenPos, CActivePalette2Item* aItem) + { + aItem->Plugin().ReleaseAniFrames(CActivePalettePluginBase::EAniFocused); + DrawItem(aScreenPos, ETrue); + FlushDirtyRect(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::FocusUpdated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::FocusUpdated() + { + TInt focusedItem = iModel->FocusedItem(); + + DrawItemRange(iFocusedItem1, iFocusedItem2); + iFocusedItem1 = focusedItem; + iFocusedItem2 = focusedItem; + + DrawItemRange(focusedItem, focusedItem); + iStyler->DrawFocusRing(focusedItem, iModel->FocusCurrentOffset(), iModel->FocusCurrentTotalOffsetFrames()); + FlushDirtyRect(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::FocusAnimated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::FocusAnimated() + { + TInt focusedItem = iModel->FocusedItem(); + + if ( focusedItem != iFocusedItem1 || (focusedItem + 1) != iFocusedItem2) + { + DrawItemRange(iFocusedItem1, iFocusedItem2); + iFocusedItem1 = focusedItem; + iFocusedItem2 = focusedItem + 1; + } + + DrawItemRange(iFocusedItem1, iFocusedItem2); + + iStyler->DrawFocusRing(iFocusedItem1, iModel->FocusCurrentOffset(), iModel->FocusCurrentTotalOffsetFrames()); + FlushDirtyRect(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::PaletteAppearingAnimated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::PaletteAppearingAnimated() + { + PaletteAppearingUpdated(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::PaletteAppearingUpdated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::PaletteAppearingUpdated() + { + TRect newRect(PalettePosition(), Rect().Size()); + + if ( !iRenderGc ) + { + Window().Invalidate(Rect()); + Window().Invalidate(newRect); + } + SetRect(newRect); + RedrawIdle(ETrue); + + if ( iRenderGc ) + { + TRect totalRect(Rect()); + totalRect.BoundingRect(newRect); + ProducePaletteToScreen(totalRect); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SetPaletteVisibility() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::SetPaletteVisibility(TBool aVisible, TBool aAnimated, TInt aDelayedStartMilliseconds) + { + return iModel->SetPaletteVisibility(aVisible, aAnimated, aDelayedStartMilliseconds); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::PalettePosition() +// ----------------------------------------------------------------------------- +// +TPoint CActivePalette2BasicUI::PalettePosition() const + { + TInt totalFrames = iModel->PaletteAppearingTotalFrames(); + TInt xOffset = ((iScreenSize.iWidth - iTopLeftCorner.iX) * (totalFrames - iModel->PaletteAppearingCurrentFrame())) / totalFrames; + + return TPoint(iTopLeftCorner.iX + xOffset, iTopLeftCorner.iY); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::APObserver() +// ----------------------------------------------------------------------------- +// +MActivePalette2Observer* CActivePalette2BasicUI::APObserver() const + { + return iAPObserver; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SetItemVisibility() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::SetItemVisibility(const TInt aItemId, const TBool aIsVisible) + { + return iModel->SetItemVisibility(aItemId, aIsVisible); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::GetItemVisibility() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::GetItemVisibility(const TInt aItemId, TBool &aIsVisible) const + { + return iModel->GetItemVisibility(aItemId, aIsVisible); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SetGc() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::SetGc(CBitmapContext* aGc) + { + iRenderGc = aGc; + iTooltipNote->SetGc(aGc); + iRenderedRect = TRect(0,0,0,0); + MakeVisible(!aGc); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::GetAvailablePlugins() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::GetAvailablePlugins(RArray& aPluginList) const + { + return iModel->GetAvailablePlugins(aPluginList); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::RenderActivePalette() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::RenderActivePalette(const TRect& aRect) const + { + ProducePaletteToScreen(aRect); + + if ( iModel->ShowTooltip() ) + { + iTooltipNote->ProduceTooltipToScreen(EFalse); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SetPaletteVisibilityAnimationDuration() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::SetPaletteVisibilityAnimationDuration(TInt aTimeInMilliSeconds) + { + return iModel->SetPaletteVisibilityAnimationDuration(aTimeInMilliSeconds); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::GetItemList() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::GetItemList(RArray& aItemVisibleList) const + { + return iModel->GetItemList(aItemVisibleList); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::SetItemList() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::SetItemList(const RArray& aItemVisibleList) + { + return iModel->SetItemList(aItemVisibleList); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::CoeControl() +// ----------------------------------------------------------------------------- +// +CCoeControl* CActivePalette2BasicUI::CoeControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::HuiControl() +// ----------------------------------------------------------------------------- +// +CHuiControl* CActivePalette2BasicUI::HuiControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::GetPaletteVisibilityAnimationDuration() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2BasicUI::GetPaletteVisibilityAnimationDuration(TInt& aTimeInMilliseconds) const + { + return iModel->GetPaletteVisibilityAnimationDuration(aTimeInMilliseconds); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::ItemsScrolled() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::ItemsScrolled() + { + RedrawIdle(ETrue); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::DrawItemRange() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::DrawItemRange(TInt aStartIndex, TInt aFinishIndex) const + { + aStartIndex = Max(aStartIndex, 0); + aFinishIndex = Min(aFinishIndex, iModel->CountItemsOnScreen()); + + if ( aFinishIndex >= aStartIndex ) + { + TInt index; + for ( index = aStartIndex - 1; index <= aFinishIndex; index++) + { + DrawSeparator(index); + } + + for ( index = aStartIndex; index <= aFinishIndex; index++) + { + DrawItem(index); + } + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::DrawItem() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::DrawItem(TInt aIndex, TBool aAnimOnly) const + { + CActivePalette2Item* item = iModel->ItemFromScreenPos(aIndex); + + if ( item ) + { + if ( aAnimOnly ) + { + iStyler->AnimItem(aIndex, &item->Icon(), item->Mask()); + } + else + { + iStyler->DrawItem(aIndex, &item->Icon(), item->Mask(), iModel->ItemScrollOffset(), iModel->ItemScrollTotalFrames()); + } + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::DrawSeparator() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::DrawSeparator(TInt aIndex) const + { + if ( aIndex < 0 ) + { + iStyler->DrawTopScrollArrowSection(iModel->ShowTopScrollIndicator()); + } + else if (aIndex >= (iModel->CountItemsOnScreen()-1)) + { + iStyler->DrawBottomScrollArrowSection(iModel->ShowBottomScrollIndicator()); + } + else + { + iStyler->DrawGap(aIndex, iModel->ItemScrollOffset(), iModel->ItemScrollTotalFrames()); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::FlushDirtyRect() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::FlushDirtyRect() + { + FlushBufNow(DrawBufRectToScreenRect(iStyler->DirtyRect())); + iStyler->ClearDirtyRect(); + + if ( iRenderGc && iAPObserver) + { + iAPObserver->ActivePaletteUpdated(); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::HandleResourceChange() +// ----------------------------------------------------------------------------- +// +void CActivePalette2BasicUI::HandleResourceChange( TInt aType ) + { + if ( KEikDynamicLayoutVariantSwitch == aType ) + { + // UI sizes and dimensions + AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, iScreenSize ); + + TRAP_IGNORE( ReCalcAutoSizeL() ); + + // enter idle + RedrawIdle(EFalse); + } + + CCoeControl::HandleResourceChange( aType ); + + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2CheckerboardStyler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2CheckerboardStyler.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,337 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Checkerboard Styler* +*/ + + +/** + * @file ActivePalette2CheckerboardStyler.cpp + * Active Palette Checkerboard Styler + */ + +#include "ActivePalette2Logger.h" +#include "ActivePalette2CheckerboardStyler.h" +#include "ActivePalette2Cfg.h" +#include "ActivePalette2Utils.h" +#include + +#include +#include +#include + +/// Returns whether supplied number is odd +#define IS_ODD(num) ((num) & 1) + +// Lightness threshold for checking whether a pixel +// should be considered 'white'. Lightness is defined as the sum of the +// 8-bit red, green, and blue values. +const TInt KLightnessThreshold = 0x80 * 3; + +// Threshold for determining if a pixel in a soft mask is considered +// opaque or transparent. +const TUint8 KMaskThreshold = 0x7f; + +// Color value for transparent pixel (ARGB format). +const TUint32 KColorKey = 0xFF000000; + +// Color value for opaque pixel (ARGB format). +const TUint32 KOpaqueColor = 0x00FFFFFF; + + +// ----------------------------------------------------------------------------- +// CActivePalette2CheckerboardStyler::NewL() +// ----------------------------------------------------------------------------- +// +CActivePalette2CheckerboardStyler* CActivePalette2CheckerboardStyler::NewL() + { + CActivePalette2CheckerboardStyler* self = new (ELeave) CActivePalette2CheckerboardStyler(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // this + return self; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2CheckerboardStyler::ConstructL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2CheckerboardStyler::ConstructL() + { + LOGTEXT( _L( "CActivePalette2CheckerboardStyler::ConstructL entered")); + CActivePalette2Styler::ConstructL(); + + iAPTopSectionMask = new (ELeave) CFbsBitmap; + iAPItemMaskA = new (ELeave) CFbsBitmap; + iAPItemMaskB = new (ELeave) CFbsBitmap; + iAPGapMaskA = new (ELeave) CFbsBitmap; + iAPGapMaskB = new (ELeave) CFbsBitmap; + iAPBottomSectionMaskA = new (ELeave) CFbsBitmap; + iAPBottomSectionMaskB = new (ELeave) CFbsBitmap; + + // The order of calling these has an importance, to create the checkers correctly + + LoadAndScaleCheckerboardL( iAPTopSectionMask, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_top, EMbmActivepalette2graphicsQgn_graf_cam4_tb_top_mask, + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) ) ); + LoadAndScaleCheckerboardL( iAPItemMaskA, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_body, EMbmActivepalette2graphicsQgn_graf_cam4_tb_body_mask, + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) ) ); + LoadAndScaleCheckerboardL( iAPGapMaskA, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_gap, EMbmActivepalette2graphicsQgn_graf_cam4_tb_gap_mask, + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems) ) ); + LoadAndScaleCheckerboardL( iAPItemMaskB, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_body, EMbmActivepalette2graphicsQgn_graf_cam4_tb_body_mask, + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) ) ); + LoadAndScaleCheckerboardL( iAPGapMaskB, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_gap, EMbmActivepalette2graphicsQgn_graf_cam4_tb_gap_mask, + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems) ) ); + LoadAndScaleCheckerboardL( iAPBottomSectionMaskB, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_bottom, EMbmActivepalette2graphicsQgn_graf_cam4_tb_bottom_mask, + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EBottomSectionHeight) ) ); + LoadAndScaleCheckerboardL( iAPBottomSectionMaskA, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_bottom, EMbmActivepalette2graphicsQgn_graf_cam4_tb_bottom_mask, + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EBottomSectionHeight) ) ); + + LOGTEXT( _L( "CActivePalette2CheckerboardStyler::ConstructL Left")); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2CheckerboardStyler::~CActivePalette2CheckerboardStyler() +// ----------------------------------------------------------------------------- +// +CActivePalette2CheckerboardStyler::~CActivePalette2CheckerboardStyler() + { + delete iAPTopSectionMask; + delete iAPItemMaskA; + delete iAPItemMaskB; + delete iAPGapMaskA; + delete iAPGapMaskB; + delete iAPBottomSectionMaskA; + delete iAPBottomSectionMaskB; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2CheckerboardStyler::DrawItem() +// ----------------------------------------------------------------------------- +// +void CActivePalette2CheckerboardStyler::DrawItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask, TInt aOffsetFrame, TInt aOffsetTotal) + { + TRect area(ItemRect(aScreenPos, aOffsetFrame, aOffsetTotal)); + + iDrawBufContext->SetClippingRect(iItemsRect); + iDrawBufMaskContext->SetClippingRect(iItemsRect); + + if ( IS_ODD(aScreenPos) ) + { + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, iAPItem, iAPItemMaskB, EFalse, EFalse); + } + else + { + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, iAPItem, iAPItemMaskA, EFalse, EFalse); + } + + BlitGraphic(area.iTl + TPoint(ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemXOffset),0), iDrawBufContext, iDrawBufMaskContext, aIcon, aMask, ETrue, ETrue); + + iDrawBufMaskContext->CancelClippingRect(); + iDrawBufContext->CancelClippingRect(); + + area.Intersection(iItemsRect); + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2CheckerboardStyler::DrawGap() +// ----------------------------------------------------------------------------- +// +void CActivePalette2CheckerboardStyler::DrawGap(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal) + { + TRect area(GapRect(aScreenPos, aOffsetFrame, aOffsetTotal)); + + iDrawBufContext->SetClippingRect(iItemsRect); + iDrawBufMaskContext->SetClippingRect(iItemsRect); + + if ( IS_ODD(aScreenPos) ) + { + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, iAPGap, iAPGapMaskB, EFalse, EFalse); + } + else + { + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, iAPGap, iAPGapMaskA, EFalse, EFalse); + } + + iDrawBufMaskContext->CancelClippingRect(); + iDrawBufContext->CancelClippingRect(); + + area.Intersection(iItemsRect); + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2CheckerboardStyler::AnimItem() +// ----------------------------------------------------------------------------- +// +void CActivePalette2CheckerboardStyler::AnimItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask) + { + TRect area(ItemRect(aScreenPos)); + area.iTl.iX = ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemXOffset); + area.SetWidth(ActivePalette2Utils::APDimension( ActivePalette2Utils::EItemWidth )); + + TRect clippingRect(TPoint(ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemXOffset), 0), ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::EItemSize ) ); + + iDrawBufContext->BitBlt(area.iTl, iAPItem, clippingRect); + + if ( IS_ODD(aScreenPos) ) + { + iDrawBufMaskContext->BitBlt(area.iTl, iAPItemMaskB, clippingRect); + } + else + { + iDrawBufMaskContext->BitBlt(area.iTl, iAPItemMaskA, clippingRect); + } + + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, aIcon, aMask, ETrue, ETrue); + + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2CheckerboardStyler::DrawTopScrollArrowSection() +// ----------------------------------------------------------------------------- +// +void CActivePalette2CheckerboardStyler::DrawTopScrollArrowSection(TBool aShowArrow) + { + TRect area(TopSectionRect()); + + BlitGraphic(TPoint(0,0), iDrawBufContext, iDrawBufMaskContext, iAPTopSection, iAPTopSectionMask, EFalse, EFalse); + + if ( aShowArrow ) + { + CentreGraphic(area, iDrawBufContext, iDrawBufMaskContext, iScrollUpIcon, iScrollUpIconMask, ETrue, ETrue); + } + + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2CheckerboardStyler::DrawBottomScrollArrowSection() +// ----------------------------------------------------------------------------- +// +void CActivePalette2CheckerboardStyler::DrawBottomScrollArrowSection(TBool aShowArrow) + { + TRect area(BottomSectionRect()); + + if ( IS_ODD(iNumItems) ) + { + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, iAPBottomSection, iAPBottomSectionMaskA, EFalse, EFalse); + } + else + { + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, iAPBottomSection, iAPBottomSectionMaskB, EFalse, EFalse); + } + + if ( aShowArrow ) + { + CentreGraphic(area, iDrawBufContext, iDrawBufMaskContext, iScrollDownIcon, iScrollDownIconMask, ETrue, ETrue); + } + + AddToDirtyRect( area ); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2CheckerboardStyler::LoadAndScaleCheckerboard() +// ----------------------------------------------------------------------------- +// +void CActivePalette2CheckerboardStyler::LoadAndScaleCheckerboardL( + CFbsBitmap* aTargetBitmap, + const TDesC& aFileName, + TInt32 aId, + TInt32 aMaskId, + TSize aSize ) + { + LOGTEXT( _L( "CActivePalette2CheckerboardStyler::LoadAndScaleCheckerboard entered")); + CFbsBitmap* sourceIcon = NULL; + CFbsBitmap* sourceIconMask = NULL; + AknIconUtils::CreateIconLC(sourceIcon, sourceIconMask, aFileName, aId, aMaskId); + AknIconUtils::SetSize(sourceIcon, aSize); + AknIconUtils::SetSize(sourceIconMask, aSize); + LOGTEXT( _L( "CActivePalette2CheckerboardStyler::LoadAndScaleCheckerboard svg icons loaded")); + User::LeaveIfError( aTargetBitmap->Create( aSize, EColor16MA ) ); + + TSize bmpSize = aTargetBitmap->SizeInPixels(); + TRgb rgbColor = KRgbBlack; + TRgb rgbAlphaColor = KRgbBlack; + + HBufC8* lineBuf = HBufC8::NewLC( CFbsBitmap::ScanLineLength( bmpSize.iWidth, EColor16MA ) ); + TPtr8 lineDes = lineBuf->Des(); + HBufC8* maskBuf = HBufC8::NewLC( CFbsBitmap::ScanLineLength( bmpSize.iWidth, EGray256 ) ); + TPtr8 maskDes = maskBuf->Des(); + + for (TInt y = 0; y < bmpSize.iHeight; y++) + { + sourceIcon->GetScanLine( + lineDes, TPoint(0, y), bmpSize.iWidth, EColor16MA); + sourceIconMask->GetScanLine( + maskDes, TPoint(0, y), bmpSize.iWidth, EGray256); + + // EColor16MA is 4 bytes (32-bits) per pixel + TUint32* linePtr = reinterpret_cast( &lineDes[0] ); + + // EGray256 is 1 byte per pixel + TUint8* maskPtr = reinterpret_cast( &maskDes[0] ); + + for( TInt x = 0; x < bmpSize.iWidth; x++ ) + { + TUint32 color = linePtr[x]; + TUint8 mask = maskPtr[x]; + + // Get the RGB values in order to check the lightness of the pixel + // to determine whether to mask with the checkerboard pattern. + TInt lightness = + (color & 0xFF) + // blue + ((color >> 8) & 0xFF) + // green + ((color >> 16) & 0xFF); // red + + if ( mask < KMaskThreshold ) + { + // Transparent area. + linePtr[x] = KColorKey; + } + else if ( lightness > KLightnessThreshold ) + { + // Semitransparent (dithered) area. + // Make every second pixel transparent. + if ( ( x + iLineCheckerCounter ) & 1 ) + { + linePtr[x] = KColorKey; + } + else + { + linePtr[x] = KOpaqueColor; + } + } + else + { + // Fully opaque area + linePtr[x] = KOpaqueColor; + } + } + + aTargetBitmap->SetScanLine(lineDes, y); + iLineCheckerCounter++; + } + + // end draw checkers + LOGTEXT( _L( "CActivePalette2CheckerboardStyler::LoadAndScaleCheckerboard svg4")); + + CleanupStack::PopAndDestroy(maskBuf); + CleanupStack::PopAndDestroy(lineBuf); + CleanupStack::PopAndDestroy(2); // sourceIcon, sourceIconMask + LOGTEXT( _L( "CActivePalette2CheckerboardStyler::LoadAndScaleCheckerboard left")); + } + + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2DllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2DllMain.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 DLL entry point* +*/ + + +/** + * @file ActivePalette2DllMain.cpp + * Active Palette 2 DLL entry point + */ + +// INCLUDES +#include + +/** + * Standard Symbian DLL entry point function. + */ +#ifndef EKA2 +GLDEF_C TInt E32Dll(TDllReason /* aReason*/) + { + return KErrNone; + } +#endif diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2EventData.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2EventData.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains an event's data* +*/ + + +/** + * @file ActivePalette2EventData.cpp + * Contains an event's data + */ + + +#include + +// ----------------------------------------------------------------------------- +// TActivePaletteEventData::TActivePaletteEventData() +// ----------------------------------------------------------------------------- +// +TActivePalette2EventData::TActivePalette2EventData(TInt aResult, TInt aCurItem, const TInt aPrevItem, const TInt aServingItem, const TUid& aServingPlugin): + iResult(aResult), + iCurItem(aCurItem), + iPrevItem(aPrevItem), + iServingItem(aServingItem), + iServingPlugin(aServingPlugin) + { + // No implementation required + } + + +// ----------------------------------------------------------------------------- +// TActivePaletteEventData::Result() +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TActivePalette2EventData::Result(void) const + { + return iResult; + } + + +// ----------------------------------------------------------------------------- +// TActivePaletteEventData::CurItem() +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TActivePalette2EventData::CurItem(void) const + { + return iCurItem; + } + + +// ----------------------------------------------------------------------------- +// TActivePaletteEventData::PrevItem() +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TActivePalette2EventData::PrevItem(void) const + { + return iPrevItem; + } + + +// ----------------------------------------------------------------------------- +// TActivePaletteEventData::ServingItem() +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TActivePalette2EventData::ServingItem(void) const + { + return iServingItem; + } + + +// ----------------------------------------------------------------------------- +// TActivePaletteEventData::ServingPlugin() +// ----------------------------------------------------------------------------- +// +EXPORT_C TUid TActivePalette2EventData::ServingPlugin(void) const + { + return iServingPlugin; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2Factory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2Factory.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Creates concrete implementation of AP* +*/ + + +/** + * @file ActivePalette2Factory.cpp + * Creates concrete implementation of AP + */ + +#include "ActivePalette2BuildConfig.h" + +#ifdef AP2_USE_2D_RENDERING +#include "ActivePalette2BasicUI.h" +#endif + +#ifdef AP2_USE_3D_RENDERING +#include "ActivePalette2HUI.h" +#endif + +#include +#include + + +// ---------------------------------------------------------------------------- +// ActivePalette2Factory::CreateActivePaletteUIL +// ---------------------------------------------------------------------------- +#ifdef AP2_USE_2D_RENDERING +EXPORT_C MActivePalette2UI* ActivePalette2Factory::CreateActivePaletteUIL(TActivePalette2DrawMode aDrawMode) + { + return CActivePalette2BasicUI::NewL(aDrawMode); + } +#else +EXPORT_C MActivePalette2UI* ActivePalette2Factory::CreateActivePaletteUIL(TActivePalette2DrawMode /* aDrawMode */ ) + { + User::Leave(KErrNotSupported); + return NULL; + } +#endif // AP2_USE_2D_RENDERING + + +// ---------------------------------------------------------------------------- +// ActivePalette2Factory::CreateHUIActivePaletteUIL +// ---------------------------------------------------------------------------- +#ifdef AP2_USE_3D_RENDERING +EXPORT_C MActivePalette2UI* ActivePalette2Factory::CreateHUIActivePaletteUIL(CHuiEnv& aEnv) + { + return CActivePalette2HUI::NewL(aEnv); + } +#else +EXPORT_C MActivePalette2UI* ActivePalette2Factory::CreateHUIActivePaletteUIL(CHuiEnv& /* aEnv */ ) + { + User::Leave(KErrNotSupported); + return NULL; + } +#endif // AP2_USE_3D_RENDERING + + +EXPORT_C MActivePalette2UI* ActivePalette2Factory::CreateGuiActivePaletteUIL( MGui* /*aGui*/ ) + { + User::Leave(KErrNotSupported); + return NULL; + } diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2GenericPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2GenericPlugin.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,244 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 Generic Plugin* +*/ + + +/** + * @file ActivePalette2GenericPlugin.cpp + * Active Palette 2 Generic Plugin + */ + +// INCLUDE FILES +#include "ActivePalette2GenericPlugin.h" +#include "ActivePalette2Const.h" +#include "ActivePalette2Cfg.h" + +#include +#include + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// TAPGenericPluginParams::TAPGenericPluginParams() +// C++ Constructor +// ----------------------------------------------------------------------------- +// +TAP2GenericPluginParams::TAP2GenericPluginParams() : + iResFileType(EGenericStdResFile), + iGraphicsFileName(KNullDesC), + iIconId(0), + iMaskId(0), + iTooltipText(KNullDesC), + iMessageId(KActivePaletteNoDataInt), + iMsgCustomParam(KActivePaletteNoDataInt) + { + } + +// ----------------------------------------------------------------------------- +// TAPGenericPluginParams::TAPGenericPluginParams() +// C++ Constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C TAP2GenericPluginParams::TAP2GenericPluginParams(const TInt aResFileType, + const TDesC& aGraphicsFileName, + const TInt aIconId, + const TInt aMaskId, + const TDesC& aTooltipText, + const TInt aMessageId, + const TInt aMsgCustomParam): + iResFileType(aResFileType), + iGraphicsFileName(aGraphicsFileName), + iIconId(aIconId), + iMaskId(aMaskId), + iTooltipText(aTooltipText), + iMessageId(aMessageId), + iMsgCustomParam(aMsgCustomParam) + { + } + +// ----------------------------------------------------------------------------- +// TAPGenericPluginIcon::TAPGenericPluginIcon() +// C++ Constructor +// ----------------------------------------------------------------------------- +// +TAP2GenericPluginIcon::TAP2GenericPluginIcon() : + iIconId(0), + iMaskId(0) + { + } + +// ----------------------------------------------------------------------------- +// TAPGenericPluginIcon::TAPGenericPluginIcon() +// C++ Constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C TAP2GenericPluginIcon::TAP2GenericPluginIcon(const TInt aIconId, + const TInt aMaskId): + iIconId(aIconId), + iMaskId(aMaskId) + { + } + +// ----------------------------------------------------------------------------- +// CAP2GenericPlugin::CAP2GenericPlugin() +// C++ Constructor +// ----------------------------------------------------------------------------- +// +CAP2GenericPlugin::CAP2GenericPlugin(const NActivePalettePluginFactory::TPluginCreationParams& aCreationParams): +CActivePalettePluginBase(aCreationParams) + { + } + +// ----------------------------------------------------------------------------- +// CAP2GenericPlugin::CAP2GenericPlugin() +// Destructor +// ----------------------------------------------------------------------------- +// +CAP2GenericPlugin::~CAP2GenericPlugin() + { + } + +// ----------------------------------------------------------------------------- +// CAP2GenericPlugin::HandleItemSelectedL() +// ----------------------------------------------------------------------------- +// +void CAP2GenericPlugin::HandleItemSelectedL(void) + { + PluginObserver().SendMessage(iMessageId,iMsgCustomParam); + PluginObserver().NotifyItemComplete(KActivePaletteNoDataInt); + } + +// ----------------------------------------------------------------------------- +// CAP2GenericPlugin::ConstructL() +// ----------------------------------------------------------------------------- +// +void CAP2GenericPlugin::ConstructL(const NActivePalettePluginFactory::TPluginCreationParams& aCreationParams, + const TDesC8& aCustomDataDes, const TInt aCustomDataInt) + { + CActivePalettePluginBase::ConstructL(aCreationParams, aCustomDataDes, aCustomDataInt); + + iDimensions = aCreationParams.Dimensions(); + + // unpack creation params + TAP2GenericPluginParams params; + TPckg paramsPckg(params); + if (aCustomDataDes.Length()) + { + paramsPckg.Copy(aCustomDataDes); + SetIconAndTooltipL(params); + } + } + +// ----------------------------------------------------------------------------- +// CAP2GenericPlugin::SetIconAndTooltipL() +// ----------------------------------------------------------------------------- +// +void CAP2GenericPlugin::SetIconAndTooltipL(TAP2GenericPluginParams& aParams) + { + iMessageId = aParams.iMessageId; + iMsgCustomParam = aParams.iMsgCustomParam; + + iGraphicsFileName = aParams.iGraphicsFileName; + + CGulIcon* icon = CreateIconL(aParams.iIconId, aParams.iMaskId); + CleanupStack::PushL(icon); + + // Don't need to worry about the CGulIcon object from now on + // as we are transferring ownership of it to the active palette. + PluginObserver().SetItemIconAndTooltipL(icon, ETrue, aParams.iTooltipText); + + CleanupStack::Pop(icon); + } + +// ----------------------------------------------------------------------------- +// CAP2GenericPlugin::CreateIconL() +// ----------------------------------------------------------------------------- +// +CGulIcon* CAP2GenericPlugin::CreateIconL(TInt aIconId, TInt aMaskId) + { + CFbsBitmap* picture; + CFbsBitmap* mask; + + AknIconUtils::CreateIconLC(picture, mask, iGraphicsFileName, aIconId, aMaskId); + AknIconUtils::SetSize(picture, iDimensions); + AknIconUtils::SetSize(mask, iDimensions); + + CGulIcon* icon = CGulIcon::NewL(picture,mask); + + // Can now take the bitmaps off the cleanup stack as we have + // transferred ownership to the CGulIcon object + CleanupStack::Pop(mask); + CleanupStack::Pop(picture); + + return icon; + } + +// ----------------------------------------------------------------------------- +// CAP2GenericPlugin::HandleMessageL() +// ----------------------------------------------------------------------------- +// +void CAP2GenericPlugin::HandleMessageL(const TInt aMessageID, const TDesC8& aDataDes, const TInt /* aDataInt */) + { + switch (aMessageID) + { + case EAPGenericPluginChangeIcon: + { + TAP2GenericPluginIcon iconParams; + TPckg iconParamsPckg(iconParams); + if (aDataDes.Length()) + { + iconParamsPckg.Copy(aDataDes); + CGulIcon* icon = CreateIconL(iconParams.iIconId, iconParams.iMaskId); + // Ownership of icon is transferred to the Active Palette + PluginObserver().SetItemIcon(icon, ETrue); + } + } + break; + + case EAPGenericPluginChangeParams: + { + TAP2GenericPluginParams params; + TPckg paramsPckg(params); + if (aDataDes.Length()) + { + paramsPckg.Copy(aDataDes); + SetIconAndTooltipL(params); + } + break; + } + + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// InstantiateGenericPluginL() +// ----------------------------------------------------------------------------- +// +CActivePalettePluginBase* InstantiateGenericPluginL( + const TUid& aPluginUid, + const NActivePalettePluginFactory::TPluginCreationParams& aCreationParams) + { + if (TUid::Uid(KActivePalette2GenericPluginUID) != aPluginUid) + { + User::Leave(KErrNotSupported); + } + + CActivePalettePluginBase* self = new (ELeave) CAP2GenericPlugin(aCreationParams); + return self; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2HUI.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2HUI.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1181 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: AP implementation using HUITK* +*/ + + +/** + * @file ActivePalette2HUI.cpp + * AP implementation using HUITK + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ActivePalette2HUI.h" +#include "ActivePalette2Cfg.h" +#include "ActivePalette2Item.h" +#include "ActivePalette2Utils.h" +#include "ActivePalette2Model.h" + + + +#define PREPROCESS_BITMAPS + +#define KPaletteHiddenXPos (iScreenSize.iWidth) + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::CActivePalette2HUI() +// ----------------------------------------------------------------------------- +// +CActivePalette2HUI::CActivePalette2HUI(CHuiEnv& aEnv) +: CHuiControl(aEnv) + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::NewL() +// ----------------------------------------------------------------------------- +// +CActivePalette2HUI* CActivePalette2HUI::NewL(CHuiEnv& aEnv) + { + CActivePalette2HUI* self = new(ELeave) CActivePalette2HUI(aEnv); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::ConstructL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::ConstructL() + { + TRendererCallBacks callBacks; + callBacks.iTooltipDescriptive = this; + callBacks.iItemScrollDescriptive = this; + callBacks.iFocusDescriptive = this; + callBacks.iAppearanceDescriptive = this; + + iModel = CActivePalette2Model::NewL(*this, ActivePalette2Utils::APDimensionSize( EItemSize ), callBacks); + + UpdateTopLeftCornerWithScreenSize(); + + // Full screen layout, used to get screen-orientation notifications + iFullScreenLayout = AppendLayoutL(EHuiLayoutTypeAnchor); + iFullScreenLayout->SetFlags(EHuiVisualFlagLayoutUpdateNotification); + + iPaletteLayout = AppendLayoutL(EHuiLayoutTypeAnchor); + iPaletteLayout->SetFlags(EHuiVisualFlagManualLayout); + iPaletteLayout->SetSize(THuiRealSize(TSize(ActivePalette2Utils::APDimension(EPaletteWidth), ActivePalette2Utils::APDimension(ETopSectionHeight) + ActivePalette2Utils::APDimension(EBottomSectionHeight) ))); + iPaletteLayout->SetPos(THuiRealPoint(iTopLeftCorner)); + iPaletteLayout->SetClipping(ETrue); + + CFbsBitmap* picture; + CFbsBitmap* mask; + + // Background top-section + iBackgroundTopSectionLayout = AppendLayoutL(EHuiLayoutTypeAnchor, iPaletteLayout); + iBackgroundTopSectionLayout->SetFlags(EHuiVisualFlagManualLayout); + iBackgroundTopSectionLayout->SetSize(THuiRealSize(TSize(ActivePalette2Utils::APDimension(EPaletteWidth), ActivePalette2Utils::APDimension(ETopSectionHeight)))); + iBackgroundTopSectionLayout->SetPos(THuiRealPoint(TopScrollPanePosition())); + + iBackgroundTopSectionVisual = CHuiImageVisual::AddNewL(*this, iBackgroundTopSectionLayout); + + AknIconUtils::CreateIconLC(picture, mask, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_top, EMbmActivepalette2graphicsQgn_graf_cam4_tb_top_mask); + + iBackgroundTopSectionTexture = CHuiTexture::NewL(); + iBackgroundTopSectionTexture->UploadL(*picture, mask); + + iBackgroundTopSectionVisual->SetImage( THuiImage( *iBackgroundTopSectionTexture ) ); + + CleanupStack::PopAndDestroy(); // picture + CleanupStack::PopAndDestroy(); // mask + + + // Background mid-section + iBackgroundMidSectionLayout = AppendLayoutL(EHuiLayoutTypeAnchor, iPaletteLayout); + iBackgroundMidSectionLayout->SetFlags(EHuiVisualFlagManualLayout); + iBackgroundMidSectionLayout->SetSize(THuiRealSize(TSize(ActivePalette2Utils::APDimension(EPaletteWidth), 0))); + iBackgroundMidSectionLayout->SetPos(THuiRealPoint(TopScrollPanePosition() + TPoint(0, ActivePalette2Utils::APDimension(ETopSectionHeight)))); + + iBackgroundMidSectionVisual = CHuiImageVisual::AddNewL(*this, iBackgroundMidSectionLayout); + + AknIconUtils::CreateIconLC(picture, mask, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_body, EMbmActivepalette2graphicsQgn_graf_cam4_tb_body_mask); + + iBackgroundMidSectionTexture = CHuiTexture::NewL(); + iBackgroundMidSectionTexture->UploadL(*picture, mask); + + iBackgroundMidSectionVisual->SetImage( THuiImage( *iBackgroundMidSectionTexture ) ); + + CleanupStack::PopAndDestroy(); // picture + CleanupStack::PopAndDestroy(); // mask + + + // Background bottom-section + iBackgroundBottomSectionLayout = AppendLayoutL(EHuiLayoutTypeAnchor, iPaletteLayout); + iBackgroundBottomSectionLayout->SetFlags(EHuiVisualFlagManualLayout); + iBackgroundBottomSectionLayout->SetSize(THuiRealSize(TSize(ActivePalette2Utils::APDimension(EPaletteWidth), ActivePalette2Utils::APDimension(EBottomSectionHeight)))); + iBackgroundBottomSectionLayout->SetPos(THuiRealPoint(BottomScrollPanePosition())); + + iBackgroundBottomSectionVisual = CHuiImageVisual::AddNewL(*this, iBackgroundBottomSectionLayout); + + AknIconUtils::CreateIconLC(picture, mask, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_bottom, EMbmActivepalette2graphicsQgn_graf_cam4_tb_bottom_mask); + + iBackgroundBottomSectionTexture = CHuiTexture::NewL(); + iBackgroundBottomSectionTexture->UploadL(*picture, mask); + + iBackgroundBottomSectionVisual->SetImage( THuiImage( *iBackgroundBottomSectionTexture ) ); + + CleanupStack::PopAndDestroy(); // picture + CleanupStack::PopAndDestroy(); // mask + + + // Item layouts + for( TInt i = 0; i < NAP2Cfg::KMaxNofItemsInView + 1; i++) + { + CHuiLayout* layout = AppendLayoutL(EHuiLayoutTypeAnchor, iPaletteLayout); + layout->SetFlags(EHuiVisualFlagManualLayout); + layout->SetSize(THuiRealSize(ActivePalette2Utils::APDimensionSize( EItemSize ))); + layout->SetPos(THuiRealPoint(ItemPosition(i))); + iItemLayout.Append(layout); + + CHuiImageVisual* image = CHuiImageVisual::AddNewL(*this, layout); + iItemVisual.Append(image); + + CHuiTexture* texture = CHuiTexture::NewL(); + iItemTexture.Append(texture); + + image->SetImage( THuiImage( *texture ) ); + } + + + // Top scroll icon + iTopScrollLayout = AppendLayoutL(EHuiLayoutTypeAnchor, iPaletteLayout); + iTopScrollLayout->SetFlags(EHuiVisualFlagManualLayout); + iTopScrollLayout->SetSize(THuiRealSize(ActivePalette2Utils::APDimensionSize(E3dScrollIconSize))); + iTopScrollLayout->SetPos(THuiRealPoint(TopScrollPanePosition() + ActivePalette2Utils::APDimensionPoint(E3dScrollIconOffset))); + + iTopScrollVisual = CHuiImageVisual::AddNewL(*this, iTopScrollLayout); + + AknIconUtils::CreateIconLC(picture, mask, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_arrow_up, EMbmActivepalette2graphicsQgn_graf_cam4_tb_arrow_up_mask); + + iTopScrollTexture = CHuiTexture::NewL(); + iTopScrollTexture->UploadL(*picture, mask); + + iTopScrollVisual->SetImage( THuiImage( *iTopScrollTexture ) ); + + CleanupStack::PopAndDestroy(); + CleanupStack::PopAndDestroy(); + + + // Bottom scroll icon + iBottomScrollLayout = AppendLayoutL(EHuiLayoutTypeAnchor, iPaletteLayout); + iBottomScrollLayout->SetFlags(EHuiVisualFlagManualLayout); + iBottomScrollLayout->SetSize(THuiRealSize(ActivePalette2Utils::APDimensionSize(E3dScrollIconSize))); + iBottomScrollLayout->SetPos(THuiRealPoint(BottomScrollPanePosition() + ActivePalette2Utils::APDimensionPoint(E3dScrollIconOffset))); + + iBottomScrollVisual = CHuiImageVisual::AddNewL(*this, iBottomScrollLayout); + + AknIconUtils::CreateIconLC(picture, mask, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_arrow_down, EMbmActivepalette2graphicsQgn_graf_cam4_tb_arrow_down_mask); + + iBottomScrollTexture = CHuiTexture::NewL(); + iBottomScrollTexture->UploadL(*picture, mask); + + iBottomScrollVisual->SetImage( THuiImage( *iBottomScrollTexture ) ); + + CleanupStack::PopAndDestroy(); + CleanupStack::PopAndDestroy(); + + + // Focus ring + iFocusRingLayout = AppendLayoutL(EHuiLayoutTypeAnchor, iPaletteLayout); + iFocusRingLayout->SetFlags(EHuiVisualFlagManualLayout); + iFocusRingLayout->SetSize(THuiRealSize(TSize(ActivePalette2Utils::APDimension(EFocusRingWidth), ActivePalette2Utils::APDimension(EFocusRingHeight)))); + iFocusRingLayout->SetPos(THuiRealPoint(ItemPosition(0) + TPoint(ActivePalette2Utils::APDimension(EFocusRingXOffset), ActivePalette2Utils::APDimension(EFocusRingYOffset)))); + + iFocusRingVisual = CHuiImageVisual::AddNewL(*this, iFocusRingLayout); + + AknIconUtils::CreateIconLC(picture, mask, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_focus, EMbmActivepalette2graphicsQgn_graf_cam4_tb_focus_mask); + + iFocusRingTexture = CHuiTexture::NewL(); + iFocusRingTexture->UploadL(*picture, mask); + + iFocusRingVisual->SetImage( THuiImage( *iFocusRingTexture ) ); + + CleanupStack::PopAndDestroy(); + CleanupStack::PopAndDestroy(); + + + // Tooltip + iTooltipLayout = AppendLayoutL(EHuiLayoutTypeAnchor); + iTooltipLayout->SetFlags(EHuiVisualFlagManualLayout); + iTooltipLayout->SetSize(THuiRealSize(TSize(0, 0))); + iTooltipLayout->SetPos(THuiRealPoint(iTopLeftCorner)); + iTooltipLayout->SetClipping(ETrue); + + + // Tooltip background for nose section + iTooltipBackgroundNoseLayout = AppendLayoutL(EHuiLayoutTypeAnchor, iTooltipLayout); + iTooltipBackgroundNoseLayout->SetFlags(EHuiVisualFlagManualLayout); + iTooltipBackgroundNoseLayout->SetSize(THuiRealSize(TSize(ActivePalette2Utils::APDimension(ETooltipNose), ActivePalette2Utils::APDimension(ETooltipHeight)))); + iTooltipBackgroundNoseLayout->SetPos(THuiRealPoint(TPoint(0,0))); + + iTooltipBackgroundNoseVisual = CHuiImageVisual::AddNewL(*this, iTooltipBackgroundNoseLayout); + + AknIconUtils::CreateIconLC(picture, mask, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_end, EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_end_mask); + + iTooltipBackgroundNoseTexture = CHuiTexture::NewL(); + iTooltipBackgroundNoseTexture->UploadL(*picture, mask); + + iTooltipBackgroundNoseVisual->SetImage( THuiImage( *iTooltipBackgroundNoseTexture ) ); + + CleanupStack::PopAndDestroy(); // picture + CleanupStack::PopAndDestroy(); // mask + + + // Tooltip background for nose section + iTooltipBackgroundBodyLayout = AppendLayoutL(EHuiLayoutTypeAnchor, iTooltipLayout); + iTooltipBackgroundBodyLayout->SetFlags(EHuiVisualFlagManualLayout); + iTooltipBackgroundBodyLayout->SetSize(THuiRealSize(TSize(ActivePalette2Utils::APDimension(E3dTooltipMaxWidth), ActivePalette2Utils::APDimension(ETooltipHeight)))); + iTooltipBackgroundBodyLayout->SetPos(THuiRealPoint(TPoint(ActivePalette2Utils::APDimension(ETooltipNose),0))); + + iTooltipBackgroundBodyVisual = CHuiImageVisual::AddNewL(*this, iTooltipBackgroundBodyLayout); + + AknIconUtils::CreateIconLC(picture, mask, NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_body, EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_body_mask); + + iTooltipBackgroundBodyTexture = CHuiTexture::NewL(); + iTooltipBackgroundBodyTexture->UploadL(*picture, mask); + + iTooltipBackgroundBodyVisual->SetImage( THuiImage( *iTooltipBackgroundBodyTexture ) ); + + CleanupStack::PopAndDestroy(); // picture + CleanupStack::PopAndDestroy(); // mask + + + // Tooltip text layouts + iTooltipTextLayout = AppendLayoutL(EHuiLayoutTypeAnchor, iTooltipLayout); + iTooltipTextLayout->SetFlags(EHuiVisualFlagManualLayout); + iTooltipTextLayout->SetSize(THuiRealSize(TSize(ActivePalette2Utils::APDimension(E3dTooltipMaxWidth), ActivePalette2Utils::APDimension(ETooltipHeight)))); + iTooltipTextLayout->SetPos(THuiRealPoint(TPoint(ActivePalette2Utils::APDimension(ETooltipNose), ActivePalette2Utils::APDimension(E3dTooltipTextYOffset)))); + + iTooltipTextVisual = CHuiTextVisual::AddNewL(*this, iTooltipTextLayout); + iTooltipTextVisual->SetStyle(EHuiTextStyleMenuSmall, EHuiBackgroundTypeLight); + iTooltipTextVisual->SetMaxLineCount(1); + iTooltipTextVisual->SetAlign(EHuiAlignHLeft, EHuiAlignVCenter); + iTooltipTextVisual->SetTextL(_L("")); + + + iGeneralTimer = CPeriodic::NewL(CActive::EPriorityStandard); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::~CActivePalette2HUI() +// ----------------------------------------------------------------------------- +// +CActivePalette2HUI::~CActivePalette2HUI() + { + if (iGeneralTimer) + { + iGeneralTimer->Cancel(); + delete iGeneralTimer; + } + + iItemLayout.Reset(); + iItemVisual.Reset(); + iItemTexture.ResetAndDestroy(); + + delete iBackgroundTopSectionTexture; + delete iBackgroundMidSectionTexture; + delete iBackgroundBottomSectionTexture; + + delete iFocusRingTexture; + + delete iBottomScrollTexture; + delete iTopScrollTexture; + + delete iTooltipBackgroundBodyTexture; + delete iTooltipBackgroundNoseTexture; + + delete iModel; + iModel = NULL; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::InstallItemL() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + const TDesC8& aCustomDataDes) + { + return iModel->InstallItemL(aItemVisible, aPluginUid, aCustomDataDes); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::InstallItemL() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt ) + { + return iModel->InstallItemL(aItemVisible, aPluginUid, aCustomDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::InstallItemL() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt, + const TDesC8& aCustomDataDes) + { + return iModel->InstallItemL(aItemVisible, aPluginUid, aCustomDataInt, aCustomDataDes); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::RemoveItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::RemoveItem(const TInt aItemId) + { + return iModel->RemoveItem(aItemId); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::SetItemVisibility() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::SetItemVisibility(const TInt aItemId, const TBool aIsVisible) + { + return iModel->SetItemVisibility(aItemId, aIsVisible); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::GetItemVisibility() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::GetItemVisibility(const TInt aItemId, TBool &aIsVisible) const + { + return iModel->GetItemVisibility(aItemId, aIsVisible); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::GetItemList() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::GetItemList(RArray& aItemVisibleList) const + { + return iModel->GetItemList(aItemVisibleList); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::SetItemList() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::SetItemList(const RArray& aItemVisibleList) + { + return iModel->SetItemList(aItemVisibleList); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::SendMessage() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::SendMessage(TInt aItemId, TInt aMessageId, const TDesC8& aDataDes) + { + return iModel->SendMessage(aItemId, aMessageId, aDataDes); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::SendMessage() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::SendMessage(TInt aItemId, TInt aMessageId, TInt aDataInt) + { + return iModel->SendMessage(aItemId, aMessageId, aDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::GetCurrentItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::GetCurrentItem(TInt& aItemId) const + { + return iModel->GetCurrentItem(aItemId); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::SetCurrentItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::SetCurrentItem(const TInt aItemId) + { + return iModel->SetCurrentItem(aItemId); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::SetPaletteVisibility() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::SetPaletteVisibility(TBool aVisible, TBool aAnimated, TInt aDelayedStartMilliseconds) + { + return iModel->SetPaletteVisibility(aVisible, aAnimated, aDelayedStartMilliseconds); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::SetPaletteVisibilityAnimationDuration() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::SetPaletteVisibilityAnimationDuration(TInt aTimeInMilliseconds) + { + return iModel->SetPaletteVisibilityAnimationDuration(aTimeInMilliseconds); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::GetPaletteVisibilityAnimationDuration() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::GetPaletteVisibilityAnimationDuration(TInt& aTimeInMilliseconds) const + { + return iModel->GetPaletteVisibilityAnimationDuration(aTimeInMilliseconds); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::CoeControl() +// ----------------------------------------------------------------------------- +// +CCoeControl* CActivePalette2HUI::CoeControl() + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::HuiControl() +// ----------------------------------------------------------------------------- +// +CHuiControl* CActivePalette2HUI::HuiControl() + { + return this; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::SetGc() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::SetGc(CBitmapContext* /*aGc*/) + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::RenderActivePalette() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::RenderActivePalette(const TRect& /*aRect*/) const + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::SetObserver() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::SetObserver(MActivePalette2Observer* aObserver) + { + iObserver = aObserver; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::GetAvailablePlugins() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::GetAvailablePlugins(RArray& aPluginList) const + { + return iModel->GetAvailablePlugins(aPluginList); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::LocateTo() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::LocateTo(const TPoint& aTopLeft) + { + iTopLeftCorner = aTopLeft; + iPaletteLayout->SetPos(THuiRealPoint(PalettePosition())); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::Location() +// ----------------------------------------------------------------------------- +// +TPoint CActivePalette2HUI::Location() const + { + return iTopLeftCorner; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::SetNavigationKeys() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::SetNavigationKeys(const TActivePalette2NavigationKeys& aNavigationKeys) + { + iNavigationKeys = aNavigationKeys; + } + + + + + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::ShowTooltipUpdated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::ShowTooltipUpdated() + { + if ( iModel->ShowTooltip() ) + { + iTooltipLayout->iOpacity.Set(KOpacityFull); + } + else + { + iTooltipLayout->iOpacity.Set(KOpacityNone); + } + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::ItemsUpdated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::ItemsUpdated() + { + // Update size + TSize overallSize(PaletteSize()); + iPaletteLayout->SetSize(THuiRealSize(overallSize)); + TSize itemsSize(overallSize); + itemsSize.iHeight -= (ActivePalette2Utils::APDimension(ETopSectionHeight) + ActivePalette2Utils::APDimension(EBottomSectionHeight)); + iBackgroundMidSectionLayout->SetSize(THuiRealSize(itemsSize)); + iBackgroundBottomSectionLayout->SetPos(THuiRealPoint(BottomScrollPanePosition())); + + Render(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::ItemAnimated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::ItemAnimated(TInt aScreenPos, CActivePalette2Item* aItem, TInt aAnimFrame) + { + // animation frame + TBool ownershipTransferForFrame; + TBool ownershipTransferForMask; + CFbsBitmap* frame = NULL; + CFbsBitmap* frameMask = NULL; + + aItem->Plugin().ProduceAniFrame( + CActivePalettePluginBase::EAniFocused, + aAnimFrame, + iModel->ItemAnimInfo(), + aItem->Icon(), + aItem->Mask(), + &frame, + &frameMask, + ownershipTransferForFrame, + ownershipTransferForMask); + + TRAP_IGNORE(iItemTexture[aScreenPos]->UploadL(*frame, frameMask)); + iItemVisual[aScreenPos]->SetChanged(); + + // release resources + if (ownershipTransferForFrame) + { + delete frame; + } + if (ownershipTransferForMask) + { + delete frameMask; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::ItemAnimationComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::ItemAnimationComplete(TInt /*aScreenPos*/, CActivePalette2Item* aItem) + { + aItem->Plugin().ReleaseAniFrames(CActivePalettePluginBase::EAniFocused); + Render(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::PaletteAppearingUpdated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::PaletteAppearingUpdated() + { + iGeneralTimer->Cancel(); + iPaletteLayout->SetPos(THuiRealPoint(PalettePosition())); + UpdateFocus(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::UpdateFocus() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::UpdateFocus() + { + if ( iModel->PaletteActive() + && iModel->CountItemsOnScreen() > 0 ) + { + TPoint startPos = ItemPosition(iModel->FocusedItem()) + TPoint(ActivePalette2Utils::APDimension(EFocusRingXOffset), ActivePalette2Utils::APDimension(EFocusRingYOffset)); + iFocusRingLayout->SetPos(THuiRealPoint(startPos)); + iFocusRingVisual->iOpacity.Set(1.0); + } + else + { + iFocusRingVisual->iOpacity.Set(0.0); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::APObserver() +// ----------------------------------------------------------------------------- +// +MActivePalette2Observer* CActivePalette2HUI::APObserver() const + { + return iObserver; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::Render() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::Render() + { +#ifdef PREPROCESS_BITMAPS + CFbsBitmap* tempBitmap = NULL; + CFbsBitmapDevice* tempDevice = NULL; + CBitmapContext* tempGc = NULL; + + CFbsBitmap* tempMaskBitmap = NULL; + CFbsBitmapDevice* tempMaskDevice = NULL; + CBitmapContext* tempMaskGc = NULL; + + TRAPD(err, + ActivePalette2Utils::CreateDrawingObjectsL(EColor16MU, ActivePalette2Utils::APDimensionSize( EItemSize ), + &tempBitmap, + &tempDevice, + &tempGc)); + + if ( err != KErrNone ) + { + return; + } + + TRAPD(err2, ActivePalette2Utils::CreateDrawingObjectsL(EGray256, + ActivePalette2Utils::APDimensionSize( EItemSize ), + &tempMaskBitmap, + &tempMaskDevice, + &tempMaskGc)); + + if ( err2 != KErrNone ) + { + return; + } + +#endif // PREPROCESS_BITMAPS + + if ( iModel->ShowTopScrollIndicator() ) + { + iTopScrollVisual->iOpacity.Set(KOpacityFull, NAP2Cfg::K3dScrollIndicatorFadeTime); + } + else + { + iTopScrollVisual->iOpacity.Set(KOpacityNone, NAP2Cfg::K3dScrollIndicatorFadeTime); + } + + + TInt numItemsOnScreen = iModel->CountItemsOnScreen(); + + numItemsOnScreen++; + + TPoint scrollOffset = CurrentScrollOffset(); + + TInt i; + for ( i = 0; i < numItemsOnScreen; i++ ) + { + CActivePalette2Item* item = iModel->ItemFromScreenPos(i); + + if ( item ) + { + iItemLayout[i]->SetPos(THuiRealPoint(ItemPosition(i) + scrollOffset)); + +#ifdef PREPROCESS_BITMAPS + tempGc->BitBlt(TPoint(0,0), &(item->Icon())); + tempMaskGc->BitBlt(TPoint(0,0), item->Mask()); + TRAP_IGNORE(iItemTexture[i]->UploadL(*tempBitmap, tempMaskBitmap)); +#else + TRAP_IGNORE(iItemTexture[i]->UploadL(item->Icon(), item->Mask())); +#endif + iItemVisual[i]->iOpacity.Set(KOpacityFull); + } + } + + if ( iModel->ItemScrollOffset() == 0 ) + { + iItemVisual[numItemsOnScreen-1]->iOpacity.Set(KOpacityNone); + } + else + { + ItemsScrolledSetItemOpacities(); + } + + + for ( i = numItemsOnScreen; i < iItemVisual.Count(); i++ ) + { + iItemVisual[i]->iOpacity.Set(KOpacityNone); + } + + if ( iModel->ShowBottomScrollIndicator() ) + { + iBottomScrollLayout->SetPos(THuiRealPoint(BottomScrollPanePosition() + ActivePalette2Utils::APDimensionPoint(E3dScrollIconOffset))); + iBottomScrollVisual->iOpacity.Set(KOpacityFull, NAP2Cfg::K3dScrollIndicatorFadeTime); + } + else + { + iBottomScrollVisual->iOpacity.Set(KOpacityNone, NAP2Cfg::K3dScrollIndicatorFadeTime); + } + + UpdateFocus(); + +#ifdef PREPROCESS_BITMAPS + ActivePalette2Utils::DeleteDrawingObjects(&tempMaskBitmap, + &tempMaskDevice, + &tempMaskGc); + ActivePalette2Utils::DeleteDrawingObjects(&tempBitmap, + &tempDevice, + &tempGc); +#endif + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::OfferEventL() +// ----------------------------------------------------------------------------- +// +TBool CActivePalette2HUI::OfferEventL(const THuiEvent& aEvent) + { + TBool res = EFalse; + + if(aEvent.IsKeyEvent() && aEvent.iCode == EEventKey) + { + if (aEvent.iKeyEvent.iScanCode == iNavigationKeys.iNaviPrev) + { + // go to previous + res = iModel->ProcessInputEvent(EAP2InputUp); + } + else if (aEvent.iKeyEvent.iScanCode == iNavigationKeys.iNaviNext) + { + // go to next + res = iModel->ProcessInputEvent(EAP2InputDown); + } + else if (aEvent.iKeyEvent.iScanCode == iNavigationKeys.iNaviSelect) + { + // select item + res = iModel->ProcessInputEvent(EAP2InputSelect); + } + else + { + // lint + } + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::PalettePosition() +// ----------------------------------------------------------------------------- +// +TPoint CActivePalette2HUI::PalettePosition() const + { + TInt totalFrames = Max(1, iModel->PaletteAppearingTotalFrames()); + TInt xOffset = ((KPaletteHiddenXPos - iTopLeftCorner.iX) * (totalFrames - iModel->PaletteAppearingCurrentFrame())) / totalFrames; + return TPoint(iTopLeftCorner.iX + xOffset, iTopLeftCorner.iY); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::ItemsScrolledSetItemOpacities() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::ItemsScrolledSetItemOpacities() + { + TInt currentOffset = iModel->ItemScrollOffset(); + TInt totalFrames = Max(1, iModel->ItemScrollTotalFrames()); + + iItemVisual[0]->iOpacity.Set(TReal(totalFrames - currentOffset) / totalFrames); + iItemVisual[iModel->CountItemsOnScreen()]->iOpacity.Set(TReal(currentOffset) / totalFrames); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateFocus() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::AnimateFocus(TInt aCurrentPos, TInt aTargetPos, TInt aTimeInMilliseconds) + { + if ( iModel->PaletteActive() + && iModel->CountItemsOnScreen() > 0 ) + { + iFocusRingLayout->SetPos(THuiRealPoint(ItemPosition(aCurrentPos) + TPoint(ActivePalette2Utils::APDimension(EFocusRingXOffset), ActivePalette2Utils::APDimension(EFocusRingYOffset)))); + + iFocusRingLayout->SetPos(THuiRealPoint(ItemPosition(aTargetPos) + TPoint(ActivePalette2Utils::APDimension(EFocusRingXOffset), ActivePalette2Utils::APDimension(EFocusRingYOffset))), aTimeInMilliseconds); + + iFocusRingVisual->iOpacity.Set(KOpacityFull); + + iGeneralTimer->Cancel(); + iGeneralTimer->Start( + aTimeInMilliseconds * KMicrosecondsPerMillisecond, + aTimeInMilliseconds * KMicrosecondsPerMillisecond, + TCallBack(&CActivePalette2HUI::AnimateFocusTimerCallback,(TAny *)this)); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateFocusTimerCallback() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::AnimateFocusTimerCallback(TAny* aPtr) + { + CActivePalette2HUI* self = (CActivePalette2HUI*) aPtr; + + if ( self ) + { + return self->AnimateFocusTimerComplete(); + } + else + { + return KCallbackFinished; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateFocusTimerComplete() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::AnimateFocusTimerComplete() + { + iGeneralTimer->Cancel(); + iModel->AnimateFocusRendererComplete(); + return KCallbackFinished; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::ItemPosition() +// ----------------------------------------------------------------------------- +// +TPoint CActivePalette2HUI::ItemPosition(TInt aScreenPos) const + { + return TPoint(ActivePalette2Utils::APDimension(EItemXOffset), ActivePalette2Utils::APDimension(ETopSectionHeight) + aScreenPos * (ActivePalette2Utils::APDimension(EItemHeight) + ActivePalette2Utils::APDimension(EGapBetweenItems))); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::TopScrollPanePosition() +// ----------------------------------------------------------------------------- +// +TPoint CActivePalette2HUI::TopScrollPanePosition() const + { + return TPoint(0, 0); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::BottomScrollPanePosition() +// ----------------------------------------------------------------------------- +// +TPoint CActivePalette2HUI::BottomScrollPanePosition() const + { + TInt gaps = Max(0, iModel->CountItemsOnScreen() - 1); + return TPoint(0, ActivePalette2Utils::APDimension(ETopSectionHeight) + iModel->CountItemsOnScreen() * ActivePalette2Utils::APDimension(EItemHeight) + gaps * ActivePalette2Utils::APDimension(EGapBetweenItems)); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::PaletteSize() +// ----------------------------------------------------------------------------- +// +TSize CActivePalette2HUI::PaletteSize() const + { + return TSize(ActivePalette2Utils::APDimension(EPaletteWidth), BottomScrollPanePosition().iY + ActivePalette2Utils::APDimension(EBottomSectionHeight)); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::CurrentScrollOffset() +// ----------------------------------------------------------------------------- +// +TPoint CActivePalette2HUI::CurrentScrollOffset() const + { + return TPoint(0, -((ActivePalette2Utils::APDimension(EItemHeight) + ActivePalette2Utils::APDimension(EGapBetweenItems)) * iModel->ItemScrollOffset())/Max(1, iModel->ItemScrollTotalFrames())); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2BasicUI::AnimateAppearance() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::AnimateAppearance(TBool aVisible, TInt aTimeInMilliseconds) + { + if ( aVisible ) + { + iPaletteLayout->SetPos(THuiRealPoint(TPoint(iTopLeftCorner.iX, iTopLeftCorner.iY)), aTimeInMilliseconds); + } + else + { + iPaletteLayout->SetPos(THuiRealPoint(TPoint(KPaletteHiddenXPos, iTopLeftCorner.iY)), aTimeInMilliseconds); + } + + iGeneralTimer->Cancel(); + iGeneralTimer->Start( + aTimeInMilliseconds * KMicrosecondsPerMillisecond, + aTimeInMilliseconds * KMicrosecondsPerMillisecond, + TCallBack(&CActivePalette2HUI::AnimateAppearanceTimerCallback,(TAny *)this)); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateFocusTimerCallback() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::AnimateAppearanceTimerCallback(TAny* aPtr) + { + CActivePalette2HUI* self = (CActivePalette2HUI*) aPtr; + + if ( self ) + { + return self->AnimateAppearanceTimerComplete(); + } + else + { + return KCallbackFinished; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateFocusTimerComplete() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::AnimateAppearanceTimerComplete() + { + iGeneralTimer->Cancel(); + iModel->AnimateAppearanceRendererComplete(); + return KCallbackFinished; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::GuessCurrentAppearanceFrame() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::GuessCurrentAppearanceFrame() + { + if ( KPaletteHiddenXPos - iTopLeftCorner.iX == 0 ) + { + return 0; + } + else + { + TInt currentPos = iPaletteLayout->Pos().Now().iX; + return ((KPaletteHiddenXPos - currentPos) * iModel->PaletteAppearingTotalFrames()) / (KPaletteHiddenXPos - iTopLeftCorner.iX); + } + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateItemScroll() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::AnimateItemScroll(TInt aDirection, TInt aTimeInMilliseconds) + { + + TInt numItems = iModel->CountItemsOnScreen(); + + TInt itemOffset = 0; + if ( aDirection == 1 ) + { + itemOffset = -1; + } + + for( TInt i = 0; i <= numItems; i++) + { + iItemLayout[i]->SetPos(THuiRealPoint(ItemPosition(i + itemOffset)), aTimeInMilliseconds); + } + + if ( aDirection > 0 ) + { + iItemVisual[0]->iOpacity.Set(KOpacityNone, aTimeInMilliseconds); + iItemVisual[numItems]->iOpacity.Set(KOpacityFull, aTimeInMilliseconds); + } + else + { + iItemVisual[0]->iOpacity.Set(KOpacityFull, aTimeInMilliseconds); + iItemVisual[numItems]->iOpacity.Set(KOpacityNone, aTimeInMilliseconds); + } + + iGeneralTimer->Cancel(); + iGeneralTimer->Start( + aTimeInMilliseconds * KMicrosecondsPerMillisecond, + aTimeInMilliseconds * KMicrosecondsPerMillisecond, + TCallBack(&CActivePalette2HUI::AnimateItemScrollTimerCallback,(TAny *)this)); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateFocusTimerCallback() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::AnimateItemScrollTimerCallback(TAny* aPtr) + { + CActivePalette2HUI* self = (CActivePalette2HUI*) aPtr; + + if ( self ) + { + return self->AnimateItemScrollTimerComplete(); + } + else + { + return KCallbackFinished; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateFocusTimerComplete() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::AnimateItemScrollTimerComplete() + { + iGeneralTimer->Cancel(); + iModel->AnimateItemScrollRendererComplete(); + return KCallbackFinished; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::TooltipUpdated() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::TooltipUpdated() + { + TRAP_IGNORE(iTooltipTextVisual->SetTextL(*(iModel->TooltipText()))); + TSize textSize = iTooltipTextVisual->TextExtents(); + return textSize.iWidth + ActivePalette2Utils::APDimension(ETooltipTail) + ActivePalette2Utils::APDimension(ETooltipNose); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateTooltip() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::AnimateTooltip(TBool aToShow, TInt aTimeInMilliseconds) + { + TInt startMultiplier = aToShow ? 0 : 1; + TInt endMultiplier = aToShow ? 1 : 0; + + TPoint startPos(iTopLeftCorner + ItemPosition(iModel->TooltipScreenPosition()) + ActivePalette2Utils::APDimensionPoint(E3dTooltipOffset)); + TSize startSize(((iTooltipTextVisual->TextExtents().iWidth + ActivePalette2Utils::APDimension(ETooltipNose) + ActivePalette2Utils::APDimension(ETooltipTail)) * startMultiplier), ActivePalette2Utils::APDimension(ETooltipHeight)); + startPos.iX -= startSize.iWidth; + + iTooltipLayout->SetSize(THuiRealSize(startSize)); + iTooltipLayout->SetPos(THuiRealPoint(startPos)); + + TPoint endPos(iTopLeftCorner + ItemPosition(iModel->TooltipScreenPosition()) + ActivePalette2Utils::APDimensionPoint(E3dTooltipOffset)); + TSize endSize(((iTooltipTextVisual->TextExtents().iWidth + ActivePalette2Utils::APDimension(ETooltipNose) + ActivePalette2Utils::APDimension(ETooltipTail)) * endMultiplier), ActivePalette2Utils::APDimension(ETooltipHeight)); + endPos.iX -= endSize.iWidth; + + iTooltipLayout->SetSize(THuiRealSize(endSize), aTimeInMilliseconds); + iTooltipLayout->SetPos(THuiRealPoint(endPos), aTimeInMilliseconds); + + ShowTooltipUpdated(); + + iGeneralTimer->Cancel(); + iGeneralTimer->Start( + aTimeInMilliseconds * KMicrosecondsPerMillisecond, + aTimeInMilliseconds * KMicrosecondsPerMillisecond, + TCallBack(&CActivePalette2HUI::AnimateTooltipTimerCallback,(TAny *)this)); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateTooltipTimerCallback() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::AnimateTooltipTimerCallback(TAny* aPtr) + { + CActivePalette2HUI* self = (CActivePalette2HUI*) aPtr; + + if ( self ) + { + return self->AnimateTooltipTimerComplete(); + } + else + { + return KCallbackFinished; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::AnimateTooltipTimerComplete() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2HUI::AnimateTooltipTimerComplete() + { + iGeneralTimer->Cancel(); + iModel->AnimateTooltipRendererComplete(); + return KCallbackFinished; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::VisualLayoutUpdated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::VisualLayoutUpdated(CHuiVisual& /*aVisual*/) + { + UpdateTopLeftCornerWithScreenSize(); + iPaletteLayout->SetPos(THuiRealPoint(PalettePosition())); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2HUI::UpdateTopLeftCornerWithScreenSize() +// ----------------------------------------------------------------------------- +// +void CActivePalette2HUI::UpdateTopLeftCornerWithScreenSize() + { + AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, iScreenSize ); + + // This uses the same logic that MC Photos used. If in landscape mode or no + // location specified in portrait mode then position the palette relative to + // the top RH corner of the screen using the default settings + if ( ( iScreenSize.iWidth > iScreenSize.iHeight ) || + ( ! iLocated ) ) + { + iTopLeftCorner.iX = iScreenSize.iWidth + ActivePalette2Utils::APDimensionPoint(EDefault3dPaletteOffset).iX; + iTopLeftCorner.iY = ActivePalette2Utils::APDimensionPoint(EDefault3dPaletteOffset).iY; + } + } diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2Item.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2Item.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,433 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Items* +*/ + + +/** + * @file ActivePalette2Item.cpp + * Active Palette Items + */ + +// DEFINITIONS +#define ACTIVEPALETTE_SUPPORT_PLUGIN_CAM + +// INCLUDE FILES +#include + +#include "ActivePalette2Item.h" +#include "ActivePalette2Model.h" +#include "ActivePalette2Logger.h" +#include "ActivePalette2Cfg.h" +#include "ActivePalette2GenericPlugin.h" +#include "CActivePalettePluginBase.h" + +#include +#include +#include + + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CActivePalette2IDHolder::CActivePalette2IDHolder() +// ----------------------------------------------------------------------------- +// +CActivePalette2IDHolder::CActivePalette2IDHolder() + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CActivePalette2IDHolder::CActivePalette2IDHolder() +// ----------------------------------------------------------------------------- +// +CActivePalette2IDHolder::CActivePalette2IDHolder(TInt aItemId) +: iItemId(aItemId) + { + // no implementation required + } + +// ----------------------------------------------------------------------------- +// CActivePalette2IDHolder::SetItemId() +// ----------------------------------------------------------------------------- +// +void CActivePalette2IDHolder::SetItemId(TInt aItemId) + { + iItemId = aItemId; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::NewLC() +// ----------------------------------------------------------------------------- +// +CActivePalette2Item * CActivePalette2Item::NewLC(TInt aItemId, + const TUid& aPluginUid, + CActivePalette2Model& aModel) + { + CActivePalette2Item * self = new (ELeave) CActivePalette2Item( + aItemId, aPluginUid, aModel + ); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::CActivePalette2Item() +// ----------------------------------------------------------------------------- +// +CActivePalette2Item::CActivePalette2Item( + TInt aItemId, + const TUid& aPluginUid, + CActivePalette2Model& aModel +) +: CActivePalette2IDHolder(aItemId), + iPluginUid(aPluginUid), + iModel(aModel) + { + LOGTEXT( _L( "CActivePalette2Item::CActivePalette2Item" )); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::ConstructL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::ConstructL(void) + { + NActivePalettePluginFactory::TInstantiatePluginLFunc + instantiatePluginL = FindPluginFactoryL(iPluginUid); + + // instantiate plugin + CActivePalettePluginBase* pluginObj = instantiatePluginL(iPluginUid, GetPluginCreationParams()); + if (NULL == iPlugin || pluginObj != iPlugin) + { + // illegal plugin, plugin was supposed to callback via NotifyPluginCreated() + User::Leave(KErrGeneral); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::~CActivePalette2Item() +// ----------------------------------------------------------------------------- +// +CActivePalette2Item::~CActivePalette2Item() + { + LOGTEXT1( _L( "CActivePalette2Item::~CActivePalette2Item entered, item ID : %d" ), ItemId()); + + if (iPlugin) + { + LOGTEXT( _L( "... calling plugin's shutdown" ) ); + iPlugin->Shutdown(); + LOGTEXT( _L( "... plugin's shutdown returned" ) ); + } + LOGTEXT( _L( "... deleting plugin's object" ) ); + CBase::Delete(iPlugin); + LOGTEXT( _L( "... plugin's object deleted" ) ); + iPlugin = NULL; + + if (iOwnsIcon) + { + delete iIcon; + } + iIcon = NULL; + + delete iTooltip; + iTooltip = NULL; + + iDLL.Close(); + + LOGTEXT( _L( "CActivePalette2Item::~CActivePalette2Item left" ) ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::FindPluginFactoryL() +// ----------------------------------------------------------------------------- +// +NActivePalettePluginFactory::TInstantiatePluginLFunc CActivePalette2Item::FindPluginFactoryL(const TUid aUid) + { + LOGTEXT1( _L( "CActivePalette2Item::FindPluginFactoryL entered, Uid : %d" ), + aUid.iUid); + + NActivePalettePluginFactory::TInstantiatePluginLFunc factory = NULL; + + if (aUid == TUid::Uid(KActivePalette2GenericPluginUID)) + { + factory = &InstantiateGenericPluginL; + } + else + { + // lookup DLL file name + TFileName dllFileName; + TBool dllNameAssigned = EFalse; + // todo: implement lookup in plugin table + + if (TUid::Uid(KPrintPluginUid) == aUid) + { + dllFileName = KPrintPluginDLLName; + dllNameAssigned = ETrue; + } + else if (TUid::Uid(KPrintIntentPluginUid) == aUid) + { + dllFileName = KPrintIntentPluginDLLName; + dllNameAssigned = ETrue; + } + else if( TUid::Uid( KOnlineSharingPluginUid ) == aUid ) + { + dllFileName = KOnlineSharingPluginDLLName; + dllNameAssigned = ETrue; + } +#ifdef ACTIVEPALETTE_SUPPORT_PLUGIN_CAM + else if (TUid::Uid( KCamAPPluginUid ) == aUid) + { + dllFileName = KCamAPluginDLLName; + dllNameAssigned = ETrue; + } + else + { + // lint + } +#endif // ACTIVEPALETTE_SUPPORT_PLUGIN_CAM + + LOGTEXT1( _L( "... DLL file name found?: %d" ), dllNameAssigned); + if (EFalse == dllNameAssigned) + { + User::Leave(KErrNotSupported); + } + + // load plug-in DLL + LOGTEXT( _L( "... loading DLL" )); + User::LeaveIfError(iDLL.Load(dllFileName)); + + // get factory function + LOGTEXT( _L( "... factory entry point lookup" )); + factory = (NActivePalettePluginFactory::TInstantiatePluginLFunc) + iDLL.Lookup(NActivePalettePluginFactory::KFactoryEntryOrdinal); + + if(!factory) + { + User::Leave(KErrGeneral); + } + } + + LOGTEXT1( _L( "CActivePalette2Item::FindPluginFactoryL left, factory : %p" ), + factory); + + return factory; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::GetPluginCreationParams() +// ----------------------------------------------------------------------------- +// +NActivePalettePluginFactory::TPluginCreationParams CActivePalette2Item::GetPluginCreationParams(void) + { + return NActivePalettePluginFactory::TPluginCreationParams( + *this, + iModel.ItemSize()); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::NotifyPluginCreated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::NotifyPluginCreated(CActivePalettePluginBase* aPlugin) + { + iPlugin = aPlugin; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::NotifyPluginDestroyed() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::NotifyPluginDestroyed(CActivePalettePluginBase* aPlugin) + { + if (iPlugin == aPlugin) + { + iPlugin = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::PluginUid() +// ----------------------------------------------------------------------------- +// +TUid CActivePalette2Item::PluginUid(void) const + { + return iPluginUid; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::DoSetItemIcon() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::DoSetItemIcon(CGulIcon* aIcon, TBool aOnwershipTransfer) + { + if (iOwnsIcon) + { + delete iIcon; + iIcon = NULL; + } + + iIcon = aIcon; + iOwnsIcon = aOnwershipTransfer; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::SetItemIcon() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::SetItemIcon(CGulIcon* aIcon, TBool aOnwershipTransfer) + { + DoSetItemIcon(aIcon,aOnwershipTransfer); + // notify UI + iModel.NotifyGraphicsChanged(*this,ETrue,EFalse); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::SetItemTooltipL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::SetItemTooltipL(const TDesC& aTooltipText) + { + // delete old + delete iTooltip; + iTooltip = NULL; + + // copy text + iTooltip = aTooltipText.AllocL(); + // notify UI + iModel.NotifyGraphicsChanged(*this,EFalse,ETrue); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::SetItemIconAndTooltipL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::SetItemIconAndTooltipL( + CGulIcon* aIcon, + TBool aOnwershipTransfer, + const TDesC & aTooltipText +) + { + // delete old + delete iTooltip; + iTooltip = NULL; + + // copy icon and tooltip + DoSetItemIcon(aIcon, aOnwershipTransfer); + iTooltip = aTooltipText.AllocL(); + + + // notify UI + iModel.NotifyGraphicsChanged(*this,ETrue,ETrue); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::NotifyItemComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::NotifyItemComplete(const TDesC8& aDataDes) + { + // notify model' user + iModel.NotifyItemComplete(*this, KErrNone, aDataDes, KActivePaletteNoDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::NotifyItemComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::NotifyItemComplete(TInt aDataInt) + { + // notify model' user + iModel.NotifyItemComplete(*this, KErrNone, KNullDesC8, aDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::SendMessage() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::SendMessage(TInt aMessageID, const TDesC8& aDataDes) + { + // notify model' user + iModel.NotifyMessage(*this, KErrNone, aMessageID, aDataDes, KActivePaletteNoDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::SendMessage() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::SendMessage(TInt aMessageID, TInt aDataInt) + { + // notify model' user + iModel.NotifyMessage(*this, KErrNone, aMessageID, KNullDesC8, aDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::Icon() +// ----------------------------------------------------------------------------- +// +CFbsBitmap & CActivePalette2Item::Icon(void) const + { // icon is always valid + return *iIcon->Bitmap(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::Mask() +// ----------------------------------------------------------------------------- +// +CFbsBitmap * CActivePalette2Item::Mask(void) const + { + return (NULL == iIcon) ? NULL : iIcon->Mask(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::Tooltip() +// ----------------------------------------------------------------------------- +// +HBufC* CActivePalette2Item::Tooltip(void) const + { + return iTooltip; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::InitPluginL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Item::InitPluginL(const TDesC8& aCustomDataDes, TInt aCustomDataInt) + { + // do construct + iPlugin->ConstructL(GetPluginCreationParams(),aCustomDataDes,aCustomDataInt); + // validate icon + if (NULL == iIcon || NULL == iIcon->Bitmap()) + { + User::Leave(KErrGeneral); // plugin MUST produce an icon during its ConstructL() + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Item::Plugin() +// ----------------------------------------------------------------------------- +// +CActivePalettePluginBase& CActivePalette2Item::Plugin(void) const + { + return *iPlugin; + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2ItemVisible.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2ItemVisible.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains (item id, visible) pairs used by AP2* +*/ + + +/** + * @file ActivePalette2ItemVisible.cpp + * Contains (item id, visible) pairs used by AP2 + */ + + +#include + + +// ----------------------------------------------------------------------------- +// TActivePalette2ItemVisible::TActivePalette2ItemVisible() +// ----------------------------------------------------------------------------- +// +EXPORT_C TActivePalette2ItemVisible::TActivePalette2ItemVisible(TInt aItemId, TBool aVisible) +: iItemId(aItemId), + iVisible(aVisible) + { + // No implementation required + } + + +// ----------------------------------------------------------------------------- +// TActivePalette2ItemVisible::ItemId() +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt TActivePalette2ItemVisible::ItemId() const + { + return iItemId; + } + +// ----------------------------------------------------------------------------- +// TActivePalette2ItemVisible::Visible() +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool TActivePalette2ItemVisible::Visible() const + { + return iVisible; + } + +// ----------------------------------------------------------------------------- +// TActivePalette2ItemVisible::TActivePalette2ItemVisible() +// ----------------------------------------------------------------------------- +// +TActivePalette2ItemVisible::TActivePalette2ItemVisible() +: iItemId(0), + iVisible(EFalse) + { + // No implementation required + } diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2Model.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2Model.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,2350 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 Model* +*/ + + +/** + * @file ActivePalette2Model.cpp + * Active Palette 2 Model + */ + +// INCLUDE FILES +#include +#include +#include +#include + +#include "ActivePalette2Item.h" +#include "ActivePalette2Model.h" +#include "ActivePalette2ModelObserver.h" +#include "ActivePalette2Logger.h" +#include "ActivePalette2Cfg.h" +#include "activepalette2configuration.h" +#include "ActivePalette2Utils.h" + + +// ----------------------------------------------------------------------------- +// TRendererCallBacks::TRendererCallBacks() +// ----------------------------------------------------------------------------- +// +TRendererCallBacks::TRendererCallBacks() +: iTooltipTimer(NULL), + iFocusTimer(NULL), + iItemScrollTimer(NULL), + iAppearanceTimer(NULL), + iTooltipDescriptive(NULL), + iFocusDescriptive(NULL), + iItemScrollDescriptive(NULL), + iAppearanceDescriptive(NULL) + { + // no implementation needed + } + + + + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::NewL() +// 2 phase construction +// ----------------------------------------------------------------------------- +// +CActivePalette2Model* CActivePalette2Model::NewL( + MActivePalette2ModelObserver& aModelObserver, + TSize aItemSize, + const TRendererCallBacks& aCallbacks, + CActivePalette2Configuration* aConfiguration /*=NULL*/ ) + { + CActivePalette2Model * self = + new (ELeave) CActivePalette2Model( aModelObserver, + aItemSize, + aCallbacks, + aConfiguration ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // this + return self; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::CActivePalette2Model() +// C++ Constuctor +// ----------------------------------------------------------------------------- +// +CActivePalette2Model::CActivePalette2Model( + MActivePalette2ModelObserver& aModelObserver, + TSize aItemSize, + const TRendererCallBacks& aCallbacks, + CActivePalette2Configuration* aConfiguration ) + : iPreviousItemID(KInvalidId), + iFocusedItemID(KInvalidId), + iPaletteMoveCurrentOffset(0), + iPaletteMoveOffsetTotalFrames(NAP2Cfg::KPaletteAppearFrames), + iPaletteMoveAnimationDuration(NAP2Cfg::KPaletteAppearTotalTime / KMicrosecondsPerMillisecond), + iAnimState(EPaletteAnimIdle), + iCallbacks(aCallbacks), + iModelObserver(aModelObserver), + iItemSize(aItemSize), + iTooltipConfig() + { + LOGTEXT( _L( "CActivePalette2Model::CActivePalette2Model entered" )); + if( aConfiguration ) + { + aConfiguration->TooltipConfiguration( iTooltipConfig ); + } + else + { + iTooltipConfig.iPreshowDelay = NAP2Cfg::KTooltipPreshowDelay; + iTooltipConfig.iFullshowPeriod = NAP2Cfg::KTooltipFullshowPeriod; + iTooltipConfig.iTimerTickLength = NAP2Cfg::KTooltipTimerTickLength; + iTooltipConfig.iTransitionSpeed = NAP2Cfg::KTooltipShowSpeed; + iTooltipConfig.iTransitionFrames = KErrNotSupported; + } + LOGTEXT( _L( "CActivePalette2Model::CActivePalette2Model left" )); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ConstructL(void) +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::ConstructL(void) + { + iTooltipTimer = CPeriodic::NewL(CActive::EPriorityHigh); // high priority for smooth animation + iFocusChangeTimer = CPeriodic::NewL(CActive::EPriorityHigh); + iItemScrollTimer = CPeriodic::NewL(CActive::EPriorityHigh); + iItemAnimTimer = CPeriodic::NewL(CActive::EPriorityHigh); + iPaletteMoveTimer = CPeriodic::NewL(CActive::EPriorityHigh); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::~CActivePalette2Model() +// Destructor +// ----------------------------------------------------------------------------- +// +CActivePalette2Model::~CActivePalette2Model() + { + LOGTEXT( _L( "CActivePalette2Model::~CActivePalette2Model entered" )); + + if (iTooltipTimer) + { + iTooltipTimer->Cancel(); + delete iTooltipTimer; + } + + if (iFocusChangeTimer) + { + iFocusChangeTimer->Cancel(); + delete iFocusChangeTimer; + } + + if (iItemScrollTimer) + { + iItemScrollTimer->Cancel(); + delete iItemScrollTimer; + } + + if (iItemAnimTimer) + { + iItemAnimTimer->Cancel(); + delete iItemAnimTimer; + } + + if (iPaletteMoveTimer) + { + iPaletteMoveTimer->Cancel(); + delete iPaletteMoveTimer; + } + + iItemsArray.ResetAndDestroy(); + iItemsArray.Close(); + iVisibilityArray.Reset(); + iVisibilityArray.Close(); + + LOGTEXT( _L( "CActivePalette2Model::~CActivePalette2Model left" )); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::FindItem() +// item data management +// ----------------------------------------------------------------------------- +// +CActivePalette2Item* CActivePalette2Model::FindItem(const TInt aItemId) const + { + TInt index = ItemIndexFromId(aItemId); + + if ( ValidItemIndex(index) ) + { + return static_cast(iItemsArray[index]); + } + else + { + return NULL; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::DoInstallItemL() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::DoInstallItemL(TInt aItemId, + TBool aVisible, + const TUid& aPluginUid, + const TDesC8& aCustomDataDes, + TInt aCustomDataInt) + { + // check if item ID is unique + if ( ItemIndexFromId(aItemId) != KInvalidItemIndex ) + { + return KErrArgument; + } + + // item and plugin instantiate + CActivePalette2Item* item = CActivePalette2Item::NewLC(aItemId,aPluginUid, *this); + + item->InitPluginL(aCustomDataDes, aCustomDataInt); + + User::LeaveIfError(iItemsArray.Append(item)); + User::LeaveIfError(iVisibilityArray.Append(aVisible)); + + CleanupStack::Pop(item); + + if ( aVisible ) + { + EnforceConstraints(); + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::RemoveItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::RemoveItem(const TInt aItemId) + { + LOGTEXT1( _L( "CActivePalette2Model::RemoveItem entered, Item ID: %d" ), + aItemId); + + TInt res(KErrNone); + + CActivePalette2Item* item = FindItem(aItemId); + TInt index = ItemIndexFromId(aItemId); + + if (item) // valid item + { + iItemsArray.Remove(index); // unregister + iVisibilityArray.Remove(index); + + // destroy item + CBase::Delete(item); // implies plugin shutodown and DLL unload + + EnforceConstraints(); + } + else + { + res = KErrArgument; + } + + LOGTEXT1( _L( "CActivePalette2Model::RemoveItem left, res %d" ), res); + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::HandleItemSelected() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::HandleItemSelected(const TInt aItemIndex) + { + LOGTEXT1( _L( "CActivePalette2Model::HandleItemSelected entered, Item ID: %d" ), + aItemIndex); + + if ( ValidItemIndex(aItemIndex) ) + { + CActivePalette2Item* item = iItemsArray[aItemIndex]; + if (item) + { + TInt err; + + LOGTEXT( _L( "... calling plugin's HandleItemSelectedL" )); + + TRAP(err, item->Plugin().HandleItemSelectedL()); + + LOGTEXT1( _L( "... res : %d" ), err); + + if (KErrNone != err) + { + // leave during item selection handling, invoke callback now + NotifyItemComplete(*item, err, KNullDesC8, KActivePaletteNoDataInt); + } + } + else + { + LOGTEXT( _L( "... INTERNAL FAULT: item object not found" )); + } + } + + LOGTEXT( _L( "CActivePalette2Model::HandleItemSelected left" )); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::DispatchMessage() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::DispatchMessage(const TInt aItemId, const TInt aMessageID, const TDesC8& aDataDes, const TInt aDataInt) + { + LOGTEXT2( _L( "CActivePalette2Model::DispatchMessgage entered, Item ID: %d, Message ID : %d" ), + aItemId, aMessageID); + + TInt res; + CActivePalette2Item* item = FindItem(aItemId); + if (item) + { + TInt err; + + LOGTEXT( _L( "...calling plugin's HandleMessageL" )); + + TRAP(err, item->Plugin().HandleMessageL(aMessageID, aDataDes, aDataInt)); + + LOGTEXT1( _L( "... res : %d" ), err); + + res = err; // retransmit error code + } + else + { + res = KErrArgument; + } + + LOGTEXT1( _L( "CActivePalette2Model::DispatchMessgage left, res %d" ), res); + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::Observer() +// ----------------------------------------------------------------------------- +// +MActivePalette2ModelObserver& CActivePalette2Model::Observer(void) const + { + return iModelObserver; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemIndexFromId() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::ItemIndexFromId(const TInt aItemId) const + { + TInt res = KInvalidItemIndex; + TInt currentItemIndex = 0; + + while ( res == KInvalidItemIndex && ValidItemIndex(currentItemIndex) ) + { + if ( iItemsArray[currentItemIndex]->ItemId() == aItemId ) + { + res = currentItemIndex; + } + else + { + currentItemIndex++; + } + } + + return res; + } + + + + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::TooltipText() +// ----------------------------------------------------------------------------- +// +TDesC* CActivePalette2Model::TooltipText() + { + if ( ValidItemIndex(iFocusedItem) ) + { + CActivePalette2Item& api = static_cast (*iItemsArray[iFocusedItem]); + return api.Tooltip(); + } + else + { + return NULL; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ShowTooltip() +// ----------------------------------------------------------------------------- +// +TBool CActivePalette2Model::ShowTooltip() + { + return iShowTooltip; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::TooltipCurrentFrame() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::TooltipCurrentFrame() + { + return iTooltipCurrentFrame; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::TooltipTotalFrames() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::TooltipTotalFrames() + { + return iTooltipTotalFrames; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::TooltipScreenPosition() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::TooltipScreenPosition() + { + return FocusedItem(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::CompelTooltip() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::CompelTooltip() + { + TInt tooltip_width = iModelObserver.TooltipUpdated(); + + if( iTooltipConfig.iTransitionFrames > 0 ) + iTooltipTotalFrames = iTooltipConfig.iTransitionFrames; + else + iTooltipTotalFrames = tooltip_width / iTooltipConfig.iTransitionSpeed; + + TooltipSetState( ETooltipRise ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::RemoveTooltip(void) +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::RemoveTooltip(void) + { + TooltipSetState(ETooltipNone); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::TooltipSteadyAniAction() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::TooltipSteadyAniAction(void) + { + // start shrinking + TooltipSetState(ETooltipSet); + return KCallbackFinished; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::TooltipRiseAniAction() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::TooltipRiseAniAction(void) + { + TInt res = KCallbackFinished; + + iShowTooltip = ETrue; + + if ( iCallbacks.iTooltipTimer ) + { + if (iTooltipCurrentFrame >= iTooltipTotalFrames) + { + TooltipSetState(ETooltipSteady); + } + else + { + res = KCallbackCallAgain; + iTooltipCurrentFrame++; + } + + iCallbacks.iTooltipTimer->TooltipAnimated(); + } + else if ( iCallbacks.iTooltipDescriptive ) + { + TInt duration( (iTooltipTotalFrames*iTooltipConfig.iTimerTickLength) / KMicrosecondsPerMillisecond ); + iCallbacks.iTooltipDescriptive->AnimateTooltip( ETrue, duration ); + iTooltipTimer->Cancel(); + } + else + { + // just for Lint. + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::TooltipDisappearAniAction() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::TooltipDisappearAniAction(void) + { + TInt res = KCallbackFinished; + + if ( iCallbacks.iTooltipTimer ) + { + if (iTooltipCurrentFrame <= 0) + { + TooltipSetState(ETooltipNone); + } + else + { + res = KCallbackCallAgain; + iTooltipCurrentFrame--; + } + + if ( iCallbacks.iTooltipTimer ) + { + iCallbacks.iTooltipTimer->TooltipAnimated(); + } + } + else if ( iCallbacks.iTooltipDescriptive ) + { + TInt duration( (iTooltipTotalFrames*iTooltipConfig.iTimerTickLength) / KMicrosecondsPerMillisecond ); + iCallbacks.iTooltipDescriptive->AnimateTooltip( EFalse, duration ); + iTooltipTimer->Cancel(); + } + else + { + // just for Lint. + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::TooltipTimerCallback() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::TooltipTimerCallback(TAny* aPtr) + { + CActivePalette2Model* self = (CActivePalette2Model*) aPtr; + TInt res = KCallbackFinished; + + switch (self->iTooltipState) + { + case ETooltipSteady: + res = self->TooltipSteadyAniAction(); + break; + + case ETooltipRise: + res = self->TooltipRiseAniAction(); + break; + + case ETooltipSet: + res = self->TooltipDisappearAniAction(); + break; + + default: + break; + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::TooltipSetState() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::TooltipSetState(TTooltipState aState) + { + iTooltipTimer->Cancel(); + TBool isOk = ETrue; + + switch (aState) + { + case ETooltipNone: + iTooltipTimer->Cancel(); + if ( iShowTooltip || iTooltipCurrentFrame > 0 ) + { + iShowTooltip = EFalse; + iTooltipCurrentFrame = 0; + iModelObserver.ShowTooltipUpdated(); + } + break; + + case ETooltipSteady: + iTooltipTimer->Start( + iTooltipConfig.iFullshowPeriod, + iTooltipConfig.iFullshowPeriod, + TCallBack(&CActivePalette2Model::TooltipTimerCallback,(TAny *)this)); + break; + + case ETooltipRise: + iTooltipCurrentFrame = 0; + iTooltipTimer->Start( + iTooltipConfig.iPreshowDelay, + iTooltipConfig.iTimerTickLength, + TCallBack(&CActivePalette2Model::TooltipTimerCallback,(TAny *)this)); + break; + + case ETooltipSet: +// iTooltipCurrentFrame = 0; + iTooltipTimer->Start( + iTooltipConfig.iTimerTickLength, + iTooltipConfig.iTimerTickLength, + TCallBack(&CActivePalette2Model::TooltipTimerCallback,(TAny *)this)); + break; + + default: + isOk = EFalse; + break; + } + + if (isOk) + { + iTooltipState = aState; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::FocusChangeComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::AnimateTooltipRendererComplete() + { + switch (iTooltipState) + { + case ETooltipRise: + TooltipSetState(ETooltipSteady); + break; + + case ETooltipSet: + TooltipSetState(ETooltipNone); + break; + + default: + case ETooltipNone: + case ETooltipSteady: + break; + } + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::CountItemsOnScreen() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::CountItemsOnScreen(void) + { + return iNoItemsOnScreen; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ShowTopScrollIndicator() +// ----------------------------------------------------------------------------- +// +TBool CActivePalette2Model::ShowTopScrollIndicator(void) + { + return iShowTopScrollArrow; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ShowBottomScrollIndicator() +// ----------------------------------------------------------------------------- +// +TBool CActivePalette2Model::ShowBottomScrollIndicator(void) + { + return iShowBottomScrollArrow; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::InitialiseConstraints() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::InitialiseConstraints(void) + { + iTopItemOnScreen = FindVisibleItem(0); + + iFocusedItem = iTopItemOnScreen; + + iNoVisibleItems = CountVisibleItems(0); + + iNoItemsOnScreen = Min(NAP2Cfg::KMaxNofItemsInView, iNoVisibleItems); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::EnforceConstraints() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::EnforceConstraints(void) + { + CompleteAnyItemBasedAnimations(); + + iNoVisibleItems = CountVisibleItems(0); + + iNoItemsOnScreen = Min(NAP2Cfg::KMaxNofItemsInView, iNoVisibleItems); + + iTopItemOnScreen = FindVisibleItem(iTopItemOnScreen); + + if(CountVisibleItems(iTopItemOnScreen) < iNoItemsOnScreen) + { + iTopItemOnScreen = FindVisibleItem(0); + + if ( iNoVisibleItems > iNoItemsOnScreen ) + { + while ( CountVisibleItems(iTopItemOnScreen) < iNoItemsOnScreen ) + { + iTopItemOnScreen = FindVisibleItem(iTopItemOnScreen + 1); + } + } + } + + if ( iNoVisibleItems > 0 ) + { + if ( iFocusedItem < 0 ) + { + iFocusedItem = FindVisibleItem(0); + } + + if ( iFocusedItem >= iItemsArray.Count() ) + { + iFocusedItem = PreviousVisibleItem(iItemsArray.Count() - 1); + } + + if ( ValidItemIndex(iFocusedItem) ) + { + if ( !iVisibilityArray[iFocusedItem] ) + { + TInt previousFocusedItem = iFocusedItem; + + iFocusedItem = FindVisibleItem(iFocusedItem); + + if ( iFocusedItem == KInvalidItemIndex ) + { + iFocusedItem = PreviousVisibleItem(previousFocusedItem); + } + + if ( iFocusedItem == KInvalidItemIndex ) + { + iFocusedItem = FindVisibleItem(0); + } + } + } + + if ( iFocusedItem < iTopItemOnScreen ) + { + iTopItemOnScreen = iFocusedItem; + } + else + { + while ( iFocusedItem > BottomItemOnScreen() ) + { + iTopItemOnScreen = FindVisibleItem(iTopItemOnScreen + 1); + } + } + } + else + { + iFocusedItem = KInvalidItemIndex; + } + + ItemsUpdated(); + FocusedItemUpdated(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::CompleteAnyItemBasedAnimations() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::CompleteAnyItemBasedAnimations() + { + switch (iAnimState) + { + case EPaletteAnimItemScroll: + case EPaletteAnimFocusChange: + case EPaletteAnimItemAnim: + SetAnimState(EPaletteAnimIdle); + break; + + default: + // do nothing + break; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::BottomItemOnScreen() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::BottomItemOnScreen(void) + { + TInt bottomItemOnScreen = iTopItemOnScreen; + + for(TInt i = 1; i < iNoItemsOnScreen; i++) + { + bottomItemOnScreen = FindVisibleItem(bottomItemOnScreen + 1); + } + + return bottomItemOnScreen; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::FindVisibleItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::FindVisibleItem(TInt aStartingItem) + { + TInt result = KInvalidItemIndex; + TInt currentItem = aStartingItem; + TBool found = EFalse; + TInt arraySize = iVisibilityArray.Count(); + + if ( aStartingItem != KInvalidItemIndex ) + { + while(!found && currentItem < arraySize) + { + if(iVisibilityArray[currentItem]) + { + result = currentItem; + found = ETrue; + } + else + { + currentItem++; + } + } + } + + return result; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::PreviousVisibleItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::PreviousVisibleItem(TInt aStartingItem) + { + TInt result = KInvalidItemIndex; + TInt currentItem = aStartingItem; + TBool found = EFalse; + + if ( aStartingItem != KInvalidItemIndex ) + { + while(!found && currentItem >= 0) + { + if(iVisibilityArray[currentItem]) + { + result = currentItem; + found = ETrue; + } + else + { + currentItem--; + } + } + } + + return result; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::CountVisibleItems() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::CountVisibleItems(TInt aStartingItem) + { + TInt result = 0; + TInt currentItem = aStartingItem; + TInt arraySize = iVisibilityArray.Count(); + + if ( aStartingItem != KInvalidItemIndex ) + { + while(currentItem < arraySize) + { + if(iVisibilityArray[currentItem]) + { + result++; + } + currentItem++; + } + } + else + { + result = KInvalidItemIndex; + } + + return result; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemIndexFromScreenPos() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::ItemIndexFromScreenPos(TInt aScreenPos) + { + TInt result = KInvalidItemIndex; + + if ( aScreenPos >= 0 && iNoItemsOnScreen > 0 && aScreenPos < NAP2Cfg::KMaxNofItemsInView + 1 ) + { + result = iOnScreenItemIndex[aScreenPos]; + } + + return result; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemFromScreenPos() +// ----------------------------------------------------------------------------- +// +CActivePalette2Item* CActivePalette2Model::ItemFromScreenPos(TInt aScreenPos) + { + CActivePalette2Item* result = NULL; + + TInt itemIndex = ItemIndexFromScreenPos(aScreenPos); + + if ( itemIndex != KInvalidItemIndex ) + { + result = iItemsArray[itemIndex]; + } + + return result; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ScreenPosFromItemIndex() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::ScreenPosFromItemIndex(TInt aItem) + { + TInt result = KInvalidScreenPos; + TInt currentItem = iTopItemOnScreen; + TInt currentScreenPos = 0; + TBool found = EFalse; + + if ( aItem >= iItemsArray.Count() ) + { + result = iNoItemsOnScreen; + } + else if ( aItem < 0) + { + result = NAP2Cfg::KScreenPosAboveTop; + } + else + { + while ( !found && currentScreenPos < iNoItemsOnScreen ) + { + if ( aItem == currentItem ) + { + found = ETrue; + } + else + { + currentItem = FindVisibleItem(currentItem + 1); + currentScreenPos++; + } + } + + if ( found ) + { + result = currentScreenPos; + } + } + + return result; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::FocusedItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::FocusedItem() + { + return ScreenPosFromItemIndex(iFocusedItem); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::FocusCurrentOffset() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::FocusCurrentOffset() + { + return iFocusedCurrentOffset; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::FocusCurrentTotalOffsetFrames() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::FocusCurrentTotalOffsetFrames() + { + return NAP2Cfg::KFocusChangeFrames; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::PaletteAppearingCurrentFrame() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::PaletteAppearingCurrentFrame() + { + return iPaletteMoveCurrentOffset; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::PaletteAppearingTotalFrames() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::PaletteAppearingTotalFrames() + { + return iPaletteMoveOffsetTotalFrames; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ProcessInputEvent() +// ----------------------------------------------------------------------------- +// +TBool CActivePalette2Model::ProcessInputEvent(TActivePalette2InputEvent aEvent) + { + TBool eventConsumed = EFalse; + + if ( PaletteActive() ) + { + SetAnimState(EPaletteAnimIdle); + + switch(aEvent) + { + case EAP2InputUp: + RemoveTooltip(); + + iFocusChangeTargetItem = PreviousVisibleItem(iFocusedItem - 1); + + if ( iFocusChangeTargetItem != KInvalidItemIndex && iFocusChangeTargetItem != iFocusedItem ) + { + if ( ScreenPosFromItemIndex(iFocusedItem) == 0 ) + { + // Item scroll + iTopItemOnScreen = iFocusChangeTargetItem; + iFocusedItem = iFocusChangeTargetItem; + + iItemScrollCurrentOffset = NAP2Cfg::KItemScrollFrames; + + ItemsUpdated(); + + ScrollItems(-1); + } + else + { + // Focus change + ChangeFocus(); + + eventConsumed = ETrue; + } + } + else + { + iFocusChangeTargetItem = PreviousVisibleItem(iItemsArray.Count() - 1); + + if ( iFocusChangeTargetItem != KInvalidItemIndex && iFocusChangeTargetItem != iFocusedItem ) + { + // Focus wrap + TInt screenPos = iNoItemsOnScreen - 1; + iTopItemOnScreen = iFocusChangeTargetItem; + + while ( screenPos > 0 ) + { + iTopItemOnScreen = PreviousVisibleItem(iTopItemOnScreen-1); + screenPos--; + } + + ItemsUpdated(); + + iFocusedItem = iItemsArray.Count(); + + ChangeFocus(); + + eventConsumed = ETrue; + } + } + break; + case EAP2InputDown: + RemoveTooltip(); + + iFocusChangeTargetItem = FindVisibleItem(iFocusedItem + 1); + + if ( iFocusChangeTargetItem != KInvalidItemIndex && iFocusChangeTargetItem != iFocusedItem ) + { + if ( ScreenPosFromItemIndex(iFocusedItem) == (iNoItemsOnScreen - 1)) + { + // Item scroll + iItemScrollCurrentOffset = 0; + + ScrollItems(+1); + } + else + { + // Focus change + ChangeFocus(); + } + + eventConsumed = ETrue; + } + else + { + // wrap focus to top + iFocusChangeTargetItem = FindVisibleItem(0); + + if ( iFocusChangeTargetItem != KInvalidItemIndex && iFocusChangeTargetItem != iFocusedItem ) + { + iTopItemOnScreen = iFocusChangeTargetItem; + ItemsUpdated(); + iFocusedItem = -1; + + ChangeFocus(); + } + } + + break; + + case EAP2InputSelect: + RemoveTooltip(); + + if ( iFocusedItem >= 0 && iFocusedItem < iItemsArray.Count()) + { + if ( iVisibilityArray[iFocusedItem] ) + { + TActivePalette2EventData res(PrepareEventData(*iItemsArray[iFocusedItem], KErrNone)); + + if ( iModelObserver.APObserver() ) + { + iModelObserver.APObserver()->NotifyItemSelected(res); + } + + HandleItemSelected(iFocusedItem); + + eventConsumed = ETrue; + } + } + break; + } + } + + return eventConsumed; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ScrollItems() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::ScrollItems(TInt aDirection) + { + SetAnimState(EPaletteAnimItemScroll); + + if ( iCallbacks.iItemScrollTimer ) + { + iItemScrollDirection = aDirection; + + iItemScrollTimer->Start( + NAP2Cfg::KItemScrollTimerTickLength, + NAP2Cfg::KItemScrollTimerTickLength, + TCallBack(&CActivePalette2Model::ItemScrollTimerCallback,(TAny *)this)); + } + else if ( iCallbacks.iItemScrollDescriptive ) + { + iCallbacks.iItemScrollDescriptive->AnimateItemScroll(aDirection, NAP2Cfg::KItemScrollTotalTime / KMicrosecondsPerMillisecond); + } + else + { + // just for Lint. + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ChangeFocus() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::ChangeFocus() + { + if ( iCallbacks.iFocusTimer ) + { + if ( iFocusedItem < iFocusChangeTargetItem ) + { + iFocusedCurrentOffset = 0; + iFocusChangeDirection = +1; + } + else + { + iFocusedCurrentOffset = NAP2Cfg::KFocusChangeFrames; + iFocusChangeDirection = -1; + iFocusedItem = iFocusChangeTargetItem; + } + + SetAnimState(EPaletteAnimFocusChange); + iFocusChangeTimer->Start( + NAP2Cfg::KFocusChangeTimerTickLength, + NAP2Cfg::KFocusChangeTimerTickLength, + TCallBack(&CActivePalette2Model::FocusChangeTimerCallback,(TAny *)this)); + } + else if ( iCallbacks.iFocusDescriptive ) + { + SetAnimState(EPaletteAnimFocusChange); + iCallbacks.iFocusDescriptive->AnimateFocus(ScreenPosFromItemIndex(iFocusedItem), ScreenPosFromItemIndex(iFocusChangeTargetItem), NAP2Cfg::KFocusChangeTotalTime / KMicrosecondsPerMillisecond); + } + else + { + // lint + } + } + + + + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemAnimInfo() +// ----------------------------------------------------------------------------- +// +CActivePalettePluginBase::TPluginAnimationInfo CActivePalette2Model::ItemAnimInfo() + { + return iAniItemInfo; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SetPaletteVisibility() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::SetPaletteVisibility(TBool aVisible, TBool aAnimated, TInt aDelayedStartMilliseconds) + { + // Check if we're already in an appearance animation + if ( iAnimState == EPaletteAnimAppearing + && iCallbacks.iAppearanceDescriptive ) + { + // If so, update state + iPaletteMoveCurrentOffset = iCallbacks.iAppearanceDescriptive->GuessCurrentAppearanceFrame(); + + if ( iPaletteMoveCurrentOffset < 0 || iPaletteMoveCurrentOffset > iPaletteMoveOffsetTotalFrames ) + { + iPaletteMoveOffsetTotalFrames = iPaletteMoveOffsetTotalFrames; + } + } + + + if ( aAnimated || aDelayedStartMilliseconds > 0) + { + if ( aVisible ) + { + if ( iPaletteMoveOffsetTotalFrames > iPaletteMoveCurrentOffset ) + { + RemoveTooltip(); + SetAnimState(EPaletteAnimAppearing); + iModelObserver.PaletteAppearingUpdated(); + + if ( aAnimated ) + { + iPaletteMoveAnimationDirection = +1; + } + else + { + iPaletteMoveAnimationDirection = +iPaletteMoveOffsetTotalFrames; + } + + iPaletteMoveTimer->Cancel(); + iPaletteMoveTimer->Start(Max(1, aDelayedStartMilliseconds * KMicrosecondsPerMillisecond), + NAP2Cfg::KPaletteAppearTimerTickLength, + TCallBack(&CActivePalette2Model::PaletteAnimTimerCallback,(TAny*)this)); + } + else if ( aAnimated && 0 >= iPaletteMoveAnimationDirection ) + { + iPaletteMoveAnimationDirection = +1; + } + } + else + { + if ( iPaletteMoveCurrentOffset > 0 ) + { + RemoveTooltip(); + SetAnimState(EPaletteAnimAppearing); + iModelObserver.PaletteAppearingUpdated(); + + if ( aAnimated ) + { + iPaletteMoveAnimationDirection = -1; + } + else + { + iPaletteMoveAnimationDirection = -iPaletteMoveOffsetTotalFrames; + } + + + iPaletteMoveTimer->Cancel(); + iPaletteMoveTimer->Start(Max(1, aDelayedStartMilliseconds * KMicrosecondsPerMillisecond), + NAP2Cfg::KPaletteAppearTimerTickLength, + TCallBack(&CActivePalette2Model::PaletteAnimTimerCallback,(TAny*)this)); + } + //Start fix for ERCK-77PCZJ + else + { + iPaletteMoveAnimationDirection = -iPaletteMoveOffsetTotalFrames; + SetAnimState(EPaletteAnimIdle); + } + //End fix ERCK-77PCZJ + } + } + else + { + if ( aVisible ) + { + if ( iPaletteMoveOffsetTotalFrames != iPaletteMoveCurrentOffset ) + { + RemoveTooltip(); + SetAnimState(EPaletteAnimIdle); + iPaletteMoveCurrentOffset = iPaletteMoveOffsetTotalFrames; + iModelObserver.PaletteAppearingUpdated(); + } + } + else + { + if ( iPaletteMoveCurrentOffset != 0 ) + { + RemoveTooltip(); + SetAnimState(EPaletteAnimIdle); + iPaletteMoveCurrentOffset = 0; + iModelObserver.PaletteAppearingUpdated(); + } + //Start fix for ERCK-77PCZJ + else + { + iPaletteMoveAnimationDirection = -iPaletteMoveOffsetTotalFrames; + SetAnimState(EPaletteAnimIdle); + } + //End fix ERCK-77PCZJ + } + } + + return KErrNone; + } + + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::NotifyItemComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::NotifyItemComplete(const CActivePalette2Item& aItem, + TInt aResult, + const TDesC8& aDataDes, + TInt aDataInt) + { + if ( iModelObserver.APObserver() ) + { + TActivePalette2EventData evt(PrepareEventData(aItem, aResult)); + iModelObserver.APObserver()->NotifyItemComplete(evt, aDataDes, aDataInt); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::NotifyMessage() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::NotifyMessage(const CActivePalette2Item& aItem, + const TInt aResult, + const TInt aMessageID, + const TDesC8& aDataDes, + TInt aDataInt) + { + if ( iModelObserver.APObserver() ) + { + TActivePalette2EventData eventData = PrepareEventData(aItem, aResult); + iModelObserver.APObserver()->NotifyMessage(eventData, aMessageID, aDataDes, aDataInt); + } + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::NotifyGraphicsChanged() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::NotifyGraphicsChanged(const CActivePalette2Item& /*aItem*/, + const TBool aIsIconChanged, + const TBool aIsTooltipChanged) + { + if ( aIsTooltipChanged ) + { + RemoveTooltip(); + } + + if ( aIsIconChanged ) + { + ItemsUpdated(); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::PrepareEventData() +// ----------------------------------------------------------------------------- +// +TActivePalette2EventData CActivePalette2Model::PrepareEventData(const CActivePalette2Item& aItem, + TInt aResult) + { + TActivePalette2EventData evt + ( + aResult, + aItem.ItemId(), + iPreviousItemID, + aItem.ItemId(), + aItem.PluginUid() + ); + + return evt; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SetItemVisibility() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::SetItemVisibility(const TInt aItemId, const TBool aIsVisible) + { + TInt index = ItemIndexFromId(aItemId); + TInt res = KErrNotFound; + + if ( ValidItemIndex(index) ) + { + if ( iVisibilityArray[index] != aIsVisible ) + { + iVisibilityArray[index] = aIsVisible; + EnforceConstraints(); + } + res = KErrNone; + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::GetItemVisibility() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::GetItemVisibility(const TInt aItemId, TBool &aIsVisible) const + { + TInt index = ItemIndexFromId(aItemId); + TInt res = KErrNone; + + if ( ValidItemIndex(index) ) + { + aIsVisible = iVisibilityArray[index]; + } + else + { + res = KErrArgument; + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::GetAvailablePlugins() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::GetAvailablePlugins(RArray& aPluginList) const + { + aPluginList.Reset(); + + // Generic plugin always available + aPluginList.Append(TUid::Uid(KActivePalette2GenericPluginUID)); + + AppendPluginIdIfAvailable(aPluginList, TUid::Uid(KPrintPluginUid), TFileName(KPrintPluginDLLName)); + AppendPluginIdIfAvailable(aPluginList, TUid::Uid(KPrintIntentPluginUid), TFileName(KPrintIntentPluginDLLName)); + AppendPluginIdIfAvailable(aPluginList, TUid::Uid(KOnlineSharingPluginUid), TFileName(KOnlineSharingPluginDLLName)); +#ifdef ACTIVEPALETTE_SUPPORT_PLUGIN_CAM + AppendPluginIdIfAvailable(aPluginList, TUid::Uid(KCamAPPluginUid), TFileName(KCamAPluginDLLName)); +#endif + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::AppendPluginIdIfAvailable() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::AppendPluginIdIfAvailable(RArray& aPluginList, const TUid aDllUid, const TFileName aDllFileName) const + { + RLibrary dll; + + TInt err = dll.Load(aDllFileName); + + if ( err == KErrNone ) + { + aPluginList.Append(aDllUid); + } + + dll.Close(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SetPaletteVisibilityAnimationDuration() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::SetPaletteVisibilityAnimationDuration(TInt aTimeInMilliSeconds) + { + iPaletteMoveAnimationDuration = aTimeInMilliSeconds; + + TInt targetTotalFrames = (aTimeInMilliSeconds * KMicrosecondsPerMillisecond) / NAP2Cfg::KPaletteAppearTimerTickLength; + + if ( targetTotalFrames < 1 ) + { + targetTotalFrames = 1; + } + + // update current frame + if ( iPaletteMoveCurrentOffset == iPaletteMoveOffsetTotalFrames ) + { + iPaletteMoveCurrentOffset = targetTotalFrames; + } + else if ( iPaletteMoveCurrentOffset > 0 && iPaletteMoveOffsetTotalFrames > 0) + { + iPaletteMoveCurrentOffset = (iPaletteMoveCurrentOffset * targetTotalFrames) / iPaletteMoveOffsetTotalFrames; + } + else + { + iPaletteMoveCurrentOffset = 0; + } + + iPaletteMoveOffsetTotalFrames = targetTotalFrames; + + // double check we're in range + if ( iPaletteMoveCurrentOffset < 0 ) + { + iPaletteMoveCurrentOffset = 0; + } + + if ( iPaletteMoveCurrentOffset > iPaletteMoveOffsetTotalFrames ) + { + iPaletteMoveCurrentOffset = iPaletteMoveOffsetTotalFrames; + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::GetItemList() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::GetItemList(RArray& aItemVisibleList) const + { + aItemVisibleList.Reset(); + + TInt currentItem = 0; + TInt totalItems = iItemsArray.Count(); + + while ( currentItem < totalItems ) + { + aItemVisibleList.Append( + TActivePalette2ItemVisible( + iItemsArray[currentItem]->ItemId(), + iVisibilityArray[currentItem])); + currentItem++; + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SetItemList() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::SetItemList(const RArray& aItemVisibleList) + { + TInt res = KErrNone; + TInt currentItem = 0; + TInt totalItems = iItemsArray.Count(); + TInt totalInputItems = aItemVisibleList.Count(); + TInt destIndex = 0; + + TInt focusedItemId = 0; + + // Backup the current focused item + if ( ValidItemIndex(iFocusedItem) ) + { + focusedItemId = iItemsArray[iFocusedItem]->ItemId(); + } + + // Check that there aren't any invalid IDs in the list + while ( currentItem < totalInputItems && res == KErrNone ) + { + TInt itemId = aItemVisibleList[currentItem].ItemId(); + TInt foundIndex = ItemIndexFromId(itemId); + + if ( foundIndex == KInvalidItemIndex ) + { + res = KErrNotFound; + } + + currentItem++; + } + + // Rearrange the item & visibility lists + currentItem = 0; + while ( currentItem < totalInputItems && destIndex < totalItems && res == KErrNone ) + { + TInt itemId = aItemVisibleList[currentItem].ItemId(); + TBool visible = aItemVisibleList[currentItem].Visible(); + + TInt foundIndex = ItemIndexFromId(itemId); + + if ( foundIndex >= currentItem ) + { + iItemsArray.Insert(iItemsArray[foundIndex], destIndex); + iItemsArray.Remove(foundIndex + 1); + + iVisibilityArray.Insert(visible, destIndex); + iVisibilityArray.Remove(foundIndex + 1); + + destIndex++; + } + + currentItem++; + } + + // Update the focus + if ( res == KErrNone ) + { + iFocusedItem = ItemIndexFromId(focusedItemId); + + EnforceConstraints(); + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::GetPaletteVisibilityAnimationDuration() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::GetPaletteVisibilityAnimationDuration(TInt& aTimeInMilliseconds) const + { + aTimeInMilliseconds = iPaletteMoveAnimationDuration; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SetCurrentItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::SetCurrentItem(const TInt aItemId) + { + TInt err = KErrNotFound; + TInt index = ItemIndexFromId(aItemId); + + if ( ValidItemIndex(index) ) + { + err = KErrGeneral; + + if ( iVisibilityArray[index] ) + { + iFocusedItem = index; + + EnforceConstraints(); + + err = KErrNone; + } + } + + return err; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::GetCurrentItem() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::GetCurrentItem(TInt& aItemId) const + { + TInt err = KErrGeneral; + + if ( ValidItemIndex(iFocusedItem) ) + { + if ( iItemsArray[iFocusedItem] ) + { + aItemId = iItemsArray[iFocusedItem]->ItemId(); + + err = KErrNone; + } + } + return err; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemsUpdated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::ItemsUpdated() + { + RemoveTooltip(); + + // Update cached data + TInt onScreenPos = 0; + TInt onScreenIndex = iTopItemOnScreen; + + while ( onScreenIndex != KInvalidItemIndex && onScreenPos < (NAP2Cfg::KMaxNofItemsInView + 1)) + { + iOnScreenItemIndex[onScreenPos] = onScreenIndex; + onScreenIndex = FindVisibleItem(onScreenIndex + 1); + onScreenPos++; + } + + while (onScreenPos < (NAP2Cfg::KMaxNofItemsInView + 1)) + { + iOnScreenItemIndex[onScreenPos] = KInvalidItemIndex; + onScreenPos++; + } + + iShowTopScrollArrow = iTopItemOnScreen > FindVisibleItem(0); + iShowBottomScrollArrow = CountVisibleItems(iTopItemOnScreen) > iNoItemsOnScreen; + + iModelObserver.ItemsUpdated(); + } + + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemScrollOffset() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::ItemScrollOffset() + { + return iItemScrollCurrentOffset; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemScrollTotalFrames() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::ItemScrollTotalFrames() + { + return NAP2Cfg::KItemScrollFrames; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SetAnimState() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::SetAnimState(TPaletteAnimState aNewState) + { + if ( iAnimState != aNewState ) + { + // Exit old state + switch ( iAnimState ) + { + case EPaletteAnimItemScroll: + ItemScrollComplete(); + break; + + case EPaletteAnimFocusChange: + FocusChangeComplete(); + break; + + case EPaletteAnimItemAnim: + ItemAnimationComplete(); + break; + + case EPaletteAnimAppearing: + PaletteAnimComplete(); + break; + + case EPaletteAnimIdle: + default: + // do nothing; + break; + } + + // Enter new state + switch ( aNewState ) + { + case EPaletteAnimItemScroll: + break; + + case EPaletteAnimFocusChange: + break; + + case EPaletteAnimItemAnim: + StartItemAnimation(); + break; + + case EPaletteAnimAppearing: + break; + + case EPaletteAnimIdle: + default: + // do nothing; + break; + } + + iAnimState = aNewState; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::PaletteActive() +// ----------------------------------------------------------------------------- +// +TBool CActivePalette2Model::PaletteActive() + { + return ( iAnimState != EPaletteAnimAppearing && iPaletteMoveCurrentOffset == iPaletteMoveOffsetTotalFrames); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ValidItemIndex() +// ----------------------------------------------------------------------------- +// +TBool CActivePalette2Model::ValidItemIndex(TInt aItemIndex) const + { + return (aItemIndex >= 0 && aItemIndex < iItemsArray.Count()); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SendMessage() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::SendMessage(TInt aItemId, TInt aMessageId, const TDesC8& aDataDes) + { + return DispatchMessage(aItemId,aMessageId,aDataDes,KActivePaletteNoDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SendMessage() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::SendMessage(TInt aItemId, TInt aMessageId, TInt aDataInt) + { + return DispatchMessage(aItemId,aMessageId,KNullDesC8,aDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::InstallItemL() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + const TDesC8& aCustomDataDes) + { + return DoInstallItemL(aItemVisible.ItemId(), + aItemVisible.Visible(), + aPluginUid,aCustomDataDes, + KActivePaletteNoDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::InstallItemL() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt) + { + return DoInstallItemL(aItemVisible.ItemId(), + aItemVisible.Visible(), + aPluginUid, + KNullDesC8, + aCustomDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::InstallItemL() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::InstallItemL(const TActivePalette2ItemVisible& aItemVisible, + const TUid& aPluginUid, + TInt aCustomDataInt, + const TDesC8& aCustomDataDes) + { + return DoInstallItemL(aItemVisible.ItemId(), + aItemVisible.Visible(), + aPluginUid, + aCustomDataDes, + aCustomDataInt); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemSize() +// ----------------------------------------------------------------------------- +// +TSize CActivePalette2Model::ItemSize() + { + return iItemSize; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::LocateTo() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::LocateTo(const TPoint& /*aTopLeft*/) + { + // unused + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::Location() +// ----------------------------------------------------------------------------- +// +TPoint CActivePalette2Model::Location() const + { + // unused + return TPoint(0,0); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::CoeControl() +// ----------------------------------------------------------------------------- +// +CCoeControl* CActivePalette2Model::CoeControl() + { + // unused + return NULL; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::HuiControl() +// ----------------------------------------------------------------------------- +// +CHuiControl* CActivePalette2Model::HuiControl() + { + // unused + return NULL; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SetGc() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::SetGc(CBitmapContext* /*aGc*/) + { + // unused + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::RenderActivePalette() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::RenderActivePalette(const TRect& /*aRect*/) const + { + // unused + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SetObserver() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::SetObserver(MActivePalette2Observer* /*aObserver*/) + { + // unused + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SetNavigationKeys() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::SetNavigationKeys(const TActivePalette2NavigationKeys& /*aNavigationKeys*/) + { + // unused + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::AnimateAppearanceRendererComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::AnimateAppearanceRendererComplete() + { + if ( iAnimState == EPaletteAnimAppearing ) + { + SetAnimState(EPaletteAnimIdle); + iModelObserver.PaletteAppearingUpdated(); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::AnimateItemScrollRendererComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::AnimateItemScrollRendererComplete() + { + if ( iAnimState == EPaletteAnimItemScroll ) + { + SetAnimState(EPaletteAnimItemAnim); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::SetFocusedItem() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::FocusedItemUpdated() + { + if ( ValidItemIndex(iFocusedItem) ) + { + TInt currentID = iItemsArray[iFocusedItem]->ItemId(); + + iPreviousItemID = iFocusedItemID; + iFocusedItemID = currentID; + + if ( iModelObserver.APObserver() ) + { + iModelObserver.APObserver()->NotifyItemFocused(iPreviousItemID, iFocusedItemID); + } + + if ( iCallbacks.iFocusTimer ) + { + iCallbacks.iFocusTimer->FocusUpdated(); + } + } + } + + + + + + + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::StartItemAnimation() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::StartItemAnimation() + { + CompelTooltip(); + + CActivePalettePluginBase::TPluginAnimationInfo animConfig; + + animConfig.iFrameSize = ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::EItemSize ); + animConfig.iNofFrames = NAP2Cfg::KItemAnimNoFrames; + animConfig.iFrameTimeGapMs = NAP2Cfg::KItemAnimFrameDuration; + + iAniItem = iItemsArray[iFocusedItem]; + iAniItemScreenPos = ScreenPosFromItemIndex(iFocusedItem); + + iAnimationFrame = 0; + + TRAP_IGNORE(iAniItem->Plugin().PrepareAniFramesL( + CActivePalettePluginBase::EAniFocused, + iAniItemInfo, + animConfig, + iAniItem->Icon(), + iAniItem->Mask())); + + iItemAnimTimer->Start(iAniItemInfo.iFrameTimeGapMs, iAniItemInfo.iFrameTimeGapMs, + TCallBack(&CActivePalette2Model::ItemAnimTimerCallback,(TAny*)this)); + + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemAnimTimerCallback() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::ItemAnimTimerCallback(TAny* aPtr) + { + CActivePalette2Model* self = (CActivePalette2Model*) aPtr; + + if ( self ) + { + return self->ItemAnimAction(); + } + else + { + return KCallbackFinished; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemAnimAction() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::ItemAnimAction() + { + TInt res = KCallbackCallAgain; + + if ( iAnimationFrame > iAniItemInfo.iNofFrames) + { + res = KCallbackFinished; + SetAnimState(EPaletteAnimIdle); + } + else + { + iModelObserver.ItemAnimated(iAniItemScreenPos, iAniItem, iAnimationFrame); + iAnimationFrame++; + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemAnimationComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::ItemAnimationComplete() + { + iItemAnimTimer->Cancel(); + iModelObserver.ItemAnimationComplete(iAniItemScreenPos, iAniItem); + iAniItem = NULL; + iAniItemScreenPos = KInvalidScreenPos; + } + + + + + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemScrollTimerCallback() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::ItemScrollTimerCallback(TAny* aPtr) + { + CActivePalette2Model* self = (CActivePalette2Model*) aPtr; + + if ( self ) + { + return self->ItemScrollAction(); + } + else + { + return KCallbackFinished; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemScrollAction() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::ItemScrollAction() + { + TInt res = KCallbackCallAgain; + + iItemScrollCurrentOffset += iItemScrollDirection; + + if ( iItemScrollCurrentOffset <= 0 || iItemScrollCurrentOffset >= NAP2Cfg::KItemScrollFrames ) + { + res = KCallbackFinished; + SetAnimState(EPaletteAnimItemAnim); + } + else + { + if ( iCallbacks.iItemScrollTimer ) + { + iCallbacks.iItemScrollTimer->ItemsScrolled(); + } + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::ItemScrollComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::ItemScrollComplete() + { + iItemScrollTimer->Cancel(); + + iItemScrollCurrentOffset = 0; + + if ( iFocusedItem != iFocusChangeTargetItem ) + { + iFocusedItem = iFocusChangeTargetItem; + iTopItemOnScreen = FindVisibleItem(iTopItemOnScreen + 1); + ItemsUpdated(); + } + else + { + if ( iCallbacks.iItemScrollTimer ) + { + iCallbacks.iItemScrollTimer->ItemsScrolled(); + } + } + } + + + + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::PaletteAnimTimerCallback() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::PaletteAnimTimerCallback(TAny* aPtr) + { + CActivePalette2Model* self = (CActivePalette2Model*) aPtr; + + if ( self ) + { + return self->PaletteAnimAction(); + } + else + { + return KCallbackFinished; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::PaletteAnimAction() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::PaletteAnimAction() + { + TInt res = KCallbackCallAgain; + + iPaletteMoveCurrentOffset += iPaletteMoveAnimationDirection; + + if ( (iPaletteMoveCurrentOffset <= 0) || (iPaletteMoveCurrentOffset >= iPaletteMoveOffsetTotalFrames)) + { + res = KCallbackFinished; + SetAnimState(EPaletteAnimIdle); + iModelObserver.PaletteAppearingUpdated(); + } + else + { + iModelObserver.PaletteAppearingUpdated(); + + if ( iCallbacks.iAppearanceDescriptive ) + { + iPaletteMoveTimer->Cancel(); + + if ( iPaletteMoveAnimationDirection > 0 ) + { + // Palette is appearing + iCallbacks.iAppearanceDescriptive->AnimateAppearance(ETrue, + (iPaletteMoveAnimationDuration * (iPaletteMoveOffsetTotalFrames - iPaletteMoveCurrentOffset)) + / iPaletteMoveOffsetTotalFrames); + } + else + { + // Palette is disappearing + iCallbacks.iAppearanceDescriptive->AnimateAppearance(EFalse, + (iPaletteMoveAnimationDuration * (iPaletteMoveCurrentOffset)) + / iPaletteMoveOffsetTotalFrames); + } + + res = KCallbackFinished; + } + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::PaletteAnimComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::PaletteAnimComplete() + { + iPaletteMoveTimer->Cancel(); + + if ( iPaletteMoveAnimationDirection > 0 ) + { + iPaletteMoveCurrentOffset = iPaletteMoveOffsetTotalFrames; + } + else + { + iPaletteMoveCurrentOffset = 0; + } + } + + + + + + + + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::AnimateFocusRendererComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::AnimateFocusRendererComplete() + { + // Check we're expecting call + if ( iAnimState == EPaletteAnimFocusChange ) + { + SetAnimState(EPaletteAnimItemAnim); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::FocusChangeTimerCallback() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::FocusChangeTimerCallback(TAny* aPtr) + { + CActivePalette2Model* self = (CActivePalette2Model*) aPtr; + + if ( self ) + { + return self->FocusChangeAction(); + } + else + { + return KCallbackFinished; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::FocusChangeAction() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Model::FocusChangeAction() + { + TInt res = KCallbackCallAgain; + + iFocusedCurrentOffset += iFocusChangeDirection; + + if ( iFocusedCurrentOffset <= 0 || iFocusedCurrentOffset >= NAP2Cfg::KFocusChangeFrames ) + { + res = KCallbackFinished; + SetAnimState(EPaletteAnimItemAnim); + } + else + { + if ( iCallbacks.iFocusTimer ) + { + iCallbacks.iFocusTimer->FocusAnimated(); + } + } + + return res; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Model::FocusChangeComplete() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Model::FocusChangeComplete() + { + iFocusChangeTimer->Cancel(); + + iFocusedItem = iFocusChangeTargetItem; + iFocusedCurrentOffset = 0; + + FocusedItemUpdated(); + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2NavigationKeys.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2NavigationKeys.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains the key definitions used for navigation in AP* +*/ + + +/** + * @file ActivePalette2NavigationKeys.cpp + * Contains the key definitions used for navigation in AP + */ + + +#include +#include + + +// ----------------------------------------------------------------------------- +// CActivePaletteUI::TNavigationKeys::TNavigationKeys() +// ----------------------------------------------------------------------------- +// +EXPORT_C TActivePalette2NavigationKeys::TActivePalette2NavigationKeys(void) +: iNaviPrev(EStdKeyUpArrow), + iNaviNext(EStdKeyDownArrow), + iNaviSelect(EStdKeyDevice3) + { + // No implementation required + } + + +// ----------------------------------------------------------------------------- +// CActivePaletteUI::TNavigationKeys::TNavigationKeys() +// ----------------------------------------------------------------------------- +// +EXPORT_C TActivePalette2NavigationKeys::TActivePalette2NavigationKeys( + TInt aNaviPrev, + TInt aNaviNext, + TInt aNaviSelect ) +: iNaviPrev( aNaviPrev ), + iNaviNext( aNaviNext ), + iNaviSelect( aNaviSelect ) + { + // No implementation required + } + + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2OpaqueStyler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2OpaqueStyler.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Opaque Styler* +*/ + + +/** + * @file ActivePalette2OpaqueStyler.cpp + * Active Palette Opaque Styler + */ + +#include "ActivePalette2OpaqueStyler.h" +#include "ActivePalette2Cfg.h" +#include "ActivePalette2Utils.h" + +#include +#include + + +// ----------------------------------------------------------------------------- +// CActivePalette2OpaqueStyler::NewL() +// ----------------------------------------------------------------------------- +// +CActivePalette2OpaqueStyler* CActivePalette2OpaqueStyler::NewL() + { + CActivePalette2OpaqueStyler* self = new (ELeave) CActivePalette2OpaqueStyler(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // this + return self; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2OpaqueStyler::ConstructL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2OpaqueStyler::ConstructL() + { + CActivePalette2Styler::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2OpaqueStyler::DrawItem() +// ----------------------------------------------------------------------------- +// +void CActivePalette2OpaqueStyler::DrawItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask, TInt aOffsetFrame, TInt aOffsetTotal) + { + TRect area(ItemRect(aScreenPos, aOffsetFrame, aOffsetTotal)); + + iDrawBufContext->SetClippingRect(iItemsRect); + + iDrawBufContext->SetBrushColor(TRgb(0xDDDDDD)); + iDrawBufContext->Clear(area); + + iDrawBufContext->BitBltMasked(area.iTl + TPoint(ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemXOffset),0), + aIcon, + TRect(TPoint(0,0), ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::EItemSize )), + aMask, + ETrue); + + iDrawBufContext->CancelClippingRect(); + + area.Intersection(iItemsRect); + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2OpaqueStyler::DrawGap() +// ----------------------------------------------------------------------------- +// +void CActivePalette2OpaqueStyler::DrawGap(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal) + { + TRect area(GapRect(aScreenPos, aOffsetFrame, aOffsetTotal)); + + iDrawBufContext->SetClippingRect(iItemsRect); + + iDrawBufContext->SetBrushColor(TRgb(0xCCCCCC)); + iDrawBufContext->Clear(area); + + iDrawBufContext->CancelClippingRect(); + + area.Intersection(iItemsRect); + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2OpaqueStyler::AnimItem() +// ----------------------------------------------------------------------------- +// +void CActivePalette2OpaqueStyler::AnimItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask) + { + TRect area(ItemRect(aScreenPos)); + area.iTl.iX = ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemXOffset); + area.SetWidth(ActivePalette2Utils::APDimension( ActivePalette2Utils::EItemWidth )); + + iDrawBufContext->SetBrushColor(TRgb(0xDDDDDD)); + iDrawBufContext->Clear(area); + + iDrawBufContext->BitBltMasked(area.iTl, + aIcon, + TRect(TPoint(0,0), area.Size()), + aMask, + ETrue); + + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2OpaqueStyler::DrawTopScrollArrowSection() +// ----------------------------------------------------------------------------- +// +void CActivePalette2OpaqueStyler::DrawTopScrollArrowSection(TBool aShowArrow) + { + TRect area(TopSectionRect()); + + iDrawBufContext->SetBrushColor(TRgb(0x8888FF)); + iDrawBufContext->Clear(area); + + if ( aShowArrow ) + { + CentreGraphic(area, iDrawBufContext, iDrawBufMaskContext, iScrollUpIcon, iScrollUpIconMask, ETrue, ETrue); + } + + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2OpaqueStyler::DrawBottomScrollArrowSection() +// ----------------------------------------------------------------------------- +// +void CActivePalette2OpaqueStyler::DrawBottomScrollArrowSection(TBool aShowArrow) + { + TRect area(BottomSectionRect()); + + iDrawBufContext->SetBrushColor(TRgb(0xFF8888)); + iDrawBufContext->Clear(area); + + if ( aShowArrow ) + { + CentreGraphic(area, iDrawBufContext, iDrawBufMaskContext, iScrollDownIcon, iScrollDownIconMask, ETrue, ETrue); + } + + AddToDirtyRect( area ); + } + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2SemiTransparentFadingStyler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2SemiTransparentFadingStyler.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,179 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + +#include +#include + +#include + +#include "ActivePalette2Logger.h" +#include "ActivePalette2Cfg.h" +#include "ActivePalette2Utils.h" +#include "ActivePalette2SemiTransparentFadingStyler.h" + + +static const TInt KAlphaMask = 0xFF; + +// ----------------------------------------------------------------------------- +// 2-phase constructor <> +// ----------------------------------------------------------------------------- +// +CActivePalette2SemiTransparentFadingStyler* +CActivePalette2SemiTransparentFadingStyler::NewL() + { + CActivePalette2SemiTransparentFadingStyler* self = + new (ELeave) CActivePalette2SemiTransparentFadingStyler(); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor <> +// ----------------------------------------------------------------------------- +// +CActivePalette2SemiTransparentFadingStyler +::~CActivePalette2SemiTransparentFadingStyler() + { + ReleaseTooltipBuf(); + } + + +// ----------------------------------------------------------------------------- +// BlitTooltip <> +// ----------------------------------------------------------------------------- +// +void +CActivePalette2SemiTransparentFadingStyler +::BlitTooltip( CBitmapContext* aGc, + const TPoint& aPos, + TInt aCurrentPhase, + TInt aTotalPhases ) + { + TInt alpha_orig = ( KAlphaMask * aCurrentPhase ) / aTotalPhases; + TInt alpha_value = alpha_orig & KAlphaMask; // Limit to 0..255 + TRgb alpha = TRgb::Gray256( alpha_value ); + + LOGTEXT1( _L("CActivePalette2SemiTransparentFadingStyler::BlitTooltip, alpha=%d"), alpha_value ); + + iTooltipAlphaContext->SetBrushColor( alpha ); + iTooltipAlphaContext->SetBrushStyle( CGraphicsContext::ESolidBrush ); + iTooltipAlphaContext->Clear(); + + iTooltipBlendedMaskContext->SetBrushColor( KRgbBlack ); + iTooltipBlendedMaskContext->SetBrushStyle( CGraphicsContext::ESolidBrush ); + iTooltipBlendedMaskContext->Clear(); + iTooltipBlendedMaskContext->BitBltMasked( TPoint( 0,0 ), + iTooltipAlphaBitmap, + TooltipSize(), + iTooltipBufMaskBitmap, + EFalse ); + + aGc->BitBltMasked( aPos, + iTooltipBufBitmap, + TooltipSize(), + iTooltipBlendedMaskBitmap, + EFalse ); + } + + + + +// ----------------------------------------------------------------------------- +// TooltipNoseMaskId <> +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2SemiTransparentFadingStyler::TooltipNoseMaskId() + { + return EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_end_mask; + } + +// ----------------------------------------------------------------------------- +// TooltipBodyMaskId <> +// ----------------------------------------------------------------------------- +// +TInt +CActivePalette2SemiTransparentFadingStyler::TooltipBodyMaskId() + { + return EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_body_mask; + } + + +// ----------------------------------------------------------------------------- +// AllocateTooltipBufL <> +// ----------------------------------------------------------------------------- +// +void +CActivePalette2SemiTransparentFadingStyler::AllocateTooltipBufL() + { + ReleaseTooltipBuf(); + + ActivePalette2Utils::CreateDrawingObjectsL( TooltipSize(), + &iTooltipBufBitmap, + &iTooltipBufDevice, + &iTooltipBufContext ); + + ActivePalette2Utils::CreateDrawingObjectsL( EGray2, + TooltipSize(), + &iTooltipBufMaskBitmap, + &iTooltipBufMaskDevice, + &iTooltipBufMaskContext ); + + ActivePalette2Utils::CreateDrawingObjectsL( EGray256, + TooltipSize(), + &iTooltipAlphaBitmap, + &iTooltipAlphaDevice, + &iTooltipAlphaContext ); + + ActivePalette2Utils::CreateDrawingObjectsL( EGray256, + TooltipSize(), + &iTooltipBlendedMaskBitmap, + &iTooltipBlendedMaskDevice, + &iTooltipBlendedMaskContext ); + } + +// ----------------------------------------------------------------------------- +// ReleaseTooltipBuf <> +// ----------------------------------------------------------------------------- +// +void +CActivePalette2SemiTransparentFadingStyler::ReleaseTooltipBuf() + { + ActivePalette2Utils::DeleteDrawingObjects( &iTooltipBufBitmap, + &iTooltipBufDevice, + &iTooltipBufContext ); + + ActivePalette2Utils::DeleteDrawingObjects( &iTooltipBufMaskBitmap, + &iTooltipBufMaskDevice, + &iTooltipBufMaskContext ); + + ActivePalette2Utils::DeleteDrawingObjects( &iTooltipAlphaBitmap, + &iTooltipAlphaDevice, + &iTooltipAlphaContext ); + + ActivePalette2Utils::DeleteDrawingObjects( &iTooltipBlendedMaskBitmap, + &iTooltipBlendedMaskDevice, + &iTooltipBlendedMaskContext ); + } + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2SemiTransparentStyler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2SemiTransparentStyler.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,208 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Styler* +*/ + + +/** + * @file ActivePalette2SemiTransparentStyler.cpp + * Active Palette Semi-transparent Styler + */ + +#include "ActivePalette2SemiTransparentStyler.h" +#include "ActivePalette2Cfg.h" +#include "ActivePalette2Utils.h" +#include + +#include +#include +#include + +//#define USE_OPAQUE_TOOLTIPS + + +// ----------------------------------------------------------------------------- +// CActivePalette2SemiTransparentStyler::NewL() +// ----------------------------------------------------------------------------- +// +CActivePalette2SemiTransparentStyler* CActivePalette2SemiTransparentStyler::NewL() + { + CActivePalette2SemiTransparentStyler* self = new (ELeave) CActivePalette2SemiTransparentStyler(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // this + return self; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2SemiTransparentStyler::ConstructL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2SemiTransparentStyler::ConstructL() + { + CActivePalette2Styler::ConstructL(); + + iAPTopSectionMask = AknIconUtils::CreateIconL( NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_top_mask); + AknIconUtils::SetSize(iAPTopSectionMask, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) ) ); + + iAPItemMask = AknIconUtils::CreateIconL( NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_body_mask); + AknIconUtils::SetSize(iAPItemMask, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) ) ); + + iAPGapMask = AknIconUtils::CreateIconL( NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_gap_mask); + AknIconUtils::SetSize(iAPGapMask, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems) ) ); + + iAPBottomSectionMask = AknIconUtils::CreateIconL( NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_bottom_mask); + AknIconUtils::SetSize(iAPBottomSectionMask, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EBottomSectionHeight) ) ); + + } + +// ----------------------------------------------------------------------------- +// CActivePalette2SemiTransparentStyler::~CActivePalette2SemiTransparentStyler() +// ----------------------------------------------------------------------------- +// +CActivePalette2SemiTransparentStyler::~CActivePalette2SemiTransparentStyler() + { + delete iAPTopSectionMask; + delete iAPItemMask; + delete iAPGapMask; + delete iAPBottomSectionMask; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2SemiTransparentStyler::DrawItem() +// ----------------------------------------------------------------------------- +// +void CActivePalette2SemiTransparentStyler::DrawItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask, TInt aOffsetFrame, TInt aOffsetTotal) + { + TRect area(ItemRect(aScreenPos, aOffsetFrame, aOffsetTotal)); + + iDrawBufContext->SetClippingRect(iItemsRect); + iDrawBufMaskContext->SetClippingRect(iItemsRect); + + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, iAPItem, iAPItemMask, EFalse, EFalse); + BlitGraphic(area.iTl + TPoint(ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemXOffset),0), iDrawBufContext, iDrawBufMaskContext, aIcon, aMask, ETrue, ETrue); + + iDrawBufMaskContext->CancelClippingRect(); + iDrawBufContext->CancelClippingRect(); + + area.Intersection(iItemsRect); + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2SemiTransparentStyler::DrawGap() +// ----------------------------------------------------------------------------- +// +void CActivePalette2SemiTransparentStyler::DrawGap(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal) + { + TRect area(GapRect(aScreenPos, aOffsetFrame, aOffsetTotal)); + + iDrawBufContext->SetClippingRect(iItemsRect); + iDrawBufMaskContext->SetClippingRect(iItemsRect); + + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, iAPGap, iAPGapMask, EFalse, EFalse); + + iDrawBufMaskContext->CancelClippingRect(); + iDrawBufContext->CancelClippingRect(); + + area.Intersection(iItemsRect); + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2SemiTransparentStyler::AnimItem() +// ----------------------------------------------------------------------------- +// +void CActivePalette2SemiTransparentStyler::AnimItem(TInt aScreenPos, CFbsBitmap* aIcon, CFbsBitmap* aMask) + { + TRect area(ItemRect(aScreenPos)); + area.iTl.iX = ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemXOffset); + area.SetWidth(ActivePalette2Utils::APDimension( ActivePalette2Utils::EItemWidth )); + + TRect clippingRect(TPoint(ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemXOffset), 0), ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::EItemSize )); + + iDrawBufContext->BitBlt(area.iTl, iAPItem, clippingRect); + iDrawBufMaskContext->BitBlt(area.iTl, iAPItemMask, clippingRect); + + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, aIcon, aMask, ETrue, ETrue); + + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2SemiTransparentStyler::DrawTopScrollArrowSection() +// ----------------------------------------------------------------------------- +// +void CActivePalette2SemiTransparentStyler::DrawTopScrollArrowSection(TBool aShowArrow) + { + TRect area(TopSectionRect()); + + BlitGraphic(TPoint(0,0), iDrawBufContext, iDrawBufMaskContext, iAPTopSection, iAPTopSectionMask, EFalse, EFalse); + + if ( aShowArrow ) + { + CentreGraphic(area, iDrawBufContext, iDrawBufMaskContext, iScrollUpIcon, iScrollUpIconMask, ETrue, ETrue); + } + + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2SemiTransparentStyler::DrawBottomScrollArrowSection() +// ----------------------------------------------------------------------------- +// +void CActivePalette2SemiTransparentStyler::DrawBottomScrollArrowSection(TBool aShowArrow) + { + TRect area(BottomSectionRect()); + + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, iAPBottomSection, iAPBottomSectionMask, EFalse, EFalse); + + if ( aShowArrow ) + { + CentreGraphic(area, iDrawBufContext, iDrawBufMaskContext, iScrollDownIcon, iScrollDownIconMask, ETrue, ETrue); + } + + AddToDirtyRect( area ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2SemiTransparentStyler::TooltipNoseMaskId() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2SemiTransparentStyler::TooltipNoseMaskId() + { +#ifdef USE_OPAQUE_TOOLTIPS + return CActivePalette2Styler::TooltipNoseMaskId(); +#else + return EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_end_mask; +#endif + } + +// ----------------------------------------------------------------------------- +// CActivePalette2SemiTransparentStyler::TooltipBodyMaskId() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2SemiTransparentStyler::TooltipBodyMaskId() + { +#ifdef USE_OPAQUE_TOOLTIPS + return CActivePalette2Styler::TooltipBodyMaskId(); +#else + return EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_body_mask; +#endif + } + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2Styler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2Styler.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,461 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Styler* +*/ + + +/** + * @file ActivePalette2Styler.cpp + * Active Palette Styler + */ + +#include "ActivePalette2Logger.h" +#include "ActivePalette2Styler.h" +#include "ActivePalette2Utils.h" +#include "ActivePalette2Cfg.h" +#include +#include +#include + +static const TInt KDefaultFontId = EAknLogicalFontSecondaryFont; + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::CActivePalette2Styler() +// ----------------------------------------------------------------------------- +// +CActivePalette2Styler::CActivePalette2Styler() + { + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::ConstructL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::ConstructL() + { + LOGTEXT( _L( "CActivePalette2Styler::ConstructL entered")); + AllocateDrawBufL(); + AllocateTooltipBufL(); + iFont = AknLayoutUtils::FontFromId(KDefaultFontId); + + AknIconUtils::CreateIconL(iScrollUpIcon, iScrollUpIconMask, NAP2Cfg::KUIGraphics, + EMbmActivepalette2graphicsQgn_graf_cam4_tb_arrow_up, EMbmActivepalette2graphicsQgn_graf_cam4_tb_arrow_up_mask); + AknIconUtils::SetSize(iScrollUpIcon, ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::E3dScrollIconSize ), EAspectRatioNotPreserved ); + AknIconUtils::SetSize(iScrollUpIconMask, ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::E3dScrollIconSize ), EAspectRatioNotPreserved ); + + AknIconUtils::CreateIconL(iScrollDownIcon, iScrollDownIconMask, NAP2Cfg::KUIGraphics, + EMbmActivepalette2graphicsQgn_graf_cam4_tb_arrow_down, EMbmActivepalette2graphicsQgn_graf_cam4_tb_arrow_down_mask); + AknIconUtils::SetSize(iScrollDownIcon, ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::E3dScrollIconSize ), EAspectRatioNotPreserved ); + AknIconUtils::SetSize(iScrollDownIconMask, ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::E3dScrollIconSize ), EAspectRatioNotPreserved ); + + AknIconUtils::CreateIconL(iFocusRing, iFocusRingMask, NAP2Cfg::KUIGraphics, + EMbmActivepalette2graphicsQgn_graf_cam4_tb_focus, EMbmActivepalette2graphicsQgn_graf_cam4_tb_focus_mask); + AknIconUtils::SetSize(iFocusRing, ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::E3dFocusRingSize ), EAspectRatioNotPreserved ); + AknIconUtils::SetSize(iFocusRingMask, ActivePalette2Utils::APDimensionSize( ActivePalette2Utils::E3dFocusRingSize ), EAspectRatioNotPreserved ); + + AknIconUtils::CreateIconL(iTooltipNose, iTooltipNoseMask, NAP2Cfg::KUIGraphics, + EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_end, EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_end_mask); + AknIconUtils::SetSize(iTooltipNose, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipNose), ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipHeight) ), EAspectRatioNotPreserved ); + AknIconUtils::SetSize(iTooltipNoseMask, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipNose), ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipHeight) ), EAspectRatioNotPreserved ); + + AknIconUtils::CreateIconL(iTooltipBody, iTooltipBodyMask, NAP2Cfg::KUIGraphics, + EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_body, EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_body_mask); + AknIconUtils::SetSize(iTooltipBody, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipHeight) ), EAspectRatioNotPreserved ); + AknIconUtils::SetSize(iTooltipBodyMask, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipHeight) ), EAspectRatioNotPreserved ); + + iAPTopSection = AknIconUtils::CreateIconL( NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_top); + AknIconUtils::SetSize(iAPTopSection, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) ), EAspectRatioNotPreserved ); + + iAPItem = AknIconUtils::CreateIconL( NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_body); + AknIconUtils::SetSize(iAPItem, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) ), EAspectRatioNotPreserved ); + + iAPGap = AknIconUtils::CreateIconL( NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_gap); + AknIconUtils::SetSize(iAPGap, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems) ), EAspectRatioNotPreserved ); + + iAPBottomSection = AknIconUtils::CreateIconL( NAP2Cfg::KUIGraphics, EMbmActivepalette2graphicsQgn_graf_cam4_tb_bottom); + AknIconUtils::SetSize(iAPBottomSection, TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EBottomSectionHeight) ), EAspectRatioNotPreserved ); + + LOGTEXT( _L( "CActivePalette2Styler::ConstructL left")); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::~CActivePalette2Styler() +// ----------------------------------------------------------------------------- +// +CActivePalette2Styler::~CActivePalette2Styler() + { + ReleaseDrawBuf(); // Utility function checks pointers to be deleted. + ReleaseTooltipBuf(); // Utility function checks pointers to be deleted. + + delete iScrollUpIcon; + delete iScrollUpIconMask; + delete iScrollDownIcon; + delete iScrollDownIconMask; + delete iFocusRing; + delete iFocusRingMask; + delete iTooltipNose; + delete iTooltipNoseMask; + delete iTooltipBody; + delete iTooltipBodyMask; + delete iAPTopSection; + delete iAPItem; + delete iAPGap; + delete iAPBottomSection; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::SetNumberOfItemsL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::SetNumberOfItemsL(TInt aItems) + { + AddToDirtyRect(TRect(TPoint(0,0), Size())); + iNumItems = aItems; + + if ( iNumItems > 0 ) + { + iNumGaps = iNumItems - 1; + } + else + { + iNumGaps = 0; + } + + AllocateDrawBufL(); + AddToDirtyRect(TRect(TPoint(0,0), Size())); + + iItemsRect = TRect(TPoint(0, ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight)), TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), iNumItems * ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + iNumGaps * ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::Size() +// ----------------------------------------------------------------------------- +// +TSize CActivePalette2Styler::Size() const + { + return (iNumItems > 0) + ? TSize( ActivePalette2Utils::APDimension(ActivePalette2Utils::EPaletteWidth), + ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) + + iNumItems * ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + + iNumGaps * ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems) + + ActivePalette2Utils::APDimension(ActivePalette2Utils::EBottomSectionHeight) ) + : TSize( 0, 0 ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::DirtyRect() +// ----------------------------------------------------------------------------- +// +TRect CActivePalette2Styler::DirtyRect() + { + if ( iDirtyRectExists ) + { + return iDirtyRect; + } + else + { + return TRect(TPoint(0,0), TSize(0,0)); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::ClearDirtyRect() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::ClearDirtyRect() + { + iDirtyRectExists = EFalse; + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::AllocateDrawBufL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::AllocateDrawBufL(void) + { + ReleaseDrawBuf(); + + ActivePalette2Utils::CreateDrawingObjectsL(Size(), + &iDrawBufBitmap, + &iDrawBufDevice, + &iDrawBufContext); + + ActivePalette2Utils::CreateDrawingObjectsL(EGray256, Size(), + &iDrawBufMaskBitmap, + &iDrawBufMaskDevice, + &iDrawBufMaskContext); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::ReleaseDrawBuf() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::ReleaseDrawBuf(void) + { + // DeleteDrawingObjects checks passed pointers to ensure they are not null + ActivePalette2Utils::DeleteDrawingObjects(&iDrawBufBitmap, + &iDrawBufDevice, + &iDrawBufContext); + + ActivePalette2Utils::DeleteDrawingObjects(&iDrawBufMaskBitmap, + &iDrawBufMaskDevice, + &iDrawBufMaskContext); + } + + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::AllocateTooltipBufL() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::AllocateTooltipBufL(void) + { + ReleaseTooltipBuf(); + + ActivePalette2Utils::CreateDrawingObjectsL(TooltipSize(), + &iTooltipBufBitmap, + &iTooltipBufDevice, + &iTooltipBufContext); + + ActivePalette2Utils::CreateDrawingObjectsL(EGray256, TooltipSize(), + &iTooltipBufMaskBitmap, + &iTooltipBufMaskDevice, + &iTooltipBufMaskContext); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::ReleaseTooltipBuf() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::ReleaseTooltipBuf(void) + { + // DeleteDrawingObjects checks passed pointers to ensure they are not null + ActivePalette2Utils::DeleteDrawingObjects(&iTooltipBufBitmap, + &iTooltipBufDevice, + &iTooltipBufContext); + + ActivePalette2Utils::DeleteDrawingObjects(&iTooltipBufMaskBitmap, + &iTooltipBufMaskDevice, + &iTooltipBufMaskContext); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::AddToDirtyRect() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::AddToDirtyRect(TRect aNewRect) + { + if ( iDirtyRectExists ) + { + iDirtyRect.BoundingRect(aNewRect); + } + else + { + iDirtyRectExists = ETrue; + iDirtyRect = aNewRect; + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::BlitPalette() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::BlitPalette(CBitmapContext* aGc, TPoint aPos, TRect aClippingRect) const + { + aGc->BitBltMasked( + aPos + aClippingRect.iTl, + iDrawBufBitmap, + aClippingRect, + iDrawBufMaskBitmap, EFalse); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::DrawTooltip() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Styler::DrawTooltip(TDesC* aText) + { + iTextWidth = iFont->TextWidthInPixels( *aText ); + TRAP_IGNORE(AllocateTooltipBufL()); + RenderTooltip(aText); + return TooltipSize().iWidth; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::BlitTooltip() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::BlitTooltip(CBitmapContext* aGc, const TPoint& aPos, TRect aClippingRect) + { + aGc->BitBltMasked( aPos, + iTooltipBufBitmap, + aClippingRect, + iTooltipBufMaskBitmap, + EFalse ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::BlitTooltip() +// ----------------------------------------------------------------------------- +// +void +CActivePalette2Styler::BlitTooltip( CBitmapContext* aGc, + const TPoint& aPos, + TInt aCurrentPhase, + TInt aTotalPhases ) + { + TSize tooltipSize( TooltipSize() ); + + TInt shownHeight = tooltipSize.iHeight; + TInt shownWidth = (tooltipSize.iWidth * aCurrentPhase) / aTotalPhases; + + TRect clippingRect( TPoint(0,0), TSize( shownWidth, shownHeight ) ); + TPoint topLeft( aPos.iX + tooltipSize.iWidth - shownWidth, aPos.iY ); + + aGc->BitBltMasked( topLeft, + iTooltipBufBitmap, + clippingRect, + iTooltipBufMaskBitmap, + EFalse ); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::TooltipSize() +// ----------------------------------------------------------------------------- +// +TSize CActivePalette2Styler::TooltipSize() + { + return TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipNose) + iTextWidth + ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipTail), ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipHeight)); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::RenderTooltip() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::RenderTooltip(TDesC* aText) + { + const TInt height = ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipHeight); + const TInt nose = ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipNose); + + TPoint currentPos(0, 0); + + BlitGraphic(currentPos, iTooltipBufContext, iTooltipBufMaskContext, iTooltipNose, iTooltipNoseMask, EFalse, EFalse); + currentPos.iX += iTooltipNose->SizeInPixels().iWidth; + + TInt width = TooltipSize().iWidth; + while ( currentPos.iX <= width ) + { + BlitGraphic(currentPos, iTooltipBufContext, iTooltipBufMaskContext, iTooltipBody, iTooltipBodyMask, EFalse, EFalse); + currentPos.iX += iTooltipBody->SizeInPixels().iWidth; + } + + TAknLayoutText tooltipLayout; + TRect layoutRect(TPoint(nose, 0), TSize(iTextWidth, height)); + + TInt baseline_offset = ( ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipHeight) + iFont->FontMaxAscent() - iFont->FontMaxDescent() ) / 2; + tooltipLayout.LayoutText(layoutRect, KDefaultFontId, NAP2Cfg::KColourTooltipText, 0, 0, /*NAP2Cfg::KTooltipBaseline - 1*/ baseline_offset/*EYZG-796AF7*/, iTextWidth, ELayoutAlignRight); + tooltipLayout.DrawText(*iTooltipBufContext, *aText, ETrue); + tooltipLayout.DrawText(*iTooltipBufMaskContext, *aText, ETrue, TRgb(KRgbWhite)); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::TootipYOffset() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Styler::TootipYOffset(TInt aScreenPos) + { + return ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) + aScreenPos * (ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) + ActivePalette2Utils::APDimension(ActivePalette2Utils::ETooltipYOffset); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::TooltipNoseMaskId() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Styler::TooltipNoseMaskId() + { + return EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_end_mask; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::TooltipBodyMaskId() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Styler::TooltipBodyMaskId() + { + return EMbmActivepalette2graphicsQgn_graf_cam4_tb_tooltip_body_mask; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::BlitGraphic() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::BlitGraphic(TPoint aPos, CBitmapContext* aGraphicGc, CBitmapContext* aMaskGc, CFbsBitmap* aGraphic, CFbsBitmap* aGraphicMask, TBool aMaskGraphic, TBool aMaskMask) + { + if ( aGraphicGc ) + { + if ( aMaskGraphic ) + { + aGraphicGc->BitBltMasked(aPos, aGraphic, TRect(TPoint(0,0), aGraphic->SizeInPixels()), aGraphicMask, EFalse); + } + else + { + aGraphicGc->BitBlt(aPos, aGraphic); + } + } + + + if ( aMaskGc ) + { + if ( aMaskMask ) + { + aMaskGc->BitBltMasked(aPos, aGraphicMask, TRect(TPoint(0,0), aGraphic->SizeInPixels()), aGraphicMask, EFalse); + } + else + { + aMaskGc->BitBlt(aPos, aGraphicMask); + } + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::CentreGraphic() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::CentreGraphic(TRect aArea, CBitmapContext* aGraphicGc, CBitmapContext* aMaskGc, CFbsBitmap* aGraphic, CFbsBitmap* aGraphicMask, TBool aMaskGraphic, TBool aMaskMask) + { + TPoint pos(aArea.iTl); + pos.iX += (aArea.iBr.iX - aArea.iTl.iX)/2; + pos.iY += (aArea.iBr.iY - aArea.iTl.iY)/2; + pos.iX -= aGraphic->SizeInPixels().iWidth/2; + pos.iY -= aGraphic->SizeInPixels().iHeight/2; + + BlitGraphic(pos, aGraphicGc, aMaskGc, aGraphic, aGraphicMask, aMaskGraphic, aMaskMask); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Styler::DrawFocusRing() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Styler::DrawFocusRing(TInt aScreenPos, TInt aOffsetFrame, TInt aOffsetTotal) + { + TInt offset = ((ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) * aOffsetFrame) / aOffsetTotal; + TRect area(TPoint(ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemXOffset) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EFocusRingXOffset), + ActivePalette2Utils::APDimension(ActivePalette2Utils::ETopSectionHeight) + aScreenPos * (ActivePalette2Utils::APDimension(ActivePalette2Utils::EItemHeight) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EGapBetweenItems)) + ActivePalette2Utils::APDimension(ActivePalette2Utils::EFocusRingYOffset) + offset), + TSize(ActivePalette2Utils::APDimension(ActivePalette2Utils::EFocusRingWidth), ActivePalette2Utils::APDimension(ActivePalette2Utils::EFocusRingHeight))); + + BlitGraphic(area.iTl, iDrawBufContext, iDrawBufMaskContext, iFocusRing, iFocusRingMask, ETrue, ETrue); + + area.Intersection(TRect(TPoint(0,0), Size())); + AddToDirtyRect( area ); + } diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2StylerFactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2StylerFactory.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Styler Factory* +*/ + + +/** + * @file ActivePalette2StylerFactory.cpp + * Active Palette Styler Factory + */ + +#include "ActivePalette2StylerFactory.h" +#include "ActivePalette2Styler.h" +#include "ActivePalette2SemiTransparentFadingStyler.h" +#include "ActivePalette2SemiTransparentStyler.h" +#include "ActivePalette2CheckerboardStyler.h" +#include "ActivePalette2OpaqueStyler.h" + +// ----------------------------------------------------------------------------- +// ActivePalette2StylerFactory::CreateStylerL() +// ----------------------------------------------------------------------------- +// +CActivePalette2Styler* ActivePalette2StylerFactory::CreateStylerL(TActivePalette2DrawMode aDrawMode) + { + CActivePalette2Styler* res = NULL; + + switch ( aDrawMode ) + { + case EAP2DrawModeSemiTransparentTooltipModeFading: + res = CActivePalette2SemiTransparentFadingStyler::NewL(); + break; + + case EAP2DrawModeSemiTransparent: + res = CActivePalette2SemiTransparentStyler::NewL(); + break; + + case EAP2DrawModeCheckerboard: + res = CActivePalette2CheckerboardStyler::NewL(); + break; + + case EAP2DrawModeOpaque: + default: + res = CActivePalette2OpaqueStyler::NewL(); + break; + } + + return res; + } diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2Tooltip.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2Tooltip.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,244 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Tooltip* +*/ + + +/** + * @file ActivePalette2Tooltip.cpp + * Active Palette Tooltip + */ + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include + +#include "ActivePalette2Tooltip.h" +#include "ActivePalette2Logger.h" +#include "ActivePalette2Utils.h" +#include "ActivePalette2Model.h" +#include "ActivePalette2Cfg.h" +#include "ActivePalette2BasicUI.h" +#include "ActivePalette2Styler.h" + + +// ================= MEMBER FUNCTIONS ======================= + + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::NewL() +// ----------------------------------------------------------------------------- +// + CActivePalette2Tooltip* CActivePalette2Tooltip::NewL(const CActivePalette2BasicUI* aParent, + CActivePalette2Model* aModel, + CActivePalette2Styler* aStyler) + { + CActivePalette2Tooltip * self = new (ELeave) + CActivePalette2Tooltip(aModel, aStyler); + + CleanupStack::PushL(self); + self->ConstructL(aParent); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::CActivePalette2Tooltip() +// C++ constructor +// ----------------------------------------------------------------------------- +// +CActivePalette2Tooltip::CActivePalette2Tooltip( + CActivePalette2Model* aModel, + CActivePalette2Styler* aStyler) +: CCoeControl(), + iAnchor(TPoint(0,0)), + iModel(aModel), + iStyler(aStyler) + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::ConstructL() +// Symbian 2nd phase construction +// ----------------------------------------------------------------------------- +// +void CActivePalette2Tooltip::ConstructL(const CActivePalette2BasicUI* aParent) + { + + iParent = aParent; + + if(aParent) + { + SetContainerWindowL(*aParent); + } + + // finally + MakeVisible(EFalse); + ActivateL(); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::~CActivePalette2Tooltip() +// Destructor +// ----------------------------------------------------------------------------- +// +CActivePalette2Tooltip::~CActivePalette2Tooltip() + { + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::Draw() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Tooltip::Draw(const TRect& /*aRect*/) const + { + if ( !iRenderGc && iModel->ShowTooltip() ) + { + ProduceTooltipToScreen(EFalse); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::ProduceTooltipToScreen() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Tooltip::ProduceTooltipToScreen(TBool aActivateGc) const + { + // Redraw background + TRect redrawRect; + TRect tooltipRect(TooltipRect()); + + if ( iModel->ShowTooltip() ) + { + redrawRect = tooltipRect; + + if ( iRenderedRect.Width() > 0 ) + { + redrawRect.BoundingRect(iRenderedRect); + } + } + else + { + redrawRect = iRenderedRect; + } + + if ( !iRenderGc && aActivateGc ) + { + Window().Invalidate(redrawRect); + ActivateGc(); + Window().BeginRedraw(redrawRect); + } + + // Draw in the background + if ( iParent && iParent->APObserver() ) + { + if ( redrawRect.Size().iHeight > 0 && redrawRect.Size().iWidth > 0 ) + { + iParent->APObserver()->Redraw(redrawRect); + } + } + + if ( iModel->ShowTooltip() ) + { + if ( iRenderGc ) + { + iStyler->BlitTooltip(iRenderGc, tooltipRect.iTl, + TRect(TPoint(0,0),TPoint(tooltipRect.Width(), tooltipRect.Height()))); + } + else + { + iStyler->BlitTooltip(&SystemGc(), tooltipRect.iTl, + TRect(TPoint(0,0),TPoint(tooltipRect.Width(), tooltipRect.Height()))); + } + } + + if ( !iRenderGc && aActivateGc ) + { + Window().EndRedraw(); + DeactivateGc(); + } + + if ( iModel->ShowTooltip() ) + { + iRenderedRect = tooltipRect; + } + else + { + iRenderedRect = TRect(0,0,0,0); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::TooltipUpdated() +// ----------------------------------------------------------------------------- +// +TInt CActivePalette2Tooltip::TooltipUpdated() + { + return iStyler->DrawTooltip(iModel->TooltipText()); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::TooltipAnimated() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Tooltip::TooltipAnimated() + { + ProduceTooltipToScreen(ETrue); + + if ( !iRenderGc ) + { + SetRect(TooltipRect()); + } + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::TooltipRect() +// ----------------------------------------------------------------------------- +// +TRect CActivePalette2Tooltip::TooltipRect() const + { + TInt yPos = iAnchor.iY + iStyler->TootipYOffset(iModel->TooltipScreenPosition()); + return TRect(TPoint(iAnchor.iX - ((iStyler->TooltipSize().iWidth * iModel->TooltipCurrentFrame()) / iModel->TooltipTotalFrames()), + yPos), + TPoint(iAnchor.iX, + yPos + iStyler->TooltipSize().iHeight)); + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::SetAnchor() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Tooltip::SetAnchor(TPoint aAnchor) + { + iAnchor = aAnchor; + } + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::SetGc() +// ----------------------------------------------------------------------------- +// +void CActivePalette2Tooltip::SetGc(CBitmapContext* aGc) + { + iRenderGc = aGc; + MakeVisible(!aGc); + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/ActivePalette2Utils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/ActivePalette2Utils.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,356 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Utilities* +*/ + + +/** + * @file ActivePalette2Utils.cpp + * Active Palette Utilities + */ + +// INCLUDE FILES +#include "ActivePalette2Utils.h" + +#include "ActivePalette2Cfg.h" + +#include +#include +#include +#include +#include + +// LOCAL CONSTANTS + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// ActivePalette2Utils::CreateDrawingObjectsL( +// ----------------------------------------------------------------------------- +// +void ActivePalette2Utils::CreateDrawingObjectsL(const TDisplayMode aDisplayMode, + const TSize aSize, + CFbsBitmap** aBitmap, + CFbsBitmapDevice** aDevice, + CBitmapContext** aGc) + { + CreateDrawingObjectsLC(aDisplayMode,aSize,aBitmap,aDevice,aGc); + CleanupStack::Pop(*aGc); + CleanupStack::Pop(*aDevice); + CleanupStack::Pop(*aBitmap); + } + +// ----------------------------------------------------------------------------- +// ActivePalette2Utils::CreateDrawingObjectsLC() +// ----------------------------------------------------------------------------- +// +void ActivePalette2Utils::CreateDrawingObjectsLC(const TDisplayMode aDisplayMode, + const TSize aSize, + CFbsBitmap** aBitmap, + CFbsBitmapDevice** aDevice, + CBitmapContext** aGc) + { + *aBitmap = new (ELeave) CFbsBitmap(); + CleanupStack::PushL(*aBitmap); + + User::LeaveIfError((*aBitmap)->Create(aSize,aDisplayMode)); + + *aDevice = CFbsBitmapDevice::NewL(*aBitmap); + CleanupStack::PushL(*aDevice); + + CFbsBitGc* context; + User::LeaveIfError((*aDevice)->CreateContext(context)); + *aGc = context; + CleanupStack::PushL(*aGc); + } + +// ----------------------------------------------------------------------------- +// ActivePalette2Utils::CreateDrawingObjectsL() +// ----------------------------------------------------------------------------- +// +void ActivePalette2Utils::CreateDrawingObjectsL(const TSize aSize, + CFbsBitmap** aBitmap, + CFbsBitmapDevice** aDevice, + CBitmapContext** aGc) + { + TInt color; + TInt gray; + TDisplayMode displayMode; + displayMode = CEikonEnv::Static()->WsSession().GetDefModeMaxNumColors(color,gray); + CreateDrawingObjectsL(displayMode,aSize,aBitmap,aDevice,aGc); + } + +// ----------------------------------------------------------------------------- +// ActivePalette2Utils::DeleteDrawingObjects() +// ----------------------------------------------------------------------------- +// +void ActivePalette2Utils::DeleteDrawingObjects( CFbsBitmap** aBitmap, + CFbsBitmapDevice** aDevice, + CBitmapContext** aGc) + { + if (*aGc) + { + delete *aGc; + *aGc = NULL; + } + if (*aDevice) + { + delete *aDevice; + *aDevice = NULL; + } + if (*aBitmap) + { + delete *aBitmap; + *aBitmap = NULL; + } + } + + +// ----------------------------------------------------------------------------- +// ActivePalette2Utils::APDimension() +// ----------------------------------------------------------------------------- +// +TInt ActivePalette2Utils::APDimension( TAPDimension aDimensionType, TInt aGeneric ) + { + TSize ScreenSize( 0, 0 ); + AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, ScreenSize ); + TInt baseheight = 240; + TInt lower = 0; + if ( ScreenSize.iWidth < ScreenSize.iHeight ) + { + lower = ScreenSize.iWidth; + } + else + { + lower = ScreenSize.iHeight; + } + TReal ratio = TReal(lower)/baseheight; + TInt returnValue = 0; + TReal roundResult; + switch ( aDimensionType ) + { + case EItemWidth: + { + Math::Round( roundResult, ratio*NAP2Cfg::KItemWidth, 0 ); + } + break; + case EItemHeight: + { + Math::Round( roundResult, ratio*NAP2Cfg::KItemHeight, 0 ); + } + break; + case EPaletteWidth: + { + Math::Round( roundResult, ratio*NAP2Cfg::KPaletteWidth, 0 ); + } + break; + case ETopSectionHeight: + { + Math::Round( roundResult, ratio*NAP2Cfg::KTopSectionHeight, 0 ); + } + break; + case EBottomSectionHeight: + { + Math::Round( roundResult, ratio*NAP2Cfg::KBottomSectionHeight, 0 ); + } + break; + case EGapBetweenItems: + { + Math::Round( roundResult, ratio*NAP2Cfg::KGapBetweenItems, 0 ); + } + break; + case EItemXOffset: + { + Math::Round( roundResult, ratio*NAP2Cfg::KItemXOffset, 0 ); + } + break; + case EFocusRingWidth: + { + Math::Round( roundResult, ratio*NAP2Cfg::KFocusRingWidth, 0 ); + } + break; + case EFocusRingHeight: + { + Math::Round( roundResult, ratio*NAP2Cfg::KFocusRingHeight, 0 ); + } + break; + case EFocusRingXOffset: + { + Math::Round( roundResult, ratio*NAP2Cfg::KFocusRingXOffset, 0 ); + } + break; + case EFocusRingYOffset: + { + Math::Round( roundResult, ratio*NAP2Cfg::KFocusRingYOffset, 0 ); + } + break; + case ETooltipYOffset: + { + Math::Round( roundResult, ratio*NAP2Cfg::KTooltipYOffset, 0 ); + } + break; + case ETooltipHeight: + { + Math::Round( roundResult, NAP2Cfg::KTooltipFactor*ratio*NAP2Cfg::KTooltipHeight, 0 ); + } + break; + case ETooltipWidth: + { + Math::Round( roundResult, NAP2Cfg::KTooltipFactor*ratio*NAP2Cfg::KTooltipWidth, 0 ); + } + break; + case ETooltipBaseline: + { + Math::Round( roundResult, ratio*NAP2Cfg::KTooltipBaseline, 0 ); + } + break; + case ETooltipTail: + { + Math::Round( roundResult, NAP2Cfg::KTooltipFactor*ratio*NAP2Cfg::KTooltipTail, 0 ); + } + break; + case ETooltipNose: + { + Math::Round( roundResult, NAP2Cfg::KTooltipFactor*ratio*NAP2Cfg::KTooltipNose, 0 ); + } + break; + case E3dTooltipTextYOffset: + { + Math::Round( roundResult, ratio*NAP2Cfg::K3dTooltipTextYOffset, 0 ); + } + break; + case E3dTooltipMaxWidth: + { + roundResult = ScreenSize.iWidth; + } + break; + case EGenericParam: + { + Math::Round( roundResult, ratio*aGeneric, 0 ); + } + break; + default: + { + //PRINT( _L("Camera :: CCamAppUi::HandleCommandL Panic!") ) + //CamPanic( ECamPanicUi ); + } + break; + } + returnValue = TInt(roundResult); + return returnValue; + } + + +// ----------------------------------------------------------------------------- +// ActivePalette2Utils::APDimensionSize() +// ----------------------------------------------------------------------------- +// +TSize ActivePalette2Utils::APDimensionSize( TAPDimensionSize aDimensionSize ) + { + TSize returnSize( 0, 0 ); + switch ( aDimensionSize ) + { + case EItemSize: + { + TInt width = ActivePalette2Utils::APDimension( EItemWidth ); + TInt height = ActivePalette2Utils::APDimension( EItemHeight ); + returnSize.SetSize( width, height ); + } + break; + case E3dPaletteTextureSize: + { + TInt width = ActivePalette2Utils::APDimension( EGenericParam, K3dPaletteTextureSize.iWidth ); + TInt height = ActivePalette2Utils::APDimension( EGenericParam, K3dPaletteTextureSize.iHeight ); + returnSize.SetSize( width, height ); + } + break; + case E3dScrollIconSize: + { + TInt width = ActivePalette2Utils::APDimension( EGenericParam, K3dScrollIconSize.iWidth ); + TInt height = ActivePalette2Utils::APDimension( EGenericParam, K3dScrollIconSize.iHeight ); + returnSize.SetSize( width, height ); + } + break; + case E3dFocusRingSize: + { + TInt width = ActivePalette2Utils::APDimension( EGenericParam, K3dFocusRingSize.iWidth ); + TInt height = ActivePalette2Utils::APDimension( EGenericParam, K3dFocusRingSize.iHeight ); + returnSize.SetSize( width, height ); + } + break; + default: + { + //PRINT( _L("Camera :: CCamAppUi::HandleCommandL Panic!") ) + //CamPanic( ECamPanicUi ); + } + break; + } + return returnSize; + } + +// ----------------------------------------------------------------------------- +// ActivePalette2Utils::APDimensionPoint() +// ----------------------------------------------------------------------------- +// +TPoint ActivePalette2Utils::APDimensionPoint( TAPDimensionPoint aDimensionPoint ) + { + TPoint returnPoint( 0, 0 ); + switch ( aDimensionPoint ) + { + case EDefault2dPaletteOffset: + { + TInt x = ActivePalette2Utils::APDimension( EGenericParam, KDefault2dPaletteOffset.iX ); + TInt y = ActivePalette2Utils::APDimension( EGenericParam, KDefault2dPaletteOffset.iY ); + returnPoint.SetXY( x, y ); + } + break; + case EDefault3dPaletteOffset: + { + TInt x = ActivePalette2Utils::APDimension( EGenericParam, KDefault3dPaletteOffset.iX ); + TInt y = ActivePalette2Utils::APDimension( EGenericParam, KDefault3dPaletteOffset.iY ); + returnPoint.SetXY( x, y ); + } + break; + case E3dScrollIconOffset: + { + TInt x = ActivePalette2Utils::APDimension( EGenericParam, K3dScrollIconOffset.iX ); + TInt y = ActivePalette2Utils::APDimension( EGenericParam, K3dScrollIconOffset.iY ); + returnPoint.SetXY( x, y ); + } + break; + case E3dFocusRingOffset: + { + TInt x = ActivePalette2Utils::APDimension( EGenericParam, K3dFocusRingOffset.iX ); + TInt y = ActivePalette2Utils::APDimension( EGenericParam, K3dFocusRingOffset.iY ); + returnPoint.SetXY( x, y ); + } + break; + case E3dTooltipOffset: + { + TInt x = -ActivePalette2Utils::APDimension( EItemXOffset ); + TInt y = ActivePalette2Utils::APDimension( EGenericParam, K3dTooltipOffset.iY ); + returnPoint.SetXY( x, y ); + } + break; + default: + { + //PRINT( _L("Camera :: CCamAppUi::HandleCommandL Panic!") ) + //CamPanic( ECamPanicUi ); + } + break; + } + return returnPoint; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/CActivePalettePluginBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/CActivePalettePluginBase.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,335 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette Base plugin class* +*/ + + +/** + * @file CActivePalettePluginBase.cpp + * Active Palette Base plugin class + */ + +// INCLUDE FILES + +#include "CActivePalettePluginBase.h" +#include "ActivePalette2Logger.h" + +#include "ActivePalette2Utils.h" + +#include +#include + +#include "ActivePalette2Cfg.h" + + +// CONSTANTS + +const TInt KAnimPhase1 = 0; +const TInt KAnimPhase2 = 1; +const TInt KAnimPhaseMax = KAnimPhase2; +const TInt KAnimNofPhases = 2; + +const TInt KAnimDeviatinFactorMul = 1; +const TInt KAnimDeviatinFactorDiv = 5; + + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CAnimationHelper::CAnimationHelper() +// C++ constructor +// ----------------------------------------------------------------------------- +// +CAnimationHelper::CAnimationHelper() + { + // empty + } + +// ----------------------------------------------------------------------------- +// CAnimationHelper::ConstructL() +// 2nd phase construction +// ----------------------------------------------------------------------------- +// +void CAnimationHelper::ConstructL(const TSize aSize, const TBool aMaskNeeded) + { + ActivePalette2Utils::CreateDrawingObjectsL(aSize,&iFrame,&iFrameDevice,&iFrameGc); + if (aMaskNeeded) + { + ActivePalette2Utils::CreateDrawingObjectsL(EGray256, + aSize,&iFrameMask,&iFrameMaskDevice,&iFrameMaskGc); + } + } + +// ----------------------------------------------------------------------------- +// CAnimationHelper::~CAnimationHelper() +// Destructor +// ----------------------------------------------------------------------------- +// +CAnimationHelper::~CAnimationHelper() + { + // DeleteDrawingObjects checks passed pointers to ensure they are not null + ActivePalette2Utils::DeleteDrawingObjects(&iFrame,&iFrameDevice,&iFrameGc); + ActivePalette2Utils::DeleteDrawingObjects(&iFrameMask,&iFrameMaskDevice,&iFrameMaskGc); + } + +// ----------------------------------------------------------------------------- +// CAnimationHelper::NewL() +// Symbian 2 phase construction +// ----------------------------------------------------------------------------- +// +CAnimationHelper * CAnimationHelper::NewL(const TSize aSize, const TBool aMaskNeeded) + { + CAnimationHelper * self = new (ELeave) CAnimationHelper(); + + CleanupStack::PushL(self); + self->ConstructL(aSize, aMaskNeeded); + CleanupStack::Pop(self); + + return self; + } + +// ----------------------------------------------------------------------------- +// NActivePalettePluginFactory::TPluginCreationParams::PluginObserver() +// ----------------------------------------------------------------------------- +// +EXPORT_C MActivePalettePluginObserver& NActivePalettePluginFactory::TPluginCreationParams::PluginObserver(void) const + { + return iObserver; + } + +// ----------------------------------------------------------------------------- +// NActivePalettePluginFactory::TPluginCreationParams::Dimensions(void) +// ----------------------------------------------------------------------------- +// +EXPORT_C TSize NActivePalettePluginFactory::TPluginCreationParams::Dimensions(void) const + { + return iDimensions; + } + +// ----------------------------------------------------------------------------- +// NActivePalettePluginFactory::TPluginCreationParams::TPluginCreationParams() +// ----------------------------------------------------------------------------- +// +EXPORT_C NActivePalettePluginFactory::TPluginCreationParams::TPluginCreationParams(MActivePalettePluginObserver & aObserver, + const TSize& aDimensions) +: iObserver(aObserver), + iDimensions(aDimensions) + { + } + +// ----------------------------------------------------------------------------- +// CActivePalettePluginBase::CActivePalettePluginBase() +// C++ constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CActivePalettePluginBase::CActivePalettePluginBase(const NActivePalettePluginFactory::TPluginCreationParams & aCreationParams) +: iPluginObserver(aCreationParams.PluginObserver()) + { + LOGTEXT( _L( "CActivePalettePluginBase::CActivePalettePluginBase" ) ); + PluginObserver().NotifyPluginCreated(this); + } + +// ----------------------------------------------------------------------------- +// CActivePalettePluginBase::~CActivePalettePluginBase() +// Destructor +// ----------------------------------------------------------------------------- +// +EXPORT_C CActivePalettePluginBase::~CActivePalettePluginBase(void) + { + LOGTEXT( _L( "CActivePalettePluginBase::~CActivePalettePluginBase" ) ); + CBase::Delete(iAnimationHelper); + iAnimationHelper = NULL; + PluginObserver().NotifyPluginDestroyed(this); + } + +// ----------------------------------------------------------------------------- +// CActivePalettePluginBase::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +EXPORT_C void CActivePalettePluginBase::ConstructL(const NActivePalettePluginFactory::TPluginCreationParams& /*aCreationParams*/, + const TDesC8 & /*aCustomDataDes*/, + const TInt /*aCustomDataInt*/) + { + LOGTEXT( _L( "CActivePalettePluginBase::ConstructL" ) ); + // empty + } + +// ----------------------------------------------------------------------------- +// CActivePalettePluginBase::Shutdown() +// ----------------------------------------------------------------------------- +// +EXPORT_C void CActivePalettePluginBase::Shutdown(void) + { + LOGTEXT( _L( "CActivePalettePluginBase::Shutdown" ) ); + // empty + } + +// ----------------------------------------------------------------------------- +// CActivePalettePluginBase::HandleMessageL() +// ----------------------------------------------------------------------------- +// +EXPORT_C void CActivePalettePluginBase::HandleMessageL(const TInt aMessageID, + const TDesC8& /*aDataDes*/, + const TInt /*aDataInt*/) + { + LOGTEXT1( _L( "CActivePalettePluginBase::HandleMessageL, message ID: %d" ), aMessageID ); + // empty + if (aMessageID) + { + // no compiler warning + } + } + +// ----------------------------------------------------------------------------- +// CActivePalettePluginBase::PrepareAniFramesL() +// ----------------------------------------------------------------------------- +// +EXPORT_C void CActivePalettePluginBase::PrepareAniFramesL(const TInt aAniType, + TPluginAnimationInfo& aAniInfo, + const TPluginAnimationInfo& aDefaultAniInfo, + const CFbsBitmap& aItemIcon, + const CFbsBitmap* aItemIconMask) + { + LOGTEXT1( _L( "CActivePalettePluginBase::PrepareAniFramesL, AniType ID: %d" ), aAniType); + + // use default animation info + aAniInfo = aDefaultAniInfo; + + // create data for icon and mask frames + iAnimationHelper = CAnimationHelper::NewL(aDefaultAniInfo.iFrameSize, + (NULL != aItemIconMask)); + + if (aAniType) + { + // no compiler warning + } + if (aItemIcon.Handle()) + { + // no compiler warning + } + } + +// ----------------------------------------------------------------------------- +// CActivePalettePluginBase::ReleaseAniFrames() +// ----------------------------------------------------------------------------- +// +EXPORT_C void CActivePalettePluginBase::ReleaseAniFrames(const TInt aAniType) + { + LOGTEXT1( _L( "CActivePalettePluginBase::ReleaseAniFrames, AniType ID: %d" ), aAniType); + + CBase::Delete(iAnimationHelper); + iAnimationHelper = NULL; + + if (aAniType) + { + // no compiler warning + } + } + +// ----------------------------------------------------------------------------- +// CActivePalettePluginBase::ProduceAniFrame( +// ----------------------------------------------------------------------------- +// +EXPORT_C void CActivePalettePluginBase::ProduceAniFrame( + TInt aAniType, + TInt aFrameNo, + const TPluginAnimationInfo& aAniInfo, + const CFbsBitmap& aItemIcon, + const CFbsBitmap* aItemIconMask, + CFbsBitmap** aFrame, + CFbsBitmap** aFrameMask, + TBool& aOwnershipTransferForFrame, + TBool& aOwnershipTransferForMask) + { + LOGTEXT2( + _L( "CActivePalettePluginBase::ProduceAniFrame, AniType ID: %d, frame no : %d" ), + aAniType, + aFrameNo); + + CAnimationHelper* ani = static_cast(iAnimationHelper); + + aOwnershipTransferForFrame = EFalse; + aOwnershipTransferForMask = EFalse; + + *aFrame = ani->iFrame; + *aFrameMask = ani->iFrameMask; + + // empty mask, transparent + if (NULL != ani->iFrameMaskGc) + { + ani->iFrameMaskGc->Reset(); + ani->iFrameMaskGc->SetBrushColor(KRgbBlack); + ani->iFrameMaskGc->SetBrushStyle(CGraphicsContext::ESolidBrush); + ani->iFrameMaskGc->Clear(); + } + + // empty frame + ani->iFrameGc->Reset(); + ani->iFrameGc->SetBrushColor(KRgbWhite); + ani->iFrameGc->SetBrushStyle(CGraphicsContext::ESolidBrush); + ani->iFrameGc->Clear(); + + // ani frame + TInt phase = Min(KAnimPhaseMax, + KAnimNofPhases * aFrameNo / aAniInfo.iNofFrames); + + TInt inPhaseMax = aAniInfo.iNofFrames / KAnimNofPhases; + + TInt inPhaseOfs = Min(inPhaseMax, aFrameNo - (phase * KAnimPhaseMax)); + + TInt lenX = aAniInfo.iFrameSize.iWidth; + TInt lenY = aAniInfo.iFrameSize.iHeight; + + TInt devX = lenX * KAnimDeviatinFactorMul / KAnimDeviatinFactorDiv; + TInt devY = lenY * KAnimDeviatinFactorMul / KAnimDeviatinFactorDiv; + + TInt szx(0); + TInt szy(0); + + TInt addX = devX * inPhaseOfs / inPhaseMax; + TInt addY = devY * inPhaseOfs / inPhaseMax; + + switch (phase) + { + case KAnimPhase1: + szx = lenX - addX; + szy = lenY - addY; + break; + + case KAnimPhase2: + default: + szx = lenX - devX + addX; + szy = lenY - devY + addY; + break; + } + + TRect frameRect(TPoint( (lenX - szx) / 2, (lenY - szy) / 2), + TSize(szx, szy)); + TRect iconRect(TPoint(0,0), aItemIcon.SizeInPixels()); + + if (NULL != aItemIconMask && NULL != ani->iFrameMaskGc) + { + ani->iFrameMaskGc->DrawBitmap(frameRect,aItemIconMask,iconRect); + } + + ani->iFrameGc->DrawBitmap(frameRect,&aItemIcon,iconRect); + + if (aAniType) + { + // no compiler warning + } + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/activepalette2configuration.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/activepalette2configuration.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +#include "ActivePalette2Cfg.h" +#include "activepalette2configuration.h" + + +CActivePalette2Configuration* +CActivePalette2Configuration::NewL( TActivePalette2DrawMode aDrawMode ) + { + CActivePalette2Configuration* self = + new (ELeave) CActivePalette2Configuration( aDrawMode ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +CActivePalette2Configuration +::CActivePalette2Configuration( TActivePalette2DrawMode aDrawMode ) + : iDrawMode( aDrawMode ) + { + } + +void +CActivePalette2Configuration::ConstructL() + { + } + +CActivePalette2Configuration::~CActivePalette2Configuration() + { + } + + +void +CActivePalette2Configuration +::TooltipConfiguration( TActivePalette2TooltipConfig& aTooltipTimes ) + { + switch( iDrawMode ) + { + case EAP2DrawModeSemiTransparentTooltipModeFading: + + aTooltipTimes.iPreshowDelay = NAP2Cfg::KTooltipPreshowDelayFading; + aTooltipTimes.iFullshowPeriod = NAP2Cfg::KTooltipFullshowPeriodFading; + aTooltipTimes.iTimerTickLength = NAP2Cfg::KTooltipTimerTickLengthFading; + aTooltipTimes.iTransitionSpeed = KErrNotSupported; + aTooltipTimes.iTransitionFrames = NAP2Cfg::KTooltipFadingSteps; + + break; + + case EAP2DrawModeSemiTransparent: + case EAP2DrawModeCheckerboard: + case EAP2DrawModeOpaque: + default: + + aTooltipTimes.iPreshowDelay = NAP2Cfg::KTooltipPreshowDelay; + aTooltipTimes.iFullshowPeriod = NAP2Cfg::KTooltipFullshowPeriod; + aTooltipTimes.iTimerTickLength = NAP2Cfg::KTooltipTimerTickLength; + aTooltipTimes.iTransitionSpeed = NAP2Cfg::KTooltipShowSpeed; + aTooltipTimes.iTransitionFrames = KErrNotSupported; + + break; + } + } diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/activepalette2tooltipfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/activepalette2tooltipfactory.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 Tooltip Factory implementation +* +*/ + + +// =========================================================================== +// Includes +#include "ActivePalette2Tooltip.h" +#include "activepalette2tooltipfading.h" +#include "activepalette2tooltipfactory.h" + +// =========================================================================== +// Implementation + +// --------------------------------------------------------------------------- +// CreateTooltipL +// --------------------------------------------------------------------------- +// +CActivePalette2Tooltip* +ActivePalette2TooltipFactory::CreateTooltipL( + TActivePalette2DrawMode aDrawMode, + const CActivePalette2BasicUI* aParent, + CActivePalette2Model* aModel, + CActivePalette2Styler* aStyler ) + { + CActivePalette2Tooltip* tt = NULL; + + switch ( aDrawMode ) + { + case EAP2DrawModeSemiTransparentTooltipModeFading: + tt = CActivePalette2TooltipFading::NewL( aParent, aModel, aStyler ); + break; + case EAP2DrawModeSemiTransparent: + case EAP2DrawModeCheckerboard: + case EAP2DrawModeOpaque: + default: + tt = CActivePalette2Tooltip::NewL( aParent, aModel, aStyler ); + break; + } + + return tt; + } + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/Src/activepalette2tooltipfading.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/Src/activepalette2tooltipfading.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active Palette 2 Fading Tooltip implementation +* +*/ + + + +// =========================================================================== +// Includes +#include + +#include "ActivePalette2BasicUI.h" +#include "ActivePalette2Model.h" +#include "ActivePalette2Styler.h" +#include "activepalette2tooltipfading.h" + +// =========================================================================== +// Constants + + +// =========================================================================== +// Class implementation + +// static +CActivePalette2TooltipFading* +CActivePalette2TooltipFading::NewL( const CActivePalette2BasicUI* aParent, + CActivePalette2Model* aModel, + CActivePalette2Styler* aStyler ) + { + CActivePalette2TooltipFading* self = + new (ELeave) CActivePalette2TooltipFading( aModel, aStyler ); + + CleanupStack::PushL( self ); + self->ConstructL( aParent ); + CleanupStack::Pop( self ); + + return self; + } + + +// virtual +CActivePalette2TooltipFading::~CActivePalette2TooltipFading() + { + // No new resources to free. + } + + +// virtual +void +CActivePalette2TooltipFading +::ProduceTooltipToScreen( TBool aActivateGc ) const + { + TRect redrawRect; + TRect tooltipRect( TooltipRect() ); + + // ------------------------------------------------------- + // Figure out redraw area needed + if ( iModel->ShowTooltip() ) + { + redrawRect = tooltipRect; + + if ( iRenderedRect.Width() > 0 ) + { + redrawRect.BoundingRect( iRenderedRect ); + } + } + else + { + redrawRect = iRenderedRect; + } + + // ------------------------------------------------------- + // Activate system gc if needed + if ( !iRenderGc && aActivateGc ) + { + Window().Invalidate(redrawRect); + ActivateGc(); + Window().BeginRedraw(redrawRect); + } + + // ------------------------------------------------------- + // Draw in the background + if ( iParent && iParent->APObserver() ) + { + if ( redrawRect.Size().iHeight > 0 && redrawRect.Size().iWidth > 0 ) + { + iParent->APObserver()->Redraw(redrawRect); + } + } + + // ------------------------------------------------------- + // Blit tooltip to buffer and use current opaqueness + // value to blend the tooltip to gc. + if ( iModel->ShowTooltip() ) + { + CBitmapContext* context = ( iRenderGc ? iRenderGc : &SystemGc() ); + iStyler->BlitTooltip( context, + tooltipRect.iTl, + iModel->TooltipCurrentFrame(), + iModel->TooltipTotalFrames() ); + } + + // ------------------------------------------------------- + // Deactivate gc if needed + if ( !iRenderGc && aActivateGc ) + { + Window().EndRedraw(); + DeactivateGc(); + } + + // ------------------------------------------------------- + // Determine redraw area for next round. + if ( iModel->ShowTooltip() ) + { + iRenderedRect = tooltipRect; + } + else + { + iRenderedRect = TRect(0,0,0,0); + } + // ------------------------------------------------------- + } + + + +// virtual +TRect +CActivePalette2TooltipFading::TooltipRect() const + { + TInt tlX = iAnchor.iX - iStyler->TooltipSize().iWidth; + TInt tlY = iAnchor.iY + iStyler->TootipYOffset( iModel->TooltipScreenPosition() ); + TInt brX = iAnchor.iX; + TInt brY = tlY + iStyler->TooltipSize().iHeight; + + return TRect( tlX, tlY, brX, brY ); + } + + + +// ----------------------------------------------------------------------------- +// CActivePalette2Tooltip::SetAnchor() +// ----------------------------------------------------------------------------- +// +void +CActivePalette2TooltipFading +::ConstructL( const CActivePalette2BasicUI* aParent ) + { + CActivePalette2Tooltip::ConstructL( aParent ); + } + +CActivePalette2TooltipFading +::CActivePalette2TooltipFading( CActivePalette2Model* aModel, + CActivePalette2Styler* aStyler ) + : CActivePalette2Tooltip( aModel, aStyler ) + { + } diff -r 000000000000 -r 1ddebce53859 camerauis/activepalette/rom/activepalette2.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/activepalette/rom/activepalette2.iby Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for project Active Palette +* +*/ + + + +#ifndef ACTIVEPALETTE2_IBY +#define ACTIVEPALETTE2_IBY + +file = ABI_DIR\BUILD_DIR\ActivePalette.dll SHARED_LIB_DIR\ActivePalette.dll +data = DATAZ_\RESOURCE_FILES_DIR\apps\activepalette2graphics.mif APP_RESOURCE_DIR\activepalette2graphics.mif + +#endif // ACTIVEPALETTE2_IBY + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/build/cameraapp.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/build/cameraapp.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project specification for the Camera App +* +*/ + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +../generic/data/cameraappCapture1.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappCapture1.wav +../generic/data/cameraappCapture1.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappCapture1.wav +../generic/data/cameraappCapture2.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappCapture2.wav +../generic/data/cameraappCapture2.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappCapture2.wav +../generic/data/cameraappCapture3.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappCapture3.wav +../generic/data/cameraappCapture3.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappCapture3.wav +../generic/data/cameraappCapture4.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappCapture4.wav +../generic/data/cameraappCapture4.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappCapture4.wav +../generic/data/cameraappFocusSucc.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappFocusSucc.wav +../generic/data/cameraappFocusSucc.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappFocusSucc.wav +../generic/data/cameraappCapture1.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappCapture1.wav +../generic/data/cameraappCapture1.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappCapture1.wav +../generic/data/cameraappCapture2.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappCapture2.wav +../generic/data/cameraappCapture2.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappCapture2.wav +../generic/data/cameraappCapture3.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappCapture3.wav +../generic/data/cameraappCapture3.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappCapture3.wav +../generic/data/cameraappCapture4.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappCapture4.wav +../generic/data/cameraappCapture4.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappCapture4.wav +../generic/data/cameraappFocusSucc.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappFocusSucc.wav +../generic/data/cameraappFocusSucc.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappFocusSucc.wav +../generic/data/cameraappStart.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappStart.wav +../generic/data/cameraappStart.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappStart.wav +../generic/data/cameraappStop.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappStop.wav +../generic/data/cameraappStop.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappStop.wav +../generic/data/cameraappStart.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappStart.wav +../generic/data/cameraappStart.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappStart.wav +../generic/data/cameraappStop.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappStop.wav +../generic/data/cameraappStop.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappStop.wav + + +../generic/data/cameraappCaptureShort1.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappCaptureShort1.wav +../generic/data/cameraappCaptureShort1.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappCaptureShort1.wav +../generic/data/cameraappCaptureShort2.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappCaptureShort2.wav +../generic/data/cameraappCaptureShort2.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappCaptureShort2.wav +../generic/data/cameraappCaptureShort3.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappCaptureShort3.wav +../generic/data/cameraappCaptureShort3.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappCaptureShort3.wav +../generic/data/cameraappCaptureShort4.wav /epoc32/release/winscw/urel/z/system/sounds/digital/cameraappCaptureShort4.wav +../generic/data/cameraappCaptureShort4.wav /epoc32/release/winscw/udeb/z/system/sounds/digital/cameraappCaptureShort4.wav +../generic/data/cameraappCaptureShort1.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappCaptureShort1.wav +../generic/data/cameraappCaptureShort1.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappCaptureShort1.wav +../generic/data/cameraappCaptureShort2.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappCaptureShort2.wav +../generic/data/cameraappCaptureShort2.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappCaptureShort2.wav +../generic/data/cameraappCaptureShort3.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappCaptureShort3.wav +../generic/data/cameraappCaptureShort3.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappCaptureShort3.wav +../generic/data/cameraappCaptureShort4.wav /epoc32/release/armv5/urel/z/system/sounds/digital/cameraappCaptureShort4.wav +../generic/data/cameraappCaptureShort4.wav /epoc32/release/armv5/udeb/z/system/sounds/digital/cameraappCaptureShort4.wav + + +../generic/data/capture.jpg /epoc32/winscw/c/private/101F857A/capture.jpg + + +PRJ_MMPFILES // List of .mmp files + +cameraapp.mmp + +PRJ_EXTENSIONS + +START EXTENSION s60/mifconv +OPTION TARGETFILE cameraapp.mif +OPTION HEADERFILE cameraapp.mbg +OPTION SOURCEFILE iconlist.txt +END + +START EXTENSION s60/mifconv +OPTION SOURCEDIR ../generic/bitmaps +OPTION TARGETFILE cameraapp2.mif +OPTION HEADERFILE cameraapp2.mbg +OPTION SOURCES -c8,1 qgn_indi_lcam_cont_cam_xenon_charging.bmp +END + +START EXTENSION s60/mifconv +OPTION TARGETFILE cameraapp_aif.mif +OPTION SOURCES -c8,8 qgn_menu_cams +END diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/build/cameraapp.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/build/cameraapp.mmp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,374 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project cameraapp +* +*/ + + +#if defined(WINS) || defined(WINSCW) +// During linking WINS or WINSCW flag is set instead of __WINS__ or __WINSCW__. +// Set those flags here, so the product feature flags can be set correctly in +// also during linking. +#define __WINSCW__ +#define __WINS__ +#endif + +#if defined(WINS) || defined(WINSCW) +MACRO FORCE_DUMMY_ENGINE +#define FORCE_DUMMY_ENGINE +#endif + +// Use this #define if dynamic settings should be reset to defaults +// on switching from photo to video mode and vice versa. +#undef RESET_DYNAMIC_SETTINGS_WHEN_SWITCH_MODE + +#define _RESOURCES_INC_ ../generic/data/resource_inc + +#include "../group/camproductconfig.mmh" +#include "../generic/inc/CamAppUid.h" +#include "../generic/inc/cameracontroller/camcameracontrollerflags.hrh" +#include +#include +#include + +TARGET cameraapp.exe +TARGETTYPE exe +EPOCSTACKSIZE 0x5000 +EPOCHEAPSIZE 0x4000 0x2380000 +UID 0x100039CE 0x101F857A //KCameraappUID replaced with real value due to the OST compiler limitations +VENDORID VID_DEFAULT +CAPABILITY CAP_APPLICATION MultimediaDD SurroundingsDD PowerMgmt + +START RESOURCE ../generic/data/cameraapp.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANGUAGE_IDS +END // RESOURCE + +START RESOURCE ../generic/data/cameraapp_reg.rss +DEPENDS cameraapp.rsg +TARGETPATH /private/10003a3f/apps +END // RESOURCE + +// NHD Camera settings resources +START RESOURCE ../generic/data/nhdcamsettings.rss +TARGETPATH APP_RESOURCE_DIR +HEADER +LANGUAGE_IDS +END // RESOURCE + + +// VGA Camera settings resources +START RESOURCE ../generic/data/vgacamsettings.rss +TARGETPATH APP_RESOURCE_DIR +HEADER +LANGUAGE_IDS +END // RESOURCE + +// --------------------------------------------------------------------------- +// Source files +SOURCEPATH ../generic/common/src +SOURCE CamVideoQualityLevel.cpp +SOURCE CamStaticSettingsModel.cpp +SOURCE CamUtility.cpp +SOURCE CamPanic.cpp +SOURCE CamWaitDialog.cpp +SOURCE CamCollectionManagerAo.cpp +SOURCE caminfolistboxitembase.cpp +SOURCE CamCaptureSetupListItem.cpp +SOURCE CamCaptureSetupListBox.cpp +SOURCE CamCaptureSetupListBoxModel.cpp +SOURCE CamCaptureSetupListItemDrawer.cpp + +SOURCE camconfiguration.cpp +SOURCE camconfigurationutility.cpp + +SOURCEPATH ../generic/src +SOURCE CamApp.cpp +SOURCE CamAppui.cpp +SOURCE CamDocument.cpp +SOURCE CamAppController.cpp +SOURCE CamTimer.cpp +SOURCE CamNaviCounterControl.cpp +SOURCE CamNaviCounterModel.cpp +SOURCE CamNaviProgressBarControl.cpp +SOURCE CamNaviProgressBarModel.cpp +SOURCE CamSelfTimer.cpp +SOURCE CamDefaultNameSettingItem.cpp +SOURCE Camdefaultnamesettingpage.cpp +SOURCE CamViewBase.cpp +SOURCE CamPostCaptureViewBase.cpp +SOURCE CamPreCaptureViewBase.cpp +SOURCE CamStillPreCaptureView.cpp +SOURCE CamStillPostCaptureView.cpp +SOURCE CamStillUserSceneSetupView.cpp +SOURCE CamUserSceneSetupViewBase.cpp +SOURCE CamVideoPreCaptureView.cpp +SOURCE CamVideoPostCaptureView.cpp +SOURCE CamBurstThumbnailView.cpp +SOURCE CamContainerBase.cpp +SOURCE CamPreCaptureContainerBase.cpp +SOURCE CamPostCaptureContainer.cpp +SOURCE CamShootingModeContainer.cpp +SOURCE CamUserSceneSetupContainer.cpp +SOURCE CamBurstThumbnailContainer.cpp +SOURCE CamBurstThumbnailGrid.cpp +SOURCE CamBurstThumbnailGridModel.cpp +SOURCE CamSidePane.cpp +SOURCE CamIndicator.cpp +SOURCE CamIndicatorResourceReader.cpp +SOURCE CamIndicatorData.cpp +SOURCE CamBurstThumbnailGridSizer.cpp +SOURCE CamSettingsModel.cpp + +SOURCE CamZoomPane.cpp +SOURCE CamZoomModel.cpp +SOURCE CamZoomUpdateManager.cpp +SOURCE CamCaptureSetupControlHandler.cpp +SOURCE CamCaptureSetupContainer.cpp +SOURCE CamCaptureSetupViewBase.cpp +SOURCE CamCaptureSetupMenuListItem.cpp +SOURCE CamCaptureSetupMenuListBox.cpp +SOURCE CamCaptureSetupMenuListBoxModel.cpp +SOURCE CamCaptureSetupMenuListItemDrawer.cpp +SOURCE CamCaptureSetupMenu.cpp +SOURCE CamCaptureSetupSlider.cpp +SOURCE CamVideoPreCaptureContainer.cpp +SOURCE CamStillPreCaptureContainer.cpp +SOURCE CamBurstCaptureArray.cpp +SOURCE CamStandbyContainer.cpp +SOURCE CamUserSceneSetupItemArray.cpp +SOURCE CamUserSceneSetupListItem.cpp +SOURCE CamImageSaveActive.cpp +SOURCE CamFileCheckAo.cpp + +SOURCE CamDecorator.cpp +SOURCE CamObserverHandler.cpp +SOURCE CamRecordingIconDecoration.cpp +SOURCE CamNewFileService.cpp +SOURCE CamServer.cpp + +SOURCE CamCallStateAo.cpp +SOURCE CamPropertyWatcher.cpp +SOURCE camactivepalettehandler.cpp +SOURCE CamCommandHandlerAo.cpp +SOURCE CamSceneListBox.cpp +SOURCE CamSceneListBoxModel.cpp +SOURCE CamBmpRotatorAo.cpp +SOURCE CamVolumeKeyObserver.cpp +SOURCE CamSyncRotatorAo.cpp +SOURCE CamPerformanceLogger.cpp +SOURCE CamInfoListBox.cpp +SOURCE CamInfoListBoxModel.cpp +SOURCE CamInfoListBoxContainer.cpp +SOURCE CamTimeLapseUtility.cpp + +SOURCE camlinevfgriddrawer.cpp +SOURCE camvfgridfactory.cpp +SOURCE cambatterypanecontroller.cpp +SOURCE cambatterypanedrawer.cpp + +SOURCE CamLocationIconController.cpp + +SOURCE camflashstatus.cpp +SOURCE camfolderutility.cpp +SOURCE camtextitem.cpp +SOURCE cambitmapitem.cpp +SOURCE camvideotime.cpp +SOURCE CamDriveChangeNotifier.cpp +SOURCE camoneclickuploadutility.cpp +SOURCE CamMemoryMonitor.cpp +SOURCE cambackupcontainer.cpp + +// Camera controller sources +SOURCEPATH ../generic/src/cameracontroller +SOURCE cambuffer.cpp +SOURCE cambuffershare.cpp +SOURCE camimagedecoder.cpp +SOURCE camimageencoder.cpp +SOURCE cambitmapscaler.cpp +SOURCE camsnapshot.cpp +SOURCE camsnapshotprovider.cpp +SOURCE camcameracontroller.cpp +SOURCE camcameracontrolleractive.cpp +SOURCE camconstantsettingprovider.cpp +SOURCE camsettingconversion.cpp +SOURCE camsettingprovider.cpp +#ifdef CAMERAAPP_FLASH_SIMULATOR +SOURCE camflashsimulator.cpp +#endif +#ifdef CAMERAAPP_CAPI_EMULATOR +SOURCE CamCamera.cpp +SOURCE CamCameraCallback.cpp +#ifndef FORCE_DUMMY_ENGINE +SOURCE CameraappTestBitmapManager.cpp +#endif +#endif //CAMERAAPP_CAPI_EMULATOR + +// Audio player sources +SOURCEPATH ../generic/src/audioplayer +SOURCE camaudioplayercontroller.cpp +SOURCE camaudioplayerwrapper.cpp +SOURCE camtoneplayerwrapper.cpp + +// Test code sources +SOURCEPATH ../generic/dummyengine + +// Use dummy engine if this is defined +#ifdef FORCE_DUMMY_ENGINE +SOURCE CameraappDummyEngine.cpp +SOURCE CameraappDummyCallbackActive.cpp +SOURCE CameraappTestBitmapManager.cpp +#endif + +// --------------------------------------------------------------------------- +// Header folders + +USERINCLUDE ../generic/inc +USERINCLUDE ../generic/common/inc +USERINCLUDE ../generic/common/data +USERINCLUDE ../generic/inc/cameracontroller +USERINCLUDE ../generic/inc/audioplayer +USERINCLUDE ../generic/camerauiconfigmanager/inc + +USERINCLUDE ../generic/dummyengine + +APP_LAYER_SYSTEMINCLUDE + +// --------------------------------------------------------------------------- +// Libraries + +LIBRARY ecom.lib +LIBRARY GSEcomPlugin.lib +LIBRARY euser.lib +LIBRARY apparc.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY eikcoctl.lib +LIBRARY avkon.lib +LIBRARY caeengine.lib +LIBRARY AknSkins.lib +LIBRARY efsrv.lib +LIBRARY PlatformEnv.lib // PathInfo +LIBRARY SysUtil.lib +LIBRARY fbscli.lib +LIBRARY bitgdi.lib +LIBRARY ws32.lib +LIBRARY commonengine.lib +LIBRARY egul.lib +LIBRARY bafl.lib +LIBRARY sendui.lib +LIBRARY CdlEngine.lib +LIBRARY BitmapTransforms.lib +LIBRARY commondialogs.lib +LIBRARY featmgr.lib +LIBRARY ServiceHandler.lib // AIW library +LIBRARY AknIcon.lib +LIBRARY MediaClientAudio.lib +LIBRARY eikctl.lib +LIBRARY apgrfx.lib +LIBRARY charconv.lib +LIBRARY hlplch.lib // Help Launcher +LIBRARY CommonUi.lib // CDocumentHandler +LIBRARY apmime.lib // TDataType +LIBRARY CentralRepository.lib +LIBRARY eikdlg.lib +LIBRARY numberconversion.lib +LIBRARY NewService.lib +LIBRARY camerauiconfigmanager.lib +LIBRARY CFClient.lib +LIBRARY CFServices.lib +LIBRARY ActivePalette.lib +LIBRARY aknlayout2.lib + +// Remote Controller framework +LIBRARY RemConCoreApi.lib +LIBRARY RemConInterfaceBase.lib + +LIBRARY aknlayout2scalable.lib +LIBRARY gdi.lib +LIBRARY estor.lib // RWriteStream + +LIBRARY ecam.lib +#ifdef CAMERAAPP_CAPI_V2 +LIBRARY ecamadvsettings.lib +LIBRARY ecamdirectviewfinder.lib +#ifdef CAMERAAPP_CAPI_V2_SS +LIBRARY ecamsnapshot.lib +#endif +LIBRARY ecamhistogram.lib +LIBRARY ecamoverlay.lib +#endif // CAMERAAPP_CAPI_V2 + +LIBRARY ImageConversion.lib +LIBRARY exiflib.lib // CExifRead +LIBRARY hal.lib // HAL, HALData + +LIBRARY ecampluginsupport.lib + +LIBRARY SensrvClient.lib +LIBRARY sensrvutil.lib + +#ifdef CAMERAAPP_LOGGING +LIBRARY flogger.lib +#endif + +LIBRARY cntmodel.lib + +#ifndef __WINSCW__ +LIBRARY locationtrail.lib +#ifdef RD_MDS_2_5 +LIBRARY locationmanager.lib +#endif //RD_MDS_2_5 +#endif //WINSCW + +LIBRARY oommonitor.lib +LIBRARY aknnotify.lib + +LIBRARY imagingconfigmanager.lib +LIBRARY touchfeedback.lib + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +LIBRARY aknlistloadertfx.lib +#endif //RD_UI_TRANSITION_EFFECTS_LIST +// MC photos related lib +LIBRARY glxuiutilities.lib +LIBRARY glxcollectionmanager.lib +LIBRARY glxmetadatadialog.lib + +LIBRARY thumbnailmanager.lib + + +// --------------------------------------------------------------------------- +#ifdef FORCE_DUMMY_ENGINE + +START BITMAP DummyViewFinder.mbm + HEADER + TARGETPATH /system/apps/cameraapp + SOURCEPATH ../generic/data/bitmaps + + SOURCE c24 DummyViewfinder.bmp + SOURCE c24 DummyViewfinder2.bmp + SOURCE c24 DummyViewfinder3.bmp +END + +#endif // FORCE_DUMMY_ENGINE +// --------------------------------------------------------------------------- + +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) +LIBRARY harvesterclient.lib +#endif // defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + +USERINCLUDE ../generic/data/resource_inc +USERINCLUDE ../traces diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/build/iconlist.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/build/iconlist.txt Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,158 @@ +-c8,1 qgn_indi_cam4_antired.svg +-c8,1 qgn_indi_cam4_audio.svg +-c8,1 qgn_indi_cam4_audio_mute.svg +-c8,1 qgn_indi_cam4_autoflash.svg +-c8,1 qgn_indi_cam4_camera.svg +-c8,1 qgn_indi_cam4_capture.svg +-c8,1 qgn_indi_cam4_change.svg +-c8,1 qgn_indi_cam4_colour.svg +-c8,1 qgn_indi_cam4_colour_bw.svg +-c8,1 qgn_indi_cam4_colour_natural.svg +-c8,1 qgn_indi_cam4_colour_negative.svg +-c8,1 qgn_indi_cam4_colour_normal.svg +-c8,1 qgn_indi_cam4_colour_sepia.svg +-c8,1 qgn_indi_cam4_colour_vivid.svg +-c8,1 qgn_indi_cam4_contrast.svg +-c8,1 qgn_indi_cam4_contrast_minus.svg +-c8,1 qgn_indi_cam4_contrast_plus.svg +-c8,1 qgn_indi_cam4_tb_delete.svg +-c8,1 qgn_indi_cam4_exposure.svg +-c8,1 qgn_indi_cam4_exposure_minus.svg +-c8,1 qgn_indi_cam4_exposure_plus.svg +-c8,1 qgn_indi_cam4_extension.svg +-c8,1 qgn_indi_cam4_flash_off.svg +-c8,1 qgn_indi_cam4_flash_on.svg +-c8,1 qgn_indi_cam4_focus_frame_auto_bl.svg +-c8,1 qgn_indi_cam4_focus_frame_auto_br.svg +-c8,1 qgn_indi_cam4_focus_frame_auto_tl.svg +-c8,1 qgn_indi_cam4_focus_frame_auto_tr.svg +-c8,1 qgn_indi_cam4_goto_gallery.svg +-c8,1 qgn_indi_cam4_iso.svg +-c8,1 qgn_indi_cam4_iso_auto.svg +-c8,1 qgn_indi_cam4_iso_high.svg +-c8,1 qgn_indi_cam4_iso_low.svg +-c8,1 qgn_indi_cam4_iso_lowmed.svg +-c8,1 qgn_indi_cam4_iso_medium.svg +-c8,1 qgn_indi_cam4_iso_medhigh.svg +-c8,1 qgn_indi_cam4_tb_light_off.svg +-c8,1 qgn_indi_cam4_tb_light.svg +-c8,1 qgn_indi_cam4_location.svg +-c8,1 qgn_indi_cam4_memory_mass.svg +-c8,1 qgn_indi_cam4_memory_mmc.svg +-c8,1 qgn_indi_cam4_memory_phone.svg +-c8,1 qgn_indi_cam4_mode_auto.svg +-c8,1 qgn_indi_tb_cam4_goto_main.svg +-c8,1 qgn_indi_cam4_camera_second.svg +-c8,1 qgn_indi_cam4_mode_closeup.svg +-c8,1 qgn_indi_cam4_mode_landscape.svg +-c8,1 qgn_indi_cam4_mode_night.svg +-c8,1 qgn_indi_cam4_mode_portrait.svg +-c8,1 qgn_indi_cam4_mode_portrait_night.svg +-c8,1 qgn_indi_cam4_mode_sport.svg +-c8,1 qgn_indi_cam4_mode_userscene.svg +-c8,1 qgn_indi_cam4_quality_03mp_low.svg +-c8,1 qgn_indi_cam4_quality_08mp_low.svg +-c8,1 qgn_indi_cam4_quality_13mp_low.svg +-c8,1 qgn_indi_cam4_quality_13mp_medium.svg +-c8,1 qgn_indi_cam4_quality_1mp_low.svg +-c8,1 qgn_indi_cam4_quality_2mp_high.svg +-c8,1 qgn_indi_cam4_quality_2mp_medium.svg +-c8,1 qgn_indi_cam4_quality_3mp_high.svg +-c8,1 qgn_indi_cam4_quality_3mp_medium.svg +-c8,1 qgn_indi_cam4_quality_5mp_high.svg +-c8,1 qgn_indi_cam4_quality_sharing.svg +-c8,1 qgn_indi_cam4_quality_wide_high.svg +-c8,1 qgn_indi_cam4_tb_send.svg +-c8,1 qgn_indi_cam4_sequence.svg +-c8,1 qgn_indi_cam4_sequence_10min.svg +-c8,1 qgn_indi_cam4_sequence_10s.svg +-c8,1 qgn_indi_cam4_sequence_1min.svg +-c8,1 qgn_indi_cam4_sequence_30min.svg +-c8,1 qgn_indi_cam4_sequence_30s.svg +-c8,1 qgn_indi_cam4_sequence_5min.svg +-c8,1 qgn_indi_cam4_sequence_5s.svg +-c8,1 qgn_indi_cam4_sequence_burst.svg +-c8,1 qgn_indi_cam4_shake.svg +-c8,1 qgn_indi_cam4_sharpness.svg +-c8,1 qgn_indi_cam4_sharpness_hard.svg +-c8,1 qgn_indi_cam4_sharpness_normal.svg +-c8,1 qgn_indi_cam4_sharpness_soft.svg +-c8,1 qgn_indi_cam4_selftimer.svg +-c8,1 qgn_indi_cam4_selftimer_2sec.svg +-c8,1 qgn_indi_cam4_selftimer_10s.svg +-c8,1 qgn_indi_cam4_selftimer_20s.svg +-c8,1 qgn_indi_cam4_selftimer_off.svg +-c8,1 qgn_indi_cam4_tb_add_to_album.svg +-c8,1 qgn_indi_cam4_tb_capture.svg +-c8,1 qgn_indi_cam4_tb_record.svg +-c8,1 qgn_indi_cam4_video.svg +-c8,1 qgn_indi_cam4_viewfinder_on.svg +-c8,1 qgn_indi_cam4_viewfinder_off.svg +-c8,1 qgn_indi_cam4_wb.svg +-c8,1 qgn_indi_cam4_wb_auto.svg +-c8,1 qgn_indi_cam4_wb_cloudy.svg +-c8,1 qgn_indi_cam4_wb_fluorecent.svg +-c8,1 qgn_indi_cam4_wb_sunny.svg +-c8,1 qgn_indi_cam4_wb_tungsten.svg +-c8,1 qgn_indi_cam4_zoom.svg +-c8,1 qgn_indi_cam4_zoom_bottom.svg +-c8,1 qgn_indi_cam4_zoom_marker.svg +-c8,1 qgn_indi_cam4_zoom_marker_selected.svg +-c8,1 qgn_indi_cam4_zoom_max.svg +-c8,1 qgn_indi_cam4_zoom_middle.svg +-c8,1 qgn_indi_cam4_zoom_min.svg +-c8,1 qgn_indi_cam4_zoom_top.svg +-c8,1 qgn_indi_vid4_continuous_af.svg +-c8,1 qgn_indi_vid4_mode_video.svg +-c8,1 qgn_indi_vid4_pause.svg +-c8,1 qgn_indi_cam4_tb_play.svg +-c8,1 qgn_indi_vid4_record.svg +-c8,1 qgn_indi_vid4_quality_email_high.svg +-c8,1 qgn_indi_vid4_quality_email_normal.svg +-c8,1 qgn_indi_vid4_quality_high.svg +-c8,1 qgn_indi_vid4_quality_normal.svg +-c8,1 qgn_indi_vid4_quality_tv_high.svg +-c8,1 qgn_indi_vid4_quality_tv_normal.svg +-c8,1 qgn_indi_vid4_stabilize_on.svg +-c8,1 qgn_indi_vid4_audio_mute.svg +-c8,1 qgn_prop_cam4_codec_mp4.svg +-c8,1 qgn_prop_cam4_codec_3gp.svg +-c8,1 qgn_graf_nslider_cam4_empty.svg +-c8,1 qgn_graf_nslider_cam4_marker.svg +-c8,1 qgn_graf_nslider_cam4_image_1.svg +-c8,1 qgn_graf_nslider_cam4_image_2.svg +-c8,1 qgn_graf_nslider_cam4_image_3.svg +-c8,1 qgn_graf_nslider_cam4_video_1.svg +-c8,1 qgn_graf_nslider_cam4_video_2.svg +-c8,1 qgn_graf_nslider_cam4_video_3.svg +-c8,1 qgn_graf_nslider_cam4_video_4.svg +-c8,1 qgn_graf_nslider_cam4_video_5.svg +-c8 qgn_graf_mup2_bar_frame.svg +-c8,1 qgn_graf_mup2_bar_progress.svg +-c8,1 qgn_indi_cam4_tb_extension.svg +-c8,1 qgn_graf_nslider_cam4_marker_selected.svg +-c8,1 qgn_indi_cam_battery_strength.svg +-c8,1 qgn_indi_vid4_video.svg +-c8,1 qgn_indi_vid4_light_on +-c8,1 qgn_indi_vid4_light_off +-c8,1 qgn_indi_cam4_tb_goto_gallery.svg +-c8,1 qgn_prop_cam_battery_icon.svg +-c8,1 qgn_indi_cam4_zoom_bmp.bmp +-c8,1 qgn_indi_cam4_zoom_bottom_bmp.bmp +-c8,1 qgn_indi_cam4_zoom_max_bmp.bmp +-c8,1 qgn_indi_cam4_zoom_middle_bmp.bmp +-c8,1 qgn_indi_cam4_zoom_min_bmp.bmp +-c8,1 qgn_indi_cam4_zoom_top_bmp.bmp +-c8,1 qgn_indi_cam4_tb_mark.svg +-c8,1 qgn_indi_cam4_quality_8mp_high.svg +-c8,1 qgn_indi_cam4_quality_12mp_high.svg +-c8,1 qgn_indi_cam4_tb_upload.svg +-c8,1 qgn_indi_cam4_geotag_on.svg +-c8,1 qgn_indi_cam4_geotag_off.svg +-c8,1 qgn_indi_cam4_tb_facedet.svg +-c8,1 qgn_indi_cam4_tb_facedet_off.svg +-c8,1 qgn_indi_cam4_facedet.svg +-c8,1 qgn_indi_tb_cam4_photo_detail.svg +-c8,1 qgn_indi_cam4_quality_hd.svg +-c8,1 qgn_indi_cam4_quality_9mp_high.svg +-c8,1 qgn_indi_cam4_quality_6mp_high.svg diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/cenrep/keys_cameraapp.xls Binary file camerauis/cameraapp/cenrep/keys_cameraapp.xls has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/conf/cameraapp.confml Binary file camerauis/cameraapp/conf/cameraapp.confml has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/conf/cameraapp_101F8809.crml Binary file camerauis/cameraapp/conf/cameraapp_101F8809.crml has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/conf/cameraapp_101FFA86.crml Binary file camerauis/cameraapp/conf/cameraapp_101FFA86.crml has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/conf/cameraapp_10208A43.crml Binary file camerauis/cameraapp/conf/cameraapp_10208A43.crml has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/data/2000F8E0.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/data/2000F8E0.rss Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* ECOM plugin resource file for GS Camcorder Plugin +* +* +*/ + + +#include + +// ECOM plugin resource definition specific to the camcorder plugin + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = 0x2000F8E0;// Camera Plugin dll UID + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x10207236; // UID for CGSPluginInterface - do not change. + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x2000F8E1; // Plugin UID + version_no = 1; + display_name = "Camera settings"; // Plugin debug name + default_data = "0x10207239"; // Parent UID + opaque_data = "110"; // Order number + } + }; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/data/gscamerapluginrsc.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/data/gscamerapluginrsc.rss Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,649 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Resource file for GS Camera Plug-in +* +*/ + + +// RESOURCE IDENTIFIER +NAME DCAM // 4 letter ID + +// INCLUDES + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "GSCamcorderPlugin.hrh" +#include "Cam.hrh" +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "Cam.rh" +#include "CamConstantsCamcorder.hrh" +#include "CamConstantsViewMode.hrh" +#include "CamConstantsPortrait.hrh" +#include + + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +RESOURCE EIK_APP_INFO + { + cba = r_cam_softkeys_options_exit; + } +//---------------------------------------------------- +// +// r_cam_saving_image_wait_note +// Wait note shown when saving image after capture +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_processing_wait_note + { + flags = EAknWaitNoteFlags | EEikDialogFlagNoBackgroundFade; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = EGenProcessingWaitNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_gen_note_processing; + }; + } + }; + } +//---------------------------------------------------- +// +// r_cam_setting_list_view +// Video and Photo settings view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_cam_setting_list_view + { + menubar = r_gs_cam_settings_menubar; + cba = r_cam_setting_softkeys_options_back__open; + } + +//---------------------------------------------------- +// +// r_gs_menubar_open_exit +// Options menu with 'Open' and 'Exit' items. +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_menubar_open_exit + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_open; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_menubar_change_exit +// Options menu with 'Change' and 'Exit' items. +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_menubar_change_exit + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_change; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_menu_item_open +// Options menu item 'Open'. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_open + { + items = + { + MENU_ITEM + { + command = EAknCmdOpen; + txt = qtn_fldr_open; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_menu_item_change +// Options menu item 'Change'. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_change + { + items = + { + MENU_ITEM + { + command = ECamMSKCmdAppChange; + txt = qtn_options_change; + } + }; + } +#ifdef __SERIES60_HELP +//---------------------------------------------------- +// +// r_gs_menu_item_exit +// Options menu items 'Help' and 'Exit'. +// Used instead of plain 'Exit' when help is wanted +// to be shown in UI. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_exit + { + items = + { + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } +#else // if __SERIES60_HELP not defined +//---------------------------------------------------- +// +// r_gs_menu_item_exit +// Options menu item 'Exit'. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_exit + { + items = + { + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } +#endif // __SERIES60_HELP + +//---------------------------------------------------- +// +// r_gs_cam_settings_menubar +// Menubar visible in the main setting view +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_cam_settings_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_cam_settings_menu; + } + }; + } +//---------------------------------------------------- +// +// r_gs_cam_settings_menu +// Menu visible in the main setting view +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_cam_settings_menu + { + items = + { + MENU_ITEM + { + command = EAknCmdOpen; + txt = qtn_msk_open; + }, +#ifdef __SERIES60_HELP + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, +#endif + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } + + + +//---------------------------------------------------- +// +// r_cam_settings_title_name +// Title name used in all settings views +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_gs_settings_title_name + { + buf = qtn_lcam_gen_sett_title_camera; + } + + + +//----------------------------------------------------------------------------- +// +// r_cam_lbx +// Camera listbox items +// +//----------------------------------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_cam_lbx + { + items = + { + GS_FEATURE + { + txt = "0\t"qtn_lcam_gen_sett_camera_folder_image; + item = EImageSettingsFolder; + }, + GS_FEATURE + { + txt = "1\t"qtn_lcam_gen_sett_camera_folder_video; + item = EVideoSettingsFolder; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_setting_softkeys_options_back__open +// Softkeys for settings main view +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_setting_softkeys_options_back__open + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, + CBA_BUTTON { id = EAknCmdOpen; txt = qtn_msk_open; } + }; + } + +//---------------------------------------------------- +// +// r_gs_camcorder_view_title +// Camcorder view's title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_camcorder_view_title + { + txt = qtn_lcam_gen_sett_list; + } + +//---------------------------------------------------- +// +// r_cam_namebase_video +// Base name for video files +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_namebase_video + { + buf = qtn_lcam_namebase_video; + } + + +//---------------------------------------------------- +// +// r_cam_namebase_image +// Base name for image files +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_namebase_image + { + buf = qtn_lcam_namebase_image; + } + + +//*********************************************************** +// VIDEO QUALITY RESOURCE DEFINITIONS +//*********************************************************** + +//---------------------------------------------------- +// +// r_gs_video_quality_tvhigh +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_tvhigh + { + buf = qtn_lcam_set_type_tvhigh; + } + + +//---------------------------------------------------- +// +// r_gs_video_quality_high +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_high + { + buf = qtn_lcam_set_type_high; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_widescreen_high +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_widescreen_high + { + buf = qtn_lcam_set_type_widescreen; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_widescreen_normal +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_widescreen_normal + { + buf = qtn_lcam_set_type_widescr_normal; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_tvnorm +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_tvnorm + { + buf = qtn_lcam_set_type_tvnorm; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_norm +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_norm + { + buf = qtn_lcam_set_type_normal; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_webhigh +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_webhigh + { + buf = qtn_lcam_set_type_webhigh; + } + + +//---------------------------------------------------- +// +// r_gs_video_quality_webnorm +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_webnorm + { + buf = qtn_lcam_set_type_webnorm; + } + + +//---------------------------------------------------- +// +// r_gs_video_quality_mms +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_mms + { + buf = qtn_lcam_set_type_mms; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_sharing +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_sharing + { + buf = qtn_lcam_set_type_sharing; + } + + +//********************************************************* +// GS Cusotm IMAGE QUALITY SETTINGS resource definitions +//********************************************************** + + +//---------------------------------------------------- +// +// r_gs_image_quality_print5mlarge +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print5mlarge + { + buf = qtn_lcam_sett_attr_quality_print5mlarge; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print3mlarge +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print3mlarge + { + buf = qtn_lcam_sett_attr_quality_print3mlarge; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print2mlarge +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print2mlarge + { + buf = qtn_lcam_sett_attr_quality_print2mlarge; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print3mmed +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print3mmed + { + buf = qtn_lcam_sett_attr_quality_print3mmed; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print2mmed +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print2mmed + { + buf = qtn_lcam_sett_attr_quality_print2mmed; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print1mmed +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print1mmed + { + buf = qtn_lcam_sett_attr_quality_print1mmed; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print1_3small +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print1_3small + { + buf = qtn_lcam_sett_attr_quality_print1_3small; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print1_0small +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print1_0small + { + buf = qtn_lcam_sett_attr_quality_print1_0small; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print0_8small +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print0_8small + { + buf = qtn_lcam_sett_attr_quality_print0_8med; + } + +//---------------------------------------------------- +// +// r_gs_image_quality_mms +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_mms + { + buf = qtn_lcam_sett_attr_quality_mms; + } + +// The following are the resources shared between camera application +// and camera settings pluin refer to \generic\common folder for details +#include "CamSettings.ra" +#include "CamAppWide.ra" +#include "CamCapture.ra" +#include "CamCaptureSetup.ra" +#include "CamStillCaptureCamcorder.ra" +#include "CamVideoCaptureCamcorder.ra" + + +//End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/data/gscamerapluginrscv2.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/data/gscamerapluginrscv2.rss Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,649 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Resource file for VGA GS Camera Plug-in +* +*/ + + +// RESOURCE IDENTIFIER +NAME DCAM // 4 letter ID + +// INCLUDES + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "GSCamcorderPlugin.hrh" +#include "Cam.hrh" +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "Cam.rh" +#include "CamConstantsCamcorder.hrh" +#include "CamConstantsViewMode.hrh" +#include "CamConstantsPortrait.hrh" +#include + + +// RESOURCE DEFINITIONS + +//---------------------------------------------------- +// +// +// Needed or loading the resource fails! +// +//---------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +RESOURCE EIK_APP_INFO + { + cba = r_cam_softkeys_options_exit; + } +//---------------------------------------------------- +// +// r_cam_saving_image_wait_note +// Wait note shown when saving image after capture +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_processing_wait_note + { + flags = EAknWaitNoteFlags | EEikDialogFlagNoBackgroundFade; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = EGenProcessingWaitNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_gen_note_processing; + }; + } + }; + } +//---------------------------------------------------- +// +// r_cam_setting_list_view +// Video and Photo settings view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_gs_cam_setting_list_view + { + menubar = r_gs_cam_settings_menubar; + cba = r_cam_setting_softkeys_options_back__open; + } + +//---------------------------------------------------- +// +// r_gs_menubar_open_exit +// Options menu with 'Open' and 'Exit' items. +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_menubar_open_exit + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_open; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_menubar_change_exit +// Options menu with 'Change' and 'Exit' items. +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_menubar_change_exit + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_menu_item_exit; + }, + MENU_TITLE + { + menu_pane = r_gs_menu_item_change; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_menu_item_open +// Options menu item 'Open'. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_open + { + items = + { + MENU_ITEM + { + command = EAknCmdOpen; + txt = qtn_fldr_open; + } + }; + } + +//---------------------------------------------------- +// +// r_gs_menu_item_change +// Options menu item 'Change'. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_change + { + items = + { + MENU_ITEM + { + command = ECamMSKCmdAppChange; + txt = qtn_options_change; + } + }; + } +#ifdef __SERIES60_HELP +//---------------------------------------------------- +// +// r_gs_menu_item_exit +// Options menu items 'Help' and 'Exit'. +// Used instead of plain 'Exit' when help is wanted +// to be shown in UI. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_exit + { + items = + { + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } +#else // if __SERIES60_HELP not defined +//---------------------------------------------------- +// +// r_gs_menu_item_exit +// Options menu item 'Exit'. +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_menu_item_exit + { + items = + { + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } +#endif // __SERIES60_HELP + +//---------------------------------------------------- +// +// r_gs_cam_settings_menubar +// Menubar visible in the main setting view +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_gs_cam_settings_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_gs_cam_settings_menu; + } + }; + } +//---------------------------------------------------- +// +// r_gs_cam_settings_menu +// Menu visible in the main setting view +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_gs_cam_settings_menu + { + items = + { + MENU_ITEM + { + command = EAknCmdOpen; + txt = qtn_msk_open; + }, +#ifdef __SERIES60_HELP + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, +#endif + MENU_ITEM + { + command = EAknCmdExit; + txt = qtn_options_exit; + } + }; + } + + + +//---------------------------------------------------- +// +// r_cam_settings_title_name +// Title name used in all settings views +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_gs_settings_title_name + { + buf = qtn_lcam_gen_sett_title_camera; + } + + + +//----------------------------------------------------------------------------- +// +// r_cam_lbx +// Camera listbox items +// +//----------------------------------------------------------------------------- +// +RESOURCE GS_FEATURE_ARRAY r_cam_lbx + { + items = + { + GS_FEATURE + { + txt = "0\t"qtn_lcam_gen_sett_camera_folder_image; + item = EImageSettingsFolder; + }, + GS_FEATURE + { + txt = "1\t"qtn_lcam_gen_sett_camera_folder_video; + item = EVideoSettingsFolder; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_setting_softkeys_options_back__open +// Softkeys for settings main view +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_setting_softkeys_options_back__open + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, + CBA_BUTTON { id = EAknCmdOpen; txt = qtn_msk_open; } + }; + } + +//---------------------------------------------------- +// +// r_gs_camcorder_view_title +// Camcorder view's title. +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_gs_camcorder_view_title + { + txt = qtn_lcam_gen_sett_list; + } + +//---------------------------------------------------- +// +// r_cam_namebase_video +// Base name for video files +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_namebase_video + { + buf = qtn_lcam_namebase_video; + } + + +//---------------------------------------------------- +// +// r_cam_namebase_image +// Base name for image files +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_namebase_image + { + buf = qtn_lcam_namebase_image; + } + + +//*********************************************************** +// VIDEO QUALITY RESOURCE DEFINITIONS +//*********************************************************** + +//---------------------------------------------------- +// +// r_gs_video_quality_tvhigh +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_tvhigh + { + buf = qtn_lcam_set_type_tvhigh_v2; + } + + +//---------------------------------------------------- +// +// r_gs_video_quality_high +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_high + { + buf = qtn_lcam_set_type_high_v2; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_widescreen_high +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_widescreen_high + { + buf = qtn_lcam_set_type_widescreen_v2; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_widescreen_normal +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_widescreen_normal + { + buf = qtn_lcam_set_type_widescr_normal; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_tvnorm +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_tvnorm + { + buf = qtn_lcam_set_type_tvnorm_v2; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_norm +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_norm + { + buf = qtn_lcam_set_type_normal_v2; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_webhigh +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_webhigh + { + buf = qtn_lcam_set_type_webhigh_v2; + } + + +//---------------------------------------------------- +// +// r_gs_video_quality_webnorm +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_webnorm + { + buf = qtn_lcam_set_type_webnorm_v2; + } + + +//---------------------------------------------------- +// +// r_gs_video_quality_mms +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_mms + { + buf = qtn_lcam_set_type_mms_v2; + } + +//---------------------------------------------------- +// +// r_gs_video_quality_sharing +// Video Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_video_quality_sharing + { + buf = qtn_lcam_set_type_sharing_v2; + } + + +//********************************************************* +// GS Cusotm IMAGE QUALITY SETTINGS resource definitions +//********************************************************** + + +//---------------------------------------------------- +// +// r_gs_image_quality_print5mlarge +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print5mlarge + { + buf = qtn_lcam_sett_attr_quality_print5mlarge_v2; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print3mlarge +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print3mlarge + { + buf = qtn_lcam_sett_attr_quality_print3mlarge_v2; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print2mlarge +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print2mlarge + { + buf = qtn_lcam_sett_attr_quality_print2mlarge_v2; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print3mmed +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print3mmed + { + buf = qtn_lcam_sett_attr_quality_print3mmed_v2; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print2mmed +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print2mmed + { + buf = qtn_lcam_sett_attr_quality_print2mmed_v2; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print1mmed +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print1mmed + { + buf = qtn_lcam_sett_attr_quality_print1mmed; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print1_3small +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print1_3small + { + buf = qtn_lcam_sett_attr_quality_print1_3small_v2; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print1_0small +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print1_0small + { + buf = qtn_lcam_sett_attr_quality_print1_0small_v2; + } + + +//---------------------------------------------------- +// +// r_gs_image_quality_print0_8small +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_print0_8small + { + buf = qtn_lcam_sett_attr_quality_print0_8med_v2; + } + +//---------------------------------------------------- +// +// r_gs_image_quality_mms +// Image Quality +// +//---------------------------------------------------- +// +RESOURCE TBUF r_gs_image_quality_mms + { + buf = qtn_lcam_sett_attr_quality_mms_v2; + } + +// The following are the resources shared between camera application +// and camera settings pluin refer to \generic\common folder for details +#include "CamSettingsV2.ra" +#include "CamAppWideV2.ra" +#include "CamCapture.ra" +#include "CamCaptureSetupV2.ra" +#include "CamStillCaptureCamcorder.ra" +#include "CamVideoCaptureCamcorder.ra" + + +//End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file provides the information required for building +* GSCamcorderPlugin. +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES + +../group/gscameraplugin.mmp + +PRJ_TESTMMPFILES + +PRJ_EXTENSIONS + +START EXTENSION s60/mifconv +OPTION TARGETFILE camerasettingsplugin.mif +OPTION HEADERFILE camerasettingsplugin.mbg +OPTION SOURCEDIR ../icons +OPTION SOURCEFILE iconlist.txt +END + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/group/gscameraplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/group/gscameraplugin.mmp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* This is project specification file for the camera plug-in for +* General Settings. +* +*/ + + +MACRO CAMERAAPP_PLUGIN_BUILD +#define CAMERAAPP_PLUGIN_BUILD + +#include +#include + +CAPABILITY CAP_ECOM_PLUGIN +TARGET gscameraplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x2000F8E0 +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE GSCamcorderPluginImplementationTable.cpp +SOURCE GSCamcorderPlugin.cpp +SOURCE GSCamcorderPluginContainer.cpp + +SOURCE GSCamcorderSettingsBaseView.cpp +SOURCE GSCamcorderSettingsContainer.cpp + +SOURCE GSCamPhotoSettingsList.cpp +SOURCE GSCamPhotoSettingsView.cpp + +SOURCE GSCamVideoSettingsList.cpp +SOURCE GSCamVideoSettingsView.cpp + +SOURCE GSCamQualitySettingSlider.cpp +SOURCE GSCamQualitySettingContainer.cpp +SOURCE GSCamQualitySettingItem.cpp +SOURCE GSCamQualitySettingPage.cpp +SOURCE GSCustomQualitySettingItem.cpp + +SOURCE CamLocationSettingContainer.cpp +SOURCE CamLocationSettingItem.cpp +SOURCE CamLocationSettingPage.cpp + +SOURCE GSCamDefaultNameSettingItem.cpp +SOURCE GSCamdefaultnamesettingpage.cpp + +SOURCEPATH ../../common/src +SOURCE CamVideoQualityLevel.cpp +SOURCE CamStaticSettingsModel.cpp +SOURCE CamWaitDialog.cpp +SOURCE CamPanic.cpp +SOURCE CamUtility.cpp + +SOURCE CamCaptureSetupListItem.cpp +SOURCE CamCaptureSetupListBoxModel.cpp +SOURCE CamCaptureSetupListBox.cpp +SOURCE CamCaptureSetupListItemDrawer.cpp +SOURCE caminfolistboxitembase.cpp + +SOURCE camconfiguration.cpp +SOURCE camconfigurationutility.cpp + + +USERINCLUDE ../inc +USERINCLUDE ../data +USERINCLUDE ../../common/data +USERINCLUDE ../../common/inc +USERINCLUDE ../../camerauiconfigmanager/inc + +USERINCLUDE ../../inc + +// Default system include paths for application layer modules. +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data + +// ECOM resource definition +START RESOURCE 2000F8E0.rss +TARGET gscameraplugin.rsc +END // ECOM resource definition + +// Plugin resources +START RESOURCE gscamerapluginrsc.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // Plugin resources + +// Plugin resources +START RESOURCE gscamerapluginrscv2.rss +HEADER +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END // Plugin resources + +LANGUAGE_IDS +LIBRARY GSEcomPlugin.lib +LIBRARY PlatformEnv.lib // PathInfo +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY eikcore.lib +LIBRARY commonengine.lib//For RConeResourceLoader +LIBRARY GSFramework.lib +LIBRARY egul.lib // CGulIcon +LIBRARY aknskins.lib // AknsUtils.h +LIBRARY centralrepository.lib +LIBRARY FeatMgr.lib // Feature manager +LIBRARY AknNotify.lib // for CAknGlobalNote.h +LIBRARY AknIcon.lib // AknIconUtils +LIBRARY GSListBox.lib // For CGSListBoxItemTextArray +LIBRARY charconv.lib // utf +LIBRARY commondialogs.lib // CAknMemorySelectionDialog +LIBRARY eikctl.lib +LIBRARY NewService.lib +LIBRARY eikdlg.lib +LIBRARY bitgdi.lib +LIBRARY aknlayout2.lib +LIBRARY aknlayout2scalable.lib +LIBRARY CdlEngine.lib +LIBRARY camerauiconfigmanager.lib + +#ifdef __SERIES60_HELP +LIBRARY hlplch.lib // for "Help" options menu +#endif +LIBRARY fbscli.lib +LIBRARY ws32.lib +LIBRARY imagingconfigmanager.lib +LIBRARY touchfeedback.lib + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +LIBRARY aknlistloadertfx.lib +#endif //RD_UI_TRANSITION_EFFECTS_LIST + +// - used only by Codewarrior for convenience. +DOCUMENT 2000F8E0.rss +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/group/iconlist.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/group/iconlist.txt Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,7 @@ +-c8,8 qgn_lcam_gen_sett_list.svg +-c8,8 qgn_lcam_gen_sett_camera_folder_image.svg +-c8,8 qgn_lcam_gen_sett_camera_folder_video.svg +-1 qgn_lcam_gen_sett_camera_tab_image.svg +-1 qgn_lcam_gen_sett_camera_tab_video.svg + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/icons/qgn_lcam_gen_sett_camera_folder_image.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/icons/qgn_lcam_gen_sett_camera_folder_image.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,143 @@ + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/icons/qgn_lcam_gen_sett_camera_folder_video.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/icons/qgn_lcam_gen_sett_camera_folder_video.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,88 @@ + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/icons/qgn_lcam_gen_sett_camera_tab_image.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/icons/qgn_lcam_gen_sett_camera_tab_image.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,24 @@ + + + + +]> + + + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/icons/qgn_lcam_gen_sett_camera_tab_video.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/icons/qgn_lcam_gen_sett_camera_tab_video.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,24 @@ + + + + +]> + + + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/icons/qgn_lcam_gen_sett_list.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/icons/qgn_lcam_gen_sett_list.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,180 @@ + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamAlbumSettingItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamAlbumSettingItem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item type for "Add to album".* +*/ + + + + +#ifndef CAMALBUMSETTINGITEM_H +#define CAMALBUMSETTINGITEM_H + +// INCLUDES +#include + + +class CAknSingleGraphicPopupMenuStyleListBox; +class CCamStaticSettingsModel; + +/** +* Setting item class similar to standard avkon CAknEnumeratedTextPopupSettingItem. +* Allows the setting list array to be updated dynamically to show a currently selected album +* name. The setting page displays "Yes" and "No options and displays an album selection list +* popup if the user selects the "Yes" option. +* +*/ + +class CCamAlbumSettingItem : public CAknEnumeratedTextPopupSettingItem + { +public: + /** + * Construct a list, storing in it a resource (to be read at 2nd stage construction) + * and a reference to an externally owned integer - the value to be manipulated + * @since 2.8 + * @param aSettingItemId the setting item being constructed + * @param aValue the current value of the item + */ + CCamAlbumSettingItem( TInt aSettingItemId, TInt& aValue ); + + /** + * Destructor + * @since 2.8 + */ + ~CCamAlbumSettingItem(); + +public: // Functions from base classes + + /** + * From MAknSettingPageObserver + * Virtual Method called by framework to handle events in the + * setting page. Used to launch an album selection list. + * @since 2.8 + * @param aSettingPage the setting page reporting the event + * @param aEventType the type of event reported + */ + void HandleSettingPageEventL( CAknSettingPage* aSettingPage, + TAknSettingPageEvent aEventType ); + +public: // New methods + + /** + * Replace the "Yes" text in the setting list with the currently + * selected capture album. Text in the setting page is unchanged. + * @since 2.8 + */ + void UpdateListTextL(); + +private: // Functions from base classes + + /** + * From CAknEnumeratedTextPopupSettingItem + * Virtual Method called by framework to complete the construction. + * Calls UpdateListTextL to set the list text when the item is first + * constructed + * @since 2.8 + */ + void CompleteConstructionL(); + +private: // New methods + + /** + * Launches an album selection list + * @since 2.8 + * @return Whether or not an album was selected from the list + */ + void DisplayAlbumSelectionListL(); + + /** + * Handle situations where the capture album does not exist or a request for + * information on the capture album fails + * @since 2.8 + */ + void HandleAlbumError(); + +private: // data + + // List of Album IDs - One for each unique album name + TBool iAlbumExists; + HBufC* iAlbumTitle; + }; + +#endif // CAMALBUMSETTINGITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamLocationSettingContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamLocationSettingContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,223 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef CAMLOCATIONSETTINGCONTAINER_H +#define CAMLOCATIONSETTINGCONTAINER_H + +// INCLUDES +#include +#include +#include + +#include "MCamAppController.h" +#include "CamSettingValueObserver.h" +#include "CamStaticSettingsModel.h" +// CONSTANTS +const TInt KMaxTextLength = 40; + +// FORWARD DECLARATIONS +class CCamCaptureSetupListBox; +class MAknQueryValue; +class MTouchFeedback; + +// CLASS DECLARATION + +/** +* Implements the location listbox control and descriptive texts +* +* @since 2.8 +*/ +class CCamLocationSettingContainer : public CCoeControl, + public MCamSettingValueObserver, + public MEikListBoxObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aController reference to the app controller + * @param aCaptureMode the current capture mode + * @param aParent this control's parent + * @return pointer to a new quality container + */ + static CCamLocationSettingContainer* NewL( MCamAppController& aController, + TCamCameraMode aCaptureMode, + CCoeControl* aParent ); + + /** + * Destructor. + */ + virtual ~CCamLocationSettingContainer(); + + public: // New functions + + /** + * Returns the selected quality + * @since 2.8 + * @return the selected quality + */ + TInt SelectedValue() const; + + public: // Functions from base classes + + /** + * From CCoeControl + * Constructs the control from a resource + * @since 2.8 + * @param aReader the resource reader + */ + void ConstructFromResourceL( TResourceReader& aReader ); + + /** + * From CCoeControl + * Standard CCoeControl routine to return the number of component controls + * @since 2.8 + * @return the number of component controls + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl + * Standard CCoeControl routine to return the control at a given index + * @since 2.8 + * @param anIndex index at which to return control + * @return the control at the given index + */ + CCoeControl* ComponentControl( TInt anIndex ) const; + + /** + * From CCoeControl + * Draws the controls + * @since 2.8 + * @param aRect the invlaid rect to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl + * Called when the size of the control changes + * @since 2.8 + */ + void SizeChanged(); + + /** + * From CCoeControl + * Offers a key event to the control + * @since 2.8 + * @param aKeyEvent the key event offered + * @param aType the type key event + * @return whether the key was handled + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + /** + * From MCamSettingValueObserver + * Handles a change in the slider value + * @since 2.8 + * @param aNewValue the new value of the setting + */ + void HandleSettingValueUpdateL( TInt aNewValue ); + + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + * @since 2.8 + * @param aController reference to the app controller + * @param aMode the current capture mode + * @param aParent this control's parent + */ + CCamLocationSettingContainer( MCamAppController& aController, + TCamCameraMode aMode, + CCoeControl* aParent ); + + /** + * By default Symbian 2nd phase constructor is private. + * @since 2.8 + */ + void ConstructL(); + + /** + * Reads the listbox layout from a resource file + */ + void ReadListboxLayoutL( TRect& aRect ); + + /** + * Sets up the summary pane detail arrays + * @since 2.8 + * @param aResourceId The resource that defines the summary pane details + */ + void ConstructSummaryDetailsFromResourceL(TInt aResourceId); + + /** + * Draws the summary title and description text + * @since 2.8 + * @param aGc The graphics context to draw to + */ + void DrawSummaryText( CWindowGc& aGc ) const; + /** + * Splits the summary title and description text into multiple lines that fit the status layouts + * @since 2.8 + */ + void SplitCurrentTextL(); + + void ConstructContainerTitleFromResourceL( TInt aResourceId ); + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + /** + * From MEikListBoxObserver + */ + void HandleListBoxEventL(CEikListBox* aListBox, + TListBoxEvent aEventType ); + + private: // Data + // the parent control + CCoeControl* iParent; + // the app controller + MCamAppController& iController; + + // the location mode list box + CCamCaptureSetupListBox* iListBox; + // the capture mode (video/still) + TCamCameraMode iMode; + + // Layout of summary outer region (box) + TAknLayoutRect iSummaryRect; + // Array of all descriptions texts + RPointerArray iDescArray; + // Array of layouts for description lines + RArray iDescLayoutArray; + // Array of split description lines + CArrayFixFlat* iCurrentDescLineArray; + + // The text shown as the title of the container + HBufC16* iTextTitle; + + MTouchFeedback* iFeedback; // not own + TBool iActivateOnTouchRelease; + + }; + +#endif // CAMLOCATIONSETTINGCONTAINER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamLocationSettingItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamLocationSettingItem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item for Location setting item in image settings* +*/ + + + + +#ifndef CAMLOCATIONSETTINGITEM_H +#define CAMLOCATIONSETTINGITEM_H + +// INCLUDES +#include +#include "CamStaticSettingsModel.h" +#include "MCamAppController.h" + +// CLASS DECLARATION + +/** +* Setting item for image/video location texts +* @since 2.8 +*/ +class CCamLocationSettingItem : public CAknEnumeratedTextPopupSettingItem + { + public: // Constructors and destructor + /** + * C++ constructor + * @since 2.8 + * @param aController reference to the controller + * @param aMode current mode (video or still image) + * @param aIdentifier setting page resource id + * @param aValue current name base type + */ + CCamLocationSettingItem( TCamCameraMode aMode, + TInt aIdentifier, + TInt& aValue ); + + /** + * Destructor + */ + virtual ~CCamLocationSettingItem(); + + protected: // Functions from base classes + /** + * From CAknEnumeratedTextPopupSettingItem + * @since 2.8 + * Framework method for constructing the launching setting page. + * @return a constructed CAknSettingPage object on the heap + */ + CAknSettingPage* CreateSettingPageL(); + + /** + * + * Virtual method called by framework to complete the construction. + * In this class, the two arrays, pointers to which can be obtained by calling + * EnumeratedTextArray() and PoppedUpTextArray() are created. + * + */ + void CompleteConstructionL(); + + private: // Data + + // The current mode of capture. + TCamCameraMode iMode; + }; + +#endif // CAMLOCATIONSETTINGITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamLocationSettingPage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamLocationSettingPage.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,192 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for Location setting.* +*/ + + + +#ifndef CAMLOCATIONSETTINGPAGE_H +#define CAMLOCATIONSETTINGPAGE_H + +// INCLUDES +#include +#include "MCamAppController.h" + +// FORWARD DECLARATIONS +class MCamAppController; +class CCamLocationSettingContainer; +class MAknQueryValue; + +// CLASS DECLARATION + +/** +* Setting page for the location control. This setting page is customised +* so that it contains a custom control and not the editor control +* supplied by CAknSettingPage. The base class doesn't allow for custom +* controls to be used in settings pages, so this class provides this +* functionality. +* +* @since 2.8 +*/ + +class CCamLocationSettingPage : public CAknSettingPage + { +public: // Constructors, etc. + /** + * Construct the quality setting page + * @since 2.8 + * @param aMode The current capture mode + * @param aSettingTitleText Text at top of setting pane + * @param aSettingNumber Number at top left (if present) + * @param aControlType Determines the type constructed and how its resource is read + * @param aEditorResourceId Editor resource to use in the setting page (if present) + * @param aSettingPageResourceId Setting Page to use (if present) + * @param aQueryValue reference to a query value object + * @param aController reference tothe application controller + */ + CCamLocationSettingPage( TCamCameraMode aMode, + TDesC& aSettingTitleText, + TInt aSettingNumber, + TInt aControlType, + TInt aEditorResourceId, + TInt aSettingPageResourceId, + MAknQueryValue& aQueryValue, + MCamAppController& aController ); + + /** + * Destructor + * @since 2.8 + */ + ~CCamLocationSettingPage(); + + /** + * Symbian 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + +public: // Functions from base classes + + /** + * From CAknSettingPage + * Called when the state of the quality control changes. + * Used to preview the new setting value + * @since 2.8 + */ + void UpdateSettingL(); + + /** + * From CAknSettingPage + * Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack + * to accept or cancel the pop-up. + * @since 2.8 + * @param aCommandId Event Id from the soft-key + */ + void ProcessCommandL( TInt aCommandId ); + + /** + * From CAknSettingPage + * Puts up a constructed dialog. Part of the non-waiting API calls. + * Activity to perform as soon as the setting page is displayed + * @since 2.8 + * @return Whether check succeeded + */ + TBool PostDisplayCheckL(); + + /** + * From CAknSettingPage + * Used to inform the setting item that a new value has been selected + * @since 2.8 + */ + void SelectCurrentItemL(); + + /** + * From CCoeControl + * Standard Constructs the control from the resource + * @since 2.8 + * @param aReader The resource reader + */ + void ConstructFromResourceL( TResourceReader& aReader ); + + /** + * From CCoeControl + * Standard CCoeControl routine to return the number of component controls + * @since 2.8 + * @return the number of component controls + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl + * Standard CCoeControl routine to return the control at a given index + * @since 2.8 + * @param anIndex index at which to return control + * @return the control at the given index + */ + CCoeControl* ComponentControl( TInt anIndex ) const; + + /** + * From CCoeControl + * Used the draw the setting page + * @since 2.8 + * @param aRect the invalid rect to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl + * Called when the size of the setting page changes + * @since 2.8 + */ + void SizeChanged(); + + /** + * From CCoeControl + * Used to handle key events + * @since 2.8 + * @param aKeyEvent the key event to handle + * @param aType the type of key event + * @return whether the key was handled + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + +private: + /** + * Called when the setting value is to be previewed + * @since 2.8 + * @param aPtr pointer to the object that called the timer + * @return Error code + */ + static TInt PreviewSettingChange( TAny* aPtr ); + +private: // data + // used to inform the setting item of a change in setting page + MAknQueryValue& iQueryValue; + // the custom control (quality container ) used in this setting page + CCamLocationSettingContainer* iLocationContainer; + // reference to the application controller + MCamAppController& iController; + // the current camera mode + TCamCameraMode iMode; + // Used to perform the preview setting change + CPeriodic* iTimer; + // the setting item + TInt iSettingItemId; + // the current value of the setting item + TInt iCurrentVal; + }; + +#endif // CAMLOCATIONSETTINGPAGE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamcorderLocalViewIds.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamcorderLocalViewIds.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ID's for all Camera Plugin Views +* +*/ + + +#ifndef CAMCORDERLOCALVIEWIDS_H +#define CAMCORDERLOCALVIEWIDS_H + +const TUid EGSCamImageSettingsViewId = {50}; +const TUid EGSCamVideoSettingsViewId = {51}; + +#endif //CAMCORDERLOCALVIEWIDS_H +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamDefaultNameSettingItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamDefaultNameSettingItem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item for name base type (date/text)* +*/ + + + + +#ifndef GSCAMDEFAULTNAMESETTINGITEM_H +#define GSCAMDEFAULTNAMESETTINGITEM_H + +// INCLUDES +#include +#include "CamSettingsInternal.hrh" + +/** +* Setting item for name base type (date/text) +* @since 2.8 +*/ +class CGSCamDefaultNameSettingItem : public CAknEnumeratedTextPopupSettingItem + { + public: // Constructors and destructor + /** + * C++ constructor + * @since 2.8 + * @param aNameBase current name base + * @param aMode current mode (video or still image) + * @param aIdentifier setting page resource id + * @param aValue current name base type + */ + CGSCamDefaultNameSettingItem( TDes& aNameBase, + TCamCameraMode aMode, + TInt aIdentifier, + TInt& aValue, + TBool iCamera ); + + /** + * Destructor + */ + virtual ~CGSCamDefaultNameSettingItem(); + + protected: // Functions from base classes + /** + * From CAknEnumeratedTextPopupSettingItem + * @since 2.8 + * Framework method for constructing the launching setting page. + * @return a constructed CAknSettingPage object on the heap + */ + CAknSettingPage* CreateSettingPageL(); + + private: // Data + // Reference to the cuurent name base. + TDes& iNameBase; + // The current mode of capture. + TCamCameraMode iMode; + TBool iCamera; + }; + + +#endif // GSCAMDEFAULTNAMESETTINGITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamPhotoSettingsList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamPhotoSettingsList.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Photo settings list class +* +*/ + + + +#ifndef GSCAMPHOTOSETTINGSLIST_H +#define GSCAMPHOTOSETTINGSLIST_H + +// INCLUDES +#include // for feature definitions +#include // CAknSettingItemList +#include +#include +#include "CamStaticSettingsModel.h" +#include "GSCamcorderPlugin.hrh" + + +// FORWARD DECLARATIONS +class CGSCamSettingsModel; +class CGSCamcorderPlugin; + +class CCamWaitDialog; + +/** +* Image settings list class +*/ +class CGSCamPhotoSettingsList : public CAknSettingItemList + + { + public: // Constructors and destructor + /** + * C++ constructor. + * @since 2.1 + * @param aController reference to CCcorController + */ + CGSCamPhotoSettingsList( CCamStaticSettingsModel& aModel ); + + /** + * Symbian 2nd phase constructor + * @since 2.1 + */ + void ConstructL( TBool aLaunchedFromGS, + TBool aSecondaryCameraSettings ); + + /** + * Destructor. + */ + virtual ~CGSCamPhotoSettingsList(); + + + public: // Functions of base classes + /** + * From CAknSettingItemList + * Launch the setting page for the current item by calling + * EditItemL on it. + */ + void EditItemL( TInt aIndex, TBool aCalledFromMenu ); + + /** + * From CCoeControl set the size and position of its component controls. + */ + void SizeChanged(); + + + private: // Functions from base classes + /** + * From CAknSettingItemList Handles creating setting items + * @param aIdentifier Identifier of the setting item to create + */ + CAknSettingItem* CreateSettingItemL( TInt aIdentifier ); + + /** + * Returns the current value of a setting for this list. + * @since 2.8 + * @param aItemId The id of the setting in question + * @return the current value. + */ + TInt ValueOfSetting( TInt aItemId ) const; + + /** + * Returns the array index of a setting for this list. + * @since 2.8 + * @param aItemId The id of the setting in question + * @return the array index. + */ + TInt IndexOfSetting( TInt aItemId ) const; + + + private: // Data + + // Store values for the different settings. + RPointerArray iSettings; + TInt iQualityValue; + RArray iSupportedQualityLevels; + TBool iLaunchedFromGS; + TBool iSecondaryCameraSettings; + + // Used to store memory value. Required by the CAknMemorySelectionSettingItemMultiDrive. + DriveInfo::TDefaultDrives iMemVal; + TDriveNumber iDrive; + + CCamStaticSettingsModel& iModel; + // The default name base. + TBuf iDefaultNameBase; + + CCamWaitDialog* iWaitDialog; + // Index of the setting item which is active + TInt iIndex; + // Flag to check if the Wait note is active + TBool iWaitNoteActive; + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamPhotoSettingsView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamPhotoSettingsView.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Photo settings view +* +*/ + + + +#ifndef GSCAMPHOTOSETTINGSVIEW_H +#define GSCAMPHOTOSETTINGSVIEW_H + +// INCLUDES +#include +#include +#include +#include "GSCamcorderSettingsBaseView.h" + +// CONSTANTS + +// FORWARD DECLARATIONS +class CGSTabHelper; +class MGSTabbedView; + +// CLASS DECLARATION + +/** +* Image settings page view class. +* @since 2.1 +*/ +class CGSCamPhotoSettingsView : public CGSCamcorderSettingsBaseView, + public MGSTabbedView + + { + public: // Constructors and destructor + /** + * Symbian two-phased constructor. + * @since 3.1 + * @param aTabViewArray reference to tab viewarray + */ + static CGSCamPhotoSettingsView* NewLC( + CCamStaticSettingsModel& aModel, + CArrayPtrFlat* aTabViewArray ); + + /** + * Destructor. + */ + virtual ~CGSCamPhotoSettingsView(); + + /** + * Creates new icon for tab. Ownership is transferred to client. + * @since 3.1 + */ + CGulIcon* CreateTabIconL(); + + + private: // Functions from base classes + + /** + * From CAknView returns Uid of View + * @return TUid uid of the view + */ + TUid Id() const; + + /** + * From CAknView, handle commands + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * From CAknView Activate this view + * @param aPrevViewId + * @param aCustomMessageId + * @param aCustomMessage + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * From CAknView Deactivate this view + */ + void DoDeactivate(); + + private: + /** + * C++ default constructor. + * @since 3.1 + * @param aController Reference to either the application controller base class or test base class + */ + CGSCamPhotoSettingsView( CCamStaticSettingsModel& aModel ); + + /** + * Symbian 2nd phase constructor. + * @since 3.1 + * @param aTabViewArray reference to tab viewarray + */ + void ConstructL( CArrayPtrFlat* aTabViewArray ); + + private: // Data + CGSTabHelper* iTabHelper; + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamQualitySettingContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamQualitySettingContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,305 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements the quality slider for image and video settings* +*/ + + +#ifndef GSCAMQUALITYSETTINGCONTAINER_H +#define GSCAMQUALITYSETTINGCONTAINER_H + +// INCLUDES +#include +#include +#include +#include "CamSettingValueObserver.h" +#include "GSCamQualitySettingSlider.h" +#include "CamControllerObservers.h" + +// CONSTANTS +const TInt KMaxTextLength = 40; + +// FORWARD DECLARATIONS +class CCamCaptureSetupSlider; +class MAknQueryValue; + +class CCamConfiguration; +class MTouchFeedback; + +enum TCamCameraStateFlags + { + ECamIdle = 0, + ECamReserved = 1<<0, + ECamPowerOn = 1<<1, + ECamVFOn = 1<<2, + ECamImageOn = 1<<3, + ECamVideoOn = 1<<4 +// ECamCaptureOn = 1<<5 + }; +/** +* Implements the quality slider control and descriptive texts +* +* @since 2.8 +*/ +class CGSCamQualitySettingContainer : public CCoeControl, + public MCamSettingValueObserver, + public MCamControllerObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aController reference to the app controller + * @param aMode the current capture mode + * @param aParent this control's parent + * @return pointer to a new quality container + */ + static CGSCamQualitySettingContainer* NewL( MCamAppController& aController, + TCamCameraMode aMode, + CCoeControl* aParent ); + + /** + * Destructor. + */ + virtual ~CGSCamQualitySettingContainer(); + + public: // New functions + + /** + * Returns the selected quality + * @since 2.8 + * @return the selected quality + */ + TInt SelectedQuality() const; + + public: // Functions from base classes + + /** + * From CCoeControl + * Constructs the control from a resource + * @since 2.8 + * @param aReader the resource reader + */ + void ConstructFromResourceL( TResourceReader& aReader ); + + /** + * From CCoeControl + * Standard CCoeControl routine to return the number of component controls + * @since 2.8 + * @return the number of component controls + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl + * Standard CCoeControl routine to return the control at a given index + * @since 2.8 + * @param anIndex index at which to return control + * @return the control at the given index + */ + CCoeControl* ComponentControl( TInt anIndex ) const; + + /** + * From CCoeControl + * Draws the controls + * @since 2.8 + * @param aRect the invlaid rect to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl + * Called when the size of the control changes + * @since 2.8 + */ + void SizeChanged(); + + /** + * From CCoeControl + * Offers a key event to the control + * @since 2.8 + * @param aKeyEvent the key event offered + * @param aType the type key event + * @return whether the key was handled + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + /** + * From MCamSettingValueObserver + * Handles a change in the slider value + * @since 2.8 + * @param aNewValue the new value of the setting + */ + void HandleSettingValueUpdateL( TInt aNewValue ); + + public: // From MCamControllerObserver + /** + * From MCamControllerObserver + * Handles an event from the controller + * @since 2.8 + * @param aEvent the event that the controller sends out + * @param aError KErrNone if the operation that cause the event was successful + */ + void HandleControllerEventL( TCamControllerEvent aEvent, TInt aError ); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + * @since 2.8 + * @param aController reference to the app controller + * @param aMode the current capture mode + * @param aParent this control's parent + */ + CGSCamQualitySettingContainer( MCamAppController& aController, + TCamCameraMode aMode, + CCoeControl* aParent ); + + /** + * By default Symbian 2nd phase constructor is private. + * @since 2.8 + */ + void ConstructL(); + + /** + * Reads the layout from a resource file + * @since 2.8 + */ + void ReadLayoutL(); + + /** + * Draws the quality description texts for image/video + * @since 2.8 + * @param aGc The graphics context to draw to + */ + void DrawQualityTexts( CWindowGc& aGc, TRgb aColor ) const; + + /** + * Draws the storage icon for image/video + * @since 2.8 + * @param aGc The graphics context to draw to + */ + void DrawStorageIcon( CWindowGc& aGc ) const; + + /** + * Draws the remaining image count/video time remaining + * @since 2.8 + * @param aGc The graphics context to draw to + */ + void DrawRemainingText( CWindowGc& aGc ) const; + + /** + * Queries the controller to update the remaining time text + * @since 2.8 + */ + void UpdateRemainingTextL(); + + /** + * Resets the remaing time/images text. + */ + void ResetRemainingTextL(); + + /** + * Populates a text array from the resource definition of available + * quality texts using the supported quality values + * @since 3.0 + * @param aReader the resource reader with the array of available texts + * @param aArray the array to populate + */ + void ReadInTextArrayL( TResourceReader& aReader, CDesCArrayFlat& aArray ); + + public: // Data + + protected: // Data + + private: // Data + // the app controller interface + MCamAppController& iController; + + // the parent control + CCoeControl* iParent; + // the selected quality settings + TInt iSelectedQuality; + // phone storage location bitmap + CFbsBitmap* iPhoneIcon; + // phone storage location mask + CFbsBitmap* iPhoneIconMask; + // MMC storage location bitmap + CFbsBitmap* iMMCIcon; + // MMC storage location mask + CFbsBitmap* iMMCIconMask; + // mass storage storage location bitmap + CFbsBitmap* iMassStorageIcon; + // mass storage storage location mask + CFbsBitmap* iMassStorageIconMask; + // The text in the title pane + HBufC* iTextTitle; + // The subtitle text at top of page + HBufC* iTextTopSubtitle; + // The subtitle text at bottom of page + HBufC* iTextBottomSubtitle; + // The title for the remaining time text + HBufC* iTextRemainingTitle; + // The remaining count/time text + TBuf iTextRemaining; + // Format string for remaining time + HBufC* iTimeFormat; + + // Array of all quality titles + CDesCArrayFlat* iTitleArray; + // Array of all quality descriptions + CDesCArrayFlat* iDescArray; + // Array of the enumeration mapping to the titles + RArray iEnumArray; + // Array of quality description lines + CArrayFixFlat* iCurrentDescLineArray; + // The layout of the quality title + TAknLayoutText iLayoutSettingTitle; + // the layout for the rect containing all description text + TAknLayoutRect iLayoutDescRect; + // Array of layouts for each of the lines in the quality decription + RArray iLayoutSettingDescLines; + // The layout for the remaining title text + TAknLayoutText iLayoutRemainingTitle; + // The layout for the remaining images/video time + TAknLayoutText iLayoutRemainingText; + // The layout for the storage icon + TAknLayoutRect iLayoutIcon; + // The slider control + CGSCamQualitySettingSlider* iSlider; + // The current capture mode (video/still) + TCamCameraMode iMode; + // The current storage location + TCamMediaStorage iStorageLocation; + + // Array of supported qualities + RArray iSupportedQualitiesArray; + + // ETrue if remaining video recording time for current video quality + // is known, so remaining time and storage icon can be drawn. + TBool iRemainingVideoTimeKnown; + + // Configuration Manager + CCamConfiguration* iConfiguration; + + MTouchFeedback* iFeedback; // not own + }; + +#endif // GSCAMQUALITYSETTINGCONTAINER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamQualitySettingItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamQualitySettingItem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item for image/video quality* +*/ + + + + +#ifndef GSCAMQUALITYSETTINGITEM_H +#define GSCAMQUALITYSETTINGITEM_H + +// INCLUDES +#include +#include "CamSettingsInternal.hrh" + + +class CCamStaticSettingsModel; + +/** +* Setting item for image/video quality texts +* @since 2.8 +*/ +class CGSCamQualitySettingItem : public CAknEnumeratedTextPopupSettingItem + { + public: // Constructors and destructor + /** + * C++ constructor + * @since 2.8 + * @param aMode current mode (video or still image) + * @param aIdentifier setting page resource id + * @param aValue current name base type + */ + CGSCamQualitySettingItem( TCamCameraMode aMode, + TInt aIdentifier, + TInt& aValue, + CCamStaticSettingsModel& aModel ); + + /** + * Destructor + */ + virtual ~CGSCamQualitySettingItem(); + + protected: // Functions from base classes + /** + * From CAknEnumeratedTextPopupSettingItem + * @since 2.8 + * Framework method for constructing the launching setting page. + * @return a constructed CAknSettingPage object on the heap + */ + CAknSettingPage* CreateSettingPageL(); + + /** + * + * Virtual method called by framework to complete the construction. + * In this class, the two arrays, pointers to which can be obtained by calling + * EnumeratedTextArray() and PoppedUpTextArray() are created. + * + */ + void CompleteConstructionL(); + + private: // Data + // The current mode of capture. + TCamCameraMode iMode; + // Array of supported quality levels + RArray iSupportedQualitiesArray; + + CCamStaticSettingsModel& iModel; + }; + +#endif // GSCAMQUALITYSETTINGITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamQualitySettingPage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamQualitySettingPage.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for Image/Video quality.* +*/ + + + +#ifndef GSCAMQUALITYSETTINGPAGE_H +#define GSCAMQUALITYSETTINGPAGE_H + +// INCLUDES +#include +#include "CamSettingsInternal.hrh" + +// FORWARD DECLARATIONS +class CGSCamQualitySettingContainer; +class MAknQueryValue; +class MCamAppController; + +// CLASS DECLARATION + +/** +* Setting page for the quality control. This setting page is customised +* so that it contains a custom control and not the editor control +* supplied by CAknSettingPage. The base class doesn't allow for custom +* controls to be used in settings pages, so this class provides this +* functionality. +* +* @since 2.8 +*/ + +class CGSCamQualitySettingPage : public CAknSettingPage + { +public: // Constructors, etc. + /** + * Construct the quality setting page + * @since 2.8 + * @param aMode The current capture mode + * @param aSettingTitleText Text at top of setting pane + * @param aSettingNumber Number at top left (if present) + * @param aControlType Determines the type constructed and how its resource is read + * @param aEditorResourceId Editor resource to use in the setting page (if present) + * @param aSettingPageResourceId Setting Page to use (if present) + * @param aQueryValue reference to a query value object + */ + CGSCamQualitySettingPage( TCamCameraMode aMode, + TDesC& aSettingTitleText, + TInt aSettingNumber, + TInt aControlType, + TInt aEditorResourceId, + TInt aSettingPageResourceId, + MAknQueryValue& aQueryValue ); + + /** + * Destructor + * @since 2.8 + */ + ~CGSCamQualitySettingPage(); + + /** + * Symbian 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + +public: // Functions from base classes + + /** + * From CAknSettingPage + * Called when the state of the quality control changes. + * Used to preview the new setting value + * @since 2.8 + */ + void UpdateSettingL(); + + /** + * From CAknSettingPage + * Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack + * to accept or cancel the pop-up. + * @since 2.8 + * @param aCommandId Event Id from the soft-key + */ + void ProcessCommandL( TInt aCommandId ); + + /** + * From CAknSettingPage + * Puts up a constructed dialog. Part of the non-waiting API calls. + * Activity to perform as soon as the setting page is displayed + * @since 2.8 + * @return Whether check succeeded + */ + TBool PostDisplayCheckL(); + + /** + * From CAknSettingPage + * Used to inform the setting item that a new value has been selected + * @since 2.8 + */ + void SelectCurrentItemL(); + + /** + * From CCoeControl + * Standard Constructs the control from the resource + * @since 2.8 + * @param aReader The resource reader + */ + void ConstructFromResourceL( TResourceReader& aReader ); + + /** + * From CCoeControl + * Standard CCoeControl routine to return the number of component controls + * @since 2.8 + * @return the number of component controls + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl + * Standard CCoeControl routine to return the control at a given index + * @since 2.8 + * @param anIndex index at which to return control + * @return the control at the given index + */ + CCoeControl* ComponentControl( TInt anIndex ) const; + + /** + * From CCoeControl + * Used the draw the setting page + * @since 2.8 + * @param aRect the invalid rect to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl + * Called when the size of the setting page changes + * @since 2.8 + */ + void SizeChanged(); + + /** + * From CCoeControl + * Used to handle key events + * @since 2.8 + * @param aKeyEvent the key event to handle + * @param aType the type of key event + * @return whether the key was handled + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + +private: + /** + * Called when the setting value is to be previewed + * @since 2.8 + * @param aPtr pointer to the object that called the timer + * @return Error code + */ + static TInt PreviewSettingChange( TAny* aPtr ); + +private: // data + // used to inform the setting item of a change in setting page + MAknQueryValue& iQueryValue; + // the app controller + MCamAppController& iController; + // the current capture mode + TCamCameraMode iMode; + // Used to perform the preview setting change + CPeriodic* iTimer; + // the custom control (quality container ) used in this setting page + CGSCamQualitySettingContainer* iQualityContainer; + // the setting item + TInt iSettingItemId; + // the current value of the setting item + TInt iCurrentVal; + }; + +#endif // GSCAMQUALITYSETTINGPAGE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamQualitySettingSlider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamQualitySettingSlider.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,360 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for showing the EV slider* +*/ + + + +#ifndef __CGSCAMQUALITYSETTINGSLIDER_H +#define __CGSCAMQUALITYSETTINGSLIDER_H + +// INCLUDES +#include +#include // for TAknLayoutText +#include "CamPSI.h" // For Product Specific Information +#include "CamSettingsInternal.hrh" +#include "CamSettings.hrh" +#include "GSCamcorderPlugin.hrh" +#include "Cam.hrh" +#include "CamSettingValueObserver.h" + +// CONSTANTS +// The maximum number of divisions required for the quality slider. +#define BITMAP_SHAFT_MAX_DIVISIONS 6 + +class CCamConfiguration; + + +/** +* Utility class used to group together related layout information into one +* object, and construct itself using a supplied resource reader. +* +* @since 2.8 +*/ +class CCamSliderLegend : public CBase + { + +public: + + ~CCamSliderLegend(); + + /** + * Constructs the layout information for the object + * @since 3.0 + * @param aLayoutRect Layout for the icon + * @param aBitmap Bitmap ID + * @param aMask Mask ID + */ + void ConstructL( const TAknLayoutRect& aLayoutRect, + TInt aBitmap, TInt aMask ); + + /** + * Draws the legend + * @since 2.8 + * @param aGc The window contest to use for the drawing + */ + void Draw( CWindowGc& aGc ) const; + + /** + * Returns the rect for the legend + * @since 2.8 + * @return The rect for the legend + */ + TRect Rect() const; + +private: + TCamSliderLegendItem iItem; + TAknLayoutText iPosition; + HBufC* iText; + TAknLayoutRect iIconRect; + CFbsBitmap* iBitmap; + CFbsBitmap* iMask; + }; + + + +/** +* Slider for showing Quality level settings +* +* @since 2.8 +*/ +class CGSCamQualitySettingSlider : public CCoeControl + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CGSCamQualitySettingSlider* NewL( const CCoeControl* aParent, + MCamSettingValueObserver* aObserver, + TCamSettingItemIds aSettingType, + TInt aSteps, + CCamConfiguration* aConfiguration + ); + + /** + * Destructor. + */ + virtual ~CGSCamQualitySettingSlider(); + + public: // New functions + + /** + * Sets up the range and initial value of the slider + * @since 2.8 + * @param aValue The value to start with on the slider. + */ + void InitializeL( TInt aValue, + HBufC* aTopSubtitle, + HBufC* aBottomSubtitle ); + + /** + * Returns the minium slider value + * @since 2.8 + * @return The minimum slider value + */ + TInt MinValue() const; + + /** + * Returns the maximum slider value + * @since 2.8 + * @return The maximum slider value + */ + TInt MaxValue() const; + + /** + * Sets the minimum and maximum values of the slider control + * @since 3.0 + * @param aMin The minimum slider value + * @param aMax The maximum slider value + */ + void SetRange( TInt aMin, TInt aMax ); + + public: // Functions from base classes + + /** + * From CCoeControl + * @since 2.8 + * @param aRect Rect indicating the specific area to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl + * @since 2.8 + * @param aKeyEvent Details of the key event + * @param aType The keypress type + * @return TKeyResponse whether the key event was handled or ignored + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) ; + + /** + * From CCoeControl + * @since 2.8 + * @return The minimum size required for the control to display + */ + TSize MinimumSize(); + + /** + * From CCoeControl + * @since 2.8 + */ + void SizeChanged(); + + /** + * From CCoeControl + * @ + */ + void HandlePointerEventL(const TPointerEvent& aPointerEvent); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CGSCamQualitySettingSlider( MCamSettingValueObserver* aObserver, + TCamSettingItemIds aSettingType, + TInt aSteps, + CCamConfiguration* aConfiguration ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const CCoeControl* aParent ); + + /** + * Called to read the layout information from a resource + * @since 2.8 + */ + void ReadLayoutL(); + + /** + * Read touch layout + */ + void TouchLayoutVideo(); + + /** + * Read nontouch layout + */ + void NonTouchLayoutVideo(); + + /** + * Read touch layout + */ + void TouchLayoutPhoto(); + + /** + * Read nontouch layout + */ + void NonTouchLayoutPhoto(); + + /** + * Appends legends to iLegendArray by Product Specific Information key + * @since 5.0 + * @param aKey, Product Specific Information key + * @param aNumSliderValues, number of slider values + */ + void AppendLegendArrayL( TCamPsiKey aKey, TInt aNumSliderValues = 0 ); + + /** + * Get layout for video/image quality legend icons + * @since S60 v5.0 + * @param aParentRect Parent rectangle + * @param aSettingType Setting type + * @param aIndex Item index + * @return Layout rect that has the correct layout set + */ + TAknLayoutRect GetTouchVideoLegendLayout( + const TRect& aParentRect, + TInt aIndex ) const; + + /** + * Get layout for video/image quality legend icons + * @since S60 v5.0 + * @param aParentRect Parent rectangle + * @param aSettingType Setting type + * @param aIndex Item index + * @return Layout rect that has the correct layout set + */ + TAknLayoutRect GetNonTouchVideoLegendLayout( + const TRect& aParentRect, + TInt aIndex ) const; + + /** + * Get layout for video/image quality legend icons + * @since S60 v5.0 + * @param aParentRect Parent rectangle + * @param aSettingType Setting type + * @param aIndex Item index + * @return Layout rect that has the correct layout set + */ + TAknLayoutRect GetTouchPhotoLegendLayout( + const TRect& aParentRect, + TInt aIndex ) const; + + /** + * Get layout for three image quality legend icons + * @since S60 v5.0 + * @param aParentRect Parent rectangle + * @param aSettingType Setting type + * @param aIndex Item index + * @return Layout rect that has the correct layout set + */ + TAknLayoutRect GetNonTouchPhotoLegend3Layout( + const TRect& aParentRect, + TInt aIndex ) const; + + /** + * Get layout for five image quality legend icons + * @since S60 v5.0 + * @param aParentRect Parent rectangle + * @param aSettingType Setting type + * @param aIndex Item index + * @return Layout rect that has the correct layout set + */ + TAknLayoutRect GetNonTouchPhotoLegend5Layout( + const TRect& aParentRect, + TInt aIndex ) const; + + /** + * Counts quality setting steps. Available layouts are for three and + * five steps. + * @return TBool, ETrue if count is three or less + */ + TBool IsThreeTicksSlider() const; + + public: // Data + + protected: // Data + + private: // Data + + // Bitmaps for the slider "shaft" + CFbsBitmap* iBitmapShafts[BITMAP_SHAFT_MAX_DIVISIONS+1]; + CFbsBitmap* iBitmapShaftsMasks[BITMAP_SHAFT_MAX_DIVISIONS+1]; + + // Current level to be indicated by the slider + TInt iValue; + + // Pointer to the observer of slider events + MCamSettingValueObserver* iSettingObserver; + + // The values that + RPointerArray iLegendArray; + + // Layout structure for the Shaft + TAknLayoutRect iShaftLayout; + + // The minimum size the control requires to be drawn + TSize iMinimumSize; + + // The parent control of the slider + const CCoeControl* iParentControl; + + // The maximum slider value + TInt iMaxSliderValue; + + // The minium slider value + TInt iMinSliderValue; + + // the number of slider values + TInt iNumSliderValues; + + // Identifies which setting is being edited + TCamSettingItemIds iSettingType; + + // number of slider steps + TInt iSteps; + + // Configuration manager + CCamConfiguration* iConfiguration; + + // The subtitle text at top of page + HBufC* iTopSubtitle; + // The subtitle text at bottom of page + HBufC* iBottomSubtitle; + // The layout for the subtitle text at top + TAknLayoutText iLayoutSubtitleTop; + // The layout for the subtitle text at bottom of page + TAknLayoutText iLayoutSubtitleBottom; + + }; + +#endif // __CGSCAMQUALITYSETTINGSLIDER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamVideoQualityLevel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamVideoQualityLevel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container class for video qulaity data* +*/ + + + +#ifndef GSCAMVIDEOQUALITYLEVEL_H +#define GSCAMVIDEOQUALITYLEVEL_H + +// INCLUDES +#include +#include "camconfigurationtypes.h" + + +// CLASS DECLARATION + +/** +* Container class to hold video quality settings +* Read in from resource file +* +* @since 2.8 +*/ +class CGSCamVideoQualityLevel : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aReader resource reader for video quality level resources + * @return pointer to instances of CGSCamVideoQualityLevel + */ + static CGSCamVideoQualityLevel* NewL( TResourceReader& aReader ); + + /** + * Two-phased constructor. + * @param aReader resource reader for video quality level resources + * @param aVariantFlags The flags to specify operator variants + * @return pointer to instances of CGSCamVideoQualityLevel + */ + static CGSCamVideoQualityLevel* NewL( TVideoQualitySettings& aSettings ); + + /** + * Destructor. + */ + virtual ~CGSCamVideoQualityLevel(); + + public: // New functions + + /** + * Return video resolution associated with this quality level + * @since 2.8 + * @return Video resolution + */ + TVideoResolution VideoResolution(); + + /** + * Return video frame rate associated with this quality level + * @since 2.8 + * @return Video frame rate + */ + TReal FrameRate(); + + /** + * Return video bitrate associated with this quality level + * @since 2.8 + * @return Video bitrate + */ + TInt VideoBitRate(); + + /** + * Return audio bitrate associated with this quality level identifier + * @since 2.8 + * @return audio bitrate + */ + TInt AudioBitRate(); + + /** + * Return mime type required associated with this video quality level + * @since 2.8 + * @return descriptor containing mime type + */ + TPtrC8 VideoMimeType(); + + /** + * Return preferred supplier value associated with this video quality level + * @since 2.8 + * @return descriptor containing preferred supplier + */ + TPtrC PreferredSupplier(); + + /** + * Return video codec associated with this video quality level + * @since 2.8 + * @return descriptor containing codec + */ + TPtrC8 VideoFileType(); + + /** + * Return audio codec associated with this video quality level + * @since 2.8 + * @return descriptor containing audio codec + */ + TPtrC8 AudioType(); + + /** + * Return file type identier associated with this video quality level + * either Mpeg4 or 3GP + * @since 2.8 + * @return flags + */ + TInt VideoType(); + + /** + * Return file length associated with this video quality level + * either max or short + * @since 2.8 + * @return flags + */ + TInt VideoLength(); + + /** + * Return video quality level + * @since 3.0 + * @return quality level value + */ + TInt VideoQuality(); + + private: + + /** + * C++ default constructor. + */ + CGSCamVideoQualityLevel(); + + /** + * By default Symbian 2nd phase constructor is private. + * @param aReader resource reader for video quality level resources + * @param aVariantFlags The flags to specify operator variants + */ + void ConstructL( TVideoQualitySettings& aSettings ); + + /** + * By default Symbian 2nd phase constructor is private. + * @param aReader resource reader for video quality level resources + * @param aVariantFlags The flags to specify operator variants + */ + void ConstructFromResourceL( TResourceReader& aReader ); + + private: + /** + * Reads an LTEXT element from resources and returns + * it as HBufC8. + * @since 2.8 + * @param aReader Resource reader to read descriptor from + * @return HBufC8 containing string read from resource + */ + HBufC8* ReadHBufC8L( TResourceReader& aReader ) const; + + private: // Data + // Identifer + TInt iQualityLevel; + // Video reoslution + TVideoResolution iVideoResolution; + // Video Frame rate + TReal iVideoFrameRate; + // Video bit rate + TInt iVideoBitRate; + // Audio bit rate + TInt iAudioBitRate; + // Video mime type + HBufC8* iVideoMimeType; + // Preferred supplier + HBufC* iPreferredSupplier; + // Video file type + HBufC8* iVideoCodec; + // Audio codec + HBufC8* iAudioCodec; + // video type identifier (MPeg4 or 3GP) + TInt iVideoFileType; + // video length (max or short) + TInt iVideoLength; + }; + +#endif // GSCAMVIDEOQUALITYLEVEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamVideoSettingsList.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamVideoSettingsList.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Video settings list class +* +*/ + + + +#ifndef GSCAMVIDEOSETTINGSLIST_H +#define GSCAMVIDEOSETTINGSLIST_H + +// INCLUDES + +#include // for feature definitions + +#include // CAknSettingItemList +#include +#include + +#include "CamStaticSettingsModel.h" +#include "GSCamcorderPlugin.hrh" + +// FORWARD DECLARATIONS +class CCamStaticSettingsModel; +class CGSCamcorderPlugin; + +class CCamWaitDialog; + + +/** +* Image settings list class +*/ +class CGSCamVideoSettingsList : public CAknSettingItemList + + { + public: // Constructors and destructor + /** + * C++ constructor. + * @since 2.1 + * @param aController reference to CCcorController + */ + CGSCamVideoSettingsList( CCamStaticSettingsModel& aModel ); + + /** + * Symbian 2nd phase constructor + * @since 2.1 + */ + void ConstructL( TBool aLaunchedFromGS, + TBool aSecondaryCameraSettings ); + + /** + * Destructor. + */ + virtual ~CGSCamVideoSettingsList(); + + + public: // Functions of base classes + /** + * From CAknSettingItemList + * Launch the setting page for the current item by calling + * EditItemL on it. + */ + void EditItemL( TInt aIndex, TBool aCalledFromMenu ); + + /** + * From CCoeControl set the size and position of its component controls. + */ + void SizeChanged(); + + + private: // Functions from base classes + /** + * From CAknSettingItemList Handles creating setting items + * @param aIdentifier Identifier of the setting item to create + */ + CAknSettingItem* CreateSettingItemL( TInt aIdentifier ); + + /** + * Returns the current value of a setting for this list. + * @since 2.8 + * @param aItemId The id of the setting in question + * @return the current value. + */ + TInt ValueOfSetting( TInt aItemId ) const; + + /** + * Returns the array index of a setting for this list. + * @since 2.8 + * @param aItemId The id of the setting in question + * @return the array index. + */ + TInt IndexOfSetting( TInt aItemId ) const; + + + private: // Data + // Store values for the different settings. + RPointerArray iSettings; + // Array of supported quality levels + RArray iSupportedVideoQualities; + + TInt iQualityValue; + TBool iLaunchedFromGS; + TBool iSecondaryCameraSettings; + TBuf iDefaultNameBase; + + // Used to store memory value. Required by the CAknMemorySelectionSettingItemMultiDrive. + DriveInfo::TDefaultDrives iMemVal; + TDriveNumber iDrive; + + CCamStaticSettingsModel& iModel; + CCamWaitDialog* iWaitDialog; + // Index of the setting item which is active + TInt iIndex; + // Flag to check if the Wait note is active + TBool iWaitNoteActive; + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamVideoSettingsView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamVideoSettingsView.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Video settings view +* +*/ + + + +#ifndef GSCAMVIDEOSETTINGSVIEW_H +#define GSCAMVIDEOSETTINGSVIEW_H + +// INCLUDES +#include +#include +#include +#include "GSCamcorderSettingsBaseView.h" + +// CONSTANTS + +// FORWARD DECLARATIONS +class CGSTabHelper; +class MGSTabbedView; + +// CLASS DECLARATION + +/** +* Image settings page view class. +* @since 2.1 +*/ +class CGSCamVideoSettingsView : public CGSCamcorderSettingsBaseView, + public MGSTabbedView + + { + public: // Constructors and destructor + /** + * Symbian two-phased constructor. + * @since 3.1 + * @param aTabViewArray reference to tab viewarray + */ + static CGSCamVideoSettingsView* NewLC( + CCamStaticSettingsModel& aModel, + CArrayPtrFlat* aTabViewArray ); + + /** + * Destructor. + */ + virtual ~CGSCamVideoSettingsView(); + + /** + * Creates new icon for tab. Ownership is transferred to client. + * @since 3.1 + */ + CGulIcon* CreateTabIconL(); + + private: // Functions from base classes + + /** + * From CAknView returns Uid of View + * @return TUid uid of the view + */ + TUid Id() const; + + + /** + * From CAknView, handle commands + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * From CAknView Activate this view + * @param aPrevViewId + * @param aCustomMessageId + * @param aCustomMessage + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * From CAknView Deactivate this view + */ + void DoDeactivate(); + + private: + /** + * C++ constructor. + * @since 3.1 + */ + CGSCamVideoSettingsView( CCamStaticSettingsModel& aModel ); + + /** + * Symbian 2nd phase constructor. + * @since 3.1 + * @param aTabViewArray reference to tab viewarray + */ + void ConstructL(CArrayPtrFlat* aTabViewArray); + + private: // Data + CGSTabHelper* iTabHelper; + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamcorderPlugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamcorderPlugin.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,313 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef GS_CAMCORDERGSPLUGIN_H +#define GS_CAMCORDERGSPLUGIN_H + +// Includes +#include +#include +#include +#include +#include +#include "CamStaticSettingsModel.h" + +// Classes referenced +class CGSCamcorderPluginContainer; +class CAknViewAppUi; +class CGSBaseView; +class MGSTabbedView; +class CCamStaticSettingsModel; +class CCamConfiguration; + + +// Constants +_LIT(KDirAndFile,"z:\\resource\\apps\\camerasettingsplugin.mif"); + +/** +* UPDATE THIS: +* +* This UID is used for both the view UID and the ECOM plugin implementation +* UID. +*/ +const TUid KGSCamcorderGSPluginUid = { 0x2000F8E0 }; + +_LIT( KGSCamcorderPluginResourceFileName, "z:\\resource\\gscamerapluginrsc.rsc" ); +_LIT( KGSCamcorderPluginResourceFileNamev2, "z:\\resource\\gscamerapluginrscv2.rsc" ); + +// CLASS DECLARATION + +/** +* CGSCamcorderPlugin view class. +* +* This is an CamcorderGS of the minimal GS plugin.CGSPluginInterface +*/ +class CGSCamcorderPlugin : public CGSBaseView + { + + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @return + * @since 3.1 + */ + static CGSCamcorderPlugin* NewL( TAny* aInitParams ); + + /** + * Destructor. + */ + ~CGSCamcorderPlugin(); + + + public: // Functions from base classes + + /** + * From CAknView, returns the views id. + * @return Returns id of the view. + * @since 3.1 + */ + TUid Id() const; + + /** + * From MEikCommandObserver, handles the menu based commands. + * @param aCommand identifies the given command. + * @since 3.1 + */ + void HandleCommandL( TInt aCommand ); + + /** + * Updates specific value to container + * @param aListItem item index to update + * @param aNewValue new value for the setting + * @since 3.1 + */ + void UpdateListBoxL( const TInt& aListItem, TInt aNewValue ); + + public: // From CGSPluginInterface + + /* + * Check whether this view been lauched from General Settings. + */ + TBool LaunchedFromGS() const; + + /** + * Method for getting caption of this plugin. This should be the + * localized name of the settings view to be shown in parent view. + * @param aCaption pointer to Caption variable + * @since 3.1 + */ + void GetCaptionL( TDes& aCaption ) const; + + /** + * Creates a new icon of desired type. Override this to provide custom + * icons. Othervise default icon is used. Ownership of the created icon + * is transferred to the caller. + * + * Icon type UIDs (use these defined constants): + * KGSIconTypeLbxItem - ListBox item icon. + * KGSIconTypeTab - Tab icon. + * + * @param aIconType UID Icon type UID of the icon to be created. + * @return Pointer of the icon. NOTE: Ownership of this icon is + * transferred to the caller. + * @since 3.1 + */ + CGulIcon* CreateIconL( const TUid aIconType ); + + /** + * Method for reading the ID of the plugin provider category. See + * TGSPluginProviderCategory. PluginProviderCategory can be used for + * sorting plugins. + * + * Default value is EGSPluginProvider3rdParty. Override this function + * to change the category. + * + * @return Plugin provider category ID defined by + * TGSPluginProviderCategory + * @since 3.1 + */ + TInt PluginProviderCategory() const; + + /** + * Method for checking, if plugin should be visible and used in GS FW. + * (for example shown in listbox of the parent view). + * + * On default plugin is visible. Overwrite this function to enable or + * disable your plugin dynamically. + * + * @return ETrue if plugin should be visible in GS. + * @return EFalse if plugin should not be visible in GS. + * @since 3.1 + */ + TBool Visible() const; + + /** + * Reserved for future use/plugin's custom functionality. This can be + * overwritten if plugin needs to have custom functionality which cannot + * be fulfilled otherwise. + * @since 3.1 + */ + TAny* CustomOperationL( TAny* aParam1, TAny* aParam2 ); + + /** + * From CEikAppUi + * Handle skin change event. + * @since 3.1 + */ + void HandleClientRectChange(); + + /** + * From CAknView Activate this view + * @param aPrevViewId + * @param aCustomMessageId + * @param aCustomMessage + * @since 3.1 + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * From CAknView Deactivate this view + * @since 3.1 + */ + void DoDeactivate(); + + /** + * Activate local views within this plug-in + * @param aFeatureId ID of the view to be activated + * @since 3.1 + */ + void ActivateInternalViewL( TInt aFeatureId ); + + /** + * Creates local views within this plug-in + * @since 3.1 + */ + void CreateLocalViewL(); + + /** + * Get CamcorderGSPlugin's ccontainer. + * @since 3.1 + */ + CGSCamcorderPluginContainer* Container(); + + /** + * From MGSTabbedView + * @return Reference to owned tabbed views which should be included in + * the sub-view's tab group. + * @since 3.1 + */ + CArrayPtrFlat* TabbedViews(); + + /** + * Method used to check if the the Settings are + * are for Secondary camera. + */ + TBool IsSecondaryCameraSettings(); + + /* + * Fetch the integer value from appropriate settings model + */ + TInt IntegerSettingValue( const TInt aSettingItem ); + + /* + * Fetch the text value from appropriate settings model + */ + TPtrC TextSettingValue( const TInt aSettingItem ); + + /* + * Set text value of a setting item using right settings model + */ + void SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ); + + /* + * Set int value of a setting item using right settings model + */ + void SetIntegerSettingValueL( TInt aSettingItem, + TInt aSettingValue ); + + /* + * Loads all video static settings from CenRep + */ + void LoadVideoStaticSettingsL( TBool aResetFromGS ); + + /* + * Loads all image static settings from CenRep + */ + void LoadPhotoStaticSettingsL( TBool aResetFromGS ); + + /* + * Display the reset factory settings dialog + */ + TInt DisplayRestoreSettingsDlgL(); + + void SetSecondaryCameraSettings( TBool aSecondarySettings ); + + + protected: + + /** + * C++ default constructor. + */ + CGSCamcorderPlugin(); + + /** + * Symbian OS default constructor. + */ + void ConstructL(); + + /** + * Handles OK key press. + * @since 3.1 + */ + void HandleListBoxSelectionL(); + + /** + * From MEikMenuObserver Dynamically customize menu items + * @param aResourceId Menu pane resource ID + * @param aMenuPane Menu pane pointer + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + /** + * Creates new container. + * @since 3.1 + */ + void NewContainerL(); + + protected: //Data + + RConeResourceLoader iResources; + // Previous view to return when exiting CamcorderGSPlugin. + TVwsViewId iParentView; + + private: + void RemoveLocalViews(); + + private: + CArrayPtrFlat* iViewArray; + TBool iSecondaryCameraSettings; + CCamStaticSettingsModel* iSettingsModel; + CCamConfiguration* iConfiguration; + TBool iReloadSettings; + }; + +#endif // GS_CamcorderGSPLUGIN_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamcorderPlugin.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamcorderPlugin.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource header file for Camera Application* +*/ + + +#ifndef GSCAMCORDERPLUGIN_HRH +#define GSCAMCORDERPLUGIN_HRH + +enum TGSCamcorderFolderItemIds + { + EImageSettingsFolder, + EVideoSettingsFolder + }; + +#endif // + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamcorderPluginContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamcorderPluginContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container class for the camera general settings plugin +* +*/ + + +#ifndef CAMCODERGSPLUGINCONTAINER_H +#define CAMCODERGSPLUGINCONTAINER_H + +// INCLUDES +// System includes +#include + +// CONSTANTS +const TInt KGSCamSettingsListImageIndex = 0; +const TInt KGSCamSettingsListVideoIndex = 1; + +// FORWARD DECLARATIONS +class CGSListBoxItemTextArray; +class CAknIconArray; +class TAknsItemID; +// CLASS DECLARATION +/** +* CGSTelPluginContainer class +*/ +class CGSCamcorderPluginContainer : public CGSBaseContainer + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * + * @param aRect gives the correct TRect for construction. + */ + void ConstructL( const TRect& aRect ); + + /** + * Destructor. + */ + ~CGSCamcorderPluginContainer(); + + public: + + /** + * Updates list box + * + * @param aFeatureId is a updated list box item + */ + virtual void UpdateListBoxL( TInt aFeatureId ); + + /** + * Creates list box + * + * @param aResLbxId is resource number to create. + */ + void ConstructListBoxL( TInt aResLbxId ); + + /** + * Retrieves the currently selected listbox feature id + * @return feature id. + * @since 3.1 + */ + TInt CurrentFeatureId() const; + + /** + * Load icon bitmaps. + * @since 3.1 + */ + void LoadIconsL(); + + /** + * From CCoeControl changes the size of the list box + */ + void SizeChanged(); + + protected: //new + + /** + * Creates list box items + */ + virtual void CreateListBoxItemsL(); + + /** + * Creates Image setting list box item. + */ + void MakeImageSettingsFolderItemL(); + + /** + * Creates Video setting list box item. + */ + void MakeVideoSettingsFolderItemL(); + + /** + * Required for help. + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + /** + * From CCoeControl handles focus changes for listbox item + */ + void FocusChanged( TDrawNow aDrawNow ); + + protected: + CGSListBoxItemTextArray* iListboxItemArray; + private: + void AppendIconToArrayL( CAknIconArray* aArray, + const TAknsItemID& aID, + const TDesC& aMbmFile, + TInt aBitmapId, + TInt aMaskId ); + }; + +#endif // CamCODERGSPLUGINCONTAINER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamcorderSettingsBaseView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamcorderSettingsBaseView.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for Photo/Video settings view +* +* Copyright (c) 2008 Nokia Corporation. +* This material, including documentation and any related +* computer programs, is protected by copyright controlled by +* Nokia Corporation. All rights are reserved. Copying, +* including reproducing, storing, adapting or translating, any +* or all of this material requires the prior written consent of +* Nokia Corporation. This material also contains confidential +* information which may not be disclosed to others without the +* prior written consent of Nokia Corporation. +* +* +*/ + + + +#ifndef GSCAMCORDERSETTINGSBASEVIEW_H +#define GSCAMCORDERSETTINGSBASEVIEW_H + +// INCLUDES +#include +#include + + +// CLASS DECLARATION +class CGSCamcorderSettingsContainer; + + +/** +* Image settings page view class. +* @since +*/ +class CGSCamcorderSettingsBaseView : public CAknView, + public MEikListBoxObserver + + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~CGSCamcorderSettingsBaseView(); + + /** + * From CEikAppUi + * Handle skin change event. + * @since 3.1 + */ + void HandleClientRectChange(); + + /** + * From CCoeControl + * Handle skin change event. + */ + void HandleResourceChange( TInt aType ); + + public: // New functions + /* + * Check whether this view been lauched from General Settings. + */ + TBool LaunchedFromGS() const; + + public: // Functions from base classes + + /** + * From CAknView, handle commands + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * From CAknView Activate this view + * @param aPrevViewId + * @param aCustomMessageId + * @param aCustomMessage + */ + void DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * From MEikMenuObserver Dynamically customize menu items + * @param aResourceId Menu pane resource ID + * @param aMenuPane Menu pane pointer + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + /** + * From CAknView Deactivate this view + */ + void DoDeactivate(); + + /** + * Creates new container. + * @since 3.1 + */ + void NewContainerL(); + + /** + * Get CameraGSPlugin's ccontainer. + * @since 3.1 + */ + CGSCamcorderSettingsContainer* Container(); + + /** + * Sets Navipane text + * @since 3.1 + */ + void SetNaviPaneL(); + + /** + * Creates new container. + * @since 3.1 + */ + void CreateContainerL(); + + public: // from MEikListBoxObserver + + /** + * Handles listbox events. + * @param aListBox Listbox where the event occurred. + * @param aEventType Event type. + * + */ + void HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ); + + protected: + /** + * C++ constructor. + * @since 3.1 + */ + CGSCamcorderSettingsBaseView( CCamStaticSettingsModel& aModel, + TBool aPhotoSettings ); + + private: // Data + CCamStaticSettingsModel& iModel; + TBool iSecondaryCameraSettings; + TBool iPhotoSettings; + CGSCamcorderSettingsContainer* iContainer; + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamcorderSettingsContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamcorderSettingsContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base container for Photo/video settings views +* +* Copyright (c) 2008 Nokia Corporation. +* This material, including documentation and any related +* computer programs, is protected by copyright controlled by +* Nokia Corporation. All rights are reserved. Copying, +* including reproducing, storing, adapting or translating, any +* or all of this material requires the prior written consent of +* Nokia Corporation. This material also contains confidential +* information which may not be disclosed to others without the +* prior written consent of Nokia Corporation. +* +* +*/ + + +#ifndef GSCAMCORDERSETTINGSCONTAINER_H +#define GSCAMCORDERSETTINGSCONTAINER_H + + +// FORWARD DECLARATIONS +class CCamStaticSettingsModel; +class CAknSettingItemList; + + +// CLASS DECLARATION + +/** +* Container for the image settings page. +* @since +*/ +class CGSCamcorderSettingsContainer: public CCoeControl + { + public: // Constructors and destructor + + /** + * Symbian OS default constructor. + * @since 3.1 + */ + void ConstructL( CCamStaticSettingsModel& aModel, + TBool aLauchedFromGS, + TBool aSecondaryCameraSettings, + TBool aImageSettings ); + + /** + * Destructor. + */ + ~CGSCamcorderSettingsContainer(); + + + public: // New functions + /** + * Open setting page for currently selected setting item. + * @since 3.1 + */ + void EditCurrentL( TBool aCalledFromMenu = ETrue ); + + /** + * Save all settings. + * @since 3.1 + */ + void SaveSettingsL(); + + /** + * Get a pointer to the settingslist. + * @since 9.1 + */ + CAknSettingItemList* SettingsList() const; + + protected: // Functions from base classes + + /** + * From CCoeControl + * Gives the help context to be displayed + * @param aContext help context related to current view + */ + void GetHelpContext( TCoeHelpContext& aContext ) const; + + private: //data + + /** + * From CCoeControl set the size and position of its component controls. + */ + void SizeChanged(); + + /** + * From CCoeControl changes the size of the list box + */ + void HandleResourceChange( TInt aType ); + + /** + * From CCoeControl return the number of controls owned + * @return TInt number of controls + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl returns a control + * @param aIndex index of a control + * @return CCoeControl* pointer on a control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl event handling section + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + /** + * From CCoeControl changes the size of the list box + */ + void FocusChanged( TDrawNow aDrawNow ); + + /** + * Draw the counter to the bitmap used in the navi pane + * @since 3.0 + * @param aBmpGc The graphics context for the bitmap + * @param aBmpMaskGc The graphics context for the bitmap mask + */ + void CreateNaviBitmapsL(); + + private: + //CGSCamPhotoSettingsList* iImageSettingsList; // owned + CAknSettingItemList* iSettingsList; // owned + TBool iLauchedFromGS; + TBool iImageSettings; + TInt iProductCaptureKey; + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamdefaultnamesettingpage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCamdefaultnamesettingpage.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for name base type (date/text)* +*/ + + + + +#ifndef GSCAMDEFAULTNAMESETTINGPAGE_H +#define GSCAMDEFAULTNAMESETTINGPAGE_H + +// INCLUDES +#include +#include "CamSettingsInternal.hrh" +#include "Cam.hrh" + +/** +* Setting page for name base type (date/text) +* @since 2.8 +*/ +class CGSCamDefaultNameSettingPage : public CAknPopupSettingPage + { + public: // Constructors and destructor + /** + * C++ constructor. + * Parameters are passed directly to CAknPopupSettingPage. + * See CAknPopupSettingPage constructor for parameter details. + * @since 2.8 + * @param aNameBase current name base (in/out) + * @param aMode current mode (video or still image) + * @param aSettingTitleText title to display in page + * @param aSettingNumber the setting number + * @param aControlType the type of control + * @param aEditorResourceId the id of the editor resource + * @param aSettingPageResourceId the id of the page resource + * @param aQueryValue reference to the query value + */ + CGSCamDefaultNameSettingPage( + TDes& aNameBase, + TCamCameraMode aMode, + const TDesC* aSettingTitleText, + TInt aSettingNumber, + TInt aControlType, + TInt aEditorResourceId, + TInt aSettingPageResourceId, + MAknQueryValue& aQueryValue, + TBool aCamera ); + + /** + * Destructor + * @since 2.8 + */ + virtual ~CGSCamDefaultNameSettingPage(); + + protected: // Functions from base classes + /* + * From CAknSettingPage. + * @since 2.8 + * Check if the name base value is ok, so the user can + * exit the setting page. + * + * @param aAccept ETrue if the user has indicated to accept the + * setting page; EFalse otherwise + * @return TBool a value indicating whether the setting page + * should be dismissed + */ + TBool OkToExitL( TBool aAccept ); + + private: // New methods + + /* + * Display the editor dialog + * @since 3.0 + * + * @return TBool a value indicating whether the setting page + * should be dismissed + */ + TBool ShowEditorDialogL(); + + private: // Data + // Reference to the cuurent name base. + TDes& iNameBase; + // Used to store new name base so that it can be validated + // before overwriting old value. + TBuf iTempNameBase; + // The current mode of capture. + TCamCameraMode iMode; + TBool iCamera; + }; + +#endif // GSCAMDEFAULTNAMESETTINGPAGE_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCustomQualitySettingItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/inc/GSCustomQualitySettingItem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item for Location setting item in image settings* +*/ + + + + +#ifndef GSCUSTOMQUALITYSETTINGITEM_H +#define GSCUSTOMQUALITYSETTINGITEM_H + +// INCLUDES +#include "CamStaticSettingsModel.h" +#include + +// CLASS DECLARATION + +/** +* Setting item for image/video location texts +* @since 2.8 +*/ +class CGSCustomQualitySettingItem : public CAknEnumeratedTextPopupSettingItem + { + public: // Constructors and destructor + /** + * C++ constructor + * @since 2.8 + * @param aController reference to the controller + * @param aMode current mode (video or still image) + * @param aIdentifier setting page resource id + * @param aValue current name base type + */ + CGSCustomQualitySettingItem( + TInt aSettingItemId, + TInt& aValue, + CCamStaticSettingsModel& aModel, + TCamCameraMode aMode + ); + + /** + * Destructor + */ + ~CGSCustomQualitySettingItem(); + + public: // Functions from base classes + + + private: // Functions from base classes + + /** + * From CAknEnumeratedTextPopupSettingItem + * Virtual Method called by framework to complete the construction. + * Calls UpdateListTextL to set the list text when the item is first + * constructed + * @since 2.8 + */ + void CompleteConstructionL(); + + + + private: // Data + // reference to the app controller + CCamStaticSettingsModel& iModel; + // The current mode of capture. + TCamCameraMode iMode; + RArray iSupportedQualityLevels; + + }; + +#endif // CAMLOCATIONSETTINGITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/CamAlbumSettingItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/CamAlbumSettingItem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,212 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item type for "Add to album"* +*/ + + + +// INCLUDE FILES + +#include +#include + +#include "CamAlbumSettingItem.h" +#include "CamSettings.hrh" +#include "CamUtility.h" +#include "CameraappPrivateCRKeys.h" +#include "CamStaticSettingsModel.h" +#include "camerauiconfigmanager.h" +#include "CamAppUiBase.h" +#include "GSCamcorderPlugin.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// CCamAlbumSettingItem::CCamAlbumSettingItem +// Two phase construction +// --------------------------------------------------------------------------- +// +CCamAlbumSettingItem::CCamAlbumSettingItem( TInt aSettingItemId, + TInt& aValue) +: CAknEnumeratedTextPopupSettingItem( aSettingItemId, aValue ) + { + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CCamAlbumSettingItem::~CCamAlbumSettingItem() + { + PRINT( _L("Camera => ~CCamAlbumSettingItem") ); + PRINT( _L("Camera <= ~CCamAlbumSettingItem") ); + } + +// --------------------------------------------------------------------------- +// CCamAlbumSettingItem::HandleSettingPageEventL +// Handle events in the setting page +// --------------------------------------------------------------------------- +// +void CCamAlbumSettingItem::HandleSettingPageEventL( CAknSettingPage* /*aSettingPage*/, + TAknSettingPageEvent aEventType ) + { + // Get the value of the currently selected item on the setting page + MAknQueryValue* settingPageValues = QueryValue(); + TInt selectedIndex = settingPageValues->CurrentValueIndex(); + CArrayPtr* items = EnumeratedTextArray(); + TInt selectedValue = items->At( selectedIndex )->EnumerationValue(); + + // If the user has Okayed the "Yes" option. + if ( aEventType == EEventSettingOked && selectedValue == ECamSettYes ) + { + // Launch the album selection list popup + DisplayAlbumSelectionListL(); + } + UpdateListBoxTextL(); + } + +// --------------------------------------------------------------------------- +// CCamAlbumSettingItem::CompleteConstructionL +// Gets the correct text for a currently selected album +// --------------------------------------------------------------------------- +// +void CCamAlbumSettingItem::CompleteConstructionL() + { + PRINT( _L("Camera => CCamAlbumSettingItem::CompleteConstructionL") ); + CAknEnumeratedTextPopupSettingItem::CompleteConstructionL(); + if ( ExternalValue() == ECamSettYes ) + { + // We update the list box only if the setting item is true + // In this case, we stop displaying "Yes" and replace it with + // current album name. + UpdateListTextL(); + } + PRINT( _L("Camera <= CCamAlbumSettingItem::CompleteConstructionL") ); + } + +// --------------------------------------------------------------------------- +// CCamAlbumSettingItem::UpdateListTextL +// Update the text in the setting list to show the current capture album name +// --------------------------------------------------------------------------- +// +void CCamAlbumSettingItem::UpdateListTextL() + { + PRINT( _L("Camera => CCamAlbumSettingItem::UpdateListTextL") ); + + CAknViewAppUi *AppUi = static_cast( CCoeEnv::Static()->AppUi() ); + CGSCamcorderPlugin* parent = static_cast + ( AppUi->View( KGSCamcorderGSPluginUid ) ); + // If "Add to album" is on + if ( ExternalValue() == ECamSettYes ) + { + // A default capture album exists + // Replace the "Yes" text with the current capture album name + CArrayPtr* itemArray = EnumeratedTextArray(); + TInt numberOfItems = itemArray->Count(); // item count + TInt index = 0; + TBool found = EFalse; + while ( !found && index < numberOfItems ) + { + TInt value = itemArray->At( index )->EnumerationValue(); + // This is the "Yes" option + if ( value == ECamSettYes ) + { + // Replace the text with the album name + // We get the album name from CenRep key + HBufC* albumName = parent->TextSettingValue( + ECamSettingItemDefaultAlbumName ).AllocLC(); + + CAknEnumeratedText* newItem = new( ELeave ) + CAknEnumeratedText( value, albumName ); + CleanupStack::Pop( albumName ); + CleanupStack::PushL( newItem ); + CAknEnumeratedText* oldItem = itemArray->At( index ); + itemArray->Delete( index ); + delete oldItem; + oldItem = NULL; + itemArray->InsertL( index, newItem ); + CleanupStack::Pop( newItem ); + found = ETrue; + } + index++; + } + } // End of ExternalValue + UpdateListBoxTextL(); + PRINT( _L("Camera <= CCamAlbumSettingItem::UpdateListTextL C") ); + } + +// --------------------------------------------------------------------------- +// CCamAlbumSettingItem::DisplayAlbumSelectionListL +// Launch the album selection list popup +// --------------------------------------------------------------------------- +// +void CCamAlbumSettingItem::DisplayAlbumSelectionListL() + { + + CAknViewAppUi *AppUi = static_cast( CCoeEnv::Static()->AppUi() ); + CGSCamcorderPlugin* parent = static_cast + ( AppUi->View( KGSCamcorderGSPluginUid ) ); + // Launch the Pop-up menu using the Gallery API + // allowMultipleSelection = ETrue --> Multiple Selection + // allowMultipleSelection = EFalse --> Single Selection + TBool allowMultipleSelection = EFalse; + RArray selectedAlbumIds; + CleanupClosePushL( selectedAlbumIds ); + // Launching the Pop-up menu with the list of albums + TRAPD ( err, TGlxCollectionSelectionPopup::ShowPopupL( + selectedAlbumIds, + KGlxCollectionTypeIdAlbum, + allowMultipleSelection, + ETrue + ) ); + + TInt defaultAlbumId = 0; // default album id in CenRep + + TInt prevDefaultId = parent->IntegerSettingValue( + ECamSettingItemDefaultAlbumId ); + if ( selectedAlbumIds.Count() > 0 && err == KErrNone ) + { + // this is the new album which is set as default + defaultAlbumId = static_cast( selectedAlbumIds[0] ); + } + else if ( prevDefaultId != 0 ) + { + // UseCase: If the user selects cancel when the pop-up active + // we then go back to the prev album selected + defaultAlbumId = prevDefaultId; + } + else + { + } + CleanupStack::PopAndDestroy( &selectedAlbumIds ); + + parent->SetIntegerSettingValueL( ECamSettingItemDefaultAlbumId, + defaultAlbumId ); + + } + +// --------------------------------------------------------------------------- +// CCamAlbumSettingItem::HandleAlbumError +// Deal with loss of capture album or album information +// --------------------------------------------------------------------------- +// +void CCamAlbumSettingItem::HandleAlbumError() + { + // Set "Add to album" off + SetInternalValue( ECamSettNo ); + SetExternalValue( ECamSettNo ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/CamLocationSettingContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/CamLocationSettingContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,775 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements the location settings for image settings* +*/ + + + +// INCLUDE FILES + +#include +#include +#include +#include +#include // CAknTitlePane +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CamLocationSettingContainer.h" +#include "CamUtility.h" +#include "CamCaptureSetupListBox.h" +#include "CamCaptureSetupListBoxModel.h" +#include "CamPanic.h" +#include "camuiconstants.h" +#include "camuidconstants.h" +#include "CamAppUiBase.h" +#include "CamStaticSettingsModel.h" +#include "GSCamcorderPlugin.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::CCamLocationSettingContainer +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamLocationSettingContainer::CCamLocationSettingContainer( MCamAppController& aController, + TCamCameraMode aMode, + CCoeControl* aParent ) +: iParent( aParent ), + iController( aController ), + iMode( aMode ), + iActivateOnTouchRelease( EFalse ) + { + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamLocationSettingContainer::ConstructL() + { + PRINT(_L("Camera => CCamLocationSettingContainer::ConstructL") ) + PRINT(_L("Camera <= CCamLocationSettingContainer::ConstructL") ) + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamLocationSettingContainer* +CCamLocationSettingContainer::NewL( MCamAppController& aController, + TCamCameraMode aMode, + CCoeControl* aParent ) + { + CCamLocationSettingContainer* self = + new( ELeave ) CCamLocationSettingContainer( aController, aMode, aParent ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::~CCamLocationSettingContainer +// Destructor +// ----------------------------------------------------------------------------- +// +CCamLocationSettingContainer::~CCamLocationSettingContainer() + { + PRINT( _L("Camera => ~CCamLocationSettingContainer") ); + CCamAppUiBase* appUi = static_cast( iEikonEnv->AppUi() ); + if ( appUi ) + { + TInt resId = ( ECamControllerVideo == iMode ) + ? R_CAM_VIDEO_SETTINGS_TITLE_NAME + : R_CAM_PHOTO_SETTINGS_TITLE_NAME; + + TRAP_IGNORE( appUi->SetTitleL( resId ) ); + } + iDescArray.ResetAndDestroy(); + iDescLayoutArray.Close(); + if ( iCurrentDescLineArray ) + { + iCurrentDescLineArray->Reset(); + delete iCurrentDescLineArray; + } + delete iListBox; + + if ( iTextTitle ) + { + delete iTextTitle; + iTextTitle = NULL; + } + + PRINT( _L("Camera <= ~CCamLocationSettingContainer") ); + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::SelectedQuality +// Returns the value selected by the listbox +// ----------------------------------------------------------------------------- +// +TInt CCamLocationSettingContainer::SelectedValue() const + { + CCamCaptureSetupListBoxModel *model = static_cast( iListBox->Model() ); + return model->ItemValue( iListBox->CurrentItemIndex() ); + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::ConstructFromResourceL +// Constructs the container from the resource +// ----------------------------------------------------------------------------- +// +void CCamLocationSettingContainer::ConstructFromResourceL( TResourceReader& /*aReader*/ ) + { + CAknViewAppUi* viewAppUi = static_cast( CCoeEnv::Static()->AppUi() ); + CGSCamcorderPlugin* parent = static_cast + ( viewAppUi->View( KGSCamcorderGSPluginUid ) ); + + // set up the container windows here as setting page window + // isn't created until CAknSettingPage::ConstructFromResourceL is called + SetContainerWindowL( *iParent ); + + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect ); + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, + statusPaneRect ); + + // layout area rectangle contains the area, where components need to be + // drawn to. the container size is the whole screen, but the layouts are + // for the client area. aRect is the container size that might include or + // might not include statuspane area. calculating area self will + // go around the problem + TRect layoutAreaRect; + layoutAreaRect = mainPaneRect; + layoutAreaRect.BoundingRect( statusPaneRect ); + + // set the layouts for the rect containing the description + if ( CamUtility::IsNhdDevice() ) + { + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + iSummaryRect.LayoutRect( layoutAreaRect, AknLayoutScalable_Apps::main_cset_text2_pane( 0 ) ); + } + else + { + iSummaryRect.LayoutRect( layoutAreaRect, AknLayoutScalable_Apps::main_cset_text2_pane( 1 ) ); + } + } + else + { + iSummaryRect.LayoutRect( layoutAreaRect, AknLayoutScalable_Apps::main_cset6_text2_pane( 0 ) ); + } + + TRAPD( ignore, + ConstructSummaryDetailsFromResourceL( R_CAM_OFF_ON_LOC_TEXT_LIST_SUMMARY ); + ) + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + + iCurrentDescLineArray = new( ELeave ) CArrayFixFlat( 5 ); + + // set layout for 5 lines of descriptive text + iDescLayoutArray.Reset(); + TAknLayoutText layout; + TAknLayoutScalableParameterLimits listLimits = + AknLayoutScalable_Apps::main_cset_text2_pane_t1_copy1_ParamLimits( 0 ); + TInt lineCount = listLimits.LastRow() + 1; + for ( TInt i = 0; i < lineCount; i++ ) + { + if ( CamUtility::IsNhdDevice() ) + { + layout.LayoutText( iSummaryRect.Rect(), + AknLayoutScalable_Apps::main_cset_text2_pane_t1( i ) ); + } + else + { + layout.LayoutText( iSummaryRect.Rect(), + AknLayoutScalable_Apps::main_cset_text2_pane_t1_copy1(0,0,i) ); + } + User::LeaveIfError( iDescLayoutArray.Append( layout ) ); + } + + TInt listInt = ECamSettingItemRecLocation; + iListBox = new( ELeave ) CCamCaptureSetupListBox( this, iController ); + iListBox->ConstructL( this, + R_CAM_OFF_ON_LOC_TEXT_LIST, + TInt( ECamSettingItemRecLocation ), + 0, + EFalse, + ETrue ); + if ( parent ) + { + iListBox->InitializeL + ( parent->IntegerSettingValue( listInt ) ); + } + iListBox->SetContainerWindowL( *iParent ); + iListBox->DisableSingleClick( ETrue ); + + TRect listboxRect; + ReadListboxLayoutL(listboxRect); + + // Determine the height of the listbox; Either the height based on the number of items, + // or the maximum allowed listbox height. + CEikScrollBarFrame::TScrollBarVisibility visibility = CEikScrollBarFrame::EOff; + TInt maxListBoxHeight = listboxRect.Height(); + TInt listBoxHeight = iListBox->CalcHeightBasedOnNumOfItems( + iListBox->Model()->NumberOfItems() ); + if ( maxListBoxHeight < listBoxHeight ) + { + // there are more items than would fit to the listbox rectangle + + // the maximum height is the total height of items + // that can fit to the maxlistboxheight + TInt itemHeight = iListBox->ItemHeight(); + TInt itemsVisible = maxListBoxHeight / itemHeight; + listBoxHeight = itemsVisible * itemHeight; + + // the scrollbar needs to be turned on + visibility = CEikScrollBarFrame::EOn; + } + + // get layout for the listbox rect + TAknLayoutRect listboxLayoutRect; + if ( visibility == CEikScrollBarFrame::EOn ) + { + // if scrollbars are used, use scrollbar layout + if ( CamUtility::IsNhdDevice() ) + { + listboxLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::main_cset_list_pane( 0 ) ); + } + else + { + listboxLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::main_cset_list_pane_copy1( 0 ) ); + } + } + else + { + if ( CamUtility::IsNhdDevice() ) + { + listboxLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::main_cset_list_pane( 1 ) ); + } + else + { + listboxLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::main_cset_list_pane_copy1( 1 ) ); + } + } + + // layout scrollbarpane (will not be visible if not needed) + TAknLayoutRect scrollbarLayoutRect; + if ( CamUtility::IsNhdDevice() ) + { + scrollbarLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::scroll_pane_cp028( 0 ) ); + } + else + { + scrollbarLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::scroll_pane_cp028_copy1( 0 ) ); + } + + // calculate the layout for the listbox with changed height + const AknLayoutUtils::SAknLayoutControl listboxLayout = + { ELayoutEmpty, listboxRect.iTl.iX, listboxRect.iTl.iY, + ELayoutEmpty, ELayoutEmpty, + listboxLayoutRect.Rect().Width(), listBoxHeight }; + + AknLayoutUtils::LayoutControl( iListBox, + layoutAreaRect, listboxLayout); + + iListBox->CreateScrollBarFrameL( ETrue ); + iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, + visibility ); + iListBox->MakeVisible( ETrue ); + iListBox->SetFocus( EFalse, ENoDrawNow ); + iListBox->UpdateScrollBarsL(); + iListBox->ScrollBarFrame()->DrawScrollBarsNow(); + iListBox->SetListBoxObserver(this); + SplitCurrentTextL(); + + // Prevents the system filling invalidated areas with the background colour - + // helps reduce flicker. + Window().SetBackgroundColor(); + + ConstructContainerTitleFromResourceL( R_CAM_PHOTO_LOCATION_SETTINGS_TITLE_NAME ); + CCamAppUiBase* appUi = static_cast( iEikonEnv->AppUi() ); + appUi->SetTitleL( iTextTitle->Des() ); + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::CountComponentControls +// return the number of component controls +// ----------------------------------------------------------------------------- +// +TInt CCamLocationSettingContainer::CountComponentControls() const + { + return 1; // the listbox + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::ComponentControl +// return the control at a given index +// ----------------------------------------------------------------------------- +// +CCoeControl* CCamLocationSettingContainer::ComponentControl( TInt /*aIndex*/ ) const + { + return iListBox; + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::Draw +// Draws the container +// ----------------------------------------------------------------------------- +// +void CCamLocationSettingContainer::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + + // Draw skin background + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, gc, Rect() ); + + // Draw summary text + DrawSummaryText( gc ); + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::SizeChanged +// Handles a change in the size of the control +// ----------------------------------------------------------------------------- +// +void CCamLocationSettingContainer::SizeChanged() + { + // Do this only if the listbox has been created, ie. ConstructFromResourceL() has been called + if (iListBox) + { + TRect listboxRect; + TRAPD( ignore, ReadListboxLayoutL(listboxRect) ); + if ( ignore ) + { + // Just return if the resource reader fails + return; + } + + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect ); + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, + statusPaneRect ); + + // layout area rectangle contains the area, where components need to be + // drawn to. the container size is the whole screen, but the layouts are + // for the client area. aRect is the container size that might include or + // might not include statuspane area. calculating area self will + // go around the problem + TRect layoutAreaRect; + layoutAreaRect = mainPaneRect; + layoutAreaRect.BoundingRect( statusPaneRect ); + + // Determine the height of the listbox; Either the height based on the number of items, + // or the maximum allowed listbox height. + CEikScrollBarFrame::TScrollBarVisibility visibility = CEikScrollBarFrame::EOff; + TInt maxListBoxHeight = listboxRect.Height(); + TInt listBoxHeight = iListBox->CalcHeightBasedOnNumOfItems( + iListBox->Model()->NumberOfItems() ); + if ( maxListBoxHeight < listBoxHeight ) + { + // there are more items than would fit to the listbox rectangle + + // the maximum height is the total height of items + // that can fit to the maxlistboxheight + TInt itemHeight = iListBox->ItemHeight(); + TInt itemsVisible = maxListBoxHeight / itemHeight; + listBoxHeight = itemsVisible * itemHeight; + + // the scrollbar needs to be turned on + visibility = CEikScrollBarFrame::EOn; + } + + // get layout for the listbox rect + TAknLayoutRect listboxLayoutRect; + if ( visibility == CEikScrollBarFrame::EOn ) + { + // if scrollbars are used, use scrollbar layout + if ( CamUtility::IsNhdDevice() ) + { + listboxLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::main_cset_list_pane( 0 ) ); + } + else + { + listboxLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::main_cset_list_pane_copy1( 0 ) ); + } + } + else + { + if ( CamUtility::IsNhdDevice() ) + { + listboxLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::main_cset_list_pane( 1 ) ); + } + else + { + listboxLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::main_cset_list_pane_copy1( 1 ) ); + } + } + + // layout scrollbarpane (will not be visible if not needed) + TAknLayoutRect scrollbarLayoutRect; + if ( CamUtility::IsNhdDevice() ) + { + scrollbarLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::scroll_pane_cp028( 0 ) ); + } + else + { + scrollbarLayoutRect.LayoutRect( listboxRect, + AknLayoutScalable_Apps::scroll_pane_cp028_copy1( 0 ) ); + } + + // calculate the layout for the listbox with changed height + const AknLayoutUtils::SAknLayoutControl listboxLayout = + { ELayoutEmpty, listboxRect.iTl.iX, listboxRect.iTl.iY, + ELayoutEmpty, ELayoutEmpty, + listboxLayoutRect.Rect().Width(), listBoxHeight }; + + AknLayoutUtils::LayoutControl( iListBox, + layoutAreaRect, listboxLayout); + } + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::OfferKeyEventL +// Handles key events +// ----------------------------------------------------------------------------- +// +TKeyResponse CCamLocationSettingContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse keyResponse = iListBox->OfferKeyEventL( aKeyEvent, aType ); + if ( keyResponse == EKeyWasConsumed ) + { + ReportEventL( MCoeControlObserver::EEventStateChanged ); + } + return keyResponse; + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::HandleSettingValueUpdateL +// Handles a change to the setting value +// ----------------------------------------------------------------------------- +// +void CCamLocationSettingContainer::HandleSettingValueUpdateL( TInt /*aNewValue*/ ) + { + SplitCurrentTextL(); + ActivateGc(); + Window().Invalidate( iSummaryRect.Rect() ); + DeactivateGc(); + } + +// ----------------------------------------------------------------------------- +// CCamLocationSettingContainer::ReadListboxLayoutL +// Reads the listbox layout +// ----------------------------------------------------------------------------- +// +void CCamLocationSettingContainer::ReadListboxLayoutL( TRect& aRect ) + { + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect ); + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, + statusPaneRect ); + + // layout area rectangle contains the area, where components need to be + // drawn to. the container size is the whole screen, but the layouts are + // for the client area. aRect is the container size that might include or + // might not include statuspane area. calculating area self will + // go around the problem + TRect layoutAreaRect; + layoutAreaRect = mainPaneRect; + layoutAreaRect.BoundingRect( statusPaneRect ); + + // get the rect size for listbox in the layout + TAknLayoutRect listboxLayoutRect; + if ( CamUtility::IsNhdDevice() ) + { + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + listboxLayoutRect.LayoutRect( layoutAreaRect, + AknLayoutScalable_Apps::main_cset_listscroll_pane( 4 ) ); + } + else + { + listboxLayoutRect.LayoutRect( layoutAreaRect, + AknLayoutScalable_Apps::main_cset_listscroll_pane( 5 ) ); + } + } + else + { + listboxLayoutRect.LayoutRect( layoutAreaRect, + AknLayoutScalable_Apps::main_cset6_listscroll_pane( 4 ) ); + } + aRect.SetRect(listboxLayoutRect.Rect().iTl, listboxLayoutRect.Rect().Size() ); + } + +// ----------------------------------------------------------------- +// CCamLocationSettingContainer::ConstructSummaryDetailsFromResourceL +// Sets up the layouts of the summary items +// ----------------------------------------------------------------- +void CCamLocationSettingContainer::ConstructSummaryDetailsFromResourceL(TInt aResourceId) + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResourceId ); + const TInt count = reader.ReadInt16(); + + TInt i = -1; + // bitmapID and SummarySceneId are needed since we are using + // a resource that requires fetching those values also. + // The reason why the resource itself is not changed is + // that we are using a CamCaptureSetupListBox that needs those. + // This requires much less work if not creating own listbox type that + // would otherwise have to be created. CamCaptureSetupListBox is now + // used here in such a way that the listbox icon are is set to zero width + // and no bitmap icon is showed. + TInt bitmapId = -1; + // To remove warning about setting variable but never using it + TInt summarySceneId = bitmapId; + // made to remove warning. (explained above comments) + bitmapId = summarySceneId; + + HBufC16* descr = NULL; + + // Read all of the summary entries from the resource file + for ( i = 0; i < count; i++ ) + { + summarySceneId = reader.ReadInt16(); + bitmapId = reader.ReadInt32(); + descr = reader.ReadHBufC16L(); + + // This hack because an empty resource string which comes as NULL from the resource reader. + // This would create crash later on. + if ( NULL == descr ) + { + _LIT(KText,""); + HBufC* buf; + buf = HBufC::NewL(0); + *buf = KText; + User::LeaveIfError( iDescArray.Append( buf ) ); + } + else + { + User::LeaveIfError( iDescArray.Append( descr ) ); + } + } + CleanupStack::PopAndDestroy(); // reader + } + + +// ----------------------------------------------------------------- +// CCamLocationModeContainer::DrawSummaryText +// Draws summary title and description text +// ----------------------------------------------------------------- +void CCamLocationSettingContainer::DrawSummaryText( CWindowGc& aGc ) const + { +// aGc.SetBrushColor( KRgbShadedWhite ); +// aGc.Clear( iSummaryRect.Rect() ); + + TInt count = iCurrentDescLineArray->Count(); + TInt layoutCount = iDescLayoutArray.Count(); + TRgb color; + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ); + + if ( layoutCount < count ) + { + count = layoutCount; + } + TInt i; + for ( i = 0; i < count; i++ ) + { + iDescLayoutArray[i].DrawText( aGc, ( *iCurrentDescLineArray )[i], ETrue, color ); + } + } + +// ----------------------------------------------------------------- +// CCamLocationModeContainer::SplitCurrentTextL +// Splits the summary title and description text into multiple lines that fit the status layouts +// ----------------------------------------------------------------- +void CCamLocationSettingContainer::SplitCurrentTextL() + { + // Use the layout info from the first line for width and font + TAknLayoutText layout = iDescLayoutArray[0]; + AknTextUtils::WrapToArrayL( *iDescArray[iListBox->CurrentItemIndex()], + layout.TextRect().Width(), + *( layout.Font() ), + *iCurrentDescLineArray ); + } + + +// -------------------------------------------------------------------------- +// CCamLocationSettingContainer::ConstructContainerTitleFromResourceL +// -------------------------------------------------------------------------- +// +void CCamLocationSettingContainer::ConstructContainerTitleFromResourceL( TInt aResourceId ) + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResourceId ); // cleanupstack + + iTextTitle = reader.ReadHBufC16L(); + + CleanupStack::PopAndDestroy(); // reader + } + +// -------------------------------------------------------------------------- +// CCamLocationSettingContainer::HandlePointerEventL +// -------------------------------------------------------------------------- +// +void CCamLocationSettingContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + RDebug::Print(_L("CCamLocationSettingContainer::HandlePointerEventL iType=%d iPosition=(%d, %d)"), + aPointerEvent.iType, + aPointerEvent.iPosition.iX, + aPointerEvent.iPosition.iY ); + iListBox->HandlePointerEventL( aPointerEvent ); + /*TInt oldListItemIndex = -1; + TInt newListItemIndex = -1; + TBool handleItemActivation = EFalse; + + if ( iListBox ) + { + oldListItemIndex = iListBox->CurrentItemIndex(); + } + + CCoeControl::HandlePointerEventL( aPointerEvent ); + + if ( iListBox ) + { + newListItemIndex = iListBox->CurrentItemIndex(); + } + + if ( oldListItemIndex != -1 && newListItemIndex != -1 ) + { + + // figure out if item was activated by touch down + release combination on same item + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + if ( newListItemIndex != oldListItemIndex ) + { + iActivateOnTouchRelease = EFalse; + } + else + { + // set the current item to be activated on touch release + iActivateOnTouchRelease = ETrue; + } + } + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + if ( iActivateOnTouchRelease && ( newListItemIndex == oldListItemIndex ) ) + { + TInt pointedItemIndex; + TBool focusableItemPointed = iListBox->View()->XYPosToItemIndex(aPointerEvent.iPosition, pointedItemIndex ); + // check that pointer is in focusable area + if ( focusableItemPointed ) + { + // only if list item index has not changed during event and iActivateOnTouchRelease is true + handleItemActivation = ETrue; + iActivateOnTouchRelease = EFalse; + } + else + { + iActivateOnTouchRelease = EFalse; + } + } + } + else + { + // aPointerEvent.iType == TPointerEvent::EDrag + + if ( newListItemIndex != oldListItemIndex ) + { + // change only when drag event changes the listitem index + iActivateOnTouchRelease = EFalse; + } + } + + } // end if ( oldListItemIndex != -1 && newListItemIndex != -1 ) + + if ( handleItemActivation ) + { + TKeyEvent key; + key.iRepeats = 0; + key.iCode = EKeyOK; + key.iModifiers = 0; + iEikonEnv->SimulateKeyEventL( key, EEventKey ); + }*/ + + } // end of HandlePointerEventL +// --------------------------------------------------------------------------- +// CCamLocationSettingContainer::HandleListBoxEventL +// Handles Listbox events +// --------------------------------------------------------------------------- +// +void CCamLocationSettingContainer::HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ) + { + + switch( aEventType ) + { + + case EEventEnterKeyPressed: + case EEventItemDoubleClicked: + { + TKeyEvent key; + key.iRepeats = 0; + key.iCode = EKeyOK; + key.iModifiers = 0; + iEikonEnv->SimulateKeyEventL( key, EEventKey ); + } + break; + case EEventItemClicked: + { + HandleSettingValueUpdateL( iListBox->CurrentItemIndex() ); + } + break; + default: + break; + } + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/CamLocationSettingItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/CamLocationSettingItem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Location Setting item type for Image settings* +*/ + + + +// INCLUDE FILES +#include "CamLocationSettingItem.h" +#include "CamLocationSettingPage.h" +#include "CamUtility.h" +#include "CamAppUiBase.h" +#include "CamStaticSettingsModel.h" + +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== +// --------------------------------------------------------------------------- +// CCamLocationSettingItem::CCamLocationSettingItem +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamLocationSettingItem::CCamLocationSettingItem( + TCamCameraMode aMode, + TInt aIdentifier, + TInt& aValue ) + : CAknEnumeratedTextPopupSettingItem( aIdentifier, aValue ), + iMode( aMode ) + { + } + + +// --------------------------------------------------------------------------- +// CCamLocationSettingItem::~CCamLocationSettingItem +// Destructor. +// --------------------------------------------------------------------------- +// +CCamLocationSettingItem::~CCamLocationSettingItem() + { + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingItem::CreateSettingPageL +// Framework method for constructing the launching setting page. +// --------------------------------------------------------------------------- +// +CAknSettingPage* CCamLocationSettingItem::CreateSettingPageL() + { + PRINT( _L("Camera => CCamLocationSettingItem::CreateSettingPageL") ); + // Create an instance of our customized setting page. + TPtrC settingName = SettingName(); + CAknSettingPage* page = + new( ELeave ) CCamLocationSettingPage( iMode, + settingName, + SettingNumber(), + EAknCtPopupSettingList, + SettingEditorResourceId(), + SettingPageResourceId(), + *QueryValue(), + static_cast( CCoeEnv::Static()->AppUi() ) + ->AppController() ); + PRINT( _L("Camera <= CCamLocationSettingItem::CreateSettingPageL") ); + return page; + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingItem::CompleteConstructionL +// +// --------------------------------------------------------------------------- +// +void CCamLocationSettingItem::CompleteConstructionL() + { + PRINT( _L("Camera => CCamLocationSettingItem::CompleteConstructionL") ); + CAknEnumeratedTextPopupSettingItem::CompleteConstructionL(); + // make sure we only have the support items in our test array + CArrayPtr* array = EnumeratedTextArray(); + PRINT( _L("Camera <= CCamLocationSettingItem::CompleteConstructionL") ); + } + +// End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/CamLocationSettingPage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/CamLocationSettingPage.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,301 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for location setting in Image&Video Settings.* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include "CamUtility.h" +#include "CamLocationSettingPage.h" +#include "MCamAppController.h" +#include "CamLocationSettingContainer.h" +#include +#include + +// CONSTANTS + + +// ============================ MEMBER FUNCTIONS =============================== +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::CCamLocationSettingPage +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamLocationSettingPage::CCamLocationSettingPage( + TCamCameraMode aMode, + TDesC& aSettingTitleText, + TInt aSettingNumber, + TInt aControlType, + TInt aEditorResourceId, + TInt aSettingPageResourceId, + MAknQueryValue& aQueryValue, + MCamAppController& aController ) + : CAknSettingPage( &aSettingTitleText, + aSettingNumber, + aControlType, + aEditorResourceId, + aSettingPageResourceId ), + iQueryValue( aQueryValue ), + iController( aController ), + iMode( aMode ) + { + } +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::~CCamLocationSettingPage +// C++ destructor +// --------------------------------------------------------------------------- +// +CCamLocationSettingPage::~CCamLocationSettingPage() + { + PRINT( _L("Camera => ~CCamLocationSettingPage") ); + delete iLocationContainer; + + if ( iTimer && iTimer->IsActive() ) + { + iTimer->Cancel(); + } + delete iTimer; + + TRAP_IGNORE( iController.CancelPreviewChangesL() ); + PRINT( _L("Camera <= ~CCamLocationSettingPage") ); + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::ConstructL +// Construct the setting page +// --------------------------------------------------------------------------- +// +void CCamLocationSettingPage::ConstructL() + { + // create the timer used for callbacks + iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + // this needs to be created before BaseConstructL as it sets the + // size of the setting page which will result in SizeChanged being called + iLocationContainer = CCamLocationSettingContainer::NewL( iController, + iMode, + this ); + BaseConstructL(); + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::UpdateSettingL +// Called when the state of location setting changes +// --------------------------------------------------------------------------- +// +void CCamLocationSettingPage::UpdateSettingL() + { + TBool settingValueEnabled = ETrue; + iCurrentVal = iLocationContainer->SelectedValue(); + iSettingItemId = ECamSettingItemRecLocation; + // Inform the base setting page class + SetDataValidity( settingValueEnabled ); + UpdateCbaL(); + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::ProcessCommandL +// Processes events from the softkeys. +// --------------------------------------------------------------------------- +// +void CCamLocationSettingPage::ProcessCommandL( TInt aCommandId ) + { + HideMenu(); + + // Respond to softkey events + switch ( aCommandId ) + { + case EAknSoftkeyOk: + case EAknSoftkeySelect: + SelectCurrentItemL(); + AttemptExitL( ETrue ); + iController.CommitPreviewChanges(); + break; + case EAknSoftkeyCancel: + AttemptExitL( EFalse ); + iController.CancelPreviewChangesL(); + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::PostDisplayCheckL +// Customises some of the functionality so that the custom control +// is used instead of the base classes editor control +// --------------------------------------------------------------------------- +// +TBool CCamLocationSettingPage::PostDisplayCheckL() + { + // don't use the editor control in the base class + // use the custom control instead. + iLocationContainer->SetObserver( this ); + return CAknSettingPage::PostDisplayCheckL(); + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::SelectCurrentItemL +// Uses the query value to inform the setting item that +// a new value has been selected +// --------------------------------------------------------------------------- +// +void CCamLocationSettingPage::SelectCurrentItemL() + { + iQueryValue.SetCurrentValueIndex( iLocationContainer->SelectedValue() ); + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::ConstructFromResourceL +// Constructs the quality container from the resource file +// --------------------------------------------------------------------------- +// +void CCamLocationSettingPage::ConstructFromResourceL( TResourceReader& aReader ) + { + // setting page window is created in the base class + CAknSettingPage::ConstructFromResourceL( aReader ); + + TResourceReader reader; + iLocationContainer->ConstructFromResourceL( reader ); + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::CountComponentControls +// Returns the number of component controls +// --------------------------------------------------------------------------- +// +TInt CCamLocationSettingPage::CountComponentControls() const + { + return 1; // the location container + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::ComponentControl +// Returns the control at the given index +// --------------------------------------------------------------------------- +// +CCoeControl* CCamLocationSettingPage::ComponentControl( TInt /*aIndex*/ ) const + { + return iLocationContainer; + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::Draw +// Draws the setting page +// --------------------------------------------------------------------------- +// +void CCamLocationSettingPage::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushColor( KRgbWhite ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.DrawRect( Rect() ); + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::SizeChanged +// Handles a change in the size of the page +// --------------------------------------------------------------------------- +// +void CCamLocationSettingPage::SizeChanged() + { + CAknSettingPage::SizeChanged(); + + if ( CamUtility::IsNhdDevice() ) + { + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + AknLayoutUtils::LayoutControl( iLocationContainer, Rect(), AknLayoutScalable_Apps::main_cam_set_pane_g1( 7 ) ); + } + else + { + AknLayoutUtils::LayoutControl( iLocationContainer, Rect(), AknLayoutScalable_Apps::main_cam_set_pane_g1( 8 ) ); + } + } + else + { + AknLayoutUtils::LayoutControl( iLocationContainer, Rect(), AknLayoutScalable_Apps::main_cam6_set_pane( 0 ) ); + } + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::OfferKeyEventL +// Handles the key event +// --------------------------------------------------------------------------- +// +TKeyResponse CCamLocationSettingPage::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType + ) + { + // Always react to Escape key by cancelling the setting page + if ( aType == EEventKey && aKeyEvent.iCode == EKeyEscape) + { + ProcessCommandL( EAknSoftkeyCancel ); + return EKeyWasConsumed; + } + + // Only handle other key events if we're focused + if ( IsFocused() ) + { + // Abstraction of key events: Escape is handled like Cancel + // OK key is handled like the Select softkey by default + if ( aType == EEventKey && aKeyEvent.iCode == EKeyOK ) + { + if ( aKeyEvent.iRepeats != 0 ) + { + return EKeyWasConsumed; + } + if ( DataValidity() ) + { + ProcessCommandL( EAknSoftkeySelect ); + } + return EKeyWasConsumed; + } + } + + // offer the key to the quality container class + // if not handled by the setting page + return iLocationContainer->OfferKeyEventL( aKeyEvent, aType ); + } + +// --------------------------------------------------------------------------- +// CCamLocationSettingPage::PreviewSettingChangeL +// Previews the setting value +// --------------------------------------------------------------------------- +// +TInt CCamLocationSettingPage::PreviewSettingChange( TAny* aAny ) + { + CCamLocationSettingPage* settingPage = + static_cast( aAny ); + // preview the setting value - will + // update the engine and the navi couner + TRAPD( ignore, settingPage->iController.PreviewSettingChangeL( + settingPage->iSettingItemId, + settingPage->iCurrentVal ) ); + if(ignore) + { + // Lint error removal + } + + // cancel the timer + settingPage->iTimer->Cancel(); + + return KErrNone; + } +//End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamDefaultNameSettingItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamDefaultNameSettingItem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item type for CAknEnumeratedItems.* +*/ + + + +// INCLUDE FILES +#include "GSCamDefaultNameSettingItem.h" +#include "GSCamdefaultnamesettingpage.h" +#include "CamSettingsInternal.hrh" +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== +// --------------------------------------------------------------------------- +// CGSCamDefaultNameSettingItem::CGSCamDefaultNameSettingItem +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCamDefaultNameSettingItem::CGSCamDefaultNameSettingItem( + TDes& aNameBase, + TCamCameraMode aMode, + TInt aIdentifier, + TInt& aValue, + TBool aCamera ) +: CAknEnumeratedTextPopupSettingItem( aIdentifier, aValue ), + iNameBase( aNameBase ), + iMode( aMode ), + iCamera ( aCamera ) + { + } + + +// --------------------------------------------------------------------------- +// CGSCamDefaultNameSettingItem::~CGSCamDefaultNameSettingItem +// Destructor. +// --------------------------------------------------------------------------- +// +CGSCamDefaultNameSettingItem::~CGSCamDefaultNameSettingItem() + { + } + + +// --------------------------------------------------------------------------- +// CGSCamDefaultNameSettingItem::CreateSettingPageL +// Framework method for constructing the launching setting page. +// --------------------------------------------------------------------------- +// +CAknSettingPage* CGSCamDefaultNameSettingItem::CreateSettingPageL() + { + // Create an instance of our customized setting page. + TPtrC settingName = SettingName(); + return new( ELeave )CGSCamDefaultNameSettingPage( + iNameBase, + iMode, + &settingName, + SettingNumber(), + EAknCtPopupSettingList, + SettingEditorResourceId(), + SettingPageResourceId(), + *QueryValue(), iCamera ); + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamPhotoSettingsList.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamPhotoSettingsList.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,413 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image settings list class +* +*/ + + +// INCLUDE FILES + +#include +#include // CAknMemorySelectionSettingItem +#include +#include +#include +#include +#include +#include +#include // DriveInfo + +#include "GSCamcorderPlugin.hrh" +#include "Cam.hrh" +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "CamPanic.h" +#include "CamAppUiBase.h" +#include "CamUtility.h" +#include "MCamAppController.h" +#include "GSCamPhotoSettingsList.h" +#include "GSCamcorderPlugin.h" +#include "GSCamQualitySettingItem.h" +#include "GSCustomQualitySettingItem.h" +#include "GSCamDefaultNameSettingItem.h" +#include "CameraUiConfigManager.h" +#include "CamCollectionManagerAo.h" +#include "CamWaitDialog.h" +#include "CamLocationSettingItem.h" +#include "camconfiguration.h" + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsList::CGSCamPhotoSettingsList +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCamPhotoSettingsList::CGSCamPhotoSettingsList( CCamStaticSettingsModel& aModel ) +: iModel( aModel ) + { + } + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsList::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CGSCamPhotoSettingsList::ConstructL( TBool aLaunchedFromGS, + TBool aSecondaryCameraSettings ) + { + CAknViewAppUi *AppUi = static_cast + ( CCoeEnv::Static()->AppUi() ); + + CGSCamcorderPlugin* parent = static_cast + ( AppUi->View( KGSCamcorderGSPluginUid ) ); + if ( parent ) + { + parent->LoadVideoStaticSettingsL( ETrue ); + parent->LoadPhotoStaticSettingsL( ETrue ); + } + + iLaunchedFromGS = aLaunchedFromGS; + iSecondaryCameraSettings = aSecondaryCameraSettings; + iSettings.ResetAndDestroy(); + iModel.Configuration().GetPsiIntArrayL( ECamPsiSupportedStillQualities, iSupportedQualityLevels ); + + TInt resId; + if ( iModel.UiConfigManagerPtr() && + iModel.UiConfigManagerPtr()->IsLocationSupported() ) + { + resId = R_CAM_PHOTO_SETTINGS_WITH_LOCATION_ITEM_LIST_CAMCORDER; + } + else + { + resId = R_CAM_PHOTO_SETTINGS_ITEM_LIST_CAMCORDER; + } + + if ( iSecondaryCameraSettings ) + { + resId = R_CAM_VIDEO_SETTINGS_ITEM_LIST_PORTRAIT; + } + + if ( iSecondaryCameraSettings ) + { + resId = R_CAM_PHOTO_SETTINGS_ITEM_LIST_PORTRAIT; + } + ConstructFromResourceL( resId ); + } + + +// Destructor +CGSCamPhotoSettingsList::~CGSCamPhotoSettingsList() + { + iSettings.ResetAndDestroy(); + iSettings.Close(); + iSupportedQualityLevels.Close(); + } + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsList::CreateSettingItemL +// From CAknSettingItemList Handles creating setting items +// --------------------------------------------------------------------------- +// +CAknSettingItem* CGSCamPhotoSettingsList::CreateSettingItemL( TInt aIdentifier ) + { + // Add storage place to storage list of settings values. + // ...create the storage place. + CAknViewAppUi *AppUi = static_cast + ( CCoeEnv::Static()->AppUi() ); + + CGSCamcorderPlugin* parent = static_cast + ( AppUi->View( KGSCamcorderGSPluginUid ) ); + + TIntSetting* newSetting = new( ELeave ) TIntSetting; + CleanupStack::PushL( newSetting ); + // ...set the identifier for this setting item. + newSetting->iItemId = aIdentifier; + if( aIdentifier != ECamSettingItemRestoreCameraSettings && parent ) + { + newSetting->iValueId = parent->IntegerSettingValue( aIdentifier ); + } + else + { + newSetting->iValueId = 0; + } + // ...add the new storage place item to the storage list. + iSettings.AppendL( newSetting ); + CleanupStack::Pop( newSetting ); + + // Create the list setting item + CAknSettingItem* settingItem = NULL; + TInt lastItem = iSettings.Count() - 1; + // Setting items take reference to the value to be manipulated. + TInt& valueId( iSettings[lastItem]->iValueId ); + + switch ( aIdentifier ) + { + case ECamSettingItemPhotoShowFocusPoint: + case ECamSettingItemShowCapturedPhoto: + { + settingItem = new( ELeave ) + CAknBinaryPopupSettingItem( aIdentifier, valueId ); + } + break; + + case ECamSettingItemPhotoDigitalZoom: + { + if ( iModel.UiConfigManagerPtr() && + iModel.UiConfigManagerPtr()->IsExtendedDigitalZoomSupported() ) + { + settingItem = new( ELeave ) + CAknEnumeratedTextPopupSettingItem( aIdentifier, valueId ); + } + } + break; + + case ECamSettingItemPhotoQuality: + { + if ( parent ) + { + iQualityValue = parent->IntegerSettingValue( ECamSettingItemPhotoQuality ); + } + if ( !iLaunchedFromGS ) + { + settingItem = new( ELeave ) + CGSCamQualitySettingItem( ECamControllerImage, + aIdentifier, + iQualityValue, + iModel + ); + } + else + { + settingItem = new( ELeave ) + CGSCustomQualitySettingItem( aIdentifier, + iQualityValue, + iModel, + ECamControllerImage + ); + } + } + break; + case ECamSettingItemPhotoCaptureTone: + { + settingItem = new( ELeave ) + CAknEnumeratedTextPopupSettingItem( aIdentifier, valueId ); + } + break; + + case ECamSettingItemImageRotation: + { + if ( iModel.UiConfigManagerPtr() && + iModel.UiConfigManagerPtr()->IsOrientationSensorSupported() ) + { + settingItem = + new( ELeave ) CAknBinaryPopupSettingItem( aIdentifier, valueId ); + } + } + break; + + case ECamSettingItemRestoreCameraSettings: + { + settingItem = new ( ELeave ) CAknBigSettingItemBase( aIdentifier ); + } + break; + + case ECamSettingItemPhotoMediaStorage: + { + // Convert the setting to a memory enum + iMemVal = static_cast + ( CamUtility::MapToSettingsListMemory( valueId ) ); + __ASSERT_DEBUG( iMemVal != KErrNotFound, + CamPanic( ECamPanicUnhandledCreateSettingItem ) ); + + // Get the root path of the default mass storage memory. + TInt driveInt; + TInt err = DriveInfo::GetDefaultDrive( iMemVal, driveInt ); + iDrive = static_cast(driveInt); + + settingItem = new ( ELeave ) + CAknMemorySelectionSettingItemMultiDrive( + aIdentifier, + iDrive ); + } + break; + + case ECamSettingItemPhotoNameBaseType: + { + if ( parent ) + { + iDefaultNameBase = parent->TextSettingValue( + ECamSettingItemPhotoNameBase ); + TBool flag = ( iLaunchedFromGS || iSecondaryCameraSettings ); + settingItem = + new( ELeave ) CGSCamDefaultNameSettingItem( iDefaultNameBase, + ECamControllerImage, + aIdentifier, + valueId, + flag ); + } + } + break; + + case ECamSettingItemRecLocation: + { + if ( !iLaunchedFromGS ) + { + settingItem = + new( ELeave ) CCamLocationSettingItem( ECamControllerImage, + aIdentifier, + valueId ); + } + else + { + settingItem = + new( ELeave ) CAknEnumeratedTextPopupSettingItem( aIdentifier, + valueId ); + } + } + break; + + default: + { + break; + } + } + return settingItem; + } + + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsList::EditItemL +// Launch the setting page for the current item by calling +// EditItemL on it. +// --------------------------------------------------------------------------- +// +void CGSCamPhotoSettingsList::EditItemL( TInt aIndex, TBool aCalledFromMenu ) + { + CAknViewAppUi *AppUi = static_cast( CCoeEnv::Static()->AppUi() ); + CGSCamcorderPlugin* parent = static_cast + ( AppUi->View( KGSCamcorderGSPluginUid ) ); + CAknSettingItemArray* itemArray = SettingItemArray(); + CAknSettingItem* editedItem = itemArray->At(aIndex); + + if ( editedItem->Identifier() == ECamSettingItemRestoreCameraSettings ) + { + TInt response = 0; + if ( parent ) + { + response = parent->DisplayRestoreSettingsDlgL(); + } + // If launched from GS and response "Yes" reload settings page to update values + if ( iLaunchedFromGS && response ) + { + AppUi->ActivateLocalViewL( KGSCamcorderGSPluginUid ); + } + return; + } + + // Edit item via setting page or in-place. + CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu ); + + // Write the new value for the edited control to its stored data. + editedItem->StoreL(); + + // Update the settings model so that the navipane is updated. + TInt settingValue; + // ...If the changed setting is the media storage setting + // ...then convert the memory value to settings model type value. + if ( editedItem->Identifier() == ECamSettingItemPhotoMediaStorage ) + { + iMemVal = static_cast(CamUtility::GetDriveTypeFromDriveNumber( iDrive )); + settingValue = CamUtility::MapFromSettingsListMemory( iMemVal ); + } + else if ( editedItem->Identifier() == ECamSettingItemPhotoQuality ) + { + settingValue = iQualityValue; + } + else + { + settingValue = ValueOfSetting( editedItem->Identifier() ); + } + + if ( parent ) + { + parent->SetIntegerSettingValueL( editedItem->Identifier(), settingValue ); + } + + // If the setting is for the photo base name then store the name. + if ( parent ) + { + parent->SetTextSettingValueL( ECamSettingItemPhotoNameBase, + iDefaultNameBase ); + } + + } + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsList::ValueOfSetting +// Returns the current value of the a setting for this list. +// Note, this is not the value currently stored in the settings model, as these +// may differ. +// --------------------------------------------------------------------------- +// +TInt CGSCamPhotoSettingsList::ValueOfSetting( TInt aItemId ) const + { + TInt itemIndex = IndexOfSetting( aItemId ); + return iSettings[itemIndex]->iValueId; + } + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsList::IndexOfSetting +// Returns the array index of a setting for this list. +// --------------------------------------------------------------------------- +// +TInt CGSCamPhotoSettingsList::IndexOfSetting( TInt aItemId ) const + { + TInt i; + TInt itemTotal = iSettings.Count(); + for ( i = 0; i < itemTotal; ++i ) + { + if ( iSettings[i]->iItemId == aItemId ) + { + return i; + } + } + + // Should never get here. + // Remove lint warning + return KErrNotFound; + } + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsList::SizeChanged +// Set the size and position of component controls. +// --------------------------------------------------------------------------- +// +void CGSCamPhotoSettingsList::SizeChanged() + { + CAknSettingItemList::SizeChanged(); + + CEikListBox* lb = ListBox(); + if( lb ) + { + lb->SetRect( Rect() ); // Set container's rect to listbox + } + } + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamPhotoSettingsView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamPhotoSettingsView.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,242 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image settings view +* +*/ + + +// INCLUDE FILES + +#include +#include +#include +#include // CAknTitlePane +#include +#include +#include +#include +#include +#include +#include "CamAppUid.h" +#include "GSCamcorderPlugin.h" +#include "GSCamcorderPlugin.hrh" +#include "Cam.hrh" +#include "GSCamPhotoSettingsView.h" +#include "GSCamcorderPlugin.h" +#include "CamLocalViewIds.h" +#include "GSCamcorderSettingsBaseView.h" + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsView::CGSCamPhotoSettingsView +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCamPhotoSettingsView::CGSCamPhotoSettingsView( CCamStaticSettingsModel& aModel ) +: CGSCamcorderSettingsBaseView( aModel, ETrue ) + { + } + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsView::NewLC +// Symbian OS two-phased constructor. +// --------------------------------------------------------------------------- +// +CGSCamPhotoSettingsView* CGSCamPhotoSettingsView::NewLC( + CCamStaticSettingsModel& aModel, + CArrayPtrFlat* aTabViewArray ) + { + CGSCamPhotoSettingsView* self = + new ( ELeave ) CGSCamPhotoSettingsView( aModel ); + CleanupStack::PushL( self ); + self->ConstructL( aTabViewArray ); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsView::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CGSCamPhotoSettingsView::ConstructL( CArrayPtrFlat* aTabViewArray ) + { + iTabHelper = CGSTabHelper::NewL(); + aTabViewArray->AppendL(this); + BaseConstructL( R_CAM_SETTING_LIST_VIEW ); + } + + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsView::~CGSCamPhotoSettingsView +// Destructor +// --------------------------------------------------------------------------- +// +CGSCamPhotoSettingsView::~CGSCamPhotoSettingsView() + { + delete iTabHelper; + iTabHelper = NULL; + } + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsView::Id +// From CAknView, returns Uid of View +// --------------------------------------------------------------------------- +// +TUid CGSCamPhotoSettingsView::Id() const + { + return KGSCamImageSettingsViewId; + } + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsView::HandleCommandL +// --------------------------------------------------------------------------- +// +void CGSCamPhotoSettingsView::HandleCommandL( TInt aCommand ) + { + const TVwsViewId KImagePreCaptureView ( TUid::Uid( KCameraappUID ), KImagePreCaptureId ); + switch ( aCommand ) + { + case EAknSoftkeyBack: + { + if ( LaunchedFromGS() ) + { + AppUi()->ActivateLocalViewL( KGSCamcorderGSPluginUid ); + + } + + else + { + AppUi()->ActivateViewL( KImagePreCaptureView, + TUid::Uid( aCommand ), + KNullDesC8 ); + } + + + break; + } + case ECamCmdInternalExit: + { + if ( LaunchedFromGS() ) + { + AppUi()->HandleCommandL( EAknCmdExit ); + } + else + { + //To ensure that camera resources are released when exiting + //settings, we need to call internal exit here to close the + //camera completely + AppUi()->HandleCommandL( aCommand ); + } + } + break; + default: + { + CGSCamcorderSettingsBaseView::HandleCommandL( aCommand ); + break; + } + } + } + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsView::DoActivateL +// Activate this view +// --------------------------------------------------------------------------- +// +void CGSCamPhotoSettingsView::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + CGSCamcorderPlugin* parent = + static_cast ( + AppUi()->View( KGSCamcorderGSPluginUid ) ); + + if ( aCustomMessageId == TUid::Uid( KGSSecondaryCameraPhotoSettingsView ) ) + { + RDebug::Print(_L("[CGSCamcorderPlugin] DoActivateL()1" )); + if( parent) + { + parent->SetSecondaryCameraSettings( ETrue ); + } + } + else + { + parent->SetSecondaryCameraSettings( EFalse ); + } + + CGSCamcorderSettingsBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + //StatusPane()->MakeVisible( ETrue ); + + if( parent ) + { + if ( LaunchedFromGS() ) + { + iTabHelper->CreateTabGroupL( Id(), + static_cast*> + ( parent->TabbedViews() ) ); + } + } + } + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsView::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CGSCamPhotoSettingsView::DoDeactivate() + { + CGSCamcorderSettingsBaseView::DoDeactivate(); + iTabHelper->RemoveTabGroup(); + } + + +// --------------------------------------------------------------------------- +// CGSCamPhotoSettingsView::CreateTabIconL() +// Creates icon for tab. +// --------------------------------------------------------------------------- +// +CGulIcon* CGSCamPhotoSettingsView::CreateTabIconL() + { + TParse* fp = new(ELeave) TParse(); + CleanupStack::PushL( fp ); + TInt err = fp->Set(KDirAndFile, &KDC_APP_BITMAP_DIR, NULL); + + if (err != KErrNone) + { + User::Leave(err); + } + + TBuf fileName = fp->FullName(); + CleanupStack::PopAndDestroy( fp ); //fp + + CGulIcon* icon; + + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDDefault, + fileName, + EMbmCamerasettingspluginQgn_lcam_gen_sett_camera_tab_image, + EMbmCamerasettingspluginQgn_lcam_gen_sett_camera_tab_image ); + + return icon; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamQualitySettingContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamQualitySettingContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,699 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements the quality slider for image and video settings* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // CAknTitlePane +#include +#include + +#include "CamAppUiBase.h" +#include "GSCamQualitySettingContainer.h" +#include "GSCamQualitySettingSlider.h" +#include "CamUtility.h" +#include "camuiconstants.h" +#include "MCamAppController.h" +#include "CamControllerObservers.h" +#include "MCamStaticSettings.h" + +#include "camconfiguration.h" + +// CONSTANTS +const TUint KMaxRemainingImagesShown = 9999; + +_LIT( KRemainingImagesNumberFormat, "%04d" ); + +// MACROS + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::CGSCamQualitySettingContainer +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CGSCamQualitySettingContainer::CGSCamQualitySettingContainer( + MCamAppController& aController, + TCamCameraMode aMode, + CCoeControl* aParent ) + : iController( aController ), + iParent( aParent ), + iMode ( aMode ) + { + TInt key = (ECamControllerVideo == iMode) + ? ECamSettingItemVideoMediaStorage + : ECamSettingItemPhotoMediaStorage; + // Get the total remaining record time from the controller + iStorageLocation = + static_cast( iController.IntegerSettingValue( key ) ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingContainer::ConstructL() + { + CCamAppUiBase* appUi = static_cast( CCoeEnv::Static()->AppUi() ); + MCamStaticSettings& model = appUi->StaticSettingsModel(); + iController.AddControllerObserverL( this ); + + TCamSettingItemIds settingType = ( ECamControllerVideo == iMode ) + ? ECamSettingItemVideoQuality + : ECamSettingItemPhotoQuality; + + iSlider = CGSCamQualitySettingSlider::NewL( iParent, this, settingType, 0, + &(model.Configuration()) ); + + + iSelectedQuality = model.IntegerSettingValue( settingType ); + + iTimeFormat = ( ECamControllerVideo == iMode ) + ? iEikonEnv->AllocReadResourceL( R_QTN_TIME_DURAT_LONG ) + : KRemainingImagesNumberFormat().AllocL(); + + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + + // ...phone memory icon + AknIconUtils::CreateIconL( iPhoneIcon, + iPhoneIconMask, + resname, + EMbmCameraappQgn_indi_cam4_memory_phone, + EMbmCameraappQgn_indi_cam4_memory_phone_mask ); + + // ...mmc icon + AknIconUtils::CreateIconL( iMMCIcon, + iMMCIconMask, + resname, + EMbmCameraappQgn_indi_cam4_memory_mmc, + EMbmCameraappQgn_indi_cam4_memory_mmc_mask ); + + // ...mass storage icon + AknIconUtils::CreateIconL( iMassStorageIcon, + iMassStorageIconMask, + resname, + EMbmCameraappQgn_indi_cam4_memory_mass, + EMbmCameraappQgn_indi_cam4_memory_mass_mask ); + + UpdateRemainingTextL(); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CGSCamQualitySettingContainer* +CGSCamQualitySettingContainer::NewL( MCamAppController& aController, + TCamCameraMode aMode, + CCoeControl* aParent ) + { + CGSCamQualitySettingContainer* self = + new( ELeave ) CGSCamQualitySettingContainer( aController, aMode, aParent ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::~CGSCamQualitySettingContainer +// Destructor +// ----------------------------------------------------------------------------- +// +CGSCamQualitySettingContainer::~CGSCamQualitySettingContainer() + { + PRINT( _L("Camera => ~CGSCamQualitySettingContainer") ); + CCamAppUiBase* appUi = static_cast( iEikonEnv->AppUi() ); + if ( appUi ) + { + TInt resId = ( ECamControllerVideo == iMode ) + ? R_CAM_VIDEO_SETTINGS_TITLE_NAME + : R_CAM_PHOTO_SETTINGS_TITLE_NAME; + + TRAP_IGNORE( appUi->SetTitleL( resId ) ); + } + iController.RemoveControllerObserver( this ); + delete iPhoneIcon; + delete iPhoneIconMask; + delete iMMCIcon; + delete iMMCIconMask; + delete iMassStorageIcon; + delete iMassStorageIconMask; + + delete iTimeFormat; + + // delete descriptors from arrays + if ( iTitleArray ) + { + iTitleArray->Reset(); + delete iTitleArray; + } + if ( iDescArray ) + { + iDescArray->Reset(); + delete iDescArray; + } + if ( iCurrentDescLineArray ) + { + iCurrentDescLineArray->Reset(); + delete iCurrentDescLineArray; + } + + iLayoutSettingDescLines.Reset(); + iEnumArray.Reset(); + if ( iFeedback ) + { + iFeedback->RemoveFeedbackForControl( iSlider ); + } + delete iSlider; + delete iTextTitle; + delete iTextTopSubtitle; + delete iTextBottomSubtitle; + delete iTextRemainingTitle; + + iSupportedQualitiesArray.Close(); + PRINT( _L("Camera <= ~CGSCamQualitySettingContainer") ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::SelectedQuality +// Returns the quality selected by the slider +// ----------------------------------------------------------------------------- +// +TInt CGSCamQualitySettingContainer::SelectedQuality() const + { + return iSelectedQuality; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::ConstructFromResourceL +// Constructs the container from the resource +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingContainer::ConstructFromResourceL( TResourceReader& aReader ) + { + CCamAppUiBase* appUi = static_cast( iEikonEnv->AppUi() ); + // set up the container windows here as setting page window + // isn't created until CAknSettingPage::ConstructFromResourceL is called + SetContainerWindowL( *iParent ); + iSlider->SetContainerWindowL( *iParent ); + + // read the texts from the resource file + iTextTitle = aReader.ReadHBufCL(); + appUi->SetTitleL( iTextTitle->Des() ); + iTextTopSubtitle = aReader.ReadHBufCL(); + iTextBottomSubtitle = aReader.ReadHBufCL(); + iTextRemainingTitle = aReader.ReadHBufCL(); + + TCamPsiKey key = ( ECamControllerVideo == iMode ) + ? ECamPsiSupportedVideoQualities + : ECamPsiSupportedStillQualities; + + + iConfiguration = &(appUi->StaticSettingsModel().Configuration()); + iConfiguration->GetPsiIntArrayL( key, iSupportedQualitiesArray ); + + iTitleArray = new( ELeave ) CDesCArrayFlat( 1 ); + iDescArray = new( ELeave ) CDesCArrayFlat( 1 ); + + // read the descriptive text and split the text into 3 lines + ReadInTextArrayL( aReader, *iTitleArray ); + ReadInTextArrayL( aReader, *iDescArray ); + + // Read the setting enums that match with the text arrays. + TInt count = aReader.ReadInt16(); + TInt suppCount = iSupportedQualitiesArray.Count(); + + TInt i = 0; + TInt j = 0; + + for ( i = 0; i < count && j < suppCount ; i++ ) + { + TInt val = aReader.ReadInt16(); + + // check if it's a supported quality level + if ( i == iSupportedQualitiesArray[j] ) + { + if ( ECamControllerVideo == iMode ) + { + User::LeaveIfError( iEnumArray.Append( static_cast( val ) ) ); + } + else + { + User::LeaveIfError( iEnumArray.Append( static_cast( val ) ) ); + } + j++; + } + } + + // TCamImageQualitySetting enum starts with highest quality == 0 + // so convert this to value the slider understands i.e. 0 == lowest + TInt sliderValue = iEnumArray.Count() - 1 - iSelectedQuality; + + iSlider->InitializeL( sliderValue, iTextTopSubtitle, iTextBottomSubtitle ); + + // Set the new range of values + iSlider->SetRange( 0, iEnumArray.Count() - 1 ); + + iCurrentDescLineArray = new( ELeave ) CArrayFixFlat( 3 ); + // Use the layout info from the first line for width and font + TAknLayoutText layout = iLayoutSettingDescLines[0]; + AknTextUtils::WrapToArrayL( ( *iDescArray )[iSelectedQuality], + layout.TextRect().Width(), + *( layout.Font() ), + *iCurrentDescLineArray ); + iFeedback = MTouchFeedback::Instance(); + if ( iFeedback ) + { + iFeedback->SetFeedbackArea( iSlider, 0, iSlider->Rect(), + ETouchFeedbackBasic, ETouchEventStylusDown ); + } + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::CountComponentControls +// return the number of component controls +// ----------------------------------------------------------------------------- +// +TInt CGSCamQualitySettingContainer::CountComponentControls() const + { + return 1; // the slider + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::ComponentControl +// return the control at a given index +// ----------------------------------------------------------------------------- +// +CCoeControl* CGSCamQualitySettingContainer::ComponentControl( TInt /*aIndex*/ ) const + { + return iSlider; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::Draw +// Draws the container +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingContainer::Draw( const TRect& /*aRect*/ ) const + { + PRINT( _L("Camera => CGSCamQualitySettingContainer::Draw") ); + CWindowGc& gc = SystemGc(); + + // Draw skin background + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, gc, Rect() ); + + // draw the title text + TRgb color; + AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + + // draw the quality description text + DrawQualityTexts( gc, color ); + + // draw the remaining images/remaining video time + iLayoutRemainingTitle.DrawText( gc, iTextRemainingTitle->Des(), ETrue, color ); + + // draw the remaining images/remaining video time + TBufC<40> Buf( iTextRemaining ); + TPtr Pointer = Buf.Des(); + AknTextUtils::LanguageSpecificNumberConversion( Pointer ); + iLayoutRemainingText.DrawText( gc, /*iTextRemaining*/Buf, ETrue, color ); + + // draw the current location icon + DrawStorageIcon( gc ); + + PRINT( _L("Camera <= CGSCamQualitySettingContainer::Draw") ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::SizeChanged +// Handles a change in the size of the control +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingContainer::SizeChanged() + { + TRAP_IGNORE( ReadLayoutL() ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::OfferKeyEventL +// Handles key events +// ----------------------------------------------------------------------------- +// +TKeyResponse CGSCamQualitySettingContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse keyResponse = iSlider->OfferKeyEventL( aKeyEvent, aType ); + if ( keyResponse == EKeyWasConsumed ) + { + ReportEventL( MCoeControlObserver::EEventStateChanged ); + } + return keyResponse; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::HandleSettingValueUpdateL +// Handles a change to the setting value of the slider +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingContainer::HandleSettingValueUpdateL( TInt aNewValue ) + { + ASSERT ( aNewValue >= 0 && + aNewValue < iEnumArray.Count() ); + + // The slider values range from Max at the top (eg 5) to Min at the bottom (0). + // For quality settings enum (0 is Max, 4 is Min) need to invert this + TInt index = iSlider->MaxValue() - aNewValue; + if ( ECamControllerVideo == iMode ) + { + iSelectedQuality = index; + } + else + { + iSelectedQuality = index; + } + + // remove the old lines + iCurrentDescLineArray->Reset(); + // Use the layout info from the first line for width and font + TAknLayoutText layout = iLayoutSettingDescLines[0]; + AknTextUtils::WrapToArrayL( ( *iDescArray )[iSelectedQuality], + layout.TextRect().Width(), + *( layout.Font() ), + *iCurrentDescLineArray ); + + /* - + // Update the number of images remaining + UpdateRemainingTextL(); + */ + // + + ResetRemainingTextL(); + + // Results in a call to CCamQualitySettingPage::UpdateSettingL() + ReportEventL( MCoeControlObserver::EEventStateChanged ); + + /*ActivateGc(); + Window().Invalidate( iLayoutDescRect.Rect() ); + DeactivateGc();*/ + DrawNow(); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::HandleControllerEventL +// Handles a change in the controller +// ----------------------------------------------------------------------------- +// + +void CGSCamQualitySettingContainer::HandleControllerEventL( + TCamControllerEvent aEvent, TInt /*aError*/ ) + + { + PRINT( _L("Camera => CGSCamQualitySettingContainer::HandleControllerEventL") ); + CCamAppUiBase* appUi = static_cast( iEikonEnv->AppUi() ); + TBool redrawNeeded = EFalse; + // If this is a capture complete event, or the image quality or save + // location has changed... + if ( aEvent == ECamEventImageQualityChanged || + aEvent == ECamEventSaveLocationChanged || + aEvent == ECamEventVideoQualityChanged ) + { + UpdateRemainingTextL(); + + if ( aEvent == ECamEventSaveLocationChanged ) + { + /*TCamSettingItemIds storageLocation = ( ECamControllerVideo == iMode) + ? ECamSettingItemVideoMediaStorage + : ECamSettingItemPhotoMediaStorage;*/ + // update location + /*if ( static_cast( iEikonEnv->AppUi() )->IsMMCRemovedNotePending() ) + { + iStorageLocation = static_cast< TCamMediaStorage > + ( iController.IntegerSettingValueUnfiltered( storageLocation ) ); + } + else + { + iStorageLocation = static_cast< TCamMediaStorage > + ( iController.IntegerSettingValue( storageLocation ) ); + }*/ + } + + redrawNeeded = ETrue; + } + else + { + // Other events: no action + } + + + if ( redrawNeeded ) + { + DrawNow(); + } + PRINT( _L("Camera <= CGSCamQualitySettingContainer::HandleControllerEventL") ); + } + + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::ReadLayoutL +// Reads the layout information from the resource file +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingContainer::ReadLayoutL() + { + TAknLayoutRect settingLayout; + settingLayout.LayoutRect( Rect(), AknLayoutScalable_Apps::main_cam_set_pane( 0 ) ); + TRect settingRect( settingLayout.Rect() ); + + AknLayoutUtils::LayoutControl( iSlider, settingRect, AknLayoutScalable_Apps::main_cset_slider_pane( 2 ) ); + + // set the layouts for the rects + // containing the descriptions + TRect infoboxRect; + iLayoutDescRect.LayoutRect( settingRect, AknLayoutScalable_Apps::main_cset_text_pane( 0 ) ); + infoboxRect = iLayoutDescRect.Rect(); + + // set quality setting title layout + iLayoutSettingTitle.LayoutText( infoboxRect, AknLayoutScalable_Apps::main_cset_text_pane_t1( 0 ) ); + + // set layouts for 3 lines of descriptive text + iLayoutSettingDescLines.Reset(); + TAknLayoutText layout; + layout.LayoutText( infoboxRect, AknLayoutScalable_Apps::main_cset_text_pane_t2( 0 ) ); + User::LeaveIfError( iLayoutSettingDescLines.Append( layout ) ); + layout.LayoutText( infoboxRect, AknLayoutScalable_Apps::main_cset_text_pane_t3( 0 ) ); + User::LeaveIfError( iLayoutSettingDescLines.Append( layout ) ); + layout.LayoutText( infoboxRect, AknLayoutScalable_Apps::main_cset_text_pane_t4( 0 ) ); + User::LeaveIfError( iLayoutSettingDescLines.Append( layout ) ); + + // set remaining text layouts + iLayoutRemainingTitle.LayoutText( infoboxRect, AknLayoutScalable_Apps::main_cset_text_pane_t6( 0 ) ); + iLayoutRemainingText.LayoutText( infoboxRect, AknLayoutScalable_Apps::main_cset_text_pane_t7( 0 ) ); + // read the storage icon layout + iLayoutIcon.LayoutRect( infoboxRect, AknLayoutScalable_Apps::main_cset_text_pane_g1( 0 ) ); + + // set size for different memory type icons + TSize iconSize ( iLayoutIcon.Rect().Size() ); + AknIconUtils::SetSize( iPhoneIcon, iconSize, EAspectRatioPreserved ); + AknIconUtils::SetSize( iMMCIcon, iconSize, EAspectRatioPreserved ); + AknIconUtils::SetSize( iMassStorageIcon, iconSize, EAspectRatioPreserved ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingContainer::DrawQualityTexts +// Draws the quality information texts +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingContainer::DrawQualityTexts( CWindowGc& aGc, TRgb aColor ) const + { + // Set the brushstyle to ENullBrush in order to not show the + // text background box. Otherwise it would show slightly from + // beneath the shaded background + //aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + iLayoutSettingTitle.DrawText + ( aGc, ( *iTitleArray )[iSelectedQuality], ETrue, aColor ); + + TInt count = Min( iCurrentDescLineArray->Count(), iLayoutSettingDescLines.Count() ); + + for ( TInt i = 0; i < count; i++ ) + { + if ( i < count ) + { + iLayoutSettingDescLines[i]. + DrawText( aGc, ( *iCurrentDescLineArray )[i], ETrue, aColor ); + } + } + } + +// --------------------------------------------------------- +// CGSCamQualitySettingContainer::DrawStorageIcon +// Draw the icon for the media storage location +// --------------------------------------------------------- +// +void CGSCamQualitySettingContainer::DrawStorageIcon( CWindowGc& aGc ) const + { + CFbsBitmap* icon = NULL; + CFbsBitmap* mask = NULL; + if ( iStorageLocation == ECamMediaStoragePhone ) + { + icon = iPhoneIcon; + mask = iPhoneIconMask; + } + else if ( iStorageLocation == ECamMediaStorageMassStorage ) + { + icon = iMassStorageIcon; + mask = iMassStorageIconMask; + } + else + { + icon = iMMCIcon; + mask = iMMCIconMask; + } + + iLayoutIcon.DrawImage( aGc, icon, mask ); + } + +// --------------------------------------------------------- +// CGSCamQualitySettingContainer::DrawRemainingText +// Draw the remaining image count/video time +// --------------------------------------------------------- +// +void CGSCamQualitySettingContainer::DrawRemainingText( CWindowGc& aGc ) const + { + // Set the brushstyle to ENullBrush in order to not show the + // text background box. Otherwise it would show slightly from + // beneath the shaded background + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + aGc.Clear( iLayoutRemainingText.TextRect() ); + iLayoutRemainingText.DrawText( aGc, iTextRemaining ); + } + +// --------------------------------------------------------- +// CGSCamQualitySettingContainer::UpdateRemainingTextL +// Update the remaining image count/video time remaining +// --------------------------------------------------------- +// +void CGSCamQualitySettingContainer::UpdateRemainingTextL() + { + PRINT( _L("Camera => CGSCamQualitySettingContainer::UpdateRemainingTextL") ); + + if ( ECamControllerVideo == iMode ) + { + // Get the total remaining record time from the controller + TTime time ( iController.RecordTimeRemaining().Int64() ); +/* - + HBufC* timeFormat = + iEikonEnv->AllocReadResourceLC( R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO ); + time.FormatL( iTextRemaining, *timeFormat ); + CleanupStack::PopAndDestroy( timeFormat ); +*/ +// + + time.FormatL( iTextRemaining, *iTimeFormat ); + } + else + { + // use the stored image resolution to calculated the remaining images + TBool burstActive = static_cast + ( iEikonEnv->AppUi() )->IsBurstEnabled(); + + TInt imagesLeft = iController.ImagesRemaining( ECamMediaStorageCurrent, + burstActive, + iSelectedQuality ); + TInt showLeft = Min( imagesLeft, KMaxRemainingImagesShown ); +// - +// iTextRemaining.Format( KRemainingImagesNumberFormat, showLeft ); +// + + iTextRemaining.Format( *iTimeFormat, showLeft ); + } + + PRINT( _L("Camera <= CGSCamQualitySettingContainer::UpdateRemainingTextL") ); + } + +// --------------------------------------------------------- +// ResetRemainingTextL +// --------------------------------------------------------- +// +void +CGSCamQualitySettingContainer::ResetRemainingTextL() + { + /* mm: Disabled for now. Below code sets to 00:00. + Proposed --:-- for video, no action for image (too fast). + if ( ECamControllerVideo == iMode ) + { + TTime time( TInt64( 0 ) ); + time.FormatL( iTextRemaining, *iTimeFormat ); + } + else + { + } + */ + } + +// --------------------------------------------------------- +// CGSCamQualitySettingContainer::ReadInTextArrayL +// Populate a text array from the resource definition of available +// quality texts using the supported quality values +// --------------------------------------------------------- +// +void CGSCamQualitySettingContainer::ReadInTextArrayL( TResourceReader& aReader, CDesCArrayFlat& aArray ) + { + CDesCArrayFlat* tempArray; + tempArray = aReader.ReadDesC16ArrayL(); + + TInt descCount = tempArray->Count(); + TInt suppCount = iSupportedQualitiesArray.Count(); + + TInt i = 0; + + for ( i = 0; i < suppCount; i++ ) + { + TInt descriptionIndex = + iConfiguration->MapSupportedQualityToQualityDescriptor( + iMode == ECamControllerVideo, + iSupportedQualitiesArray[i] ); + + if ( descriptionIndex >= 0 + && descriptionIndex < descCount ) + { + aArray.AppendL( ( *tempArray )[descriptionIndex] ); + } + } + tempArray->Reset(); + delete tempArray; + tempArray = NULL; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamQualitySettingItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamQualitySettingItem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item type for Image/Video quality.* +*/ + + + +// INCLUDE FILES +#include "GSCamQualitySettingItem.h" +#include "GSCamQualitySettingPage.h" +#include "CamUtility.h" +#include "CamStaticSettingsModel.h" + +#include "camconfiguration.h" + +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== +// --------------------------------------------------------------------------- +// CGSCamQualitySettingItem::CGSCamQualitySettingItem +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCamQualitySettingItem::CGSCamQualitySettingItem( + TCamCameraMode aMode, + TInt aIdentifier, + TInt& aValue, + CCamStaticSettingsModel& aModel ) + : CAknEnumeratedTextPopupSettingItem( aIdentifier, aValue ), + iMode( aMode ), + iModel( aModel ) + { + } + + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingItem::~CGSCamQualitySettingItem +// Destructor. +// --------------------------------------------------------------------------- +// +CGSCamQualitySettingItem::~CGSCamQualitySettingItem() + { + PRINT( _L("Camera => ~CGSCamQualitySettingItem") ); + iSupportedQualitiesArray.Reset(); + PRINT( _L("Camera <= ~CGSCamQualitySettingItem") ); + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingItem::CreateSettingPageL +// Framework method for constructing the launching setting page. +// --------------------------------------------------------------------------- +// +CAknSettingPage* CGSCamQualitySettingItem::CreateSettingPageL() + { + PRINT( _L("Camera => CGSCamQualitySettingItem::CreateSettingPageL") ); + // Create an instance of our customized setting page. + TPtrC settingName = SettingName(); + CAknSettingPage* page = + new( ELeave ) CGSCamQualitySettingPage( iMode, + settingName, + SettingNumber(), + EAknCtPopupSettingList, + SettingEditorResourceId(), + SettingPageResourceId(), + *QueryValue() ); + PRINT( _L("Camera <= CGSCamQualitySettingItem::CreateSettingPageL") ); + return page; + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingItem::CompleteConstructionL +// +// --------------------------------------------------------------------------- +// +void CGSCamQualitySettingItem::CompleteConstructionL() + { + PRINT( _L("Camera => CGSCamQualitySettingItem::CompleteConstructionL") ); + CAknEnumeratedTextPopupSettingItem::CompleteConstructionL(); + + // make sure we only have the supported items in our text array + CArrayPtr* array = EnumeratedTextArray(); + + TBool isVideoMode = (ECamControllerVideo == iMode); + + TCamPsiKey key = isVideoMode + ? ECamPsiSupportedVideoQualities + : ECamPsiSupportedStillQualities; + + iModel.Configuration().GetPsiIntArrayL( key, iSupportedQualitiesArray ); + + iSupportedQualitiesArray.Sort(); + + // amend list of supported settings + TInt sCount = iSupportedQualitiesArray.Count(); + + TInt cnt = array->Count(); + TInt j = --sCount; + TInt i; + + for ( i = cnt; --i >= 0; ) + { + if( j < 0 || + i != iModel.Configuration().MapSupportedQualityToQualityDescriptor( + isVideoMode, + iSupportedQualitiesArray[j] ) + ) + { + delete ( array->At( i ) ); + array->Delete( i ); + } + else + { + j--; + } + } + // Reset the enum values in the resource, so that the updated list has the + // new values starting from 0 + for( i = 0; i < array->Count(); i++ ) + { + array->At(i)->SetEnumerationValue( i ); + } + +#ifdef _DEBUG + PRINT( _L("Camera <> ===============================================") ); + PRINT( _L("Camera <> Quality setting item texts left:") ); + for( i = 0; i < array->Count(); i++ ) + { + PRINT2( _L("Camera <> Quality (%d): %S"), + i, + array->At(i)->Value() ); + } + PRINT( _L("Camera <> ===============================================") ); +#endif + + PRINT( _L("Camera <= CGSCamQualitySettingItem::CompleteConstructionL") ); + } + +// End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamQualitySettingPage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamQualitySettingPage.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,309 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for Image/Video quality.* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include "GSCamQualitySettingPage.h" +#include "GSCamQualitySettingContainer.h" +#include "CamUtility.h" +#include "MCamAppController.h" +#include "CamAppUiBase.h" +#include + + +// ============================ MEMBER FUNCTIONS =============================== +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::CGSCamQualitySettingPage +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCamQualitySettingPage::CGSCamQualitySettingPage( + TCamCameraMode aMode, + TDesC& aSettingTitleText, + TInt aSettingNumber, + TInt aControlType, + TInt aEditorResourceId, + TInt aSettingPageResourceId, + MAknQueryValue& aQueryValue ) + : CAknSettingPage( &aSettingTitleText, + aSettingNumber, + aControlType, + aEditorResourceId, + aSettingPageResourceId ), + iQueryValue( aQueryValue ), + iController( static_cast( CCoeEnv::Static()->AppUi() )->AppController() ), + iMode( aMode ) + { + } +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::~CGSCamQualitySettingPage +// C++ destructor +// --------------------------------------------------------------------------- +// +CGSCamQualitySettingPage::~CGSCamQualitySettingPage() + { + PRINT( _L("Camera => ~CGSCamQualitySettingPage") ); + delete iQualityContainer; + + if ( iTimer && iTimer->IsActive() ) + { + iTimer->Cancel(); + } + delete iTimer; + + TRAP_IGNORE( iController.CancelPreviewChangesL() ); + PRINT( _L("Camera <= ~CGSCamQualitySettingPage") ); + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::ConstructL +// Construct the setting page +// --------------------------------------------------------------------------- +// +void CGSCamQualitySettingPage::ConstructL() + { + // create the timer used for callbacks + iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + // this needs to be created before BaseConstructL as it sets the + // size of the setting page which will result in SizeChanged being called + iQualityContainer = CGSCamQualitySettingContainer::NewL( iController, + iMode, + this ); + BaseConstructL(); + + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::UpdateSettingL +// Called when the state of quality control changes +// --------------------------------------------------------------------------- +// +void CGSCamQualitySettingPage::UpdateSettingL() + { + TBool settingValueEnabled = ETrue; + iCurrentVal = iQualityContainer->SelectedQuality(); + + if ( ECamControllerVideo == iMode ) + { + iSettingItemId = ECamSettingItemVideoQuality; + } + else + { + iSettingItemId = ECamSettingItemPhotoQuality; + } + + // Inform the base setting page class + SetDataValidity( settingValueEnabled ); + UpdateCbaL(); + + // If the list item is enabled update the image/video count to + // let the user know how this item would affect the remaining images/videos + if ( settingValueEnabled ) + { + if ( iTimer->IsActive() ) + { + iTimer->Cancel(); + } + iTimer->Start( 10*1000, + 10*1000, + TCallBack( PreviewSettingChange, this ) ); + } + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::ProcessCommandL +// Processes events from the softkeys. +// --------------------------------------------------------------------------- +// +void CGSCamQualitySettingPage::ProcessCommandL( TInt aCommandId ) + { + HideMenu(); + + // Respond to softkey events + switch ( aCommandId ) + { + case EAknSoftkeyOk: + case EAknSoftkeySelect: + SelectCurrentItemL(); + AttemptExitL( ETrue ); + iCurrentVal = iQualityContainer->SelectedQuality(); + iController.CommitPreviewChanges(); + break; + case EAknSoftkeyCancel: + AttemptExitL( EFalse ); + iController.CancelPreviewChangesL(); + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::PostDisplayCheckL +// Customises some of the functionality so that the custom quality control +// is used instead of the base classes editor control +// --------------------------------------------------------------------------- +// +TBool CGSCamQualitySettingPage::PostDisplayCheckL() + { + // don't use the editor control in the base class + // use the quality control instead. + iQualityContainer->SetObserver( this ); + return CAknSettingPage::PostDisplayCheckL(); + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::SelectCurrentItemL +// Uses the query value to inform the setting item that +// a new quality has been selected +// --------------------------------------------------------------------------- +// +void CGSCamQualitySettingPage::SelectCurrentItemL() + { + iQueryValue.SetCurrentValueIndex( iQualityContainer->SelectedQuality() ); + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::ConstructFromResourceL +// Constructs the quality container from the resource file +// --------------------------------------------------------------------------- +// +void CGSCamQualitySettingPage::ConstructFromResourceL( TResourceReader& aReader ) + { + // setting page window is created in the base class + CAknSettingPage::ConstructFromResourceL( aReader ); + + TInt resourceId = ( ECamControllerVideo == iMode ) + ? R_CAM_SETTING_VIDEO_QUALITY_SLIDER + : R_CAM_SETTING_PHOTO_QUALITY_SLIDER; + + TResourceReader reader; + iCoeEnv->CreateResourceReaderLC( reader, resourceId ); + iQualityContainer->ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); //reader + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::CountComponentControls +// Returns the number of component controls +// --------------------------------------------------------------------------- +// +TInt CGSCamQualitySettingPage::CountComponentControls() const + { + return 1; // the quality container + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::ComponentControl +// Returns the control at the given index +// --------------------------------------------------------------------------- +// +CCoeControl* CGSCamQualitySettingPage::ComponentControl( TInt /*aIndex*/ ) const + { + return iQualityContainer; + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::Draw +// Draws the setting page +// --------------------------------------------------------------------------- +// +void CGSCamQualitySettingPage::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushColor( KRgbWhite ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.DrawRect( Rect() ); + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::SizeChanged +// Handles a change in the size of the page +// --------------------------------------------------------------------------- +// +void CGSCamQualitySettingPage::SizeChanged() + { + CAknSettingPage::SizeChanged(); + + AknLayoutUtils::LayoutControl( iQualityContainer, Rect(), AknLayoutScalable_Apps::main_cam_set_pane_g1( 6 ) ); + + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::OfferKeyEventL +// Handles the key event +// --------------------------------------------------------------------------- +// +TKeyResponse +CGSCamQualitySettingPage::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // Always react to Escape key by cancelling the setting page + if ( aType == EEventKey && aKeyEvent.iCode == EKeyEscape) + { + ProcessCommandL( EAknSoftkeyCancel ); + return EKeyWasConsumed; + } + + // Only handle other key events if we're focused + if ( IsFocused() ) + { + // Abstraction of key events: Escape is handled like Cancel + // OK key is handled like the Select softkey by default + if ( aType == EEventKey && aKeyEvent.iCode == EKeyOK ) + { + if ( aKeyEvent.iRepeats != 0 ) + { + return EKeyWasConsumed; + } + if ( DataValidity() ) + { + ProcessCommandL( EAknSoftkeySelect ); + } + return EKeyWasConsumed; + } + } + + // offer the key to the quality container class + // if not handled by the setting page + return iQualityContainer->OfferKeyEventL( aKeyEvent, aType ); + } + +// --------------------------------------------------------------------------- +// CGSCamQualitySettingPage::PreviewSettingChangeL +// Previews the setting value +// --------------------------------------------------------------------------- +// +TInt CGSCamQualitySettingPage::PreviewSettingChange( TAny* aAny ) + { + CGSCamQualitySettingPage* settingPage = + static_cast( aAny ); + // preview the setting value - will + // update the engine and the navi couner + TRAP_IGNORE( settingPage->iController.PreviewSettingChangeL( + settingPage->iSettingItemId, + settingPage->iCurrentVal ) ); + + // cancel the timer + settingPage->iTimer->Cancel(); + + return KErrNone; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamQualitySettingSlider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamQualitySettingSlider.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1068 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for showing quality slider* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include // For CCoeAppUiBase +#include // For CEikApplication +#include // resource reader +#include +#include +#include +#include +#include "GSCamQualitySettingSlider.h" +#include "CamPanic.h" // Panic codes +#include "CamUtility.h" +#include "CamPSI.h" + +#include "camconfiguration.h" + +// CONSTANTS + +const TInt KDivisorFactor = 1024; // Avoids using TReal maths, use factor of 2 + +const TInt KMinQuality = 0; +const TInt KMaxBackCameraPhotoQuality = 4; // Can be 3 or 5 steps => 2 or 4 +const TInt KMaxBackCameraVideoQuality = 4; + +// Image quality value indexes +const TInt KImageQualityHigh = 0; +const TInt KImageQualityMedium = 1; +const TInt KImageQualityLow = 2; +const TInt KImageQualityLower = 3; +const TInt KImageQualityLowest = 4; + +// Video quality value indexes +const TInt KVideoQualityTVHigh = 0; +const TInt KVideoQualityWide = 1; +const TInt KVideoQualityEmailHigh = 2; +const TInt KVideoQualityEmailNormal = 3; +const TInt KVideoQualitySharing = 4; + +// Video quality type indexes +const TInt KVideoQualityTVHighType = 5; +const TInt KVideoQualityWideType = 6; +const TInt KVideoQualityEmailHighType = 7; +const TInt KVideoQualityEmailNormalType = 8; +const TInt KVideoQualitySharingType = 9; + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------- +// CCamSliderLegend::~CCamSliderLegend +// destructor +// --------------------------------------------------------- +// +CCamSliderLegend::~CCamSliderLegend() + { + delete iText; + delete iBitmap; + delete iMask; + } + +// --------------------------------------------------------- +// CCamSliderLegend::Draw +// Draws the legend +// --------------------------------------------------------- +// +void CCamSliderLegend::Draw( CWindowGc& aGc ) const + { + if ( iItem == ECamSliderLegendItemText ) + { + TRgb color; + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + + iPosition.DrawText( aGc, iText->Des(), ETrue, color ); + } + else + { + iIconRect.DrawImage( aGc, iBitmap, iMask ); + } + } + +// --------------------------------------------------------- +// CCamSliderLegend::Rect +// Returns the legend rect +// --------------------------------------------------------- +// +TRect CCamSliderLegend::Rect() const + { + if ( iItem == ECamSliderLegendItemText ) + { + return iPosition.TextRect(); + } + else + { + return iIconRect.Rect(); + } + } + + +// --------------------------------------------------------- +// CCamSliderLegend::ConstructL +// Constructs the layout entry +// --------------------------------------------------------- +// +void CCamSliderLegend::ConstructL( const TAknLayoutRect& aLayoutRect, + TInt aBitmap, TInt aMask ) + { + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + + iItem = ECamSliderLegendItemIcon; + iIconRect = aLayoutRect; + + AknIconUtils::CreateIconL( iBitmap, iMask, resname, aBitmap, aMask ); + AknIconUtils::SetSize( iBitmap, iIconRect.Rect().Size() ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::CGSCamQualitySettingSlider +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CGSCamQualitySettingSlider::CGSCamQualitySettingSlider( + MCamSettingValueObserver* aObserver, TCamSettingItemIds aSettingType, + TInt aSteps, CCamConfiguration* aConfiguration ) : + iSettingObserver( aObserver ), iSettingType( aSettingType ), + iSteps( aSteps ), iConfiguration ( aConfiguration ) + { + switch ( iSettingType ) + { + case ECamSettingItemPhotoQuality: + { + if( CamUtility::GetCommonPsiInt( + ECamPsiNumberSupportedStillQualities, iMaxSliderValue) != + KErrNone ) + { + iMaxSliderValue = KMaxBackCameraPhotoQuality; + } + iMinSliderValue = KMinQuality; + iNumSliderValues = iMaxSliderValue + 1; + } + break; + + case ECamSettingItemVideoQuality: + { + if( CamUtility::GetCommonPsiInt( + ECamPsiNumberSupportedVideoQualities, iMaxSliderValue) != + KErrNone ) + { + iMaxSliderValue = KMaxBackCameraVideoQuality; + } + iMinSliderValue = KMinQuality; + iNumSliderValues = iMaxSliderValue + 1; + } + break; + default: + { + } + break; + } + + // Prefill iBitmapShafts and iBitmapShaftMasks with NULL + for ( TInt i = 0; i <= BITMAP_SHAFT_MAX_DIVISIONS; i++) + { + iBitmapShafts[i] = static_cast(NULL); + iBitmapShaftsMasks[i] = static_cast(NULL); + } + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingSlider::ConstructL( const CCoeControl* aParent ) + { + __ASSERT_DEBUG( aParent!=NULL, CamPanic( ECamPanicNullPointer ) ); + + iParentControl = aParent; + SetContainerWindowL( *iParentControl ); + + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + if ( IsThreeTicksSlider() ) + { + // Create component bitmaps + AknsUtils::CreateIconL( skin, KAknsIIDQgnGrafNsliderCam4Image1, + iBitmapShafts[KImageQualityHigh], + iBitmapShaftsMasks[KImageQualityHigh], + resname, + EMbmCameraappQgn_graf_nslider_cam4_image_1, + EMbmCameraappQgn_graf_nslider_cam4_image_1_mask ); + AknsUtils::CreateIconL( skin, KAknsIIDQgnGrafNsliderCam4Image2, + iBitmapShafts[KImageQualityMedium], + iBitmapShaftsMasks[KImageQualityMedium], + resname, + EMbmCameraappQgn_graf_nslider_cam4_image_2, + EMbmCameraappQgn_graf_nslider_cam4_image_2_mask ); + AknsUtils::CreateIconL( skin, KAknsIIDQgnGrafNsliderCam4Image3, + iBitmapShafts[KImageQualityLow], + iBitmapShaftsMasks[KImageQualityLow], + resname, + EMbmCameraappQgn_graf_nslider_cam4_image_3, + EMbmCameraappQgn_graf_nslider_cam4_image_3_mask ); + } + else // iSettingType == ECamSettingItemVideoQuality + { + AknsUtils::CreateIconL( skin, KAknsIIDQgnGrafNsliderCam4Video1, + iBitmapShafts[KVideoQualityTVHigh], + iBitmapShaftsMasks[KVideoQualityTVHigh], + resname, + EMbmCameraappQgn_graf_nslider_cam4_video_1, + EMbmCameraappQgn_graf_nslider_cam4_video_1_mask ); + AknsUtils::CreateIconL( skin, KAknsIIDQgnGrafNsliderCam4Video2, + iBitmapShafts[KVideoQualityWide], + iBitmapShaftsMasks[KVideoQualityWide], + resname, + EMbmCameraappQgn_graf_nslider_cam4_video_2, + EMbmCameraappQgn_graf_nslider_cam4_video_2_mask ); + AknsUtils::CreateIconL( skin, KAknsIIDQgnGrafNsliderCam4Video3, + iBitmapShafts[KVideoQualityEmailHigh], + iBitmapShaftsMasks[KVideoQualityEmailHigh], + resname, + EMbmCameraappQgn_graf_nslider_cam4_video_3, + EMbmCameraappQgn_graf_nslider_cam4_video_3_mask ); + AknsUtils::CreateIconL( skin, KAknsIIDQgnGrafNsliderCam4Video4, + iBitmapShafts[KVideoQualityEmailNormal], + iBitmapShaftsMasks[KVideoQualityEmailNormal], + resname, + EMbmCameraappQgn_graf_nslider_cam4_video_4, + EMbmCameraappQgn_graf_nslider_cam4_video_4_mask ); + AknsUtils::CreateIconL( skin, KAknsIIDQgnGrafNsliderCam4Video5, + iBitmapShafts[KVideoQualitySharing], + iBitmapShaftsMasks[KVideoQualitySharing], + resname, + EMbmCameraappQgn_graf_nslider_cam4_video_5, + EMbmCameraappQgn_graf_nslider_cam4_video_5_mask ); + } + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CGSCamQualitySettingSlider* CGSCamQualitySettingSlider::NewL( + const CCoeControl* aParent, + MCamSettingValueObserver* aObserver, + TCamSettingItemIds aSettingItem, + TInt aSteps, + CCamConfiguration* aConfiguration ) + { + CGSCamQualitySettingSlider* self = + new( ELeave ) CGSCamQualitySettingSlider( aObserver, aSettingItem, + aSteps, aConfiguration); + CleanupStack::PushL( self ); + self->ConstructL( aParent ); + CleanupStack::Pop( self ); + self->iConfiguration = aConfiguration; + return self; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::~CGSCamQualitySettingSlider +// Destructor +// ----------------------------------------------------------------------------- +// +CGSCamQualitySettingSlider::~CGSCamQualitySettingSlider() + { + for ( TInt i = 0; i <= BITMAP_SHAFT_MAX_DIVISIONS; i++) + { + delete iBitmapShafts[i]; + delete iBitmapShaftsMasks[i]; + } + + // Destroy legend strings + iLegendArray.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::InitializeL +// Sets up the slider with the initial value +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingSlider::InitializeL( TInt aValue, + HBufC* aTopSubtitle, + HBufC* aBottomSubtitle ) + { + // Check the initial value is valid. If no, leave. + if ( aValue < iMinSliderValue || + aValue > iMaxSliderValue ) + { + PRINT3( _L("Camera <> CGSCamQualitySettingSlider::InitializeL - illegal value: %d (min %d, max %d)" ), + aValue, iMinSliderValue, iMaxSliderValue ); + User::Leave( KErrArgument ); + } + + iValue = aValue; + iTopSubtitle = aTopSubtitle; + iBottomSubtitle = aBottomSubtitle; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::MinValue +// Returns the minimum slider value +// ----------------------------------------------------------------------------- +// +TInt CGSCamQualitySettingSlider::MinValue() const + { + return iMinSliderValue; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::MaxValue +// Returns the maximum slider value +// ----------------------------------------------------------------------------- +// +TInt CGSCamQualitySettingSlider::MaxValue() const + { + return iMaxSliderValue; + } + + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::SetRange +// Sets the minimum and maximum values of the slider control +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingSlider::SetRange( TInt aMin, TInt aMax ) + { + ASSERT( aMin < aMax ); + iMinSliderValue = aMin; + iMaxSliderValue = aMax; + iNumSliderValues = iMaxSliderValue + 1; + } + + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::Draw +// Draws the slider +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingSlider::Draw( const TRect& /*aRect*/ ) const + { + CFbsBitmap* shaft; + CFbsBitmap* shaftMask; + CWindowGc& gc = SystemGc(); + TRgb color; + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + + MAknsControlContext *cc = AknsDrawUtils::ControlContext( iParentControl ); + //AknsDrawUtils::Background( skin, cc, iParentControl, gc, Rect() ); + + // draw top and bottom subtitles + iLayoutSubtitleTop.DrawText( gc, iTopSubtitle->Des(), ETrue, color ); + iLayoutSubtitleBottom.DrawText( gc, iBottomSubtitle->Des(), ETrue, color ); + + // Draw the legend icons + TInt count = iLegendArray.Count(); + TInt i = 0; + for ( i = 0; i < count; i++ ) + { + iLegendArray[i]->Draw( gc ); + } + + // the quality slider has a different shaft icon for each slider value + if ( iMaxSliderValue <= BITMAP_SHAFT_MAX_DIVISIONS + && iValue <= BITMAP_SHAFT_MAX_DIVISIONS + && iMaxSliderValue >= 0 + && iValue >= 0 ) + { + shaft = iBitmapShafts[iValue]; + shaftMask = iBitmapShaftsMasks[iValue]; + } + else + { + shaft = NULL; + } + + // Draw the shaft bitmap + if ( shaft ) + { + iShaftLayout.DrawImage( gc, shaft, shaftMask ); + } + } + + +// --------------------------------------------------------- +// CGSCamQualitySettingSlider::SizeChanged +// Calculates the new minimum size +// --------------------------------------------------------- +// +void CGSCamQualitySettingSlider::SizeChanged() + { + TRAPD( ignore, ReadLayoutL() ); + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + + // Work out the minimum size + TInt count = iLegendArray.Count(); + + TRect minimumRect; + + // Start min rect as first legend text + if ( count > 0 ) + { + minimumRect = iLegendArray[0]->Rect(); + } + + // Take into account the other legend texts + TInt i; + for ( i = 1; i < count; i++ ) + { + minimumRect.BoundingRect( iLegendArray[i]->Rect() ); + } + + // Take into account the shaft bitmap + minimumRect.BoundingRect( iShaftLayout.Rect() ); + + iMinimumSize = minimumRect.Size(); + } + + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::OfferKeyEventL +// Allows the user to change the current EV value via key presses. +// ----------------------------------------------------------------------------- +// +TKeyResponse CGSCamQualitySettingSlider::OfferKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode aType ) + { + if ( aType == EEventKey ) + { + if ( aKeyEvent.iScanCode == EStdKeyUpArrow ) + { + if ( iValue < iMaxSliderValue ) + { + iValue ++; + // Tell observer about change + iSettingObserver->HandleSettingValueUpdateL( iValue ); + DrawNow(); + } + + return EKeyWasConsumed; + } + else if ( aKeyEvent.iScanCode == EStdKeyDownArrow ) + { + if ( iValue > iMinSliderValue ) + { + iValue --; + // Tell observer about change + iSettingObserver->HandleSettingValueUpdateL( iValue ); + DrawNow(); + } + + return EKeyWasConsumed; + } + else if ( aKeyEvent.iCode == EKeyOK && aKeyEvent.iRepeats == 0 ) + { + return EKeyWasConsumed; + } + // No allowing left and right key events thansfer to other view. + else if( aKeyEvent.iScanCode == EStdKeyLeftArrow + || aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + return EKeyWasConsumed; + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error, MISRA required rule 60 + } + } + return EKeyWasNotConsumed; + } + +// --------------------------------------------------------- +// CGSCamQualitySettingSlider::MinimumSize +// --------------------------------------------------------- +// +TSize CGSCamQualitySettingSlider::MinimumSize() + { + TSize zerosize = TSize( 0, 0 ); + if ( iMinimumSize == zerosize ) + { + SizeChanged(); + } + return iMinimumSize; + } + + +// --------------------------------------------------------- +// CGSCamQualitySettingSlider::ReadLayoutL +// --------------------------------------------------------- +// +void CGSCamQualitySettingSlider::ReadLayoutL() + { + // We can use Rect() as the parent rectangle for subcomponents, because + // CGSCamQualitySettingSlider uses the main_cset_slider_pane layout + + // We're starting again from scratch, so delete the old layout(s) + iLegendArray.ResetAndDestroy(); + + if( iSettingType == ECamSettingItemVideoQuality ) + { + if ( CamUtility::IsNhdDevice() ) + { + TouchLayoutVideo(); + } + else + { + NonTouchLayoutVideo(); + } + + AppendLegendArrayL( ECamPsiVideoQualityIconIds ); + AppendLegendArrayL( ECamPsiVideoQualityFileTypeId, iNumSliderValues ); + } + else // iSettingType == ECamSettingItemPhotoQuality + { + if ( CamUtility::IsNhdDevice() ) + { + TouchLayoutPhoto(); + } + else + { + NonTouchLayoutPhoto(); + } + AppendLegendArrayL( ECamPsiStillQualityIconIds ); + } + + // set the shaft icon sizes + for ( TInt i = 0; i < BITMAP_SHAFT_MAX_DIVISIONS+1; i++ ) + { + AknIconUtils::SetSize( iBitmapShafts[ i ], iShaftLayout.Rect().Size(), + EAspectRatioNotPreserved ); + } + + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::TouchLayoutVideo +// Generate layouts for slider legend icons +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingSlider::TouchLayoutVideo() + { + // Set the shaft layout structure + iShaftLayout.LayoutRect( Rect(), + AknLayoutScalable_Apps::cset_slider_pane( 4 ) ); + // set subtitle text layouts + iLayoutSubtitleTop.LayoutText( Rect(), + AknLayoutScalable_Apps::main_cset_slider_pane_t1( 4 ) ); + iLayoutSubtitleBottom.LayoutText( Rect(), + AknLayoutScalable_Apps::main_cset_slider_pane_t7( 4 ) ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::NonTouchLayoutVideo +// Generate layouts for slider legend icons +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingSlider::NonTouchLayoutVideo() + { + // Set the shaft layout structure + iShaftLayout.LayoutRect( Rect(), + AknLayoutScalable_Apps::cset6_slider_pane( 4 )); + // set subtitle text layouts + iLayoutSubtitleTop.LayoutText( Rect(), + AknLayoutScalable_Apps::main_cset6_slider_pane_t1( 4 ) ); + iLayoutSubtitleBottom.LayoutText( Rect(), + AknLayoutScalable_Apps::main_cset6_slider_pane_t7( 4 ) ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::TouchLayoutPhoto +// Generate layouts for slider legend icons +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingSlider::TouchLayoutPhoto() + { + iShaftLayout.LayoutRect( Rect(), + AknLayoutScalable_Apps::cset_slider_pane( 2 ) ); + // set subtitle text layouts + iLayoutSubtitleTop.LayoutText( Rect(), + AknLayoutScalable_Apps::main_cset_slider_pane_t1( 2 ) ); + iLayoutSubtitleBottom.LayoutText( Rect(), + AknLayoutScalable_Apps::main_cset_slider_pane_t7( 2 ) ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::NonTouchLayoutPhoto +// Generate layouts for slider legend icons +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingSlider::NonTouchLayoutPhoto() + { + // Set the shaft layout structure + iShaftLayout.LayoutRect( Rect(), + AknLayoutScalable_Apps::cset6_slider_pane( 2 )); + // set subtitle text layouts + iLayoutSubtitleTop.LayoutText( Rect(), + AknLayoutScalable_Apps::main_cset6_slider_pane_t1( 2 ) ); + iLayoutSubtitleBottom.LayoutText( Rect(), + AknLayoutScalable_Apps::main_cset6_slider_pane_t7( 2 ) ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::AppendLegendArrayL +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingSlider::AppendLegendArrayL( TCamPsiKey aKey, + TInt aNumSliderValues ) + { + RArray array; + CleanupClosePushL( array ); + + TAknLayoutRect layout; + iConfiguration->GetPsiIntArrayL( aKey, array ); + for( TInt i = 0; i < array.Count(); i+=2 ) + { + // get positioning info + if ( iSettingType == ECamSettingItemVideoQuality ) + { + if ( CamUtility::IsNhdDevice() ) + { + layout = GetTouchVideoLegendLayout( Rect(), + i/2 + aNumSliderValues ); + } + else + { + layout = GetNonTouchVideoLegendLayout( Rect(), + i/2 + aNumSliderValues ); + } + } + else + { + if ( CamUtility::IsNhdDevice() ) + { + if ( IsThreeTicksSlider() ) + { + // Touch layouts supports only three ticks sliders + layout = GetTouchPhotoLegendLayout( Rect(), + i/2 + aNumSliderValues ); + } + else + { + // Five ticks slider is taken from NonTouch layouts + layout = GetNonTouchPhotoLegend5Layout( Rect(), + i/2 + aNumSliderValues ); + } + } + else + { + if ( IsThreeTicksSlider() ) + { + layout = GetNonTouchPhotoLegend3Layout( Rect(), + i/2 + aNumSliderValues ); + } + else + { + layout = GetNonTouchPhotoLegend5Layout( Rect(), + i/2 + aNumSliderValues ); + } + } + } + + CCamSliderLegend* legend = new ( ELeave ) CCamSliderLegend(); + CleanupStack::PushL( legend ); + legend->ConstructL( layout, array[i], array[i+1] ); + + User::LeaveIfError( iLegendArray.Append( legend ) ); + CleanupStack::Pop( legend ); + } + CleanupStack::PopAndDestroy( &array ); + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::GetTouchVideoLegendLayout +// Select layout for slider legend icons +// ----------------------------------------------------------------------------- +// +TAknLayoutRect CGSCamQualitySettingSlider::GetTouchVideoLegendLayout( + const TRect& aParentRect, + TInt aIndex ) const + { + TAknLayoutRect res; + switch ( aIndex ) + { + case KVideoQualityTVHigh : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g7( 0 ) ); + break; + } + case KVideoQualityTVHighType : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g8( 0 ) ); + break; + } + case KVideoQualityWide : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g11( 0 ) ); + + break; + } + case KVideoQualityWideType : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g12( 0 ) ); + break; + } + case KVideoQualityEmailHigh : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g16( 0 ) ); + break; + } + case KVideoQualityEmailHighType : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g17( 0 ) ); + break; + } + case KVideoQualityEmailNormal : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g13( 0 ) ); + break; + } + case KVideoQualityEmailNormalType : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g14( 0 ) ); + break; + } + case KVideoQualitySharing : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g16( 0 ) ); + break; + } + case KVideoQualitySharingType : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g17( 0 ) ); + break; + } + default: + { + break; + } + } + return res; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::GetNonTouchVideoLegendLayout +// Select layout for slider legend icons +// ----------------------------------------------------------------------------- +// +TAknLayoutRect CGSCamQualitySettingSlider::GetNonTouchVideoLegendLayout( + const TRect& aParentRect, + TInt aIndex ) const + { + TAknLayoutRect res; + switch ( aIndex ) + { + case KVideoQualityTVHigh : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g7( 0 ) ); + break; + } + case KVideoQualityTVHighType : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g8( 0 ) ); + break; + } + case KVideoQualityWide : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g11( 0 ) ); + break; + } + case KVideoQualityWideType : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g12( 0 ) ); + break; + } + case KVideoQualityEmailHigh : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g16( 0 ) ); + break; + } + case KVideoQualityEmailHighType : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g17( 0 ) ); + break; + } + case KVideoQualityEmailNormal : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g13( 0 ) ); + break; + } + case KVideoQualityEmailNormalType : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g14( 0 ) ); + break; + } + case KVideoQualitySharing : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g16( 0 ) ); + break; + } + case KVideoQualitySharingType : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g17( 0 ) ); + break; + } + default: + { + break; + } + } + return res; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::GetTouchPhotoLegendLayout +// Select layout for slider legend icons +// ----------------------------------------------------------------------------- +// +TAknLayoutRect CGSCamQualitySettingSlider::GetTouchPhotoLegendLayout( + const TRect& aParentRect, + TInt aIndex ) const + { + TAknLayoutRect res; + switch ( aIndex ) + { + case KImageQualityHigh : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g3( 0 ) ); + break; + } + case KImageQualityMedium : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g4( 0 ) ); + break; + } + case KImageQualityLow : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g5( 0 ) ); + break; + } + default: + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g5( 0 ) ); + break; + } + } + return res; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::GetNonTouchPhotoLegend3Layout +// Select layout for slider legend icons +// ----------------------------------------------------------------------------- +// +TAknLayoutRect CGSCamQualitySettingSlider::GetNonTouchPhotoLegend3Layout( + const TRect& aParentRect, + TInt aIndex ) const + { + TAknLayoutRect res; + switch ( aIndex ) + { + case KImageQualityHigh : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g7( 0 ) ); + break; + } + case KImageQualityMedium : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g4( 0 ) ); + break; + } + case KImageQualityLow : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g5( 0 ) ); + break; + } + default: + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g5( 0 ) ); + break; + } + } + return res; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::GetNonTouchPhotoLegend5Layout +// Select layout for slider legend icons +// ----------------------------------------------------------------------------- +// +TAknLayoutRect CGSCamQualitySettingSlider::GetNonTouchPhotoLegend5Layout( + const TRect& aParentRect, + TInt aIndex ) const + { + TAknLayoutRect res; + switch ( aIndex ) + { + case KImageQualityHigh : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g7( 0 ) ); + break; + } + case KImageQualityMedium : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g9( 0 ) ); + break; + } + case KImageQualityLow : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g4( 0 ) ); + break; + } + case KImageQualityLower : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g13( 0 ) ); + + break; + } + case KImageQualityLowest : + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g5( 0 ) ); + break; + } + default: + { + res.LayoutRect( aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g5( 0 ) ); + + break; + } + } + return res; + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::IsThreeTicksSlider +// Select layout for slider legend icons +// ----------------------------------------------------------------------------- +// +TBool CGSCamQualitySettingSlider::IsThreeTicksSlider() const + { + if ( !iConfiguration ) + { + return ETrue; + } + TInt count; + if ( iSettingType == ECamSettingItemVideoQuality ) + { + count = iConfiguration->NumVideoQualities(); + } + else + { + count = iConfiguration->NumPrimaryImageQualities(); + } + + PRINT1( _L("Camera <> CGSCamQualitySettingSlider::IsThreeTicksSlider count=%d"), count ); + return count < 4; // Magic: less than three steps + } + +// ----------------------------------------------------------------------------- +// CGSCamQualitySettingSlider::HandlePointerEventL +// Handles slider pointer events +// ----------------------------------------------------------------------------- +// +void CGSCamQualitySettingSlider::HandlePointerEventL( + const TPointerEvent& aPointerEvent ) + { + + CCoeControl::HandlePointerEventL( aPointerEvent ); + + // This is the max bitmap offset from the top of the shaft that the + // selection can be + TInt maxVOffset = iShaftLayout.Rect().Size().iHeight; + + // This is the no. of pixels for a "step" + TInt stepInPixels = ( maxVOffset * KDivisorFactor ) / iNumSliderValues; + + // Calculate new setting value + TInt deltaY = aPointerEvent.iPosition.iY - iShaftLayout.Rect().iTl.iY; + TInt nbrSteps = deltaY / ( stepInPixels / KDivisorFactor ); + iValue = iMaxSliderValue - nbrSteps; + + if ( iValue < iMinSliderValue ) + { + iValue = iMinSliderValue; + } + + if (iValue > iMaxSliderValue) + { + iValue = iMaxSliderValue; + } + // Tell observer about change + iSettingObserver->HandleSettingValueUpdateL( iValue ); + DrawNow(); + + } + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamVideoQualityLevel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamVideoQualityLevel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,321 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Stores video qulaity leve linformation read from resource file* +*/ + + + +// INCLUDE FILES + +#include // CnvUtfConverter +#include "CameraVariant.hrh" +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "GSCamVideoQualityLevel.h" +#include "camlogging.h" +#include "CamUtility.h" + + +const TInt KQualityMaxStringLength = 64; + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::CGSCamVideoQualityLevel +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CGSCamVideoQualityLevel::CGSCamVideoQualityLevel() + { + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::ConstructFromResourceL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CGSCamVideoQualityLevel::ConstructFromResourceL( TResourceReader& aReader ) + { + // read identifier for this quality level + iQualityLevel = aReader.ReadInt16(); + // read resolution + iVideoResolution = TVideoResolution(aReader.ReadInt16()); + // read frame rate + iVideoFrameRate = aReader.ReadReal64(); + // read video bitrate + iVideoBitRate = aReader.ReadInt32(); + // read audio bitrate + iAudioBitRate = aReader.ReadInt32(); + // read mime type + iVideoMimeType = ReadHBufC8L( aReader ); + // read preferred supplier + iPreferredSupplier = aReader.ReadHBufC16L(); + // read video codec + iVideoCodec = ReadHBufC8L( aReader ); + // read audio codec + iAudioCodec = ReadHBufC8L( aReader ); + // read file type + iVideoFileType = aReader.ReadInt16(); + // read length + iVideoLength = aReader.ReadInt16(); + + // if sharing quality - check the flags +/* if ( iQualityLevel == ECamVideoQualitySharing ) + { + // sharing should be subqcif + if ( aVariantFlags & KCamCrQualityVideoSharingIsSubQCIF ) + { + iVideoResolution = ECamVideoResolutionSubQCIF; + } + } */ + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CGSCamVideoQualityLevel::ConstructL( TVideoQualitySettings& aSettings ) + { + // read identifier for this quality level + iQualityLevel = aSettings.iQualityLevel; + // read resolution + iVideoResolution = TVideoResolution(aSettings.iVideoResolution); + // read frame rate + iVideoFrameRate = aSettings.iVideoFrameRate; + // read video bitrate + iVideoBitRate = aSettings.iVideoBitRate; + // read audio bitrate + iAudioBitRate = aSettings.iAudioBitRate; + + // read mime type + iVideoMimeType = HBufC8::NewL( KQualityMaxStringLength ); + iVideoMimeType->Des().Copy(aSettings.iVideoMimeType); + + // read preferred supplier + iPreferredSupplier = HBufC::NewL( KQualityMaxStringLength ) ; + iPreferredSupplier->Des().Copy( aSettings.iPreferredSupplier); + + // read video codec + iVideoCodec = HBufC8::NewL( KQualityMaxStringLength ); + iVideoCodec->Des().Copy( aSettings.iVideoCodec ); + // read audio codec + iAudioCodec = HBufC8::NewL( KQualityMaxStringLength ); + iAudioCodec->Des().Copy( aSettings.iAudioCodec ); + + // read file type* + iVideoFileType = aSettings.iVideoFileType; + // read length + iVideoLength = aSettings.iVideoLength; + + // if sharing quality - check the flags +/* if ( iQualityLevel == ECamVideoQualitySharing ) + { + // sharing should be subqcif + if ( aVariantFlags & KCamCrQualityVideoSharingIsSubQCIF ) + { + iVideoResolution = ECamVideoResolutionSubQCIF; + } + }*/ + } + + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CGSCamVideoQualityLevel* CGSCamVideoQualityLevel::NewL( TResourceReader& aReader ) + { + CGSCamVideoQualityLevel* self = new( ELeave ) CGSCamVideoQualityLevel; + + CleanupStack::PushL( self ); + self->ConstructFromResourceL( aReader ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CGSCamVideoQualityLevel* CGSCamVideoQualityLevel::NewL( TVideoQualitySettings& aSettings ) + { + CGSCamVideoQualityLevel* self = new( ELeave ) CGSCamVideoQualityLevel; + + CleanupStack::PushL( self ); + self->ConstructL( aSettings ); + CleanupStack::Pop(); + + return self; + } + +// Destructor +CGSCamVideoQualityLevel::~CGSCamVideoQualityLevel() + { + PRINT( _L("Camera => ~CGSCamVideoQualityLevel" )); + delete iVideoMimeType; + delete iPreferredSupplier; + delete iVideoCodec; + delete iAudioCodec; + PRINT( _L("Camera <= ~CGSCamVideoQualityLevel" )); + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::VideoResolution +// Return video resolution associated with this quality level +// ----------------------------------------------------------------------------- +// +TVideoResolution CGSCamVideoQualityLevel::VideoResolution() + { + return iVideoResolution; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::FrameRate +// Return video frame rate associated with this quality level +// ----------------------------------------------------------------------------- +// +TReal CGSCamVideoQualityLevel::FrameRate() + { + return iVideoFrameRate; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::VideoBitRate +// Return video bitrate associated with this quality level +// ----------------------------------------------------------------------------- +// +TInt CGSCamVideoQualityLevel::VideoBitRate() + { + return iVideoBitRate; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::AudioBitRate +// Return audio bitrate associated with this quality level identifier +// ----------------------------------------------------------------------------- +// +TInt CGSCamVideoQualityLevel::AudioBitRate() + { + return iAudioBitRate; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::VideoMimeType +// Return mime type required associated with this video quality level +// ----------------------------------------------------------------------------- +// +TPtrC8 CGSCamVideoQualityLevel::VideoMimeType() + { + return *iVideoMimeType; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::PreferredSupplier +// Return preferred supplier value associated with this video quality level +// ----------------------------------------------------------------------------- +// +TPtrC CGSCamVideoQualityLevel::PreferredSupplier() + { + return *iPreferredSupplier; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::VideoFileType +// Return video codec associated with this video quality level +// ----------------------------------------------------------------------------- +// +TPtrC8 CGSCamVideoQualityLevel::VideoFileType() + { + return *iVideoCodec; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::AudioType +// Return audio codec associated with this video quality level +// ----------------------------------------------------------------------------- +// +TPtrC8 CGSCamVideoQualityLevel::AudioType() + { + return *iAudioCodec; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::VideoType +// Return file type identier associated with this video quality level +// either Mpeg4 or 3GP +// ----------------------------------------------------------------------------- +// +TInt CGSCamVideoQualityLevel::VideoType() + { + return iVideoFileType; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::VideoLength +// Return length associated with this video quality level +// either max or short +// ----------------------------------------------------------------------------- +// +TInt CGSCamVideoQualityLevel::VideoLength() + { + return iVideoLength; + } + +// ----------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::VideoQuality +// Return video quality level +// ----------------------------------------------------------------------------- +// +TInt CGSCamVideoQualityLevel::VideoQuality() + { + return iQualityLevel; + } + +// --------------------------------------------------------------------------- +// CGSCamVideoQualityLevel::ReadHBufC8L +// Reads an LTEXT element from resources and returns +// it as HBufC8. +// --------------------------------------------------------------------------- +// +HBufC8* CGSCamVideoQualityLevel::ReadHBufC8L( TResourceReader& aReader ) const + { + HBufC* tempBuf = NULL; + tempBuf = aReader.ReadHBufCL(); + if ( !tempBuf ) + { + return NULL; + } + + CleanupStack::PushL( tempBuf ); + + // Assume aSource only contains 7-bit ASCII characters. + // (ie. length of the string in UTF-8 is equal to the number of + // characters) + HBufC8* res = HBufC8::NewLC( tempBuf->Length() ); + TPtr8 resPtr( res->Des() ); + TPtr16 sourcePtr( tempBuf->Des() ); + CnvUtfConverter::ConvertFromUnicodeToUtf8( resPtr, sourcePtr ); + CleanupStack::Pop(); // res + CleanupStack::PopAndDestroy(); // tempBuf + return res; + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamVideoSettingsList.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamVideoSettingsList.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,427 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Video settings list class +* +*/ + + +// INCLUDE FILES + +#include // CAknMemorySelectionSettingItem +#include +#include +#include +#include +#include +#include +#include +#include // DriveInfo + +#include "GSCamcorderPlugin.hrh" +#include "Cam.hrh" +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "GSCamVideoSettingsList.h" +#include "CamPanic.h" +#include "CamAppUiBase.h" +#include "GSCamcorderPlugin.h" +#include "CamUtility.h" +#include "MCamAppController.h" +#include "CamStaticSettingsModel.h" +#include "GSCamQualitySettingItem.h" +#include "GSCamDefaultNameSettingItem.h" +#include "GSCustomQualitySettingItem.h" +#include "CameraUiConfigManager.h" + +#include "CamCollectionManagerAo.h" +#include "CamWaitDialog.h" + +#include "camconfiguration.h" +#include "CamLocationSettingItem.h" + +// FORWARD DECLARATIONS + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsList::CGSCamVideoSettingsList +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCamVideoSettingsList::CGSCamVideoSettingsList( CCamStaticSettingsModel& aModel ) +:iModel( aModel ) + { + iSettings.Reset(); + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsList::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CGSCamVideoSettingsList::ConstructL( TBool aLaunchedFromGS, + TBool aSecondaryCameraSettings ) + { + CAknViewAppUi *AppUi = + static_cast( CCoeEnv::Static()->AppUi() ); + + CGSCamcorderPlugin* parent = static_cast + ( AppUi->View( KGSCamcorderGSPluginUid ) ); + + if ( parent ) + { + parent->LoadVideoStaticSettingsL( ETrue ); + parent->LoadPhotoStaticSettingsL( ETrue ); + } + + iModel.Configuration().GetPsiIntArrayL( ECamPsiSupportedVideoQualities, iSupportedVideoQualities ); + + iLaunchedFromGS = aLaunchedFromGS; + iSecondaryCameraSettings = aSecondaryCameraSettings; + iSettings.ResetAndDestroy(); + + TInt resId; + if ( iModel.UiConfigManagerPtr() && + iModel.UiConfigManagerPtr()->IsLocationSupported() ) + { + resId = R_CAM_VIDEO_SETTINGS_WITH_LOCATION_ITEM_LIST_CAMCORDER; + } + else + { + resId = R_CAM_VIDEO_SETTINGS_ITEM_LIST_CAMCORDER; + } + + if ( iSecondaryCameraSettings ) + { + resId = R_CAM_VIDEO_SETTINGS_ITEM_LIST_PORTRAIT; + } + + ConstructFromResourceL( resId ); + } + + +// Destructor +//CGSCamVideoSettingsList::~CGSCamVideoSettingsList() +// +CGSCamVideoSettingsList::~CGSCamVideoSettingsList() + { + iSettings.ResetAndDestroy(); + iSettings.Close(); + iSupportedVideoQualities.Close(); + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsList::CreateSettingItemL +// From CAknSettingItemList Handles creating setting items +// --------------------------------------------------------------------------- +// +CAknSettingItem* CGSCamVideoSettingsList::CreateSettingItemL( TInt aIdentifier ) + { + CAknViewAppUi *AppUi = static_cast( CCoeEnv::Static()->AppUi() ); + CGSCamcorderPlugin* parent = static_cast + ( AppUi->View( KGSCamcorderGSPluginUid ) ); + // Add storage place to storage list of settings values. + // ...create the storage place. + TIntSetting* newSetting = new( ELeave ) TIntSetting; + CleanupStack::PushL( newSetting ); + // ...set the identifier for this setting item. + newSetting->iItemId = aIdentifier; + if( aIdentifier != ECamSettingItemRestoreCameraSettings ) + { + if ( parent ) + { + newSetting->iValueId = parent->IntegerSettingValue( aIdentifier ); + } + } + else + { + newSetting->iValueId = 0; + } + // ...add the new storage place item to the storage list. + iSettings.AppendL( newSetting ); + CleanupStack::Pop( newSetting ); + + // Create the list setting item + CAknSettingItem* settingItem = NULL; + TInt lastItem = iSettings.Count() - 1; + // Setting items take reference to the value to be manipulated. + TInt& valueId( iSettings[lastItem]->iValueId ); + + switch ( aIdentifier ) + { + case ECamSettingItemVideoAudioRec: + case ECamSettingItemVideoShowCapturedVideo: + case ECamSettingItemVideoOpZoomOff: + { + settingItem = + new( ELeave ) CAknBinaryPopupSettingItem( aIdentifier, valueId ); + } + break; + case ECamSettingItemVideoDigitalZoom: + { + if ( iModel.UiConfigManagerPtr() && + iModel.UiConfigManagerPtr()->IsExtendedDigitalZoomSupported() ) + { + settingItem = new( ELeave ) CAknBinaryPopupSettingItem( aIdentifier, valueId ); + } + break; + } + case ECamSettingItemVideoQuality: + { + if ( parent ) + { + iQualityValue = parent->IntegerSettingValue( ECamSettingItemVideoQuality); + } + if ( !iLaunchedFromGS ) + { + settingItem = new( ELeave ) + CGSCamQualitySettingItem( ECamControllerVideo, + aIdentifier, + iQualityValue, + iModel ); + } + else + { + settingItem = new( ELeave ) + CGSCustomQualitySettingItem( aIdentifier, + iQualityValue, + iModel, + ECamControllerVideo ); + } + } + break; + + case ECamSettingItemRecLocation: + { + if ( !iLaunchedFromGS ) + { + settingItem = + new( ELeave ) CCamLocationSettingItem( ECamControllerVideo, + aIdentifier, + valueId ); + } + else + { + settingItem = + new( ELeave ) CAknEnumeratedTextPopupSettingItem( aIdentifier, + valueId ); + } + } + break; + + case ECamSettingItemVideoMediaStorage: + { + // Convert the setting to a memory enum + iMemVal = static_cast + ( CamUtility::MapToSettingsListMemory( + iSettings[lastItem]->iValueId ) ); + + __ASSERT_DEBUG( iMemVal != KErrNotFound, + CamPanic( ECamPanicUnhandledCreateSettingItem ) ); + + // Get the root path of the default mass storage memory. + TInt driveInt; + TInt err = DriveInfo::GetDefaultDrive( iMemVal, driveInt ); + iDrive = static_cast(driveInt); + + settingItem = new ( ELeave ) + CAknMemorySelectionSettingItemMultiDrive( aIdentifier, + iDrive ); + break; + } + case ECamSettingItemVideoNameBaseType: + { + if ( parent ) + { + iDefaultNameBase = parent->TextSettingValue( + ECamSettingItemVideoNameBase ); + } + TBool flag = ( iLaunchedFromGS || iSecondaryCameraSettings ); + settingItem = new( ELeave ) + CGSCamDefaultNameSettingItem( iDefaultNameBase, + ECamControllerVideo, + aIdentifier, + valueId, + flag ); + } + break; + + + case ECamSettingItemVideoStab: + { + if ( iModel.UiConfigManagerPtr() && + iModel.UiConfigManagerPtr()->IsVideoStabilizationSupported() ) + { + settingItem = + new( ELeave ) CAknBinaryPopupSettingItem( aIdentifier, valueId ); + } + } + break; + case ECamSettingItemRestoreCameraSettings: + { + settingItem = new ( ELeave ) CAknBigSettingItemBase( aIdentifier ); + } + break; + case ECamSettingItemContinuousAutofocus: + { + if ( iModel.UiConfigManagerPtr() && + iModel.UiConfigManagerPtr()->IsContinuosAutofocusSupported() ) + { + settingItem = + new( ELeave ) CAknBinaryPopupSettingItem( aIdentifier, valueId ); + } + + break; + } + default: + __ASSERT_DEBUG( EFalse, CamPanic( ECamPanicUnhandledCreateSettingItem ) ); + break; + } + + PRINT( _L("Camera <= CCamVideoSettingsList::CreateSettingItemL") ); + return settingItem; + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsList::EditItemL +// Launch the setting page for the current item by calling +// EditItemL on it. +// --------------------------------------------------------------------------- +// +void CGSCamVideoSettingsList::EditItemL( TInt aIndex, TBool aCalledFromMenu ) + { + PRINT( _L("Camera => CCamVideoSettingsList::EditItemL" )) + CAknViewAppUi *AppUi = static_cast( + CCoeEnv::Static()->AppUi() ); + + CGSCamcorderPlugin* parent = static_cast + ( AppUi->View( KGSCamcorderGSPluginUid ) ); + + CAknSettingItemArray* itemArray = SettingItemArray(); + CAknSettingItem* editedItem = itemArray->At(aIndex); + + if ( editedItem->Identifier() == ECamSettingItemRestoreCameraSettings ) + { + TInt response = 0; + if ( parent ) + { + response = parent->DisplayRestoreSettingsDlgL(); + } + // If launched from GS and response "Yes" reload settings page to update values + if ( iLaunchedFromGS && response ) + { + AppUi->ActivateLocalViewL( KGSCamcorderGSPluginUid ); + } + return; + } + + // Edit item via setting page or in-place. + CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu ); + // Write the new value for the edited control to its stored data. + editedItem->StoreL(); + + // Update the settings model so that the navipane is updated. + TInt settingValue; + // ...If the changed setting is the media storage setting + // ...then convert the memory value to settings model type value. + if ( editedItem->Identifier() == ECamSettingItemVideoMediaStorage ) + { + iMemVal = static_cast(CamUtility::GetDriveTypeFromDriveNumber( iDrive )); + settingValue = CamUtility::MapFromSettingsListMemory( iMemVal ); + //__ASSERT_DEBUG( settingValue != KErrNotFound, CamPanic( ECamPanicUnknownSettingItem ) ); + } + else if ( editedItem->Identifier() == ECamSettingItemVideoQuality ) + { + settingValue = iQualityValue; + } + // ...Otherwise, no conversion necessary. + else + { + settingValue = ValueOfSetting( editedItem->Identifier() ); + } + // ...Update the settings model with the new value. + if ( parent ) + { + parent->SetIntegerSettingValueL( editedItem->Identifier(), + settingValue ); + } + + // If the setting is for the video base name then store the name. + if ( editedItem->Identifier() == ECamSettingItemVideoNameBaseType + && parent ) + { + parent->SetTextSettingValueL( ECamSettingItemVideoNameBase, + iDefaultNameBase ); + } + + PRINT( _L("Camera <= CCamVideoSettingsList::EditItemL" )) + } + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsList::ValueOfSetting +// Returns the current value of the a setting for this list. +// Note, this is not the value currently stored in the settings model, as these +// may differ. +// --------------------------------------------------------------------------- +// +TInt CGSCamVideoSettingsList::ValueOfSetting( TInt aItemId ) const + { + TInt itemIndex = IndexOfSetting( aItemId ); + return iSettings[itemIndex]->iValueId; + } + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsList::IndexOfSetting +// Returns the array index of a setting for this list. +// --------------------------------------------------------------------------- +// +TInt CGSCamVideoSettingsList::IndexOfSetting( TInt aItemId ) const + { + TInt i; + TInt itemTotal = iSettings.Count(); + for ( i = 0; i < itemTotal; ++i ) + { + if ( iSettings[i]->iItemId == aItemId ) + { + return i; + } + } + + // Should never get here. + // Remove lint warning + return KErrNotFound; + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsList::SizeChanged +// Set the size and position of component controls. +// --------------------------------------------------------------------------- +// +void CGSCamVideoSettingsList::SizeChanged() + { + CAknSettingItemList::SizeChanged(); + CEikListBox* lb = ListBox(); + if( lb ) + { + lb->SetRect( Rect() ); // Set container's rect to listbox + } + } + + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamVideoSettingsView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamVideoSettingsView.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,249 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Video settings view +* +*/ + + +// INCLUDE FILES + +#include +#include +#include +#include // CAknTitlePane +#include +#include +#include +#include +#include +#include + +#include "CamAppUid.h" +#include "GSCamcorderPlugin.h" +#include "GSCamcorderPlugin.hrh" +#include "Cam.hrh" +#include "GSCamVideoSettingsView.h" +#include "GSCamcorderSettingsBaseView.h" +#include "GSCamcorderPlugin.h" +#include "CamLocalViewIds.h" + + + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsView::CGSCamVideoSettingsView +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCamVideoSettingsView::CGSCamVideoSettingsView( CCamStaticSettingsModel& aModel ) +: CGSCamcorderSettingsBaseView( aModel, EFalse ) + { + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsView::NewLC +// Symbian OS two-phased constructor. +// --------------------------------------------------------------------------- +// +CGSCamVideoSettingsView* CGSCamVideoSettingsView::NewLC( + CCamStaticSettingsModel& aModel, + CArrayPtrFlat* aTabViewArray ) + { + CGSCamVideoSettingsView* self = + new ( ELeave ) CGSCamVideoSettingsView( aModel ); + CleanupStack::PushL( self ); + self->ConstructL( aTabViewArray ); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsView::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CGSCamVideoSettingsView::ConstructL( CArrayPtrFlat* aTabViewArray ) + { + iTabHelper = CGSTabHelper::NewL(); + aTabViewArray->AppendL(this); + BaseConstructL( R_CAM_SETTING_LIST_VIEW ); + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsView::~CGSCamVideoSettingsView() +// Destructor +// --------------------------------------------------------------------------- +// +CGSCamVideoSettingsView::~CGSCamVideoSettingsView() + { + delete iTabHelper; + iTabHelper = NULL; + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsView::Id +// From CAknView, returns Uid of View +// --------------------------------------------------------------------------- +// +TUid CGSCamVideoSettingsView::Id() const + { + return KGSCamVideoSettingsViewId; + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsView::HandleCommandL +// From MEikMenuObserver delegate commands from the menu +// --------------------------------------------------------------------------- +// +void CGSCamVideoSettingsView::HandleCommandL( TInt aCommand ) + { + const TVwsViewId KVideoPreCaptureView( TUid::Uid( KCameraappUID ), + KVideoPreCaptureId ); + switch ( aCommand ) + { + case EAknSoftkeyBack: + { + if ( LaunchedFromGS() ) + { + AppUi()->ActivateLocalViewL( KGSCamcorderGSPluginUid ); + } + else + { + AppUi()->ActivateViewL( KVideoPreCaptureView, + TUid::Uid( aCommand ), + KNullDesC8 ); + } + break; + } + + case ECamCmdInternalExit: + { + if ( LaunchedFromGS() ) + { + AppUi()->HandleCommandL( EAknCmdExit ); + } + else + { + //To ensure that camera resources are released when exiting + //settings, we need to call internal exit here to close the + //camera completely + AppUi()->HandleCommandL( aCommand ); + } + break; + } + default: + { + CGSCamcorderSettingsBaseView::HandleCommandL( aCommand ); + break; + } + } + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsView::DoActivateL +// Activate this view +// --------------------------------------------------------------------------- +// +void CGSCamVideoSettingsView::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + + CGSCamcorderPlugin* parent = + static_cast ( + AppUi()->View( KGSCamcorderGSPluginUid ) ); + + if ( aCustomMessageId == TUid::Uid( KGSSecondaryCameraVideoSettingsView ) ) + { + if( parent) + { + parent->SetSecondaryCameraSettings( ETrue ); + } + } + else + { + if( parent ) + { + parent->SetSecondaryCameraSettings( EFalse ); + } + } + + CGSCamcorderSettingsBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + //StatusPane()->MakeVisible( ETrue ); + + if( parent ) + { + if ( LaunchedFromGS() ) + { + iTabHelper->CreateTabGroupL( Id(), + static_cast*> + ( parent->TabbedViews() ) ); + } + } + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsView::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CGSCamVideoSettingsView::DoDeactivate() + { + CGSCamcorderSettingsBaseView::DoDeactivate(); + if ( iTabHelper ) + { + iTabHelper->RemoveTabGroup(); + } + } + + +// --------------------------------------------------------------------------- +// CGSCamVideoSettingsView::CreateTabIconL() +// Creates icon for tab. +// --------------------------------------------------------------------------- +// +CGulIcon* CGSCamVideoSettingsView::CreateTabIconL() + { + TParse* fp = new(ELeave) TParse(); + CleanupStack::PushL( fp ); + TInt err = fp->Set(KDirAndFile, &KDC_APP_BITMAP_DIR, NULL); + + if (err != KErrNone) + { + User::Leave(err); + } + + TBuf fileName = fp->FullName(); + CleanupStack::PopAndDestroy( fp ); //fp + + CGulIcon* icon; + + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDDefault, + fileName, + EMbmCamerasettingspluginQgn_lcam_gen_sett_camera_tab_video, + EMbmCamerasettingspluginQgn_lcam_gen_sett_camera_tab_video ); + + return icon; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderPlugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderPlugin.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,673 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main settings view class +* +*/ + + +// INCLUDE FILES + +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#endif +#include +#include +#include +#include // cakntitlepane +#include +#include +#include +#include +#include +#include //for stringloader +#include +#include +#include //for kgsmainviewuid +#include +#include // for hlplauncher + +#include +#include "GSCamcorderPlugin.h" +#include "GSCamcorderPluginContainer.h" +#include "GSCamcorderPlugin.hrh" +#include "Cam.hrh" +#include "GSCamPhotoSettingsView.h" +#include "GSCamVideoSettingsView.h" +#include "CamLocalViewIds.h" +#include "MCamAppController.h" +#include "CamUtility.h" +#include "CamAppUid.h" + +#include "camconfiguration.h" + + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::CGSCamcorderPlugin +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCamcorderPlugin::CGSCamcorderPlugin() + : iResources( *iCoeEnv ), + iSecondaryCameraSettings( EFalse ), iReloadSettings( EFalse ) + { + + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CGSCamcorderPlugin* CGSCamcorderPlugin::NewL( TAny* /*aInitParams*/ ) + { + CGSCamcorderPlugin* self = new(ELeave) CGSCamcorderPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::ConstructL() + { + RDebug::Print(_L("[CGSCamcorderPlugin] ConstructL()" )); + + iViewArray = new (ELeave) CArrayPtrFlat( 2 ); + + iConfiguration = CCamConfiguration::NewL(); + iSettingsModel = CCamStaticSettingsModel::NewL( *iConfiguration ); + + RDebug::Print( _L( "[CGSCamcorderPlugin] Loading resource from :" ) ); + if ( CamUtility::IsNhdDevice() ) + { + RDebug::Print( KGSCamcorderPluginResourceFileName ); + OpenLocalizedResourceFileL( KGSCamcorderPluginResourceFileName, + iResources ); + } + else + { + RDebug::Print( KGSCamcorderPluginResourceFileNamev2 ); + OpenLocalizedResourceFileL( KGSCamcorderPluginResourceFileNamev2, + iResources ); + } + + FeatureManager::InitializeLibL(); + // Create needed Local views + CreateLocalViewL(); + BaseConstructL( R_GS_CAM_SETTING_LIST_VIEW ); + } + + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::~CGSCamcorderPlugin +// Destructor +// --------------------------------------------------------------------------- +// +CGSCamcorderPlugin::~CGSCamcorderPlugin() + { + RDebug::Print( _L( " ==> [CGSCamcorderPlugin] ~CGSCamcorderPlugin()" ) ); + FeatureManager::UnInitializeLib(); + + if ( iViewArray ) + { + iViewArray->Reset(); + delete iViewArray; + } + + if ( iSettingsModel ) + { + delete iSettingsModel; + iSettingsModel = NULL; + } + + delete iConfiguration; + iConfiguration = NULL; + + iResources.Close(); + + RDebug::Print( _L( " <==[CGSCamcorderPlugin] ~CGSCamcorderPlugin()" ) ); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::Id +// Return UID of view +// --------------------------------------------------------------------------- +// +TUid CGSCamcorderPlugin::Id() const + { + return KGSCamcorderGSPluginUid; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::HandleCommandL +// Handle commands +// --------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::HandleCommandL( TInt aCommand ) + { + + switch ( aCommand ) + { + case ECamMSKCmdAppChange: + case EAknCmdOpen: + HandleListBoxSelectionL(); + break; + + case EAknSoftkeyBack: + iAppUi->ActivateLocalViewL( iParentView.iViewUid ); + iParentView = KNullViewId; + break; + case EAknCmdHelp: +#ifdef __SERIES60_HELP + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), iAppUi->AppHelpContextL() ); + } +#endif + break; + case ECamCmdInternalExit: + if ( LaunchedFromGS() ) + { + aCommand = EAknCmdExit; + } + default: + iAppUi->HandleCommandL( aCommand ); + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::DoActivate +// Activate this view +// --------------------------------------------------------------------------- +// + +void CGSCamcorderPlugin::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + RDebug::Print(_L("[CGSCamcorderPlugin] DoActivateL()" )); + + + if ( !iReloadSettings ) + { + if ( aCustomMessageId == TUid::Uid( KGSActivatePhotoSettingsView ) || + aCustomMessageId == TUid::Uid( KGSSecondaryCameraPhotoSettingsView ) ) + { + RDebug::Print(_L("[CGSCamcorderPlugin] DoActivateL()1" )); + iParentView = aPrevViewId; + iAppUi->ActivateLocalViewL( KGSCamImageSettingsViewId ); + return; + } + else if ( aCustomMessageId == TUid::Uid( KGSActivateVideoSettingsView ) || + aCustomMessageId == TUid::Uid( KGSSecondaryCameraVideoSettingsView ) ) + { + RDebug::Print(_L("[CGSCamcorderPlugin] DoActivateL()2" )); + iParentView = aPrevViewId; + iAppUi->ActivateLocalViewL( KGSCamVideoSettingsViewId ); + return; + } + } + + // activate baseview only if not transfered straight to localview + CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + + TInt highlight = KGSCamSettingsListImageIndex; + if ( iPrevViewId.iViewUid == KGSCamVideoSettingsViewId ) + { + highlight = KGSCamSettingsListVideoIndex; + } + if( iParentView == KNullViewId ) + { + // Parent view could be Camcorder internal view or KGSAppsPluginUid + iParentView = aPrevViewId; + if ( aCustomMessageId.iUid ) + { + highlight = KGSCamSettingsListVideoIndex; + } + } + + iContainer->SetSelectedItem( highlight ); + if ( iReloadSettings ) + { + iReloadSettings = EFalse; + HandleListBoxSelectionL(); + } + + + + } + + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::DoDeactivate() + { + RDebug::Print(_L("[CGSCamcorderPlugin] DoDeactivate()" )); + + CGSBaseView::DoDeactivate(); + if( iContainer ) + { + iAppUi->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer=NULL; + } + } + + +// ----------------------------------------------------------------------------- +// CGSCamcorderPlugin::HandleClientRectChange +// Handle screen size change. +// ----------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::Container +// Return handle to container class. +// --------------------------------------------------------------------------- +// +CGSCamcorderPluginContainer* CGSCamcorderPlugin::Container() + { + return static_cast( iContainer ); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::HandleListBoxSelectionL +// Handle any user actions while in the list view. +// --------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::HandleListBoxSelectionL() + { + const TInt currentFeatureId = Container()->CurrentFeatureId(); + + switch ( currentFeatureId ) + { + case EImageSettingsFolder: + case EVideoSettingsFolder: + ActivateInternalViewL( currentFeatureId ); + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::GetCaptionL +// Caption text for view to be displayed in NaviPane. +// --------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::GetCaptionL( TDes& aCaption ) const + { + RDebug::Print(_L("[CGSCamcorderPlugin] GetCaption() - BEGIN" )); + + // the resource file is already opened. + HBufC* result = StringLoader::LoadL( R_CAM_GS_SETTINGS_TITLE_NAME ); + + aCaption.Copy( *result ); + delete result; + + RDebug::Print(_L("[CGSCamcorderPlugin] GetCaption() - END" )); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::NewContainerL +// Creates new iContainer. +// --------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::NewContainerL() + { + iContainer = new( ELeave ) CGSCamcorderPluginContainer; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::ActivateInternalViewL +// Activate local views within this plug-in. +// --------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::ActivateInternalViewL( TInt aFeatureId ) + { + switch ( aFeatureId ) + { + case EVideoSettingsFolder: + iAppUi->ActivateLocalViewL( KGSCamVideoSettingsViewId ); + break; + case EImageSettingsFolder: + iAppUi->ActivateLocalViewL( KGSCamImageSettingsViewId ); + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::CreateLocalViewL +// Initializes local views within this plug-in based on the view ID. +// --------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::CreateLocalViewL() + { + CAknView* view; + + view = CGSCamPhotoSettingsView::NewLC( *iSettingsModel, iViewArray ); + iAppUi->AddViewL( view ); + CleanupStack::Pop( view); + + view = CGSCamVideoSettingsView::NewLC( *iSettingsModel, iViewArray ); + iAppUi->AddViewL( view ); + CleanupStack::Pop(view); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::CreateIconL +// Return the icon, if has one. +// --------------------------------------------------------------------------- +// +CGulIcon* CGSCamcorderPlugin::CreateIconL( const TUid /*aIconType*/ ) + { + TParse* fp = new(ELeave) TParse(); + CleanupStack::PushL( fp ); + TInt err = fp->Set(KDirAndFile, &KDC_APP_BITMAP_DIR, NULL); + + if (err != KErrNone) + { + User::Leave(err); + } + + TBuf fileName = fp->FullName(); + CleanupStack::PopAndDestroy( fp ); //fp + + CGulIcon* icon; + + icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnPropSetAppsCams, + fileName, + EMbmCamerasettingspluginQgn_lcam_gen_sett_list, + EMbmCamerasettingspluginQgn_lcam_gen_sett_list_mask ); + + return icon; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::PluginProviderCategory +// A means to identify the location of this plug-in in the framework. +// --------------------------------------------------------------------------- +// +TInt CGSCamcorderPlugin::PluginProviderCategory() const + { + //To identify internal plug-ins. + return KGSPluginProviderInternal; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::TabbedViews() +// Returns pointer to tabbed views of application. +// --------------------------------------------------------------------------- +// +CArrayPtrFlat* CGSCamcorderPlugin::TabbedViews() + { + return iViewArray; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::Visible() +// Method for checking, if plugin should be visible and used in GS. +// --------------------------------------------------------------------------- +// +TBool CGSCamcorderPlugin::Visible() const + { + return ETrue; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::CustomOperationL() +// Reserved for later use. +// --------------------------------------------------------------------------- +// +TAny* CGSCamcorderPlugin::CustomOperationL( TAny* aParam1, TAny* /*aParam2*/ ) + { + return aParam1; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::DynInitMenuPaneL +// Dynamically customize menu items +// --------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + if ( aResourceId == R_CAM_SETTINGS_LIST_MENU ) + { +#ifdef __SERIES60_HELP + if ( !FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } +#endif + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::LaunchedFromGS +// For variating the construction of the setting items +// --------------------------------------------------------------------------- +// +TBool CGSCamcorderPlugin::LaunchedFromGS() const + { + return iAppUi->Application()->AppDllUid().iUid != KCameraappUID; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::IsSecondaryCameraSettings() +// Returns if we have to lauch secondary camera settings or main camera settings +// --------------------------------------------------------------------------- +// +TBool CGSCamcorderPlugin::IsSecondaryCameraSettings() + { + return iSecondaryCameraSettings; + } + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::SetSecondaryCameraSettings() +// Sets if camera has lauched secondary camera settings or main camera settings +// --------------------------------------------------------------------------- +// +void CGSCamcorderPlugin::SetSecondaryCameraSettings( TBool aSecondarySettings ) + { + iSecondaryCameraSettings = aSecondarySettings; + } + + +// +// CGSCamcorderPlugin::IntegerSettingValue +// +TInt CGSCamcorderPlugin::IntegerSettingValue( const TInt aSettingItem ) + { + if ( LaunchedFromGS() ) + { + return iSettingsModel->IntegerSettingValue( aSettingItem ); + } + else + { + CCamAppUiBase* appUi = static_cast( CCoeEnv::Static()->AppUi() ); + MCamAppController& controller = appUi->AppController(); + return controller.IntegerSettingValue( aSettingItem ); + } + } + +// +// CGSCamcorderPlugin::TextValueFromSettingsModel +// +TPtrC CGSCamcorderPlugin::TextSettingValue( const TInt aSettingItem ) + { + if ( LaunchedFromGS() ) + { + return iSettingsModel->TextSettingValue( aSettingItem ); + } + else + { + CCamAppUiBase* appUi = static_cast( CCoeEnv::Static()->AppUi() ); + MCamAppController& controller = appUi->AppController(); + return controller.TextSettingValue( aSettingItem ); + } + } + + +// +// CGSCamcorderPlugin::SetTextSettingValueL +// +void CGSCamcorderPlugin::SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ) + { + if ( !LaunchedFromGS() ) + { + CCamAppUiBase* appUi = static_cast( CCoeEnv::Static()->AppUi() ); + MCamAppController& controller = appUi->AppController(); + controller.SetTextSettingValueL( aSettingItem, aSettingValue ); + } + else + { + iSettingsModel->SetTextSettingValueL( aSettingItem, aSettingValue ); + } + } + +// +// CGSCamcorderPlugin::SetIntegerSettingValueL +// +void CGSCamcorderPlugin::SetIntegerSettingValueL( TInt aSettingItem, + TInt aSettingValue ) + { + if ( !LaunchedFromGS() ) + { + CCamAppUiBase* appUi = static_cast( CCoeEnv::Static()->AppUi() ); + MCamAppController& controller = appUi->AppController(); + controller.SetIntegerSettingValueL( aSettingItem, aSettingValue ); + } + else + { + iSettingsModel->SetIntegerSettingValueL( aSettingItem, aSettingValue ); + } + } + + +// +// CGSCamcorderPlugin::LoadVideoStaticSettingsL +// +void CGSCamcorderPlugin::LoadVideoStaticSettingsL( TBool aResetFromGS ) + { + if ( LaunchedFromGS() ) + { + iSettingsModel->LoadVideoStaticSettingsL( aResetFromGS ); + } + else + { + CCamAppUiBase* appUi = static_cast( CCoeEnv::Static()->AppUi() ); + MCamStaticSettings& model = appUi->StaticSettingsModel(); + model.LoadVideoStaticSettingsL( aResetFromGS ); + } + } + + + +// +// CGSCamcorderPlugin::LoadPhotoStaticSettingsL +// +void CGSCamcorderPlugin::LoadPhotoStaticSettingsL( TBool aResetFromGS ) + { + if ( LaunchedFromGS() ) + { + iSettingsModel->LoadPhotoStaticSettingsL( aResetFromGS ); + } + else + { + CCamAppUiBase* appUi = static_cast( CCoeEnv::Static()->AppUi() ); + MCamStaticSettings& model = appUi->StaticSettingsModel(); + model.LoadPhotoStaticSettingsL( aResetFromGS ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPlugin::DisplayRestoreSettingsDlgL +// Display restore Camera setting confirmation dialog +// --------------------------------------------------------------------------- +// +TInt CGSCamcorderPlugin::DisplayRestoreSettingsDlgL() + { + HBufC* confirmationText; + confirmationText = StringLoader::LoadLC( R_CAM_RESTORE_SETTINGS_NOTE_TEXT ); + CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText ); + CleanupStack::PopAndDestroy( confirmationText ); + TInt response = confirmationDialog->ExecuteLD( R_CAM_RESTORE_SETTINGS_NOTE ); + if ( response ) + { + // since restore camera setting item is visible only when + // launched from camera, we inform the specific view to handle + // this from the camera side, instead doing it here in the plugin + if ( !LaunchedFromGS() ) + { + MCamAppController& controller = + static_cast( + CCoeEnv::Static()->AppUi() )->AppController(); + controller.RestoreFactorySettingsL( EFalse ); + } + else + { + iSettingsModel->ResetRepository(); + iReloadSettings = ETrue; + } + } + return response; + } + +// End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderPluginContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderPluginContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,282 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camcorder sub-menu in General Settings. +* +*/ + + +// INCLUDES +#include //for CAknSettingStyleListBox +#include +#include +#include //for listbox clases +#include // CAknIconArray +#include // CColumnListBoxData + +#include "CamAppUid.h" +#include "GSCamcorderPluginContainer.h" +#include "GSCamcorderPlugin.hrh" +#include "Cam.hrh" +#include "GSCamcorderPlugin.h" +#include + +const TInt KIconArrayGranularity = 2; + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::ConstructL +// Symbian OS default constructor +// --------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::ConstructL( const TRect& aRect ) + { + RDebug::Print( _L( "[CGSCamcorderPluginContainer]: ConstructL - Begin" ) ); + + // Construct iListBox + iListBox = new ( ELeave ) CAknSingleLargeStyleListBox; + BaseConstructL( aRect, R_GS_CAMCORDER_VIEW_TITLE, R_CAM_LBX ); + LoadIconsL(); + RDebug::Print( _L( "[CGSCamcorderPluginContainer]: ConstructL - End" ) ); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::~CGSTelPluginContainer +// Destructor +// --------------------------------------------------------------------------- +// +CGSCamcorderPluginContainer::~CGSCamcorderPluginContainer() + { + delete iListboxItemArray; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::UpdateListBoxL +// Update listbox item +// --------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::UpdateListBoxL( TInt aFeatureId ) + { + RDebug::Print( + _L( "[CGSCamcorderPluginContainer]: UpdateListBoxL - Begin" ) ); + switch ( aFeatureId ) + { + case EVideoSettingsFolder: + MakeVideoSettingsFolderItemL(); + break; + case EImageSettingsFolder: + MakeImageSettingsFolderItemL(); + break; + + default: + break; + } + + // Update the listbox + iListBox->HandleItemAdditionL(); + RDebug::Print( + _L( "[CGSCamcorderPluginContainer]: UpdateListBoxL - End" ) ); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::ConstructListBoxL +// Update listbox item +// --------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::ConstructListBoxL( TInt aResLbxId ) + { + RDebug::Print( + _L( "[CGSCamcorderPluginContainer]: ConstructListBoxL - Begin" ) ); + iListBox->ConstructL( this, EAknListBoxSelectionList ); + + iListboxItemArray = CGSListBoxItemTextArray::NewL( aResLbxId, + *iListBox, *iCoeEnv ); + iListBox->Model()->SetItemTextArray( iListboxItemArray ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + CreateListBoxItemsL(); + RDebug::Print( + _L( "[CGSCamcorderPluginContainer]: ConstructListBoxL - End" ) ); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::CreateListBoxItemsL +// Update listbox item +// --------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::CreateListBoxItemsL() + { + RDebug::Print( + _L( "[CGSCamcorderPluginContainer]: CreateListBoxItemsL - Begin" ) ); + MakeVideoSettingsFolderItemL(); + MakeImageSettingsFolderItemL(); + RDebug::Print( + _L( "[CGSCamcorderPluginContainer]: CreateListBoxItemsL - End" ) ); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::CurrentFeatureId +// Get the currently selected feature +// --------------------------------------------------------------------------- +// +TInt CGSCamcorderPluginContainer::CurrentFeatureId() const + { + return iListboxItemArray->CurrentFeature(); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::MakeVideoSettingsFolderItemL +// Create Video Settings folder item +// --------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::MakeVideoSettingsFolderItemL() + { + iListboxItemArray->SetItemVisibilityL( EVideoSettingsFolder, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSTelPluginContainer::MakeImageSettingsFolderItemL +// Create Image Settings folder item +// --------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::MakeImageSettingsFolderItemL() + { + iListboxItemArray->SetItemVisibilityL( EImageSettingsFolder, + CGSListBoxItemTextArray::EVisible ); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::GetHelpContext +// Get help for this view +// --------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { +#ifdef __SERIES60_HELP + aContext.iMajor = TUid::Uid( KCameraappUID ); + aContext.iContext = KLCAM_HLP_SETTINGS; +#endif + } + + + +// ---------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::LoadIconsL +// Load icon bitmaps. +// ---------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::LoadIconsL() + { + RDebug::Print( _L( "[CGSCamcorderPluginContainer]: LoadIconsL - Begin" ) ); + CEikColumnListBox* listbox = static_cast( iListBox ); + + // Delete the old icon array, if any + delete listbox->ItemDrawer()->ColumnData()->IconArray(); + listbox->ItemDrawer()->ColumnData()->SetIconArray( NULL ); + + // Construct a new CAknIconArray for iListBox + CAknIconArray* icons = + new ( ELeave ) CAknIconArray( KIconArrayGranularity ); + CleanupStack::PushL( icons ); + + TParse* fp = new(ELeave) TParse(); + CleanupStack::PushL( fp ); + TInt err = fp->Set(KDirAndFile, &KDC_APP_BITMAP_DIR, NULL); + + if (err != KErrNone) + { + User::Leave(err); + } + TBuf fileName = fp->FullName(); + CleanupStack::PopAndDestroy( fp ); //fp + + AppendIconToArrayL( + icons, + KAknsIIDQgnPropSetCamsImageSub, + fileName, + EMbmCamerasettingspluginQgn_lcam_gen_sett_camera_folder_image, + EMbmCamerasettingspluginQgn_lcam_gen_sett_camera_folder_image_mask ); + + AppendIconToArrayL( + icons, + KAknsIIDQgnPropSetCamsVideoSub, + fileName, + EMbmCamerasettingspluginQgn_lcam_gen_sett_camera_folder_video, + EMbmCamerasettingspluginQgn_lcam_gen_sett_camera_folder_video_mask ); + + CleanupStack::Pop( icons ); // icons + + listbox->ItemDrawer()->ColumnData()->SetIconArray( icons ); + RDebug::Print( _L( "[CGSCamcorderPluginContainer]: LoadIconsL - End" ) ); + } + +// --------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::SizeChanged +// Set the size and position of component controls. +// --------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::SizeChanged() + { + if ( iListBox ) + { + iListBox->SetRect( Rect() ); + } + } + + +// ---------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::FocusChanged +//Focus changed for listbox item. +// ---------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::FocusChanged( TDrawNow aDrawNow ) + { + CCoeControl::FocusChanged( aDrawNow ); + if( iListBox ) + { + iListBox->SetFocus( IsFocused(), aDrawNow ); + } + } + +// --------------------------------------------------------------------------- +// CGSCamcorderPluginContainer::AppendIconToArrayL +// Load a possibly skinned icon (with mask) and append it to an +// icon array. +// --------------------------------------------------------------------------- +// +void CGSCamcorderPluginContainer::AppendIconToArrayL( CAknIconArray* aArray, + const TAknsItemID& aID, + const TDesC& aMbmFile, + TInt aBitmapId, + TInt aMaskId ) + { + CGulIcon* icon = AknsUtils::CreateGulIconL( + AknsUtils::SkinInstance(), aID, aMbmFile, + aBitmapId, aMaskId ); + + CleanupStack::PushL( icon ); + aArray->AppendL( icon ); + CleanupStack::Pop( icon ); // icon + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderPluginImplementationTable.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderPluginImplementationTable.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* ECOM proxy table for this plugin +* +*/ + + +// System includes +#include +#include + +// User includes +#include "GSCamcorderPlugin.h" + +// Constants +const TImplementationProxy KCamcorderGSPluginImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( 0x2000F8E1, CGSCamcorderPlugin::NewL ) + }; + + +// --------------------------------------------------------------------------- +// ImplementationGroupProxy +// Gate/factory function +// --------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(KCamcorderGSPluginImplementationTable) + / sizeof(TImplementationProxy); + return KCamcorderGSPluginImplementationTable; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderSettingsBaseView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderSettingsBaseView.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,310 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image settings view +* +* Copyright (c) 2008 Nokia Corporation. +* This material, including documentation and any related +* computer programs, is protected by copyright controlled by +* Nokia Corporation. All rights are reserved. Copying, +* including reproducing, storing, adapting or translating, any +* or all of this material requires the prior written consent of +* Nokia Corporation. This material also contains confidential +* information which may not be disclosed to others without the +* prior written consent of Nokia Corporation. +* +* +*/ + + +// INCLUDE FILES + +#include +#include +#include +#include +#include +#include // CAknTitlePane +#include +#include +#include +#include +#include +#include +#include // For HlpLauncher + +#include // CAknSettingItemList + +#include "CamAppUid.h" + +#include "GSCamcorderPlugin.h" +#include "GSCamcorderPlugin.hrh" +#include "Cam.hrh" +#include "GSCamcorderSettingsBaseView.h" +#include "GSCamcorderSettingsContainer.h" +#include "GSCamcorderPlugin.h" +#include "MCamAppController.h" +#include "CamAppUiBase.h" + + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::CGSCamcorderSettingsBaseView +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCamcorderSettingsBaseView::CGSCamcorderSettingsBaseView( CCamStaticSettingsModel& aModel, + TBool aPhotoSettings ) +: iModel( aModel ), + iSecondaryCameraSettings( EFalse ) + { + iPhotoSettings = aPhotoSettings; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::~CGSCamcorderSettingsBaseView +// Destructor +// --------------------------------------------------------------------------- +// +CGSCamcorderSettingsBaseView::~CGSCamcorderSettingsBaseView() + { + if ( iContainer ) + { + AppUi()->RemoveFromStack( iContainer ); + delete iContainer; + } + } + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::LaunchedFromGS +// For variating the construction of the setting items +// --------------------------------------------------------------------------- +// +TBool CGSCamcorderSettingsBaseView::LaunchedFromGS() const + { + return AppUi()->Application()->AppDllUid().iUid != KCameraappUID; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::HandleCommandL +// From MEikMenuObserver delegate commands from the menu +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsBaseView::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case ECamMSKCmdAppChange: + static_cast ( iContainer )->EditCurrentL( EFalse ); + break; + case EAknCmdHelp: +#ifdef __SERIES60_HELP + if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + HlpLauncher::LaunchHelpApplicationL( + iEikonEnv->WsSession(), AppUi()->AppHelpContextL() ); + } +#endif + break; + case EAknCmdOpen: // MSK change + { + TKeyEvent key; + key.iRepeats = 0; + key.iCode = EKeyEnter; + key.iModifiers = 0; + iEikonEnv->SimulateKeyEventL( key, EEventKey ); + break; + } + default: + { + AppUi()->HandleCommandL( aCommand ); + break; + } + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::DoActivateL +// Activate this view +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsBaseView::DoActivateL( const TVwsViewId& /* aPrevViewId */, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + SetNaviPaneL(); + StatusPane()->MakeVisible( ETrue ); + if( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + delete iContainer; + iContainer = NULL; + } + CGSCamcorderPlugin* parent = + static_cast ( + AppUi()->View( KGSCamcorderGSPluginUid ) ); + iSecondaryCameraSettings = parent->IsSecondaryCameraSettings(); + CreateContainerL(); + AppUi()->AddToViewStackL( *this, iContainer ); + + iContainer->SetRect( ClientRect() ); + iContainer->ActivateL(); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsBaseView::DoDeactivate() + { + if ( iContainer ) + { + AppUi()->RemoveFromStack( iContainer ); + delete iContainer; + iContainer = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::Container +// Returns network container item +// --------------------------------------------------------------------------- +// +CGSCamcorderSettingsContainer* CGSCamcorderSettingsBaseView::Container() + { + return static_cast ( iContainer ); + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::DynInitMenuPaneL +// Dynamically customize menu items +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsBaseView::DynInitMenuPaneL( TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + if ( aResourceId == R_GS_CAM_SETTINGS_MENU ) + { +#ifdef __SERIES60_HELP + if ( !FeatureManager::FeatureSupported( KFeatureIdHelp ) ) + { + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + } +#endif + } + } + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::NewContainerL() +// Creates new iContainer. +// --------------------------------------------------------------------------- +void CGSCamcorderSettingsBaseView::NewContainerL() + { + iContainer = new (ELeave) CGSCamcorderSettingsContainer; + } + + +// ----------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::HandleClientRectChange +// Handle screen size change. +// ----------------------------------------------------------------------------- +// +void CGSCamcorderSettingsBaseView::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::HandleListBoxEventL +// +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsBaseView::HandleListBoxEventL( CEikListBox* /*aListBox*/, + TListBoxEvent aEventType ) + { + switch ( aEventType ) + { + case EEventEnterKeyPressed: + case EEventItemDoubleClicked: + case EEventItemSingleClicked: + if( iContainer ) + { + iContainer->EditCurrentL(); + } + break; + default: + break; + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::CreateContainerL() +// Creates new iContainer. +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsBaseView::CreateContainerL() + { + NewContainerL(); + iContainer->SetMopParent( this ); + + TRAPD( error, iContainer->ConstructL( iModel, + LaunchedFromGS(), + iSecondaryCameraSettings, + iPhotoSettings ) ); + + if ( error ) + { + delete iContainer; + iContainer = NULL; + User::Leave( error ); + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsBaseView::SetNaviPaneL +// Sets Navipane texts. +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsBaseView::SetNaviPaneL() + { + CEikStatusPane* sp = AppUi()->StatusPane(); + CAknTitlePane* title = static_cast + ( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); + + TInt resId = R_CAM_PHOTO_SETTINGS_TITLE_NAME; + if ( !iPhotoSettings ) + { + resId = R_CAM_VIDEO_SETTINGS_TITLE_NAME; + } + // Set view title from resource: + TResourceReader rReader; + iCoeEnv->CreateResourceReaderLC( rReader, resId ); + title->SetFromResourceL( rReader ); + CleanupStack::PopAndDestroy(); //rReader + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderSettingsContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamcorderSettingsContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,303 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image settings container +* +* Copyright (c) 2008 Nokia Corporation. +* This material, including documentation and any related +* computer programs, is protected by copyright controlled by +* Nokia Corporation. All rights are reserved. Copying, +* including reproducing, storing, adapting or translating, any +* or all of this material requires the prior written consent of +* Nokia Corporation. This material also contains confidential +* information which may not be disclosed to others without the +* prior written consent of Nokia Corporation. +* +* +*/ + + +// INCLUDE FILES +#include +#include // CAknSingleGraphicStyleListBox +#include // TResourceReader +#include // CColumnListBoxData + +#include // CAknSettingItemList + +#include "CamAppUid.h" + +#include +#include "GSCamcorderSettingsContainer.h" +#include "GSCamPhotoSettingsList.h" +#include "GSCamVideoSettingsList.h" +#include "CamAppUiBase.h" +#include "MCamAppController.h" +#include "CameraUiConfigManager.h" + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsContainer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsContainer::ConstructL( CCamStaticSettingsModel& aModel, + TBool aLauchedFromGS, + TBool aSecondaryCameraSettings, + TBool aImageSettings ) + { + iLauchedFromGS = aLauchedFromGS; + iImageSettings = aImageSettings; + if ( iImageSettings ) + { + iSettingsList = new ( ELeave ) CGSCamPhotoSettingsList( aModel ); + } + else + { + iSettingsList = new ( ELeave ) CGSCamVideoSettingsList( aModel ); + } + CreateWindowL(); + + iSettingsList->SetContainerWindowL( *this ); + if ( iImageSettings ) + { + static_cast( iSettingsList )->ConstructL( + aLauchedFromGS, aSecondaryCameraSettings ); + } + else + { + static_cast( iSettingsList )->ConstructL( + aLauchedFromGS, aSecondaryCameraSettings ); + } + + if ( !iLauchedFromGS ) + { + // read the product specific capture key from ui config manager + RArray primaryCaptureKeys; + CleanupClosePushL( primaryCaptureKeys ); + if ( aModel.UiConfigManagerPtr() ) + { + aModel.UiConfigManagerPtr()->SupportedPrimaryCameraCaptureKeyL( primaryCaptureKeys ); + } + iProductCaptureKey = primaryCaptureKeys[0]; + CleanupStack::PopAndDestroy( &primaryCaptureKeys ); + } + + /* + if ( !aLauchedFromGS ) + { + // create navi pane bitmaps and add to navipane + // only if launched from camera application. + CreateNaviBitmapsL(); + } + */ + } + + +// Destructor +CGSCamcorderSettingsContainer::~CGSCamcorderSettingsContainer() + { + if ( iSettingsList ) + { + delete iSettingsList; + iSettingsList = NULL; + } + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsContainer::EditCurrentL +// Open setting page for currently selected setting item. +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsContainer::EditCurrentL( TBool aCalledFromMenu /*=ETrue*/ ) + { + TInt index = iSettingsList->SettingItemArray()->ItemIndexFromVisibleIndex( + iSettingsList->ListBox()->CurrentItemIndex() ); + iSettingsList->EditItemL( index, aCalledFromMenu ); + } + + +// --------------------------------------------------------- +// CGSCamcorderSettingsContainer::GetHelpContext +// Gives the help context to be displayed +// --------------------------------------------------------- +// +void CGSCamcorderSettingsContainer::GetHelpContext( + TCoeHelpContext& aContext ) const + { +#ifdef __SERIES60_HELP + aContext.iMajor = TUid::Uid( KCameraappUID ); + if ( iImageSettings ) + { + aContext.iContext = KLCAM_HLP_SETTINGS_PHOTO; + } + else + { + aContext.iContext = KLCAM_HLP_SETTINGS_VIDEO; + } +#endif + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsContainer::CountComponentControls +// From CCoeControl return the number of controls owned +// --------------------------------------------------------------------------- +// +TInt CGSCamcorderSettingsContainer::CountComponentControls() const + { + return 1; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsContainer::ComponentControl +// From CCoeControl returns a control +// --------------------------------------------------------------------------- +// +CCoeControl* CGSCamcorderSettingsContainer::ComponentControl( + TInt /* aIndex */ ) const + { + return iSettingsList; + } + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsContainer::SettingsList +// Returns a pointer to settingslist +// --------------------------------------------------------------------------- +// +CAknSettingItemList* CGSCamcorderSettingsContainer::SettingsList() const + { + return iSettingsList; + } + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsContainer::OfferKeyEventL +// Key event handling +// --------------------------------------------------------------------------- +// +TKeyResponse CGSCamcorderSettingsContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if ( aKeyEvent.iScanCode == iProductCaptureKey && !iLauchedFromGS ) + { + CCamAppUiBase* camAppUi = (CCamAppUiBase*)iAvkonAppUiBase; + + TBool background = camAppUi->AppInBackground( EFalse ); + + if ( background ) + { + // Capture key pressed and camera in background. + // Jump to foreground. + CEikonEnv::Static()->RootWin().SetOrdinalPosition( 0, 0 ); + return EKeyWasConsumed; + } + return EKeyWasNotConsumed; + } + + TKeyEvent newKeyEvent = aKeyEvent; + if ( !iLauchedFromGS ) + { + if ( aKeyEvent.iCode == EKeyLeftArrow ) + { + newKeyEvent.iCode = EKeyDownArrow; + } + else if ( aKeyEvent.iCode == EKeyRightArrow ) + { + // Listbox takes all events even if it doesn't use them + //return EKeyWasNotConsumed; + newKeyEvent.iCode = EKeyUpArrow; + } + } + else + { + if ( aKeyEvent.iCode == EKeyLeftArrow || + aKeyEvent.iCode == EKeyRightArrow ) + { + // Listbox takes all events even if it doesn't use them + return EKeyWasNotConsumed; + } + } + return iSettingsList->OfferKeyEventL( newKeyEvent, aType ); + } + + + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsContainer::SizeChanged +// Set the size and position of component controls. +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsContainer::SizeChanged() + { + if ( iSettingsList ) + { + iSettingsList->SetRect( Rect() ); + } + } + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsContainer::HandleResourceChange +// Handles resource changes, e.g. layout changes of screen. +// --------------------------------------------------------------------------- +void CGSCamcorderSettingsContainer::HandleResourceChange( TInt aType ) + { + if ( aType == KEikDynamicLayoutVariantSwitch ) + { + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect); + SetRect( mainPaneRect ); + } + CCoeControl::HandleResourceChange( aType ); + } + + +// --------------------------------------------------------- +// CGSCamcorderSettingsContainer::FocusChanged +// Focus changed for listbox item. +// --------------------------------------------------------- +// +void CGSCamcorderSettingsContainer::FocusChanged( TDrawNow aDrawNow ) + { + CCoeControl::FocusChanged( aDrawNow ); + if ( iSettingsList ) + { + iSettingsList->SetFocus( IsFocused(), aDrawNow ); + } + //CreateNaviBitmapsL(); + } + +// --------------------------------------------------------------------------- +// CGSCamcorderSettingsContainer::CreateNaviBitmapsL() +// We ask navi counter model to draw the counter and storage icon for us +// when we are in image settings. +// --------------------------------------------------------------------------- +// +void CGSCamcorderSettingsContainer::CreateNaviBitmapsL() + { + if ( !iLauchedFromGS ) + { + CCamAppUiBase* camAppUi = (CCamAppUiBase*)iAvkonAppUiBase; + if ( camAppUi ) + { + camAppUi->CreateNaviBitmapsL( ETrue ); + } + } + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamdefaultnamesettingpage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCamdefaultnamesettingpage.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item page for default name (text/date).* +*/ + + + +// INCLUDE FILES + +#include +#include +#include +#include +#include "CamSettingsInternal.hrh" +#include "GSCamdefaultnamesettingpage.h" +#include "CamUtility.h" +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// CGSCamDefaultNameSettingPage::CGSCamDefaultNameSettingPage +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCamDefaultNameSettingPage::CGSCamDefaultNameSettingPage( + TDes& aNameBase, + TCamCameraMode aMode, + const TDesC* aSettingTitleText, + TInt aSettingNumber, + TInt aControlType, + TInt aEditorResourceId, + TInt aSettingPageResourceId, + MAknQueryValue& aQueryValue, + TBool aCamera ) + : CAknPopupSettingPage( aSettingTitleText, aSettingNumber, + aControlType, aEditorResourceId, + aSettingPageResourceId, + aQueryValue ), + iNameBase( aNameBase ), + iMode( aMode ), + iCamera ( aCamera ) + { + } + + +// --------------------------------------------------------------------------- +// CGSCamDefaultNameSettingPage::~CGSCamDefaultNameSettingPage +// Destructor. +// --------------------------------------------------------------------------- +// +CGSCamDefaultNameSettingPage::~CGSCamDefaultNameSettingPage() + { + } + + +// --------------------------------------------------------------------------- +// CGSCamDefaultNameSettingPage::OkToExitL +// Check if the name base value is ok, so the user can +// exit the setting page. +// --------------------------------------------------------------------------- +// +TBool CGSCamDefaultNameSettingPage::OkToExitL( TBool aAccept ) + { + if ( aAccept ) + { + iTempNameBase = iNameBase; + + if ( QueryValue()->CurrentValueIndex() == ECamNameBaseText ) + { + // Ensure application is in editing orientation + CAknAppUiBase* appUi = + static_cast( CCoeEnv::Static()->AppUi() ); + + // Show the editor dialog + TBool editorRet = EFalse; + // Trap this to make sure the orientation is reverted back to normal + TRAPD( leaveErr, editorRet = ShowEditorDialogL() ) + if ( !editorRet ) + { + // redraw listbox to update radio button when cancel is pressed + ListBoxControl()->DrawNow(); + } + if ( !iCamera ) + { + appUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape ); + } + else + { + //appUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationPortrait ); + } + User::LeaveIfError( leaveErr ); + return editorRet; + } + + } + return ETrue; + } + +// --------------------------------------------------------------------------- +// CGSCamDefaultNameSettingPage::ShowEditorDialogL +// Display the text editor dialog +// --------------------------------------------------------------------------- +// +TBool CGSCamDefaultNameSettingPage::ShowEditorDialogL() + { + TBool done = EFalse; + while ( !done ) + { + // Show data query + HBufC* prompt = NULL; + if ( ECamControllerVideo == iMode ) + { + prompt = StringLoader::LoadLC( R_CAM_QUERY_DEFAULT_VIDEO_NAME ); + } + else + { + prompt = StringLoader::LoadLC( R_CAM_QUERY_DEFAULT_IMAGE_NAME ); + } + + CAknTextQueryDialog* nameQuery = + CAknTextQueryDialog::NewL( iTempNameBase ); + + nameQuery->SetMaxLength( KMaxNameBaseLength ); + nameQuery->PrepareLC( R_CAM_RENAME_QUERY ); + nameQuery->SetPromptL( *prompt ); + + TBool res = ( nameQuery->RunLD() == EAknSoftkeyOk ); + + CleanupStack::PopAndDestroy(); // prompt + + if ( !res ) + { + // User cancelled the query, return to setting page + return EFalse; + } + + // Check base name validity + res = CamUtility::CheckFileNameValidityL( iTempNameBase ); + + if ( res ) + { + // New name base was valid, exit setting page + iNameBase = iTempNameBase; + return res; + } + + // Show data query again + } + // should never get here + return EFalse; + } +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCustomQualitySettingItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/GsCamcorderPlugin/src/GSCustomQualitySettingItem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Location Setting item type for Image settings* +*/ + + + +// INCLUDE FILES +#include "GSCustomQualitySettingItem.h" +#include "CamLocationSettingPage.h" +#include "CamUtility.h" +#include "GSCamcorderPlugin.h" +#include "CamAppUiBase.h" + +#include "camconfiguration.h" + + +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== +// --------------------------------------------------------------------------- +// CGSCustomQualitySettingItem::CGSCustomQualitySettingItem +// C++ constructor +// --------------------------------------------------------------------------- +// +CGSCustomQualitySettingItem::CGSCustomQualitySettingItem( + TInt aIdentifier, + TInt& aValue, + CCamStaticSettingsModel& aModel, + TCamCameraMode aMode ) + : CAknEnumeratedTextPopupSettingItem( aIdentifier, aValue ), + iModel( aModel ), + iMode( aMode ) + { + } + + +// --------------------------------------------------------------------------- +// CGSCustomQualitySettingItem::~CGSCustomQualitySettingItem +// Destructor. +// --------------------------------------------------------------------------- +// +CGSCustomQualitySettingItem::~CGSCustomQualitySettingItem() + { + iSupportedQualityLevels.Close(); + } + +// --------------------------------------------------------------------------- +// CGSCustomQualitySettingItem::CompleteConstructionL +// Gets the correct text for a currently selected album +// --------------------------------------------------------------------------- +// +void CGSCustomQualitySettingItem::CompleteConstructionL() + { + PRINT( _L("Camera => CGSCustomQualitySettingItem::CompleteConstructionL") ); + + CAknEnumeratedTextPopupSettingItem::CompleteConstructionL(); + + // make sure we only have the supported items in our text array + CArrayPtr* array = EnumeratedTextArray(); + + TBool isVideoMode = (ECamControllerVideo == iMode); + + TCamPsiKey key = isVideoMode + ? ECamPsiSupportedVideoQualities + : ECamPsiSupportedStillQualities; + + iModel.Configuration().GetPsiIntArrayL( key, iSupportedQualityLevels ); + + iSupportedQualityLevels.Sort(); + + // amend list of supported settings + TInt sCount = iSupportedQualityLevels.Count(); + + TInt cnt = array->Count(); + TInt j = --sCount; + TInt i; + + for ( i = cnt; --i >= 0; ) + { + if( j < 0 || + i != iModel.Configuration().MapSupportedQualityToQualityDescriptor( + isVideoMode, + iSupportedQualityLevels[j] ) + ) + { + delete ( array->At( i ) ); + array->Delete( i ); + } + else + { + j--; + } + } + + // Reset the enum values in the resource, so that the updated list has the + // new values starting from 0 + for( i = 0; i < array->Count(); i++ ) + { + array->At(i)->SetEnumerationValue( i ); + } + +#ifdef _DEBUG + PRINT( _L("Camera <> ===============================================") ); + PRINT( _L("Camera <> Quality setting item texts left:") ); + for( i = 0; i < array->Count(); i++ ) + { + PRINT2( _L("Camera <> Quality (%d): %S"), + i, + array->At(i)->Value() ); + } + PRINT( _L("Camera <> ===============================================") ); +#endif + + + PRINT( _L("Camera <= CGSCustomQualitySettingItem::CompleteConstructionL") ); + } + + + +// End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/bitmaps/qgn_indi_cam_battery_strength_bmp.bmp Binary file camerauis/cameraapp/generic/bitmaps/qgn_indi_cam_battery_strength_bmp.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/bitmaps/qgn_indi_cam_battery_strength_bmp_mask.bmp Binary file camerauis/cameraapp/generic/bitmaps/qgn_indi_cam_battery_strength_bmp_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/bitmaps/qgn_indi_lcam_cont_cam_xenon_charging.bmp Binary file camerauis/cameraapp/generic/bitmaps/qgn_indi_lcam_cont_cam_xenon_charging.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/bitmaps/qgn_indi_lcam_cont_cam_xenon_charging_mask.bmp Binary file camerauis/cameraapp/generic/bitmaps/qgn_indi_lcam_cont_cam_xenon_charging_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/bitmaps/qgn_prop_cam_battery_icon_bmp.bmp Binary file camerauis/cameraapp/generic/bitmaps/qgn_prop_cam_battery_icon_bmp.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/bitmaps/qgn_prop_cam_battery_icon_bmp_mask.bmp Binary file camerauis/cameraapp/generic/bitmaps/qgn_prop_cam_battery_icon_bmp_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/bwins/camerauiconfigmanageru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/bwins/camerauiconfigmanageru.def Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,62 @@ +EXPORTS + ?IsThumbnailManagerAPISupported@CCameraUiConfigManager@@QBEHXZ @ 1 NONAME ; int CCameraUiConfigManager::IsThumbnailManagerAPISupported(void) const + ?CaptureToneDelay@CCameraUiConfigManager@@QBEHXZ @ 2 NONAME ; int CCameraUiConfigManager::CaptureToneDelay(void) const + ?IsQwerty2ndCamera@CCameraUiConfigManager@@QBEHXZ @ 3 NONAME ; int CCameraUiConfigManager::IsQwerty2ndCamera(void) const + ?SupportedPrimaryCameraAutoFocusKeyL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 4 NONAME ; void CCameraUiConfigManager::SupportedPrimaryCameraAutoFocusKeyL(class RArray &) + ?SupportedEVSettingsL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 5 NONAME ; void CCameraUiConfigManager::SupportedEVSettingsL(class RArray &) + ?IsISOSupported@CCameraUiConfigManager@@QBEHXZ @ 6 NONAME ; int CCameraUiConfigManager::IsISOSupported(void) const + ?SupportedMaxExtendedZoomStepsL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 7 NONAME ; void CCameraUiConfigManager::SupportedMaxExtendedZoomStepsL(class RArray &) + ?IsKeyLockWatcherSupported@CCameraUiConfigManager@@QBEHXZ @ 8 NONAME ; int CCameraUiConfigManager::IsKeyLockWatcherSupported(void) const + ?IsContinuosAutofocusSupported@CCameraUiConfigManager@@QBEHXZ @ 9 NONAME ; int CCameraUiConfigManager::IsContinuosAutofocusSupported(void) const + ?SupportedMaxZoomStepsL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 10 NONAME ; void CCameraUiConfigManager::SupportedMaxZoomStepsL(class RArray &) + ?SupportedFlashModeSettingsL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 11 NONAME ; void CCameraUiConfigManager::SupportedFlashModeSettingsL(class RArray &) + ?SupportedSceneModesAndSettingsL@CCameraUiConfigManager@@QAEXAAV?$RArray@UTSceneSettings@@@@H@Z @ 12 NONAME ; void CCameraUiConfigManager::SupportedSceneModesAndSettingsL(class RArray &, int) + ?IsXenonFlashSupported@CCameraUiConfigManager@@QBEHXZ @ 13 NONAME ; int CCameraUiConfigManager::IsXenonFlashSupported(void) const + ?IsVideoLightSupported@CCameraUiConfigManager@@QBEHXZ @ 14 NONAME ; int CCameraUiConfigManager::IsVideoLightSupported(void) const + ?SupportedColorToneSettingsL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 15 NONAME ; void CCameraUiConfigManager::SupportedColorToneSettingsL(class RArray &) + ?SupportedPrimaryCameraZoomOutKeysL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 16 NONAME ; void CCameraUiConfigManager::SupportedPrimaryCameraZoomOutKeysL(class RArray &) + ?IsExtendedLightSensitivitySupported@CCameraUiConfigManager@@QBEHXZ @ 17 NONAME ; int CCameraUiConfigManager::IsExtendedLightSensitivitySupported(void) const + ?IsFlashModeSupported@CCameraUiConfigManager@@QBEHXZ @ 18 NONAME ; int CCameraUiConfigManager::IsFlashModeSupported(void) const + ?SupportedSharpnessSettingsL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 19 NONAME ; void CCameraUiConfigManager::SupportedSharpnessSettingsL(class RArray &) + ?SupportedSecondaryCameraAutoFocusKeyL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 20 NONAME ; void CCameraUiConfigManager::SupportedSecondaryCameraAutoFocusKeyL(class RArray &) + ?IsAutofocusSetInHyperfocalAtStartup@CCameraUiConfigManager@@QBEHXZ @ 21 NONAME ; int CCameraUiConfigManager::IsAutofocusSetInHyperfocalAtStartup(void) const + ?NewLC@CCameraUiConfigManager@@SAPAV1@XZ @ 22 NONAME ; class CCameraUiConfigManager * CCameraUiConfigManager::NewLC(void) + ?NewL@CCameraUiConfigManager@@SAPAV1@XZ @ 23 NONAME ; class CCameraUiConfigManager * CCameraUiConfigManager::NewL(void) + ?IsSharpnessFeatureSupported@CCameraUiConfigManager@@QBEHXZ @ 24 NONAME ; int CCameraUiConfigManager::IsSharpnessFeatureSupported(void) const + ?SupportedWhiteBalanceSettingsL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 25 NONAME ; void CCameraUiConfigManager::SupportedWhiteBalanceSettingsL(class RArray &) + ?SupportedPrimaryCameraZoomInKeysL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 26 NONAME ; void CCameraUiConfigManager::SupportedPrimaryCameraZoomInKeysL(class RArray &) + ?IsSecondaryCameraSupported@CCameraUiConfigManager@@QBEHXZ @ 27 NONAME ; int CCameraUiConfigManager::IsSecondaryCameraSupported(void) const + ?IsBurstModeSupported@CCameraUiConfigManager@@QBEHXZ @ 28 NONAME ; int CCameraUiConfigManager::IsBurstModeSupported(void) const + ?BurstFileSizeEstimateFactor@CCameraUiConfigManager@@QBEHXZ @ 29 NONAME ; int CCameraUiConfigManager::BurstFileSizeEstimateFactor(void) const + ?IsFaceTrackingSupported@CCameraUiConfigManager@@QBEHXZ @ 30 NONAME ; int CCameraUiConfigManager::IsFaceTrackingSupported(void) const + ?IsCaptureToneDelaySupported@CCameraUiConfigManager@@QBEHXZ @ 31 NONAME ; int CCameraUiConfigManager::IsCaptureToneDelaySupported(void) const + ?IsOpticalJoyStickSupported@CCameraUiConfigManager@@QBEHXZ @ 32 NONAME ; int CCameraUiConfigManager::IsOpticalJoyStickSupported(void) const + ?IsUIOrientationOverrideSupported@CCameraUiConfigManager@@QBEHXZ @ 33 NONAME ; int CCameraUiConfigManager::IsUIOrientationOverrideSupported(void) const + ?SupportedSecondaryCameraZoomInKeysL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 34 NONAME ; void CCameraUiConfigManager::SupportedSecondaryCameraZoomInKeysL(class RArray &) + ?IsBrightnessSupported@CCameraUiConfigManager@@QBEHXZ @ 35 NONAME ; int CCameraUiConfigManager::IsBrightnessSupported(void) const + ?SupportedContrastRangeL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 36 NONAME ; void CCameraUiConfigManager::SupportedContrastRangeL(class RArray &) + ?IsColorToneFeatureSupported@CCameraUiConfigManager@@QBEHXZ @ 37 NONAME ; int CCameraUiConfigManager::IsColorToneFeatureSupported(void) const + ?SupportedZoomDelaysL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 38 NONAME ; void CCameraUiConfigManager::SupportedZoomDelaysL(class RArray &) + ?IsContrastSupported@CCameraUiConfigManager@@QBEHXZ @ 39 NONAME ; int CCameraUiConfigManager::IsContrastSupported(void) const + ?IsPublishZoomStateSupported@CCameraUiConfigManager@@QBEHXZ @ 40 NONAME ; int CCameraUiConfigManager::IsPublishZoomStateSupported(void) const + ?SupportedPrimaryCameraCaptureKeyL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 41 NONAME ; void CCameraUiConfigManager::SupportedPrimaryCameraCaptureKeyL(class RArray &) + ?SupportedLAFZoomBarL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 42 NONAME ; void CCameraUiConfigManager::SupportedLAFZoomBarL(class RArray &) + ?IsExtendedDigitalZoomSupported@CCameraUiConfigManager@@QBEHXZ @ 43 NONAME ; int CCameraUiConfigManager::IsExtendedDigitalZoomSupported(void) const + ?IsLensCoverSupported@CCameraUiConfigManager@@QBEHXZ @ 44 NONAME ; int CCameraUiConfigManager::IsLensCoverSupported(void) const + ?RequiredRamMemoryFocusGained@CCameraUiConfigManager@@QBEHXZ @ 45 NONAME ; int CCameraUiConfigManager::RequiredRamMemoryFocusGained(void) const + ?CriticalLevelRamMemory@CCameraUiConfigManager@@QBEHXZ @ 46 NONAME ; int CCameraUiConfigManager::CriticalLevelRamMemory(void) const + ?SupportedBrightnessRangeL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 47 NONAME ; void CCameraUiConfigManager::SupportedBrightnessRangeL(class RArray &) + ?SupportedSecondaryCameraCaptureKeyL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 48 NONAME ; void CCameraUiConfigManager::SupportedSecondaryCameraCaptureKeyL(class RArray &) + ?IsAutoFocusSupported@CCameraUiConfigManager@@QBEHXZ @ 49 NONAME ; int CCameraUiConfigManager::IsAutoFocusSupported(void) const + ?IsOrientationSensorSupported@CCameraUiConfigManager@@QBEHXZ @ 50 NONAME ; int CCameraUiConfigManager::IsOrientationSensorSupported(void) const + ?IsPhotosSupported@CCameraUiConfigManager@@QBEHXZ @ 51 NONAME ; int CCameraUiConfigManager::IsPhotosSupported(void) const + ?RequiredRamMemory@CCameraUiConfigManager@@QBEHXZ @ 52 NONAME ; int CCameraUiConfigManager::RequiredRamMemory(void) const + ?IsLocationSupported@CCameraUiConfigManager@@QBEHXZ @ 53 NONAME ; int CCameraUiConfigManager::IsLocationSupported(void) const + ?IsOneClickUploadSupported@CCameraUiConfigManager@@QBEHXZ @ 54 NONAME ; int CCameraUiConfigManager::IsOneClickUploadSupported(void) const + ?IsVideoStabilizationSupported@CCameraUiConfigManager@@QBEHXZ @ 55 NONAME ; int CCameraUiConfigManager::IsVideoStabilizationSupported(void) const + ?IsEVSupported@CCameraUiConfigManager@@QBEHXZ @ 56 NONAME ; int CCameraUiConfigManager::IsEVSupported(void) const + ?IsWhiteBalanceFeatureSupported@CCameraUiConfigManager@@QBEHXZ @ 57 NONAME ; int CCameraUiConfigManager::IsWhiteBalanceFeatureSupported(void) const + ?SupportedSecondaryCameraZoomOutKeysL@CCameraUiConfigManager@@QAEXAAV?$RArray@H@@@Z @ 58 NONAME ; void CCameraUiConfigManager::SupportedSecondaryCameraZoomOutKeysL(class RArray &) + ?IsDSAViewFinderSupported@CCameraUiConfigManager@@QBEHH@Z @ 59 NONAME ; int CCameraUiConfigManager::IsDSAViewFinderSupported(int) const + ?CriticalLevelRamMemoryFocusGained@CCameraUiConfigManager@@QBEHXZ @ 60 NONAME ; int CCameraUiConfigManager::CriticalLevelRamMemoryFocusGained(void) const + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/conf/camerauiconfigmanager.confml Binary file camerauis/cameraapp/generic/camerauiconfigmanager/conf/camerauiconfigmanager.confml has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/conf/camerauiconfigmanager_2001B29B.crml Binary file camerauis/cameraapp/generic/camerauiconfigmanager/conf/camerauiconfigmanager_2001B29B.crml has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/eabi/camerauiconfigmanageru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/eabi/camerauiconfigmanageru.def Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,66 @@ +EXPORTS + _ZN22CCameraUiConfigManager20SupportedEVSettingsLER6RArrayIiE @ 1 NONAME + _ZN22CCameraUiConfigManager20SupportedLAFZoomBarLER6RArrayIiE @ 2 NONAME + _ZN22CCameraUiConfigManager20SupportedZoomDelaysLER6RArrayIiE @ 3 NONAME + _ZN22CCameraUiConfigManager22SupportedMaxZoomStepsLER6RArrayIiE @ 4 NONAME + _ZN22CCameraUiConfigManager23SupportedContrastRangeLER6RArrayIiE @ 5 NONAME + _ZN22CCameraUiConfigManager25SupportedBrightnessRangeLER6RArrayIiE @ 6 NONAME + _ZN22CCameraUiConfigManager27SupportedColorToneSettingsLER6RArrayIiE @ 7 NONAME + _ZN22CCameraUiConfigManager27SupportedFlashModeSettingsLER6RArrayIiE @ 8 NONAME + _ZN22CCameraUiConfigManager27SupportedSharpnessSettingsLER6RArrayIiE @ 9 NONAME + _ZN22CCameraUiConfigManager30SupportedMaxExtendedZoomStepsLER6RArrayIiE @ 10 NONAME + _ZN22CCameraUiConfigManager30SupportedWhiteBalanceSettingsLER6RArrayIiE @ 11 NONAME + _ZN22CCameraUiConfigManager31SupportedSceneModesAndSettingsLER6RArrayI14TSceneSettingsEi @ 12 NONAME + _ZN22CCameraUiConfigManager33SupportedPrimaryCameraCaptureKeyLER6RArrayIiE @ 13 NONAME + _ZN22CCameraUiConfigManager33SupportedPrimaryCameraZoomInKeysLER6RArrayIiE @ 14 NONAME + _ZN22CCameraUiConfigManager34SupportedPrimaryCameraZoomOutKeysLER6RArrayIiE @ 15 NONAME + _ZN22CCameraUiConfigManager35SupportedPrimaryCameraAutoFocusKeyLER6RArrayIiE @ 16 NONAME + _ZN22CCameraUiConfigManager35SupportedSecondaryCameraCaptureKeyLER6RArrayIiE @ 17 NONAME + _ZN22CCameraUiConfigManager35SupportedSecondaryCameraZoomInKeysLER6RArrayIiE @ 18 NONAME + _ZN22CCameraUiConfigManager36SupportedSecondaryCameraZoomOutKeysLER6RArrayIiE @ 19 NONAME + _ZN22CCameraUiConfigManager37SupportedSecondaryCameraAutoFocusKeyLER6RArrayIiE @ 20 NONAME + _ZN22CCameraUiConfigManager4NewLEv @ 21 NONAME + _ZN22CCameraUiConfigManager5NewLCEv @ 22 NONAME + _ZNK22CCameraUiConfigManager13IsEVSupportedEv @ 23 NONAME + _ZNK22CCameraUiConfigManager14IsISOSupportedEv @ 24 NONAME + _ZNK22CCameraUiConfigManager16CaptureToneDelayEv @ 25 NONAME + _ZNK22CCameraUiConfigManager17IsPhotosSupportedEv @ 26 NONAME + _ZNK22CCameraUiConfigManager17IsQwerty2ndCameraEv @ 27 NONAME + _ZNK22CCameraUiConfigManager17RequiredRamMemoryEv @ 28 NONAME + _ZNK22CCameraUiConfigManager19IsContrastSupportedEv @ 29 NONAME + _ZNK22CCameraUiConfigManager19IsLocationSupportedEv @ 30 NONAME + _ZNK22CCameraUiConfigManager20IsAutoFocusSupportedEv @ 31 NONAME + _ZNK22CCameraUiConfigManager20IsBurstModeSupportedEv @ 32 NONAME + _ZNK22CCameraUiConfigManager20IsFlashModeSupportedEv @ 33 NONAME + _ZNK22CCameraUiConfigManager20IsLensCoverSupportedEv @ 34 NONAME + _ZNK22CCameraUiConfigManager21IsBrightnessSupportedEv @ 35 NONAME + _ZNK22CCameraUiConfigManager21IsVideoLightSupportedEv @ 36 NONAME + _ZNK22CCameraUiConfigManager21IsXenonFlashSupportedEv @ 37 NONAME + _ZNK22CCameraUiConfigManager22CriticalLevelRamMemoryEv @ 38 NONAME + _ZNK22CCameraUiConfigManager23IsFaceTrackingSupportedEv @ 39 NONAME + _ZNK22CCameraUiConfigManager24IsDSAViewFinderSupportedEi @ 40 NONAME + _ZNK22CCameraUiConfigManager25IsKeyLockWatcherSupportedEv @ 41 NONAME + _ZNK22CCameraUiConfigManager25IsOneClickUploadSupportedEv @ 42 NONAME + _ZNK22CCameraUiConfigManager26IsOpticalJoyStickSupportedEv @ 43 NONAME + _ZNK22CCameraUiConfigManager26IsSecondaryCameraSupportedEv @ 44 NONAME + _ZNK22CCameraUiConfigManager27BurstFileSizeEstimateFactorEv @ 45 NONAME + _ZNK22CCameraUiConfigManager27IsCaptureToneDelaySupportedEv @ 46 NONAME + _ZNK22CCameraUiConfigManager27IsColorToneFeatureSupportedEv @ 47 NONAME + _ZNK22CCameraUiConfigManager27IsPublishZoomStateSupportedEv @ 48 NONAME + _ZNK22CCameraUiConfigManager27IsSharpnessFeatureSupportedEv @ 49 NONAME + _ZNK22CCameraUiConfigManager28IsOrientationSensorSupportedEv @ 50 NONAME + _ZNK22CCameraUiConfigManager28RequiredRamMemoryFocusGainedEv @ 51 NONAME + _ZNK22CCameraUiConfigManager29IsContinuosAutofocusSupportedEv @ 52 NONAME + _ZNK22CCameraUiConfigManager29IsVideoStabilizationSupportedEv @ 53 NONAME + _ZNK22CCameraUiConfigManager30IsExtendedDigitalZoomSupportedEv @ 54 NONAME + _ZNK22CCameraUiConfigManager30IsThumbnailManagerAPISupportedEv @ 55 NONAME + _ZNK22CCameraUiConfigManager30IsWhiteBalanceFeatureSupportedEv @ 56 NONAME + _ZNK22CCameraUiConfigManager32IsUIOrientationOverrideSupportedEv @ 57 NONAME + _ZNK22CCameraUiConfigManager33CriticalLevelRamMemoryFocusGainedEv @ 58 NONAME + _ZNK22CCameraUiConfigManager35IsAutofocusSetInHyperfocalAtStartupEv @ 59 NONAME + _ZNK22CCameraUiConfigManager35IsExtendedLightSensitivitySupportedEv @ 60 NONAME + _ZTI22CCameraUiConfigManager @ 61 NONAME + _ZTI25CCameraUiConfigManagerImp @ 62 NONAME + _ZTV22CCameraUiConfigManager @ 63 NONAME + _ZTV25CCameraUiConfigManagerImp @ 64 NONAME + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project camerauiconfigmanager +* Manager +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../conf/camerauiconfigmanager.confml APP_LAYER_CONFML(camerauiconfigmanager.confml) +../conf/camerauiconfigmanager_2001B29B.crml APP_LAYER_CRML(camerauiconfigmanager_2001B29B.crml) + +PRJ_MMPFILES +camerauiconfigmanager.mmp + +PRJ_TESTMMPFILES + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/group/camerauiconfigmanager.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/group/camerauiconfigmanager.mmp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for CameraUiConfiguration component +* +*/ + + +// =========================================================================== +// Target definition +TARGET camerauiconfigmanager.dll +TARGETTYPE dll +UID 0x1000008d 0x2001B29A +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + + +// --------------------------------------------------------------------------- +// Includes +#include +#include +#include + + +// --------------------------------------------------------------------------- +// Sources +SOURCEPATH ../src + +SOURCE CameraUiConfigManager.cpp +SOURCE CameraUiConfigManagerImp.cpp + +// --------------------------------------------------------------------------- +// Headers +USERINCLUDE ../inc +USERINCLUDE ../../common/inc + +// --------------------------------------------------------------------------- +// Libraries +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY centralrepository.lib + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraConfigurationCrKeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraConfigurationCrKeys.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Cr keys definitions header. + * +*/ + + +#ifndef CAMERACONFIGURATIONCRKEYS_H +#define CAMERACONFIGURATIONCRKEYS_H + + +// ========================================================= +// Camera dynamic configuration Settings + +const TUid KCameraDynamicConfigurationCrKeys = {0x2001B29B}; + + +// Cr key for Settings which does not have configured setting items +// ( checking feature supported or not ) + +const TUint32 KCamCrFeatureSecondaryCamera = 0x001; +const TUint32 KCamCrFeatureDSAViewFinder = 0x002; +const TUint32 KCamCrFeatureLensCover = 0x003; +const TUint32 KCamCrFeatureXenonFlash = 0x004; +const TUint32 KCamCrFeatureExtLightSensitivity = 0x005; +const TUint32 KCamCrFeatureFaceTracking = 0x006; +const TUint32 KCamCrFeatureOpticalJoyStick = 0x007; +const TUint32 KCamCrFeatureOneClickUpLoad = 0x008; +const TUint32 KCamCrFeatureVideoLight = 0x009; +const TUint32 KCamCrFeatureAutoFocus = 0x010; +const TUint32 KCamCrFeatureVideoStabilization = 0x011; +const TUint32 KCamCrFeatureOrientationSensor = 0x012; +const TUint32 KCamCrFeatureLightSensitivity = 0x013; +const TUint32 KCamCrFeatureLocation = 0x014; +const TUint32 KCamCrFeatureKeyLockWatcher = 0x015; +const TUint32 KCamCrFeatureExtDigitalZoom = 0x016; +const TUint32 KCamCrFeatureKeyPhotos = 0x017; +const TUint32 KCamCrFeatureKeyPublishZoomSate = 0x018; +const TUint32 KCamCrFeatureKeyAFSetInHyperfocalAtStartup = 0x019; +const TUint32 KCamCrFeatureRequiredRamMemory = 0x020; +const TUint32 KCamCrFeatureCriticalLevelRamMemory = 0x021; +const TUint32 KCamCrFeatureRequiredRamMemoryFocusGained = 0x022; +const TUint32 KCamCrFeatureCriticalLevelRamMemoryFocusGained= 0x023; +const TUint32 KCamCrFeatureCaptureToneDelaySupport = 0x024; +const TUint32 KCamCrFeatureCaptureToneDelayValue = 0x025; +const TUint32 KCamCrFeature2ndCameraOrientation = 0x026; +const TUint32 KCamCrFeatureUIOrientationOverride = 0x027; +const TUint32 KCamCrFeatureThumbnailManagerAPI = 0x028; +const TUint32 KCamCrFeatureBurstMode = 0x029; +const TUint32 KCamCrFeatureContinuousAF = 0x01E; +// Cr keys reserved for future use 0x020 -- 0x029 + +// Cr key for Settings which only have configured setting items +// ( feature always supported ) + +const TUint32 KCamCrFeaturePCZoomInItems = 0x030; +const TUint32 KCamCrFeaturePCZoomOutItems = 0x031; +const TUint32 KCamCrFeatureSCZoomInItems = 0x032; +const TUint32 KCamCrFeatureSCZoomOutItems = 0x033; +const TUint32 KCamCrFeaturePCCaptureKeys = 0x034; +const TUint32 KCamCrFeatureSCCaptureKeys = 0x035; +const TUint32 KCamCrFeaturePCAutoFocusKeys = 0x036; +const TUint32 KCamCrFeatureSCAutoFocusKeys = 0x037; +const TUint32 KCamCrFeatureMaxDigitalZoomLimits = 0x038; +const TUint32 KCamCrFeatureMaxExtendedZoomLimits = 0x039; +const TUint32 KCamCrFeatureMaxOpticalZoomLimits = 0x040; +const TUint32 KCamCrFeatureZoomLAF = 0x041; +const TUint32 KCamCrFeatureImageSceneModeAuto = 0x042; +const TUint32 KCamCrFeatureImageSceneModeUser = 0x043; +const TUint32 KCamCrFeatureImageSceneModeMacro = 0x044; +const TUint32 KCamCrFeatureImageSceneModePotrait = 0x045; +const TUint32 KCamCrFeatureImageSceneModeScenery = 0x046; +const TUint32 KCamCrFeatureImageSceneModeSports = 0x047; +const TUint32 KCamCrFeatureImageSceneModeNight = 0x048; +const TUint32 KCamCrFeatureImageSceneModeNightPotrait = 0x049; +const TUint32 KCamCrFeatureBurstFileSizeEstimateFactor = 0x04A; +const TUint32 KCamCrFeatureZoomDelays = 0x04B; + + +// Cr key for Settings where we check both for feature support +// And configured setting items + +const TUint32 KCamCrFeatureColorTone = 0x050; +const TUint32 KCamCrFeatureColorToneItems = 0x051; + +const TUint32 KCamCrFeatureWhiteBalance = 0x052; +const TUint32 KCamCrFeatureWhiteBalanceItems = 0x053; + +const TUint32 KCamCrFeatureEV = 0x054; +const TUint32 KCamCrFeatureEVItems = 0x055; + +const TUint32 KCamCrFeatureFlashMode = 0x056; +const TUint32 KCamCrFeatureFlashModeItems = 0x057; + +const TUint32 KCamCrFeatureSharpness = 0x058; +const TUint32 KCamCrFeatureSharpnessItems = 0x059; + +const TUint32 KCamCrFeatureContrast = 0x060; +const TUint32 KCamCrFeatureContrastItems = 0x061; + +const TUint32 KCamCrFeatureBrightness = 0x062; +const TUint32 KCamCrFeatureBrightnessItems = 0x063; + +const TUint32 KCamCrFeatureVideoSceneNormal = 0x064; +const TUint32 KCamCrFeatureVideoSceneModeNight = 0x065; +const TUint32 KCamCrFeatureVideoSceneModeLowLight = 0x066; + +#endif // CAMERACONFIGURATIONCRKEYS_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraDynamicSettings.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraDynamicSettings.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,319 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 which contains contants and enums definitions + * +*/ + + +#ifndef CAMERADYNAMICSETTINGS_HRH +#define CAMERADYNAMICSETTINGS_HRH + +#include +#include +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" + +//Constants +const TInt KCamLastSettingItem = -9999; + + +// Camera UI dynamic setting items + +enum TCamDynamicSettings + { + ECamDynamicSettingsMin, + + // settings with no configured setting items + ECamDynamicSettingSecondaryCamera, + ECamDynamicSettingDSAViewFinder, + ECamDynamicSettingLensCover, + ECamDynamicSettingXenonFlash, + ECamDynamicSettingExtLightSensitivity, + ECamDynamicSettingFaceTracking, + ECamDynamicSettingOpticalJoyStick, + ECamDynamicSettingOneClickUpload, + ECamDynamicSettingVideoLight, + ECamDynamicSettingAutoFocus, + ECamDynamicSettingVideoStabilization, + ECamDynamicSettingOrientationSensor, + ECamDynamicSettingLocation, + ECamDynamicSettingKeyLockWatcher, + ECamDynamicSettingExtDigitalZoom, + ECamDynamicSettingPhoto, + ECamDynamicSettingPublishZoomState, + ECamDynamicSettingAutofocusSetInHyperfocalAtStartup, + ECamDynamicSettingRequiredRamMemory, + ECamDynamicSettingCriticalLevelRamMemory, + ECamDynamicSettingRequiredRamMemoryFocusGained, + ECamDynamicSettingCriticalLevelRamMemoryFocusGained, + ECamDynamicSetting2ndCameraOrientation, + ECamDynamicSettingUIOrientationOverride, + ECamDynamicSettingThumbnailManagerAPI, + ECamDynamicSettingBurstMode, + ECamDynamicSettingContinuousAF, + // Primary/secondary camera capture keys + ECamDynamicSettingPCCaptureKeys, + ECamDynamicSettingSCCaptureKeys, + ECamDynamicSettingPCAutoFocusKeys, + ECamDynamicSettingSCAutoFocusKeys, + + // settings with configured setting items + ECamDynamicSettingWhiteBalance, + ECamDynamicSettingColorTone, + ECamDynamicSettingEV, + ECamDynamicSettingFlashMode, + ECamDynamicSettingLightSensitivity, + ECamDynamicSettingSharpness, + ECamDynamicSettingContrast, + ECamDynamicSettingBrightness, + + // primary and secondary camera zoom-in and zoom-out settings + ECamDynamicSettingPCZoomIn, + ECamDynamicSettingPCZoomOut, + ECamDynamicSettingSCZoomIn, + ECamDynamicSettingSCZoomOut, + + // primary and secondary camera still/video zoom ( digital, extended & optical ) limits + //Image/Video based on supported resolutions + ECamDynamicSettingMaxDigitalZoomLimits, + ECamDynamicSettingMaxExtendedZoomLimits, + ECamDynamicSettingMaxOpticalZoomLimits, + ECamDynamicSettingZoomLAF, + + // image scene mode and scene specific setting cr keys + ECamDynamicSettingImageSceneModeAuto, + ECamDynamicSettingImageSceneModeUser, + ECamDynamicSettingImageSceneModeMacro, + ECamDynamicSettingImageSceneModePotrait, + ECamDynamicSettingImageSceneModeScenery, + ECamDynamicSettingImageSceneModeSports, + ECamDynamicSettingImageSceneModeNight, + ECamDynamicSettingImageSceneModeNightPotrait, + + ECamDynamicSettingBurstFileSizeEstimateFactor, + + ECamDynamicSettingZoomDelays, + + // video scene mode and scene specific setting cr keys + ECamDynamicSettingVideoSceneModeNormal, + ECamDynamicSettingVideoSceneModeNight, + ECamDynamicSettingVideoSceneModeLowLight, + + // capture tone related enums + ECamDynamicSettingCaptureToneDelaySupport, + ECamDynamicSettingCaptureToneDelayValue, + + ECamDynamicSettingsMax + }; + + +// Strings per settings and the order of the strings should be matched +// exactly to the order of the enum's defined in the enum arrays for +// each setting. + +//And "Strings" are defined according to the settings from ecam values. + +/* +* Color tone enums and strings +*/ + +// Photo scene settings +const TInt KCamColorToneEnums[] = + { + { ECamColourFilterColour }, + { ECamColourFilterBlackAndWhite }, + { ECamColourFilterSepia }, + { ECamColourFilterNegative }, + { ECamColourFilterVivid }, + { KCamLastSettingItem } + }; + +const TUint16* const KCamColorToneStrings[] = + { + (const TUint16* const)_S16("EEffectNone"), + (const TUint16* const)_S16("EEffectMonochrome"), + (const TUint16* const)_S16("EEffectSepia"), + (const TUint16* const)_S16("EEffectNegative"), + (const TUint16* const)_S16("EEffectVivid") + }; + + +/* +* White balance enums and strings +*/ + +const TInt KCamWhiteBalanceEnums[] = + { + { ECamWhiteBalanceAWB }, + { ECamWhiteBalanceDaylight }, + { ECamWhiteBalanceCloudy }, + { ECamWhiteBalanceTungsten }, + { ECamWhiteBalanceFlourescent }, + { KCamLastSettingItem } + }; + +const TUint16* const KCamWhiteBalanceStrings[] = + { + ( const TUint16* const )_S16("EWBAuto"), + ( const TUint16* const )_S16("EWBDaylight"), + ( const TUint16* const )_S16("EWBCloudy"), + ( const TUint16* const )_S16("EWBTungsten"), + ( const TUint16* const )_S16("EWBFluorescent") + }; + + +/* +* Flash mode setting enums and corresponding strings +* order of enums and strings "should" match +*/ +const TInt KCamFlashModeEnums[] = + { + { ECamFlashAuto }, + { ECamFlashForced }, + { ECamFlashAntiRedEye }, + { ECamFlashOff }, + { KCamLastSettingItem } + }; + +const TUint16* const KCamFlashModeStrings[] = + { + (const TUint16* const)_S16("EFlashAuto"), + (const TUint16* const)_S16("EFlashForced"), + (const TUint16* const)_S16("EFlashRedEyeReduce"), + (const TUint16* const)_S16("EFlashNone") + }; + + + + +/* + * Scene mode setting enums; and corresponding strings + * order of enums and strings "should" match + */ + const TInt KCamSceneModeEnums[] = + { + { ECamSceneAuto }, + { ECamSceneUser }, + { ECamSceneMacro }, + { ECamScenePortrait }, + { ECamSceneScenery }, + { ECamSceneSports }, + { ECamSceneNight }, + { ECamSceneNightPortrait }, + { ECamSceneNormal }, + { ECamSceneLowLight }, + // Exposure modes for each scene + { ECamSceneAEModeAuto }, + { ECamSceneAEModeNight }, + { ECamSceneAEModeBacklight }, + { ECamSceneAEModeCenter }, + { ECamSceneAEModeSports }, + // AF modes for each scene + { ECamSceneAFModeMacro }, + { ECamSceneAFPortrait }, + { ECamSceneAFModeNormal }, + { ECamSceneAFModeInfinity }, + { ECamSceneAFModeHyperfocal }, + { ECamSceneAFModeContinuous }, + // flash mode + { ECamFlashAuto }, + { ECamFlashForced }, + { ECamFlashAntiRedEye }, + { ECamFlashOff }, + // white balance ecam + { ECamWhiteBalanceAWB }, + { ECamWhiteBalanceDaylight }, + { ECamWhiteBalanceCloudy }, + { ECamWhiteBalanceTungsten }, + { ECamWhiteBalanceFlourescent }, + // light sensitivity enums + { ECamLightSensitivityAuto }, + { ECamLightSensitivityLow }, + { ECamLightSensitivityLowMed }, + { ECamLightSensitivityMed }, + { ECamLightSensitivityMedHigh }, + { ECamLightSensitivityHigh }, + // sharpness modes that ui supports + { ECamImageSharpnessNorm }, + { ECamImageSharpnessSoft }, + { ECamImageSharpnessHard }, + // contrast modes that ui supports + { ECamContrastNorm }, + { ECamContrastPlus }, + { ECamContrastNeg }, + { KCamLastSettingItem } + }; + +/* +* Scene mode specific strings +*/ +const TUint16* const KCamSceneModeStrings[] = + { + // possible scene modes + (const TUint16* const)_S16("ECamSceneAuto"), + (const TUint16* const)_S16("ECamSceneUser"), + (const TUint16* const)_S16("ECamSceneMacro"), + (const TUint16* const)_S16("ECamScenePortrait"), + (const TUint16* const)_S16("ECamSceneScenery"), + (const TUint16* const)_S16("ECamSceneSports"), + (const TUint16* const)_S16("ECamSceneNight"), + (const TUint16* const)_S16("ECamSceneNightPortrait"), + (const TUint16* const)_S16("ECamSceneNormal"), + (const TUint16* const)_S16("ECamSceneLowLight"), + // possible exposure modes + (const TUint16* const)_S16("EExposureAuto"), + (const TUint16* const)_S16("EExposureNight"), + (const TUint16* const)_S16("EExposureBacklight"), + (const TUint16* const)_S16("EExposureCenter"), + (const TUint16* const)_S16("EExposureSport"), + // possible AF mode for each specific scene + (const TUint16* const)_S16("ECamSceneAFModeMacro"), + (const TUint16* const)_S16("ECamSceneAFPortrait"), + (const TUint16* const)_S16("ECamSceneAFModeNormal"), + (const TUint16* const)_S16("ECamSceneAFModeInfinity"), + (const TUint16* const)_S16("ECamSceneAFModeHyperfocal"), + (const TUint16* const)_S16("ECamSceneAFModeContinuous"), + //possible flash modes + (const TUint16* const)_S16("EFlashAuto"), + (const TUint16* const)_S16("EFlashForced"), + (const TUint16* const)_S16("EFlashRedEyeReduce"), + (const TUint16* const)_S16("EFlashNone"), + // white balance strings + ( const TUint16* const )_S16("EWBAuto"), + ( const TUint16* const )_S16("EWBDaylight"), + ( const TUint16* const )_S16("EWBCloudy"), + ( const TUint16* const )_S16("EWBTungsten"), + ( const TUint16* const )_S16("EWBFluorescent"), + // light sensitivity enums + (const TUint16* const)_S16("ECamLightSensitivityAuto"), + (const TUint16* const)_S16("ECamLightSensitivityLow"), + (const TUint16* const)_S16("ECamLightSensitivityLowMed"), + (const TUint16* const)_S16("ECamLightSensitivityMed"), + (const TUint16* const)_S16("ECamLightSensitivityMedHigh"), + (const TUint16* const)_S16("ECamLightSensitivityHigh"), + // sharpness modes that ui supports + (const TUint16* const)_S16("ECamImageSharpnessNorm"), + (const TUint16* const)_S16("ECamImageSharpnessSoft"), + (const TUint16* const)_S16("ECamImageSharpnessHard"), + // contrast modes that ui supports + (const TUint16* const)_S16("ECamContrastNorm"), + (const TUint16* const)_S16("ECamContrastPlus"), + (const TUint16* const)_S16("ECamContrastNeg"), + }; + + + +#endif //CAMERADYNAMICSETTINGS_HRH + +//End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraUiConfigManager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraUiConfigManager.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,468 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CameraUiConfigManager API header. + * +*/ + + +#ifndef CAMERAUICONFIGMANAGER_H +#define CAMERAUICONFIGMANAGER_H + +// INCLUDES + +#include + + +// Photo/Video scene information +struct TSceneSettings + { + // Used for both image and video scene configuration. + TInt iSupported; + TInt iIdentifier; + TInt iExposureMode; + TInt iWhiteBalance; + TInt iFlash; + TInt iContrastMode; + TInt iFocalDistance; + /* + * The following 3 only used for image mode. In Video mode, we ignore this + */ + TInt iSharpnessMode; + TInt iLightSensitivityMode; + TInt iExposureCompensationValue; + /* + * 0 -> Read from ICM or else.. take the frame rate defined here into use + * only used in video. Ingored in image mode. + */ + TInt iFrameRate; + }; + + +class CCameraUiConfigManagerImp; + +// CCameraUiConfigManager API + +class CCameraUiConfigManager : public CBase + { + // ========================================================================= + public: // Constructors and destructor + + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aConfiguration + * engine changes. + */ + IMPORT_C static CCameraUiConfigManager* NewLC(); + + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aConfiguration + * engine changes. + */ + IMPORT_C static CCameraUiConfigManager* NewL(); + + /* + * Constructor + */ + CCameraUiConfigManager(); + + /** + * Destructor. + */ + ~CCameraUiConfigManager(); + + public: + + /* + * Checking for Color feature support + */ + IMPORT_C TBool IsColorToneFeatureSupported() const; + + /* + * To check for sharpness feature support + */ + IMPORT_C TBool IsSharpnessFeatureSupported() const; + + /* + * To check for white balance feature support + */ + IMPORT_C TBool IsWhiteBalanceFeatureSupported() const; + + /* + * Secondary camera support + */ + IMPORT_C TBool IsSecondaryCameraSupported() const; + + /* + * Direct Screen View Finder feature support + * aPrimaryCamera = ETrue ( Direct screen access support for primary camera ) + * aPrimaryCamera = EFalse ( Direct screen access support for secondary camera ) + */ + IMPORT_C TBool IsDSAViewFinderSupported( TBool aPrimaryCamera = ETrue ) const; + + /* + * Lens cover feature support + */ + IMPORT_C TBool IsLensCoverSupported() const; + + /* + * Xenon flash feature support + */ + IMPORT_C TBool IsXenonFlashSupported() const; + + /* + * Light sensitivity feature support + */ + IMPORT_C TBool IsISOSupported() const; + + /* + * EV feature support + */ + IMPORT_C TBool IsEVSupported() const; + + /* + * Flash mode feature support + */ + IMPORT_C TBool IsFlashModeSupported() const; + + + /* + * Contrast feature support + */ + IMPORT_C TBool IsContrastSupported() const; + + /* + * Brightness feature support + */ + IMPORT_C TBool IsBrightnessSupported() const; + + + /* + * Flash mode feature support + */ + IMPORT_C TBool IsExtendedLightSensitivitySupported() const; + + + /* + * One click upload feature support + */ + IMPORT_C TBool IsOneClickUploadSupported() const; + + + /* + * Video Light feature support + */ + IMPORT_C TBool IsVideoLightSupported() const; + + + /* + * Auto focus feature support + */ + IMPORT_C TBool IsAutoFocusSupported() const; + + /* + * Video Stabilization feature support + */ + IMPORT_C TBool IsVideoStabilizationSupported() const; + + /* + * Orientation sensor feature support + */ + IMPORT_C TBool IsOrientationSensorSupported() const; + + /* + * Face-tracking feature support + */ + IMPORT_C TBool IsFaceTrackingSupported() const; + + /* + * Optical joy stick feature support + */ + IMPORT_C TBool IsOpticalJoyStickSupported() const; + + /* + * location feature support + */ + IMPORT_C TBool IsLocationSupported() const; + + /* + * keywatcher feature support + */ + IMPORT_C TBool IsKeyLockWatcherSupported() const; + + /* + * Extended Digital Zoom feature support + */ + IMPORT_C TBool IsExtendedDigitalZoomSupported() const; + + /* + * MC photos support available + */ + IMPORT_C TBool IsPhotosSupported() const; + + /* + * Publish Zoom State support available + */ + IMPORT_C TBool IsPublishZoomStateSupported() const; + + /* + * EFalse = HW/Adapation sets AF to Hyperfocal during startup + * ETrue = Should be handled in UI + */ + IMPORT_C TBool IsAutofocusSetInHyperfocalAtStartup() const; + + /* + * Capture tone delay support available + */ + IMPORT_C TBool IsCaptureToneDelaySupported() const; + + /* + * UI Orientation Override feature support + */ + IMPORT_C TBool IsUIOrientationOverrideSupported() const; + + /* + * ThumbnailManager API feature support + */ + IMPORT_C TBool IsThumbnailManagerAPISupported() const; + + /* + * Capture tone delay in milliseconds. + */ + IMPORT_C TInt CaptureToneDelay() const; + + /* + * Required RAM memory for CameraApp + */ + IMPORT_C TInt RequiredRamMemory() const; + + /* + * Critical Level RAM memory for CameraApp + */ + IMPORT_C TInt CriticalLevelRamMemory() const; + + /* + * Required RAM memory for CameraApp when focus gained + */ + IMPORT_C TInt RequiredRamMemoryFocusGained() const; + + /* + * Critical Level RAM memory for CameraApp when focus gained + */ + IMPORT_C TInt CriticalLevelRamMemoryFocusGained() const; + + /* + * To get all supported color tone setting items + * aParam: aSupportedValues contain colortone setting enums supported by camera ui + * check camsettings.hrh for supported enums in camera ui + */ + IMPORT_C void SupportedColorToneSettingsL( RArray& aSupportedValues ); + + /* + * To get all supported white balance setting items + * aParam: aSupportedValues contain white balance setting enums supported by camera ui + * check camsettings.hrh for supported enums in camera ui + */ + IMPORT_C void SupportedWhiteBalanceSettingsL( + RArray& aSupportedValues ); + + /* + * To get all supported Sharpness setting items + * @aSupportedValues contains values ranging from MIN to MAX + */ + IMPORT_C void SupportedSharpnessSettingsL( RArray& aSupportedValues ); + + /* + * Primary Camera Zoom-In Keys + * aParam: aSupportedValues will have key scan codes configured via cenrep + */ + IMPORT_C void SupportedPrimaryCameraZoomInKeysL( RArray& aSupportedValues ); + + /* + * Primary Camera Zoom-Out Keys + * aParam: aSupportedValues will have key scan codes configured via cenrep + */ + IMPORT_C void SupportedPrimaryCameraZoomOutKeysL( RArray& aSupportedValues ); + + /* + * Secondary Camera Zoom-In Keys + * aParam: aSupportedValues will have key scan codes configured via cenrep + */ + IMPORT_C void SupportedSecondaryCameraZoomInKeysL( RArray& aSupportedValues ); + + /* + * Secondary Camera Zoom-Out Keys + * aParam: aSupportedValues will have key scan codes configured via cenrep + */ + IMPORT_C void SupportedSecondaryCameraZoomOutKeysL( RArray& aSupportedValues ); + + /* + * EV compensation supported settings + * aSupportedValues contains the complete range of EV settings from MIN to MAX + * @e.g. -2,2,10 ( aSupportedValues[0] = MIN, + * aSupportedValues[1] = MAX, + * aSupportedValues[2] = Steps ) + */ + IMPORT_C void SupportedEVSettingsL( RArray& aSupportedValues ); + + + /* + * Flash mode setting items + * aParam: aSupportedValues contain flash mode enums supported by camera ui + * check camsettings.hrh for supported enums in camera ui + */ + IMPORT_C void SupportedFlashModeSettingsL( RArray& aSupportedValues ); + + + /* + * Primary camera capture key + * aParam: aSupportedValues will have key mappings for capture key + */ + IMPORT_C void SupportedPrimaryCameraCaptureKeyL( RArray& aSupportedValues ); + + /* + * Secondary camera capture key + * aParam: aSupportedValues will have key mappings for capture key + */ + IMPORT_C void SupportedSecondaryCameraCaptureKeyL( RArray& aSupportedValues ); + + /* + * Primary camera AF key + * aParam: aSupportedValues will have key mappings for Autofocus key + */ + IMPORT_C void SupportedPrimaryCameraAutoFocusKeyL( RArray& aSupportedValues ); + + /* + * Secondary camera AutoFocus key + * aParam: aSupportedValues will have key mappings for Autofocus key + */ + IMPORT_C void SupportedSecondaryCameraAutoFocusKeyL( RArray& aSupportedValues ); + + /* + * Supported contrast setting range values + * aParam: aSupportedValues will have contrast values ranging + * from MIN - MAX and step size + * aSupportedValues[0] -> MIN value + * aSupportedValues[1] -> MAX value + * aSupportedValues[2] -> Steps + */ + IMPORT_C void SupportedContrastRangeL( RArray& aSupportedValues ); + + /* + * Supported brightness setting range values + * aParam: aSupportedValues will have brightness values ranging + * from MIN - MAX and step size + * aSupportedValues[0] -> MIN value + * aSupportedValues[1] -> MAX value + * aSupportedValues[2] -> Steps + */ + IMPORT_C void SupportedBrightnessRangeL( RArray& aSupportedValues ); + + /* + * To get all supported Max Zoom steps for all Image, Video resoultions for + * primary and second camera + * @ aSupportedValues[ 0] -> KMaxPhoto8MPZoomStep + * @ aSupportedValues[ 1] -> KMaxPhoto5MPZoomStep + * @ aSupportedValues[ 2] -> KMaxPhoto3MPZoomStep + * @ aSupportedValues[ 3] -> KMaxPhoto2MPZoomStep + * @ aSupportedValues[ 4] -> KMaxPhoto1_3MPZoomStep + * @ aSupportedValues[ 5] -> KMaxPhoto1MPZoomStep + * @ aSupportedValues[ 6] -> KMaxPhoto08MPZoomStep + * @ aSupportedValues[ 7] -> ?? no constant in UI + * @ aSupportedValues[ 8] -> KMaxPhotoVGAZoomStep + * @ aSupportedValues[ 9] -> KMaxVideoZoomStepHD + * @ aSupportedValues[10] -> KMaxVideoZoomStepWVGA + * @ aSupportedValues[11] -> KMaxVideoZoomStepNHD + * @ aSupportedValues[12] -> KMaxVideoZoomStepVGA + * @ aSupportedValues[13] -> KMaxVideoZoomStepQVGA + * @ aSupportedValues[14] -> KMaxVideoZoomStepCIF + * @ aSupportedValues[15] -> KMaxVideoZoomStepQCIF + * @ aSupportedValues[16] -> iMaxVideoStepSQCIF + * @ aSupportedValues[17] -> KMax2ndCamPhotoStep + * @ aSupportedValues[18] -> KMax2ndCamVideoStepCIF + * @ aSupportedValues[19] -> KMax2ndCamVideoStepQCIF + * @ aSupportedValues[20] -> iMax2ndCamVideoStepSQCIF + */ + IMPORT_C void SupportedMaxZoomStepsL( RArray& aSupportedValues ); + + /* + * To get all supported photo specific MAX extended zoom steps w.r.t all photo + * resoultions ( only for main camera for now ) + * aSupportedValues[0] -> 5MP max ext-zoom step + * aSupportedValues[n] -> lowest resolution for main camera MAX ext-zoom step + */ + IMPORT_C void SupportedMaxExtendedZoomStepsL( + RArray& aSupportedValues ); + /* + * Supported zoom bar Look and Feel ( LAF ) values + * @aSupportedValues[0] -> Time per zoom tick in milliseconds + * @aSupportedValues[1] -> Time per extended zoom tick in milliseconds + * @aSupportedValues[2] -> No of zoom steps per tick + * @aSupportedValues[3] -> No of extended zoom steps per tick + * @aSupportedValues[4] -> Secondary camera zoom steps per tick + */ + IMPORT_C void SupportedLAFZoomBarL( + RArray& aSupportedValues ); + + /* + * Supported Image Scene modes and Scene specific settings + */ + IMPORT_C void SupportedSceneModesAndSettingsL( + RArray& aSupportedValues, + TBool aPhotoScene = ETrue ); + + /* + * Determines device qwerty-mode state. + * This method is meant to be used with secondary camera. + * @return ETrue if qwerty keyboard is open + */ + IMPORT_C TInt IsQwerty2ndCamera() const; + + /* + * Burst file size estimate correction factor + * in percent (100 = 100%). + * @return correction factor in percent + */ + IMPORT_C TInt BurstFileSizeEstimateFactor() const; + + /* + * @aSupportedValues[0] -> Value for iCamZoomCooldown + * @aSupportedValues[1] -> Value for iCamMaxZoomCooldown + */ + IMPORT_C void SupportedZoomDelaysL( + RArray& aSupportedValues ); + /* + * BurstMode Support + */ + IMPORT_C TBool IsBurstModeSupported() const; + + /* + * Continuous autofocus. + * @return ETrue if continuous autofocus feature is enabled + */ + IMPORT_C TBool IsContinuosAutofocusSupported() const; + + private: + void ConstructL(); + + private: + + CCameraUiConfigManagerImp* iConfigManagerImp; +}; + +#endif // CAMERAUICONFIGMANAGER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraUiConfigManagerImp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/inc/CameraUiConfigManagerImp.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper class which handles reading and storing the cr keys + * and its values. + * +*/ + + +#ifndef CAMERAUICONFIGMANAGERIMP_H +#define CAMERAUICONFIGMANAGERIMP_H + +// INCLUDES + +#include +#include "CameraUiConfigManager.h" +#include "CameraDynamicSettings.hrh" + +// FORWARD DECLARATIONS +class TDynamicConfigSettingsData; +class CRepository; + + +// Class declaration +class TDynamicSettingsData + { + public: + TBuf<256> iText; + TInt iItemId; // enum value converted to TInt + }; + + +class TSupportedSettingsData + { + public: + TInt iSettingId; + TInt iSupportedValue; + RArray iSupportedSettingItems; + }; + +/** +* Helper class which handles the Cr keys +*/ +class CCameraUiConfigManagerImp : public CCameraUiConfigManager + { + // ========================================================================= + public: // Constructors and destructor + + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aConfiguration + * engine changes. + */ + static CCameraUiConfigManagerImp* NewLC(); + + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aConfiguration + * engine changes. + */ + static CCameraUiConfigManagerImp* NewL(); + + /** + * Destructor. + */ + ~CCameraUiConfigManagerImp(); + + public: + + /* + * To check if a particular feature is supported and/or in somecase + * used to return the configured setting for e.g. camera capture key + */ + TInt IsFeatureSupported( const TCamDynamicSettings aSettingId ) const; + + /* + * To get all supported color tone setting items + */ + void SupportedSettingItemsL( const TCamDynamicSettings aSettingId, + RArray& aSupportedValues ); + + /* + * Organizing CenRep data to a definite structure for scene modes. + */ + void OrganiseSceneSettings( RArray& aTargetArray, + RArray& aSceneSettingsArray, + const TBool aPhotoScene ); + + private: + + /* + * To get the setting item id, based on string comparison + */ + TInt SettingItemId( RArray& aPossibleSettings, + const TDesC& aItemString ) const; + + /* + * Gets the string value from Cr key + */ + HBufC* GetStringDataL( const TUint32 aCrKey ); + + /* + * Gets all supported items by mapping the item id's based on the configured + * items in the cr key + */ + void GetSupportedSettingIdsL( RArray& aAllItems, + RArray& aSupportedValues, + const TUint32 crKey ); + + /* + * Load all default setting items supported from the UI defined in the resource + */ + void LoadDefaultSettingsDataL( const TInt aSettingItem, + RArray& aDefaultItems ); + + /* + * Load all the dynamic setting values from cenrep + */ + void LoadAllDynamicSettingsL(); + + /* + * Append all the dynamic settings to the array + */ + void AppendToSettingsArrayL( const TInt aItemId, + const TInt aFeatureSupported, + RArray& aAllItems, + TUint32 aCrItemsKey = 0, + TBool loadSettingItems = 0 ); + + /* + * Search for setting item dynamic settings array + */ + TInt SearchInSettingsListFor( + const RPointerArray& aSettingsList, + TInt aSettingItem ) const; + + /* + * Map setting item to corresponding "Feature" Cr key + */ + TUint32 MapSettingItemToCrFeatureKeyL( const TInt aSettingItem ) const; + + + /* + * Map setting item to configured setting "values" Cr key + */ + TUint32 MapSettingItemToCrItemsKeyL( const TInt aSettingItem ) const; + + /* + * Load all configured settings from CenRep + */ + void LoadConfiguredSettingItemValuesFromCrL( + const TInt aSettingId, + const TInt aFeatureSupported, + RArray& aSettingItemDefaultData ); + + /* + * LoadCrForFeatureSupport + */ + TBool LoadCrForFeatureSupport( const TInt aSettingId ) const; + + /* + * Load corresponding setting item enumeration array + */ + const TInt* LoadSettingEnumerationArray( const TInt aSettingItem ); + + /* + * Load corresponding setting item string array + */ + const TUint16* const* LoadSettingStringArray( const TInt aSettingItem ); + + private: + + /** + * Actual constructor where the reading from the Central Repository + * happens + */ + void ConstructL(); + + private: + // we own + CRepository* iRepository; + RPointerArray iSupportedSettings; +}; + +#endif // CameraUiConfigManagerImp_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/src/CameraUiConfigManager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/src/CameraUiConfigManager.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,747 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CameraUiConfigManager API. + * +*/ + + +// Includes + +#include "CameraUiConfigManager.h" +#include "CameraUiConfigManagerImp.h" +#include "CameraDynamicSettings.hrh" + + +// Class methods + +// --------------------------------------------------------------------------- +// CCameraUiConfigManager::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +EXPORT_C CCameraUiConfigManager* CCameraUiConfigManager::NewL() + { + CCameraUiConfigManager* self = CCameraUiConfigManager::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCameraUiConfigManager::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +EXPORT_C CCameraUiConfigManager* CCameraUiConfigManager::NewLC() + { + CCameraUiConfigManager* self = new( ELeave ) CCameraUiConfigManager(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// CCameraUiConfigManager::~CCameraUiConfigManager +// Destructor +// --------------------------------------------------------------------------- +// +CCameraUiConfigManager::~CCameraUiConfigManager() + { + delete iConfigManagerImp; + } + + +// --------------------------------------------------------------------------- +// CCameraUiConfigManager::CCameraUiConfigManager +// C++ constructor +// --------------------------------------------------------------------------- +// +CCameraUiConfigManager::CCameraUiConfigManager() + { + } + + +// --------------------------------------------------------------------------- +// CCameraUiConfigManager::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCameraUiConfigManager::ConstructL() + { + iConfigManagerImp = CCameraUiConfigManagerImp::NewL(); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsColorToneFeatureSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsColorToneFeatureSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingColorTone ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsSharpnessFeatureSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsSharpnessFeatureSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingSharpness ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsWhiteBalanceFeatureSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsWhiteBalanceFeatureSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingWhiteBalance ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsSecondaryCameraSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsSecondaryCameraSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingSecondaryCamera ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsDSAViewFinderSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsDSAViewFinderSupported( TBool aPrimaryCamera ) const + { + RArray supportedItems; + TBool supported ( EFalse ); + TRAPD( err,iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingDSAViewFinder, + supportedItems ) ); + if ( KErrNone == err && supportedItems.Count() > 0 ) + { + if ( aPrimaryCamera ) supported = supportedItems[0]; + else supported = supportedItems[1]; + } + supportedItems.Close(); + return supported; // not supported + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsLensCoverSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsLensCoverSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingLensCover ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsXenonFlashSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsXenonFlashSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingXenonFlash ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsISOSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsISOSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingLightSensitivity ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsEVSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsEVSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingEV ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsFlashModeSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsFlashModeSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingFlashMode ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsContrastSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsContrastSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingContrast ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsBrightnessSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsBrightnessSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingBrightness ); + } + + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsExtendedLightSensitivitySupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsExtendedLightSensitivitySupported() const + { + return iConfigManagerImp->IsFeatureSupported( + ECamDynamicSettingExtLightSensitivity ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsOneClickUploadSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsOneClickUploadSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingOneClickUpload ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsVideoLightSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsVideoLightSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingVideoLight ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsAutoFocusSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsAutoFocusSupported() const + { +#if defined(WINS) || defined(WINSCW) + return EFalse; // return +#else + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingAutoFocus ); +#endif + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsVideoStabilizationSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsVideoStabilizationSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingVideoStabilization ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsFaceTrackingSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsFaceTrackingSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingFaceTracking ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsOpticalJoyStickSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsOpticalJoyStickSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingOpticalJoyStick ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsOrientationSensorSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsOrientationSensorSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingOrientationSensor ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsLocationSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsLocationSupported() const + { + TBool supported = iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingLocation ); +#if !defined(RD_MDS_2_5) || defined(__WINSCW__) || defined(__WINS__) + supported = EFalse; +#endif + return supported; + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsKeyLockWatcherSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsKeyLockWatcherSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingKeyLockWatcher ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsExtendedDigitalZoomSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsExtendedDigitalZoomSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingExtDigitalZoom ); + } + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsAutofocusSetInHyperfocalAtStartup +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsAutofocusSetInHyperfocalAtStartup() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingExtDigitalZoom ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsCaptureToneDelaySupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsCaptureToneDelaySupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingCaptureToneDelaySupport ); + } + +/* +* The capture tone delay in milliseconds +*/ +EXPORT_C TInt CCameraUiConfigManager::CaptureToneDelay() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingCaptureToneDelayValue ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsPhotosSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsPhotosSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingPhoto ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsPublishZoomStateSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsPublishZoomStateSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingExtDigitalZoom ); + } + + + +/* +* Required RAM memory for CameraApp +*/ +EXPORT_C TInt CCameraUiConfigManager::RequiredRamMemory() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingRequiredRamMemory ); + } + +/* +* Critical Level RAM memory for CameraApp +*/ +EXPORT_C TInt CCameraUiConfigManager::CriticalLevelRamMemory() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingCriticalLevelRamMemory ); + } + + +/* +* Required RAM memory for CameraApp when focus gained +*/ +EXPORT_C TInt CCameraUiConfigManager::RequiredRamMemoryFocusGained() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingRequiredRamMemoryFocusGained ); + } + + +/* +* Critical Level RAM memory for CameraApp when focus gained +*/ +EXPORT_C TInt CCameraUiConfigManager::CriticalLevelRamMemoryFocusGained() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingCriticalLevelRamMemoryFocusGained ); + } + + +// +//CCameraUiConfigManager::SupportedPrimaryCameraCaptureKeyL +//Returns configured capture key for primary camera +// +EXPORT_C void CCameraUiConfigManager::SupportedPrimaryCameraCaptureKeyL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingPCCaptureKeys, + aSupportedValues ); + } + + +// +//CCameraUiConfigManager::SupportedSecondaryCameraCaptureKeyL +//Returns configured capture key for secondary camera +EXPORT_C void CCameraUiConfigManager::SupportedSecondaryCameraCaptureKeyL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingSCCaptureKeys, + aSupportedValues ); + } + +// +//CCameraUiConfigManager::SupportedColorToneSettingsL +// +EXPORT_C void CCameraUiConfigManager::SupportedColorToneSettingsL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( + ECamDynamicSettingColorTone, + aSupportedValues ); + } + + +// +//CCameraUiConfigManager::SupportedWhiteBalanceSettingsL +// +EXPORT_C void CCameraUiConfigManager::SupportedWhiteBalanceSettingsL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( + ECamDynamicSettingWhiteBalance, + aSupportedValues ); + } + + +// +//CCameraUiConfigManager::SupportedSharpnessSettingsL +// +EXPORT_C void CCameraUiConfigManager::SupportedSharpnessSettingsL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( + ECamDynamicSettingSharpness, + aSupportedValues ); + } + + +// +//CCameraUiConfigManager::SupportedPrimaryCameraZoomInKeysL +// +EXPORT_C void CCameraUiConfigManager::SupportedPrimaryCameraZoomInKeysL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( + ECamDynamicSettingPCZoomIn, + aSupportedValues ); + } + + +// +//CCameraUiConfigManager::SupportedPrimaryCameraZoomOutKeysL +// +EXPORT_C void CCameraUiConfigManager::SupportedPrimaryCameraZoomOutKeysL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( + ECamDynamicSettingPCZoomOut, + aSupportedValues ); + } + + +// +//CCameraUiConfigManager::SupportedSecondaryCameraZoomInKeysL +// +EXPORT_C void CCameraUiConfigManager::SupportedSecondaryCameraZoomInKeysL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( + ECamDynamicSettingSCZoomIn, + aSupportedValues ); + } + +// +//CCameraUiConfigManager::SupportedSecondaryCameraZoomOutKeysL +// +EXPORT_C void CCameraUiConfigManager::SupportedSecondaryCameraZoomOutKeysL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( + ECamDynamicSettingSCZoomOut, + aSupportedValues ); + } + + +// +//CCameraUiConfigManager::SupportedEVSettingsL +// +EXPORT_C void CCameraUiConfigManager::SupportedEVSettingsL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( + ECamDynamicSettingEV, + aSupportedValues ); + } + +// +//CCameraUiConfigManager::SupportedFlashModeSettingsL +// +EXPORT_C void CCameraUiConfigManager::SupportedFlashModeSettingsL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( + ECamDynamicSettingFlashMode, + aSupportedValues ); + } + +// +//CCameraUiConfigManager::SupportedPrimaryCameraCaptureKeyL +//Returns configured AutoFocus key for primary camera +// +EXPORT_C void CCameraUiConfigManager::SupportedPrimaryCameraAutoFocusKeyL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingPCAutoFocusKeys, + aSupportedValues ); + } + + +// +//CCameraUiConfigManager::SupportedSecondaryCameraAutoFocusKeyL +//Returns configured AutoFocus key for secondary camera +EXPORT_C void CCameraUiConfigManager::SupportedSecondaryCameraAutoFocusKeyL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingSCAutoFocusKeys, + aSupportedValues ); + } + + +// +//CCameraUiConfigManager::SupportedContrastRangeL +//Returns configured range for contrast setting +EXPORT_C void CCameraUiConfigManager::SupportedContrastRangeL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingContrast, + aSupportedValues ); + } + +// +//CCameraUiConfigManager::SupportedBrightnessRangeL +//Returns configured range for brightness setting +EXPORT_C void CCameraUiConfigManager::SupportedBrightnessRangeL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingBrightness, + aSupportedValues ); + } + +// +//CCameraUiConfigManager::SupportedMaxZoomStepsL +// + +EXPORT_C void CCameraUiConfigManager::SupportedMaxZoomStepsL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingMaxDigitalZoomLimits, + aSupportedValues ); + } + +// +//CCameraUiConfigManager::SupportedMaxExtendedZoomStepsL +// + +EXPORT_C void CCameraUiConfigManager::SupportedMaxExtendedZoomStepsL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingMaxExtendedZoomLimits, + aSupportedValues ); + } + +// +//CCameraUiConfigManager::SupportedLAFZoomBarL +// +EXPORT_C void CCameraUiConfigManager::SupportedLAFZoomBarL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingZoomLAF, + aSupportedValues ); + } + +// +//CCameraUiConfigManager::SupportedSceneModesAndSettingsL +// +EXPORT_C void CCameraUiConfigManager::SupportedSceneModesAndSettingsL( + RArray& aSupportedValues, + TBool aPhotoScene ) + { + aSupportedValues.Reset(); + // Load all known scene mode specific settings + RArray sceneModeSettings; + if ( aPhotoScene ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingImageSceneModeAuto, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingImageSceneModeUser, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingImageSceneModeMacro, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingImageSceneModePotrait, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingImageSceneModeScenery, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingImageSceneModeSports, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingImageSceneModeNight, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingImageSceneModeNightPotrait, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + } + else + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingVideoSceneModeNormal, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingVideoSceneModeNight, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingVideoSceneModeLowLight, + sceneModeSettings ); + iConfigManagerImp->OrganiseSceneSettings( aSupportedValues, + sceneModeSettings,aPhotoScene ); + } + sceneModeSettings.Close(); + } + +// +//CCameraUiConfigManager::IsQwerty2ndCamera +// +EXPORT_C TInt CCameraUiConfigManager::IsQwerty2ndCamera() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSetting2ndCameraOrientation ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsUIOrientationOverrideSupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsUIOrientationOverrideSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingUIOrientationOverride ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsThumbnailManagerAPISupported +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsThumbnailManagerAPISupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingThumbnailManagerAPI ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::BurstFileSizeEstimateFactor +// ---------------------------------------------------------------------------------- +// +EXPORT_C TInt CCameraUiConfigManager::BurstFileSizeEstimateFactor() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingBurstFileSizeEstimateFactor ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::SupportedZoomDelays +// ---------------------------------------------------------------------------------- +// +EXPORT_C void CCameraUiConfigManager::SupportedZoomDelaysL( + RArray& aSupportedValues ) + { + iConfigManagerImp->SupportedSettingItemsL( ECamDynamicSettingZoomDelays, + aSupportedValues ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::SupportedBurstMode +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsBurstModeSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingBurstMode ); + } + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManager::IsContinuosAutofocus +// ---------------------------------------------------------------------------------- +// +EXPORT_C TBool CCameraUiConfigManager::IsContinuosAutofocusSupported() const + { + return iConfigManagerImp->IsFeatureSupported( ECamDynamicSettingContinuousAF ); + } + +//End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/camerauiconfigmanager/src/CameraUiConfigManagerImp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/camerauiconfigmanager/src/CameraUiConfigManagerImp.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,976 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper class which handles reading and storing the cr keys + * and its values. + * +*/ + + + +// Includes +#include +#include +#include +#include +#include +#include "CameraUiConfigManagerImp.h" +#include "CameraConfigurationCrKeys.h" +#include "camlogging.h" +#include "CamSettings.hrh" + + +// =========================================================================== +// Constants + +const TInt KCamCRStringInitialLength = 1024; +_LIT( KItemsSeparator, "," ); + + +// =========================================================================== + +inline TBool SettingIdMatches( const TInt* aSettingId, + const TSupportedSettingsData& aSettingItem ) + { + return ( *aSettingId == aSettingItem.iSettingId ); + }; + +// =========================================================================== + + +// Class methods + +// --------------------------------------------------------------------------- +// CCameraUiConfigManagerImp::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCameraUiConfigManagerImp* CCameraUiConfigManagerImp::NewL() + { + CCameraUiConfigManagerImp* self = CCameraUiConfigManagerImp::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + + +// --------------------------------------------------------------------------- +// CCameraUiConfigManagerImp::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCameraUiConfigManagerImp* CCameraUiConfigManagerImp::NewLC() + { + CCameraUiConfigManagerImp* self = new( ELeave ) CCameraUiConfigManagerImp(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// CCameraUiConfigManagerImp::~CCameraUiConfigManagerImp +// Destructor +// --------------------------------------------------------------------------- +// +CCameraUiConfigManagerImp::~CCameraUiConfigManagerImp() + { + for( TInt index = 0;index < iSupportedSettings.Count();index++ ) + { + if ( iSupportedSettings[index] ) + { + iSupportedSettings[index]->iSupportedSettingItems.Close(); + } + } + iSupportedSettings.ResetAndDestroy(); + iSupportedSettings.Close(); + + delete iRepository; + } + + + + +// --------------------------------------------------------------------------- +// CCameraUiConfigManagerImp::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCameraUiConfigManagerImp::ConstructL() + { + iRepository = CRepository::NewL( KCameraDynamicConfigurationCrKeys ); + LoadAllDynamicSettingsL(); + } + + + +// ---------------------------------------------------------------------------------- +// CCameraUiConfigManagerImp::IsFeatureSupported +// ---------------------------------------------------------------------------------- +// +TInt CCameraUiConfigManagerImp::IsFeatureSupported( + const TCamDynamicSettings aSettingId ) const + { + PRINT( _L("Camera => CCameraUiConfigManagerImp::IsFeatureSupportedL" )) + + TInt settingIndex ( KErrNotFound ); + TInt value(0); // setting not supported + + if ( iSupportedSettings.Count() > 0 ) + { + settingIndex = SearchInSettingsListFor( iSupportedSettings, + static_cast( aSettingId ) ); + } + else + { + // if there are no supported settings + } + + if ( KErrNotFound != settingIndex ) + { + if ( iSupportedSettings[settingIndex] ) + { + value = iSupportedSettings[settingIndex]->iSupportedValue; + } + } + else + { + // setting item not found; hence not supported. + } + PRINT1( _L("Camera <= CCameraUiConfigManagerImp::IsFeatureSupportedL = %d" ), value ); + return value; + } + + + +// +//CCameraUiConfigManagerImp::SupportedSettingItemsL +// +void CCameraUiConfigManagerImp::SupportedSettingItemsL( + const TCamDynamicSettings aSettingId, + RArray& aSupportedValues ) + { + PRINT( _L("Camera => CCameraUiConfigManagerImp::SupportedSettingItemsL" )) + TInt settingIndex ( KErrNotFound ); + aSupportedValues.Reset(); + + if ( iSupportedSettings.Count() > 0 ) + { + settingIndex = SearchInSettingsListFor( iSupportedSettings, + static_cast( aSettingId ) ); + } + else + { + // do nothing + } + if ( KErrNotFound != settingIndex ) + { + // if the index is valid, copy all corresponding setting items to the array + for ( TInt i = 0; + i < iSupportedSettings[settingIndex]->iSupportedSettingItems.Count(); + i++ ) + { + if ( iSupportedSettings[settingIndex] ) + { + aSupportedValues.AppendL( + iSupportedSettings[settingIndex]->iSupportedSettingItems[i] ); + } + } + } + else + { + User::Leave( KErrNotSupported ); + } + + PRINT( _L("Camera <= CCameraUiConfigManagerImp::SupportedSettingItemsL" )) + } + + + +// --------------------------------------------------------------------------- +// CCameraUiConfigManager::LoadAllDynamicSettingsL +// Load all dynamic settings +// --------------------------------------------------------------------------- +// +void CCameraUiConfigManagerImp::LoadAllDynamicSettingsL() + { + PRINT( _L("Camera => CCameraUiConfigManagerImp::LoadAllDynamicSettingsL()" )) + RArray settingItemDefaultData; + CleanupClosePushL( settingItemDefaultData ); + + TInt supportedValue = 0; + TInt error = KErrNone; + + for( TInt settingId = ( static_cast( ECamDynamicSettingsMin ) + 1 ); + settingId < static_cast( ECamDynamicSettingsMax ); + settingId++ ) + { + if ( LoadCrForFeatureSupport( settingId ) ) + { + error = iRepository->Get( MapSettingItemToCrFeatureKeyL( settingId ), + supportedValue ); + } + else + { + supportedValue = 1; + } + + if ( error ) break; // if any error reading CenRep; do proper clean-up + + switch( settingId ) + { + case ECamDynamicSettingCaptureToneDelaySupport: + case ECamDynamicSettingCaptureToneDelayValue: + case ECamDynamicSettingRequiredRamMemory: + case ECamDynamicSettingCriticalLevelRamMemory: + case ECamDynamicSettingRequiredRamMemoryFocusGained: + case ECamDynamicSettingCriticalLevelRamMemoryFocusGained: + case ECamDynamicSettingPhoto: + case ECamDynamicSettingPublishZoomState: + case ECamDynamicSettingAutofocusSetInHyperfocalAtStartup: + case ECamDynamicSettingLocation: + case ECamDynamicSettingKeyLockWatcher: + case ECamDynamicSettingSecondaryCamera: + case ECamDynamicSettingLensCover: + case ECamDynamicSettingXenonFlash: + case ECamDynamicSettingLightSensitivity: + case ECamDynamicSettingExtLightSensitivity: + case ECamDynamicSettingFaceTracking: + case ECamDynamicSettingOpticalJoyStick: + case ECamDynamicSettingOneClickUpload: + case ECamDynamicSettingVideoLight: + case ECamDynamicSettingAutoFocus: + case ECamDynamicSettingVideoStabilization: + case ECamDynamicSettingOrientationSensor: + case ECamDynamicSetting2ndCameraOrientation: + case ECamDynamicSettingUIOrientationOverride: + case ECamDynamicSettingThumbnailManagerAPI: + case ECamDynamicSettingBurstMode: + case ECamDynamicSettingContinuousAF: + case ECamDynamicSettingBurstFileSizeEstimateFactor: + { + PRINT1( _L("Camera <> CCameraUiConfigManagerImp::LoadAllDynamicSettingsL() append %d" ), settingId ) + AppendToSettingsArrayL( settingId, + supportedValue, + settingItemDefaultData ); + break; + } + case ECamDynamicSettingVideoSceneModeNormal: + case ECamDynamicSettingVideoSceneModeNight: + case ECamDynamicSettingVideoSceneModeLowLight: + case ECamDynamicSettingDSAViewFinder: + case ECamDynamicSettingImageSceneModeAuto: + case ECamDynamicSettingImageSceneModeUser: + case ECamDynamicSettingImageSceneModeMacro: + case ECamDynamicSettingImageSceneModePotrait: + case ECamDynamicSettingImageSceneModeScenery: + case ECamDynamicSettingImageSceneModeSports: + case ECamDynamicSettingImageSceneModeNight: + case ECamDynamicSettingImageSceneModeNightPotrait: + case ECamDynamicSettingPCCaptureKeys: + case ECamDynamicSettingSCCaptureKeys: + case ECamDynamicSettingPCAutoFocusKeys: + case ECamDynamicSettingSCAutoFocusKeys: + case ECamDynamicSettingPCZoomIn: + case ECamDynamicSettingSCZoomIn: + case ECamDynamicSettingPCZoomOut: + case ECamDynamicSettingSCZoomOut: + case ECamDynamicSettingWhiteBalance: + case ECamDynamicSettingColorTone: + case ECamDynamicSettingContrast: + case ECamDynamicSettingBrightness: + case ECamDynamicSettingEV: + case ECamDynamicSettingSharpness: + case ECamDynamicSettingFlashMode: + case ECamDynamicSettingZoomLAF: + case ECamDynamicSettingMaxOpticalZoomLimits: + case ECamDynamicSettingMaxExtendedZoomLimits: + case ECamDynamicSettingMaxDigitalZoomLimits: + case ECamDynamicSettingZoomDelays: + { + PRINT1( _L("Camera <> CCameraUiConfigManagerImp::LoadAllDynamicSettingsL() %d" ), settingId ) + LoadConfiguredSettingItemValuesFromCrL( settingId, + supportedValue, + settingItemDefaultData ); + break; + } + default: + { + break; + } + + } + } + CleanupStack::PopAndDestroy( &settingItemDefaultData ); + User::LeaveIfError( error ); + PRINT( _L("Camera <= CCameraUiConfigManagerImp::LoadAllDynamicSettingsL()" )) + } + + + +// +//CCameraUiConfigManagerImp::LoadConfiguredSettingItemValuesFromCr +// +void CCameraUiConfigManagerImp::LoadConfiguredSettingItemValuesFromCrL( + const TInt aSettingId, + const TInt aSupportedValue, + RArray& aDefaultItems ) + { + PRINT( _L("Camera => CCameraUiConfigManagerImp::LoadConfiguredSettingItemValuesFromCrL" )) + // Load supported setting items only when feature is supported + LoadDefaultSettingsDataL( aSettingId, aDefaultItems ); + AppendToSettingsArrayL( aSettingId, + aSupportedValue, + aDefaultItems, + MapSettingItemToCrItemsKeyL( aSettingId ), + ETrue ); + PRINT( _L("Camera <= CCameraUiConfigManagerImp::LoadConfiguredSettingItemValuesFromCrL" )) + } + + + + +// +// CCameraUiConfigManagerImp::AppendToSettingsArrayL +// +void CCameraUiConfigManagerImp::AppendToSettingsArrayL( const TInt aItemId, + const TInt aSupportedValue, + RArray& aAllItems, + TUint32 aCrItemsKey, + TBool aLoadSettingItems ) + { + PRINT( _L("Camera => CCameraUiConfigManagerImp::AppendToSettingsArrayL" )) + TSupportedSettingsData* newSetting = new( ELeave ) TSupportedSettingsData; + CleanupStack::PushL( newSetting ); + + newSetting->iSettingId = aItemId; // setting id + newSetting->iSupportedValue = aSupportedValue; // feature support + if ( aLoadSettingItems && aSupportedValue ) + { + // all configured setting items from cr only if the feature is supported + GetSupportedSettingIdsL( aAllItems, + newSetting->iSupportedSettingItems, + aCrItemsKey ); + } + + iSupportedSettings.AppendL( newSetting ); + CleanupStack::Pop( newSetting ); + PRINT( _L("Camera <= CCameraUiConfigManagerImp::AppendToSettingsArrayL" )) + } + + + +// --------------------------------------------------------------------------- +// CCameraUiConfigManager::LoadAllDynamicSettingL +// Load all dynamic settings +// --------------------------------------------------------------------------- +// +void CCameraUiConfigManagerImp::LoadDefaultSettingsDataL( + const TInt aSettingId, + RArray& aDefaultItems ) + { + PRINT1( _L("Camera => CCameraUiConfigManagerImp::LoadDefaultSettingsDataL setting id [%d]" ), aSettingId ) + aDefaultItems.Reset(); + TInt i = 0; + const TInt* settingsId = LoadSettingEnumerationArray( aSettingId ); + const TUint16* const* stringArray = LoadSettingStringArray( aSettingId ); + + if ( settingsId && stringArray ) + { + while ( settingsId[i] != KCamLastSettingItem ) + { + TDynamicSettingsData data; + data.iItemId = settingsId[i]; + data.iText = stringArray[i]; + aDefaultItems.AppendL( data ); + i++; + } + } + PRINT( _L("Camera <= CCameraUiConfigManagerImp::LoadDefaultSettingsDataL()" ) ) + } + + + +// +// CCameraUiConfigManagerImp::GetSupportedSettingIdsL +// +void CCameraUiConfigManagerImp::GetSupportedSettingIdsL( + RArray& aAllItems, + RArray& aSupportedValues, + const TUint32 aCrKey ) + { + PRINT( _L("Camera => CameraUiConfigManagerImp::GetSupportedSettingIdsL" )) + aSupportedValues.Reset(); + + HBufC* string; // not sure but does this need to be in cleanupstack since this can later leave? + string = GetStringDataL( aCrKey ); + TBool clearstring = EFalse; + + TPtrC data = string->Des(); + TPtrC currentItem( KNullDesC ); + + while ( data.Length() > 0 ) + { + // Find the next instance of item separator + const TInt separatorIndex( data.Find( KItemsSeparator ) ); + + if( KErrNotFound != separatorIndex ) + { + // There is more than one item in the string still + // Get the current item - everything before separator + currentItem.Set( data.Left( separatorIndex ) ); + // The remaining data is now everything after the separator + data.Set( data.Right( data.Length() - separatorIndex - 1 ) ); + } + else + { + // This is the last item in the string + currentItem.Set( data ); + data.Set( KNullDesC ); + clearstring = ETrue; + } + + // Get the item id for the current item, and if found, append to list + TInt settingItem; + PRINT1( _L("Camera <> settingItem: %S"), string ) + if ( currentItem[0]-48 >= 0 && currentItem[0]-48 <= 9 || + ( currentItem[0] == '-' && // check for negative number too + currentItem[1]-48 >= 0 && currentItem[1]-48 <= 9 ) ) + { + // read the numeric value equivalent to the numeric string + TLex lex; + if( currentItem.Length() > 2 ) + { + // if it is hex value, then extract hex value + if( currentItem[1] == 'x' || currentItem[1] == 'X' ) + { + lex = TLex( currentItem.Mid(2) ); + TRadix radix = EHex; + TUint value; + lex.Val(value, radix); + settingItem = value; + } + else // extract integer + { + lex = TLex( currentItem ); + lex.Val( settingItem ); + } + } + else // extract integer + { + lex = TLex( currentItem ); + lex.Val( settingItem ); + } + } + else + { + // not a numeric string, check for necessary enum equivalents. + settingItem = SettingItemId( aAllItems, currentItem ); + } + + PRINT1( _L("Camera <> settingItem: %d"), settingItem ) + + if( KErrNotFound != settingItem ) + { + aSupportedValues.AppendL( settingItem ); // here + } + if( clearstring ) + { + delete string; + } + } + PRINT( _L("Camera <= CameraUiConfigManagerImp::GetSupportedSettingIdsL" )) + } + + + +// +// CCameraUiConfigManagerImp::SettingItemId +// +TInt CCameraUiConfigManagerImp::SettingItemId( + RArray& aPossibleSettings, + const TDesC& aItemString ) const + { + PRINT( _L("Camera => CameraUiConfigManagerImp::SettingItemId" )) + for( TInt i = aPossibleSettings.Count()-1; i >= 0; i-- ) + { + if( aItemString == aPossibleSettings[i].iText ) + { + PRINT( _L("Camera <= CameraUiConfigManagerImp::SettingItemId" )) + return aPossibleSettings[i].iItemId; + } + } + + PRINT( _L("Camera <= CameraUiConfigManagerImp::SettingItemId" )) + // No id found for the argument string + return KErrNotFound; + } + + +// +// CCameraUiConfigManagerImp::GetStringDataL +// +HBufC* CCameraUiConfigManagerImp::GetStringDataL( const TUint32 aCrKey ) + { + PRINT( _L("Camera => CameraUiConfigManagerImp::GetStringDataL" )) + HBufC* string = HBufC::NewLC( KCamCRStringInitialLength ); + + TPtr ptr = string->Des(); + TInt size = 0; + TInt status = iRepository->Get( aCrKey, ptr, size ); + + // Did not fit into the string, reserve more memory and try again + if( KErrOverflow == status ) + { + CleanupStack::PopAndDestroy( string ); // String + string = HBufC::NewLC( size ); + ptr = string->Des(); + status = iRepository->Get( aCrKey, ptr, size ); + } + + CleanupStack::Pop( string ); // string + User::LeaveIfError( status ); + + PRINT( _L("Camera <= CameraUiConfigManagerImp::GetStringDataL" )) + return string; + } + + + +// --------------------------------------------------------------------------- +// CCameraUiConfigManager::SearchInSettingsListFor +// Searches in a settings list for a particular setting item. +// --------------------------------------------------------------------------- +// +TInt CCameraUiConfigManagerImp::SearchInSettingsListFor( + const RPointerArray& aSettingsList, + TInt aSettingItem ) const + { + return aSettingsList.Find( aSettingItem, SettingIdMatches ); + } + + +// +//CCameraUiConfigManagerImp::MapSettingItemToCrFeatureKeyL +// +TUint32 CCameraUiConfigManagerImp::MapSettingItemToCrFeatureKeyL( + const TInt aSettingItem ) const + { + PRINT( _L("Camera => CCameraUiConfigManagerImp::MapSettingItemToCrFeatureKeyL" )) + TUint32 crKey( 0 ); + switch ( aSettingItem ) + { + case ECamDynamicSettingRequiredRamMemory: + crKey = KCamCrFeatureRequiredRamMemory; + break; + case ECamDynamicSettingCaptureToneDelaySupport: + crKey = KCamCrFeatureCaptureToneDelaySupport; + break; + case ECamDynamicSettingCaptureToneDelayValue: + crKey = KCamCrFeatureCaptureToneDelayValue; + break; + case ECamDynamicSettingCriticalLevelRamMemory: + crKey = KCamCrFeatureCriticalLevelRamMemory; + break; + case ECamDynamicSettingRequiredRamMemoryFocusGained: + crKey = KCamCrFeatureRequiredRamMemoryFocusGained; + break; + case ECamDynamicSettingCriticalLevelRamMemoryFocusGained: + crKey = KCamCrFeatureCriticalLevelRamMemoryFocusGained; + break; + case ECamDynamicSettingPhoto: + crKey = KCamCrFeatureKeyPhotos; + break; + case ECamDynamicSettingPublishZoomState: + crKey = KCamCrFeatureKeyPublishZoomSate; + break; + case ECamDynamicSettingAutofocusSetInHyperfocalAtStartup: + crKey = KCamCrFeatureKeyAFSetInHyperfocalAtStartup; + break; + case ECamDynamicSettingExtDigitalZoom: + crKey = KCamCrFeatureExtDigitalZoom; + break; + case ECamDynamicSettingLocation: + crKey = KCamCrFeatureLocation; + break; + case ECamDynamicSettingKeyLockWatcher: + crKey = KCamCrFeatureKeyLockWatcher; + break; + case ECamDynamicSettingColorTone: + crKey = KCamCrFeatureColorTone; + break; + case ECamDynamicSettingSharpness: + crKey = KCamCrFeatureSharpness; + break; + case ECamDynamicSettingWhiteBalance: + crKey = KCamCrFeatureWhiteBalance; + break; + case ECamDynamicSettingSecondaryCamera: + crKey = KCamCrFeatureSecondaryCamera; + break; + case ECamDynamicSettingLensCover: + crKey = KCamCrFeatureLensCover; + break; + case ECamDynamicSettingXenonFlash: + crKey = KCamCrFeatureXenonFlash; + break; + case ECamDynamicSettingOneClickUpload: + crKey = KCamCrFeatureOneClickUpLoad; + break; + case ECamDynamicSettingVideoLight: + crKey = KCamCrFeatureVideoLight; + break; + case ECamDynamicSettingAutoFocus: + crKey = KCamCrFeatureAutoFocus; + break; + case ECamDynamicSettingExtLightSensitivity: + crKey = KCamCrFeatureExtLightSensitivity; + break; + case ECamDynamicSettingContrast: + crKey = KCamCrFeatureContrast; + break; + case ECamDynamicSettingBrightness: + crKey = KCamCrFeatureBrightness; + break; + case ECamDynamicSettingEV: + crKey = KCamCrFeatureEV; + break; + case ECamDynamicSettingFlashMode: + crKey = KCamCrFeatureFlashMode; + break; + case ECamDynamicSettingLightSensitivity: + crKey = KCamCrFeatureLightSensitivity; + break; + case ECamDynamicSettingVideoStabilization: + crKey = KCamCrFeatureVideoStabilization; + break; + case ECamDynamicSettingOrientationSensor: + crKey = KCamCrFeatureOrientationSensor; + break; + case ECamDynamicSettingFaceTracking: + crKey = KCamCrFeatureFaceTracking; + break; + case ECamDynamicSettingOpticalJoyStick: + crKey = KCamCrFeatureOpticalJoyStick; + break; + case ECamDynamicSetting2ndCameraOrientation: + crKey = KCamCrFeature2ndCameraOrientation; + break; + case ECamDynamicSettingUIOrientationOverride: + crKey = KCamCrFeatureUIOrientationOverride; + break; + case ECamDynamicSettingThumbnailManagerAPI: + crKey = KCamCrFeatureThumbnailManagerAPI; + break; + case ECamDynamicSettingBurstFileSizeEstimateFactor: + crKey = KCamCrFeatureBurstFileSizeEstimateFactor; + break; + case ECamDynamicSettingBurstMode: + crKey = KCamCrFeatureBurstMode; + break; + case ECamDynamicSettingContinuousAF: + crKey = KCamCrFeatureContinuousAF; + break; + default: + PRINT( _L("Camera <> CCameraUiConfigManagerImp::MapSettingItemToCrFeatureKeyL, leave!!!" ) ) + User::Leave( KErrNotSupported ); + } + PRINT( _L("Camera <= CCameraUiConfigManagerImp::MapSettingItemToCrFeatureKeyL" ) ) + return crKey; + } + + + +// +//CCameraUiConfigManagerImp::MapSettingItemToCrKeyL +// +TUint32 +CCameraUiConfigManagerImp::MapSettingItemToCrItemsKeyL( const TInt aSettingItem ) const + { + PRINT( _L("Camera => CCameraUiConfigManagerImp::MapSettingItemToCrItemsKeyL" )) + TUint32 crKey( 0 ); + switch ( aSettingItem ) + { + case ECamDynamicSettingVideoSceneModeNormal: + crKey = KCamCrFeatureVideoSceneNormal; + break; + case ECamDynamicSettingVideoSceneModeNight: + crKey = KCamCrFeatureVideoSceneModeNight; + break; + case ECamDynamicSettingVideoSceneModeLowLight: + crKey = KCamCrFeatureVideoSceneModeLowLight; + break; + case ECamDynamicSettingDSAViewFinder: + crKey = KCamCrFeatureDSAViewFinder; + break; + case ECamDynamicSettingImageSceneModeAuto: + crKey = KCamCrFeatureImageSceneModeAuto; + break; + case ECamDynamicSettingImageSceneModeUser: + crKey = KCamCrFeatureImageSceneModeUser; + break; + case ECamDynamicSettingImageSceneModeMacro: + crKey = KCamCrFeatureImageSceneModeMacro; + break; + case ECamDynamicSettingImageSceneModePotrait: + crKey = KCamCrFeatureImageSceneModePotrait; + break; + case ECamDynamicSettingImageSceneModeScenery: + crKey = KCamCrFeatureImageSceneModeScenery; + break; + case ECamDynamicSettingImageSceneModeSports: + crKey = KCamCrFeatureImageSceneModeSports; + break; + case ECamDynamicSettingImageSceneModeNight: + crKey = KCamCrFeatureImageSceneModeNight; + break; + case ECamDynamicSettingImageSceneModeNightPotrait: + crKey = KCamCrFeatureImageSceneModeNightPotrait; + break; + case ECamDynamicSettingPCCaptureKeys: + crKey = KCamCrFeaturePCCaptureKeys; + break; + case ECamDynamicSettingSCCaptureKeys: + crKey = KCamCrFeatureSCCaptureKeys; + break; + case ECamDynamicSettingPCAutoFocusKeys: + crKey = KCamCrFeaturePCAutoFocusKeys; + break; + case ECamDynamicSettingSCAutoFocusKeys: + crKey = KCamCrFeatureSCAutoFocusKeys; + break; + case ECamDynamicSettingColorTone: + crKey = KCamCrFeatureColorToneItems; + break; + case ECamDynamicSettingWhiteBalance: + crKey = KCamCrFeatureWhiteBalanceItems; + break; + case ECamDynamicSettingPCZoomIn: + crKey = KCamCrFeaturePCZoomInItems; + break; + case ECamDynamicSettingPCZoomOut: + crKey = KCamCrFeaturePCZoomOutItems; + break; + case ECamDynamicSettingSCZoomIn: + crKey = KCamCrFeatureSCZoomInItems; + break; + case ECamDynamicSettingSCZoomOut: + crKey = KCamCrFeatureSCZoomOutItems; + break; + case ECamDynamicSettingEV: + crKey = KCamCrFeatureEVItems; + break; + case ECamDynamicSettingSharpness: + crKey = KCamCrFeatureSharpnessItems; + break; + case ECamDynamicSettingFlashMode: + crKey = KCamCrFeatureFlashModeItems; + break; + case ECamDynamicSettingMaxDigitalZoomLimits: + crKey = KCamCrFeatureMaxDigitalZoomLimits; + break; + case ECamDynamicSettingMaxExtendedZoomLimits: + crKey = KCamCrFeatureMaxExtendedZoomLimits; + break; + case ECamDynamicSettingMaxOpticalZoomLimits: + crKey = KCamCrFeatureMaxOpticalZoomLimits; + break; + case ECamDynamicSettingZoomLAF: + crKey = KCamCrFeatureZoomLAF; + break; + case ECamDynamicSettingContrast: + crKey = KCamCrFeatureContrastItems; + break; + case ECamDynamicSettingBrightness: + crKey = KCamCrFeatureBrightnessItems; + break; + case ECamDynamicSettingZoomDelays: + crKey = KCamCrFeatureZoomDelays; + break; + default: + PRINT( _L("Camera <> CCameraUiConfigManagerImp::MapSettingItemToCrItemsKeyL, leave!!!" ) ) + User::Leave( KErrNotSupported ); + } + PRINT( _L("Camera <= CCameraUiConfigManagerImp::MapSettingItemToCrItemsKeyL" ) ) + return crKey; + } + + +// +//CCameraUiConfigManagerImp::LoadCrForFeatureSupport +// +TBool CCameraUiConfigManagerImp::LoadCrForFeatureSupport( const TInt aSettingId ) const + { + TBool loadFromCr( ETrue ); + + switch ( aSettingId ) + { + case ECamDynamicSettingDSAViewFinder: + case ECamDynamicSettingPCCaptureKeys: + case ECamDynamicSettingSCCaptureKeys: + case ECamDynamicSettingPCAutoFocusKeys: + case ECamDynamicSettingSCAutoFocusKeys: + case ECamDynamicSettingPCZoomIn: + case ECamDynamicSettingPCZoomOut: + case ECamDynamicSettingSCZoomIn: + case ECamDynamicSettingSCZoomOut: + case ECamDynamicSettingMaxDigitalZoomLimits: + case ECamDynamicSettingMaxExtendedZoomLimits: + case ECamDynamicSettingMaxOpticalZoomLimits: + case ECamDynamicSettingZoomLAF: + case ECamDynamicSettingImageSceneModeAuto: + case ECamDynamicSettingImageSceneModeUser: + case ECamDynamicSettingImageSceneModeMacro: + case ECamDynamicSettingImageSceneModePotrait: + case ECamDynamicSettingImageSceneModeScenery: + case ECamDynamicSettingImageSceneModeSports: + case ECamDynamicSettingImageSceneModeNight: + case ECamDynamicSettingImageSceneModeNightPotrait: + case ECamDynamicSettingVideoSceneModeNormal: + case ECamDynamicSettingVideoSceneModeNight: + case ECamDynamicSettingVideoSceneModeLowLight: + case ECamDynamicSettingZoomDelays: + loadFromCr = EFalse; + break; + default: + break; + } + return loadFromCr; + } + +// +//CCameraUiConfigManagerImp::LoadSettingEnumerationArray +// +const TInt* CCameraUiConfigManagerImp::LoadSettingEnumerationArray( const TInt aSettingItem ) + { + PRINT( _L("Camera => CCameraUiConfigManagerImp::LoadSettingEnumerationArray" ) ) + const TInt* enumArray = NULL; + + switch ( aSettingItem ) + { + case ECamDynamicSettingWhiteBalance: + enumArray = KCamWhiteBalanceEnums; + break; + case ECamDynamicSettingColorTone: + enumArray = KCamColorToneEnums; + break; + case ECamDynamicSettingFlashMode: + enumArray = KCamFlashModeEnums; + break; + case ECamDynamicSettingImageSceneModeAuto: + case ECamDynamicSettingImageSceneModeUser: + case ECamDynamicSettingImageSceneModeMacro: + case ECamDynamicSettingImageSceneModePotrait: + case ECamDynamicSettingImageSceneModeScenery: + case ECamDynamicSettingImageSceneModeSports: + case ECamDynamicSettingImageSceneModeNight: + case ECamDynamicSettingImageSceneModeNightPotrait: + case ECamDynamicSettingVideoSceneModeNormal: + case ECamDynamicSettingVideoSceneModeNight: + case ECamDynamicSettingVideoSceneModeLowLight: + enumArray = KCamSceneModeEnums; + break; + default: + PRINT( _L("Camera <> CCameraUiConfigManagerImp::LoadSettingEnumerationArray, default!!!" ) ) + break; + } + PRINT( _L("Camera <= CCameraUiConfigManagerImp::LoadSettingEnumerationArray" ) ) + return enumArray; + } + + +// +//CCameraUiConfigManagerImp::LoadSettingStringArray +// +const TUint16* const* CCameraUiConfigManagerImp::LoadSettingStringArray( + const TInt aSettingItem ) + { + PRINT( _L("Camera => CCameraUiConfigManagerImp::LoadSettingStringArray()" ) ) + const TUint16* const* stringArray = NULL; + + switch ( aSettingItem ) + { + case ECamDynamicSettingWhiteBalance: + stringArray = KCamWhiteBalanceStrings; + break; + case ECamDynamicSettingColorTone: + stringArray = KCamColorToneStrings; + break; + case ECamDynamicSettingFlashMode: + stringArray = KCamFlashModeStrings; + break; + case ECamDynamicSettingImageSceneModeAuto: + case ECamDynamicSettingImageSceneModeUser: + case ECamDynamicSettingImageSceneModeMacro: + case ECamDynamicSettingImageSceneModePotrait: + case ECamDynamicSettingImageSceneModeScenery: + case ECamDynamicSettingImageSceneModeSports: + case ECamDynamicSettingImageSceneModeNight: + case ECamDynamicSettingImageSceneModeNightPotrait: + case ECamDynamicSettingVideoSceneModeNormal: + case ECamDynamicSettingVideoSceneModeNight: + case ECamDynamicSettingVideoSceneModeLowLight: + stringArray = KCamSceneModeStrings; + break; + default: + break; + } + PRINT( _L("Camera <= CCameraUiConfigManagerImp::LoadSettingStringArray()" ) ) + return stringArray; + } + + +/* +* Organizing CenRep data to a definite structure for scene modes. +*/ +void CCameraUiConfigManagerImp::OrganiseSceneSettings( + RArray& aTargetArray, + RArray& aSceneSettingsArray, + const TBool aPhotoScene ) + { + if ( aSceneSettingsArray.Count() > 0 ) + { + TSceneSettings scene; + TInt index = 0; + // The following is the order how we read values from CenRep + // each time for each specific scene mode in Image & Video case. + scene.iSupported = aSceneSettingsArray[index++]; + scene.iIdentifier = aSceneSettingsArray[index++]; + scene.iExposureMode = aSceneSettingsArray[index++]; + scene.iWhiteBalance = aSceneSettingsArray[index++]; + scene.iFlash = aSceneSettingsArray[index++]; + scene.iContrastMode = aSceneSettingsArray[index++]; + scene.iFocalDistance = aSceneSettingsArray[index++]; + + if ( aPhotoScene ) + { + // The following is the order how we read values from CenRep + // each time for each specific scene mode in Image case. + // Note: In image scene, we ignore iFrameRate as this wont be configured + // for any of the image scenes + scene.iSharpnessMode = aSceneSettingsArray[index++]; + scene.iLightSensitivityMode = aSceneSettingsArray[index++]; + scene.iExposureCompensationValue = aSceneSettingsArray[index++]; + } + else + { + // The following is the order how we read values from CenRep + // each time for each specific scene mode in Video scene case. + // Note: In image scene, we ignore iFrameRate as this wont be configured + // for any of the image scenes + scene.iFrameRate = aSceneSettingsArray[index++]; + } + aTargetArray.Append( scene ); + } + } +// End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/data/CamAppWide.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/data/CamAppWide.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,853 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + +#include +#include + + + +//---------------------------------------------------- +// +// r_cam_oom_note +// Out of memory note +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_oom_note_ok_empty + { + flags = EAknWarningNoteFlags|EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_WARNING_ANIM; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_oom_note +// Out of memory note with cancel option +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_oom_note_ok_cancel + { + flags = EAknWarningNoteFlags|EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_WARNING_ANIM; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_illegal_characters +// Information note displayed when there are illegal +// characters in the filename user tries to save +// +//---------------------------------------------------- +// +RESOURCE AKN_NOTE_WRAPPER r_cam_illegal_characters + { + resId = R_AKN_INFORMATION_NOTE_DIALOG_WAIT; + timeout = EAknInformationNoteTimeout; + tone = EAknNoteDialogNoTone; + text = qtn_fldr_illegal_characters; + } + +//---------------------------------------------------- +// +// r_cam_query_default_image_name +// Prompt for image name base query. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_query_default_image_name + { + buf = qtn_lcam_query_default_image_name; + } + + +//---------------------------------------------------- +// +// r_cam_query_default_video_name +// Prompt for video name base query. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_query_default_video_name + { + buf = qtn_lcam_query_default_video_name; + } + +//---------------------------------------------------- +// +// r_cam_query_image_name +// Prompt for image name base query. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_query_image_name + { + buf = qtn_lcam_query_image_name; + } + + +//---------------------------------------------------- +// +// r_cam_query_video_name +// Prompt for video name base query. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_query_video_name + { + buf = qtn_lcam_query_video_name; + } + +//---------------------------------------------------- +// +// r_cam_rename_query +// Resources for image/video rename query dialog +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_rename_query + { + flags = EAknGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + items= + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control= AVKON_DATA_QUERY + { + layout = EDataLayout; + control = EDWIN + { + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_softkeys_options_exit +// Softkeys definition which uses ECamCmdInternalExit +// instead of EAknSoftkeyExit (as in r_avkon_softkeys_exit) +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_exit + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; } + }; + } + +//---------------------------------------------------- +// +// r_cam_unsuitable_filename +// Information note displayed when the filename +// user tries to enter contains only "." or ".." +// +//---------------------------------------------------- +// +RESOURCE AKN_NOTE_WRAPPER r_cam_unsuitable_filename + { + resId = R_AKN_INFORMATION_NOTE_DIALOG_WAIT; + timeout = EAknInformationNoteTimeout; + tone = EAknNoteDialogNoTone; + text = qtn_fldr_bad_file_name; + } + +//---------------------------------------------------- +// +// r_cam_memory_select_dialog +// Resource definition for Memory Select dialog in low memory conditions +// +//---------------------------------------------------- +// +RESOURCE MEMORYSELECTIONDIALOG r_cam_memory_select_dialog + { + softkey_1 = text_softkey_select; + softkey_2 = text_softkey_cancel; + } + + +#ifndef CAMERAAPP_PLUGIN_BUILD + +//**************************************************************** +// THE FOLLOWING ARE RESOURCES NEEDED BY CAMERA ONLY +//*************************************************************** + +//---------------------------------------------------- +// +// r_cam_error_note +// Error note +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_error_note + { + flags = EAknWarningNoteFlags; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_WARNING_ANIM; + }; + } + }; + } + + + +// ----------------------------------------------------------------------------- +// +// r_cam_memlo_not_enough_memory +// Used when sequence capture fails with KErrNoMemory +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_memlo_not_enough_memory + { + buf = qtn_memlo_not_enough_memory; + } + +//---------------------------------------------------- +// +// r_cam_free_memory_wait_note +// Wait note shown when freeing memory at startup +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_free_memory_wait_note + { + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = EFreeingMemoryWaitNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_lcam_note_free_memory; + }; + } + }; + } + +RESOURCE TBUF r_note_text_free_memory + { + buf = qtn_lcam_note_free_memory; + } + +//----------------------------------------------------------------------------- +// +// r_cam_overwrite_query +// Overwrite confirmation query +// +//----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_cam_overwrite_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_activate_cancel__select +// Softkeys for self-timer state (activate/cancel) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_activate_cancel__select + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdSelfTimerActivate; txt = qtn_lcam_softkey_activate; }, + CBA_BUTTON { id = ECamCmdSelfTimerCancel; txt = text_softkey_cancel; }, + CBA_BUTTON { id = ECamMSKCmdSelect; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_selftimer_blank_cancel +// Softkeys for self-timer state (blank/cancel) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_selftimer_blank_cancel + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; }, + CBA_BUTTON { id = ECamCmdSelfTimerCancel; txt = text_softkey_cancel; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_blank_stop +// Softkeys for during sequence capture (blank/stop) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_blank_stop + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; }, + CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_stop; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_blank +// Blank softkeys +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_blank + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; }, + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_blank_secondary +// Blank softkeys +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_blank_secondary + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; }, + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_continue_stop +// Softkeys for recording paused state (continue/stop) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_continue_stop + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdStop; txt = text_softkey_stop; }, + CBA_BUTTON { id = ECamCmdContinue; txt = qtn_lcam_softkey_continue; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_continue_stop +// Softkeys for recording paused state (continue/stop) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_continue_stop_secondary + { + buttons = + { + CBA_BUTTON { id = ECamCmdStop; txt = text_softkey_stop; }, + CBA_BUTTON { id = ECamCmdContinue; txt = qtn_lcam_softkey_continue; } + }; + } + + +//---------------------------------------------------- +// +// r_cam_softkeys_pause_stop +// Softkeys for recording state(pause/stop) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_pause_stop + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdStop; txt = text_softkey_stop; }, + CBA_BUTTON { id = ECamCmdPause; txt = text_softkey_pause; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_pause_stop_secondary +// Softkeys for recording state(pause/stop) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_pause_stop_secondary + { + buttons = + { + CBA_BUTTON { id = ECamCmdStop; txt = text_softkey_stop; }, + CBA_BUTTON { id = ECamCmdPause; txt = text_softkey_pause; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_select_cancel +// Softkeys for when using horizontal selector +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_select_cancel + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeySelect; txt = text_softkey_select; }, + CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_cancel; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_back +// Softkeys for post-capture views when processing image/video +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_back + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { txt = text_softkey_empty;}, + CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, + CBA_BUTTON { txt = text_softkey_empty; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_back_secondary +// Softkeys for post-capture views when processing image/video +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_back_secondary + { + buttons = + { + CBA_BUTTON { txt = text_softkey_empty;}, + CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, + CBA_BUTTON { txt = text_softkey_empty; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_select_delete__select +// Softkeys for embedded post-exposure state +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_select_delete__select + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdSelect; txt = text_softkey_select; }, + CBA_BUTTON { id = ECamCmdDelete; txt = qtn_lcam_softkey_delete; }, + CBA_BUTTON { id = ECamCmdSelect; txt = text_softkey_select; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_select_delete__select_secondary +// Softkeys for embedded post-exposure state +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_select_delete__select_secondary + { + buttons = + { + CBA_BUTTON { id = ECamCmdSelect; txt = text_softkey_select; }, + CBA_BUTTON { id = ECamCmdDelete; txt = qtn_lcam_softkey_delete; }, + CBA_BUTTON { id = ECamCmdSelect; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_blank_exit +// Softkeys for when application is in a capture mode +// transition. Used instead of r_avkon_softkeys_exit +// as that uses the wrong command id (EAknSoftkeyBack +// instead of ECamCmdPretendExit) +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_blank_exit + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { txt = text_softkey_empty; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_blank_exit_secondary +// Softkeys for when application is in a capture mode +// transition. Used instead of r_avkon_softkeys_exit +// as that uses the wrong command id (EAknSoftkeyBack +// instead of ECamCmdPretendExit) +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_blank_exit_secondary + { + buttons = + { + CBA_BUTTON { txt = text_softkey_empty; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_exit__continue +// Softkeys definition which uses ECamCmdContinue +// to handle the MSK event to continue from standby mode. +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_exit__continue + { + //flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdExitStandby; txt = qtn_lcam_softkey_continue; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_back__continue +// Softkeys definition which uses ECamCmdContinue +// to handle the MSK event to continue from standby mode. +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_back__continue + { + //flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; } + // CBA_BUTTON { id = ECamCmdExitStandby; txt = qtn_lcam_msk_continue; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_courtesy +// Softkeys definition used when courtesy UI is active +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_courtesy + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdRaiseCourtesyUI; txt = ""; }, + CBA_BUTTON { id = ECamCmdRaiseCourtesyUI; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_unable_to_rename +// Information note displayed when attempting +// an illegal rename (ie. overwriting images that +// are part of the same burst capture) +// +//---------------------------------------------------- +// +RESOURCE AKN_NOTE_WRAPPER r_cam_unable_to_rename + { + resId = R_AKN_INFORMATION_NOTE_DIALOG_WAIT; + timeout = EAknInformationNoteTimeout; + tone = EAknNoteDialogNoTone; + text = ""; // set from code, see r_qtn_fldr_cant_rename_item below + } + +//---------------------------------------------------- +// +// r_note_text_memory_full +// Error note text - all memory full +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_allmemory_full + { + buf = qtn_lcam_note_allmemory_full; + } + +//---------------------------------------------------- +// +// r_note_text_massmemory_full +// Error note text - mass storage memory full +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_massmemory_full + { + buf = qtn_memlo_not_enough_mass_memory; + } + +//---------------------------------------------------- +// +// r_note_text_not_enough_memory_card_defaultname +// Error note text - not enough memory in memory card with default name +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_not_enough_memory_card_defaultname + { + buf = qtn_memlo_not_enough_memory_card_defaultname; + } + +//---------------------------------------------------- +// +// r_note_text_not_enough_memory_card_name +// Error note text - not enough memory in memory card with user defined name +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_not_enough_memory_card_name + { + buf = qtn_memlo_not_enough_memory_card_name; + } + +//---------------------------------------------------- +// +// r_note_text_not_enough_device_memory +// Error note text - not enough memory in phone memory +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_not_enough_device_memory + { + buf = qtn_memlo_not_enough_device_memory; + } + +//---------------------------------------------------- +// +// r_note_text_memory_full +// Error note text - memory card not inserted/ +// corrupt/locked +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_card_not_inserted + { + buf = qtn_lcam_mmc_not_inserted; + } + +//---------------------------------------------------- +// +// r_note_text_card_read_only +// Error note text - memory card read-only +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_card_read_only + { + buf = qtn_lcam_mmc_read_only_mass_storage; + } + +//---------------------------------------------------- +// +// r_note_text_memory_full +// Error note text - internal memory full +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_internal_full + { + buf = qtn_lcam_note_internal_full; + } +//---------------------------------------------------- +// +// r_note_text_memory_full +// Error note text - memory full +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_memory_full + { + buf = qtn_lcam_note_memory_full; + } + + +//---------------------------------------------------- +// +// r_note_text_card_mem_full +// Query note text - Card memory full; switch to internal memory +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_card_mem_full + { + buf = qtn_lcam_note_card_mem_full; + } + +//---------------------------------------------------- +// +// r_note_text_internal_mem_full +// Query note text - Internal memory full; switch to card memory +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_internal_mem_full + { + buf = qtn_lcam_note_internal_mem_full; + } + + +//---------------------------------------------------- +// +// r_qtn_fldr_cant_rename_item +// Text shown when attempting +// an illegal rename (ie. overwriting images that +// are part of the same burst capture) +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_fldr_cant_rename_item + { + buf = qtn_fldr_cant_rename_item; + } + +//----------------------------------------------------------------------------- +// +// r_qtn_fldr_overwrite_query +// Overwrite confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_fldr_overwrite_query + { + buf = qtn_fldr_overwrite_query; + } + +#endif //CAMERAAPP_PLUGIN_BUILD + + +/* +//----------------------------------------------------------------------------- +// +// r_qtn_processing_video +// Processing video text, displayed on blended background in the bottom of +// thescreen in pre- and postcapture view. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_processing_video_text + { + buf = qtn_lcam_note_processing_video; + } +*/ +/* +//----------------------------------------------------------------------------- +// +// r_cam_processing_text_bg +// Size and position of the processing text blended background +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_processing_text_bg + { + r = 116; t = 219; W = 204; H = 21; + } +*/ + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/data/CamAppWideV2.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/data/CamAppWideV2.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,851 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + +#include +#include + + + +//---------------------------------------------------- +// +// r_cam_oom_note +// Out of memory note +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_oom_note_ok_empty + { + flags = EAknWarningNoteFlags|EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY__OK; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_WARNING_ANIM; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_oom_note +// Out of memory note with cancel option +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_oom_note_ok_cancel + { + flags = EAknWarningNoteFlags|EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_WARNING_ANIM; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_illegal_characters +// Information note displayed when there are illegal +// characters in the filename user tries to save +// +//---------------------------------------------------- +// +RESOURCE AKN_NOTE_WRAPPER r_cam_illegal_characters + { + resId = R_AKN_INFORMATION_NOTE_DIALOG_WAIT; + timeout = EAknInformationNoteTimeout; + tone = EAknNoteDialogNoTone; + text = qtn_fldr_illegal_characters; + } + +//---------------------------------------------------- +// +// r_cam_query_default_image_name +// Prompt for image name base query. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_query_default_image_name + { + buf = qtn_lcam_query_default_image_name; + } + + +//---------------------------------------------------- +// +// r_cam_query_default_video_name +// Prompt for video name base query. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_query_default_video_name + { + buf = qtn_lcam_query_default_video_name; + } + +//---------------------------------------------------- +// +// r_cam_query_image_name +// Prompt for image name base query. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_query_image_name + { + buf = qtn_lcam_query_image_name; + } + + +//---------------------------------------------------- +// +// r_cam_query_video_name +// Prompt for video name base query. +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_query_video_name + { + buf = qtn_lcam_query_video_name; + } + +//---------------------------------------------------- +// +// r_cam_rename_query +// Resources for image/video rename query dialog +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_rename_query + { + flags = EAknGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + items= + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control= AVKON_DATA_QUERY + { + layout = EDataLayout; + control = EDWIN + { + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_softkeys_options_exit +// Softkeys definition which uses ECamCmdInternalExit +// instead of EAknSoftkeyExit (as in r_avkon_softkeys_exit) +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_exit + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; } + }; + } + +//---------------------------------------------------- +// +// r_cam_unsuitable_filename +// Information note displayed when the filename +// user tries to enter contains only "." or ".." +// +//---------------------------------------------------- +// +RESOURCE AKN_NOTE_WRAPPER r_cam_unsuitable_filename + { + resId = R_AKN_INFORMATION_NOTE_DIALOG_WAIT; + timeout = EAknInformationNoteTimeout; + tone = EAknNoteDialogNoTone; + text = qtn_fldr_bad_file_name; + } + +//---------------------------------------------------- +// +// r_cam_memory_select_dialog +// Resource definition for Memory Select dialog in low memory conditions +// +//---------------------------------------------------- +// +RESOURCE MEMORYSELECTIONDIALOG r_cam_memory_select_dialog + { + softkey_1 = text_softkey_select; + softkey_2 = text_softkey_cancel; + } + + +#ifndef CAMERAAPP_PLUGIN_BUILD + +//**************************************************************** +// THE FOLLOWING ARE RESOURCES NEEDED BY CAMERA ONLY +//*************************************************************** + +//---------------------------------------------------- +// +// r_cam_error_note +// Error note +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_error_note + { + flags = EAknWarningNoteFlags; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EGeneralNote; + control = AVKON_NOTE + { + layout = EGeneralLayout; + animation = R_QGN_NOTE_WARNING_ANIM; + }; + } + }; + } + + + +// ----------------------------------------------------------------------------- +// +// r_cam_memlo_not_enough_memory +// Used when sequence capture fails with KErrNoMemory +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_memlo_not_enough_memory + { + buf = qtn_memlo_not_enough_memory; + } + +//---------------------------------------------------- +// +// r_cam_free_memory_wait_note +// Wait note shown when freeing memory at startup +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_free_memory_wait_note + { + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = EFreeingMemoryWaitNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_lcam_note_free_memory; + }; + } + }; + } + +RESOURCE TBUF r_note_text_free_memory + { + buf = qtn_lcam_note_free_memory; + } + +//----------------------------------------------------------------------------- +// +// r_cam_overwrite_query +// Overwrite confirmation query +// +//----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_cam_overwrite_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_activate_cancel__select +// Softkeys for self-timer state (activate/cancel) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_activate_cancel__select + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdSelfTimerActivate; txt = qtn_lcam_softkey_activate; }, + CBA_BUTTON { id = ECamCmdSelfTimerCancel; txt = text_softkey_cancel; }, + CBA_BUTTON { id = ECamMSKCmdSelect; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_selftimer_blank_cancel +// Softkeys for self-timer state (blank/cancel) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_selftimer_blank_cancel + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; }, + CBA_BUTTON { id = ECamCmdSelfTimerCancel; txt = text_softkey_cancel; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_blank_stop +// Softkeys for during sequence capture (blank/stop) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_blank_stop + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; }, + CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_stop; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_blank +// Blank softkeys +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_blank + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; }, + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_blank_secondary +// Blank softkeys +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_blank_secondary + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; }, + CBA_BUTTON { id = EAknSoftkeyEmpty; txt = ""; } + }; + } +//---------------------------------------------------- +// +// r_cam_softkeys_continue_stop +// Softkeys for recording paused state (continue/stop) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_continue_stop + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdStop; txt = text_softkey_stop; }, + CBA_BUTTON { id = ECamCmdContinue; txt = qtn_lcam_softkey_continue; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_continue_stop_secondary +// Softkeys for recording paused state (continue/stop) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_continue_stop_secondary + { + buttons = + { + CBA_BUTTON { id = ECamCmdStop; txt = text_softkey_stop; }, + CBA_BUTTON { id = ECamCmdContinue; txt = qtn_lcam_softkey_continue; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_pause_stop +// Softkeys for recording state(pause/stop) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_pause_stop + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdStop; txt = text_softkey_stop; }, + CBA_BUTTON { id = ECamCmdPause; txt = text_softkey_pause; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_pause_stop_secondary +// Softkeys for recording state(pause/stop) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_pause_stop_secondary + { + buttons = + { + CBA_BUTTON { id = ECamCmdStop; txt = text_softkey_stop; }, + CBA_BUTTON { id = ECamCmdPause; txt = text_softkey_pause; } + }; + } +//---------------------------------------------------- +// +// r_cam_softkeys_select_cancel +// Softkeys for when using horizontal selector +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_select_cancel + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeySelect; txt = text_softkey_select; }, + CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_cancel; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_back +// Softkeys for post-capture views when processing image/video +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_back + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { txt = text_softkey_empty;}, + CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, + CBA_BUTTON { txt = text_softkey_empty; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_back_secondary +// Softkeys for post-capture views when processing image/video +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_back_secondary + { + buttons = + { + CBA_BUTTON { txt = text_softkey_empty;}, + CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, + CBA_BUTTON { txt = text_softkey_empty; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_select_delete__select +// Softkeys for embedded post-exposure state +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_select_delete__select + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdSelect; txt = text_softkey_select; }, + CBA_BUTTON { id = ECamCmdDelete; txt = qtn_lcam_softkey_delete; }, + CBA_BUTTON { id = ECamCmdSelect; txt = text_softkey_select; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_select_delete__select_secondary +// Softkeys for embedded post-exposure state +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_select_delete__select_secondary + { + buttons = + { + CBA_BUTTON { id = ECamCmdSelect; txt = text_softkey_select; }, + CBA_BUTTON { id = ECamCmdDelete; txt = qtn_lcam_softkey_delete; }, + CBA_BUTTON { id = ECamCmdSelect; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_blank_exit +// Softkeys for when application is in a capture mode +// transition. Used instead of r_avkon_softkeys_exit +// as that uses the wrong command id (EAknSoftkeyBack +// instead of ECamCmdPretendExit) +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_blank_exit + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { txt = text_softkey_empty; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_blank_exit_secondary +// Softkeys for when application is in a capture mode +// transition. Used instead of r_avkon_softkeys_exit +// as that uses the wrong command id (EAknSoftkeyBack +// instead of ECamCmdPretendExit) +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_blank_exit_secondary + { + buttons = + { + CBA_BUTTON { txt = text_softkey_empty; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_exit__continue +// Softkeys definition which uses ECamCmdContinue +// to handle the MSK event to continue from standby mode. +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_exit__continue + { + //flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdExitStandby; txt = qtn_lcam_softkey_continue; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_back__continue +// Softkeys definition which uses ECamCmdContinue +// to handle the MSK event to continue from standby mode. +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_back__continue + { + //flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; } + // CBA_BUTTON { id = ECamCmdExitStandby; txt = qtn_lcam_msk_continue; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_courtesy +// Softkeys definition used when courtesy UI is active +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_courtesy + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = ECamCmdRaiseCourtesyUI; txt = ""; }, + CBA_BUTTON { id = ECamCmdRaiseCourtesyUI; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_unable_to_rename +// Information note displayed when attempting +// an illegal rename (ie. overwriting images that +// are part of the same burst capture) +// +//---------------------------------------------------- +// +RESOURCE AKN_NOTE_WRAPPER r_cam_unable_to_rename + { + resId = R_AKN_INFORMATION_NOTE_DIALOG_WAIT; + timeout = EAknInformationNoteTimeout; + tone = EAknNoteDialogNoTone; + text = ""; // set from code, see r_qtn_fldr_cant_rename_item below + } + +//---------------------------------------------------- +// +// r_note_text_memory_full +// Error note text - all memory full +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_allmemory_full + { + buf = qtn_lcam_note_allmemory_full; + } + +//---------------------------------------------------- +// +// r_note_text_massmemory_full +// Error note text - mass storage memory full +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_massmemory_full + { + buf = qtn_memlo_not_enough_mass_memory; + } + +//---------------------------------------------------- +// +// r_note_text_not_enough_memory_card_defaultname +// Error note text - not enough memory in memory card with default name +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_not_enough_memory_card_defaultname + { + buf = qtn_memlo_not_enough_memory_card_defaultname; + } + +//---------------------------------------------------- +// +// r_note_text_not_enough_memory_card_name +// Error note text - not enough memory in memory card with user defined name +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_not_enough_memory_card_name + { + buf = qtn_memlo_not_enough_memory_card_name; + } + +//---------------------------------------------------- +// +// r_note_text_not_enough_device_memory +// Error note text - not enough memory in phone memory +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_not_enough_device_memory + { + buf = qtn_memlo_not_enough_device_memory; + } + +//---------------------------------------------------- +// +// r_note_text_memory_full +// Error note text - memory card not inserted/ +// corrupt/locked +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_card_not_inserted + { + buf = qtn_lcam_mmc_not_inserted; + } + +//---------------------------------------------------- +// +// r_note_text_card_read_only +// Error note text - memory card read-only +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_card_read_only + { + buf = qtn_lcam_mmc_read_only_mass_storage; + } + +//---------------------------------------------------- +// +// r_note_text_memory_full +// Error note text - internal memory full +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_internal_full + { + buf = qtn_lcam_note_internal_full; + } +//---------------------------------------------------- +// +// r_note_text_memory_full +// Error note text - memory full +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_memory_full + { + buf = qtn_lcam_note_memory_full; + } + + +//---------------------------------------------------- +// +// r_note_text_card_mem_full +// Query note text - Card memory full; switch to internal memory +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_card_mem_full + { + buf = qtn_lcam_note_card_mem_full; + } + +//---------------------------------------------------- +// +// r_note_text_internal_mem_full +// Query note text - Internal memory full; switch to card memory +// +//---------------------------------------------------- +// +RESOURCE TBUF r_note_text_internal_mem_full + { + buf = qtn_lcam_note_internal_mem_full; + } + + + +//---------------------------------------------------- +// +// r_qtn_fldr_cant_rename_item +// Text shown when attempting +// an illegal rename (ie. overwriting images that +// are part of the same burst capture) +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_fldr_cant_rename_item + { + buf = qtn_fldr_cant_rename_item; + } + +//----------------------------------------------------------------------------- +// +// r_qtn_fldr_overwrite_query +// Overwrite confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_fldr_overwrite_query + { + buf = qtn_fldr_overwrite_query; + } + +#endif //CAMERAAPP_PLUGIN_BUILD + + +/* +//----------------------------------------------------------------------------- +// +// r_qtn_processing_video +// Processing video text, displayed on blended background in the bottom of +// thescreen in pre- and postcapture view. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_processing_video_text + { + buf = qtn_lcam_note_processing_video_v2; + } +*/ +/* +//----------------------------------------------------------------------------- +// +// r_cam_processing_text_bg +// Size and position of the processing text blended background +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_processing_text_bg + { + r = 116; t = 219; W = 204; H = 21; + } +*/ + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/data/CamCapture.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/data/CamCapture.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +//**************************************************************** +// THE FOLLOWING ARE RESOURCES NEEDED BY CAMERA ONLY +//*************************************************************** + +#ifndef CAMERAAPP_PLUGIN_BUILD + +//----------------------------------------------------------------------------- +// +// r_cam_still_pre_capture_menu_primary_camera +// Switch to primary camera text +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_pre_capture_menu_primary_camera + { + buf = qtn_lcam_options_cam1; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_capture_display_on_text +// Turn icons back on +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_display_on_text + { + buf = qtn_lcam_options_display_on2; + } + + +//----------------------------------------------------------------------------- +// Advanced / novice user mode setting item texts in precapture options menu. +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_precapture_menu_adv_usermode_on_text + { + buf = qtn_lcam_options_advanced_ap_on; + } + +RESOURCE TBUF r_cam_precapture_menu_adv_usermode_off_text + { + buf = qtn_lcam_options_advanced_ap_off; + } + +#endif //CAMERAAPP_PLUGIN_BUILD + + +// ******************************************************************* +// THE FOLLOWING DEFINITIONS ARE NEEDED FOR BOTH CAMERA AND CAMPLUGIN +// ******************************************************************* + + +// Resolution icon dimensions +#define KResolutionCIFIconWidth 13 +#define KResolutionCIFIconHeight 11 +#define KResolutionQCIFIconWidth 13 +#define KResolutionQCIFIconHeight 11 +#define KResolution5MPIconWidth 19 +#define KResolution5MPIconHeight 16 +#define KResolutionSQCIFIconWidth 13 +#define KResolutionSQCIFIconHeight 11 +#define KResolutionQXGAIconWidth 19 +#define KResolutionQXGAIconHeight 16 +#define KResolutionUXGAIconWidth 19 +#define KResolutionUXGAIconHeight 16 +#define KResolutionSXGAIconWidth 27 +#define KResolutionSXGAIconHeight 12 +#define KResolutionSVGAIconWidth 24 +#define KResolutionSVGAIconHeight 14 +#define KResolutionVGAIconWidth 19 +#define KResolutionVGAIconHeight 16 +#define KResolutionBurstQXGAIconWidth 19 +#define KResolutionBurstQXGAIconHeight 16 +#define KResolutionBurstUXGAIconWidth 19 +#define KResolutionBurstUXGAIconHeight 16 +#define KResolutionBurstSXGAIconWidth 27 +#define KResolutionBurstSXGAIconHeight 12 +#define KResolutionBurstSVGAIconWidth 19 +#define KResolutionBurstSVGAIconHeight 12 +#define KResolutionBurstVGAIconWidth 19 +#define KResolutionBurstVGAIconHeight 16 +#define KResolutionVideoTVIconWidth 19 +#define KResolutionVideoTVIconHeight 11 +#define KResolutionVideoEmailIconWidth 17 +#define KResolutionVideoEmailIconHeight 11 +#define KResolutionVideoMMSIconWidth 17 +#define KResolutionVideoMMSIconHeight 11 + + +// Status indicator icon dimensions +#define KIndicatorFlashIconWidth 18 +#define KIndicatorFlashIconHeight 18 +#define KIndicatorSelfTimerIconWidth 18 +#define KIndicatorSelfTimerIconHeight 18 +#define KIndicatorBurstModeIconWidth 18 +#define KIndicatorBurstModeIconHeight 18 +#define KIndicatorStabilisationIconWidth 18 +#define KIndicatorStabilisationIconHeight 18 +#define KIndicatorVideoModeIconWidth 11 +#define KIndicatorVideoModeIconHeight 16 +#define KIndicatorSceneIconWidth 26 +#define KIndicatorSceneIconHeight 32 +#define KIndicatorCaptureTypeIconWidth 23 +#define KIndicatorCaptureTypeIconHeight 18 +#define KIndicatorShakeWarningIconWidth 18 +#define KIndicatorShakeWarningIconHeight 18 + +#define KIndicatorAudioMuteIconCCWidth 18 +#define KIndicatorAudioMuteIconCCHeight 18 +#define KIndicatorAudioMuteIconPTWidth 11 +#define KIndicatorAudioMuteIconPTHeight 13 +#define KIndicatorAudioMuteIconVMWidth 11 +#define KIndicatorAudioMuteIconVMHeight 13 + +// Temp. move unused indicators off-screen +#define KIndicatorUnusedx 500 +#define KIndicatorUnusedy 500 + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/data/CamCaptureSetup.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/data/CamCaptureSetup.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,4178 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +//#ifndef CAMERAAPP_PLUGIN_BUILD + +#define KSetupStandardFontColour 215 +#define KSetupListboxIconLeft 0 +#define KSetupListboxIconRightAH KSetupListboxIconLeft +#define KSetupListboxIconTop 2 +#define KSetupListboxIconWidth 25 +#define KSetupListboxIconHeight 20 +#define KSetupListboxRadioLeft 27 -10 +#define KSetupListboxRadioRightAH KSetupListboxRadioLeft +#define KSetupListboxRadioTop 2 +#define KSetupListboxRadioWidth 32 +#define KSetupListboxRadioHeight 20 +#define KSetupListboxTextLeft 52 - 10 +#define KSetupSceneListboxTextLeft 35 +#define KSetupListboxTextRight 0 +#define KSetupListboxTextLeftAH KSetupListboxTextRight +#define KSetupListboxTextRightAH KSetupListboxTextLeft +#define KSetupSceneListboxTextRightAH KSetupSceneListboxTextLeft +#define KSetupListboxTextBottom 16 +#define KSetupListboxTextBottomAPAC 19 +#define KSetupListboxTextWidth 170 +#define KSetupContainerTitleLeft 170 +#define KSetupContainerTitleRight 5 +#define KSetupContainerTitleBottom 30 +#define KSetupContainerTitleBottomAPAC 26 +#define KSetupContainerTitleWidth 165 +#define KSetupControlX 167 +#define KSetupControlXAH 4 +#define KSetupControlY 38 +#define KSetupViewFinderLeft 4 +#define KSetupViewFinderRightAH 8 +#define KSetupViewFinderTop 30 +#define KSetupViewFinderWidth 160 +#define KSetupViewFinderHeight 140 +#define KSetupMenuLeft 16 +#define KSetupMenuTop 30 +#define KSetupMenuTopAPAC 28 +#define KSetupMenuWidth 288 +#define KSetupMenuHeight 190 +#define KSetupMenuHeightAPAC 192 +#define KSetupMenuTextLeft 12 +#define KSetupMenuTextLeftAH 72 +#define KSetupMenuTextRight 70 +#define KSetupMenuTextRightAH 12 +#define KSetupMenuTextBottom 28 +#define KSetupMenuTextBottomAPAC 30 +#define KSetupMenuTextWidth 206 +#define KSetupMenuIconLeft 232 +#define KSetupMenuIconLeftAH 16 +#define KSetupMenuIconTop 4 +#define KSetupMenuIconWidth 56 +#define KSetupMenuIconHeight 30 +#define KSetupMenuIconTextRight 16 +#define KSetupMenuIconTextBottom 24 +#define KSetupMenuIconTextBottomAPAC 26 +#define KSetupMenuHighlightOffset 5 +#define KSetupMenuListItemHeight 32 +#define KSetupMenuSliderShaftLeft 250 +#define KSetupMenuSliderShaftLeftAH 46 +#define KSetupMenuSliderShaftTop 44 +#define KSetupMenuSliderShaftWidth 15 +#define KSetupMenuSliderShaftHeight 99 +#define KSetupMenuSliderThumbWidth 15 +#define KSetupMenuSliderThumbHeight 8 +#define KSetupMenuSliderIconLeft 220 +#define KSetupMenuSliderIconLeftAH 56 +#define KSetupMenuSliderMiddleIconTop 90 +#define KSetupMenuSliderIconWidth 20 +#define KSetupMenuSliderIconHeight 20 +#define KSetupMenuSliderLegendRight 0 +#define KSetupMenuSliderLegendWidth 180 +#define KSetupMenuSliderTopLegendBottom 50 +#define KSetupMenuSliderBottomLegendBottom 156 +#define KSetupMenuEVLegendAHOffset (-195) +#define KSetupMenuEVLegendRight 73 +#define KSetupMenuEVLegendRightAH 236 +#define KSetupMenuEVLegendWidth 48 +#define KSetupMenuEVPlus2LegendBottom 50 +#define KSetupMenuEVPlus1LegendBottom 74 +#define KSetupMenuEV0LegendBottom 98 +#define KSetupMenuEVMinus1LegendBottom 122 +#define KSetupMenuEVMinus2LegendBottom 146 + + #define KSetupListboxIconWidthLoc 0 + #define KSetupListboxRadioLeftLoc 0 + #define KSetupListboxRadioRightLocAH KSetupListboxRadioLeftLoc + #define KSetupListboxTextLeftLoc 27//=>38 with the listbox location + #define KSetupListboxTextRightLocAH KSetupListboxTextLeftLoc + #define KSetupListboxTextRightLoc 0//168//0//155 + #define KSetupListboxTextLeftLocAH KSetupListboxTextRightLoc + #define KSetupListboxTextWidthLoc 126//170//126 + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_icon_rect +// Layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capsetup_listbox_icon_rect + { + C = ELayoutEmpty; + l = KSetupListboxIconLeft; + t = KSetupListboxIconTop; + r = ELayoutEmpty; + b = ELayoutEmpty; + W = KSetupListboxIconWidth; + H = KSetupListboxIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_icon_rect_ah +// Arabic/Hebrew layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capsetup_listbox_icon_rect_ah + { + C = ELayoutEmpty; + r = KSetupListboxIconRightAH; + t = KSetupListboxIconTop; + b = ELayoutEmpty; + W = KSetupListboxIconWidth; + H = KSetupListboxIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_mode_listbox_icon_rect_ah +// Arabic/Hebrew layout rect for icons in mode setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capsetup_mode_listbox_icon_rect_ah + { + C = ELayoutEmpty; + r = KSetupListboxIconRightAH + 6; + t = KSetupListboxIconTop; + b = ELayoutEmpty; + W = KSetupListboxIconWidth; + H = KSetupListboxIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_radiobut_rect +// Layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capsetup_listbox_radiobut_rect + { + C = ELayoutEmpty; + l = KSetupListboxRadioLeft; + t = KSetupListboxRadioTop; + r = ELayoutEmpty; + b = ELayoutEmpty; + W = KSetupListboxRadioWidth; + H = KSetupListboxRadioHeight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_radiobut_rect_ah +// Arabic/Hebrew layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capsetup_listbox_radiobut_rect_ah + { + C = ELayoutEmpty; + l = ELayoutEmpty; + t = KSetupListboxRadioTop; + r = KSetupListboxRadioRightAH; + b = ELayoutEmpty; + W = KSetupListboxRadioWidth; + H = KSetupListboxRadioHeight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_text_rect +// Layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_listbox_text_rect + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupListboxTextLeft; + r=KSetupListboxTextRight; + B=KSetupListboxTextBottom; + W=KSetupListboxTextWidth; + J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_text_rect_apac +// APAC layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_listbox_text_rect_apac + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupListboxTextLeft; + r=KSetupListboxTextRight; + B=KSetupListboxTextBottomAPAC; + W=KSetupListboxTextWidth; + J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_text_rect_ah +// Arabic/Hebrew layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_listbox_text_rect_ah + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupListboxTextLeftAH; + r=KSetupListboxTextRightAH; + B=KSetupListboxTextBottom; + W=KSetupListboxTextWidth; + J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_scene_listbox_text_rect +// Layout rect for text in scene capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_scene_listbox_text_rect + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupSceneListboxTextLeft; + r=KSetupListboxTextRight; + B=KSetupListboxTextBottom; + W=KSetupListboxTextWidth; + J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_scene_listbox_text_rect_apac +// APAC layout rect for text in scene capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_scene_listbox_text_rect_apac + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupSceneListboxTextLeft; + r=KSetupListboxTextRight; + B=KSetupListboxTextBottomAPAC; + W=KSetupListboxTextWidth; + J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_scene_listbox_text_rect_ah +// Arabic/Hebrew layout rect for text in scene capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_scene_listbox_text_rect_ah + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupListboxTextLeftAH; + r=KSetupSceneListboxTextRightAH; + B=KSetupListboxTextBottom; + W=KSetupListboxTextWidth; + J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_titletext_layout_apac +// APAC layout for capture setup container title text +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_titletext_layout_apac + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + l=KSetupContainerTitleLeft; + r=KSetupContainerTitleRight; + B=KSetupContainerTitleBottomAPAC; + W=KSetupContainerTitleWidth; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_titletext_layout_ah +// Arabic/Hebrew layout for capture setup container title text +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_titletext_layout_ah + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + r=KSetupContainerTitleLeft; + l=KSetupContainerTitleRight; + B=KSetupContainerTitleBottom; + W=KSetupContainerTitleWidth; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_titletext_layout +// Layout for capture setup container title text +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_titletext_layout + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + l=KSetupContainerTitleLeft; + r=KSetupContainerTitleRight; + B=KSetupContainerTitleBottom; + W=KSetupContainerTitleWidth; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_novf_titletext_layout +// Layout for capture setup container title text (with no viewfiner) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_novf_titletext_layout + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + l=0; + r=0; + B=KSetupContainerTitleBottom; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_novf_titletext_layout_ah +// APAC Layout for capture setup container title text (with no viewfiner) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_novf_titletext_layout_ah + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + l=0; + r=0; + B=KSetupContainerTitleBottomAPAC; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_novf_titletext_layout_apac +// APAC Layout for capture setup container title text (with no viewfiner) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_novf_titletext_layout_apac + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + l=0; + r=0; + B=KSetupContainerTitleBottomAPAC; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_control_position +// Position of capture setup control when viewfinder is present +// +//---------------------------------------------------- +// +RESOURCE POINT r_cam_capture_setup_control_position + { + x = KSetupControlX; + y = KSetupControlY; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_control_position_ah +// Position of capture setup control when viewfinder is present for Arabic/Hebrew +// +//---------------------------------------------------- +// +RESOURCE POINT r_cam_capture_setup_control_position_ah + { + x = KSetupControlXAH; + y = KSetupControlY; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_contvf_rect +// Layout for capture setup container cropped viewfinder rect +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_contvf_rect + { + l = KSetupViewFinderLeft; + t = KSetupViewFinderTop; + W = KSetupViewFinderWidth; + H = KSetupViewFinderHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_contvf_rect_ah +// Arabic/Hebrew layout for capture setup container cropped viewfinder rect +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_contvf_rect_ah + { + r = KSetupViewFinderLeft; + t = KSetupViewFinderTop; + W = KSetupViewFinderWidth; + H = KSetupViewFinderHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_photo_imagesharpness +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_photo_imagesharpness + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_hard; + setting_value_id = ECamImageSharpnessHard; + bitmap_id = EMbmCameraappQgn_indi_cam4_sharpness_hard; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_normal; + setting_value_id = ECamImageSharpnessNorm; + bitmap_id = EMbmCameraappQgn_indi_cam4_sharpness_normal; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_soft; + setting_value_id = ECamImageSharpnessSoft; + bitmap_id = EMbmCameraappQgn_indi_cam4_sharpness_soft; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_still_whitebalance +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_still_whitebalance + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_awb; + setting_value_id = ECamWhiteBalanceAWB; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_auto; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_day; + setting_value_id = ECamWhiteBalanceDaylight; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_sunny; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_cloud; + setting_value_id = ECamWhiteBalanceCloudy; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_cloudy; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_tung; + setting_value_id = ECamWhiteBalanceTungsten; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_tungsten; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_flu; + setting_value_id = ECamWhiteBalanceFlourescent; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_fluorecent; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_still_coloureffect +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_still_coloureffect + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_col; + setting_value_id = ECamColourFilterColour; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_normal; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_sep; + setting_value_id = ECamColourFilterSepia; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_sepia; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_bw; + setting_value_id = ECamColourFilterBlackAndWhite; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_bw; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_viv; + setting_value_id = ECamColourFilterVivid; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_vivid; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_neg; + setting_value_id = ECamColourFilterNegative; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_negative; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_still_flash +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_still_flash + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_auto; + setting_value_id = ECamFlashAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_autoflash; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_redeye; + setting_value_id = ECamFlashAntiRedEye; + bitmap_id = EMbmCameraappQgn_indi_cam4_antired; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_force; + setting_value_id = ECamFlashForced; + bitmap_id = EMbmCameraappQgn_indi_cam4_flash_on; + }, + CAPTURE_SETUP_LIST_ITEM + { + // item_text = qtn_lcam_set_off; + item_text = qtn_lcam_set_flash_off; + setting_value_id = ECamFlashOff; + bitmap_id = EMbmCameraappQgn_indi_cam4_flash_off; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_still_light_sensitivity +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_still_light_sensitivity + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isoauto; + setting_value_id = ECamLightSensitivityAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isolow; + setting_value_id = ECamLightSensitivityLow; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isomedium; + setting_value_id = ECamLightSensitivityMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isohigh; + setting_value_id = ECamLightSensitivityHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_still_extended_light_sensitivity +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_still_extended_light_sensitivity + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isoauto; + setting_value_id = ECamLightSensitivityAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isolow; + setting_value_id = ECamLightSensitivityLow; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_low_medium; + setting_value_id = ECamLightSensitivityLowMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isomedium; + setting_value_id = ECamLightSensitivityMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_medium_high; + setting_value_id = ECamLightSensitivityMedHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medhigh; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isohigh; + setting_value_id = ECamLightSensitivityHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_video_whitebalance +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_video_whitebalance + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_awb; + setting_value_id = ECamWhiteBalanceAWB; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_auto; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_day; + setting_value_id = ECamWhiteBalanceDaylight; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_sunny; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_cloud; + setting_value_id = ECamWhiteBalanceCloudy; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_cloudy; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_tung; + setting_value_id = ECamWhiteBalanceTungsten; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_tungsten; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_flu; + setting_value_id = ECamWhiteBalanceFlourescent; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_fluorecent; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_video_coloureffect +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_video_coloureffect + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_col; + setting_value_id = ECamColourFilterColour; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_normal; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_sep; + setting_value_id = ECamColourFilterSepia; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_sepia; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_bw; + setting_value_id = ECamColourFilterBlackAndWhite; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_bw; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_viv; + setting_value_id = ECamColourFilterVivid; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_vivid; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_neg; + setting_value_id = ECamColourFilterNegative; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_negative; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_listbox_width +// Width of capture set-up list-box +// +//---------------------------------------------------- +// +RESOURCE INT16 r_cam_capture_setup_listbox_width + { + value = 151; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_listbox_width_novf +// Width of capture set-up list-box with no viewfinder +// +//---------------------------------------------------- +// +RESOURCE INT16 r_cam_capture_setup_listbox_width_novf + { + value = 180; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_listbox_item_height +// Width of capture set-up list-box +// +//---------------------------------------------------- +// +RESOURCE INT16 r_cam_capture_setup_listbox_item_height + { + value = 26; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_data +// Lists all the contents and layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_photo_data + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTop; + W = KSetupMenuWidth; + H = KSetupMenuHeight; + }; + + contents = + { + + }; + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeft; + r=KSetupMenuTextRight; + B=KSetupMenuTextBottom; + W=KSetupMenuTextWidth; + J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeft; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeft; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottom; + W=KSetupMenuIconWidth; + J=ELayoutAlignRight; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_data_apac +// Lists all the contents and APAC layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_photo_data_apac + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTopAPAC; + W = KSetupMenuWidth; + H = KSetupMenuHeightAPAC; + }; + + contents = + { + + }; + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeft; + r=KSetupMenuTextRight; + B=KSetupMenuTextBottomAPAC; + W=KSetupMenuTextWidth; + J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeft; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeft; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottomAPAC; + W=KSetupMenuIconWidth; + J=ELayoutAlignRight; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_data_ah +// Lists all the contents and Arabic/Hebrew layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_photo_data_ah + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTop; + W = KSetupMenuWidth; + H = KSetupMenuHeight; + }; + + contents = + { + + }; + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeftAH; + r=KSetupMenuTextRightAH; + B=KSetupMenuTextBottom; + W=KSetupMenuTextWidth; + J=ELayoutAlignRight; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeftAH; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeftAH; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottom; + W=KSetupMenuIconWidth; + J=ELayoutAlignLeft; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_scene_array +// Mapping of photo scene setting values +// to actual bitmaps. These must match the order of +// TCamSceneId in CamSettings.hrh +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_scene_array + { + id = ECamSettingItemDynamicPhotoScene; + text = qtn_lcam_tt_scene; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneNight; + bitmap = EMbmCameraappQgn_indi_cam4_mode_night; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_night_s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneMacro; + bitmap = EMbmCameraappQgn_indi_cam4_mode_closeup; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_macro_s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamScenePortrait; + bitmap = EMbmCameraappQgn_indi_cam4_mode_portrait; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_port_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneAuto; + bitmap = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneScenery; + bitmap = EMbmCameraappQgn_indi_cam4_mode_landscape; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_land_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneSports; + bitmap = EMbmCameraappQgn_indi_cam4_mode_sport; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_sport_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + // Normal is video auto scene. + // Therefore "Auto" icon. + id = ECamSceneNormal; + bitmap = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_norm_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneUser; + bitmap = EMbmCameraappQgn_indi_cam4_mode_userscene; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_user_s; + }, + + /* CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneNightScenery; + bitmap = EMbmCameraappQgn_indi_lcam_ap_sce_nightland; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_nightland_s; + }, */ + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneNightPortrait; + bitmap = EMbmCameraappQgn_indi_cam4_mode_portrait_night; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_nightport_s; + /* }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneCandlelight; + bitmap = EMbmCameraappQgn_indi_lcam_ap_sce_candle; + */ //bitmap = EMbmCameraappQgn_ico_lcam_sce_candle_s; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_flash_array +// Mapping of photo scene setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_flash_array + { + id = ECamSettingItemDynamicPhotoFlash; + text = qtn_lcam_tt_flash; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashAuto; + bitmap = EMbmCameraappQgn_indi_cam4_autoflash; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashForced; + bitmap = EMbmCameraappQgn_indi_cam4_flash_on; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashAntiRedEye; + bitmap = EMbmCameraappQgn_indi_cam4_antired; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashOff; + bitmap = EMbmCameraappQgn_indi_cam4_flash_off; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_flash_array +// Mapping of video flash setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_flash_array + { + id = ECamSettingItemDynamicVideoFlash; + text = qtn_lcam_tt_flashoff; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashForced; + bitmap = EMbmCameraappQgn_indi_vid4_light_on; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashOff; + bitmap = EMbmCameraappQgn_indi_vid4_light_off; + } + }; + } + +// --------------------------------------------------------- +// r_cam_active_palette_video_flash_tooltip_array +// +// Array for video flash active palette item tooltips. +// --------------------------------------------------------- +// +RESOURCE ARRAY r_cam_active_palette_video_flash_tooltip_array + { + items = + { + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_videoflash; + }, + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_flashoff; } + }; + } + + +//---------------------------------------------------- +// +// r_cam_active_palette_precapture_facetracking_array +// Mapping of facetracking setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_precapture_facetracking_array + { + id = ECamSettingItemFaceTracking; + text = qtn_lcam_tt_facedet_off_v2; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSettOn; + bitmap = EMbmCameraappQgn_indi_cam4_tb_facedet; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSettOff; + bitmap = EMbmCameraappQgn_indi_cam4_tb_facedet_off; + } + }; + } + +// --------------------------------------------------------- +// r_cam_active_palette_facetracking_tooltip_array +// +// Array for facetracking active palette item tooltips. +// --------------------------------------------------------- +// +RESOURCE ARRAY r_cam_active_palette_facetracking_tooltip_array + { + items = + { + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_facedet_on_v2; + }, + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_facedet_off_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_white_balance_array +// Mapping of white balance setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_white_balance_array + { + id = ECamSettingItemDynamicPhotoWhiteBalance; + text = qtn_lcam_tt_wb; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceAWB; + bitmap = EMbmCameraappQgn_indi_cam4_wb_auto; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceDaylight; + bitmap = EMbmCameraappQgn_indi_cam4_wb_sunny; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceCloudy; + bitmap = EMbmCameraappQgn_indi_cam4_wb_cloudy; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceTungsten; + bitmap = EMbmCameraappQgn_indi_cam4_wb_tungsten; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceFlourescent; + bitmap = EMbmCameraappQgn_indi_cam4_wb_fluorecent; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_exposure_array +// Mapping of exposure setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_exposure_array + { + id = ECamSettingItemDynamicPhotoExposure; + text = qtn_lcam_tt_ev; + capture_setup_menu_item = + { +/* CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -6; + icontext = qtn_lcam_ev_minus2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus2; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -5; + icontext = qtn_lcam_ev_minus1_7; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus1_7; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -4; + icontext = qtn_lcam_ev_minus1_3; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus1_3; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -3; + icontext = qtn_lcam_ev_minus1; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus1; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -2; + icontext = qtn_lcam_ev_minus0_7; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus0_7; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -1; + icontext = qtn_lcam_ev_minus0_3; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus0_3; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + icontext = qtn_lcam_ev_0; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_0; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 1; + icontext = qtn_lcam_ev_plus0_3; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus0_3; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 2; + icontext = qtn_lcam_ev_plus0_7; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus0_7; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 3; + icontext = qtn_lcam_ev_plus1; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus1; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 4; + icontext = qtn_lcam_ev_plus1_3; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus1_3; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 5; + icontext = qtn_lcam_ev_plus1_7; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus1_7; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 6; + icontext = qtn_lcam_ev_plus2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus2; + } + */ }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_exposure_array2 +// Mapping of exposure setting values +// to actual bitmaps. (range -2.0 to 2.0 steps of 1/2) +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_exposure_array2 + { + id = ECamSettingItemDynamicPhotoExposure; + text = qtn_lcam_tt_ev; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -4; + icontext = qtn_lcam_ev_minus2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_minus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -3; + icontext = qtn_lcam_ev_minus1_5; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_minus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -2; + icontext = qtn_lcam_ev_minus1; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_minus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -1; + icontext = qtn_lcam_ev_minus0_5; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_minus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + icontext = qtn_lcam_ev_0; + bitmap = EMbmCameraappQgn_indi_cam4_exposure; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 1; + icontext = qtn_lcam_ev_plus0_5; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_plus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 2; + icontext = qtn_lcam_ev_plus1; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_plus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 3; + icontext = qtn_lcam_ev_plus1_5; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_plus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 4; + icontext = qtn_lcam_ev_plus2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_plus; + } + }; + } + + //---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_exposure_array3 +// Mapping of exposure setting values +// to actual bitmaps. range -2.0 to 2.0 steps of 1) +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_exposure_array3 + { + id = ECamSettingItemDynamicPhotoExposure; + text = qtn_lcam_tt_ev; + capture_setup_menu_item = + { + /* CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -2; + icontext = qtn_lcam_ev_minus2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus2; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -1; + icontext = qtn_lcam_ev_minus1; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus1; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + icontext = qtn_lcam_ev_0; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_0; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 1; + icontext = qtn_lcam_ev_plus1; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus1; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 2; + icontext = qtn_lcam_ev_plus2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus2; + } */ + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_colourfilter_array +// Mapping of photo colour filter setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_colourfilter_array + { + id = ECamSettingItemDynamicPhotoColourFilter; + text = qtn_lcam_tt_coltone; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterColour; + bitmap = EMbmCameraappQgn_indi_cam4_colour_normal; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterBlackAndWhite; + bitmap = EMbmCameraappQgn_indi_cam4_colour_bw; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterSepia; + bitmap = EMbmCameraappQgn_indi_cam4_colour_sepia; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterNegative; + bitmap = EMbmCameraappQgn_indi_cam4_colour_negative; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterVivid; + bitmap = EMbmCameraappQgn_indi_cam4_colour_vivid; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_imagesharpness_array +// Mapping of photo image sharpness setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_imagesharpness_array + { + id = ECamSettingItemDynamicPhotoImageSharpness; + text = qtn_lcam_tt_sharp; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamImageSharpnessHard; + bitmap = EMbmCameraappQgn_indi_cam4_sharpness_hard; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamImageSharpnessNorm; + bitmap = EMbmCameraappQgn_indi_cam4_sharpness_normal; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamImageSharpnessSoft; + bitmap = EMbmCameraappQgn_indi_cam4_sharpness_soft; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_brightness_array +// Mapping of photo brightness setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_brightness_array + { + id = ECamSettingItemDynamicPhotoBrightness; + text = qtn_lcam_tt_bright; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessNorm; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_brightnorm; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessPlus; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_brightplus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessNeg; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_brightneg; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_contrast_array +// Mapping of photo contrast setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_contrast_array + { + id = ECamSettingItemDynamicPhotoContrast; + text = qtn_lcam_tt_contr; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastNorm; + bitmap = EMbmCameraappQgn_indi_cam4_contrast; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastPlus; + bitmap = EMbmCameraappQgn_indi_cam4_contrast_plus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastNeg; + bitmap = EMbmCameraappQgn_indi_cam4_contrast_minus; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_coloursaturation_array +// Mapping of photo colour saturation setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_coloursaturation_array + { + id = ECamSettingItemDynamicPhotoColourSaturation; + text = qtn_lcam_popm_colsat; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationNorm; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatnorm; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationPlus; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatplus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationNeg; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatneg; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_light_sensitivity_array +// Mapping of photo scene setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_light_sensitivity_array + { + id = ECamSettingItemDynamicPhotoLightSensitivity; + text = qtn_lcam_tt_isosetting; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationNorm; + bitmap = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityLow; + bitmap = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityMed; + bitmap = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityHigh; + bitmap = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_data +// Lists all the contents and layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_video_data + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTop; + W = KSetupMenuWidth; + H = KSetupMenuHeight; + }; + + contents = + { + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_scene_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_white_balance_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_colourfilter_array; + } +#if 0 + , + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_brightness_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_contrast_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_coloursaturation_array; + } +#endif + }; + + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeft; + r=KSetupMenuTextRight; + B=KSetupMenuTextBottom; + W=KSetupMenuTextWidth; + J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeft; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeft; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottom; + W=KSetupMenuIconWidth; + J=ELayoutAlignRight; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_data_apac +// Lists all the contents and APAC layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_video_data_apac + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTopAPAC; + W = KSetupMenuWidth; + H = KSetupMenuHeightAPAC; + }; + + contents = + { + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_scene_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_white_balance_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_colourfilter_array; + } +#if 0 + , + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_brightness_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_contrast_array; + } +#endif + }; + + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeft; + r=KSetupMenuTextRight; + B=KSetupMenuTextBottomAPAC; + W=KSetupMenuTextWidth; + J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeft; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeft; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottomAPAC; + W=KSetupMenuIconWidth; + J=ELayoutAlignRight; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_data_ah +// Lists all the contents and Arabic/Hebrew layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_video_data_ah + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTop; + W = KSetupMenuWidth; + H = KSetupMenuHeight; + }; + + contents = + { + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_scene_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_white_balance_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_colourfilter_array; + } +#if 0 + , + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_brightness_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_contrast_array; + } +#endif + }; + + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeftAH; + r=KSetupMenuTextRightAH; + B=KSetupMenuTextBottom; + W=KSetupMenuTextWidth; + J=ELayoutAlignRight; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeftAH; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeftAH; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottom; + W=KSetupMenuIconWidth; + J=ELayoutAlignLeft; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_scene_array +// Mapping of photo scene setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_scene_array + { + id = ECamSettingItemDynamicVideoScene; + text = qtn_lcam_tt_scene; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneNight; + bitmap = EMbmCameraappQgn_indi_cam4_mode_night; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_night_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneMacro; + bitmap = EMbmCameraappQgn_indi_cam4_mode_closeup; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_macro_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamScenePortrait; + bitmap = EMbmCameraappQgn_indi_cam4_mode_portrait; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_port_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneAuto; + bitmap = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneScenery; + bitmap = EMbmCameraappQgn_indi_cam4_mode_landscape; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_land_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneSports; + bitmap = EMbmCameraappQgn_indi_cam4_mode_sport; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_sport_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + // Normal is video auto scene. + // Therefore "Auto" icon. + id = ECamSceneNormal; + bitmap = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneUser; + bitmap = EMbmCameraappQgn_indi_cam4_mode_userscene; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_user_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneLowLight; + bitmap = EMbmCameraappQgn_indi_cam4_wb_tungsten; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_user_s; + } + + }; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_white_balance_array +// Mapping of white balance setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_white_balance_array + { + id = ECamSettingItemDynamicVideoWhiteBalance; + text = qtn_lcam_tt_wb; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceAWB; + bitmap = EMbmCameraappQgn_indi_cam4_wb_auto; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceDaylight; + bitmap = EMbmCameraappQgn_indi_cam4_wb_sunny; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceCloudy; + bitmap = EMbmCameraappQgn_indi_cam4_wb_cloudy; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceTungsten; + bitmap = EMbmCameraappQgn_indi_cam4_wb_tungsten; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceFlourescent; + bitmap = EMbmCameraappQgn_indi_cam4_wb_fluorecent; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_colourfilter_array +// Mapping of video colour filter setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_colourfilter_array + { + id = ECamSettingItemDynamicVideoColourFilter; + text = qtn_lcam_tt_coltone; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterColour; + bitmap = EMbmCameraappQgn_indi_cam4_colour_normal; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterBlackAndWhite; + bitmap = EMbmCameraappQgn_indi_cam4_colour_bw; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterSepia; + bitmap = EMbmCameraappQgn_indi_cam4_colour_sepia; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterNegative; + bitmap = EMbmCameraappQgn_indi_cam4_colour_negative; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterVivid; + bitmap = EMbmCameraappQgn_indi_cam4_colour_vivid; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_brightness_array +// Mapping of video brightness setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_brightness_array + { + id = ECamSettingItemDynamicVideoBrightness; + text = qtn_lcam_tt_bright; + capture_setup_menu_item = + { + /* CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessNorm; + bitmap = EMbmCameraappQgn_indi_lcam_ap_brightnorm; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessPlus; + bitmap = EMbmCameraappQgn_indi_lcam_ap_brightplus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessNeg; + bitmap = EMbmCameraappQgn_indi_lcam_ap_brightneg; + } */ + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_contrast_array +// Mapping of video contrast setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_contrast_array + { + id = ECamSettingItemDynamicVideoContrast; + text = qtn_lcam_popm_contrast; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastNorm; + bitmap = EMbmCameraappQgn_indi_cam4_contrast; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastPlus; + bitmap = EMbmCameraappQgn_indi_cam4_contrast_plus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastNeg; + bitmap = EMbmCameraappQgn_indi_cam4_contrast_minus; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_coloursaturation_array +// Mapping of photo brightness setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_coloursaturation_array + { + id = ECamSettingItemDynamicVideoColourSaturation; + text = qtn_lcam_popm_colsat; + capture_setup_menu_item = + { + /* CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationNorm; + bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatnorm; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationPlus; + bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatplus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationNeg; + bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatneg; + } */ + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_brightness_array +// Location and string data for the brightness +// slider legend text +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_brightness_array + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderTopLegendBottom; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_plus; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderBottomLegendBottom - 10; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_minus; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = KSetupMenuSliderIconLeft - 7; + t = KSetupMenuSliderMiddleIconTop - 7; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + // bitmap_id = EMbmCameraappQgn_indi_lcam_ap_brightnorm; + // mask_id = EMbmCameraappQgn_indi_lcam_ap_brightnorm_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_brightness_array_ah +// Location and string data for the brightness +// slider legend text (Arabic\Hebrew Layout) +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_brightness_array_ah + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeftAH; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderTopLegendBottom; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_plus; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeftAH; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderBottomLegendBottom; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_minus; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = KSetupMenuSliderIconLeftAH; + t = KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_ap_brightnorm; +// mask_id = EMbmCameraappQgn_indi_lcam_ap_brightnorm_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_coloursaturation_array +// Location and string data for the colour saturation +// slider legend text +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_coloursaturation_array + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT { font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=268; r=44; B=65; W=8; J=ELayoutAlignLeft; }; + text = qtn_lcam_set_plus; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT { font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=268; r=44; B=255; W=8; J=ELayoutAlignLeft; }; + text = qtn_lcam_set_minus; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 243; t = 138; W = 30; H = 30; }; + // bitmap_id = EMbmCameraappQgn_indi_lcam_ap_colsatnorm; + // mask_id = EMbmCameraappQgn_indi_lcam_ap_colsatnorm_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_contrast_array +// Location and string data for the contrast +// slider legend text +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_contrast_array + { + items = + { + CAM_SLIDER_CONTRAST_LEGEND_ITEM + { + item = ECamSliderLegendItemText; + text = qtn_lcam_set_plus; + }, + CAM_SLIDER_CONTRAST_LEGEND_ITEM + { + item = ECamSliderLegendItemText; + text = qtn_lcam_set_minus; + }, + CAM_SLIDER_CONTRAST_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + bitmap_id = EMbmCameraappQgn_indi_cam4_contrast; + mask_id = EMbmCameraappQgn_indi_cam4_contrast_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_contrast_array_ah +// Location and string data for the contrast +// slider legend text (Arabic\Hebrew Layout) +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_contrast_array_ah + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeftAH; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderTopLegendBottom; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_plus; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeftAH; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderBottomLegendBottom; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_minus; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = KSetupMenuSliderIconLeftAH; + t = KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_contrast; + mask_id = EMbmCameraappQgn_indi_cam4_contrast_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_light_sensitivity_array +// Location and string data for the light sensitivity +// slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_light_sensitivity_array + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=245; //KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderTopLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isohigh; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=245; //KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=85; //KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isomedium; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=245; //KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=120; //KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isolow; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=245; //KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isoauto; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = 190; //KSetupMenuSliderIconLeft; + t = 40; // KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + mask_id = EMbmCameraappQgn_indi_cam4_iso_high_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = 190;//240; //KSetupMenuSliderIconLeft; + t = 70; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + mask_id = EMbmCameraappQgn_indi_cam4_iso_medium_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = 190; //KSetupMenuSliderIconLeft; + t = 95; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + mask_id = EMbmCameraappQgn_indi_cam4_iso_low_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = 190;//240; //KSetupMenuSliderIconLeft; + t = 128; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + mask_id = EMbmCameraappQgn_indi_cam4_iso_auto_mask; + } + + + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_light_sensitivity_array_ah +// Location and string data for the light sensitivity +// slider legend text (for Arabic/Hebrew variant) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_light_sensitivity_array_ah + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + r=245; //KSetupMenuSliderIconLeft; + l=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderTopLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isohigh; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + r=245; //KSetupMenuSliderIconLeft; + l=KSetupMenuSliderLegendRight; + B=85; //KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isomedium; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + r=245; //KSetupMenuSliderIconLeft; + l=KSetupMenuSliderLegendRight; + B=120; //KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isolow; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + r=245; //KSetupMenuSliderIconLeft; + l=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isoauto; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + r = 190; //KSetupMenuSliderIconLeft; + t = 40; // KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + mask_id = EMbmCameraappQgn_indi_cam4_iso_high_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + r = 190;//240; //KSetupMenuSliderIconLeft; + t = 70; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + mask_id = EMbmCameraappQgn_indi_cam4_iso_medium_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + r = 190; //KSetupMenuSliderIconLeft; + t = 95; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + mask_id = EMbmCameraappQgn_indi_cam4_iso_low_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + r = 190;//240; //KSetupMenuSliderIconLeft; + t = 128; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + mask_id = EMbmCameraappQgn_indi_cam4_iso_auto_mask; + } + + + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_control_position +// Position of capture setup slider control when viewfinder is present +// +//---------------------------------------------------- +// +RESOURCE POINT r_cam_capture_setup_slider_control_position + { + x = KSetupControlX; + y = KSetupControlY; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_control_position_ah +// Position of capture setup slider control when viewfinder is present +// for Arabic/Hebrew layouts +// +//---------------------------------------------------- +// +RESOURCE POINT r_cam_capture_setup_slider_control_position_ah + { + x = KSetupControlXAH; + y = KSetupControlY; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_bright_contrast_contvf_rect +// Layout for capture setup container cropped viewfinder +// rect displayed with slider controls +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_contvf_rect + { + l = KSetupViewFinderLeft; + t = KSetupViewFinderTop; + W = KSetupViewFinderWidth; + H = KSetupViewFinderHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_bright_contrast_contvf_rect_ah +// Arabic/Hebrew layout for capture setup container +// cropped viewfinder rect displayed with slider controls +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_contvf_rect_ah + { + r = KSetupViewFinderLeft; + t = KSetupViewFinderTop; + W = KSetupViewFinderWidth; + H = KSetupViewFinderHeight; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array +// Location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array2 + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2; + }, + CAM_SLIDER_EV_ITEM // +1.7 + { + text = qtn_lcam_ev_plus1_7; + }, + CAM_SLIDER_EV_ITEM // +1.3 + { + text = qtn_lcam_ev_plus1_3; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1; + }, + CAM_SLIDER_EV_ITEM // +0.7 + { + text = qtn_lcam_ev_plus0_7; + }, + CAM_SLIDER_EV_ITEM // +0.3 + { + text = qtn_lcam_ev_plus0_3; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0; + }, + CAM_SLIDER_EV_ITEM // -0.3 + { + text = qtn_lcam_ev_minus0_3; + }, + CAM_SLIDER_EV_ITEM // -0.7 + { + text = qtn_lcam_ev_minus0_7; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1; + }, + CAM_SLIDER_EV_ITEM // -1.3 + { + text = qtn_lcam_ev_minus1_3; + }, + CAM_SLIDER_EV_ITEM // -1.7 + { + text = qtn_lcam_ev_minus1_7; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array2 +// Location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2; + }, + CAM_SLIDER_EV_ITEM // +1.5 + { + text = qtn_lcam_ev_plus1_5; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1; + }, + CAM_SLIDER_EV_ITEM // +0.5 + { + text = qtn_lcam_ev_plus0_5; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0; + }, + CAM_SLIDER_EV_ITEM // -0.5 + { + text = qtn_lcam_ev_minus0_5; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1; + }, + CAM_SLIDER_EV_ITEM // -1.5 + { + text = qtn_lcam_ev_minus1_5; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array3 +// Location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array3 + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2; + }, + CAM_SLIDER_EV_ITEM // +1.5 + { + text = qtn_lcam_ev_plus1_5; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1; + }, + CAM_SLIDER_EV_ITEM // +0.5 + { + text = qtn_lcam_ev_plus0_5; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0; + }, + CAM_SLIDER_EV_ITEM // -0.5 + { + text = qtn_lcam_ev_minus0_5; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1; + }, + CAM_SLIDER_EV_ITEM // -1.5 + { + text = qtn_lcam_ev_minus1_5; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array_ah +// Arabic/Hebrew location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array_ah + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2; + }, + CAM_SLIDER_EV_ITEM // +1.7 + { + text = qtn_lcam_ev_plus1_7; + }, + CAM_SLIDER_EV_ITEM // +1.3 + { + text = qtn_lcam_ev_plus1_3; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1; + }, + CAM_SLIDER_EV_ITEM // +0.7 + { + text = qtn_lcam_ev_plus0_7; + }, + CAM_SLIDER_EV_ITEM // +0.3 + { + text = qtn_lcam_ev_plus0_3; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0; + }, + CAM_SLIDER_EV_ITEM // -0.3 + { + text = qtn_lcam_ev_minus0_3; + }, + CAM_SLIDER_EV_ITEM // -0.7 + { + text = qtn_lcam_ev_minus0_7; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1; + }, + CAM_SLIDER_EV_ITEM // -1.3 + { + text = qtn_lcam_ev_minus1_3; + }, + CAM_SLIDER_EV_ITEM // -1.7 + { + text = qtn_lcam_ev_minus1_7; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array2_ah +// Arabic/Hebrew location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array2_ah + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2; + }, + CAM_SLIDER_EV_ITEM // +1.5 + { + text = qtn_lcam_ev_plus1_5; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1; + }, + CAM_SLIDER_EV_ITEM // +0.5 + { + text = qtn_lcam_ev_plus0_5; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0; + }, + CAM_SLIDER_EV_ITEM // -0.5 + { + text = qtn_lcam_ev_minus0_5; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1; + }, + CAM_SLIDER_EV_ITEM // -1.5 + { + text = qtn_lcam_ev_minus1_5; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array3_ah +// Arabic/Hebrew location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array3_ah + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2; + }, + CAM_SLIDER_EV_ITEM // +1.5 + { + text = qtn_lcam_ev_plus1_5; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1; + }, + CAM_SLIDER_EV_ITEM // +0.5 + { + text = qtn_lcam_ev_plus0_5; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0; + }, + CAM_SLIDER_EV_ITEM // -0.5 + { + text = qtn_lcam_ev_minus0_5; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1; + }, + CAM_SLIDER_EV_ITEM // -1.5 + { + text = qtn_lcam_ev_minus1_5; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_shaft +// Location for the capture setup control slider shaft +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_shaft + { + l = KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderShaftWidth; + H = KSetupMenuSliderShaftHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_shaft_ah +// Location for the capture setup control slider shaft +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_shaft_ah + { + r = KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderShaftWidth; + H = KSetupMenuSliderShaftHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_thumb +// Location for the capture setup control slider thumb +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_thumb + { + l = 200; //KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderThumbWidth; + H = KSetupMenuSliderThumbHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_thumb_ah +// Location for the capture setup control slider thumb (Arabic/Hebrew layout) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_thumb_ah + { + r = 200; //KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderThumbWidth; + H = KSetupMenuSliderThumbHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_iso_slider_shaft +// Location for the capture setup control slider shaft +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_iso_slider_shaft + { + l = 220; //KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderShaftWidth; + H = KSetupMenuSliderShaftHeight; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_iso_slider_thumb +// Location for the capture setup control slider thumb +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_iso_slider_thumb + { + l = 220; //KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderThumbWidth; + H = KSetupMenuSliderThumbHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_whitebalance +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_whitebalance + { + buf = qtn_lcam_title_subm_wb; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_coloureffect +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_coloureffect + { + buf = qtn_lcam_title_subm_ceff; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_ev +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_ev + { + buf = qtn_lcam_title_subm_ev; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_flash +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_flash + { + buf = qtn_lcam_title_subm_flash; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_brightness +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_brightness + { + buf = qtn_lcam_title_subm_bright; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_light_sensitivity +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_light_sensitivity + { + buf = qtn_lcam_title_subm_iso; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_contrast +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_contrast + { + buf = qtn_lcam_title_subm_contr; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_imagesharpness +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_imagesharpness + { + buf = qtn_lcam_title_subm_sharp; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_coloursaturation +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_coloursaturation + { + buf = qtn_lcam_title_subm_colsat; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_video +// Title name used in video capture setup views +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_capture_setup_title_video + { + txt = qtn_lcam_title_text_vidsetup; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_photo +// Title name used in still capture setup views +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_capture_setup_title_still + { + txt = qtn_lcam_title_text_photsetup; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_second_camera_photo_data +// Lists all the contents and layout data for the photo +// capture setup menu for the secondary camera +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_second_camera_photo_data + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = 16; t = 150; W = 320; H = 130; + }; + + contents = + { + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_photo_scene_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_photo_brightness_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_photo_contrast_array; + } + + }; + + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=5; r=30; B=26; W=115; J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = 268; t = 3; W = 32; H = 20; + }; + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=286; r=16; B=24; W=80; J=ELayoutAlignRight; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = 3; + + // The height for a list item + list_item_height = 41; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_second_camera_video_data +// Lists all the contents and layout data for the video +// capture setup menu for the secondary camera +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_second_camera_video_data + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = 16; t = 150; W = 320; H = 130; + }; + + contents = + { + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_scene_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_brightness_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_contrast_array; + } + + }; + + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=5; r=30; B=26; W=115; J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = 268; t = 3; W = 32; H = 20; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=286; r=16; B=24; W=80; J=ELayoutAlignLeft; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = 3; + + // The height for a list item + list_item_height = 41; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_precapture_sequence_mode_array +// +// Lists the Ids, tooltip text and bitmaps used by the +// image precapture sequence mode active palette item. +// +//----------------------------------------------------- + +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_precapture_sequence_mode_array + { + id = ECamSettingItemSequenceMode; + text = qtn_lcam_tt_sequence; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapseOff; + bitmap = EMbmCameraappQgn_indi_cam4_sequence; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapseMin; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_burst; + }/*, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse5sec; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_5s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse10sec; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_10s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse30sec; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_30s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse1min; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_1min; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse5min; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_5min; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse10min; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_10min; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse30min; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_30min; + }*/ + }; + } + +RESOURCE ARRAY r_cam_active_palette_precapture_sequence_mode_tooltip_array + { + items = + { + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_sequence; + }, + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_normal; + } + }; + } + +RESOURCE ARRAY r_cam_active_palette_precapture_advanced_sequence_mode_tooltip_array + { + items = + { + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_sequence; + }, + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_normal; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_image_precapture_mode_select +// +// Lists the Ids, tooltip text and bitmaps used by the +// image precapture mode select active palette item. +// +//----------------------------------------------------- + +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_precapture_video_mode_select + { + id = ECamSettingItemVideoModeSelect; + text = qtn_lcam_tt_switch_video; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_mode_switch_c; + bitmap = EMbmCameraappQgn_indi_vid4_video; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_precapture_image_switch_camera +// +// Lists the Ids, tooltip text and bitmaps used by the +// switch camera active palette item. +// +//----------------------------------------------------- + +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_precapture_switch_camera + { + id = ECamSettingItemSwitchCamera; + text = qtn_lcam_tt_camera_main; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + bitmap = EMbmCameraappQgn_indi_tb_cam4_goto_main; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_video_precapture_mode_select +// +// Lists the Ids, tooltip text and bitmaps used by the +// video precapture mode select active palette item. +// +//----------------------------------------------------- + +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_precapture_image_mode_select + { + id = ECamSettingItemImageModeSelect; + text = qtn_lcam_tt_switch_image; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_mode_switch_v; + bitmap = EMbmCameraappQgn_indi_cam4_camera; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_self_timer +// Array of list items for self timer radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_self_timer + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + // item_text = qtn_lcam_set_off; + item_text = qtn_lcam_st_off; + setting_value_id = ECamSelfTimerOff; + bitmap_id = EMbmCameraappQgn_indi_cam4_selftimer_off; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_st_2; + setting_value_id = ECamSelfTimer2; + bitmap_id = EMbmCameraappQgn_indi_cam4_selftimer_2sec; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_st_10; + setting_value_id = ECamSelfTimer10; + bitmap_id = EMbmCameraappQgn_indi_cam4_selftimer_10s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_st_20; + setting_value_id = ECamSelfTimer20; + bitmap_id = EMbmCameraappQgn_indi_cam4_selftimer_20s; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_self_timer +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_self_timer + { + buf = qtn_lcam_title_selftimer; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_self_timer_select +// +// Lists the Ids, tooltip text and bitmaps used by the +// precapture mode select active palette item. +// +//----------------------------------------------------- +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_self_timer_select + { + id = ECamSettingItemDynamicSelfTimer; + text = qtn_lcam_tt_st; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSelfTimerOff; + bitmap = EMbmCameraappQgn_indi_cam4_selftimer_off; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSelfTimer2; + bitmap = EMbmCameraappQgn_indi_cam4_selftimer_2sec; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSelfTimer10; + bitmap = EMbmCameraappQgn_indi_cam4_selftimer_10s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSelfTimer20; + bitmap = EMbmCameraappQgn_indi_cam4_selftimer_20s; + } + }; + } + +// --------------------------------------------------------------------------- +// Go to photos toolbar AP item data (tooltip, icons) +// --------------------------------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_goto_photos_set_array + { + id = ECamSettingItemGotoPhotos; + text = qtn_lcam_tt_go_to_photos; + capture_setup_menu_item = + { + // For item of type ECamActivePaletteItemTypeCommand, there's only one icon. + // Command id defined in CAM_DYNAMIC_ACTIVE_PALETTE_ITEM or + // CAM_ACTIVE_PALETTE_ITEM resource for this item is used to identify the icon. + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamCmdPhotos; + bitmap = EMbmCameraappQgn_indi_cam4_goto_gallery; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_light_sensitivity_select +// +// Lists the Ids, tooltip text and bitmaps used by the +// precapture mode select light sensitivity item. +// +//----------------------------------------------------- +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_light_sensitivity_select + { + id = ECamSettingItemDynamicPhotoLightSensitivity; + text = qtn_lcam_tt_isosetting; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityAuto; + bitmap = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityLow; + bitmap = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityMed; + bitmap = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityHigh; + bitmap = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_extended_light_sensitivity_select +// +// Lists the Ids, tooltip text and bitmaps used by the +// precapture mode select light sensitivity item. +// +//----------------------------------------------------- +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_extended_light_sensitivity_select + { + id = ECamSettingItemDynamicPhotoLightSensitivity; + text = qtn_lcam_tt_isosetting; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityAuto; + bitmap = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityLow; + bitmap = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityLowMed; + bitmap = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityMed; + bitmap = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityMedHigh; + bitmap = EMbmCameraappQgn_indi_cam4_iso_medhigh; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityHigh; + bitmap = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + + +//---------------------------------------------------- +// r_cam_light_sensitivity_title +// +// Light sensitivity setting page title +// +//---------------------------------------------------- +RESOURCE TITLE_PANE r_cam_light_sensitivity_title + { + txt = qtn_lcam_title_selector_iso; //qtn_lcam_title_selector_iso_phot; + } + + + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_light_sensitivity +// Light sensitivity listbox item names and icons +// (Displayed in InfoListBox) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_light_sensitivity + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_auto; + setting_value_id = ECamLightSensitivityAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_low; + setting_value_id = ECamLightSensitivityLow; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_medium; + setting_value_id = ECamLightSensitivityMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_high; + setting_value_id = ECamLightSensitivityHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_light_sensitivity_summary +// Light sensitivity listbox item summaries +// (Displayed in InfoListBoxContainer) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_light_sensitivity_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityAuto; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_auto; + summary_title_text = qtn_lcam_set_iso_auto; + summary_description_text = qtn_lcam_set_iso_auto_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityLow; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_low; + summary_title_text = qtn_lcam_set_iso_low; + summary_description_text = qtn_lcam_set_iso_low_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityMed; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_medium; + summary_title_text = qtn_lcam_set_iso_medium; + summary_description_text = qtn_lcam_set_iso_medium_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityHigh; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_high; + summary_title_text = qtn_lcam_set_iso_high; + summary_description_text = qtn_lcam_set_iso_high_ex; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_extended_light_sensitivity +// Light sensitivity listbox item names and icons +// (Displayed in InfoListBox) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_extended_light_sensitivity + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_auto; + setting_value_id = ECamLightSensitivityAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_low; + setting_value_id = ECamLightSensitivityLow; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_low_medium; + setting_value_id = ECamLightSensitivityLowMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_medium; + setting_value_id = ECamLightSensitivityMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_medium_high; + setting_value_id = ECamLightSensitivityMedHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medhigh; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_high; + setting_value_id = ECamLightSensitivityHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_extended_light_sensitivity_summary +// Light sensitivity listbox item summaries +// (Displayed in InfoListBoxContainer) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_extended_light_sensitivity_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityAuto; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_auto; + summary_title_text = qtn_lcam_set_iso_auto; + summary_description_text = qtn_lcam_set_iso_auto_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityLow; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_low; + summary_title_text = qtn_lcam_set_iso_low; + summary_description_text = qtn_lcam_set_iso_low_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityLowMed; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_low; + summary_title_text = qtn_lcam_set_iso_low_medium; + summary_description_text = qtn_lcam_set_iso_low_medium_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityMed; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_medium; + summary_title_text = qtn_lcam_set_iso_medium; + summary_description_text = qtn_lcam_set_iso_medium_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityMedHigh; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_medhigh; + summary_title_text = qtn_lcam_set_iso_medium_high; + summary_description_text = qtn_lcam_set_iso_medium_high_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityHigh; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_high; + summary_title_text = qtn_lcam_set_iso_high; + summary_description_text = qtn_lcam_set_iso_high_ex; + } + }; + } + + + +// --------------------------------------------------------- +// Viewfinder grid + +// --------------------------------------------------------- +// +// r_cam_active_palette_vf_grid_set_array +// +// Lists the ids, tooltip texts and bitmaps used by the +// viewfinder grid setup active palette item. +// +// --------------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_vf_grid_set_array + { + id = ECamSettingItemViewfinderGrid; + text = qtn_lcam_tt_show_viewfinder_grid; + capture_setup_menu_item = + { + // The icons indicate the current setting value. + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamViewfinderGridOn; + bitmap = EMbmCameraappQgn_indi_cam4_viewfinder_on; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamViewfinderGridOff; + bitmap = EMbmCameraappQgn_indi_cam4_viewfinder_off; + } + }; + } + + +// --------------------------------------------------------- +// r_cam_active_palette_vf_grid_tooltip_array +// +// Array for viewfinder grid active palette item tooltips. +// --------------------------------------------------------- +// +RESOURCE ARRAY r_cam_active_palette_vf_grid_tooltip_array + { + items = + { + // These are indexed in CamActivePaletteHander with values of type + // TCamVfGridState based on current setting value. + // + // Note the order of texts: + // When current value is ECamViewfinderGridOn (0) the tooltip + // must be "hide viewfinder grid" and vice versa. + CAM_AP_TT_ITEM { text = qtn_lcam_tt_hide_viewfinder_grid; }, + CAM_AP_TT_ITEM { text = qtn_lcam_tt_show_viewfinder_grid; } + }; + } + + +//#endif //CAMERAAPP_PLUGIN_BUILD + +//**************************************************************** +// THE FOLLOWING ARE RESOURCES NEEDED BY SETTINGS PLUGIN AND CAMERA +//*************************************************************** + +//---------------------------------------------------- +// +// r_cam_quality_slider_shaft +// Location for the quality slider shaft +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_quality_slider_shaft + { + l = 44; + t = 16; + W = 12; + H = 155; + } + +//---------------------------------------------------- +// +// r_cam_quality_slider_shaft_ah +// Location for the quality slider shaft (Arabic/Hebrew) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_quality_slider_shaft_ah + { + r = 44; + t = 16; + W = 12; + H = 155; + } + +//---------------------------------------------------- +// +// r_cam_quality_slider_thumb +// Location for the quality slider thumb +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_quality_slider_thumb + { + l = 40; + t = 0; // not used + W = 13; + H = 7; + } + +//---------------------------------------------------- +// +// r_cam_quality_slider_thumb_ah +// Location for the quality slider thumb (Arabic/Hebrew) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_quality_slider_thumb_ah + { + r = 40; + t = 0; // not used + W = 13; + H = 7; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/data/CamCaptureSetupV2.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/data/CamCaptureSetupV2.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,4182 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +//#ifndef CAMERAAPP_PLUGIN_BUILD + +#define KSetupStandardFontColour 215 +#define KSetupListboxIconLeft 0 +#define KSetupListboxIconRightAH KSetupListboxIconLeft +#define KSetupListboxIconTop 2 +#define KSetupListboxIconWidth 25 +#define KSetupListboxIconHeight 20 +#define KSetupListboxRadioLeft 27 -10 +#define KSetupListboxRadioRightAH KSetupListboxRadioLeft +#define KSetupListboxRadioTop 2 +#define KSetupListboxRadioWidth 32 +#define KSetupListboxRadioHeight 20 +#define KSetupListboxTextLeft 52 - 10 +#define KSetupSceneListboxTextLeft 35 +#define KSetupListboxTextRight 0 +#define KSetupListboxTextLeftAH KSetupListboxTextRight +#define KSetupListboxTextRightAH KSetupListboxTextLeft +#define KSetupSceneListboxTextRightAH KSetupSceneListboxTextLeft +#define KSetupListboxTextBottom 16 +#define KSetupListboxTextBottomAPAC 19 +#define KSetupListboxTextWidth 170 +#define KSetupContainerTitleLeft 170 +#define KSetupContainerTitleRight 5 +#define KSetupContainerTitleBottom 30 +#define KSetupContainerTitleBottomAPAC 26 +#define KSetupContainerTitleWidth 165 +#define KSetupControlX 167 +#define KSetupControlXAH 4 +#define KSetupControlY 38 +#define KSetupViewFinderLeft 4 +#define KSetupViewFinderRightAH 8 +#define KSetupViewFinderTop 30 +#define KSetupViewFinderWidth 160 +#define KSetupViewFinderHeight 140 +#define KSetupMenuLeft 16 +#define KSetupMenuTop 30 +#define KSetupMenuTopAPAC 28 +#define KSetupMenuWidth 288 +#define KSetupMenuHeight 190 +#define KSetupMenuHeightAPAC 192 +#define KSetupMenuTextLeft 12 +#define KSetupMenuTextLeftAH 72 +#define KSetupMenuTextRight 70 +#define KSetupMenuTextRightAH 12 +#define KSetupMenuTextBottom 28 +#define KSetupMenuTextBottomAPAC 30 +#define KSetupMenuTextWidth 206 +#define KSetupMenuIconLeft 232 +#define KSetupMenuIconLeftAH 16 +#define KSetupMenuIconTop 4 +#define KSetupMenuIconWidth 56 +#define KSetupMenuIconHeight 30 +#define KSetupMenuIconTextRight 16 +#define KSetupMenuIconTextBottom 24 +#define KSetupMenuIconTextBottomAPAC 26 +#define KSetupMenuHighlightOffset 5 +#define KSetupMenuListItemHeight 32 +#define KSetupMenuSliderShaftLeft 250 +#define KSetupMenuSliderShaftLeftAH 46 +#define KSetupMenuSliderShaftTop 44 +#define KSetupMenuSliderShaftWidth 15 +#define KSetupMenuSliderShaftHeight 99 +#define KSetupMenuSliderThumbWidth 15 +#define KSetupMenuSliderThumbHeight 8 +#define KSetupMenuSliderIconLeft 220 +#define KSetupMenuSliderIconLeftAH 56 +#define KSetupMenuSliderMiddleIconTop 90 +#define KSetupMenuSliderIconWidth 20 +#define KSetupMenuSliderIconHeight 20 +#define KSetupMenuSliderLegendRight 0 +#define KSetupMenuSliderLegendWidth 180 +#define KSetupMenuSliderTopLegendBottom 50 +#define KSetupMenuSliderBottomLegendBottom 156 +#define KSetupMenuEVLegendAHOffset (-195) +#define KSetupMenuEVLegendRight 73 +#define KSetupMenuEVLegendRightAH 236 +#define KSetupMenuEVLegendWidth 48 +#define KSetupMenuEVPlus2LegendBottom 50 +#define KSetupMenuEVPlus1LegendBottom 74 +#define KSetupMenuEV0LegendBottom 98 +#define KSetupMenuEVMinus1LegendBottom 122 +#define KSetupMenuEVMinus2LegendBottom 146 + + #define KSetupListboxIconWidthLoc 0 + #define KSetupListboxRadioLeftLoc 0 + #define KSetupListboxRadioRightLocAH KSetupListboxRadioLeftLoc + #define KSetupListboxTextLeftLoc 27//=>38 with the listbox location + #define KSetupListboxTextRightLocAH KSetupListboxTextLeftLoc + #define KSetupListboxTextRightLoc 0//168//0//155 + #define KSetupListboxTextLeftLocAH KSetupListboxTextRightLoc + #define KSetupListboxTextWidthLoc 126//170//126 + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_icon_rect +// Layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capsetup_listbox_icon_rect + { + C = ELayoutEmpty; + l = KSetupListboxIconLeft; + t = KSetupListboxIconTop; + r = ELayoutEmpty; + b = ELayoutEmpty; + W = KSetupListboxIconWidth; + H = KSetupListboxIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_icon_rect_ah +// Arabic/Hebrew layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capsetup_listbox_icon_rect_ah + { + C = ELayoutEmpty; + r = KSetupListboxIconRightAH; + t = KSetupListboxIconTop; + b = ELayoutEmpty; + W = KSetupListboxIconWidth; + H = KSetupListboxIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_mode_listbox_icon_rect_ah +// Arabic/Hebrew layout rect for icons in mode setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capsetup_mode_listbox_icon_rect_ah + { + C = ELayoutEmpty; + r = KSetupListboxIconRightAH + 6; + t = KSetupListboxIconTop; + b = ELayoutEmpty; + W = KSetupListboxIconWidth; + H = KSetupListboxIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_radiobut_rect +// Layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capsetup_listbox_radiobut_rect + { + C = ELayoutEmpty; + l = KSetupListboxRadioLeft; + t = KSetupListboxRadioTop; + r = ELayoutEmpty; + b = ELayoutEmpty; + W = KSetupListboxRadioWidth; + H = KSetupListboxRadioHeight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_radiobut_rect_ah +// Arabic/Hebrew layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capsetup_listbox_radiobut_rect_ah + { + C = ELayoutEmpty; + l = ELayoutEmpty; + t = KSetupListboxRadioTop; + r = KSetupListboxRadioRightAH; + b = ELayoutEmpty; + W = KSetupListboxRadioWidth; + H = KSetupListboxRadioHeight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_text_rect +// Layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_listbox_text_rect + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupListboxTextLeft; + r=KSetupListboxTextRight; + B=KSetupListboxTextBottom; + W=KSetupListboxTextWidth; + J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_text_rect_apac +// APAC layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_listbox_text_rect_apac + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupListboxTextLeft; + r=KSetupListboxTextRight; + B=KSetupListboxTextBottomAPAC; + W=KSetupListboxTextWidth; + J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_listbox_text_rect_ah +// Arabic/Hebrew layout rect for icons in capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_listbox_text_rect_ah + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupListboxTextLeftAH; + r=KSetupListboxTextRightAH; + B=KSetupListboxTextBottom; + W=KSetupListboxTextWidth; + J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_scene_listbox_text_rect +// Layout rect for text in scene capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_scene_listbox_text_rect + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupSceneListboxTextLeft; + r=KSetupListboxTextRight; + B=KSetupListboxTextBottom; + W=KSetupListboxTextWidth; + J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_scene_listbox_text_rect_apac +// APAC layout rect for text in scene capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_scene_listbox_text_rect_apac + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupSceneListboxTextLeft; + r=KSetupListboxTextRight; + B=KSetupListboxTextBottomAPAC; + W=KSetupListboxTextWidth; + J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_capsetup_scene_listbox_text_rect_ah +// Arabic/Hebrew layout rect for text in scene capture setup list-box. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capsetup_scene_listbox_text_rect_ah + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupListboxTextLeftAH; + r=KSetupSceneListboxTextRightAH; + B=KSetupListboxTextBottom; + W=KSetupListboxTextWidth; + J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_titletext_layout_apac +// APAC layout for capture setup container title text +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_titletext_layout_apac + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + l=KSetupContainerTitleLeft; + r=KSetupContainerTitleRight; + B=KSetupContainerTitleBottomAPAC; + W=KSetupContainerTitleWidth; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_titletext_layout_ah +// Arabic/Hebrew layout for capture setup container title text +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_titletext_layout_ah + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + r=KSetupContainerTitleLeft; + l=KSetupContainerTitleRight; + B=KSetupContainerTitleBottom; + W=KSetupContainerTitleWidth; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_titletext_layout +// Layout for capture setup container title text +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_titletext_layout + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + l=KSetupContainerTitleLeft; + r=KSetupContainerTitleRight; + B=KSetupContainerTitleBottom; + W=KSetupContainerTitleWidth; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_novf_titletext_layout +// Layout for capture setup container title text (with no viewfiner) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_novf_titletext_layout + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + l=0; + r=0; + B=KSetupContainerTitleBottom; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_novf_titletext_layout_ah +// APAC Layout for capture setup container title text (with no viewfiner) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_novf_titletext_layout_ah + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + l=0; + r=0; + B=KSetupContainerTitleBottomAPAC; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_cont_novf_titletext_layout_apac +// APAC Layout for capture setup container title text (with no viewfiner) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_capture_setup_cont_novf_titletext_layout_apac + { + font = EAknLogicalFontPrimarySmallFont; + C=KSetupStandardFontColour; + l=0; + r=0; + B=KSetupContainerTitleBottomAPAC; + J=ELayoutAlignCenter; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_control_position +// Position of capture setup control when viewfinder is present +// +//---------------------------------------------------- +// +RESOURCE POINT r_cam_capture_setup_control_position + { + x = KSetupControlX; + y = KSetupControlY; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_control_position_ah +// Position of capture setup control when viewfinder is present for Arabic/Hebrew +// +//---------------------------------------------------- +// +RESOURCE POINT r_cam_capture_setup_control_position_ah + { + x = KSetupControlXAH; + y = KSetupControlY; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_contvf_rect +// Layout for capture setup container cropped viewfinder rect +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_contvf_rect + { + l = KSetupViewFinderLeft; + t = KSetupViewFinderTop; + W = KSetupViewFinderWidth; + H = KSetupViewFinderHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_contvf_rect_ah +// Arabic/Hebrew layout for capture setup container cropped viewfinder rect +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_contvf_rect_ah + { + r = KSetupViewFinderLeft; + t = KSetupViewFinderTop; + W = KSetupViewFinderWidth; + H = KSetupViewFinderHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_photo_imagesharpness +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_photo_imagesharpness + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_hard_v2; + setting_value_id = ECamImageSharpnessHard; + bitmap_id = EMbmCameraappQgn_indi_cam4_sharpness_hard; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_normal_v2; + setting_value_id = ECamImageSharpnessNorm; + bitmap_id = EMbmCameraappQgn_indi_cam4_sharpness_normal; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_soft_v2; + setting_value_id = ECamImageSharpnessSoft; + bitmap_id = EMbmCameraappQgn_indi_cam4_sharpness_soft; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_still_whitebalance +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_still_whitebalance + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_awb_v2; + setting_value_id = ECamWhiteBalanceAWB; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_auto; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_day_v2; + setting_value_id = ECamWhiteBalanceDaylight; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_sunny; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_cloud_v2; + setting_value_id = ECamWhiteBalanceCloudy; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_cloudy; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_tung_v2; + setting_value_id = ECamWhiteBalanceTungsten; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_tungsten; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_flu_v2; + setting_value_id = ECamWhiteBalanceFlourescent; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_fluorecent; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_still_coloureffect +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_still_coloureffect + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_col_v2; + setting_value_id = ECamColourFilterColour; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_normal; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_sep_v2; + setting_value_id = ECamColourFilterSepia; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_sepia; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_bw_v2; + setting_value_id = ECamColourFilterBlackAndWhite; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_bw; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_viv_v2; + setting_value_id = ECamColourFilterVivid; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_vivid; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_neg_v2; + setting_value_id = ECamColourFilterNegative; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_negative; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_still_flash +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_still_flash + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_auto_v2; + setting_value_id = ECamFlashAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_autoflash; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_redeye_v2; + setting_value_id = ECamFlashAntiRedEye; + bitmap_id = EMbmCameraappQgn_indi_cam4_antired; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_force_v2; + setting_value_id = ECamFlashForced; + bitmap_id = EMbmCameraappQgn_indi_cam4_flash_on; + }, + CAPTURE_SETUP_LIST_ITEM + { + // item_text = qtn_lcam_set_off; + item_text = qtn_lcam_set_flash_off_v2; + setting_value_id = ECamFlashOff; + bitmap_id = EMbmCameraappQgn_indi_cam4_flash_off; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_still_light_sensitivity +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_still_light_sensitivity + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isoauto_v2; + setting_value_id = ECamLightSensitivityAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isolow_v2; + setting_value_id = ECamLightSensitivityLow; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isomedium_v2; + setting_value_id = ECamLightSensitivityMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isohigh_v2; + setting_value_id = ECamLightSensitivityHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_still_extended_light_sensitivity +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_still_extended_light_sensitivity + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isoauto_v2; + setting_value_id = ECamLightSensitivityAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isolow_v2; + setting_value_id = ECamLightSensitivityLow; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_low_medium; + setting_value_id = ECamLightSensitivityLowMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isomedium_v2; + setting_value_id = ECamLightSensitivityMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_medium_high; + setting_value_id = ECamLightSensitivityMedHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medhigh; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_isohigh_v2; + setting_value_id = ECamLightSensitivityHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_video_whitebalance +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_video_whitebalance + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_awb_v2; + setting_value_id = ECamWhiteBalanceAWB; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_auto; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_day_v2; + setting_value_id = ECamWhiteBalanceDaylight; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_sunny; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_cloud_v2; + setting_value_id = ECamWhiteBalanceCloudy; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_cloudy; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_tung_v2; + setting_value_id = ECamWhiteBalanceTungsten; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_tungsten; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_flu_v2; + setting_value_id = ECamWhiteBalanceFlourescent; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_fluorecent; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_video_coloureffect +// Array of list items for capture setup radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_video_coloureffect + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_col_v2; + setting_value_id = ECamColourFilterColour; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_normal; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_sep_v2; + setting_value_id = ECamColourFilterSepia; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_sepia; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_bw_v2; + setting_value_id = ECamColourFilterBlackAndWhite; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_bw; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_viv_v2; + setting_value_id = ECamColourFilterVivid; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_vivid; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_neg_v2; + setting_value_id = ECamColourFilterNegative; + bitmap_id = EMbmCameraappQgn_indi_cam4_colour_negative; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_listbox_width +// Width of capture set-up list-box +// +//---------------------------------------------------- +// +RESOURCE INT16 r_cam_capture_setup_listbox_width + { + value = 151; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_listbox_width_novf +// Width of capture set-up list-box with no viewfinder +// +//---------------------------------------------------- +// +RESOURCE INT16 r_cam_capture_setup_listbox_width_novf + { + value = 180; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_listbox_item_height +// Width of capture set-up list-box +// +//---------------------------------------------------- +// +RESOURCE INT16 r_cam_capture_setup_listbox_item_height + { + value = 26; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_data +// Lists all the contents and layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_photo_data + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTop; + W = KSetupMenuWidth; + H = KSetupMenuHeight; + }; + + contents = + { + + }; + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeft; + r=KSetupMenuTextRight; + B=KSetupMenuTextBottom; + W=KSetupMenuTextWidth; + J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeft; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeft; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottom; + W=KSetupMenuIconWidth; + J=ELayoutAlignRight; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_data_apac +// Lists all the contents and APAC layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_photo_data_apac + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTopAPAC; + W = KSetupMenuWidth; + H = KSetupMenuHeightAPAC; + }; + + contents = + { + + }; + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeft; + r=KSetupMenuTextRight; + B=KSetupMenuTextBottomAPAC; + W=KSetupMenuTextWidth; + J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeft; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeft; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottomAPAC; + W=KSetupMenuIconWidth; + J=ELayoutAlignRight; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_data_ah +// Lists all the contents and Arabic/Hebrew layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_photo_data_ah + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTop; + W = KSetupMenuWidth; + H = KSetupMenuHeight; + }; + + contents = + { + + }; + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeftAH; + r=KSetupMenuTextRightAH; + B=KSetupMenuTextBottom; + W=KSetupMenuTextWidth; + J=ELayoutAlignRight; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeftAH; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeftAH; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottom; + W=KSetupMenuIconWidth; + J=ELayoutAlignLeft; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_scene_array +// Mapping of photo scene setting values +// to actual bitmaps. These must match the order of +// TCamSceneId in CamSettings.hrh +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_scene_array + { + id = ECamSettingItemDynamicPhotoScene; + text = qtn_lcam_tt_scene; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneNight; + bitmap = EMbmCameraappQgn_indi_cam4_mode_night; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_night_s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneMacro; + bitmap = EMbmCameraappQgn_indi_cam4_mode_closeup; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_macro_s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamScenePortrait; + bitmap = EMbmCameraappQgn_indi_cam4_mode_portrait; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_port_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneAuto; + bitmap = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneScenery; + bitmap = EMbmCameraappQgn_indi_cam4_mode_landscape; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_land_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneSports; + bitmap = EMbmCameraappQgn_indi_cam4_mode_sport; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_sport_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + // Normal is video auto scene. + // Therefore "Auto" icon. + id = ECamSceneNormal; + bitmap = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_norm_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneUser; + bitmap = EMbmCameraappQgn_indi_cam4_mode_userscene; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_user_s; + }, + + /* CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneNightScenery; + bitmap = EMbmCameraappQgn_indi_lcam_ap_sce_nightland; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_nightland_s; + }, */ + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneNightPortrait; + bitmap = EMbmCameraappQgn_indi_cam4_mode_portrait_night; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_nightport_s; + /* }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneCandlelight; + bitmap = EMbmCameraappQgn_indi_lcam_ap_sce_candle; + */ //bitmap = EMbmCameraappQgn_ico_lcam_sce_candle_s; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_flash_array +// Mapping of photo scene setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_flash_array + { + id = ECamSettingItemDynamicPhotoFlash; + text = qtn_lcam_tt_flash; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashAuto; + bitmap = EMbmCameraappQgn_indi_cam4_autoflash; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashForced; + bitmap = EMbmCameraappQgn_indi_cam4_flash_on; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashAntiRedEye; + bitmap = EMbmCameraappQgn_indi_cam4_antired; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashOff; + bitmap = EMbmCameraappQgn_indi_cam4_flash_off; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_flash_array +// Mapping of video flash setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_flash_array + { + id = ECamSettingItemDynamicVideoFlash; + text = qtn_lcam_tt_flashoff; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashForced; + bitmap = EMbmCameraappQgn_indi_vid4_light_on; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamFlashOff; + bitmap = EMbmCameraappQgn_indi_vid4_light_off; + } + }; + } + +// --------------------------------------------------------- +// r_cam_active_palette_video_flash_tooltip_array +// +// Array for video flash active palette item tooltips. +// --------------------------------------------------------- +// +RESOURCE ARRAY r_cam_active_palette_video_flash_tooltip_array + { + items = + { + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_videoflash; + }, + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_flashoff; } + }; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_precapture_facetracking_array +// Mapping of facetracking setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_precapture_facetracking_array + { + id = ECamSettingItemFaceTracking; + text = qtn_lcam_tt_facedet_off_v2; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSettOn; + bitmap = EMbmCameraappQgn_indi_cam4_tb_facedet; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSettOff; + bitmap = EMbmCameraappQgn_indi_cam4_tb_facedet_off; + } + }; + } + +// --------------------------------------------------------- +// r_cam_active_palette_facetracking_tooltip_array +// +// Array for facetracking active palette item tooltips. +// --------------------------------------------------------- +// +RESOURCE ARRAY r_cam_active_palette_facetracking_tooltip_array + { + items = + { + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_facedet_off_v2; + }, + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_facedet_on_v2; + } + }; + } + + + + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_white_balance_array +// Mapping of white balance setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_white_balance_array + { + id = ECamSettingItemDynamicPhotoWhiteBalance; + text = qtn_lcam_tt_wb; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceAWB; + bitmap = EMbmCameraappQgn_indi_cam4_wb_auto; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceDaylight; + bitmap = EMbmCameraappQgn_indi_cam4_wb_sunny; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceCloudy; + bitmap = EMbmCameraappQgn_indi_cam4_wb_cloudy; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceTungsten; + bitmap = EMbmCameraappQgn_indi_cam4_wb_tungsten; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceFlourescent; + bitmap = EMbmCameraappQgn_indi_cam4_wb_fluorecent; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_exposure_array +// Mapping of exposure setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_exposure_array + { + id = ECamSettingItemDynamicPhotoExposure; + text = qtn_lcam_tt_ev; + capture_setup_menu_item = + { +/* CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -6; + icontext = qtn_lcam_ev_minus2_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus2; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -5; + icontext = qtn_lcam_ev_minus1_7_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus1_7; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -4; + icontext = qtn_lcam_ev_minus1_3_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus1_3; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -3; + icontext = qtn_lcam_ev_minus1_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus1; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -2; + icontext = qtn_lcam_ev_minus0_7_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus0_7; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -1; + icontext = qtn_lcam_ev_minus0_3_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus0_3; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + icontext = qtn_lcam_ev_0_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_0; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 1; + icontext = qtn_lcam_ev_plus0_3_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus0_3; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 2; + icontext = qtn_lcam_ev_plus0_7_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus0_7; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 3; + icontext = qtn_lcam_ev_plus1_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus1; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 4; + icontext = qtn_lcam_ev_plus1_3_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus1_3; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 5; + icontext = qtn_lcam_ev_plus1_7_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus1_7; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 6; + icontext = qtn_lcam_ev_plus2_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus2; + } + */ }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_exposure_array2 +// Mapping of exposure setting values +// to actual bitmaps. (range -2.0 to 2.0 steps of 1/2) +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_exposure_array2 + { + id = ECamSettingItemDynamicPhotoExposure; + text = qtn_lcam_tt_ev; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -4; + icontext = qtn_lcam_ev_minus2_v2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_minus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -3; + icontext = qtn_lcam_ev_minus1_5_v2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_minus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -2; + icontext = qtn_lcam_ev_minus1_v2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_minus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -1; + icontext = qtn_lcam_ev_minus0_5_v2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_minus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + icontext = qtn_lcam_ev_0_v2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 1; + icontext = qtn_lcam_ev_plus0_5_v2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_plus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 2; + icontext = qtn_lcam_ev_plus1_v2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_plus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 3; + icontext = qtn_lcam_ev_plus1_5_v2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_plus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 4; + icontext = qtn_lcam_ev_plus2_v2; + bitmap = EMbmCameraappQgn_indi_cam4_exposure_plus; + } + }; + } + + //---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_exposure_array3 +// Mapping of exposure setting values +// to actual bitmaps. range -2.0 to 2.0 steps of 1) +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_exposure_array3 + { + id = ECamSettingItemDynamicPhotoExposure; + text = qtn_lcam_tt_ev; + capture_setup_menu_item = + { + /* CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -2; + icontext = qtn_lcam_ev_minus2_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus2; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = -1; + icontext = qtn_lcam_ev_minus1_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_minus1; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + icontext = qtn_lcam_ev_0_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_0; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 1; + icontext = qtn_lcam_ev_plus1_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus1; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 2; + icontext = qtn_lcam_ev_plus2_v2; + bitmap = EMbmCameraappQgn_indi_lcam_ap_ev_plus2; + } */ + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_colourfilter_array +// Mapping of photo colour filter setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_colourfilter_array + { + id = ECamSettingItemDynamicPhotoColourFilter; + text = qtn_lcam_tt_coltone; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterColour; + bitmap = EMbmCameraappQgn_indi_cam4_colour_normal; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterBlackAndWhite; + bitmap = EMbmCameraappQgn_indi_cam4_colour_bw; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterSepia; + bitmap = EMbmCameraappQgn_indi_cam4_colour_sepia; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterNegative; + bitmap = EMbmCameraappQgn_indi_cam4_colour_negative; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterVivid; + bitmap = EMbmCameraappQgn_indi_cam4_colour_vivid; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_imagesharpness_array +// Mapping of photo image sharpness setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_imagesharpness_array + { + id = ECamSettingItemDynamicPhotoImageSharpness; + text = qtn_lcam_tt_sharp; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamImageSharpnessHard; + bitmap = EMbmCameraappQgn_indi_cam4_sharpness_hard; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamImageSharpnessNorm; + bitmap = EMbmCameraappQgn_indi_cam4_sharpness_normal; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamImageSharpnessSoft; + bitmap = EMbmCameraappQgn_indi_cam4_sharpness_soft; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_brightness_array +// Mapping of photo brightness setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_brightness_array + { + id = ECamSettingItemDynamicPhotoBrightness; + text = qtn_lcam_tt_bright; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessNorm; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_brightnorm; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessPlus; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_brightplus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessNeg; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_brightneg; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_contrast_array +// Mapping of photo contrast setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_contrast_array + { + id = ECamSettingItemDynamicPhotoContrast; + text = qtn_lcam_tt_contr; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastNorm; + bitmap = EMbmCameraappQgn_indi_cam4_contrast; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastPlus; + bitmap = EMbmCameraappQgn_indi_cam4_contrast_plus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastNeg; + bitmap = EMbmCameraappQgn_indi_cam4_contrast_minus; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_photo_coloursaturation_array +// Mapping of photo colour saturation setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_photo_coloursaturation_array + { + id = ECamSettingItemDynamicPhotoColourSaturation; + text = qtn_lcam_popm_colsat; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationNorm; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatnorm; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationPlus; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatplus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationNeg; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatneg; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_light_sensitivity_array +// Mapping of photo scene setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_light_sensitivity_array + { + id = ECamSettingItemDynamicPhotoLightSensitivity; + text = qtn_lcam_tt_isosetting; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationNorm; + bitmap = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityLow; + bitmap = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityMed; + bitmap = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityHigh; + bitmap = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_data +// Lists all the contents and layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_video_data + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTop; + W = KSetupMenuWidth; + H = KSetupMenuHeight; + }; + + contents = + { + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_scene_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_white_balance_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_colourfilter_array; + } +#if 0 + , + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_brightness_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_contrast_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_coloursaturation_array; + } +#endif + }; + + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeft; + r=KSetupMenuTextRight; + B=KSetupMenuTextBottom; + W=KSetupMenuTextWidth; + J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeft; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeft; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottom; + W=KSetupMenuIconWidth; + J=ELayoutAlignRight; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_data_apac +// Lists all the contents and APAC layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_video_data_apac + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTopAPAC; + W = KSetupMenuWidth; + H = KSetupMenuHeightAPAC; + }; + + contents = + { + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_scene_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_white_balance_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_colourfilter_array; + } +#if 0 + , + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_brightness_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_contrast_array; + } +#endif + }; + + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeft; + r=KSetupMenuTextRight; + B=KSetupMenuTextBottomAPAC; + W=KSetupMenuTextWidth; + J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeft; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeft; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottomAPAC; + W=KSetupMenuIconWidth; + J=ELayoutAlignRight; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_data_ah +// Lists all the contents and Arabic/Hebrew layout data for the photo capture setup menu. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_video_data_ah + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = KSetupMenuLeft; + t = KSetupMenuTop; + W = KSetupMenuWidth; + H = KSetupMenuHeight; + }; + + contents = + { + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_scene_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_white_balance_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_colourfilter_array; + } +#if 0 + , + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_brightness_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_contrast_array; + } +#endif + }; + + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuTextLeftAH; + r=KSetupMenuTextRightAH; + B=KSetupMenuTextBottom; + W=KSetupMenuTextWidth; + J=ELayoutAlignRight; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = KSetupMenuIconLeftAH; + t = KSetupMenuIconTop; + W = KSetupMenuIconWidth; + H = KSetupMenuIconHeight; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuIconLeftAH; + r=KSetupMenuIconTextRight; + B=KSetupMenuIconTextBottom; + W=KSetupMenuIconWidth; + J=ELayoutAlignLeft; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = KSetupMenuHighlightOffset; + + // The height for a list item + list_item_height = KSetupMenuListItemHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_scene_array +// Mapping of photo scene setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_scene_array + { + id = ECamSettingItemDynamicVideoScene; + text = qtn_lcam_tt_scene; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneNight; + bitmap = EMbmCameraappQgn_indi_cam4_mode_night; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_night_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneMacro; + bitmap = EMbmCameraappQgn_indi_cam4_mode_closeup; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_macro_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamScenePortrait; + bitmap = EMbmCameraappQgn_indi_cam4_mode_portrait; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_port_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneAuto; + bitmap = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneScenery; + bitmap = EMbmCameraappQgn_indi_cam4_mode_landscape; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_land_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneSports; + bitmap = EMbmCameraappQgn_indi_cam4_mode_sport; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_sport_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + // Normal is video auto scene. + // Therefore "Auto" icon. + id = ECamSceneNormal; + bitmap = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneUser; + bitmap = EMbmCameraappQgn_indi_cam4_mode_userscene; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_user_s; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSceneLowLight; + bitmap = EMbmCameraappQgn_indi_cam4_wb_tungsten; + //bitmap = EMbmCameraappQgn_ico_lcam_sce_user_s; + } + + }; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_white_balance_array +// Mapping of white balance setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_white_balance_array + { + id = ECamSettingItemDynamicVideoWhiteBalance; + text = qtn_lcam_tt_wb; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceAWB; + bitmap = EMbmCameraappQgn_indi_cam4_wb_auto; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceDaylight; + bitmap = EMbmCameraappQgn_indi_cam4_wb_sunny; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceCloudy; + bitmap = EMbmCameraappQgn_indi_cam4_wb_cloudy; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceTungsten; + bitmap = EMbmCameraappQgn_indi_cam4_wb_tungsten; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamWhiteBalanceFlourescent; + bitmap = EMbmCameraappQgn_indi_cam4_wb_fluorecent; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_colourfilter_array +// Mapping of video colour filter setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_colourfilter_array + { + id = ECamSettingItemDynamicVideoColourFilter; + text = qtn_lcam_tt_coltone; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterColour; + bitmap = EMbmCameraappQgn_indi_cam4_colour_normal; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterBlackAndWhite; + bitmap = EMbmCameraappQgn_indi_cam4_colour_bw; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterSepia; + bitmap = EMbmCameraappQgn_indi_cam4_colour_sepia; + }, + + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterNegative; + bitmap = EMbmCameraappQgn_indi_cam4_colour_negative; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourFilterVivid; + bitmap = EMbmCameraappQgn_indi_cam4_colour_vivid; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_brightness_array +// Mapping of video brightness setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_brightness_array + { + id = ECamSettingItemDynamicVideoBrightness; + text = qtn_lcam_tt_bright; + capture_setup_menu_item = + { + /* CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessNorm; + bitmap = EMbmCameraappQgn_indi_lcam_ap_brightnorm; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessPlus; + bitmap = EMbmCameraappQgn_indi_lcam_ap_brightplus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamBrightnessNeg; + bitmap = EMbmCameraappQgn_indi_lcam_ap_brightneg; + } */ + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_contrast_array +// Mapping of video contrast setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_contrast_array + { + id = ECamSettingItemDynamicVideoContrast; + text = qtn_lcam_popm_contrast; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastNorm; + bitmap = EMbmCameraappQgn_indi_cam4_contrast; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastPlus; + bitmap = EMbmCameraappQgn_indi_cam4_contrast_plus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamContrastNeg; + bitmap = EMbmCameraappQgn_indi_cam4_contrast_minus; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_video_coloursaturation_array +// Mapping of photo brightness setting values +// to actual bitmaps. +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_capture_setup_menu_video_coloursaturation_array + { + id = ECamSettingItemDynamicVideoColourSaturation; + text = qtn_lcam_popm_colsat; + capture_setup_menu_item = + { + /* CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationNorm; + bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatnorm; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationPlus; + bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatplus; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamColourSaturationNeg; + bitmap = EMbmCameraappQgn_indi_lcam_ap_colsatneg; + } */ + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_brightness_array +// Location and string data for the brightness +// slider legend text +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_brightness_array + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderTopLegendBottom; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_plus_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderBottomLegendBottom - 10; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_minus_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = KSetupMenuSliderIconLeft - 7; + t = KSetupMenuSliderMiddleIconTop - 7; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + // bitmap_id = EMbmCameraappQgn_indi_lcam_ap_brightnorm; + // mask_id = EMbmCameraappQgn_indi_lcam_ap_brightnorm_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_brightness_array_ah +// Location and string data for the brightness +// slider legend text (Arabic\Hebrew Layout) +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_brightness_array_ah + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeftAH; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderTopLegendBottom; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_plus_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeftAH; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderBottomLegendBottom; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_minus_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = KSetupMenuSliderIconLeftAH; + t = KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_ap_brightnorm; +// mask_id = EMbmCameraappQgn_indi_lcam_ap_brightnorm_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_coloursaturation_array +// Location and string data for the colour saturation +// slider legend text +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_coloursaturation_array + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT { font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=268; r=44; B=65; W=8; J=ELayoutAlignLeft; }; + text = qtn_lcam_set_plus_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT { font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=268; r=44; B=255; W=8; J=ELayoutAlignLeft; }; + text = qtn_lcam_set_minus_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 243; t = 138; W = 30; H = 30; }; + // bitmap_id = EMbmCameraappQgn_indi_lcam_ap_colsatnorm; + // mask_id = EMbmCameraappQgn_indi_lcam_ap_colsatnorm_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_contrast_array +// Location and string data for the contrast +// slider legend text +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_contrast_array + { + items = + { + CAM_SLIDER_CONTRAST_LEGEND_ITEM + { + item = ECamSliderLegendItemText; + text = qtn_lcam_set_plus_v2; + }, + CAM_SLIDER_CONTRAST_LEGEND_ITEM + { + item = ECamSliderLegendItemText; + text = qtn_lcam_set_minus_v2; + }, + CAM_SLIDER_CONTRAST_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + bitmap_id = EMbmCameraappQgn_indi_cam4_contrast; + mask_id = EMbmCameraappQgn_indi_cam4_contrast_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_contrast_array_ah +// Location and string data for the contrast +// slider legend text (Arabic\Hebrew Layout) +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_contrast_array_ah + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeftAH; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderTopLegendBottom; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_plus_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=KSetupMenuSliderIconLeftAH; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderBottomLegendBottom; + W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_set_minus_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = KSetupMenuSliderIconLeftAH; + t = KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_contrast; + mask_id = EMbmCameraappQgn_indi_cam4_contrast_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_light_sensitivity_array +// Location and string data for the light sensitivity +// slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_light_sensitivity_array + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=245; //KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderTopLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isohigh_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=245; //KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=85; //KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isomedium_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=245; //KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=120; //KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isolow_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + l=245; //KSetupMenuSliderIconLeft; + r=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isoauto_v2; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = 190; //KSetupMenuSliderIconLeft; + t = 40; // KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + mask_id = EMbmCameraappQgn_indi_cam4_iso_high_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = 190;//240; //KSetupMenuSliderIconLeft; + t = 70; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + mask_id = EMbmCameraappQgn_indi_cam4_iso_medium_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = 190; //KSetupMenuSliderIconLeft; + t = 95; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + mask_id = EMbmCameraappQgn_indi_cam4_iso_low_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + l = 190;//240; //KSetupMenuSliderIconLeft; + t = 128; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + mask_id = EMbmCameraappQgn_indi_cam4_iso_auto_mask; + } + + + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_light_sensitivity_array_ah +// Location and string data for the light sensitivity +// slider legend text (for Arabic/Hebrew variant) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_light_sensitivity_array_ah + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + r=245; //KSetupMenuSliderIconLeft; + l=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderTopLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isohigh_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + r=245; //KSetupMenuSliderIconLeft; + l=KSetupMenuSliderLegendRight; + B=85; //KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isomedium_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + r=245; //KSetupMenuSliderIconLeft; + l=KSetupMenuSliderLegendRight; + B=120; //KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isolow_v2; + }, + CAM_SLIDER_LEGEND_ITEM + { + position = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C=KSetupStandardFontColour; + r=245; //KSetupMenuSliderIconLeft; + l=KSetupMenuSliderLegendRight; + B=KSetupMenuSliderBottomLegendBottom; + //W=KSetupMenuSliderLegendWidth; + J=ELayoutAlignLeft; + }; + text = qtn_lcam_isoauto_v2; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + r = 190; //KSetupMenuSliderIconLeft; + t = 40; // KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + mask_id = EMbmCameraappQgn_indi_cam4_iso_high_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + r = 190;//240; //KSetupMenuSliderIconLeft; + t = 70; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + mask_id = EMbmCameraappQgn_indi_cam4_iso_medium_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + r = 190; //KSetupMenuSliderIconLeft; + t = 95; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + mask_id = EMbmCameraappQgn_indi_cam4_iso_low_mask; + }, + + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT + { + r = 190;//240; //KSetupMenuSliderIconLeft; + t = 128; //KSetupMenuSliderMiddleIconTop; + W = KSetupMenuSliderIconWidth; + H = KSetupMenuSliderIconHeight; + }; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + mask_id = EMbmCameraappQgn_indi_cam4_iso_auto_mask; + } + + + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_control_position +// Position of capture setup slider control when viewfinder is present +// +//---------------------------------------------------- +// +RESOURCE POINT r_cam_capture_setup_slider_control_position + { + x = KSetupControlX; + y = KSetupControlY; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_control_position_ah +// Position of capture setup slider control when viewfinder is present +// for Arabic/Hebrew layouts +// +//---------------------------------------------------- +// +RESOURCE POINT r_cam_capture_setup_slider_control_position_ah + { + x = KSetupControlXAH; + y = KSetupControlY; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_bright_contrast_contvf_rect +// Layout for capture setup container cropped viewfinder +// rect displayed with slider controls +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_contvf_rect + { + l = KSetupViewFinderLeft; + t = KSetupViewFinderTop; + W = KSetupViewFinderWidth; + H = KSetupViewFinderHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_bright_contrast_contvf_rect_ah +// Arabic/Hebrew layout for capture setup container +// cropped viewfinder rect displayed with slider controls +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_contvf_rect_ah + { + r = KSetupViewFinderLeft; + t = KSetupViewFinderTop; + W = KSetupViewFinderWidth; + H = KSetupViewFinderHeight; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array +// Location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array2 + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2_v2; + }, + CAM_SLIDER_EV_ITEM // +1.7 + { + text = qtn_lcam_ev_plus1_7_v2; + }, + CAM_SLIDER_EV_ITEM // +1.3 + { + text = qtn_lcam_ev_plus1_3_v2; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1_v2; + }, + CAM_SLIDER_EV_ITEM // +0.7 + { + text = qtn_lcam_ev_plus0_7_v2; + }, + CAM_SLIDER_EV_ITEM // +0.3 + { + text = qtn_lcam_ev_plus0_3_v2; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0_v2; + }, + CAM_SLIDER_EV_ITEM // -0.3 + { + text = qtn_lcam_ev_minus0_3_v2; + }, + CAM_SLIDER_EV_ITEM // -0.7 + { + text = qtn_lcam_ev_minus0_7_v2; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1_v2; + }, + CAM_SLIDER_EV_ITEM // -1.3 + { + text = qtn_lcam_ev_minus1_3_v2; + }, + CAM_SLIDER_EV_ITEM // -1.7 + { + text = qtn_lcam_ev_minus1_7_v2; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array2 +// Location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2_v2; + }, + CAM_SLIDER_EV_ITEM // +1.5 + { + text = qtn_lcam_ev_plus1_5_v2; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1_v2; + }, + CAM_SLIDER_EV_ITEM // +0.5 + { + text = qtn_lcam_ev_plus0_5_v2; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0_v2; + }, + CAM_SLIDER_EV_ITEM // -0.5 + { + text = qtn_lcam_ev_minus0_5_v2; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1_v2; + }, + CAM_SLIDER_EV_ITEM // -1.5 + { + text = qtn_lcam_ev_minus1_5_v2; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array3 +// Location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array3 + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2_v2; + }, + CAM_SLIDER_EV_ITEM // +1.5 + { + text = qtn_lcam_ev_plus1_5_v2; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1_v2; + }, + CAM_SLIDER_EV_ITEM // +0.5 + { + text = qtn_lcam_ev_plus0_5_v2; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0_v2; + }, + CAM_SLIDER_EV_ITEM // -0.5 + { + text = qtn_lcam_ev_minus0_5_v2; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1_v2; + }, + CAM_SLIDER_EV_ITEM // -1.5 + { + text = qtn_lcam_ev_minus1_5_v2; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2_v2; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array_ah +// Arabic/Hebrew location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array_ah + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2_v2; + }, + CAM_SLIDER_EV_ITEM // +1.7 + { + text = qtn_lcam_ev_plus1_7_v2; + }, + CAM_SLIDER_EV_ITEM // +1.3 + { + text = qtn_lcam_ev_plus1_3_v2; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1_v2; + }, + CAM_SLIDER_EV_ITEM // +0.7 + { + text = qtn_lcam_ev_plus0_7_v2; + }, + CAM_SLIDER_EV_ITEM // +0.3 + { + text = qtn_lcam_ev_plus0_3_v2; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0_v2; + }, + CAM_SLIDER_EV_ITEM // -0.3 + { + text = qtn_lcam_ev_minus0_3_v2; + }, + CAM_SLIDER_EV_ITEM // -0.7 + { + text = qtn_lcam_ev_minus0_7_v2; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1_v2; + }, + CAM_SLIDER_EV_ITEM // -1.3 + { + text = qtn_lcam_ev_minus1_3_v2; + }, + CAM_SLIDER_EV_ITEM // -1.7 + { + text = qtn_lcam_ev_minus1_7_v2; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array2_ah +// Arabic/Hebrew location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array2_ah + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2_v2; + }, + CAM_SLIDER_EV_ITEM // +1.5 + { + text = qtn_lcam_ev_plus1_5_v2; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1_v2; + }, + CAM_SLIDER_EV_ITEM // +0.5 + { + text = qtn_lcam_ev_plus0_5_v2; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0_v2; + }, + CAM_SLIDER_EV_ITEM // -0.5 + { + text = qtn_lcam_ev_minus0_5_v2; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1_v2; + }, + CAM_SLIDER_EV_ITEM // -1.5 + { + text = qtn_lcam_ev_minus1_5_v2; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_ev_array3_ah +// Arabic/Hebrew location and string data for the EV-Slider legend text +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_slider_ev_array3_ah + { + items = + { + CAM_SLIDER_EV_ITEM // +2.0 + { + text = qtn_lcam_ev_plus2_v2; + }, + CAM_SLIDER_EV_ITEM // +1.5 + { + text = qtn_lcam_ev_plus1_5_v2; + }, + CAM_SLIDER_EV_ITEM // +1.0 + { + text = qtn_lcam_ev_plus1_v2; + }, + CAM_SLIDER_EV_ITEM // +0.5 + { + text = qtn_lcam_ev_plus0_5_v2; + }, + CAM_SLIDER_EV_ITEM // +0.0 + { + text = qtn_lcam_ev_0_v2; + }, + CAM_SLIDER_EV_ITEM // -0.5 + { + text = qtn_lcam_ev_minus0_5_v2; + }, + CAM_SLIDER_EV_ITEM // -1.0 + { + text = qtn_lcam_ev_minus1_v2; + }, + CAM_SLIDER_EV_ITEM // -1.5 + { + text = qtn_lcam_ev_minus1_5_v2; + }, + CAM_SLIDER_EV_ITEM // -2.0 + { + text = qtn_lcam_ev_minus2_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_shaft +// Location for the capture setup control slider shaft +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_shaft + { + l = KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderShaftWidth; + H = KSetupMenuSliderShaftHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_shaft_ah +// Location for the capture setup control slider shaft +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_shaft_ah + { + r = KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderShaftWidth; + H = KSetupMenuSliderShaftHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_thumb +// Location for the capture setup control slider thumb +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_thumb + { + l = 200; //KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderThumbWidth; + H = KSetupMenuSliderThumbHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_slider_thumb_ah +// Location for the capture setup control slider thumb (Arabic/Hebrew layout) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_slider_thumb_ah + { + r = 200; //KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderThumbWidth; + H = KSetupMenuSliderThumbHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_iso_slider_shaft +// Location for the capture setup control slider shaft +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_iso_slider_shaft + { + l = 220; //KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderShaftWidth; + H = KSetupMenuSliderShaftHeight; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_iso_slider_thumb +// Location for the capture setup control slider thumb +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_iso_slider_thumb + { + l = 220; //KSetupMenuSliderShaftLeft; + t = KSetupMenuSliderShaftTop; + W = KSetupMenuSliderThumbWidth; + H = KSetupMenuSliderThumbHeight; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_whitebalance +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_whitebalance + { + buf = qtn_lcam_title_subm_wb_v2; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_coloureffect +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_coloureffect + { + buf = qtn_lcam_title_subm_ceff_v2; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_ev +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_ev + { + buf = qtn_lcam_title_subm_ev_v2; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_flash +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_flash + { + buf = qtn_lcam_title_subm_flash_v2; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_brightness +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_brightness + { + buf = qtn_lcam_title_subm_bright_v2; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_light_sensitivity +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_light_sensitivity + { + buf = qtn_lcam_title_subm_iso_v2; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_contrast +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_contrast + { + buf = qtn_lcam_title_subm_contr_v2; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_imagesharpness +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_imagesharpness + { + buf = qtn_lcam_title_subm_sharp_v2; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_coloursaturation +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_coloursaturation + { + buf = qtn_lcam_title_subm_colsat; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_video +// Title name used in video capture setup views +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_capture_setup_title_video + { + txt = qtn_lcam_title_text_vidsetup; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_photo +// Title name used in still capture setup views +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_capture_setup_title_still + { + txt = qtn_lcam_title_text_photsetup; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_second_camera_photo_data +// Lists all the contents and layout data for the photo +// capture setup menu for the secondary camera +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_second_camera_photo_data + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = 16; t = 150; W = 320; H = 130; + }; + + contents = + { + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_photo_scene_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_photo_brightness_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_photo_contrast_array; + } + + }; + + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=5; r=30; B=26; W=115; J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = 268; t = 3; W = 32; H = 20; + }; + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=286; r=16; B=24; W=80; J=ELayoutAlignRight; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = 3; + + // The height for a list item + list_item_height = 41; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_menu_second_camera_video_data +// Lists all the contents and layout data for the video +// capture setup menu for the secondary camera +// +//---------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_DATA r_cam_capture_setup_menu_second_camera_video_data + { + // The rectangular layout for the listbox. + listbox_layout = AVKON_LAYOUT_RECT + { + l = 16; t = 150; W = 320; H = 130; + }; + + contents = + { + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_scene_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_brightness_array; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + capture_setup_menu_item_ref = r_cam_capture_setup_menu_video_contrast_array; + } + + }; + + // The text layouts for the text items of this listbox. + text_layout = + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=5; r=30; B=26; W=115; J=ELayoutAlignLeft; + }; + + // The rectangular layouts for the bitmap items of this listbox. + bitmap_layout = + AVKON_LAYOUT_RECT + { + l = 268; t = 3; W = 32; H = 20; + }; + + // The layout for any icon text items of this listbox. + icontext_layout = AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=KSetupStandardFontColour; l=286; r=16; B=24; W=80; J=ELayoutAlignLeft; + }; + + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + highlighted_offset = 3; + + // The height for a list item + list_item_height = 41; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_precapture_sequence_mode_array +// +// Lists the Ids, tooltip text and bitmaps used by the +// image precapture sequence mode active palette item. +// +//----------------------------------------------------- + +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_precapture_sequence_mode_array + { + id = ECamSettingItemSequenceMode; + text = qtn_lcam_tt_sequence; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapseOff; + bitmap = EMbmCameraappQgn_indi_cam4_sequence; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapseMin; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_burst; + }/*, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse5sec; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_5s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse10sec; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_10s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse30sec; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_30s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse1min; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_1min; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse5min; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_5min; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse10min; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_10min; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamTimeLapse30min; + bitmap = EMbmCameraappQgn_indi_cam4_sequence_30min; + }*/ + }; + } + +RESOURCE ARRAY r_cam_active_palette_precapture_sequence_mode_tooltip_array + { + items = + { + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_sequence; + }, + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_normal; + } + }; + } + +RESOURCE ARRAY r_cam_active_palette_precapture_advanced_sequence_mode_tooltip_array + { + items = + { + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_sequence; + }, + CAM_AP_TT_ITEM + { + text = qtn_lcam_tt_normal; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_image_precapture_mode_select +// +// Lists the Ids, tooltip text and bitmaps used by the +// image precapture mode select active palette item. +// +//----------------------------------------------------- + +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_precapture_video_mode_select + { + id = ECamSettingItemVideoModeSelect; + text = qtn_lcam_tt_switch_video; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_mode_switch_c; + bitmap = EMbmCameraappQgn_indi_vid4_video; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_active_palette_video_precapture_mode_select +// +// Lists the Ids, tooltip text and bitmaps used by the +// video precapture mode select active palette item. +// +//----------------------------------------------------- + +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_precapture_image_mode_select + { + id = ECamSettingItemImageModeSelect; + text = qtn_lcam_tt_switch_image; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + // bitmap = EMbmCameraappQgn_indi_lcam_ap_mode_switch_v; + bitmap = EMbmCameraappQgn_indi_cam4_camera; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_precapture_image_switch_camera +// +// Lists the Ids, tooltip text and bitmaps used by the +// switch camera active palette item. +// +//----------------------------------------------------- + +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_precapture_switch_camera + { + id = ECamSettingItemSwitchCamera; + text = qtn_lcam_tt_camera_main; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = 0; + bitmap = EMbmCameraappQgn_indi_tb_cam4_goto_main; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_self_timer +// Array of list items for self timer radio button list +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_self_timer + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + // item_text = qtn_lcam_set_off; + item_text = qtn_lcam_st_off_v2; + setting_value_id = ECamSelfTimerOff; + bitmap_id = EMbmCameraappQgn_indi_cam4_selftimer_off; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_st_2_v2; + setting_value_id = ECamSelfTimer2; + bitmap_id = EMbmCameraappQgn_indi_cam4_selftimer_2sec; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_st_10_v2; + setting_value_id = ECamSelfTimer10; + bitmap_id = EMbmCameraappQgn_indi_cam4_selftimer_10s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_st_20_v2; + setting_value_id = ECamSelfTimer20; + bitmap_id = EMbmCameraappQgn_indi_cam4_selftimer_20s; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_title_name_self_timer +// Title name used in capture setup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_capture_setup_title_name_self_timer + { + buf = qtn_lcam_title_selftimer_v2; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_self_timer_select +// +// Lists the Ids, tooltip text and bitmaps used by the +// precapture mode select active palette item. +// +//----------------------------------------------------- +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_self_timer_select + { + id = ECamSettingItemDynamicSelfTimer; + text = qtn_lcam_tt_st; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSelfTimerOff; + bitmap = EMbmCameraappQgn_indi_cam4_selftimer_off; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSelfTimer2; + bitmap = EMbmCameraappQgn_indi_cam4_selftimer_2sec; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSelfTimer10; + bitmap = EMbmCameraappQgn_indi_cam4_selftimer_10s; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamSelfTimer20; + bitmap = EMbmCameraappQgn_indi_cam4_selftimer_20s; + } + }; + } + + +// --------------------------------------------------------------------------- +// Go to photos toolbar AP item data (tooltip, icons) +// --------------------------------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_goto_photos_set_array + { + id = ECamSettingItemGotoPhotos; + text = qtn_lcam_tt_go_to_photos; + capture_setup_menu_item = + { + // For item of type ECamActivePaletteItemTypeCommand, there's only one icon. + // Command id defined in CAM_DYNAMIC_ACTIVE_PALETTE_ITEM or + // CAM_ACTIVE_PALETTE_ITEM resource for this item is used to identify the icon. + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamCmdPhotos; + bitmap = EMbmCameraappQgn_indi_cam4_goto_gallery; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_light_sensitivity_select +// +// Lists the Ids, tooltip text and bitmaps used by the +// precapture mode select light sensitivity item. +// +//----------------------------------------------------- +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_light_sensitivity_select + { + id = ECamSettingItemDynamicPhotoLightSensitivity; + text = qtn_lcam_tt_isosetting; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityAuto; + bitmap = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityLow; + bitmap = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityMed; + bitmap = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityHigh; + bitmap = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_active_palette_extended_light_sensitivity_select +// +// Lists the Ids, tooltip text and bitmaps used by the +// precapture mode select light sensitivity item. +// +//----------------------------------------------------- +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_extended_light_sensitivity_select + { + id = ECamSettingItemDynamicPhotoLightSensitivity; + text = qtn_lcam_tt_isosetting; + capture_setup_menu_item = + { + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityAuto; + bitmap = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityLow; + bitmap = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityLowMed; + bitmap = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityMed; + bitmap = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityMedHigh; + bitmap = EMbmCameraappQgn_indi_cam4_iso_medhigh; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamLightSensitivityHigh; + bitmap = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + + +//---------------------------------------------------- +// r_cam_light_sensitivity_title +// +// Light sensitivity setting page title +// +//---------------------------------------------------- +RESOURCE TITLE_PANE r_cam_light_sensitivity_title + { + txt = qtn_lcam_title_selector_iso; //qtn_lcam_title_selector_iso_phot; + } + + + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_light_sensitivity +// Light sensitivity listbox item names and icons +// (Displayed in InfoListBox) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_light_sensitivity + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_auto; + setting_value_id = ECamLightSensitivityAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_low; + setting_value_id = ECamLightSensitivityLow; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_medium; + setting_value_id = ECamLightSensitivityMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_high; + setting_value_id = ECamLightSensitivityHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_light_sensitivity_summary +// Light sensitivity listbox item summaries +// (Displayed in InfoListBoxContainer) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_light_sensitivity_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityAuto; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_auto; + summary_title_text = qtn_lcam_set_iso_auto; + summary_description_text = qtn_lcam_set_iso_auto_ex_v2; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityLow; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_low; + summary_title_text = qtn_lcam_set_iso_low; + summary_description_text = qtn_lcam_set_iso_low_ex_v2; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityMed; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_medium; + summary_title_text = qtn_lcam_set_iso_medium; + summary_description_text = qtn_lcam_set_iso_medium_ex_v2; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityHigh; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_high; + summary_title_text = qtn_lcam_set_iso_high; + summary_description_text = qtn_lcam_set_iso_high_ex_v2; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_extended_light_sensitivity +// Light sensitivity listbox item names and icons +// (Displayed in InfoListBox) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_extended_light_sensitivity + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_auto; + setting_value_id = ECamLightSensitivityAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_auto; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_low; + setting_value_id = ECamLightSensitivityLow; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_low_medium; + setting_value_id = ECamLightSensitivityLowMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_low; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_medium; + setting_value_id = ECamLightSensitivityMed; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medium; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_medium_high; + setting_value_id = ECamLightSensitivityMedHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_medhigh; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_iso_high; + setting_value_id = ECamLightSensitivityHigh; + bitmap_id = EMbmCameraappQgn_indi_cam4_iso_high; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_capture_setup_list_extended_light_sensitivity_summary +// Light sensitivity listbox item summaries +// (Displayed in InfoListBoxContainer) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_setup_list_extended_light_sensitivity_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityAuto; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_auto; + summary_title_text = qtn_lcam_set_iso_auto; + summary_description_text = qtn_lcam_set_iso_auto_ex_v2; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityLow; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_low; + summary_title_text = qtn_lcam_set_iso_low; + summary_description_text = qtn_lcam_set_iso_low_ex_v2; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityLowMed; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_low; + summary_title_text = qtn_lcam_set_iso_low_medium; + summary_description_text = qtn_lcam_set_iso_low_medium_ex_v2; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityMed; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_medium; + summary_title_text = qtn_lcam_set_iso_medium; + summary_description_text = qtn_lcam_set_iso_medium_ex_v2; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityMedHigh; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_medhigh; + summary_title_text = qtn_lcam_set_iso_medium_high; + summary_description_text = qtn_lcam_set_iso_medium_high_ex_v2; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamLightSensitivityHigh; + summary_icon = EMbmCameraappQgn_indi_cam4_iso_high; + summary_title_text = qtn_lcam_set_iso_high; + summary_description_text = qtn_lcam_set_iso_high_ex_v2; + } + }; + } + + + +// --------------------------------------------------------- +// Viewfinder grid + +// --------------------------------------------------------- +// +// r_cam_active_palette_vf_grid_set_array +// +// Lists the ids, tooltip texts and bitmaps used by the +// viewfinder grid setup active palette item. +// +// --------------------------------------------------------- +// +RESOURCE CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY r_cam_active_palette_vf_grid_set_array + { + id = ECamSettingItemViewfinderGrid; + text = qtn_lcam_tt_show_viewfinder_grid; + capture_setup_menu_item = + { + // The icons indicate the current setting value. + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamViewfinderGridOn; + bitmap = EMbmCameraappQgn_indi_cam4_viewfinder_on; + }, + CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + id = ECamViewfinderGridOff; + bitmap = EMbmCameraappQgn_indi_cam4_viewfinder_off; + } + }; + } + + +// --------------------------------------------------------- +// r_cam_active_palette_vf_grid_tooltip_array +// +// Array for viewfinder grid active palette item tooltips. +// --------------------------------------------------------- +// +RESOURCE ARRAY r_cam_active_palette_vf_grid_tooltip_array + { + items = + { + // These are indexed in CamActivePaletteHander with values of type + // TCamVfGridState based on current setting value. + // + // Note the order of texts: + // When current value is ECamViewfinderGridOn (0) the tooltip + // must be "hide viewfinder grid" and vice versa. + CAM_AP_TT_ITEM { text = qtn_lcam_tt_hide_viewfinder_grid; }, + CAM_AP_TT_ITEM { text = qtn_lcam_tt_show_viewfinder_grid; } + }; + } + + +//#endif //CAMERAAPP_PLUGIN_BUILD + +//**************************************************************** +// THE FOLLOWING ARE RESOURCES NEEDED BY SETTINGS PLUGIN AND CAMERA +//*************************************************************** + +//---------------------------------------------------- +// +// r_cam_quality_slider_shaft +// Location for the quality slider shaft +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_quality_slider_shaft + { + l = 44; + t = 16; + W = 12; + H = 155; + } + +//---------------------------------------------------- +// +// r_cam_quality_slider_shaft_ah +// Location for the quality slider shaft (Arabic/Hebrew) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_quality_slider_shaft_ah + { + r = 44; + t = 16; + W = 12; + H = 155; + } + +//---------------------------------------------------- +// +// r_cam_quality_slider_thumb +// Location for the quality slider thumb +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_quality_slider_thumb + { + l = 40; + t = 0; // not used + W = 13; + H = 7; + } + +//---------------------------------------------------- +// +// r_cam_quality_slider_thumb_ah +// Location for the quality slider thumb (Arabic/Hebrew) +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_quality_slider_thumb_ah + { + r = 40; + t = 0; // not used + W = 13; + H = 7; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/data/CamSettings.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/data/CamSettings.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,3275 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + + +#include "CamSettings.hrh" +#include "CamProductSpecificSettings.hrh" +#include // CommonDialogs Enumerations +#include // CommonDialogs Resource structures +#include +#include // text_softkey_back + + +#define KSettingQualitySliderOffsety 20 +#define KSettingQualitySliderRectTLx 68 +#define KSettingQualitySliderRectTLy 25 +#define KSettingQualitySliderRectWidth 244 +#define KSettingQualitySliderRectHeight 150 + +#define KSettingQualitySliderInsideFontOffsetx 8 +#define KSettingQualitySliderInsideRectBorderWidth 4 +#define KSettingQualitySliderInsideFontRightLimit (KScreenWidthCC - (KSettingQualitySliderRectTLx + KSettingQualitySliderRectWidth - KSettingQualitySliderInsideFontOffsetx)) +#define KSettingQualitySliderInsideTopRectHeight 95 + +#define KCamLocationAdjustBoxSizes 35//20+15 + +#define KCamLocationSummaryRectLeftX (178 - KCamLocationAdjustBoxSizes) +#define KCamLocationSummaryRectTop (36 - 30) +#define KCamLocationSummaryRectWidth (141 - 5 + KCamLocationAdjustBoxSizes) +#define KCamLocationSummaryRectHeight 187-10 + +#define KCamLocationSummaryInnerRectLeftX (181 - KCamLocationAdjustBoxSizes) +#define KCamLocationSummaryInnerRectTop (38 - 30) +#define KCamLocationSummaryInnerRectWidth (137 - 5 + KCamLocationAdjustBoxSizes) +#define KCamLocationSummaryInnerRectHeight 183-10 + +#define KCamLocationSummaryIconLeftX (190 - KCamLocationAdjustBoxSizes) +#define KCamLocationSummaryIconTop (47 - 30) +#define KCamLocationSummaryIconWidth 0 +#define KCamLocationSummaryIconHeight 30 + +#define KCamLocationSummaryDescrFontColor 215//213 +#define KCamLocationSummaryDescrLeftX (192 - KCamLocationAdjustBoxSizes)//=172-15 +#define KCamLocationSummaryDescrRightX 12//27//8 +#define KCamLocationSummaryDescrWidth (116 + KCamLocationAdjustBoxSizes)//=151//(125 + KCamLocationAdjustBoxSizes)//121 + +#define KCamLocationSummaryTitleBaseline1 34//74-20-20//(94 - 45)=49=74-20 +#define KCamLocationSummaryTitleBaseline2 48//88-20-20//(109 - 45)=64=88-24 +#define KCamLocationSummaryTitleBaseline3 62//102-20-20//(124 - 45)=79=102-23 +#define KCamLocationSummaryTitleBaseline4 76//116-20-20//(139 - 45)=94=116-22 +#define KCamLocationSummaryTitleBaseline5 90//130-20-20//(154 - 45) +#define KCamLocationSummaryTitleBaseline6 104//144-20-20//(169 - 45) +#define KCamLocationSummaryTitleBaseline7 118//158-20-20//(184 - 45) +#define KCamLocationSummaryTitleBaseline8 132//172-20-20//(199 - 45) +#define KCamLocationSummaryTitleBaseline9 146//186-20-20//(214 - 45) +#define KCamLocationSummaryTitleBaseline10 160//200-20-20//(229 - 45) + +#define KCamLocationListboxLeftX 10 +#define KCamLocationListboxTop 8 +#define KCamLocationListboxWidth (166 - KCamLocationAdjustBoxSizes) +#define KCamLocationListboxHeight 182 + + + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE +// Text association with MSK ( CHANGE ) +// +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppChange; + txt = qtn_msk_change; + } + }; + } + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__SELECT +// Text association with MSK ( CHANGE ) +// +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__SELECT + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeySelect; + txt = text_softkey_select; + } + }; + } + + + +RESOURCE CBA R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeySelect; + txt = text_softkey_ok; + }, + CBA_BUTTON + { + id=EAknSoftkeyCancel; + txt = text_softkey_cancel; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppChange; + txt = qtn_msk_change; + } + }; + } + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE +// Text association with MSK ( Capture ) +// Only used for still embedded views +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppCapture; + txt = ""; + } + }; + } + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE_SECONDARY +// Text association with MSK ( Capture ) +// Only used for still embedded views +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE_SECONDARY + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppCapture; + txt = qtn_lcam_msk_capture; + } + }; + } + + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD +// Text association with MSK ( Record ) +// Only used for video embedded views +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppRecord; + txt = ""; + } + }; + } + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD_SECONDARY +// Text association with MSK ( Record ) +// Only used for video embedded views +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD_SECONDARY + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppRecord; + txt = qtn_lcam_msk_record; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_back_toggletoolbar +// Text association with MSK ( Toggle Active Toolbar ) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_options_back_toggletoolbar + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamCmdToggleActiveToolbar; + txt = ""; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_back_toggletoolbar_portrait +// Text association with MSK ( Toggle Active Toolbar ) +// in portrait mode +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_options_back_toggletoolbar_portrait + { + flags = EEikButtonGroupAddToStack; + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamCmdToggleActiveToolbar; + txt = ""; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_back_toggletoolbar_burst +// Text association with MSK ( Toggle Active Toolbar ) +// in burst post mode +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_options_back_toggletoolbar_burst + { + flags = EEikButtonGroupAddToStack; + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamCmdToggleActiveToolbar; + txt = ""; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_album_list_title +// Title used in album list popup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_album_list_title + { + buf = qtn_lcam_select_album; + } + +//---------------------------------------------------- +// +// r_cam_add_to_album_land_title +// Title used in Landscape mode +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_add_to_album_land_title + { + buf = qtn_lcam_set_land_img_add_toalbum_no; + } + + +//---------------------------------------------------- +// +// r_cam_add_to_album_port_title +// Title used in Landscape mode +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_add_to_album_port_title + { + buf = qtn_lcam_set_port_img_add_toalbum_no; + } + +//---------------------------------------------------- +// +// r_cam_album_note_noalbums +// Prompt used in album list popup when no albums +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_album_note_noalbums + { + buf = qtn_lcam_note_noalbums; + } + +//---------------------------------------------------- +// +// r_cam_engine_updateafterprepare +// Specifies whether device needs to have all settings updated for the engine +// after each prepare engine call. +// +//---------------------------------------------------- +// +RESOURCE CAM_ENGINE_UPDATE r_cam_engine_update + { + update = 1; + } + +//---------------------------------------------------- +// +// r_cam_photo_dynamic_settings_data +// Default values for the photo dynamic setting items +// +//---------------------------------------------------- +// +RESOURCE CAM_SETTING_ITEMS_DATA r_cam_photo_dynamic_settings_data + { + // These items must be in the same order as the resource + // for user scene settings r_cam_user_scene_settings_data + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoWhiteBalance; + default = ECamWhiteBalanceAWB; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoExposure; + default = ECamExposureZero; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoColourFilter; + default = ECamColourFilterColour; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoFlash; + default = ECamFlashAuto; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoScene; + default = ECamSceneAuto; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoBrightness; + default = ECamBrightnessNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoContrast; + default = ECamContrastNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoImageSharpness; + default = ECamImageSharpnessNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoColourSaturation; + default = ECamColourSaturationNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicSelfTimer; + default = ECamSelfTimerOff; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoLightSensitivity; + default = ECamLightSensitivityAuto; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemViewfinderGrid; + default = ECamViewfinderGridOff; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_resolution_array +// Mapping of photo resolution settings +// to actual numeric parameters. +// +//---------------------------------------------------- +// +RESOURCE CAM_RESOLUTION_ARRAY r_cam_photo_resolution_array + { + resolutions = + { + // VGA + CAM_RESOLUTION + { + width = 640; + height = 480; + }, + // SVGA + CAM_RESOLUTION + { + width = 800; + height = 600; + }, + // XGA + CAM_RESOLUTION + { + width = 1024; + height = 768; + }, + // 1M + CAM_RESOLUTION + { + width = 1152; + height = 864; + }, + // 1.3MP + CAM_RESOLUTION + { + width = 1280; + height = 960; + }, + // 2MP + CAM_RESOLUTION + { + width = 1600; + height = 1200; + }, + // 3MP + CAM_RESOLUTION + { + width = 2048; + height = 1536; + }, + // 5MP + CAM_RESOLUTION + { + width = 2592; + height = 1944; + }, + // 8MP + CAM_RESOLUTION + { + width = 3264; + height = 2448; + }, + // 12MP + CAM_RESOLUTION + { + width = 4000; + height = 3000; + }, + // 6MP 16:9 + CAM_RESOLUTION + { + width = 3264; + height = 1832; + }, + // 9MP 16:9 + CAM_RESOLUTION + { + width = 4000; + height = 2248; + }, + // CIF + CAM_RESOLUTION + { + width = 354; + height = 288; + }, + // QVGA + CAM_RESOLUTION + { + width = 320; + height = 240; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_setting_photo_quality_slider +// Resource for the photo quality slider in quality setting page +// +//---------------------------------------------------- +// +RESOURCE CAM_QUALITY_SLIDER r_cam_setting_photo_quality_slider + { + title_text = qtn_lcam_sett_title_ph_resolut; + subtitle_text_top = qtn_lcam_quality_subtitle_maximum; + subtitle_text_bottom = qtn_lcam_quality_subtitle_minimum; + remaining_text = qtn_lcam_image_remain; + setting_title_texts = + { + LBUF { txt = qtn_lcam_sett_attr_quality_print12largem; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print9mlarge; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print8mlarge; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print6mlarge; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print5mlarge; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print3mlarge; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print2mlarge; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print3mmed; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print2mmed; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print1med; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print1_3small; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print1_0small; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print0_8med; }, + LBUF { txt = qtn_lcam_sett_attr_quality_mms; } + }; + setting_desc_texts = + { + LBUF { txt = qtn_lcam_descr_quality_print12m; }, // high quality + LBUF { txt = qtn_lcam_descr_quality_print9m; }, + LBUF { txt = qtn_lcam_descr_quality_print8m; }, // high quality + LBUF { txt = qtn_lcam_descr_quality_print6m; }, + LBUF { txt = qtn_lcam_descr_quality_print5m; }, // high quality + LBUF { txt = qtn_lcam_descr_quality_print3m; }, + LBUF { txt = qtn_lcam_descr_quality_print2m; }, + LBUF { txt = qtn_lcam_descr_quality_print3m; }, + LBUF { txt = qtn_lcam_descr_quality_print2m; }, + LBUF { txt = qtn_lcam_descr_quality_print1m; }, + LBUF { txt = qtn_lcam_descr_quality_print1_3m; }, + LBUF { txt = qtn_lcam_descr_quality_print1m; }, + LBUF { txt = qtn_lcam_descr_quality_email; }, + LBUF { txt = qtn_lcam_descr_quality_low; } + }; + setting_enum = + { + ECamImageQualityPrint12m, + ECamImageQualityPrintW9m, + ECamImageQualityPrint8m, + ECamImageQualityPrintW6m, + ECamImageQualityPrint5m, + ECamImageQualityPrint3m, // 3 MegaPixel print quality + ECamImageQualityPrint2m, // 2 MegaPixel print quality + ECamImageQualityPrint1_3m, // 1.3 MegaPixel print quality + ECamImageQualityEmail1m, + ECamImageQualityEmail08m, + ECamImageQualityEmail05m, + ECamImageQualityMMS + }; + } + + +//---------------------------------------------------- +// +// r_cam_setting_quality_slider_layout +// Layout for the quality slider in quality setting page +// +//---------------------------------------------------- +// +RESOURCE CAM_QUALITY_SLIDER_LAYOUT r_cam_setting_quality_slider_layout + { + slider_position = + { + POINT { x = 10; y = 4; } + }; + subtitle_top = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx; r=2; B=16; W=135; J=ELayoutAlignLeft; } + }; + subtitle_bottom = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx; r=2; B=186; W=135; J=ELayoutAlignLeft;} + }; + setting_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontPrimaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=47; W=KSettingQualitySliderInsideFontRightLimit; J=ELayoutAlignLeft; } + }; + setting_descriptions = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=68; W=120; J=ELayoutAlignLeft; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=88; W=120; J=ELayoutAlignLeft; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=108; W=120; J=ELayoutAlignLeft; } + }; + remaining_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=143; W=120; J=ELayoutAlignLeft; } + }; + remaining_text = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=92; B=163; W=20; J=ELayoutAlignLeft; } + }; + storage_icon = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + 52; t = 155; W = 18; H = 22; } + }; + desc_rect = + { + AVKON_LAYOUT_RECT { C = 215; l = KSettingQualitySliderRectTLx; t = KSettingQualitySliderRectTLy; W = KSettingQualitySliderRectWidth; + H = KSettingQualitySliderRectHeight; } + }; + desc_inner_rect1 = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideRectBorderWidth; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderInsideTopRectHeight; } + }; + desc_inner_rect2 = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideTopRectHeight + KSettingQualitySliderInsideRectBorderWidth * 2; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderRectHeight - KSettingQualitySliderInsideTopRectHeight - 3*KSettingQualitySliderInsideRectBorderWidth; } + }; + } + +//---------------------------------------------------- +// +// r_cam_setting_quality_slider_layout_ah +// Layout for the quality slider in quality setting page +// +//---------------------------------------------------- +// +RESOURCE CAM_QUALITY_SLIDER_LAYOUT r_cam_setting_quality_slider_layout_ah + { + slider_position = + { + POINT { x = 255; y = 10; } + }; + subtitle_top = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx; l=2; B=16; W=135; J=ELayoutAlignRight; } + }; + subtitle_bottom = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx; l=2; B=186; W=135; J=ELayoutAlignRight;} + }; + setting_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontPrimaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=KSettingQualitySliderInsideFontRightLimit; B=47; W=KSettingQualitySliderInsideFontRightLimit; J=ELayoutAlignRight; } + }; + setting_descriptions = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=KSettingQualitySliderInsideFontRightLimit; B=68; W=120; J=ELayoutAlignRight; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=KSettingQualitySliderInsideFontRightLimit; B=88; W=120; J=ELayoutAlignRight; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=KSettingQualitySliderInsideFontRightLimit; B=108; W=120; J=ELayoutAlignRight; } + }; + remaining_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=KSettingQualitySliderInsideFontRightLimit; B=143; W=120; J=ELayoutAlignRight; } + }; + remaining_text = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=92; B=163; W=20; J=ELayoutAlignRight; } + }; + storage_icon = + { + AVKON_LAYOUT_RECT { r = KSettingQualitySliderRectTLx + 52; t = 155; W = 18; H = 22; } + }; + desc_rect = + { + AVKON_LAYOUT_RECT { C = 215; r = KSettingQualitySliderRectTLx; t = KSettingQualitySliderRectTLy; W = KSettingQualitySliderRectWidth; + H = KSettingQualitySliderRectHeight; } + }; + desc_inner_rect1 = + { + AVKON_LAYOUT_RECT { r = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideRectBorderWidth; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderInsideTopRectHeight; } + }; + desc_inner_rect2 = + { + AVKON_LAYOUT_RECT { r = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideTopRectHeight + KSettingQualitySliderInsideRectBorderWidth * 2; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderRectHeight - KSettingQualitySliderInsideTopRectHeight - 3*KSettingQualitySliderInsideRectBorderWidth; } + }; + } + +//---------------------------------------------------- +// +// r_cam_setting_quality_slider_layout_apac +// Layout for the quality slider in quality setting page +// +//---------------------------------------------------- +// +RESOURCE CAM_QUALITY_SLIDER_LAYOUT r_cam_setting_quality_slider_layout_apac + { + slider_position = + { + POINT { x = 10; y = 4; } + }; + subtitle_top = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx; r=2; B=16; W=135; J=ELayoutAlignLeft; } + }; + subtitle_bottom = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx; r=2; B=186; W=135; J=ELayoutAlignLeft;} + }; + setting_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontPrimaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=47; W=KSettingQualitySliderInsideFontRightLimit; J=ELayoutAlignLeft; } + }; + setting_descriptions = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=68; W=120; J=ELayoutAlignLeft; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=88; W=120; J=ELayoutAlignLeft; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=108; W=120; J=ELayoutAlignLeft; } + }; + remaining_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=143; W=120; J=ELayoutAlignLeft; } + }; + remaining_text = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=92; B=163; W=20; J=ELayoutAlignLeft; } + }; + storage_icon = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + 52; t = 155; W = 18; H = 22; } + }; + desc_rect = + { + AVKON_LAYOUT_RECT { C = 215; l = KSettingQualitySliderRectTLx; t = KSettingQualitySliderRectTLy; W = KSettingQualitySliderRectWidth; + H = KSettingQualitySliderRectHeight; } + }; + desc_inner_rect1 = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideRectBorderWidth; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderInsideTopRectHeight; } + }; + desc_inner_rect2 = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideTopRectHeight + KSettingQualitySliderInsideRectBorderWidth * 2; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderRectHeight - KSettingQualitySliderInsideTopRectHeight - 3*KSettingQualitySliderInsideRectBorderWidth; } + }; + } + +//---------------------------------------------------- +// +// r_cam_setting_video_quality_slider +// Resource for the video quality slider in quality setting page +// +//---------------------------------------------------- +// +RESOURCE CAM_QUALITY_SLIDER r_cam_setting_video_quality_slider + { + title_text = qtn_lcam_sett_title_vi_type; + subtitle_text_top = qtn_lcam_quality_subtitle_vmax; + subtitle_text_bottom = qtn_lcam_quality_subtitle_vmin; + remaining_text = qtn_lcam_video_remain; + setting_title_texts = + { + LBUF { txt = qtn_lcam_set_type_highdefinition; }, + LBUF { txt = qtn_lcam_set_type_widescreen; }, + LBUF { txt = qtn_lcam_set_type_tvhigh; }, + LBUF { txt = qtn_lcam_set_type_high; }, + LBUF { txt = qtn_lcam_set_type_widescreen; }, + LBUF { txt = qtn_lcam_set_type_widescr_normal; }, + LBUF { txt = qtn_lcam_set_type_tvnorm; }, + LBUF { txt = qtn_lcam_set_type_normal; }, + LBUF { txt = qtn_lcam_set_type_webhigh; }, + LBUF { txt = qtn_lcam_set_type_webnorm; }, + LBUF { txt = qtn_lcam_set_type_mms; }, + LBUF { txt = qtn_lcam_set_type_sharing; } + }; + setting_desc_texts = + { + LBUF { txt = qtn_lcam_descr_quality_highdefinition; }, + LBUF { txt = qtn_lcam_descr_quality_widescreen; }, + LBUF { txt = qtn_lcam_descr_quality_tvhigh; }, + LBUF { txt = qtn_lcam_descr_quality_vhigh; }, + LBUF { txt = qtn_lcam_descr_quality_widescreen; }, + LBUF { txt = qtn_lcam_descr_quality_widescr_normal; }, + LBUF { txt = qtn_lcam_descr_quality_tvnorm; }, + LBUF { txt = qtn_lcam_descr_quality_vnorm; }, + LBUF { txt = qtn_lcam_descr_quality_webhigh; }, + LBUF { txt = qtn_lcam_descr_quality_webnorm; }, + LBUF { txt = qtn_lcam_descr_quality_vshare; }, + LBUF { txt = qtn_lcam_descr_quality_vshare; } + }; + setting_enum = + { + ECamVideoQualityHigh, + ECamVideoQualityNormalHigh, + ECamVideoQualityNormal, + ECamVideoQualityNormalLow, + ECamVideoQualitySharing + }; + } + + +// Video and Photo options menu + +//---------------------------------------------------- +// +// r_cam_video_settings_title_name +// Title name used in video settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_video_settings_title_name + { + txt = qtn_lcam_title_text_vidsetting; + } + +//---------------------------------------------------- +// +// r_cam_photo_settings_title_name +// Title name used in photo settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_photo_settings_title_name + { + txt = qtn_lcam_title_text_photsetting; + } + +//---------------------------------------------------- +// +// r_cam_photo_location_settings_title_name +// Title name used in photo location settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_photo_location_settings_title_name + { + txt = qtn_lcam_sett_attr_ph_location_setting; + } + +//---------------------------------------------------- +// +// r_cam_setting_list_view +// Video and Photo settings view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_setting_list_view + { + menubar = r_cam_settings_list_menubar; + cba = R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE; + } + +//---------------------------------------------------- +// +// r_cam_settings_list_menubar +// Menubar visible in Image Settings and Video Settings views +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_settings_list_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_settings_list_menu; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_settings_list_menu +// Menu visible in video and photo views +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_settings_list_menu + { + items = + { + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +// ---------------------------------------------------------------------------- +// +// r_setting_page_extension +// +// ---------------------------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE_EXTENSION r_setting_page_extension + { + flags = KAknSettingPageNoEmbeddedSoftKeys; + } + + +//---------------------------------------------------- +// +// r_cam_settings_quality_settings_page +// setting page resource for the quality slider +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_cam_settings_quality_settings_page + { + // the type and editor resource are included so that the + // settings page can be constructed without crashing but are not used + // The custom quality control is used instead + type = EAknCtPopupSettingList; + editor_resource_id = r_cam_setting_listbox; + softkey_resource = R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT; + extension = r_setting_page_extension; + } + + +// VIDEO SETTINGS RESOURCES + +//---------------------------------------------------- +// +// r_cam_video_settings_item_list_camcorder +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_ITEM_LIST r_cam_video_settings_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_video_quality_texts; + name = qtn_lcam_sett_attr_vi_type; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoStab; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_vid_stable; + name = qtn_lcam_sett_attr_vid_stable; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoAudioRec; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_audiomute_land; + name = qtn_lcam_sett_attr_audio_rec; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemContinuousAutofocus; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_continuous_af; + name = qtn_lcam_sett_attr_cont_af; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoShowCapturedVideo; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_vid_showcap_land; + name = qtn_lcam_sett_attr_post_vi; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_video_name; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_video_settings_with_location_item_list_camcorder +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_ITEM_LIST r_cam_video_settings_with_location_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_video_quality_texts; + name = qtn_lcam_sett_attr_vi_type; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRecLocation; + // The quality page resource is used to prevent crashing in the construction phase + // The type and editor resource are included but are not used + // The custom quality control is used instead + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_photo_location_texts; + name = qtn_lcam_sett_attr_rec_location; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoStab; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_vid_stable; + name = qtn_lcam_sett_attr_vid_stable; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoAudioRec; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_audiomute_land; + name = qtn_lcam_sett_attr_audio_rec; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemContinuousAutofocus; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_continuous_af; + name = qtn_lcam_sett_attr_cont_af; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoShowCapturedVideo; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_vid_showcap_land; + name = qtn_lcam_sett_attr_post_vi; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_video_name; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_video_settings_item_list_portrait +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_ITEM_LIST r_cam_video_settings_item_list_portrait + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoAudioRec; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_audiomute_port; + name = qtn_lcam_sett_attr_audio_rec; + }, + + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoShowCapturedVideo; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_vid_showcap_port; + name = qtn_lcam_sett_attr_post_vi; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_video_name; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_embedded_video_settings_item_list_camcorder +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_embedded_video_settings_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_video_quality_texts; + name = qtn_lcam_sett_attr_vi_type; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoAudioRec; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_audiomute_land; + name = qtn_lcam_sett_attr_audio_rec; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemContinuousAutofocus; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_continuous_af; + name = qtn_lcam_sett_attr_cont_af; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_embedded_video_settings_item_list_portrait +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_embedded_video_settings_item_list_portrait + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoAudioRec; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_audiomute_port; + name = qtn_lcam_sett_attr_audio_rec; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_video_quality_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_video_quality_texts + { + setting_texts_resource = r_cam_video_quality_text_array; + } + +//---------------------------------------------------- +// r_cam_video_resolution_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_video_resolution_texts + { + setting_texts_resource = r_cam_video_resolution_text_array; + } + +// IMAGE SETTINGS RESOURCES + + +//---------------------------------------------------- +// +// r_cam_settings_list_settings_page +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_PAGE +r_cam_settings_list_settings_page + { + type = EAknCtPopupSettingList; + editor_resource_id = r_cam_setting_listbox; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + } + + +// --------------------------------------------------------- +// +// r_cam_image_memory_selection_dialog +// Memory selection dialog +// +// --------------------------------------------------------- +// +RESOURCE MEMORYSELECTIONDIALOG r_cam_image_memory_selection_dialog + { + title = qtn_lcam_sett_attr_store; + softkey_1 = text_softkey_ok; + softkey_2 = text_softkey_cancel; + + locations = + { + LOCATION + { + root_path = text_phone_memory_root_path; + default_folder = text_images_path; + }, + LOCATION + { + root_path = text_memory_card_root_path; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_setting_listbox +// Listbox of setting page +// +// --------------------------------------------------------- +// +RESOURCE POPUP_SETTING_LIST r_cam_setting_listbox + { + flags = 0; + } + +//---------------------------------------------------- +// +// r_cam_photo_settings_item_list_camcorder +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_photo_settings_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_photo_quality_texts; + name = qtn_lcam_sett_attr_quality; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemShowCapturedPhoto; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_img_showcap_land; + name = qtn_lcam_sett_attr_post_ph; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_name_base; + }, + + // If optical zoom is supported, could use setting for digital zoom only. + // If optical zoom not supported, this setting is needed for extended zoom only. + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoDigitalZoom; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_ext_zoom_texts; + name = qtn_lcam_sett_attr_zoom; // "Extended digital zoom" + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoCaptureTone; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_capture_tone_list_texts; + name = qtn_lcam_sett_attr_tone; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemImageRotation; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_img_rotate; + name = qtn_lcam_sett_attr_tsensor; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_photo_settings_with_location_item_list_camcorder +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_photo_settings_with_location_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_photo_quality_texts; + name = qtn_lcam_sett_attr_quality; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRecLocation; + // The quality page resource is used to prevent crashing in the construction phase + // The type and editor resource are included but are not used + // The custom quality control is used instead + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_photo_location_texts; + name = qtn_lcam_sett_attr_rec_location; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemShowCapturedPhoto; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_img_showcap_land; + name = qtn_lcam_sett_attr_post_ph; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_name_base; + }, + + // If optical zoom is supported, could use setting for digital zoom only. + // If optical zoom not supported, this setting is needed for extended zoom only. + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoDigitalZoom; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_ext_zoom_texts; + name = qtn_lcam_sett_attr_zoom; // "Extended digital zoom" + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoCaptureTone; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_capture_tone_list_texts; + name = qtn_lcam_sett_attr_tone; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemImageRotation; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_img_rotate; + name = qtn_lcam_sett_attr_tsensor; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_settings_item_list_portrait +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_photo_settings_item_list_portrait + { + items = + { + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemShowCapturedPhoto; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_img_showcap_port; + name = qtn_lcam_sett_attr_post_ph; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_name_base; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_embedded_photo_settings_item_list_camcorder +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_embedded_photo_settings_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoSize; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_photo_size_texts; + name = qtn_lcam_sett_attr_ph_resolut; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_photo_quality_texts; + name = qtn_lcam_sett_attr_quality; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_embedded_photo_settings_item_list_portrait +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_embedded_photo_settings_item_list_portrait + { + items = + { + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_photo_quality_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_photo_quality_texts + { + setting_texts_resource = r_cam_photo_quality_text_array; + } + +//---------------------------------------------------- +// +// r_cam_photo_location_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_photo_location_texts + { + setting_texts_resource = r_cam_photo_location_text_array; + popped_up_texts_resource = r_cam_off_on_loc_text_list; + } + +//---------------------------------------------------- +// +// r_cam_photo_size_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_photo_size_texts + { + setting_texts_resource = r_cam_photo_size_text_array; + } + + +// --------------------------------------------------------------------------- +// Setting page texts for photo "Add to album" setting item, landscape +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_setting_texts_img_add_to_album_land + { + setting_texts_resource = r_cam_text_and_value_array_img_add_to_album_land; + popped_up_texts_resource = r_cam_text_array_img_add_to_album_land; + } + +// --------------------------------------------------------------------------- +// Setting page texts for photo "Add to album" setting item, portrait +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_setting_texts_img_add_to_album_port + { + setting_texts_resource = r_cam_text_and_value_array_img_add_to_album_port; + popped_up_texts_resource = r_cam_text_array_img_add_to_album_port; + } + +// --------------------------------------------------------------------------- +// Setting page texts for video "Add to album" setting item, landscape +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_setting_texts_vid_add_to_album_land + { + setting_texts_resource = r_cam_text_and_value_array_vid_add_to_album_land; + popped_up_texts_resource = r_cam_text_array_vid_add_to_album_land; + } + +// --------------------------------------------------------------------------- +// Setting page texts for video "Add to album" setting item, portrait +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_setting_texts_vid_add_to_album_port + { + setting_texts_resource = r_cam_text_and_value_array_vid_add_to_album_port; + popped_up_texts_resource = r_cam_text_array_vid_add_to_album_port; + } + +//---------------------------------------------------- +// +// r_cam_on_off_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +/* Only context specific setting texts to be used. +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts + { + setting_texts_resource = r_cam_on_off_text_array; + } +*/ + +// --------------------------------------------------------------------------- +// Video stabilisation setting page texts +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_vid_stable + { + setting_texts_resource = r_cam_text_array_vid_stable; + } + +// --------------------------------------------------------------------------- +// Image rotation setting page texts +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_img_rotate + { + setting_texts_resource = r_cam_text_array_img_rotate; + } + +// --------------------------------------------------------------------------- +// Show video post capture on/off setting page texts, landscape +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_vid_showcap_land + { + setting_texts_resource = r_cam_text_array_vid_showcap_land; + } + +// --------------------------------------------------------------------------- +// Show video post capture on/off setting page texts, portrait +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_vid_showcap_port + { + setting_texts_resource = r_cam_text_array_vid_showcap_port; + } + +// --------------------------------------------------------------------------- +// Show photo post capture on/off setting page texts, landscape +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_img_showcap_land + { + setting_texts_resource = r_cam_text_array_img_showcap_land; + } + +// --------------------------------------------------------------------------- +// Show photo post capture on/off setting page texts, portrait +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_img_showcap_port + { + setting_texts_resource = r_cam_text_array_img_showcap_port; + } + +//---------------------------------------------------- +// +// r_cam_on_mute_texts +// Defines list for audio enabled setting page +// +//---------------------------------------------------- +// +/* +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_mute_texts + { + setting_texts_resource = r_cam_on_mute_text_array; + } +*/ + +// --------------------------------------------------------------------------- +// Option texts for video mute audio setting, landscape +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_texts_vid_audiomute_land + { + setting_texts_resource = r_cam_text_array_audiomute_land; + } + +// --------------------------------------------------------------------------- +// Option texts for video continuous autofocus setting +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_texts_vid_continuous_af + { + setting_texts_resource = r_cam_text_array_continuous_af; + } + +// --------------------------------------------------------------------------- +// Option texts for video mute audio setting, portrait +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_texts_vid_audiomute_port + { + setting_texts_resource = r_cam_text_array_audiomute_port; + } + + +//---------------------------------------------------- +// +// r_cam_ext_zoom_texts +// Defines list for digital/extended zoom page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_ext_zoom_texts + { + setting_texts_resource = r_cam_zoom_text_array; + } + + +//---------------------------------------------------- +// +// r_cam_capture_tone_list_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_capture_tone_list_texts + { + setting_texts_resource = r_cam_capture_tone_text_and_value_array; + } + + +//---------------------------------------------------- +// +// r_cam_date_or_text_texts +// Defines list for base name setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_date_or_text_texts + { + setting_texts_resource = r_cam_date_or_text_array; + } + + +//---------------------------------------------------- +// +// r_cam_date_or_text_array +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_date_or_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamNameBaseDate; + text = qtn_lcam_set_pop_date; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamNameBaseText; + text = qtn_lcam_set_pop_text; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_photo_size_text_array +// Defines options for settings/still/image resolution. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_photo_size_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamPhotoSize2MP; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_resolut_2m; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamPhotoSizeVGA; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_resolut_vga; // Text visible in the UI + } + + }; + } + + +//---------------------------------------------------- +// +// r_cam_photo_quality_text_array +// Defines options for settings/still/image quality. +// Visible in the setting item. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_photo_quality_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint12m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print12largem; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrintW9m; // refers to id in r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print9mlarge; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint8m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print8mlarge; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrintW6m; // refers to id in r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print6mlarge; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint5m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print5mlarge; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint3m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print3mlarge; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint2m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print2mlarge; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint3m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print3mmed; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint2m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print2mmed; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityEmail1m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print1med; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint1_3m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print1_3small; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityEmail1m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print1_0small; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityEmail08m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print0_8med; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityMMS; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_mms; // Text visible in the UI + } + // Add new quality setting texts here if necessary + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_location_text_array +// Defines options for recording location. +// Visible in the setting item. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_photo_location_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamLocationOff; // refers to id in + // r_cam_image_location_array + text = qtn_lcam_location_set_off; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamLocationOn; // refers to id in + // r_cam_image_location_array + text = qtn_lcam_location_set_on; // Text visible in the UI + } + // Add new location setting texts here if necessary + }; + } + +//---------------------------------------------------- +// +// r_cam_video_quality_text_array +// Defines options for settings/video quality. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityHigh; + text = qtn_lcam_set_type_highdefinition; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityHigh; + text = qtn_lcam_set_type_widescreen; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityHigh; + text = qtn_lcam_set_type_tvhigh; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityHigh; + text = qtn_lcam_set_type_high; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormalHigh; + text = qtn_lcam_set_type_widescreen; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormalHigh; + text = qtn_lcam_set_type_widescr_normal; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormalHigh; + text = qtn_lcam_set_type_tvnorm; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormal; + text = qtn_lcam_set_type_normal; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormal; + text = qtn_lcam_set_type_webhigh; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormalLow; + text = qtn_lcam_set_type_webnorm; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualitySharing; + text = qtn_lcam_set_type_mms; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualitySharing; + text = qtn_lcam_set_type_sharing; + } + + // Add new resolutions here if necessary + }; + } + +//---------------------------------------------------- +// +// r_cam_video_resolution_text_array +// Defines options for settings/video resolution. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_resolution_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamVideoResolutionQVGA; + text = qtn_lcam_set_resolut_med; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoResolutionVGA; + text = qtn_lcam_set_resolut_lar; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoResolutionCIF; + text = qtn_lcam_set_resolut_lar; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoResolutionQCIF; + text = qtn_lcam_set_resolut_med; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoResolutionSubQCIF; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_resolut_sma; //"SubQCIF"; // Text visible in the UI + } + + // Add new resolutions here if necessary + }; + } + + +// --------------------------------------------------------------------------- +// Text and value array for image add to album setting, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_and_value_array_img_add_to_album_land + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettNo; text = qtn_lcam_set_land_img_add_toalbum_no; }, + AVKON_ENUMERATED_TEXT { value = ECamSettYes; text = qtn_lcam_set_land_img_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Text and value array for image add to album setting, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_and_value_array_img_add_to_album_port + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettNo; text = qtn_lcam_set_port_img_add_toalbum_no; }, + AVKON_ENUMERATED_TEXT { value = ECamSettYes; text = qtn_lcam_set_port_img_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Text and value array for video add to album setting, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_and_value_array_vid_add_to_album_land + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettNo; text = qtn_lcam_set_land_vid_add_toalbum_no; }, + AVKON_ENUMERATED_TEXT { value = ECamSettYes; text = qtn_lcam_set_land_vid_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Text and value array for video add to album setting, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_and_value_array_vid_add_to_album_port + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettNo; text = qtn_lcam_set_port_vid_add_toalbum_no; }, + AVKON_ENUMERATED_TEXT { value = ECamSettYes; text = qtn_lcam_set_port_vid_add_toalbum_yes; } + }; + } + + +// --------------------------------------------------------------------------- +// Option texts for photo adding to album setting, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_img_add_to_album_land + { + items = + { + LBUF { txt = qtn_lcam_set_land_img_add_toalbum_no; }, + LBUF { txt = qtn_lcam_set_land_img_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Option texts for photo adding to album setting, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_img_add_to_album_port + { + items = + { + LBUF { txt = qtn_lcam_set_port_img_add_toalbum_no; }, + LBUF { txt = qtn_lcam_set_port_img_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Option texts for video adding to album setting, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_vid_add_to_album_land + { + items = + { + LBUF { txt = qtn_lcam_set_land_vid_add_toalbum_no; }, + LBUF { txt = qtn_lcam_set_land_vid_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Option texts for video adding to album setting, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_vid_add_to_album_port + { + items = + { + LBUF { txt = qtn_lcam_set_port_vid_add_toalbum_no; }, + LBUF { txt = qtn_lcam_set_port_vid_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Video stabilisation setting texts and values +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_vid_stable + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_land_vidstab_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_land_vidstab_off; } + }; + } + +// --------------------------------------------------------------------------- +// Image rotation setting texts and values +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_img_rotate + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_land_rotate_img_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_land_rotate_img_off; } + }; + } + + +// --------------------------------------------------------------------------- +// Video post capture showing setting values and texts, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_vid_showcap_land + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_land_showcap_vid_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_land_showcap_vid_off; } + }; + } + +// --------------------------------------------------------------------------- +// Video post capture showing setting values and texts, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_vid_showcap_port + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_port_showcap_vid_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_port_showcap_vid_off; } + }; + } + +// --------------------------------------------------------------------------- +// Photo post capture showing setting values and texts, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_img_showcap_land + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_land_showcap_img_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_land_showcap_img_off; } + }; + } + +// --------------------------------------------------------------------------- +// Photo post capture showing setting values and texts, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_img_showcap_port + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_port_showcap_img_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_port_showcap_img_off; } + }; + } + + + +//---------------------------------------------------- +// +// r_cam_on_mute_text_array +// Defines text for on_mute options. +// +//---------------------------------------------------- +// +/* +RESOURCE ARRAY r_cam_on_mute_text_array + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_audio_off; } + }; + } +*/ + +// --------------------------------------------------------------------------- +// Texts array for audio mute setting on video settings, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_audiomute_land + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_land_audio_vid_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_audio_off; } + }; + } + +// --------------------------------------------------------------------------- +// Texts array for continuous autofocus setting on video settings +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_continuous_af + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_sett_attr_cont_af_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_sett_attr_cont_af_off;} + }; + } + +// --------------------------------------------------------------------------- +// Texts array for audio mute setting on video settings, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_audiomute_port + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_port_audio_vid_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_audio_off; } + }; + } + + +//---------------------------------------------------- +// +// r_cam_zoom_text_array +// Defines text for digital/extended zoom options. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_zoom_text_array + { + items = + { +// Products with optical zoom and paused extended zoom have +// [Digital zoom] +// Off, On (paused), On (continuous), +// Extended on (paused), Extended on (continuous) +// +// Products with optical zoom and on/off extended zoom have +// [Extended digital zoom] +// Off, On +// +// Products with *no* optical zoom but paused extended zoom have +// [Extended digital zoom] +// Off, On (paused), On (continuous) +// +// Products with *no* optical zoom and on/off extended zoom have +// [Extended digital zoom] +// Off, On (continuous) +// + AVKON_ENUMERATED_TEXT + { + value = ECamSettDigZoomNormalCont; + text = qtn_lcam_ex_set_off; // "Off" + }, + AVKON_ENUMERATED_TEXT + { + value = ECamSettDigZoomExtendPause; + text = qtn_lcam_ex_set_onpause; // "On (paused)" + }, + AVKON_ENUMERATED_TEXT + { + value = ECamSettDigZoomExtendCont; + text = qtn_lcam_ex_set_oncont; // "On (continuous)" + } + }; + } + + + +//---------------------------------------------------- +// +// r_cam_capture_tone_text_and_value_array +// Defines text for list of capture-tones. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_tone_text_and_value_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamSettTone1; + text = qtn_lcam_set_camera_1; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamSettTone2; + text = qtn_lcam_set_camera_2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamSettTone3; + text = qtn_lcam_set_camera_3; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamSettTone4; + text = qtn_lcam_set_camera_4; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_clip_length_text_array +// Defines text for video clip length options. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_clip_length_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamVideoClipMax; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_video_long; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoClipShort; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_video_short; // Text visible in the UI + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_video_file_type_text_array +// Defines text for video clip length options. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_file_type_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamVideoMpeg4; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_type_normal; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoH263; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_type_mobile; // Text visible in the UI + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_front_camera_video_quality_text_array +// Defines options for settings/video quality. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_front_camera_video_quality_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormal; + text = qtn_lcam_set_type_normal; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualitySharing; + text = qtn_lcam_set_type_sharing; + } + + // Add new resolutions here if necessary + }; + } + + +// --------------------------------------------------- +// +// r_cam_restore_settings_note +// Restore camera settings confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_restore_settings_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_restore_settings_note_text +// Delete confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_restore_settings_note_text + { + buf = qtn_lcam_restore_query; + } + + +//-------------------------------------------------- +// +// r_cam_off_on_loc_text_list +// Defines text for on-off options. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_off_on_loc_text_list + { + items= + { + LOCATION_SETTING_LIST_ITEM + { + item_text = qtn_lcam_location_set_off; + setting_value_id = ECamLocationOff; + }, + LOCATION_SETTING_LIST_ITEM + { + item_text = qtn_lcam_location_set_on; + setting_value_id = ECamLocationOn; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_off_on_loc_text_list_summary +// Defines text for on-off options. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_off_on_loc_text_list_summary + { + items = + { + CAM_LOCATION_SELECT_SUMMARY + { + setting_value_id = ECamLocationOff; + summary_icon = -1; + summary_description_text = qtn_lcam_descr_location_off; + }, + CAM_LOCATION_SELECT_SUMMARY + { + setting_value_id = ECamLocationOn; + summary_icon = -1; + summary_description_text = qtn_lcam_descr_location_on; + } + }; + } + + +// The following layouts are used with location setting selection +RESOURCE CAM_LOCATION_SELECT_SUMMARY_LAYOUT r_cam_location_setup_list_summary_layout + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + l = KCamLocationSummaryRectLeftX; + t = KCamLocationSummaryRectTop; + W = KCamLocationSummaryRectWidth; + H = KCamLocationSummaryRectHeight; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + l = KCamLocationSummaryInnerRectLeftX; + t = KCamLocationSummaryInnerRectTop; + W = KCamLocationSummaryInnerRectWidth; + H = KCamLocationSummaryInnerRectHeight; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + l = KCamLocationSummaryIconLeftX; + t = KCamLocationSummaryIconTop; + W = KCamLocationSummaryIconWidth; + H = KCamLocationSummaryIconHeight; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline1; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline2; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline3; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline4; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline5; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline6; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline7; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline8; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline9; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline10; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + } + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_location_setup_list_listbox_layout + { + l = KCamLocationListboxLeftX; + t = KCamLocationListboxTop; + W = KCamLocationListboxWidth; + H = KCamLocationListboxHeight; + } + + + +// The following layouts are used with location setting selection apac +RESOURCE CAM_LOCATION_SELECT_SUMMARY_LAYOUT r_cam_location_setup_list_summary_layout_apac + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + l = KCamLocationSummaryRectLeftX; + t = KCamLocationSummaryRectTop; + W = KCamLocationSummaryRectWidth; + H = KCamLocationSummaryRectHeight; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + l = KCamLocationSummaryInnerRectLeftX; + t = KCamLocationSummaryInnerRectTop; + W = KCamLocationSummaryInnerRectWidth; + H = KCamLocationSummaryInnerRectHeight; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + l = KCamLocationSummaryIconLeftX; + t = KCamLocationSummaryIconTop; + W = KCamLocationSummaryIconWidth; + H = KCamLocationSummaryIconHeight; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline1; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline2; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline3; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline4; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline5; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline6; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline7; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline8; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline9; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline10; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + } + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_location_setup_list_listbox_layout_apac + { + l = KCamLocationListboxLeftX; + t = KCamLocationListboxTop; + W = KCamLocationListboxWidth; + H = KCamLocationListboxHeight; + } + + + + +// The following layouts are used with location setting selection ah +RESOURCE CAM_LOCATION_SELECT_SUMMARY_LAYOUT r_cam_location_setup_list_summary_layout_ah + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + r = KCamLocationSummaryRectLeftX; + t = KCamLocationSummaryRectTop; + W = KCamLocationSummaryRectWidth; + H = KCamLocationSummaryRectHeight; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + r = KCamLocationSummaryInnerRectLeftX; + t = KCamLocationSummaryInnerRectTop; + W = KCamLocationSummaryInnerRectWidth; + H = KCamLocationSummaryInnerRectHeight; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + r = KCamLocationSummaryIconLeftX; + t = KCamLocationSummaryIconTop; + W = KCamLocationSummaryIconWidth; + H = KCamLocationSummaryIconHeight; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline1; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline2; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline3; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline4; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline5; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline6; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline7; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline8; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline9; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline10; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + } + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_location_setup_list_listbox_layout_ah + { + //l = KCamLocationListboxLeftX; + r = KCamLocationListboxLeftX; + t = KCamLocationListboxTop; + W = KCamLocationListboxWidth; + H = KCamLocationListboxHeight; + } + + +// ---------------------------------------------------------------------------- +// r_cam_video_setting_slider_resolution_icon_top +// video slider setting resolution indicator top icon +// ---------------------------------------------------------------------------- +RESOURCE AVKON_LAYOUT_RECT r_cam_video_setting_slider_resolution_icon_top + { + l = 9; t = 10; W = 31; H = 16; + } + +// ---------------------------------------------------------------------------- +// r_cam_video_setting_slider_resolution_icon_bottom +// video slider setting resolution indicator bottom icon +// ---------------------------------------------------------------------------- +RESOURCE AVKON_LAYOUT_RECT r_cam_video_setting_slider_resolution_icon_bottom + { + l = 9; t = 166; W = 31; H = 16; + } + +// ---------------------------------------------------------------------------- +// r_cam_image_setting_slider_resolution_icon_top +// Image setting slider resolution top icon +// ---------------------------------------------------------------------------- +RESOURCE AVKON_LAYOUT_RECT r_cam_image_setting_slider_resolution_icon_top + { + l = 6; t = 10; W = 27; H = 14; + } + + +// ---------------------------------------------------------------------------- +// r_cam_image_setting_slider_resolution_icon_bottom +// Image setting slider resolution bottom icon +// ---------------------------------------------------------------------------- +RESOURCE AVKON_LAYOUT_RECT r_cam_image_setting_slider_resolution_icon_bottom + { + l = 6; t = 166; W = 27; H = 14; + } + +//---------------------------------------------------- +// +// r_cam_postcapture_addtoalbum_setting_page +// Add to album setting items +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_addtoalbum_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_lcam_set_land_img_add_toalbum_yes; + }, + LBUF + { + txt = qtn_lcam_set_land_img_add_toalbum_no; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_postcapture_addtoalbum_setting_page +// Add to album setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_cam_addtoalbum_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_lcam_sett_attr_add_toalbum; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +// ----------------------------------------------------------------------------- +// +// r_setting_listbox +// Common listbox editor resource for setting pages with multiple selection. +// +// ----------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_setting_listbox + { + flags = EEikListBoxMultipleSelection; + } + +//---------------------------------------------------- +// +// r_lcam_sett_mem_device +// +//---------------------------------------------------- +// +RESOURCE TBUF r_lcam_sett_mem_device + { + buf = qtn_lcam_sett_mem_device; + } + +//---------------------------------------------------- +// +// r_lcam_sett_mem_mass_storage +// +//---------------------------------------------------- +// +RESOURCE TBUF r_lcam_sett_mem_mass_storage + { + buf = qtn_lcam_sett_mem_mass_storage; + } + +//---------------------------------------------------- +// +// r_lcam_sett_mem_memory_card +// +//---------------------------------------------------- +// +RESOURCE TBUF r_lcam_sett_mem_memory_card + { + buf = qtn_lcam_sett_mem_memory_card; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/data/CamSettingsV2.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/data/CamSettingsV2.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,3282 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + + +#include "CamSettings.hrh" +#include "CamProductSpecificSettings.hrh" +#include // CommonDialogs Enumerations +#include // CommonDialogs Resource structures +#include +#include // text_softkey_back + + +#define KSettingQualitySliderOffsety 20 +#define KSettingQualitySliderRectTLx 68 +#define KSettingQualitySliderRectTLy 25 +#define KSettingQualitySliderRectWidth 244 +#define KSettingQualitySliderRectHeight 150 + +#define KSettingQualitySliderInsideFontOffsetx 8 +#define KSettingQualitySliderInsideRectBorderWidth 4 +#define KSettingQualitySliderInsideFontRightLimit (KScreenWidthCC - (KSettingQualitySliderRectTLx + KSettingQualitySliderRectWidth - KSettingQualitySliderInsideFontOffsetx)) +#define KSettingQualitySliderInsideTopRectHeight 95 + +#define KCamLocationAdjustBoxSizes 35//20+15 + +#define KCamLocationSummaryRectLeftX (178 - KCamLocationAdjustBoxSizes) +#define KCamLocationSummaryRectTop (36 - 30) +#define KCamLocationSummaryRectWidth (141 - 5 + KCamLocationAdjustBoxSizes) +#define KCamLocationSummaryRectHeight 187-10 + +#define KCamLocationSummaryInnerRectLeftX (181 - KCamLocationAdjustBoxSizes) +#define KCamLocationSummaryInnerRectTop (38 - 30) +#define KCamLocationSummaryInnerRectWidth (137 - 5 + KCamLocationAdjustBoxSizes) +#define KCamLocationSummaryInnerRectHeight 183-10 + +#define KCamLocationSummaryIconLeftX (190 - KCamLocationAdjustBoxSizes) +#define KCamLocationSummaryIconTop (47 - 30) +#define KCamLocationSummaryIconWidth 0 +#define KCamLocationSummaryIconHeight 30 + +#define KCamLocationSummaryDescrFontColor 215//213 +#define KCamLocationSummaryDescrLeftX (192 - KCamLocationAdjustBoxSizes)//=172-15 +#define KCamLocationSummaryDescrRightX 12//27//8 +#define KCamLocationSummaryDescrWidth (116 + KCamLocationAdjustBoxSizes)//=151//(125 + KCamLocationAdjustBoxSizes)//121 + +#define KCamLocationSummaryTitleBaseline1 34//74-20-20//(94 - 45)=49=74-20 +#define KCamLocationSummaryTitleBaseline2 48//88-20-20//(109 - 45)=64=88-24 +#define KCamLocationSummaryTitleBaseline3 62//102-20-20//(124 - 45)=79=102-23 +#define KCamLocationSummaryTitleBaseline4 76//116-20-20//(139 - 45)=94=116-22 +#define KCamLocationSummaryTitleBaseline5 90//130-20-20//(154 - 45) +#define KCamLocationSummaryTitleBaseline6 104//144-20-20//(169 - 45) +#define KCamLocationSummaryTitleBaseline7 118//158-20-20//(184 - 45) +#define KCamLocationSummaryTitleBaseline8 132//172-20-20//(199 - 45) +#define KCamLocationSummaryTitleBaseline9 146//186-20-20//(214 - 45) +#define KCamLocationSummaryTitleBaseline10 160//200-20-20//(229 - 45) + +#define KCamLocationListboxLeftX 10 +#define KCamLocationListboxTop 8 +#define KCamLocationListboxWidth (166 - KCamLocationAdjustBoxSizes) +#define KCamLocationListboxHeight 182 + + + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE +// Text association with MSK ( CHANGE ) +// +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppChange; + txt = qtn_msk_change; + } + }; + } + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__SELECT +// Text association with MSK ( CHANGE ) +// +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__SELECT + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = EAknSoftkeySelect; + txt = text_softkey_select; + } + }; + } + +RESOURCE CBA R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeySelect; + txt = text_softkey_ok; + }, + CBA_BUTTON + { + id=EAknSoftkeyCancel; + txt = text_softkey_cancel; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppChange; + txt = qtn_msk_change; + } + }; + } + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE +// Text association with MSK ( Capture ) +// Only used for still embedded views +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppCapture; + txt = qtn_lcam_msk_capture; + } + }; + } + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE_SECONDARY +// Text association with MSK ( Capture ) +// Only used for still embedded views +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE_SECONDARY + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppCapture; + txt = qtn_lcam_msk_capture; + } + }; + } + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD +// Text association with MSK ( Record ) +// Only used for video embedded views +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppRecord; + txt = qtn_lcam_msk_record; + } + }; + } + +//---------------------------------------------------- +// +// R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD_SECONDARY +// Text association with MSK ( Record ) +// Only used for video embedded views +//---------------------------------------------------- +// +RESOURCE CBA R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD_SECONDARY + { + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamMSKCmdAppRecord; + txt = qtn_lcam_msk_record; + } + }; + } +//---------------------------------------------------- +// +// r_cam_softkeys_options_back_toggletoolbar +// Text association with MSK ( Toggle Active Toolbar ) +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_options_back_toggletoolbar + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamCmdToggleActiveToolbar; + txt = ""; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_back_toggletoolbar_portrait +// Text association with MSK ( Toggle Active Toolbar ) +// in portrait mode +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_options_back_toggletoolbar_portrait + { + flags = EEikButtonGroupAddToStack; + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamCmdToggleActiveToolbar; + txt = ""; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_back_toggletoolbar_burst +// Text association with MSK ( Toggle Active Toolbar ) +// in burst post mode +// +//---------------------------------------------------- +// +RESOURCE CBA r_cam_softkeys_options_back_toggletoolbar_burst + { + flags = EEikButtonGroupAddToStack; + buttons = + { + CBA_BUTTON + { + id=EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id=EAknSoftkeyBack; + txt = text_softkey_back; + }, + CBA_BUTTON + { + id = ECamCmdToggleActiveToolbar; + txt = ""; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_album_list_title +// Title used in album list popup +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_album_list_title + { + buf = qtn_lcam_select_album; + } + +//---------------------------------------------------- +// +// r_cam_add_to_album_land_title +// Title used in Landscape mode +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_add_to_album_land_title + { + buf = qtn_lcam_set_land_img_add_toalbum_no; + } + + +//---------------------------------------------------- +// +// r_cam_add_to_album_port_title +// Title used in Landscape mode +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_add_to_album_port_title + { + buf = qtn_lcam_set_port_img_add_toalbum_no; + } + +//---------------------------------------------------- +// +// r_cam_album_note_noalbums +// Prompt used in album list popup when no albums +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_album_note_noalbums + { + buf = qtn_lcam_note_noalbums; + } + +//---------------------------------------------------- +// +// r_cam_engine_updateafterprepare +// Specifies whether device needs to have all settings updated for the engine +// after each prepare engine call. +// +//---------------------------------------------------- +// +RESOURCE CAM_ENGINE_UPDATE r_cam_engine_update + { + update = 1; + } + +//---------------------------------------------------- +// +// r_cam_photo_dynamic_settings_data +// Default values for the photo dynamic setting items +// +//---------------------------------------------------- +// +RESOURCE CAM_SETTING_ITEMS_DATA r_cam_photo_dynamic_settings_data + { + // These items must be in the same order as the resource + // for user scene settings r_cam_user_scene_settings_data + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoWhiteBalance; + default = ECamWhiteBalanceAWB; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoExposure; + default = ECamExposureZero; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoColourFilter; + default = ECamColourFilterColour; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoFlash; + default = ECamFlashAuto; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoScene; + default = ECamSceneAuto; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoBrightness; + default = ECamBrightnessNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoContrast; + default = ECamContrastNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoImageSharpness; + default = ECamImageSharpnessNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoColourSaturation; + default = ECamColourSaturationNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicSelfTimer; + default = ECamSelfTimerOff; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicPhotoLightSensitivity; + default = ECamLightSensitivityAuto; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemViewfinderGrid; + default = ECamViewfinderGridOff; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_resolution_array +// Mapping of photo resolution settings +// to actual numeric parameters. +// +//---------------------------------------------------- +// +RESOURCE CAM_RESOLUTION_ARRAY r_cam_photo_resolution_array + { + resolutions = + { + // VGA + CAM_RESOLUTION + { + width = 640; + height = 480; + }, + // SVGA + CAM_RESOLUTION + { + width = 800; + height = 600; + }, + // XGA + CAM_RESOLUTION + { + width = 1024; + height = 768; + }, + // 1M + CAM_RESOLUTION + { + width = 1152; + height = 864; + }, + // 1.3MP + CAM_RESOLUTION + { + width = 1280; + height = 960; + }, + // 2MP + CAM_RESOLUTION + { + width = 1600; + height = 1200; + }, + // 3MP + CAM_RESOLUTION + { + width = 2048; + height = 1536; + }, + // 5MP + CAM_RESOLUTION + { + width = 2592; + height = 1944; + }, + // 8MP + CAM_RESOLUTION + { + width = 3264; + height = 2448; + }, + // 12MP + CAM_RESOLUTION + { + width = 4000; + height = 3000; + }, + // 6MP 16:9 + CAM_RESOLUTION + { + width = 3264; + height = 1832; + }, + // 9MP 16:9 + CAM_RESOLUTION + { + width = 4000; + height = 2248; + }, + // CIF + CAM_RESOLUTION + { + width = 354; + height = 288; + }, + // QVGA + CAM_RESOLUTION + { + width = 320; + height = 240; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_setting_photo_quality_slider +// Resource for the photo quality slider in quality setting page +// +//---------------------------------------------------- +// +RESOURCE CAM_QUALITY_SLIDER r_cam_setting_photo_quality_slider + { + title_text = qtn_lcam_sett_title_ph_resolut; + subtitle_text_top = qtn_lcam_quality_subtitle_maximum_v2; + subtitle_text_bottom = qtn_lcam_quality_subtitle_minimum_v2; + remaining_text = qtn_lcam_image_remain_v2; + setting_title_texts = + { + LBUF { txt = qtn_lcam_sett_attr_quality_print12largem_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print9mlarge_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print8mlarge_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print6mlarge_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print5mlarge_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print3mlarge_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print2mlarge_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print3mmed_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print2mmed_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print1med_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print1_3small_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print1_0small_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_print0_8med_v2; }, + LBUF { txt = qtn_lcam_sett_attr_quality_mms_v2; } + }; + setting_desc_texts = + { + LBUF { txt = qtn_lcam_descr_quality_print12m_v2; }, // high quality + LBUF { txt = qtn_lcam_descr_quality_print9m_v2; }, + LBUF { txt = qtn_lcam_descr_quality_print8m_v2; }, // high quality + LBUF { txt = qtn_lcam_descr_quality_print6m_v2; }, + LBUF { txt = qtn_lcam_descr_quality_print5m_v2; }, // high quality + LBUF { txt = qtn_lcam_descr_quality_print3m_v2; }, + LBUF { txt = qtn_lcam_descr_quality_print2m_v2; }, + LBUF { txt = qtn_lcam_descr_quality_print3m_v2; }, + LBUF { txt = qtn_lcam_descr_quality_print2m_v2; }, + LBUF { txt = qtn_lcam_descr_quality_print1m_v2; }, + LBUF { txt = qtn_lcam_descr_quality_print1_3m_v2; }, + LBUF { txt = qtn_lcam_descr_quality_print1m_v2; }, + LBUF { txt = qtn_lcam_descr_quality_email_v2; }, + LBUF { txt = qtn_lcam_descr_quality_low_v2; } + }; + setting_enum = + { + ECamImageQualityPrint12m, + ECamImageQualityPrintW9m, + ECamImageQualityPrint8m, + ECamImageQualityPrintW6m, + ECamImageQualityPrint5m, + ECamImageQualityPrint3m, // 3 MegaPixel print quality + ECamImageQualityPrint2m, // 2 MegaPixel print quality + ECamImageQualityPrint1_3m, // 1.3 MegaPixel print quality + ECamImageQualityEmail1m, + ECamImageQualityEmail08m, + ECamImageQualityEmail05m, + ECamImageQualityMMS + }; + } + + +//---------------------------------------------------- +// +// r_cam_setting_quality_slider_layout +// Layout for the quality slider in quality setting page +// +//---------------------------------------------------- +// +RESOURCE CAM_QUALITY_SLIDER_LAYOUT r_cam_setting_quality_slider_layout + { + slider_position = + { + POINT { x = 10; y = 4; } + }; + subtitle_top = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx; r=2; B=16; W=135; J=ELayoutAlignLeft; } + }; + subtitle_bottom = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx; r=2; B=186; W=135; J=ELayoutAlignLeft;} + }; + setting_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontPrimaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=47; W=KSettingQualitySliderInsideFontRightLimit; J=ELayoutAlignLeft; } + }; + setting_descriptions = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=68; W=120; J=ELayoutAlignLeft; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=88; W=120; J=ELayoutAlignLeft; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=108; W=120; J=ELayoutAlignLeft; } + }; + remaining_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=143; W=120; J=ELayoutAlignLeft; } + }; + remaining_text = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=92; B=163; W=20; J=ELayoutAlignLeft; } + }; + storage_icon = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + 52; t = 155; W = 18; H = 22; } + }; + desc_rect = + { + AVKON_LAYOUT_RECT { C = 215; l = KSettingQualitySliderRectTLx; t = KSettingQualitySliderRectTLy; W = KSettingQualitySliderRectWidth; + H = KSettingQualitySliderRectHeight; } + }; + desc_inner_rect1 = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideRectBorderWidth; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderInsideTopRectHeight; } + }; + desc_inner_rect2 = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideTopRectHeight + KSettingQualitySliderInsideRectBorderWidth * 2; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderRectHeight - KSettingQualitySliderInsideTopRectHeight - 3*KSettingQualitySliderInsideRectBorderWidth; } + }; + } + +//---------------------------------------------------- +// +// r_cam_setting_quality_slider_layout_ah +// Layout for the quality slider in quality setting page +// +//---------------------------------------------------- +// +RESOURCE CAM_QUALITY_SLIDER_LAYOUT r_cam_setting_quality_slider_layout_ah + { + slider_position = + { + POINT { x = 255; y = 10; } + }; + subtitle_top = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx; l=2; B=16; W=135; J=ELayoutAlignRight; } + }; + subtitle_bottom = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx; l=2; B=186; W=135; J=ELayoutAlignRight;} + }; + setting_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontPrimaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=KSettingQualitySliderInsideFontRightLimit; B=47; W=KSettingQualitySliderInsideFontRightLimit; J=ELayoutAlignRight; } + }; + setting_descriptions = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=KSettingQualitySliderInsideFontRightLimit; B=68; W=120; J=ELayoutAlignRight; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=KSettingQualitySliderInsideFontRightLimit; B=88; W=120; J=ELayoutAlignRight; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=KSettingQualitySliderInsideFontRightLimit; B=108; W=120; J=ELayoutAlignRight; } + }; + remaining_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=KSettingQualitySliderInsideFontRightLimit; B=143; W=120; J=ELayoutAlignRight; } + }; + remaining_text = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; r=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + l=92; B=163; W=20; J=ELayoutAlignRight; } + }; + storage_icon = + { + AVKON_LAYOUT_RECT { r = KSettingQualitySliderRectTLx + 52; t = 155; W = 18; H = 22; } + }; + desc_rect = + { + AVKON_LAYOUT_RECT { C = 215; r = KSettingQualitySliderRectTLx; t = KSettingQualitySliderRectTLy; W = KSettingQualitySliderRectWidth; + H = KSettingQualitySliderRectHeight; } + }; + desc_inner_rect1 = + { + AVKON_LAYOUT_RECT { r = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideRectBorderWidth; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderInsideTopRectHeight; } + }; + desc_inner_rect2 = + { + AVKON_LAYOUT_RECT { r = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideTopRectHeight + KSettingQualitySliderInsideRectBorderWidth * 2; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderRectHeight - KSettingQualitySliderInsideTopRectHeight - 3*KSettingQualitySliderInsideRectBorderWidth; } + }; + } + +//---------------------------------------------------- +// +// r_cam_setting_quality_slider_layout_apac +// Layout for the quality slider in quality setting page +// +//---------------------------------------------------- +// +RESOURCE CAM_QUALITY_SLIDER_LAYOUT r_cam_setting_quality_slider_layout_apac + { + slider_position = + { + POINT { x = 10; y = 4; } + }; + subtitle_top = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx; r=2; B=16; W=135; J=ELayoutAlignLeft; } + }; + subtitle_bottom = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx; r=2; B=186; W=135; J=ELayoutAlignLeft;} + }; + setting_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontPrimaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=47; W=KSettingQualitySliderInsideFontRightLimit; J=ELayoutAlignLeft; } + }; + setting_descriptions = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=68; W=120; J=ELayoutAlignLeft; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=88; W=120; J=ELayoutAlignLeft; }, + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=108; W=120; J=ELayoutAlignLeft; } + }; + remaining_title = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=KSettingQualitySliderInsideFontRightLimit; B=143; W=120; J=ELayoutAlignLeft; } + }; + remaining_text = + { + AVKON_LAYOUT_TEXT { font = EAknLogicalFontSecondaryFont; C=215; l=KSettingQualitySliderRectTLx + KSettingQualitySliderInsideFontOffsetx; + r=92; B=163; W=20; J=ELayoutAlignLeft; } + }; + storage_icon = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + 52; t = 155; W = 18; H = 22; } + }; + desc_rect = + { + AVKON_LAYOUT_RECT { C = 215; l = KSettingQualitySliderRectTLx; t = KSettingQualitySliderRectTLy; W = KSettingQualitySliderRectWidth; + H = KSettingQualitySliderRectHeight; } + }; + desc_inner_rect1 = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideRectBorderWidth; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderInsideTopRectHeight; } + }; + desc_inner_rect2 = + { + AVKON_LAYOUT_RECT { l = KSettingQualitySliderRectTLx + KSettingQualitySliderInsideRectBorderWidth; + t = KSettingQualitySliderRectTLy + KSettingQualitySliderInsideTopRectHeight + KSettingQualitySliderInsideRectBorderWidth * 2; + W = KSettingQualitySliderRectWidth - 2*KSettingQualitySliderInsideRectBorderWidth; + H = KSettingQualitySliderRectHeight - KSettingQualitySliderInsideTopRectHeight - 3*KSettingQualitySliderInsideRectBorderWidth; } + }; + } + +//---------------------------------------------------- +// +// r_cam_setting_video_quality_slider +// Resource for the video quality slider in quality setting page +// +//---------------------------------------------------- +// +RESOURCE CAM_QUALITY_SLIDER r_cam_setting_video_quality_slider + { + title_text = qtn_lcam_sett_title_vi_type; + subtitle_text_top = qtn_lcam_quality_subtitle_vmax_v2; + subtitle_text_bottom = qtn_lcam_quality_subtitle_vmin_v2; + remaining_text = qtn_lcam_video_remain_v2; + setting_title_texts = + { + LBUF { txt = qtn_lcam_set_type_highdefinition_v2; }, + LBUF { txt = qtn_lcam_set_type_widescreen_v2; }, + LBUF { txt = qtn_lcam_set_type_tvhigh_v2; }, + LBUF { txt = qtn_lcam_set_type_high_v2; }, + LBUF { txt = qtn_lcam_set_type_widescreen_v2; }, + LBUF { txt = qtn_lcam_set_type_widescr_normal_v2; }, + LBUF { txt = qtn_lcam_set_type_tvnorm_v2; }, + LBUF { txt = qtn_lcam_set_type_normal_v2; }, + LBUF { txt = qtn_lcam_set_type_webhigh_v2; }, + LBUF { txt = qtn_lcam_set_type_webnorm_v2; }, + LBUF { txt = qtn_lcam_set_type_mms_v2; }, + LBUF { txt = qtn_lcam_set_type_sharing_v2; } + }; + setting_desc_texts = + { + LBUF { txt = qtn_lcam_descr_quality_highdefinition_v2; }, + LBUF { txt = qtn_lcam_descr_quality_widescreen_v2; }, + LBUF { txt = qtn_lcam_descr_quality_tvhigh_v2; }, + LBUF { txt = qtn_lcam_descr_quality_vhigh_v2; }, + LBUF { txt = qtn_lcam_descr_quality_widescreen_v2; }, + LBUF { txt = qtn_lcam_descr_quality_widescr_normal_v2; }, + LBUF { txt = qtn_lcam_descr_quality_tvnorm_v2; }, + LBUF { txt = qtn_lcam_descr_quality_vnorm_v2; }, + LBUF { txt = qtn_lcam_descr_quality_webhigh_v2; }, + LBUF { txt = qtn_lcam_descr_quality_webnorm_v2; }, + LBUF { txt = qtn_lcam_descr_quality_vshare_v2; }, + LBUF { txt = qtn_lcam_descr_quality_vshare_v2; } + }; + setting_enum = + { + ECamVideoQualityHigh, + ECamVideoQualityNormalHigh, + ECamVideoQualityNormal, + ECamVideoQualityNormalLow, + ECamVideoQualitySharing + }; + } + + +// Video and Photo options menu + +//---------------------------------------------------- +// +// r_cam_video_settings_title_name +// Title name used in video settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_video_settings_title_name + { + txt = qtn_lcam_title_text_vidsetting; + } + +//---------------------------------------------------- +// +// r_cam_photo_settings_title_name +// Title name used in photo settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_photo_settings_title_name + { + txt = qtn_lcam_title_text_photsetting; + } + +//---------------------------------------------------- +// +// r_cam_photo_location_settings_title_name +// Title name used in photo location settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_photo_location_settings_title_name + { + txt = qtn_lcam_sett_attr_ph_location_setting_v2; + } + +//---------------------------------------------------- +// +// r_cam_setting_list_view +// Video and Photo settings view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_setting_list_view + { + menubar = r_cam_settings_list_menubar; + cba = R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE; + } + +//---------------------------------------------------- +// +// r_cam_settings_list_menubar +// Menubar visible in Image Settings and Video Settings views +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_settings_list_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_settings_list_menu; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_settings_list_menu +// Menu visible in video and photo views +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_settings_list_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdEdit; + txt = qtn_options_change; + }, + MENU_ITEM + { + command = ECamCmdEditRestore; + txt = qtn_lcam_set_options_restore_or; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +// ---------------------------------------------------------------------------- +// +// r_setting_page_extension +// +// ---------------------------------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE_EXTENSION r_setting_page_extension + { + flags = KAknSettingPageNoEmbeddedSoftKeys; + } + + +//---------------------------------------------------- +// +// r_cam_settings_quality_settings_page +// setting page resource for the quality slider +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_cam_settings_quality_settings_page + { + // the type and editor resource are included so that the + // settings page can be constructed without crashing but are not used + // The custom quality control is used instead + type = EAknCtPopupSettingList; + editor_resource_id = r_cam_setting_listbox; + softkey_resource = R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT; + extension = r_setting_page_extension; + } + + +// VIDEO SETTINGS RESOURCES + +//---------------------------------------------------- +// +// r_cam_video_settings_item_list_camcorder +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_ITEM_LIST r_cam_video_settings_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_video_quality_texts; + name = qtn_lcam_sett_attr_vi_type; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoStab; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_vid_stable; + name = qtn_lcam_sett_attr_vid_stable; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoAudioRec; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_audiomute_land; + name = qtn_lcam_sett_attr_audio_rec; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemContinuousAutofocus; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_continuous_af; + name = qtn_lcam_sett_attr_cont_af; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoShowCapturedVideo; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_vid_showcap_land; + name = qtn_lcam_sett_attr_post_vi; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_video_name; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_video_settings_with_location_item_list_camcorder +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_ITEM_LIST r_cam_video_settings_with_location_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_video_quality_texts; + name = qtn_lcam_sett_attr_vi_type; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRecLocation; + // The quality page resource is used to prevent crashing in the construction phase + // The type and editor resource are included but are not used + // The custom quality control is used instead + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_photo_location_texts; + name = qtn_lcam_sett_attr_rec_location; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoStab; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_vid_stable; + name = qtn_lcam_sett_attr_vid_stable; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoAudioRec; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_audiomute_land; + name = qtn_lcam_sett_attr_audio_rec; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemContinuousAutofocus; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_continuous_af; + name = qtn_lcam_sett_attr_cont_af; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoShowCapturedVideo; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_vid_showcap_land; + name = qtn_lcam_sett_attr_post_vi; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_video_name; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_video_settings_item_list_portrait +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_ITEM_LIST r_cam_video_settings_item_list_portrait + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoAudioRec; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_audiomute_port; + name = qtn_lcam_sett_attr_audio_rec; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoShowCapturedVideo; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_vid_showcap_port; + name = qtn_lcam_sett_attr_post_vi; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_video_name; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_embedded_video_settings_item_list_camcorder +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_embedded_video_settings_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_video_quality_texts; + name = qtn_lcam_sett_attr_vi_type; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoAudioRec; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_audiomute_land; + name = qtn_lcam_sett_attr_audio_rec; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemContinuousAutofocus; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_continuous_af; + name = qtn_lcam_sett_attr_cont_af; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_embedded_video_settings_item_list_portrait +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_embedded_video_settings_item_list_portrait + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoAudioRec; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_texts_vid_audiomute_port; + name = qtn_lcam_sett_attr_audio_rec; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemVideoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_video_quality_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_video_quality_texts + { + setting_texts_resource = r_cam_video_quality_text_array; + } + +//---------------------------------------------------- +// r_cam_video_resolution_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_video_resolution_texts + { + setting_texts_resource = r_cam_video_resolution_text_array; + } + +// IMAGE SETTINGS RESOURCES + + +//---------------------------------------------------- +// +// r_cam_settings_list_settings_page +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_PAGE +r_cam_settings_list_settings_page + { + type = EAknCtPopupSettingList; + editor_resource_id = r_cam_setting_listbox; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + } + + +// --------------------------------------------------------- +// +// r_cam_image_memory_selection_dialog +// Memory selection dialog +// +// --------------------------------------------------------- +// +RESOURCE MEMORYSELECTIONDIALOG r_cam_image_memory_selection_dialog + { + title = qtn_lcam_sett_attr_store; + softkey_1 = text_softkey_ok; + softkey_2 = text_softkey_cancel; + + locations = + { + LOCATION + { + root_path = text_phone_memory_root_path; + default_folder = text_images_path; + }, + LOCATION + { + root_path = text_memory_card_root_path; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_setting_listbox +// Listbox of setting page +// +// --------------------------------------------------------- +// +RESOURCE POPUP_SETTING_LIST r_cam_setting_listbox + { + flags = 0; + } + +//---------------------------------------------------- +// +// r_cam_photo_settings_item_list_camcorder +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_photo_settings_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_photo_quality_texts; + name = qtn_lcam_sett_attr_quality; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemShowCapturedPhoto; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_img_showcap_land; + name = qtn_lcam_sett_attr_post_ph; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_name_base; + }, + + // If optical zoom is supported, could use setting for digital zoom only. + // If optical zoom not supported, this setting is needed for extended zoom only. + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoDigitalZoom; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_ext_zoom_texts; + name = qtn_lcam_sett_attr_zoom; // "Extended digital zoom" + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoCaptureTone; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_capture_tone_list_texts; + name = qtn_lcam_sett_attr_tone; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemImageRotation; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_img_rotate; + name = qtn_lcam_sett_attr_tsensor; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_photo_settings_with_location_item_list_camcorder +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_photo_settings_with_location_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_photo_quality_texts; + name = qtn_lcam_sett_attr_quality; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRecLocation; + // The quality page resource is used to prevent crashing in the construction phase + // The type and editor resource are included but are not used + // The custom quality control is used instead + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_photo_location_texts; + name = qtn_lcam_sett_attr_rec_location; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemShowCapturedPhoto; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_img_showcap_land; + name = qtn_lcam_sett_attr_post_ph; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_name_base; + }, + + // If optical zoom is supported, could use setting for digital zoom only. + // If optical zoom not supported, this setting is needed for extended zoom only. + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoDigitalZoom; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_ext_zoom_texts; + name = qtn_lcam_sett_attr_zoom; // "Extended digital zoom" + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoCaptureTone; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_capture_tone_list_texts; + name = qtn_lcam_sett_attr_tone; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemImageRotation; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_img_rotate; + name = qtn_lcam_sett_attr_tsensor; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_settings_item_list_portrait +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_photo_settings_item_list_portrait + { + items = + { + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemShowCapturedPhoto; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_on_off_texts_img_showcap_port; + name = qtn_lcam_sett_attr_post_ph; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoNameBaseType; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_date_or_text_texts; + name = qtn_lcam_sett_attr_name_base; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_embedded_photo_settings_item_list_camcorder +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_embedded_photo_settings_item_list_camcorder + { + items = + { + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoSize; + setting_page_resource = r_cam_settings_list_settings_page; + associated_resource = r_cam_photo_size_texts; + name = qtn_lcam_sett_attr_ph_resolut; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoQuality; + setting_page_resource = r_cam_settings_quality_settings_page; + associated_resource = r_cam_photo_quality_texts; + name = qtn_lcam_sett_attr_quality; + }, + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + }, + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemRestoreCameraSettings; + setting_page_resource = r_cam_settings_list_settings_page; + name = qtn_lcam_sett_attr_reset; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_embedded_photo_settings_item_list_portrait +// +//---------------------------------------------------- +// + +RESOURCE AVKON_SETTING_ITEM_LIST +r_cam_embedded_photo_settings_item_list_portrait + { + items = + { + + AVKON_SETTING_ITEM + { + identifier = ECamSettingItemPhotoMediaStorage; + setting_page_resource = r_cam_image_memory_selection_dialog; + name = qtn_lcam_sett_attr_store; + } + }; + + } + +//---------------------------------------------------- +// +// r_cam_photo_quality_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_photo_quality_texts + { + setting_texts_resource = r_cam_photo_quality_text_array; + } + +//---------------------------------------------------- +// +// r_cam_photo_location_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_photo_location_texts + { + setting_texts_resource = r_cam_photo_location_text_array; + popped_up_texts_resource = r_cam_off_on_loc_text_list; + } + +//---------------------------------------------------- +// +// r_cam_photo_size_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_photo_size_texts + { + setting_texts_resource = r_cam_photo_size_text_array; + } + + +// --------------------------------------------------------------------------- +// Setting page texts for photo "Add to album" setting item, landscape +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_setting_texts_img_add_to_album_land + { + setting_texts_resource = r_cam_text_and_value_array_img_add_to_album_land; + popped_up_texts_resource = r_cam_text_array_img_add_to_album_land; + } + +// --------------------------------------------------------------------------- +// Setting page texts for photo "Add to album" setting item, portrait +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_setting_texts_img_add_to_album_port + { + setting_texts_resource = r_cam_text_and_value_array_img_add_to_album_port; + popped_up_texts_resource = r_cam_text_array_img_add_to_album_port; + } + +// --------------------------------------------------------------------------- +// Setting page texts for video "Add to album" setting item, landscape +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_setting_texts_vid_add_to_album_land + { + setting_texts_resource = r_cam_text_and_value_array_vid_add_to_album_land; + popped_up_texts_resource = r_cam_text_array_vid_add_to_album_land; + } + +// --------------------------------------------------------------------------- +// Setting page texts for video "Add to album" setting item, portrait +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_setting_texts_vid_add_to_album_port + { + setting_texts_resource = r_cam_text_and_value_array_vid_add_to_album_port; + popped_up_texts_resource = r_cam_text_array_vid_add_to_album_port; + } + +//---------------------------------------------------- +// +// r_cam_on_off_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +/* Only context specific setting texts to be used. +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts + { + setting_texts_resource = r_cam_on_off_text_array; + } +*/ + +// --------------------------------------------------------------------------- +// Video stabilisation setting page texts +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_vid_stable + { + setting_texts_resource = r_cam_text_array_vid_stable; + } + +// --------------------------------------------------------------------------- +// Image rotation setting page texts +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_img_rotate + { + setting_texts_resource = r_cam_text_array_img_rotate; + } + +// --------------------------------------------------------------------------- +// Show video post capture on/off setting page texts, landscape +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_vid_showcap_land + { + setting_texts_resource = r_cam_text_array_vid_showcap_land; + } + +// --------------------------------------------------------------------------- +// Show video post capture on/off setting page texts, portrait +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_vid_showcap_port + { + setting_texts_resource = r_cam_text_array_vid_showcap_port; + } + +// --------------------------------------------------------------------------- +// Show photo post capture on/off setting page texts, landscape +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_img_showcap_land + { + setting_texts_resource = r_cam_text_array_img_showcap_land; + } + +// --------------------------------------------------------------------------- +// Show photo post capture on/off setting page texts, portrait +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_off_texts_img_showcap_port + { + setting_texts_resource = r_cam_text_array_img_showcap_port; + } + +//---------------------------------------------------- +// +// r_cam_on_mute_texts +// Defines list for audio enabled setting page +// +//---------------------------------------------------- +// +/* +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_on_mute_texts + { + setting_texts_resource = r_cam_on_mute_text_array; + } +*/ + +// --------------------------------------------------------------------------- +// Option texts for video mute audio setting, landscape +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_texts_vid_audiomute_land + { + setting_texts_resource = r_cam_text_array_audiomute_land; + } + +// --------------------------------------------------------------------------- +// Option texts for video continuous autofocus setting +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_texts_vid_continuous_af + { + setting_texts_resource = r_cam_text_array_continuous_af; + } + +// --------------------------------------------------------------------------- +// Option texts for video mute audio setting, portrait +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_texts_vid_audiomute_port + { + setting_texts_resource = r_cam_text_array_audiomute_port; + } + + +//---------------------------------------------------- +// +// r_cam_ext_zoom_texts +// Defines list for digital/extended zoom page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_ext_zoom_texts + { + setting_texts_resource = r_cam_zoom_text_array; + } + + +//---------------------------------------------------- +// +// r_cam_capture_tone_list_texts +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_capture_tone_list_texts + { + setting_texts_resource = r_cam_capture_tone_text_and_value_array; + } + + +//---------------------------------------------------- +// +// r_cam_date_or_text_texts +// Defines list for base name setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_cam_date_or_text_texts + { + setting_texts_resource = r_cam_date_or_text_array; + } + + +//---------------------------------------------------- +// +// r_cam_date_or_text_array +// Defines list for setting page +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_date_or_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamNameBaseDate; + text = qtn_lcam_set_pop_date; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamNameBaseText; + text = qtn_lcam_set_pop_text; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_photo_size_text_array +// Defines options for settings/still/image resolution. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_photo_size_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamPhotoSize2MP; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_resolut_2m; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamPhotoSizeVGA; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_resolut_vga; // Text visible in the UI + } + + }; + } + + +//---------------------------------------------------- +// +// r_cam_photo_quality_text_array +// Defines options for settings/still/image quality. +// Visible in the setting item. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_photo_quality_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint12m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print12largem_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrintW9m; // refers to id in r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print9mlarge_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint8m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print8mlarge_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrintW6m; // refers to id in r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print6mlarge_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint5m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print5mlarge_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint3m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print3mlarge_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint2m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print2mlarge_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint3m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print3mmed_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint2m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print2mmed_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityEmail1m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print1med_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityPrint1_3m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print1_3small_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityEmail1m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print1_0small_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityEmail08m; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_print0_8med_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamImageQualityMMS; // refers to id in + // r_cam_image_quality_array + text = qtn_lcam_sett_attr_quality_mms_v2; // Text visible in the UI + } + // Add new quality setting texts here if necessary + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_location_text_array +// Defines options for recording location. +// Visible in the setting item. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_photo_location_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamLocationOff; // refers to id in + // r_cam_image_location_array + text = qtn_lcam_location_set_off_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamLocationOn; // refers to id in + // r_cam_image_location_array + text = qtn_lcam_location_set_on_v2; // Text visible in the UI + } + // Add new location setting texts here if necessary + }; + } + +//---------------------------------------------------- +// +// r_cam_video_quality_text_array +// Defines options for settings/video quality. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityHigh; + text = qtn_lcam_set_type_highdefinition_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityHigh; + text = qtn_lcam_set_type_widescreen_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityHigh; + text = qtn_lcam_set_type_tvhigh_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityHigh; + text = qtn_lcam_set_type_high_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormalHigh; + text = qtn_lcam_set_type_widescreen_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormalHigh; + text = qtn_lcam_set_type_widescr_normal_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormalHigh; + text = qtn_lcam_set_type_tvnorm_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormal; + text = qtn_lcam_set_type_normal_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormal; + text = qtn_lcam_set_type_webhigh_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormalLow; + text = qtn_lcam_set_type_webnorm_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualitySharing; + text = qtn_lcam_set_type_mms_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualitySharing; + text = qtn_lcam_set_type_sharing_v2; + } + + // Add new resolutions here if necessary + }; + } + +//---------------------------------------------------- +// +// r_cam_video_resolution_text_array +// Defines options for settings/video resolution. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_resolution_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamVideoResolutionQVGA; + text = qtn_lcam_set_resolut_med; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoResolutionVGA; + text = qtn_lcam_set_resolut_lar; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoResolutionCIF; + text = qtn_lcam_set_resolut_lar; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoResolutionQCIF; + text = qtn_lcam_set_resolut_med; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoResolutionSubQCIF; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_resolut_sma; //"SubQCIF"; // Text visible in the UI + } + + // Add new resolutions here if necessary + }; + } + + +// --------------------------------------------------------------------------- +// Text and value array for image add to album setting, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_and_value_array_img_add_to_album_land + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettNo; text = qtn_lcam_set_land_img_add_toalbum_no; }, + AVKON_ENUMERATED_TEXT { value = ECamSettYes; text = qtn_lcam_set_land_img_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Text and value array for image add to album setting, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_and_value_array_img_add_to_album_port + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettNo; text = qtn_lcam_set_port_img_add_toalbum_no; }, + AVKON_ENUMERATED_TEXT { value = ECamSettYes; text = qtn_lcam_set_port_img_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Text and value array for video add to album setting, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_and_value_array_vid_add_to_album_land + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettNo; text = qtn_lcam_set_land_vid_add_toalbum_no; }, + AVKON_ENUMERATED_TEXT { value = ECamSettYes; text = qtn_lcam_set_land_vid_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Text and value array for video add to album setting, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_and_value_array_vid_add_to_album_port + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettNo; text = qtn_lcam_set_port_vid_add_toalbum_no; }, + AVKON_ENUMERATED_TEXT { value = ECamSettYes; text = qtn_lcam_set_port_vid_add_toalbum_yes; } + }; + } + + +// --------------------------------------------------------------------------- +// Option texts for photo adding to album setting, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_img_add_to_album_land + { + items = + { + LBUF { txt = qtn_lcam_set_land_img_add_toalbum_no; }, + LBUF { txt = qtn_lcam_set_land_img_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Option texts for photo adding to album setting, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_img_add_to_album_port + { + items = + { + LBUF { txt = qtn_lcam_set_port_img_add_toalbum_no; }, + LBUF { txt = qtn_lcam_set_port_img_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Option texts for video adding to album setting, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_vid_add_to_album_land + { + items = + { + LBUF { txt = qtn_lcam_set_land_vid_add_toalbum_no; }, + LBUF { txt = qtn_lcam_set_land_vid_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Option texts for video adding to album setting, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_vid_add_to_album_port + { + items = + { + LBUF { txt = qtn_lcam_set_port_vid_add_toalbum_no; }, + LBUF { txt = qtn_lcam_set_port_vid_add_toalbum_yes; } + }; + } + +// --------------------------------------------------------------------------- +// Video stabilisation setting texts and values +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_vid_stable + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_land_vidstab_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_land_vidstab_off; } + }; + } + +// --------------------------------------------------------------------------- +// Image rotation setting texts and values +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_img_rotate + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_land_rotate_img_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_land_rotate_img_off; } + }; + } + + +// --------------------------------------------------------------------------- +// Video post capture showing setting values and texts, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_vid_showcap_land + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_land_showcap_vid_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_land_showcap_vid_off; } + }; + } + +// --------------------------------------------------------------------------- +// Video post capture showing setting values and texts, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_vid_showcap_port + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_port_showcap_vid_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_port_showcap_vid_off; } + }; + } + +// --------------------------------------------------------------------------- +// Photo post capture showing setting values and texts, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_img_showcap_land + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_land_showcap_img_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_land_showcap_img_off; } + }; + } + +// --------------------------------------------------------------------------- +// Photo post capture showing setting values and texts, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_img_showcap_port + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_port_showcap_img_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_port_showcap_img_off; } + }; + } + + + +//---------------------------------------------------- +// +// r_cam_on_mute_text_array +// Defines text for on_mute options. +// +//---------------------------------------------------- +// +/* +RESOURCE ARRAY r_cam_on_mute_text_array + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_audio_off; } + }; + } +*/ + +// --------------------------------------------------------------------------- +// Texts array for audio mute setting on video settings, landscape +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_audiomute_land + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_land_audio_vid_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_audio_off; } + }; + } + +// --------------------------------------------------------------------------- +// Texts array for continuous autofocus setting on video settings +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_continuous_af + { + items = + { + + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_sett_attr_cont_af_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_sett_attr_cont_af_off;} + }; + } + +// --------------------------------------------------------------------------- +// Texts array for audio mute setting on video settings, portrait +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_text_array_audiomute_port + { + items = + { + AVKON_ENUMERATED_TEXT { value = ECamSettOn; text = qtn_lcam_set_port_audio_vid_on; }, + AVKON_ENUMERATED_TEXT { value = ECamSettOff; text = qtn_lcam_set_audio_off; } + }; + } + + +//---------------------------------------------------- +// +// r_cam_zoom_text_array +// Defines text for digital/extended zoom options. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_zoom_text_array + { + items = + { +// Products with optical zoom and paused extended zoom have +// [Digital zoom] +// Off, On (paused), On (continuous), +// Extended on (paused), Extended on (continuous) +// +// Products with optical zoom and on/off extended zoom have +// [Extended digital zoom] +// Off, On +// +// Products with *no* optical zoom but paused extended zoom have +// [Extended digital zoom] +// Off, On (paused), On (continuous) +// +// Products with *no* optical zoom and on/off extended zoom have +// [Extended digital zoom] +// Off, On (continuous) +// + AVKON_ENUMERATED_TEXT + { + value = ECamSettDigZoomNormalCont; + text = qtn_lcam_ex_set_off; // "Off" + }, + AVKON_ENUMERATED_TEXT + { + value = ECamSettDigZoomExtendPause; + text = qtn_lcam_ex_set_onpause; // "On (paused)" + }, + AVKON_ENUMERATED_TEXT + { + value = ECamSettDigZoomExtendCont; + text = qtn_lcam_ex_set_oncont; // "On (continuous)" + } + }; + } + + + +//---------------------------------------------------- +// +// r_cam_capture_tone_text_and_value_array +// Defines text for list of capture-tones. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_capture_tone_text_and_value_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamSettTone1; + text = qtn_lcam_set_camera_1; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamSettTone2; + text = qtn_lcam_set_camera_2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamSettTone3; + text = qtn_lcam_set_camera_3; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamSettTone4; + text = qtn_lcam_set_camera_4; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_clip_length_text_array +// Defines text for video clip length options. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_clip_length_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamVideoClipMax; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_video_long; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoClipShort; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_video_short; // Text visible in the UI + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_video_file_type_text_array +// Defines text for video clip length options. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_file_type_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamVideoMpeg4; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_type_normal_v2; // Text visible in the UI + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoH263; // Refers to id in + // r_cam_image_resolution_array. + text = qtn_lcam_set_type_mobile; // Text visible in the UI + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_front_camera_video_quality_text_array +// Defines options for settings/video quality. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_front_camera_video_quality_text_array + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualityNormal; + text = qtn_lcam_set_type_normal_v2; + }, + AVKON_ENUMERATED_TEXT + { + value = ECamVideoQualitySharing; + text = qtn_lcam_set_type_sharing_v2; + } + + // Add new resolutions here if necessary + }; + } + + +// --------------------------------------------------- +// +// r_cam_restore_settings_note +// Restore camera settings confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_restore_settings_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_restore_settings_note_text +// Delete confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_restore_settings_note_text + { + buf = qtn_lcam_restore_query; + } + + +//-------------------------------------------------- +// +// r_cam_off_on_loc_text_list +// Defines text for on-off options. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_off_on_loc_text_list + { + items= + { + LOCATION_SETTING_LIST_ITEM + { + item_text = qtn_lcam_location_set_off_v2; + setting_value_id = ECamLocationOff; + }, + LOCATION_SETTING_LIST_ITEM + { + item_text = qtn_lcam_location_set_on_v2; + setting_value_id = ECamLocationOn; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_off_on_loc_text_list_summary +// Defines text for on-off options. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_off_on_loc_text_list_summary + { + items = + { + CAM_LOCATION_SELECT_SUMMARY + { + setting_value_id = ECamLocationOff; + summary_icon = -1; + summary_description_text = qtn_lcam_descr_location_off_v2; + }, + CAM_LOCATION_SELECT_SUMMARY + { + setting_value_id = ECamLocationOn; + summary_icon = -1; + summary_description_text = qtn_lcam_descr_location_on_v2; + } + }; + } + + +// The following layouts are used with location setting selection +RESOURCE CAM_LOCATION_SELECT_SUMMARY_LAYOUT r_cam_location_setup_list_summary_layout + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + l = KCamLocationSummaryRectLeftX; + t = KCamLocationSummaryRectTop; + W = KCamLocationSummaryRectWidth; + H = KCamLocationSummaryRectHeight; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + l = KCamLocationSummaryInnerRectLeftX; + t = KCamLocationSummaryInnerRectTop; + W = KCamLocationSummaryInnerRectWidth; + H = KCamLocationSummaryInnerRectHeight; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + l = KCamLocationSummaryIconLeftX; + t = KCamLocationSummaryIconTop; + W = KCamLocationSummaryIconWidth; + H = KCamLocationSummaryIconHeight; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline1; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline2; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline3; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline4; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline5; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline6; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline7; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline8; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline9; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline10; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + } + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_location_setup_list_listbox_layout + { + l = KCamLocationListboxLeftX; + t = KCamLocationListboxTop; + W = KCamLocationListboxWidth; + H = KCamLocationListboxHeight; + } + + + +// The following layouts are used with location setting selection apac +RESOURCE CAM_LOCATION_SELECT_SUMMARY_LAYOUT r_cam_location_setup_list_summary_layout_apac + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + l = KCamLocationSummaryRectLeftX; + t = KCamLocationSummaryRectTop; + W = KCamLocationSummaryRectWidth; + H = KCamLocationSummaryRectHeight; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + l = KCamLocationSummaryInnerRectLeftX; + t = KCamLocationSummaryInnerRectTop; + W = KCamLocationSummaryInnerRectWidth; + H = KCamLocationSummaryInnerRectHeight; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + l = KCamLocationSummaryIconLeftX; + t = KCamLocationSummaryIconTop; + W = KCamLocationSummaryIconWidth; + H = KCamLocationSummaryIconHeight; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline1; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline2; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline3; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline4; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline5; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline6; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline7; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline8; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline9; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + l = KCamLocationSummaryDescrLeftX; + r = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline10; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignLeft; + } + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_location_setup_list_listbox_layout_apac + { + l = KCamLocationListboxLeftX; + t = KCamLocationListboxTop; + W = KCamLocationListboxWidth; + H = KCamLocationListboxHeight; + } + + + + +// The following layouts are used with location setting selection ah +RESOURCE CAM_LOCATION_SELECT_SUMMARY_LAYOUT r_cam_location_setup_list_summary_layout_ah + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + r = KCamLocationSummaryRectLeftX; + t = KCamLocationSummaryRectTop; + W = KCamLocationSummaryRectWidth; + H = KCamLocationSummaryRectHeight; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + r = KCamLocationSummaryInnerRectLeftX; + t = KCamLocationSummaryInnerRectTop; + W = KCamLocationSummaryInnerRectWidth; + H = KCamLocationSummaryInnerRectHeight; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + r = KCamLocationSummaryIconLeftX; + t = KCamLocationSummaryIconTop; + W = KCamLocationSummaryIconWidth; + H = KCamLocationSummaryIconHeight; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline1; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline2; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline3; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline4; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline5; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline6; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline7; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline8; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline9; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = KCamLocationSummaryDescrFontColor; + r = KCamLocationSummaryDescrLeftX; + l = KCamLocationSummaryDescrRightX; + B = KCamLocationSummaryTitleBaseline10; + W = KCamLocationSummaryDescrWidth; + J = ELayoutAlignRight; + } + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_location_setup_list_listbox_layout_ah + { + //l = KCamLocationListboxLeftX; + r = KCamLocationListboxLeftX; + t = KCamLocationListboxTop; + W = KCamLocationListboxWidth; + H = KCamLocationListboxHeight; + } + + +// ---------------------------------------------------------------------------- +// r_cam_video_setting_slider_resolution_icon_top +// video slider setting resolution indicator top icon +// ---------------------------------------------------------------------------- +RESOURCE AVKON_LAYOUT_RECT r_cam_video_setting_slider_resolution_icon_top + { + l = 9; t = 10; W = 31; H = 16; + } + +// ---------------------------------------------------------------------------- +// r_cam_video_setting_slider_resolution_icon_bottom +// video slider setting resolution indicator bottom icon +// ---------------------------------------------------------------------------- +RESOURCE AVKON_LAYOUT_RECT r_cam_video_setting_slider_resolution_icon_bottom + { + l = 9; t = 166; W = 31; H = 16; + } + +// ---------------------------------------------------------------------------- +// r_cam_image_setting_slider_resolution_icon_top +// Image setting slider resolution top icon +// ---------------------------------------------------------------------------- +RESOURCE AVKON_LAYOUT_RECT r_cam_image_setting_slider_resolution_icon_top + { + l = 6; t = 10; W = 27; H = 14; + } + + +// ---------------------------------------------------------------------------- +// r_cam_image_setting_slider_resolution_icon_bottom +// Image setting slider resolution bottom icon +// ---------------------------------------------------------------------------- +RESOURCE AVKON_LAYOUT_RECT r_cam_image_setting_slider_resolution_icon_bottom + { + l = 6; t = 166; W = 27; H = 14; + } + +//---------------------------------------------------- +// +// r_cam_postcapture_addtoalbum_setting_page +// Add to album setting items +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_addtoalbum_setting_page_lbx + { + items = + { + LBUF + { + txt = qtn_lcam_set_land_img_add_toalbum_yes; + }, + LBUF + { + txt = qtn_lcam_set_land_img_add_toalbum_no; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_postcapture_addtoalbum_setting_page +// Add to album setting page +// +//---------------------------------------------------- +// +RESOURCE AVKON_SETTING_PAGE r_cam_addtoalbum_setting_page + { + number = EAknSettingPageNoOrdinalDisplayed; + label = qtn_lcam_sett_attr_add_toalbum; + softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL__OK; + type = EAknSetListBox; + editor_resource_id = r_setting_listbox; + } + +// ----------------------------------------------------------------------------- +// +// r_setting_listbox +// Common listbox editor resource for setting pages with multiple selection. +// +// ----------------------------------------------------------------------------- +// +RESOURCE LISTBOX r_setting_listbox + { + flags = EEikListBoxMultipleSelection; + } + +//---------------------------------------------------- +// +// r_lcam_sett_mem_device +// +//---------------------------------------------------- +// +RESOURCE TBUF r_lcam_sett_mem_device + { + buf = qtn_lcam_sett_mem_device; + } + +//---------------------------------------------------- +// +// r_lcam_sett_mem_mass_storage +// +//---------------------------------------------------- +// +RESOURCE TBUF r_lcam_sett_mem_mass_storage + { + buf = qtn_lcam_sett_mem_mass_storage; + } + +//---------------------------------------------------- +// +// r_lcam_sett_mem_memory_card +// +//---------------------------------------------------- +// +RESOURCE TBUF r_lcam_sett_mem_memory_card + { + buf = qtn_lcam_sett_mem_memory_card; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/data/CamStillCaptureCamcorder.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/data/CamStillCaptureCamcorder.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1038 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +#define KPhotoQualitySliderLegendCentreX 20 + + +//---------------------------------------------------- +// +// r_cam_photo_quality_slider_array_camcorder +// Legend data for the photo quality slider +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_photo_quality_slider_array_camcorder + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = KPhotoQualitySliderLegendCentreX - KResolutionBurstQXGAIconWidth/2; + t = 10; + W = KResolutionBurstQXGAIconWidth; + H = KResolutionBurstQXGAIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_qxga_list; +// mask_id = EMbmCameraappQgn_indi_lcam_res_qxga_list; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = KPhotoQualitySliderLegendCentreX - KResolutionBurstUXGAIconWidth/2; + t = 62; + W = KResolutionBurstUXGAIconWidth; + H = KResolutionBurstUXGAIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_uxga_list; +// mask_id = EMbmCameraappQgn_indi_lcam_res_uxga_list; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = KPhotoQualitySliderLegendCentreX - KResolutionBurstSXGAIconWidth/2; + t = 114; + W = KResolutionBurstSXGAIconWidth; + H = KResolutionBurstSXGAIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_sxga_list; +// mask_id = EMbmCameraappQgn_indi_lcam_res_sxga_list; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = KPhotoQualitySliderLegendCentreX - KResolutionBurstVGAIconWidth/2; + t = 166; + W = KResolutionBurstVGAIconWidth; + H = KResolutionBurstVGAIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_vga_list; +// mask_id = EMbmCameraappQgn_indi_lcam_res_vga_list; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_quality_slider_array_ah_camcorder +// Legend data for the photo quality slider (Arabic/Hebrew) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_photo_quality_slider_array_ah_camcorder + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = KPhotoQualitySliderLegendCentreX - KResolutionBurstQXGAIconWidth/2; + t = 10; + W = KResolutionBurstQXGAIconWidth; + H = KResolutionBurstQXGAIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_qxga_list; +// mask_id = EMbmCameraappQgn_indi_lcam_res_qxga_list; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = KPhotoQualitySliderLegendCentreX - KResolutionBurstUXGAIconWidth/2; + t = 62; + W = KResolutionBurstUXGAIconWidth; + H = KResolutionBurstUXGAIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_uxga_list; +// mask_id = EMbmCameraappQgn_indi_lcam_res_uxga_list; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = KPhotoQualitySliderLegendCentreX - KResolutionBurstSXGAIconWidth/2; + t = 114; + W = KResolutionBurstSXGAIconWidth; + H = KResolutionBurstSXGAIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_sxga_list; +// mask_id = EMbmCameraappQgn_indi_lcam_res_sxga_list; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = KPhotoQualitySliderLegendCentreX - KResolutionBurstVGAIconWidth/2; + t = 166; + W = KResolutionBurstVGAIconWidth; + H = KResolutionBurstVGAIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_vga_list; +// mask_id = EMbmCameraappQgn_indi_lcam_res_vga_list; + } + }; + } + +//*********************************************************** +// THE FOLLOWING RESOURCES BELOW ARE COMPILED ONLY FOR CAMERA +//*********************************************************** + +#ifndef CAMERAAPP_PLUGIN_BUILD +// --------------------------------------------------- +// +// r_cam_img_precap_imgcounter +// Layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_img_precap_imgcounter + { + font = ELatinPlain12; C=0; r=237; l=51; B=233; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_imgcounter_ah +// Arabic/Hebrew layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_img_precap_imgcounter_ah + { + //font = ELatinBold12; C=0; l=23; B=234; W=100; J=ELayoutAlignLeft; + //font = ELatinPlain12; C=0; r=243; l=52; B=233; J=ELayoutAlignLeft; + font = ELatinPlain12; C=0; r=216; l=72; B=233; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_image_size_layout_camcorder +// Layout for image size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_size_layout_camcorder + { + font = EAknLogicalFontSecondaryFont; C=0; l=20; r = 320-20-50; B=234; W=50; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_image_size_layout_ah_camcorder +// Layout for image size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_size_layout_ah_camcorder + { + font = EAknLogicalFontSecondaryFont; C=35; r=20; B=234; W=100; J=ELayoutAlignRight; + } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_still_camcorder +// The size and position of the snapshot in still post capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_still_camcorder + { l = 0; t = 0; W = 320; H = 240; } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_still_rotated +// The size and position of the snapshot in still post capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_still_rotated + { l = 0; t = 0; W = 240; H = 320; } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_cif_camcorder +// The size and position of the snapshot in video post capture view +// for Large (CIF) resolutions +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_cif_camcorder + { l = 0; t = 0; W = 320; H = 240; } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_near_cif_camcorder +// The size and position of the snapshot in video post capture view +// for Large (CIF) resolutions in secondary camera +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_near_cif_camcorder + { l = 72; t = 48; W = 176; H = 144; } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_sqcif_camcorder +// The size and position of the snapshot in video post capture view +// for Small resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_sqcif_camcorder + { l = 96; t = 72; W = 128; H = 96; } + +//----------------------------------------------------------------------------- +// +// r_cam_still_displayed_rect_secondary_camcorder +// The size and position of the viewfinder frame or snapshot in still capture +// (secondary camera) +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_still_displayed_rect_secondary_camcorder + { l = 4; t = 0; W = 344; H = 264; } + +//----------------------------------------------------------------------------- +// +// r_cam_still_requested_rect_secondary_camcorder +// The size of the viewfinder and snapshot image requested from the engine in +// still capture (secondary camera). This is different from the displayed size +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_still_requested_rect_secondary_camcorder + { l = 0; t = 0; W = 352; H = 288; } + + +//---------------------------------------------------- +// +// r_cam_post_capture_image_name_layout_camcorder +// Layout for image name in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_name_layout_camcorder + { + font = EAknLogicalFontSecondaryFont; C=35; l=4; B=13; W=150; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_image_name_layout_ah_camcorder +// Arabic/Hebrew layout for video name in post-capture +// navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_name_layout_ah_camcorder + { + font = EAknLogicalFontPrimaryFont; C=35; r=9; B=13; W=100; J=ELayoutAlignRight; + } + + +//---------------------------------------------------------------------------- +// +// r_cam_still_pre_capture_ap_items_secondary +// Still pre-capture active palette items for secondary camera +// +//---------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_still_pre_capture_ap_items_secondary + { + // Note: + // Current implementation of ActivePalette2 does not + // support the positioning with index so the order + // of items here is what matters. + // !!! position attribute is ignored !!! + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemVideoModeSelect; + cmd_id = ECamCmdNewVideo; + position = ECamAPSlotPhotoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemGotoPhotos; + cmd_id = ECamCmdPhotos; + position = ECamAPSlotPhotoPreCaptureGotoPhotos; + type = ECamActivePaletteItemTypeCommand; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemSwitchCamera; + cmd_id = ECamCmdSwitchCamera; + position = ECamAPSlotPhotoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + } + }; + } + +//---------------------------------------------------------------------------- +// r_cam_still_pre_capture_ap_items_advanced +// +// Still pre-capture active palette items in advanced user mode. +// (See r_cam_still_pre_capture_ap_items_novice) +//---------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_still_pre_capture_ap_items_advanced + { + // Note: + // Current implementation of ActivePalette2 does not + // support the positioning with index so the order + // of items here is what matters. + // !!! position attribute is ignored !!! + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemVideoModeSelect; + cmd_id = ECamCmdNewVideo; + position = ECamAPSlotPhotoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoScene; + cmd_id = ECamCmdCaptureSetupSceneStill; + position = ECamAPSlotPhotoPreCaptureScene; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoFlash; + cmd_id = ECamCmdCaptureSetupFlashStill; + position = ECamAPSlotPhotoPreCaptureFlash; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemFaceTracking; + cmd_id = ECamCmdToggleFacetracking; + position = ECamAPSlotPhotoPreCaptureFacetracking; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicSelfTimer; + cmd_id = ECamCmdCaptureSetupSelfTimer; + position = ECamAPSlotPhotoPreCaptureSelfTimer; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemGotoPhotos; + cmd_id = ECamCmdPhotos; + position = ECamAPSlotPhotoPreCaptureGotoPhotos; + type = ECamActivePaletteItemTypeCommand; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemSequenceMode; + cmd_id = ECamCmdToggleMulti; + position = ECamAPSlotPhotoPreCaptureSequence; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoColourFilter; + cmd_id = ECamCmdCaptureSetupColourFilterStill; + position = ECamAPSlotPhotoPreCaptureColour; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemViewfinderGrid; + cmd_id = ECamCmdViewfinderGrid; + position = ECamAPSlotPhotoPreCaptureVfGrid; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoWhiteBalance; + cmd_id = ECamCmdCaptureSetupWhiteBalanceStill; + position = ECamAPSlotPhotoPreCaptureWB; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoExposure; + cmd_id = ECamCmdCaptureSetupExposureStill; + position = ECamAPSlotPhotoPreCaptureEV; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoImageSharpness; + cmd_id = ECamCmdCaptureSetupImageSharpnessStill; + position = ECamAPSlotPhotoPreCaptureSharpness; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoBrightness; + cmd_id = ECamCmdCaptureSetupBrightnessStill; + position = ECamAPSlotPhotoPreCaptureBrightness; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoContrast; + cmd_id = ECamCmdCaptureSetupContrastStill; + position = ECamAPSlotPhotoPreCaptureContrast; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoLightSensitivity; + cmd_id = ECamCmdCaptureSetupLightSensitivityStill; + position = ECamAPSlotPhotoPreCaptureISO; + type = ECamActivePaletteItemTypePreCapture; + } + + }; + } + + +//---------------------------------------------------------------------------- +// r_cam_still_pre_capture_ap_items_novice +// +// Still pre-capture active palette items in novice user mode. +// (Less items than in advanced user mode.) +//---------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_still_pre_capture_ap_items_novice + { + // Note: + // Current implementation of ActivePalette2 does not + // support the positioning with index so the order + // of items here is what matters. + // !!! position attribute is ignored !!! + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemVideoModeSelect; + cmd_id = ECamCmdNewVideo; + position = ECamAPSlotPhotoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoScene; + cmd_id = ECamCmdCaptureSetupSceneStill; + position = ECamAPSlotPhotoPreCaptureScene; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoFlash; + cmd_id = ECamCmdCaptureSetupFlashStill; + position = ECamAPSlotPhotoPreCaptureFlash; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicSelfTimer; + cmd_id = ECamCmdCaptureSetupSelfTimer; + position = ECamAPSlotPhotoPreCaptureSelfTimer; + type = ECamActivePaletteItemTypePreCapture; + }, + /*CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemSequenceMode; + cmd_id = ECamCmdToggleMulti; + position = ECamAPSlotPhotoPreCaptureSequence; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + },*/ + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoColourFilter; + cmd_id = ECamCmdCaptureSetupColourFilterStill; + position = ECamAPSlotPhotoPreCaptureColour; + type = ECamActivePaletteItemTypePreCapture; + } + + }; + } + + + + +//---------------------------------------------------------------------------- +// r_cam_emb_still_pre_capture_ap_items +// +// Embedded still pre-capture active palette items in advanced user mode. +// (See r_cam_emb_still_pre_capture_ap_items_novice) +//---------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_emb_still_pre_capture_ap_items_advanced + { + items = + { + /* + * NOTE: The position attribute is ignored by current + * Active Palette implementation. + */ + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemVideoModeSelect; + cmd_id = ECamCmdNewVideo; + position = ECamAPSlotPhotoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoScene; + cmd_id = ECamCmdCaptureSetupSceneStill; + position = ECamAPSlotPhotoPreCaptureScene; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoFlash; + cmd_id = ECamCmdCaptureSetupFlashStill; + position = ECamAPSlotPhotoPreCaptureFlash; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemFaceTracking; + cmd_id = ECamCmdToggleFacetracking; + position = ECamAPSlotPhotoPreCaptureFacetracking; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicSelfTimer; + cmd_id = ECamCmdCaptureSetupSelfTimer; + position = ECamAPSlotPhotoPreCaptureSelfTimer; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoColourFilter; + cmd_id = ECamCmdCaptureSetupColourFilterStill; + position = ECamAPSlotPhotoPreCaptureColour; + type = ECamActivePaletteItemTypePreCapture; + } , + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemViewfinderGrid; + cmd_id = ECamCmdViewfinderGrid; + position = ECamAPSlotPhotoPreCaptureVfGrid; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoWhiteBalance; + cmd_id = ECamCmdCaptureSetupWhiteBalanceStill; + position = ECamAPSlotPhotoPreCaptureWB; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoExposure; + cmd_id = ECamCmdCaptureSetupExposureStill; + position = ECamAPSlotPhotoPreCaptureEV; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoImageSharpness; + cmd_id = ECamCmdCaptureSetupImageSharpnessStill; + position = ECamAPSlotPhotoPreCaptureSharpness; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoContrast; + cmd_id = ECamCmdCaptureSetupContrastStill; + position = ECamAPSlotPhotoPreCaptureContrast; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoLightSensitivity; + cmd_id = ECamCmdCaptureSetupLightSensitivityStill; + position = ECamAPSlotPhotoPreCaptureISO; + type = ECamActivePaletteItemTypePreCapture; + } + }; + } + +//---------------------------------------------------------------------------- +// r_cam_emb_still_pre_capture_ap_items_novice +// +// Embedded still pre-capture active palette items in novice user mode. +// (Less items than in advanced user mode.) +//---------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_emb_still_pre_capture_ap_items_novice + { + items = + { + /* + * NOTE: The position attribute is ignored by current + * Active Palette implementation. + */ + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemVideoModeSelect; + cmd_id = ECamCmdNewVideo; + position = ECamAPSlotPhotoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoScene; + cmd_id = ECamCmdCaptureSetupSceneStill; + position = ECamAPSlotPhotoPreCaptureScene; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoFlash; + cmd_id = ECamCmdCaptureSetupFlashStill; + position = ECamAPSlotPhotoPreCaptureFlash; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicSelfTimer; + cmd_id = ECamCmdCaptureSetupSelfTimer; + position = ECamAPSlotPhotoPreCaptureSelfTimer; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicPhotoColourFilter; + cmd_id = ECamCmdCaptureSetupColourFilterStill; + position = ECamAPSlotPhotoPreCaptureColour; + type = ECamActivePaletteItemTypePreCapture; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_still_post_capture_ap_items_secondary +// Still post-capture active palette items +// for secondary camera. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_still_post_capture_ap_items_secondary + { + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdSend; + position = 0; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdSendToCallerMultimedia; + position = 1; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdOneClickUpload; + position = 2; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdPhotos; + position = 6; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdDelete; + position = 4; + type = ECamActivePaletteItemTypePostCapture; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_post_capture_ap_items +// Still post-capture active palette items +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_still_post_capture_ap_items + { + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdSend; + position = 0; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdSendToCallerMultimedia; + position = 1; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdOneClickUpload; + position = 2; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdAddToAlbum; + position = 3; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdProperties; + position = 4; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdPhotos; + position = 5; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdDelete; + position = 7; + type = ECamActivePaletteItemTypePostCapture; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_pre_capture_view_camcorder +// Still pre-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_still_pre_capture_view_camcorder + { + menubar = r_cam_still_pre_capture_menubar_camcorder; + cba = r_cam_softkeys_options_exit; + toolbar = r_cam_still_precapture_toolbar; + } + +// --------------------------------------------------------- +// +// r_cam_still_pre_capture_menubar_camcorder +// Menubar for still image pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_pre_capture_menubar_camcorder + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_pre_capture_menu_camcorder; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_pre_capture_menu_camcorder +// Options menu for still image pre capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_pre_capture_menu_camcorder + { + items = + { + MENU_ITEM + { + command = ECamCmdSwitchCamera; + txt = qtn_lcam_options_cam2; + }, + MENU_ITEM + { + command = ECamCmdSettings; + txt = qtn_lcam_cmd_settings; + }, + MENU_ITEM + { + command = ECamCmdNewVideo; + txt = qtn_lcam_options_video_mode; + }, + + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_post_capture_view_camcorder +// Still post-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_still_post_capture_view_camcorder + { + menubar = r_cam_still_post_capture_menubar_camcorder; + cba = r_cam_softkeys_back; + toolbar = r_cam_still_postcapture_toolbar; + } + +// --------------------------------------------------------- +// +// r_cam_still_post_capture_menubar_camcorder +// Menubar for still image post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_post_capture_menubar_camcorder + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_post_capture_menu_camcorder; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_post_capture_menu_camcorder +// Options menu for still image post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_post_capture_menu_camcorder + { + items = + { + MENU_ITEM + { + command = ECamCmdSend; + txt = qtn_options_send_via; + }, + MENU_ITEM + { + command = ECamCmdSendToCallerMultimedia; + txt = qtn_lcam_options_send_to_call; + }, + MENU_ITEM + { + command = KAiwCmdAssign; + txt = qtn_lcam_use_image_postcapture_menu; + cascade = AIW_INTELLIGENT_CASCADE_ID; + }, + MENU_ITEM + { + command = ECamCmdShareOnOvi; + // AIW provider fills the menu item title. + // No submenu, only 1 provider acccepted. + txt = ""; + }, + MENU_ITEM + { + command = ECamCmdRenameImage; + txt = qtn_lcam_cmd_rename_image; + }, + MENU_ITEM + { + command = ECamCmdAddToAlbum; + txt = qtn_lcam_options_add_to_album; + }, + MENU_ITEM + { + command = ECamCmdProperties; + txt = qtn_lcam_options_tags; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos ; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + + + +// --------------------------------------------------------- +// +// r_cam_still_precap_navicounter_decorations_camcorder +// Decorations for the navicounter in still precap +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_still_precap_navicounter_decorations_camcorder + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + // Extended under the battery icon. + // Blended background height modified 1 pixel higher. + tl_x = 0; // 20; // 0 + tl_y = 219+120; // 220; + width = 107; //92; // 72; // 86 + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_precap_navicounter_decorations_camcorder_location +// Decorations for the navicounter in still precap with location icon +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_still_precap_navicounter_decorations_camcorder_location + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 0; //20; + tl_y = 220; + width = 122; //91;//86; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_postcap_navicounter_decorations_camcorder +// Decorations for the navicounter in still precap +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_still_postcap_navicounter_decorations_camcorder + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + // Background height increased by one pixel + tl_x = 0; + tl_y = 219; // 220; + width = 22; //75; //for battery icon. + } + }; + } + }; + } + +#endif //CAMERAAPP_PLUGIN_BUILD diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/data/CamVideoCaptureCamcorder.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/data/CamVideoCaptureCamcorder.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1293 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// --------------------------------------------------- +// +// r_cam_video_precap_remaining_time +// Layout for remaining recording time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_precap_remaining_time + { + // font = ELatinBold12; C=0; l=23; B=233; W=100; J=ELayoutAlignLeft; + // font = ELatinBold12; C=0; /* r=243; */l=114; B=234; W=32; J=ELayoutAlignLeft; + //font = ELatinPlain12; C=0; r=201; l=87; B=233; W=32; J=ELayoutAlignLeft; + //font = ELatinPlain12; C=0; r=227; l=60; B=233; W=32; J=ELayoutAlignLeft; + font = ELatinPlain12; C=0; r=232; l=51; B=233; W=32; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_remaining_time_ah +// Arabic/Hebrew layout for remaining recording time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_precap_remaining_time_ah + { + //font = ELatinBold12; C=0; l=23; B=233; W=100; J=ELayoutAlignLeft; + //font = ELatinPlain12; C=0; r=201; l=87; B=233; W=32; J=ELayoutAlignLeft; + font = ELatinPlain12; C=0; r=216; l=72; B=233; W=32; J=ELayoutAlignLeft; + } + + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_elapsed_time +// Layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_elapsed_time + { + // font = ELatinBold12; C=35; l=31; r=260; B=233; W=32; J=ELayoutAlignRight; + font = ELatinPlain12; C=35; l=70; r=218; B=233; W=32; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_elapsed_time_ah +// Arabic/Hebrew layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_elapsed_time_ah + { + font = ELatinPlain12; C=35; l=163; B=233; W=56; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_elapsed_time +// Layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_elapsed_time + { + // font = ELatinBold12; C=35; l=31; r=260; B=233; W=32; J=ELayoutAlignRight; + font = ELatinPlain12; C=35; l=60; r=228; B=233; W=32; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_elapsed_time_ah +// Arabic/Hebrew layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_elapsed_time_ah + { + //font = ELatinPlain12; C=35; l=121; B=233; W=56; J=ELayoutAlignLeft; + font = ELatinPlain12; C=35; l=124; B=233; W=56; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_video_size_layout_camcorder +// Layout for video size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_size_layout_camcorder + { + //font = EAknLogicalFontSecondaryFont; C=35; l=40; B=234; W = 100; J=ELayoutAlignLeft; + font = EAknLogicalFontSecondaryFont; C=0; l=30; B=234; W=0; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_video_size_layout_ah_camcorder +// Layout for video size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_size_layout_ah_camcorder + { + font = EAknLogicalFontSecondaryFont; C=35; l=222; r=49; B=234; W = 320-49-222; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_progress_bar +// Layout for progress bar during capture in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_progress_bar + { + // l=67; t=225; W=53; H=10; + //r=119; t=225; W=53; H=10; + //l=148; t=225; W=53; H=10; + r=165; t=225; W=53; H=10; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_progress_bar_ah +// Arabic/Hebrew layout for progress bar during capture in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_progress_bar_ah + { + //l=67; t=225; W=53; H=10; + l=104; t=225; W=53; H=10; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_memory_location +// Layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_memory_location + { + // l = 8; t = 222; W = 11; H = 16; + l = 192; t = 222; W = 16; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_memory_location_ah +// Arabic/Hebrew layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_memory_location_ah + { + //l = 8; t = 222; W = 11; H = 16; + l = 56; t = 222; W = 16; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimit_memory_location +// Layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_memory_location + { + // l = 8; t = 222; W = 11; H = 16; + l = 132; t = 222; W = 16; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimit_memory_location_ah +// Arabic/Hebrew layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_memory_location_ah + { + //l = 8; t = 222; W = 11; H = 16; + l = 56; t = 222; W = 16; H = 16; + } +//----------------------------------------------------------------------------- +// +// r_cam_recpause_indicator_layout_vid_main_rect_camcorder +// Layout rect for the recording and paused indicators in the main video pane. +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_recpause_indicator_layout_vid_main_rect_camcorder + { + l=117; t=225; W=8; H=8; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_remaining_time +// Layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_remaining_time + { + // font = ELatinBold12; C=215 /*0*/; l=124; B=233; W=56; J=ELayoutAlignLeft; + // font = ELatinPlain12; C=0 /*0*/; l=114; r=243; B=234; W=32; J=ELayoutAlignLeft; + //font = ELatinPlain12; C=0; l=118; /* r=243;*/ B=234; W=32; J=ELayoutAlignLeft; + font = ELatinPlain12; C=0; l=164; /* r=243;*/ B=234; W=32; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_remaining_time_ah +// Arabic/Hebrew layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_remaining_time_ah + { + //font = ELatinBold12; C=35; l=28; r=260; B=233; W=32; J=ELayoutAlignRight; + font = ELatinPlain12; C=0; l=72; r=216; B=233; W=32; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_remaining_time +// Layout for remaining time in navi pane when progress bar is not visible +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_remaining_time + { + // font = ELatinBold12; C=215; l=67; B=233; W=56; J=ELayoutAlignLeft; + font = ELatinPlain12; C=0; l=100; /* r=243;*/ B=233; W=32; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_remaining_time_ah +// Arabic/Hebrew layout for remaining time in navi pane when progrss bar is not visible. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_remaining_time_ah + { + //font = ELatinBold12; C=35; l=68; r=220; B=233; W=32; J=ELayoutAlignRight; + font = ELatinBold12; C=35; l=73; r=220; B=233; W=32; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_video_quality_slider_array_camcorder +// Legend data for the video quality slider +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_slider_array_camcorder + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 6 +8; W = KResolutionVideoTVIconWidth; H = KResolutionVideoTVIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_tvhigh; +// mask_id = EMbmCameraappQgn_indi_lcam_res_tvhigh_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 24; t = 4 +8; W = KIndicatorVideoModeIconWidth; H = KIndicatorVideoModeIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_mp4; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_mp4_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 86; W = KResolutionVideoEmailIconWidth; H = KResolutionVideoEmailIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_emailhigh; +// mask_id = EMbmCameraappQgn_indi_lcam_res_emailhigh_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 24; t = 84; W = KIndicatorVideoModeIconWidth; H = KIndicatorVideoModeIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 174 -8; W = KResolutionVideoMMSIconWidth; H = KResolutionVideoMMSIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_mms; +// mask_id = EMbmCameraappQgn_indi_lcam_res_mms_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 24; t = 172 -8; W = KIndicatorVideoModeIconWidth; H = KIndicatorVideoModeIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_quality_slider_array_ah_camcorder +// Legend data for the video quality slider (Arabic/Hebrew) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_slider_array_ah_camcorder + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = 2; t = 6; W = KResolutionCIFIconWidth; H = KResolutionCIFIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_cif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_cif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = 22; t = 4; W = KIndicatorVideoModeIconWidth; H = KIndicatorVideoModeIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_mp4; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_mp4_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = 2; t = 46; W = KResolutionCIFIconWidth; H = KResolutionCIFIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_cif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_cif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = 22; t = 44; W = KIndicatorVideoModeIconWidth; H = KIndicatorVideoModeIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_mp4; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_mp4_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = 2; t = 86; W = KResolutionQCIFIconWidth; H = KResolutionQCIFIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_qcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_qcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = 22; t = 84; W = KIndicatorVideoModeIconWidth; H = KIndicatorVideoModeIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = 2; t = 130; W = KResolutionQCIFIconWidth; H = KResolutionQCIFIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_qcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_qcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = 22; t = 128; W = KIndicatorVideoModeIconWidth; H = KIndicatorVideoModeIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = 2; t = 174; W = KResolutionSQCIFIconWidth; H = KResolutionSQCIFIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_sqcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_sqcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { r = 22; t = 172; W = KIndicatorVideoModeIconWidth; H = KIndicatorVideoModeIconHeight; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + } + }; + } + +#ifndef CAMERAAPP_PLUGIN_BUILD + +//**************************************************************** +// THE FOLLOWING ARE RESOURCES NEEDED BY CAMERA ONLY +//*************************************************************** + +/* +//---------------------------------------------------- +// +// r_cam_video_quality_slider_array_cam2_camcorder +// Legend data for the video quality slider ( for camera 2 ) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_slider_array_cam2_camcorder + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 8; W = 26; H = 22; }; + bitmap_id = EMbmCameraappQgn_indi_lcam_res_qcif; + mask_id = EMbmCameraappQgn_indi_lcam_res_qcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 4; W = 22; H = 32; }; + bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; + mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 260; W = 26; H = 22; }; + bitmap_id = EMbmCameraappQgn_indi_lcam_res_sqcif; + mask_id = EMbmCameraappQgn_indi_lcam_res_sqcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 56; W = 22; H = 32; }; + bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; + mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + } + }; + } +*/ + +//---------------------------------------------------- +// +// r_cam_post_capture_video_name_layout_camcorder +// Layout for video name in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_name_layout_camcorder + { + font = EAknLogicalFontSecondaryFont; C=35; l=9; B=13; W=150; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_video_name_layout_ah_camcorder +// Arabic/Hebrew layout for video name in post-capture +// navi-counter for secondary camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_name_layout_ah_camcorder + { + font = EAknLogicalFontSecondaryFont; C=35; r=9; B=13; W=100; J=ELayoutAlignRight; + } + +//---------------------------------------------------------------------------- +// +// r_cam_video_pre_capture_ap_items_secondary +// Video pre-capture active palette items for secondary camera +// +//---------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_pre_capture_ap_items_secondary + { + /** + * Note: position is ignored. + */ + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemImageModeSelect; + cmd_id = ECamCmdNewPhoto; + position = ECamAPSlotVideoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemGotoPhotos; + cmd_id = ECamCmdPhotos; + position = ECamAPSlotPhotoPreCaptureGotoPhotos; + type = ECamActivePaletteItemTypeCommand; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemSwitchCamera; + cmd_id = ECamCmdSwitchCamera; + position = ECamAPSlotVideoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + } + }; + } + +//---------------------------------------------------------------------------- +// r_cam_video_pre_capture_ap_items_advanced +// +// Video pre-capture active palette items in advanced user mode. +// +//---------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_pre_capture_ap_items_advanced + { + /** + * Note: position is ignored. + */ + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemImageModeSelect; + cmd_id = ECamCmdNewPhoto; + position = ECamAPSlotVideoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoScene; + cmd_id = ECamCmdCaptureSetupSceneVideo; + position = ECamAPSlotVideoPreCaptureScene; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoFlash; + cmd_id = ECamCmdToggleVideoFlash; + position = ECamAPSlotVideoPreCaptureVideoLight; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoWhiteBalance; + cmd_id = ECamCmdCaptureSetupWhiteBalanceVideo; + position = ECamAPSlotVideoPreCaptureWB; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoColourFilter; + cmd_id = ECamCmdCaptureSetupColourFilterVideo; + position = ECamAPSlotVideoPreCaptureColour; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemGotoPhotos; + cmd_id = ECamCmdPhotos; + position = ECamAPSlotVideoPreCaptureGotoPhotos; + type = ECamActivePaletteItemTypeCommand; + } + }; + } + +//---------------------------------------------------------------------------- +// r_cam_video_pre_capture_ap_items_novice +// +// Video pre-capture active palette items in novice user mode. +// (Less items than in advanced user mode.) +//---------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_pre_capture_ap_items_novice + { + /** + * Note: position is ignored. + */ + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemImageModeSelect; + cmd_id = ECamCmdNewPhoto; + position = ECamAPSlotVideoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoScene; + cmd_id = ECamCmdCaptureSetupSceneVideo; + position = ECamAPSlotVideoPreCaptureScene; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoColourFilter; + cmd_id = ECamCmdCaptureSetupColourFilterVideo; + position = ECamAPSlotVideoPreCaptureColour; + type = ECamActivePaletteItemTypePreCapture; + } + + }; + } + + +//---------------------------------------------------------------------------- +// r_cam_emb_video_pre_capture_ap_items_advanced +// +// Embedded video pre-capture active palette items in advanced user mode. +// +//---------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_emb_video_pre_capture_ap_items_advanced + { + /** + * Note: position is ignored. + */ + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemImageModeSelect; + cmd_id = ECamCmdNewPhoto; + position = ECamAPSlotVideoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoScene; + cmd_id = ECamCmdCaptureSetupSceneVideo; + position = ECamAPSlotVideoPreCaptureScene; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoFlash; + cmd_id = ECamCmdToggleVideoFlash; + position = ECamAPSlotVideoPreCaptureVideoLight; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoWhiteBalance; + cmd_id = ECamCmdCaptureSetupWhiteBalanceVideo; + position = ECamAPSlotVideoPreCaptureWB; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoColourFilter; + cmd_id = ECamCmdCaptureSetupColourFilterVideo; + position = ECamAPSlotVideoPreCaptureColour; + type = ECamActivePaletteItemTypePreCapture; + } + }; + } + + +//---------------------------------------------------------------------------- +// r_cam_emb_video_pre_capture_ap_items_novice +// +// Embedded video pre-capture active palette items in novice user mode. +// (Less items than in advanced mode.) +//---------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_emb_video_pre_capture_ap_items_novice + { + /** + * Note: position is ignored. + */ + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemImageModeSelect; + cmd_id = ECamCmdNewPhoto; + position = ECamAPSlotVideoPreCaptureMode; + type = ECamActivePaletteItemTypePreCaptureNonSetting; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoScene; + cmd_id = ECamCmdCaptureSetupSceneVideo; + position = ECamAPSlotVideoPreCaptureScene; + type = ECamActivePaletteItemTypePreCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + item_id = ECamSettingItemDynamicVideoColourFilter; + cmd_id = ECamCmdCaptureSetupColourFilterVideo; + position = ECamAPSlotVideoPreCaptureColour; + type = ECamActivePaletteItemTypePreCapture; + } + }; + } +//---------------------------------------------------- +// +// r_cam_video_post_capture_ap_items_secondary +// Video post-capture active palette items +// for secondary camera. +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_post_capture_ap_items_secondary + { + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdPlay; + position = 0; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdSend; + position = 1; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdOneClickUpload; + position = 2; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdSendToCallerMultimedia; + position = 3; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdPhotos; + position = 6; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdDelete; + position = 4; + type = ECamActivePaletteItemTypePostCapture; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_post_capture_ap_items +// Video post-capture active palette items +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_post_capture_ap_items + { + items = + { + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdPlay; + position = 0; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdSend; + position = 1; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdOneClickUpload; + position = 2; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdSendToCallerMultimedia; + position = 3; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdAddToAlbum; + position = 3; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdProperties;// cmd for add detail + position = 4; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdPhotos; + position = 6; + type = ECamActivePaletteItemTypePostCapture; + }, + CAM_ACTIVE_PALETTE_ITEM + { + cmd_id = ECamCmdDelete; + position = 7; + type = ECamActivePaletteItemTypePostCapture; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_pre_capture_view_camcorder +// Video pre-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_video_pre_capture_view_camcorder + { + menubar = r_cam_video_pre_capture_menubar_camcorder; + cba = r_cam_softkeys_options_exit; + //toolbar = r_cam_video_precapture_toolbar; + } + +// --------------------------------------------------------- +// +// r_cam_video_pre_capture_menubar_camcorder +// Menubar for video pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_pre_capture_menubar_camcorder + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_pre_capture_menu_camcorder; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_pre_capture_menu_camcorder +// Options menu for video pre capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_pre_capture_menu_camcorder + { + items = + { + MENU_ITEM + { + command = ECamCmdSwitchCamera; + txt = qtn_lcam_options_cam2; + }, + MENU_ITEM + { + command = ECamCmdSettings; + txt = qtn_lcam_cmd_settings; + }, + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_photo_mode; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_post_capture_view_camcorder +// Video post-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_video_post_capture_view_camcorder + { + menubar = r_cam_video_post_capture_menubar_camcorder; + //cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; + cba = r_cam_softkeys_options_back_toggletoolbar; + toolbar = r_cam_video_postcapture_toolbar; + } + +// --------------------------------------------------------- +// +// r_cam_video_post_capture_menubar_camcorder +// Menubar for video post capture view in camcorder mode +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_post_capture_menubar_camcorder + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_post_capture_menu_camcorder; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_post_capture_menu_camcorder +// Options menu for video post capture view in camcorder mode +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_post_capture_menu_camcorder + { + items = + { + MENU_ITEM + { + command = ECamCmdSend; + txt = qtn_options_send_via; + }, + MENU_ITEM + { + command = ECamCmdSendToCallerMultimedia; + txt = qtn_lcam_options_send_to_call; + }, + MENU_ITEM + { + command = KAiwCmdAssign; + txt = qtn_lcam_use_video_postcapture_menu; + cascade = AIW_INTELLIGENT_CASCADE_ID; + }, + MENU_ITEM + { + command = ECamCmdShareOnOvi; + // AIW provider fills the menu item title. + // No submenu, only 1 provider acccepted. + txt = ""; + }, + MENU_ITEM + { + command = ECamCmdRenameVideo; + txt = qtn_lcam_cmd_rename_video; + }, + MENU_ITEM + { + command = ECamCmdAddToAlbum; + txt = qtn_lcam_options_add_to_album; + }, + MENU_ITEM + { + command = ECamCmdProperties; + txt = qtn_lcam_options_tags; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_precap_navicounter_decorations_camcorder +// Decorations for the navicounter in video precap +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_precap_navicounter_decorations_camcorder + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + // Background height increased by one pixel + // Background extended under battery icon + tl_x = 0; // 20; // 0 + tl_y = 219; // 220; + width = 107; //124; // 104; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_limit_recording_icon +// Blended background and recording icon during capture, limited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_limit_recording_icon + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + // Background height increased by one pixel + // Background extended under battery icon + tl_x = 0; // 20; // 0 + tl_y = 219; // 220; + width = 213; // 193; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 320 - 264;//320 - 214; // 12+11; + tl_y = 219+6; // 220+6; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_limit_recording_icon_ah +// Blended background and recording icon during capture, limited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_limit_recording_icon_ah + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + // Background height increased by one pixel + // Background extended under battery icon + tl_x = 0; // 20; // 0 + tl_y = 219; // 220; + width = 213; // 193; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 320 - 130;//320 - 214; // 12+11; + tl_y = 219+6; // 220+6; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_unlimit_recording_icon +// Blended background and recording icon during capture, unlimited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_unlimit_recording_icon + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + // Background height increased by one pixel + // Background extended under battery icon + tl_x = 0; // 20; // 0 + tl_y = 219; // 220; + width = 156; // 136; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 320 - 233;//320 - 267; // 12+11; + tl_y = 219+6; // 220+6; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_unlimit_recording_icon_ah +// Blended background and recording icon during capture, unlimited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_unlimit_recording_icon_ah + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + // Background height increased by one pixel + // Background extended under battery icon + tl_x = 0; // 20; // 0 + tl_y = 219; // 220; + width = 156; // 136; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 320 - 212;//320 - 267; // 12+11; + tl_y = 219+6; // 220+6; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_postcap_navicounter_decorations_camcorder +// Decorations for the progress bar in video precap +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_postcap_navicounter_decorations_camcorder + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 0; + tl_y = 0; + width = 0; //167; removed empty pane + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 0; + tl_y = 219; // 220; + width = 18; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + // Battery icon included in the blended area. + tl_x = 0; // 20; + tl_y = 219; // 220; + width = 76; // 56; + } + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_filetype_pane_camcorder +// Video file type indicator - uses side pane resource +// Allows specifying position and size for all +// video file type indicators +// +//---------------------------------------------------- +// +RESOURCE CAMERA_SIDEPANE r_cam_video_filetype_pane_camcorder + { + indicators = + { + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorVideoFileType; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = 0; + tl_y = 0; + br_x = 0; + br_y = 0; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_mp4; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_mp4_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_3gp; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_3gp_mask; } + }; + } + }; + } + +#endif //CAMERAAPP_PLUGIN_BUILD diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/Cam.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/Cam.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,342 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource header file for Camera Application* +*/ + + +#ifndef CAM_HRH +#define CAM_HRH + + + +// This is number of *user-changeable* characters in name base for +// videos and photos, for example "Image" from "Image0001.jpg" +#define KMaxNameBaseLength 27 + +// Maximum length of the Default Album +#define KMaxAlbumNameLength 30 +// Maximum length of image of toolbar customization data string +#define KMaxToolbarDataStringLength 256 + +// Max filename length *including* numbering eg "Image9999" from "Image9999.jpg" +#define KMaxNameBaseLengthPlusNumbering 31 + +#ifndef __WINS__ + //#define EProductKeyCaptureHalf EStdKeyApplication19 + +#else + #define EProductKeyCaptureHalf 53 +#endif + // #define EProductKeyCapture EStdKeyDevice7 + + +// DATA TYPES + +// enumerate command codes +enum TCamCmd + { + ECamCmdNewVideo = 1, // start value must not be 0 + ECamCmdToggleMulti, + ECamCmdToggleFacetracking, + ECamCmdSingleCapture, + ECamCmdSequence, + ECamCmdTimeLapse, + ECamCmdPhotos, + ECamCmdShootSetup, + ECamCmdSelfTimer1, + ECamCmdSelfTimer2, + ECamCmdSelfTimer3, + ECamCmdFlash, + ECamCmdUserScene, + ECamCmdSettings, + ECamCmdNewPhoto, + ECamCmdAddAudio, + ECamCmdEdit, + ECamCmdEditRestore, + ECamCmdSelectRestore, + ECamCmdUserSceneSelected, + ECamCmdDelete, + ECamCmdAddToAlbum, + ECamCmdProperties, + ECamCmdDeleteSequence, + ECamCmdSendToCallerMultimedia, + ECamCmdPause, + ECamCmdLock, + ECamCmdUnlock, + ECamCmdContinue, + ECamCmdPlay, + ECamCmdSelfTimerCancel, + ECamCmdCaptureSetupSceneStill, + ECamCmdCaptureSetupWhiteBalanceStill, + ECamCmdCaptureSetupExposureStill, + ECamCmdCaptureSetupColourFilterStill, + ECamCmdCaptureSetupFlashStill, + ECamCmdCaptureSetupSceneVideo, + ECamCmdCaptureSetupWhiteBalanceVideo, + ECamCmdCaptureSetupColourFilterVideo, + ECamCmdCaptureSetupSceneUser, + ECamCmdCaptureSetupWhiteBalanceUser, + ECamCmdCaptureSetupExposureUser, + ECamCmdCaptureSetupColourFilterUser, + ECamCmdCaptureSetupFlashUser, + ECamCmdUserSceneReset, + ECamCmdSelect, // select for embedded views + ECamCmdMarkUnmarkMenu, + ECamCmdOpenPhoto, // Open a file from burst post-capture grid + ECamCmdSceneSettingList, + ECamCmdGoToStandby, + ECamCmdExitStandby, + ECamCmdConfirmationQuerySportsSceneChange, + ECamCmdSelfTimerActivate, + ECamCmdSelfTimerMenu, + ECamCmdMute, // Mute/unmute for embedded video + ECamCmdUnmute, + ECamCmdQuickSend, + ECamCmdInternalExit, + ECamCmdSlideClosedExit, + ECamCmdPopUpMenuZoom, + + ECamCmdSwitchCamera, + ECamCmdRenameImage, + ECamCmdRenameVideo, + ECamCmdStop, + ECamCmdCaptureSetupBrightnessStill, + ECamCmdCaptureSetupContrastStill, + ECamCmdCaptureSetupBrightnessVideo, + ECamCmdCaptureSetupContrastVideo, + ECamCmdCaptureSetupBrightnessUser, + ECamCmdCaptureSetupContrastUser, + + ECamCmdTimeLapseSlider, + ECamCmdOpenSetup, + ECamCmdTimeLapsePhoto, + + ECamCmdCaptureSetupImageSharpnessStill, + ECamCmdCaptureSetupColourSaturationStill, + ECamCmdCaptureSetupColourSaturationVideo, + ECamCmdCaptureSetupImageSharpnessUser, + ECamCmdCaptureSetupColourSaturationUser, + + ECamCmdCaptureSetupMenu, + + ECamCmdToggleCourtesyUI, + ECamCmdRedrawScreen, + + ECamCmdToggleVideoFlash, + ECamCmdCaptureSetupFlashVideo, + ECamCmdPrintIntent, + ECamCmdPrintPlugin, + ECamCmdOneClickUpload, + + ECamCmdCaptureSetupLightSensitivityUser, + + ECamCmdRaiseCourtesyUI, + ECamCmdSwitchToPrecapture, + + ECamCmdActivateFreeMemoryView, + ECamCmdCaptureSetupSelfTimer, + ECamCmdCaptureSetupLightSensitivityStill, + ECamCmdCaptureSetupLightSensitivityVideo, + + ECamCmdViewfinderGrid, // Viewfinder grid on/off + ECamCmdSwitchUserMode, // Toggle advanced/novice user mode + ECamCmdHistogram, // Histogram on/off + + // Customise toolbar view commands + ECamCmdCustomiseToolbar, // Open customise toolbar view + ECamCmdCustomiseToolbarChange, + ECamCmdCustomiseToolbarAdd, + ECamCmdCustomiseToolbarRemove, + ECamCmdCustomiseToolbarUp, + ECamCmdCustomiseToolbarDown, + ECamCmdCustomiseToolbarReset, + + ECamCmdSend, // NOTE any new commands should be placed before this + // with the exception of the AIW command below + ECamCmdAIWCommands = 200, // AIW needs to have its own area + ECamCmdEditPhoto, + ECamCmdEditVideo, + ECamCmdPrint, + ECamCmdShareOnOvi, + ECamMSKCmdAppChange, + ECamMSKCmdAppCapture, + ECamMSKCmdAppRecord, + ECamMSKCmdSelect, + ECamCmdRestoreCameraSettings, + + ECamCmdCaptureImage, + ECamCmdRecord, + ECamCmdToolbarExtension, // Command ID for toolbar extension button + ECamCmdToolbarMarkUnmark, // for sequence post capture view + ECamCmdToggleActiveToolbar // switches activepalette visibility + + }; + +enum TCamWaitNoteCtrls + { + ESavingVideoWaitNote = 1, + ESavingImagesProgressNote, + ELoadingImageWaitNote, + ESavingImageWaitNote, + EFreeingMemoryWaitNote, + EGenProcessingWaitNote + }; + +// indicators are in different orders for different products + +enum TCamIndicatorIds + { + ECamIndicatorScene = 0, + ECamIndicatorFlash, + ECamIndicatorSelfTimer, + ECamIndicatorBurstMode, + ECamIndicatorVideoStabiliser, + ECamIndicatorImageShakeWarning, + ECamIndicatorAudioMute, + ECamIndicatorFaceTracking, + ECamIndicatorVideoFileType, + ECamIndicatorCaptureMode, + ECamIndicatorVideoFlash, + ECamIndicatorFocus, + ECamIndicatorGenericSetup, + ECamIndicatorResolution, + ECamIndicatorTotal // This MUST be last in the enum! + }; + +enum TCamSoundId + { + ECamVideoStartSoundId = 1, + ECamVideoStopSoundId, + ECamVideoPauseSoundId, + ECamVideoResumeSoundId, + ECamInCallToneId, + ECamStillCaptureSoundId1, + ECamStillCaptureSoundId2, + ECamStillCaptureSoundId3, + ECamStillCaptureSoundId4, + ECamSelfTimerSoundId, + ECamAutoFocusComplete, + ECamAutoFocusFailed, + ECamBurstCaptureSoundId1, + ECamBurstCaptureSoundId2, + ECamBurstCaptureSoundId3, + ECamBurstCaptureSoundId4 + }; + +enum TCamSliderLegendItem + { + ECamSliderLegendItemText, + ECamSliderLegendItemIcon + }; + +enum TCamActivePaletteItemType + { + // Item with fixed tooltip and icon. + // Does not have any particular setting associated with it. + ECamActivePaletteItemTypeCommand, + ECamActivePaletteItemTypePreCapture, + ECamActivePaletteItemTypePreCaptureNonSetting, + ECamActivePaletteItemTypePostCapture, + ECamActivePaletteItemTypePostCapturePrintIntent + }; + +enum TCamExtAutoFocus + { + ECamExtAutoFocusFocusing, + ECamExtAutoFocusFailed, + ECamExtAutoFocusFocused + }; + +enum TScreenDecorationType + { + ECamScreenDecorationBlendedBackground, + ECamScreenDecorationDVFBlanker, // Direct Viewfinder blanker + ECamScreenDecorationRecordingIcon + }; + +enum TCamObserverEvent + { + ECamObserverEventDefault, + ECamObserverEventRecordingIconUpdated, + ECamObserverEventNaviModelUpdated, + ECamObserverEventCaptureProcessComplete + }; + +enum TCamViewState + { + // --------------------------------- + // Marker(s) - no new ids here! + ECamViewStateRangeInternalMin, + + // --------------------------------- + // "Internal" + // - views inherited from CCamViewBase!!! + ECamViewStatePreCapture, + ECamViewStatePostCapture, + ECamViewStateBurstThumbnail, + ECamViewStateStandby, + ECamViewStateUserSceneSetup, + ECamViewStateWhiteBalanceUser, + ECamViewStateColourFilterUser, + ECamViewStateFlashUser, + ECamViewStateSceneUser, + ECamViewStateSceneStill, + ECamViewStateCaptureSetupMenu, + ECamViewStateSceneSettingList, + ECamViewStateExposureUser, + ECamViewStateCustomiseToolbar, + ECamViewStatePrePortraitCapture, + // --------------------------------- + // Marker(s) - no new ids here! + ECamViewStateRangeInternalMax, + ECamViewStateRangeExternalMin, + + // --------------------------------- + // "External" + // - non CCamViewBase inherited views. + ECamViewStateSettings, + ECamViewStateViaPlayer, + ECamViewStateGsCamcorderPlugin, + + // --------------------------------- + // Marker(s) - no new ids here! + ECamViewStateRangeExternalMax, + ECamViewStateCount + // --------------------------------- + }; + +/** + * Custom messages for controlling view activation + */ +enum TCamViewMessage + { + ECamViewMessageStandby = 1, + ECamViewMessageCaptureSetupMenu, + ECamViewMessageSceneSettingList, + ECamViewMessageDeactivateFirst + }; + +/** + * Exit codes for settings plug-in. + */ +enum TCamSettingsPluginExitMessage + { + ECameraPluginExit = 0, + ECameraInternalExit, + ECameraCompleteExit + }; + +#endif // CAM_HRH + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/Cam.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/Cam.rh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,724 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource STRUCT definitions specifically for the camera* +*/ + + + +// INCLUDES +#include "Cam.hrh" +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" + + + +// MACROS + + +// STRUCTURE DEFINITIONS + + +#ifndef CAMERAAPP_PLUGIN_BUILD + +//**************************************************** +// REMEMBER ALL THE RESOURCES SPECIFIC TO CAMERA ONLY +//**************************************************** +//---------------------------------------------------- +// +// CAM_DYNAMIC_SETTING_ITEM_DATA +// The initialisation data for a dynamic setting item. +// +//---------------------------------------------------- +// +STRUCT CAM_DYNAMIC_SETTING_ITEM_DATA + { + // Settings model Id for this item. + WORD id; + + // Default value. + WORD default; + } + +#endif //CAMERAAPP_PLUGIN_BUILD + + + +//**************************************************************** +// REMEMBER ALL THE RESOURCES BELOW ARE FOR BOTH CAMERA AND PLUGIN +//**************************************************************** + +// ----------------------------------------------------------------------------- +// CAMERA_BITMAP +// This structure is for defining the bitmaps of a sidepane indicator. +// ----------------------------------------------------------------------------- +// +STRUCT CAMERA_BITMAP + { + LONG bitmap_id; + } + +// ----------------------------------------------------------------------------- +// CAMERA_INDICATOR_COORDS +// This structure is for defining the position of a side pane indicator. +// ----------------------------------------------------------------------------- +// +STRUCT CAMERA_INDICATOR_COORDS + { + WORD tl_x; // top left x co-ordinate + WORD tl_y; // top left y co-ordinate + WORD br_x; // bottom right x co-ordinate + WORD br_y; // bottom right y co-ordinate + } + +// ----------------------------------------------------------------------------- +// CAMERA_INDICATOR +// This structure is for defining a side pane indicator. +// ----------------------------------------------------------------------------- +// +STRUCT CAMERA_INDICATOR + { + WORD indicator_id; + STRUCT coords; + STRUCT bitmaps[]; + } + +// ----------------------------------------------------------------------------- +// CAMERA_SIDEPANE +// This structure is for defining a camera side pane. +// ----------------------------------------------------------------------------- +// +STRUCT CAMERA_SIDEPANE + { + STRUCT indicators[]; + } + +// ----------------------------------------------------------------------------- +// CAPTURE_SETUP_LIST_ITEM +// This structure is for defining a list item in a capture +// set-up list control +// ----------------------------------------------------------------------------- +// +STRUCT CAPTURE_SETUP_LIST_ITEM + { + LTEXT item_text; + WORD setting_value_id; + LONG bitmap_id = -1; // no bitmap + } + +// ----------------------------------------------------------------------------- +// LOCATION_SETTING_LIST_ITEM +// This structure is for defining a list item in a location +// set-up list control +// ----------------------------------------------------------------------------- +// +STRUCT LOCATION_SETTING_LIST_ITEM + { + LTEXT item_text; + WORD setting_value_id; + LONG bitmap_id = -1; // no bitmap + } + +STRUCT CAM_LOCATION_SELECT_SUMMARY + { + WORD setting_value_id; + LONG summary_icon = -1; + LTEXT summary_description_text; + } + +STRUCT CAM_LOCATION_SELECT_SUMMARY_LAYOUT + { + STRUCT summary_rect; + STRUCT summary_inner_rect; + STRUCT summary_icon; + STRUCT summary_description[]; + } + + + +//---------------------------------------------------- +// +// CAM_CAPTURE_SETUP_MENU_DATA +// All the contents and layout data for a capture setup menu. +// +//---------------------------------------------------- +// +STRUCT CAM_CAPTURE_SETUP_MENU_DATA + { + // Data for the layout of the listbox. + STRUCT listbox_layout; + // Data for the list box item contents. + STRUCT contents[]; + // Data for the layout of the text items in the listbox. + STRUCT text_layout; + // Data for the layout of the bitmaps in the list box. + STRUCT bitmap_layout; + // Data for icon text layout. + STRUCT icontext_layout; + // The offset of the highlighted rectangle (when list item selected) + // from the normal rectangle of a list item. + WORD highlighted_offset; + // The height of a list item. + WORD list_item_height; + } + +//---------------------------------------------------- +// +// CAM_CAPTURE_SETUP_MENU_ITEM_REF +// Reference to a capture setup menu item. +// +//---------------------------------------------------- +// +STRUCT CAM_CAPTURE_SETUP_MENU_ITEM_REF + { + LLINK capture_setup_menu_item_ref = 0; + } + +//---------------------------------------------------- +// +// CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY +// Array of all data for a capture setup menu item +// +//---------------------------------------------------- +// +STRUCT CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY + { + // Settings model Id for this setting item + WORD id; + + // Text for this capture setup menu item. + LTEXT text; + + // Data for a capture setup menu item + STRUCT capture_setup_menu_item[]; + } + +//---------------------------------------------------- +// +// CAM_CAPTURE_SETUP_MENU_ITEM_DATA +// Data for a single setting of a capture setup menu item. +// +//---------------------------------------------------- +// +STRUCT CAM_CAPTURE_SETUP_MENU_ITEM_DATA + { + // Id for this setting value + WORD id; + + // Id of the bitmap that is associated with this setting value (-1 default = none). + WORD bitmap = -1; + + // Text to be used instead of an icon for this setting value ("" default = none). + LTEXT icontext = ""; + } + +//---------------------------------------------------- +// +// CAM_CAPTURE_SETUP_MENU_LISTBOX +// Data for capture setup menu listbox +// +//---------------------------------------------------- +// +STRUCT CAM_CAPTURE_SETUP_MENU_LISTBOX + { + WORD bottomOffset; // vertical distance from bottom of screen of capture setup menu + } + +//---------------------------------------------------- +// +// CAM_CAPTURE_SETUP_MENU_LISTBOX +// Data for capture setup menu listbox +// +//---------------------------------------------------- +// +STRUCT CAM_CAPTURE_SETUP_MENU_LISTBOX_ITEMDRAWER + { + WORD textWidth; // width of the area allocated to drawing text, in pixels + WORD bitmapWidth; // width of the area allocated to drawing bitmaps, in pixels + WORD itemVerticalMargin; + WORD highlightOffset; + WORD textLeftMargin; + } + +// ----------------------------------------------------------------------------- +// +// CAM_BURST_GRID_ITEM +// Data for drawing of the Burst capture Thumbnail grid +// ----------------------------------------------------------------------------- +// +STRUCT CAM_BURST_GRID_ITEM + { + STRUCT cell_rect; // outline rectangle for each cell in the grid + STRUCT high_rect; // outline rectangle for the cell highlight + STRUCT mark_rect; // outline rectangle for the "mark" of the cell + STRUCT thmb_rect; // outline rectangle for the thumbnail draw area + } + +// ----------------------------------------------------------------------------- +// +// CAM_RECT_SIZE +// +// ----------------------------------------------------------------------------- +// +STRUCT CAM_RECT_SIZE + { + WORD width; + WORD height; + } + +// ----------------------------------------------------------------------------- +// +// CAM_SLIDER_EV_ITEM +// Data for drawing of the EV Slider legend +// ----------------------------------------------------------------------------- +// +STRUCT CAM_SLIDER_EV_ITEM + { + WORD item = ECamSliderLegendItemText; + LTEXT text = ""; + LONG bitmap_id = 0; + LONG mask_id = 0; + } + +// ----------------------------------------------------------------------------- +// +// CAM_SLIDER_LEGEND_ITEM +// Data for drawing of the Slider legend +// ----------------------------------------------------------------------------- +// +STRUCT CAM_SLIDER_LEGEND_ITEM + { + WORD item = ECamSliderLegendItemText; + STRUCT position; + LTEXT text = ""; + LONG bitmap_id = 0; + LONG mask_id = 0; + } + + +// ----------------------------------------------------------------------------- +// +// CAM_SLIDER_CONTRAST_LEGEND_ITEM +// Data for drawing of the Slider legend for Contrast +// ----------------------------------------------------------------------------- +// +STRUCT CAM_SLIDER_CONTRAST_LEGEND_ITEM + { + WORD item = ECamSliderLegendItemText; + LTEXT text = ""; + LONG bitmap_id = 0; + LONG mask_id = 0; + } + + +//---------------------------------------------------- +// +// CAM_USER_SCENE_SETUP_LIST_DATA +// Data for a user scene setup list +// +//---------------------------------------------------- +// +STRUCT CAM_USER_SCENE_SETUP_LIST_DATA + { + // List title + LLINK title_id = 0; + + // Array of all items for a user scene setup list + STRUCT user_scene_setup_list_items[]; + } + + +//---------------------------------------------------- +// +// CAM_USER_SCENE_SETUP_LIST_ITEM_REF +// Reference to a user scene setup list item. +// +//---------------------------------------------------- +// +STRUCT CAM_USER_SCENE_SETUP_LIST_ITEM_REF + { + LLINK user_scene_setup_list_item_ref = 0; + } + + +//---------------------------------------------------- +// +// CAM_USER_SCENE_SETUP_LIST_ITEM_DATA +// All data for an item in the user scene list item. +// +//---------------------------------------------------- +// +STRUCT CAM_USER_SCENE_SETUP_LIST_ITEM_DATA + { + // Settings model Id for the setting type associated with this item + // e.g. white balance, or colour effect. + WORD id; + + // Text associated with the setting type. + LTEXT text; + + // Array of all possible values for this user scene setup list item + STRUCT user_scene_setup_list_item_values[]; + } + + +//---------------------------------------------------- +// +// CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE +// A possible value, and associated text +// for an item of the user scene setup list. +// +//---------------------------------------------------- +// +STRUCT CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + // Settings model Id for this user setup scene list item value + WORD id; + + // Associated text with the user setup scene list item value. + LTEXT text; + } + +//---------------------------------------------------- +// +// CAM_STATIC_SETTING_ITEM_DATA +// The initialisation data for a static setting item. +// +//---------------------------------------------------- +// +STRUCT CAM_STATIC_SETTING_ITEM_DATA + { + // Settings model Id for this item. + WORD id; + + // The shared data key for the item. + LTEXT key; + + // Default value, if there is no value in shared data. + //WORD default; + + } + +//---------------------------------------------------- +// +// CAM_SETTING_ITEMS_DEFAULT_DATA +// Default values for a list of settings items. +// +//---------------------------------------------------- +// +STRUCT CAM_SETTING_ITEMS_DEFAULT_DATA + { + // Array of all possible values for this user scene setup list item + STRUCT settings_default_values[]; + } + +//---------------------------------------------------- +// +// CAM_NON_STATIC_SETTING_ITEM_DATA +// The data for a non-static setting item. +// +//---------------------------------------------------- +// +STRUCT CAM_NON_STATIC_SETTING_ITEM_DATA + { + // Settings model Id for this item. + WORD id; + + // Default value. + WORD default; + } + + + +//---------------------------------------------------- +// +// CAM_SCENE_SETTING_ITEM_DATA +// The data for a scene setting item. +// +//---------------------------------------------------- +// +STRUCT CAM_SCENE_SETTING_ITEM_DATA + { + // Settings model Id for this scene item. + WORD id; + + // Array of settings for this scene item + STRUCT scene_items[]; + } + +//---------------------------------------------------- +// +// CAM_SCENE_SETTINGS_DATA_REF +// Reference to a scene's settings data. +// +//---------------------------------------------------- +// +STRUCT CAM_SCENE_SETTINGS_DATA_REF + { + LLINK scene_settings_data_ref = 0; + } + +//---------------------------------------------------- +// +// CAM_SETTING_ITEMS_DATA +// Data for a list of settings items. +// +//---------------------------------------------------- +// +STRUCT CAM_SCENE_SETTING_DATA + { + WORD scene_item_id; + // Array of setting items data. + STRUCT settings_items[]; + } + + +//---------------------------------------------------- +// +// CAM_SETTING_ITEMS_DATA +// Data for a list of settings items. +// +//---------------------------------------------------- +// +STRUCT CAM_SETTING_ITEMS_DATA + { + // Array of setting items data. + STRUCT settings_items[]; + } + +// ----------------------------------------------------------------------------- +// CAM_ENGINE_UPDATE +// This structure is for defining whether the engine needs to be updated with +// settings after a prepare. +// ----------------------------------------------------------------------------- +// +STRUCT CAM_ENGINE_UPDATE + { + WORD update; + } + +// ----------------------------------------------------------------------------- +// CAM_VIDEO_QUALITY_LEVEL +// Structure holding parameters for video quality setting item +// +// ----------------------------------------------------------------------------- +// +STRUCT CAM_VIDEO_QUALITY_LEVEL + { + // Id for this quality level + WORD id; + + // Id of the resolution to use (may be overridden by separate + // resolution setting) + WORD resolution; + + // Target frame rate of video (frames per second) + DOUBLE frame_rate; + + // Desired bit rate of video (bits per second) + LONG bit_rate; + + // Desired bit rate of audio (bits per second) + LONG audio_bit_rate; + + // Mime type for video. If not specified, the value in shared data + // (101F8667.ini) is used. + LTEXT mime_type = ""; + + // Preferred supplier for MMF camcorder plugin. If not specified, the + // value in shared data (101F8667.ini) is used. + LTEXT16 preferred_supplier = ""; + + // Video codec. If not specified, the + // value in shared data (101F8667.ini) is used. + LTEXT video_type = ""; + + // Audio codec (FOURCC). If not specified, the + // value in shared data (101F8667.ini) is used. + LTEXT audio_type = ""; + + // video file type id + WORD file_type = ECamVideoMpeg4; + + // video length (long or short) + WORD video_length = ECamVideoClipMax; + // + } + +//---------------------------------------------------- +// +// CAM_VIDEO_QUALITY_ARRAY +// Array of all video quality levels +// +//---------------------------------------------------- +// +STRUCT CAM_VIDEO_QUALITY_ARRAY + { + // Data for all quality levels + STRUCT quality_levels[]; + } + +// ----------------------------------------------------------------------------- +// CAM_PHOTO_QUALITY_LEVEL +// Structure holding parameters for photo quality setting item +// +// ----------------------------------------------------------------------------- +// +STRUCT CAM_PHOTO_QUALITY_LEVEL + { + // Id for this quality level + WORD id; + + // Id of the resolution to use (may be overridden by separate + // resolution setting) + WORD resolution; + + // Photo quality + WORD quality; + } + +//---------------------------------------------------- +// +// CAM_PHOTO_QUALITY_ARRAY +// Array of all photo quality levels +// +//---------------------------------------------------- +// +STRUCT CAM_PHOTO_QUALITY_ARRAY + { + // Data for all quality levels + STRUCT quality_levels[]; + } + +//---------------------------------------------------- +// +// CAM_RESOLUTION +// Numeric data for a photo/video resolution preset. +// +//---------------------------------------------------- +// +STRUCT CAM_RESOLUTION + { + WORD width; + WORD height; + } + +//---------------------------------------------------- +// +// CAM_RESOLUTION_ARRAY +// Array of all photo/video resolutions +// +//---------------------------------------------------- +// +STRUCT CAM_RESOLUTION_ARRAY + { + // Data for video resolutions + STRUCT resolutions[]; + } + +//---------------------------------------------------- +// +// CAM_QUALITY_SLIDER +// Text strings for quality slider control +// +//---------------------------------------------------- +// +STRUCT CAM_QUALITY_SLIDER + { + LTEXT title_text = ""; + LTEXT subtitle_text_top = ""; + LTEXT subtitle_text_bottom = ""; + LTEXT remaining_text = ""; + STRUCT setting_title_texts[]; + STRUCT setting_desc_texts[]; + WORD setting_enum[]; + } + +//---------------------------------------------------- +// +// CAM_QUALITY_SLIDER_LAYOUT +// Layouts for quality slider control +// +//---------------------------------------------------- +// +STRUCT CAM_QUALITY_SLIDER_LAYOUT + { + STRUCT slider_position; + STRUCT subtitle_top; + STRUCT subtitle_bottom; + STRUCT setting_title; + STRUCT setting_descriptions[]; + STRUCT remaining_title; + STRUCT remaining_text; + STRUCT storage_icon; + STRUCT desc_rect; + STRUCT desc_inner_rect1; + STRUCT desc_inner_rect2; + } + +STRUCT CAM_DECORATIONS + { + STRUCT decorations[]; + } + +STRUCT CAM_DECORATION + { + WORD type; + STRUCT decoration; + } + +STRUCT CAM_BLENDED_BACKGROUND + { + WORD tl_x; + WORD tl_y; + WORD width; + } + +STRUCT CAM_DVF_BLANKER + { + WORD tl_x; + WORD tl_y; + WORD width; + WORD height; + } + +STRUCT CAM_RECORDING_ICON + { + WORD tl_x; + WORD tl_y; + WORD width; + WORD height; + } + +#include "CamModeSelect.rh" + +STRUCT CAM_ACTIVE_PALETTE_ITEM + { + LONG item_id = -1; + LONG cmd_id; + BYTE position = -1; + BYTE isVisible = 1; + BYTE type; + } + + STRUCT CAM_AP_POST_CAPTURE_ITEM + { + LTEXT text; + LONG bitmap_id; + } + + STRUCT CAM_AP_TT_ITEM + { + LTEXT text; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamAppUiBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamAppUiBase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,437 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: AppUi base class for Camera AppUi and Dummy AppUi* +*/ + + +#ifndef CAMAPPUIBASE_H +#define CAMAPPUIBASE_H + +// INCLUDES + +#include +#include +#include +#include "CamSettingsInternal.hrh" + + +// CONSTANTS + +// MACROS + +// DATA TYPES + +enum TCamAppViewIds + { + ECamViewIdStillPreCapture, + ECamViewIdStillPostCapture, + ECamViewIdVideoPreCapture, + ECamViewIdVideoPostCapture, + ECamViewIdBurstThumbnail, + ECamViewIdVideoSettings, + ECamViewIdPhotoSettings, + ECamViewIdPhotoUserSceneSetup, + ECamViewIdViaPlayerPlayBack, + ECamViewIdCustomiseToolbar + }; + +enum TCamSelfTimerFunctions + { + ECamSelfTimerMode1, // Eg ON 10-second timer + ECamSelfTimerMode2, // Eg ON 2-second timer + ECamSelfTimerMode3, // Eg ON additional possibility + ECamSelfTimerDisabled // Eg OFF + }; + +/** +* Camera orientations +*/ +enum TCamOrientation + { + ECamOrientationDefault = 0, + ECamOrientationCamcorder = ECamOrientationDefault, + ECamOrientationPortrait, + ECamOrientationViewMode, + ECamOrientationCamcorderLeft, // softkeys left + ECamOrientationTotal + }; + +enum TCamPreCaptureMode + { + ECamPreCapViewfinder, + ECamPreCapCaptureSetup, + ECamPreCapTimeLapseSlider, + ECamPreCapStandby, + ECamPreCapSceneSetting, + ECamPreCapGenericSetting + }; + +enum TCamAppEvent + { + ECamAppEventFocusGained, + ECamAppEventFocusLost + }; + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CCamSelfTimer; +class MCamBurstModeObserver; +class CCamSidePane; +class CCamZoomPane; +class CTextResolver; +class CCamActivePaletteHandler; +class MCamAppController; +class MCamStaticSettings; +// CLASS DECLARATION + +/** +* AppUi base class for Camera AppUi and Dummy AppUi +* +* @since 2.8 + */ +class CCamAppUiBase : public CAknViewAppUi + //, public MCamControllerObserver + { + public: // Constructors and destructor + + + public: // New functions + + + /** + * Determines whether or not all construction has been completed + * Used on view activation to determine if the view should + * open in standby mode. This will happen if the app is waiting for + * an orientation switch to complete or for the initial view to be set + * when launched in embedded + * @since 3.0 + * @return ETrue if all construction has completed, else EFalse + */ + virtual TBool IsConstructionComplete() const = 0; + + + /** + * Set title pane text from a resource. + * @since 2.8 + * @param aResourceId resource to read from + */ + virtual void SetTitleL( TInt aResourceId ) = 0; + + /** + * Set title pane text from a descriptor. + * @since 2.8 + * @param aText title pane text + */ + virtual void SetTitleL( const TDesC& aText ) = 0; + + /** + * In embedded mode set title to name of embedding application + * @since 2.8 + */ + virtual void SetTitleEmbeddedL() = 0; + + /** + * Draw the counter to the bitmap used in the navi pane + * @since 3.0 + * @param aBmpGc The graphics context for the bitmap + * @param aBmpMaskGc The graphics context for the bitmap mask + */ + virtual void CreateNaviBitmapsL( TBool aDrawStorageIconAndCounter )= 0; + + /** + * Push navi pane indicators on to navi pane stack. + * @since 2.8 + */ + virtual void PushNaviPaneCounterL() = 0; + + /** + * Push navi pane progress bar on to navi pane stack. + * @since 2.8 + */ + virtual void PushNaviPaneProgressBarL() = 0; + + /** + * Push default navi pane on to navi pane stack. + * @since 2.8 + */ + virtual void PushDefaultNaviPaneL() = 0; + + /** + * Enable or disable SelfTimer functionality + * @param aEnable specifies self timer mode or self timer off + * @since 2.8 + */ + virtual void SelfTimerEnableL( TCamSelfTimerFunctions aEnable ) = 0; + + /** + * Returns current self-timer state + * @since 2.8 + */ + virtual TBool SelfTimerEnabled() const = 0; + + /** + * Returns pointer to self-timer object + * @since 2.8 + */ + virtual CCamSelfTimer* SelfTimer() = 0; + + /** + * Registers an observer for changes in burst mode activation + * @since 2.8 + * @param aBurstModeObserver the object observing burst mode changes + */ + virtual void AddBurstModeObserverL( + MCamBurstModeObserver* aBurstModeObserver ) = 0; + + /** + * Removes an observer for changes in burst mode activation + * @since 2.8 + * @param aBurstModeObserver the observer to remove + */ + virtual void RemoveBurstModeObserver( + const MCamBurstModeObserver* aBurstModeObserver ) = 0; + + /** + * Returns whether or not burst capture mode is enabled. + * Will return ETrue when burst mode is enabled for still capture + * even if the application is currently in video capture mode + * @since 2.8 + * @return ETrue if burst mode is enabled, else returns EFalse + */ + virtual TBool IsBurstEnabled() const = 0; + + /** + * Returns the currently enabled burst mode. + * @since 3.0 + * @return the currently enable burst mode or ECamImageCaptureNone if + * burst is not enabled + */ + virtual TCamImageCaptureMode CurrentBurstMode() const = 0; + + /** + * Return whether we are in embedded mode (if we have a pointer to a + * MApaEmbeddedDocObserver). + * @since 2.8 + * @return TBool if tthere is a handle to MApaEmbeddedDocObserver + */ + virtual TBool IsEmbedded() const = 0; + + /** + * Sets the current capture mode ( and target capture mode ) + * @since 2.8 + * @param aMode the desired capture mode + * @param aImageMode In image capture, the desired mode (single/burst/timelapse) + */ + virtual void SetCaptureMode( TCamCameraMode aMode, + TCamImageCaptureMode aImageMode = ECamImageCaptureNone ) = 0; + + /** + * Shows the mmc removal note if it is required + * @since 2.8 + */ + virtual void ShowMMCRemovalNoteIfRequiredL() = 0; + + /** + * Returns pointer to side-pane + * @since 2.8 + * @return pointer to CCamSidePane object constructed by appUi + */ + virtual CCamSidePane* SidePane() = 0; + + /** + * Returns pointer to zoom-pane + * @since 2.8 + * @return pointer to CCamZoomPane object constructed by appUi + */ + virtual CCamZoomPane* ZoomPane() = 0; + + /** + * Returns current camera orientation + * @since 3.0 + * @return current camera orientation + */ + virtual TCamOrientation CamOrientation() = 0; + + /** + * Returns whether or the secondary camera has been activated + * Will return ETrue when when the second camera is active + * @since 2.8 + * @return ETrue if second camera is active, else returns EFalse + */ + virtual TBool IsSecondCameraEnabled() const = 0; + + /** + * Secondary camera orientation is constructed according to this flag. + * Flag can be forced to portrait/landscape or it can follow qwerty + * state. Variation is handled via configuration manager + * KCamCrFeature2ndCameraOrientation key. + * @param aLock, Lock orientation state flag. + * ETrue, ask state and lock it. + * EFalse, ask current state. + * @return ETrue if secondary camera orientation must be landscape + */ + virtual TBool IsQwerty2ndCamera( TBool aLock = EFalse ) = 0; + + /** + * Returns the active camera + * @since 2.8 + * @return either primary, secondary or none ( if in process of switching ) + */ + virtual TCamActiveCamera ActiveCamera() const = 0; + + /** + * Handles the shutter key press + * @param aPressed ETrue if the shutter is pressed, EFalse if released + * @since 2.8 + */ + virtual void HandleShutterKeyL( TBool aPressed ) = 0; + + /** + * Set embedding flag + * @param aEmbedding ETrue if we are embedding (ie Messaging, Realplayer), + * EFalse if not + * @since 2.8 + */ + virtual void SetEmbedding( TBool aEmbedding ) = 0; + + /** + * Return embedding flag + * @return aEmbedding ETrue if we are embedding (ie Messaging, Realplayer), + * EFalse if not + * @since 2.8 + */ + virtual TBool Embedding() const = 0; + + /** + * Set SendAs flag + * @param aSendAsInProgress ETrue if SendAs in progress, EFalse if not + * @since 2.8 + */ + virtual void SetSendAsInProgressL( TBool aSendAsInProgress ) = 0; + + /** + * Read SendAs flag value + * @return ETrue if sending file is in progress, EFalse otherwise + * @since 4.0 + */ + virtual TBool SendAsInProgress() const = 0; + + /** + * Return handle to active palette if supported + * @since 3.0 + * @return Handle to Active palette + */ + virtual MActivePalette2UI* ActivePalette() const = 0; + + /** + * + * + */ + virtual CCamActivePaletteHandler* APHandler() const = 0; + + /** + * Indicates whether or not the application is in a simulated exit situation + * @return ETrue if the application has pretended to exit, else EFalse + */ + virtual TBool IsInPretendExit() const = 0; + + /** + * Whether or not the telephone application is in the foreground + * @since 3.0 + * @return ETrue if the telephone application is in the foreground + */ + virtual TBool ForegroundAppIsPhoneApp() const = 0; + + /** + * Let the AppUi know what is being shown in pre-capture + * @param aMode What's being shown + */ + virtual void SetPreCaptureMode(TCamPreCaptureMode aMode) = 0; + + /* + * Gets the handle to the controller, which is used inturn by the + * plugin to call the interfaces for performing needed actions. + */ + virtual MCamAppController& AppController() = 0; + + /* + * Gets the handle to the settings model, which is used inturn by the + * plugin to call the interfaces for performing needed actions. + */ + virtual MCamStaticSettings& StaticSettingsModel() = 0; + + /** + * Returns whether an MMC removed note is pending + * @since 3.0 + * @return TBool ETrue if the UI needs to show an MMC + */ + virtual TBool IsMMCRemovedNotePending() const = 0; + + /** + * Set the requested resolution for a new file + * @since 3.2 + * @param aRequestedResolution the requested resolution from the new file request. + */ + virtual void SetRequestedNewFileResolution( const TSize& aRequestedResolution ) = 0; + + /** + * Get the requested resolution for a new file + * @since 3.2 + * @return the requested resolution from the new file request. + * Default is TSize(0,0) which interpreted as mms quality resolution + */ + virtual TSize RequestedNewFileResolution() const = 0; + + /** + * Whether or not the application is in the background + * @since 2.8 + * @param aIncludeNotifier If EFalse then the application is not + * classed as being in the background if the foreground application is + * a notifier, e.g. charging enabled. + * @return ETrue if the application is in the background + */ + virtual TBool AppInBackground( TBool aIncludeNotifier ) const = 0; + + protected: + + /** + * Offers a pointer to appui's TextResolver instance + * @since 3.0 + * @return pointer to appui's TextResolver instance + */ + virtual CTextResolver* TextResolver() = 0; + + private: + + private: // Data + + }; + +#ifdef _DEBUG +const TUint16* const KCamPreCaptureModeNames[] = + { + (const TUint16* const)_S16("ECamPreCapViewfinder"), + (const TUint16* const)_S16("ECamPreCapCaptureSetup"), + (const TUint16* const)_S16("ECamPreCapTimeLapseSlider"), + (const TUint16* const)_S16("ECamPreCapStandby"), + (const TUint16* const)_S16("ECamPreCapSceneSetting"), + (const TUint16* const)_S16("ECamPreCapGenericSetting") + }; +#endif + + +#endif // CAMAPPUIBASE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamCaptureSetupListBox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamCaptureSetupListBox.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A list box that displays settings items with radio buttons* +*/ + + +#ifndef CAMCAPTURESETUPLISTBOX_H +#define CAMCAPTURESETUPLISTBOX_H + +// INCLUDES + +#include +#include + +#ifndef CAMERAAPP_PLUGIN_BUILD + #include "CamAppController.h" +#else + #include "MCamAppController.h" +#endif //CAMERAAPP_PLUGIN_BUILD + + +// FORWARD DECLARATIONS +class MCamSettingValueObserver; + +// CLASS DECLARATION + +/** +* Main class of capture setup radio button list box. +* +* @since 2.8 +*/ +class CCamCaptureSetupListBox : public CEikListBox + { + public: // Constructors and destructor + + /** + * C++ default constructor. + */ + CCamCaptureSetupListBox( MCamSettingValueObserver* aObserver +#ifndef CAMERAAPP_PLUGIN_BUILD + ,CCamAppController& aController +#else + ,MCamAppController& aController +#endif //CAMERAAPP_PLUGIN_BUILD + ); + + /** + * Second phase constructor + * @since 2.8 + * @param aParent Parent control + * @param aArrayResourceId Listbox's item array + * @param aSettingItem setting item id + * @param aFlags Flags. By default 0 + * @param aShootingModeListBox ETrue if the listbox is shooting mode setting style + */ + void ConstructL( const CCoeControl* aParent, + TInt aArrayResourceId, + TInt aSettingItem, + TInt aFlags = 0, + TBool aShootingModeListBox = ETrue, + TBool aLocationSettingListBox = EFalse + ); + + /** + * Destructor. + */ + virtual ~CCamCaptureSetupListBox(); + + public: // New methods + + /** + * Initialize the list box + * @since 2.8 + * @param aCurrentValueId the current value for the setting being edited + */ + void InitializeL( TInt aCurrentValueId ); + + public: // methods from base classes + + /** + * From CCoeControl. + * Handles key events. + * @since 2.8 + * @param aKeyEvent The key event. + * @param aType The type of the event. + * @return Indicates whether or not the key event was used by this control. + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From CCoeControl. + */ + void HandlePointerEventL(const TPointerEvent& aPointerEvent); + + + private: // Data + + // observer that handles the control's update events + MCamSettingValueObserver* iSettingObserver; + + // Layout for icon in list-box + TAknLayoutRect iIconLayout; +#ifndef CAMERAAPP_PLUGIN_BUILD + CCamAppController& iController; +#else + MCamAppController& iController; +#endif //CAMERAAPP_PLUGIN_BUILD + }; + +#endif // CAMCAPTURESETUPLISTBOX_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamCaptureSetupListBoxModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamCaptureSetupListBoxModel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,224 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A model class for CCamCaptureSetupListBox* +*/ + + +#ifndef CAMCAPTURESETUPISTBOXMODEL_H +#define CAMCAPTURESETUPISTBOXMODEL_H + +// INCLUDES + +#include + +#ifndef CAMERAAPP_PLUGIN_BUILD + #include "CamAppController.h" +#else + #include "MCamAppController.h" +#endif //CAMERAAPP_PLUGIN_BUILD +#include "mcamlistboxmodel.h" + + +// FORWARD DECLARATIONS +class CCamInfoListboxItemBase; +class CFbsBitmap; +class TAknLayoutRect; + +// CLASS DECLARATION + +/** +* Model class of CCamCaptureSetupListBox +* +* @since 2.8 +*/ +class CCamCaptureSetupListBoxModel : public CBase, + public MCamListboxModel + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aController Controller reference + * @param aArrayResourceId Id of resource used to populate the list + * @param aSettingItem setting item + * @param aShootingModeListBox ETrue if the model represents a shooting mode capture setup listbox + * @return pointer to the created CCamCaptureSetupListBoxModel object + */ + static CCamCaptureSetupListBoxModel* NewLC( +#ifndef CAMERAAPP_PLUGIN_BUILD + CCamAppController& aController, +#else // location setting will be moved to the plugin + MCamAppController& aController, +#endif + TInt aArrayResourceId, + TInt aSettingItem, + TBool aShootingModeListBox, + TBool aLocationSettingListBox, + TRect aListBoxRect + ); + + /** + * Destructor. + */ + virtual ~CCamCaptureSetupListBoxModel(); + + + public: // from MCamListboxModel + + /** + * @since 2.8 + * Returns number of items in item array + * @return Number of items + */ + virtual TInt NumberOfItems() const; + + /** + * Returns pointer to the MDesCArray + * @since 2.8 + * @return Handle to MDesCArray + */ + virtual const MDesCArray* MatchableTextArray() const; + + /** + * Returns pointer to the item text + * @param aItemIndex index of the item + * @return pointer to the item text + */ + virtual TPtrC ItemText( TInt aItemIndex ) const; + + /** + * Returns the value id of the specified item + * @param aItemIndex index of the item + * @return the item's value id + */ + virtual TInt ItemValue( TInt aItemIndex ) const; + + /** + * Returns the bitmap for the specified item + * @param aItemIndex index of the item + * @return pointer to the icon bitmap + */ + virtual CFbsBitmap* Bitmap( TInt aItemIndex ) const; + + /** + * Returns the bitmap mask for the specified item + * @param aItemIndex index of the item + * @return pointer to the icon mask + */ + virtual CFbsBitmap* BitmapMask( TInt aItemIndex ) const; + + /** + * Returns the index of the item with the specified + * value id + * @param aValueId the value to find + * @return index of the matching item + */ + virtual TInt ValueIndex( TInt aValueId ) const; + + + /** + * Returns whether the model represents a shooting mode selection listbox + * @since 2.8 + * @return TBool ETrue if the model is representing a shooting mode listbox instead of a general settings listbox + */ + virtual TBool ShootingModeListBox() const; + + virtual TAknLayoutRect IconLayoutData() const; + virtual TAknLayoutRect RadioButtonLayoutData() const; + virtual TAknLayoutText TextLayoutData() const; + virtual TAknLayoutRect ListItemLayoutData() const; + + + protected: + + /** + * C++ default constructor. + * @since 2.8 + * @param aController Controller reference + * @param aShootingModeListBox is ETrue if the model represents a shooting mode settings listbox + */ + CCamCaptureSetupListBoxModel( +#ifndef CAMERAAPP_PLUGIN_BUILD + CCamAppController& aController, +#else // location setting will be moved to the plugin + MCamAppController& aController, +#endif //CAMERAAPP_PLUGIN_BUILD + TBool aShootingModeListBox, + TBool aLocationSettingListBox = EFalse + ); + + private: // Methods + + + /** + * Second phase constructor + * @since 2.8 + * @param aArrayResourceId Resource used to populate the list + * @param aSettingItem setting item + */ + void ConstructL( TInt aArrayResourceId, TInt aSettingItem, TRect aListBoxRect ); + + protected: + /** + * Read in layout data from resource + * @since 2.8 + */ + void ReadLayoutData( TRect aListBoxRect ); + + /** + * + * + */ + TBool SettingValueSupportedL( CCamInfoListboxItemBase* aItem, TInt aSettingItem ); + + protected: // Data + + // Array of items in the listbox + RPointerArray iItemArray; + + + + // layout data for listbox item icon + TAknLayoutRect iIconLayoutData; + + // layout data for listbox item radio button + TAknLayoutRect iRadioButtonLayoutData; + + // layout data for listbox item text + TAknLayoutText iTextLayoutData; + + TAknLayoutRect iListItemLayoutData; + + + +#ifndef CAMERAAPP_PLUGIN_BUILD + CCamAppController& iController; +#else + MCamAppController& iController; +#endif //CAMERAAPP_PLUGIN_BUILD + // Flag as to whether the model is for a shooting mode listbox + TBool iShootingModeListBox; + // Flag as to whether the model is for a location setting listbox + TBool iLocationSettingListBox; + + TUint32 iSupportedFlashModes; + + TUint32 iSupportedWBModes; + + }; + +#endif // CAMCAPTURESETUPISTBOXMODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamCaptureSetupListItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamCaptureSetupListItem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A list box item with text, a bitmap and a value id +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* +* +*/ + + +#ifndef CAMCAPTURESETUPLISTITEM_H +#define CAMCAPTURESETUPLISTITEM_H + +// INCLUDES +#include +#include "caminfolistboxitembase.h" + + +// CONSTANTS + + +// FORWARD DECLARATIONS +class CFbsBitmap; +class TResourceReader; + +/** +* A list item for CCamCaptureSetupListBox +*/ +class CCamCaptureSetupListItem : public CCamInfoListboxItemBase + { + public: + + /** + * Two-phased constructor. + * @since 2.8 + * @param aReader Interpreter for the resource used to populate the item + * @param aLayoutRect layout for icon displayed as part of list item + * @return pointer to the created CCamCaptureSetupListItem object + */ + static CCamCaptureSetupListItem* NewLC( TResourceReader& aReader, + TAknLayoutRect& aIconLayout ); + + /** + * Two-phased constructor. + * For construction with dynamic values, not resource. + */ + static CCamCaptureSetupListItem* NewLC( + const TDesC& aItemText, + TInt aSettingId, + TInt aBitmapId, + TAknLayoutRect aIconLayout ); + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamCaptureSetupListItem(); + + private: + + /** + * C++ default constructor. + * @since 2.8 + */ + CCamCaptureSetupListItem( TAknLayoutRect& aLayoutRect ); + + /** + * Construct the item using the supplied resource data + * @since 2.8 + * @param aReader Resource interpreter intialised with resource data + */ + void ConstructFromResourceL( TResourceReader& aReader ); + + /** + * Construct the item using the supplied values + */ + void ConstructFromValuesL( const TDesC& aItemText, + TInt aSettingId, + TInt aBitmapId ); + + /** + * Second phase construction + */ + void ConstructL(); + + private: + + // Layout for icon in list-box + TAknLayoutRect iIconLayout; + }; + +#endif // CAMCAPTURESETUPLISTITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamCaptureSetupListItemDrawer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamCaptureSetupListItemDrawer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A drawer class for the capture setup list box items* +*/ + + +#ifndef CAMCAPTURESETUPLISTITEMDRAWER_H +#define CAMCAPTURESETUPLISTITEMDRAWER_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class MCamListboxModel; +class CAknIconArray; +class CAknsBasicBackgroundControlContext; + +// CLASS DECLARATION + +/** +* Item drawer for CCamCaptureSetupListBox +* +* @since 2.8 +*/ +class CCamCaptureSetupListItemDrawer : public CListItemDrawer + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aListBoxModel reference to a list box model used to access item data + * @return pointer to the newly created object + */ + static CCamCaptureSetupListItemDrawer* NewL( MCamListboxModel& aListBoxModel ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamCaptureSetupListItemDrawer(); + + public: + /** + * Sets the parent control of the listbox + * @since 2.8 + * @param aControl pointer the the listbox's parent + */ + void SetParentControl( const CCoeControl* aControl ); + + private: + + /** + * C++ default constructor. + * @since 2.8 + * @param aListBoxModel reference to a list box model used to access item data + */ + CCamCaptureSetupListItemDrawer( MCamListboxModel& aListBoxModel ); + + /** + * Second phase construction + */ + void ConstructL(); + + private: // Methods from base classes + + + /** + * From CListItemDrawer + * Calculates the minimum size for a cell + * @since 2.8 + * @return the minimum size of a cell + */ + TSize MinimumCellSize() const; + + /** + * From CListItemDrawer + * Draws an item to the screen + * @since 2.8 + * @param aItemIndex the item to draw + * @param aActualItemRect the screen area occupied by the item + * @param aItemIsCurrent whether or not the item is highlighted + * @param aViewIsEmphasized unused + * @param aViewIsDimmed unused + * @param aItemIsSelected whether or not the item is selected + */ + void DrawActualItem( TInt aItemIndex, + const TRect& aActualItemRect, + TBool aItemIsCurrent, + TBool aViewIsEmphasized, + TBool aViewIsDimmed, + TBool aItemIsSelected ) const; + + private: // New methods + + /** + * Draws the highlight rectangle + * @since 2.8 + * @param aActualItemRect the screen area occupied by the item + */ + void DrawHighlight( const TRect& aActualItemRect ) const; + + /** + * Draws the radio button according to the items current state + * @since 2.8 + * @param remainingItemRect the remaining are for the item + * @param aItemIsSelected whether or not the item is selected + * @param aColor The colour to draw the radio button in + */ + void DrawRadioButton( const TRect& remainingItemRect, + TBool aItemIsSelected, const TRgb& aColor ) const; + + /** + * Draws a rectangle for an item. + * @since 2.8 + * @param the rectangular area to be drawn. + */ + void DrawItemRect( const TRect& aActualItemRect ) const; + + /** + * Read list layout + */ + void ReadLayout(); + + void CreateIconAndAddToArrayL( CArrayPtr*& aIconArray, + const TAknsItemID& aId, + const TInt aColorIndex, + const TDesC& aBmpFile, + const TInt32 aBmp, + const TInt32 aBmpM ); + + private: // Data + + // Array of icons for different radio button states. + CArrayPtr* iRadioButtonIconArray; + + // Model class providing access to item data + MCamListboxModel& iModel; + + // Item height read from resource + TInt iCaptureSetupItemHeight; + + // the parent control of the listbox + const CCoeControl* iParentControl; + + // Layouts + TAknTextComponentLayout iTxtLayout; + TAknWindowComponentLayout iBmpLayout; + TAknTextComponentLayout iTxtWithRbLayout; + TAknWindowComponentLayout iBmpWithRbLayout; + TAknWindowComponentLayout iHighlightLayout; + }; + +#endif // CAMCAPTURESETUPLISTITEMDRAWER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamCollectionManagerAo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamCollectionManagerAo.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Asynchronous Operation of Add to Album +* +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +*/ + +#ifndef __CAMCOLLECTIONMANAGERAO_H__ +#define __CAMCOLLECTIONMANAGERAO_H__ + +#include + +class CGlxCollectionInfo; +class CGlxCollectionManager; +class MCamAddToAlbumObserver; + +class CCamCollectionManagerAO : public CActive + { + public: // Constructors and destructor + + + /** + * Destructor. + */ + ~CCamCollectionManagerAO(); + + /** + * Constructor + * @aObserver Observer for compeleted/failed operations. + */ + CCamCollectionManagerAO( MCamAddToAlbumObserver& aObserver ); + + public: // New Method + + /** + * Initiates Add To Album Operation + * @param aSelectedAlbumIds Array of ids for albums where to add. + * @param aUri Filename of the image / video to add. + */ + void StartCallBackAddToAlbumL( const RArray& aSelectedAlbumIds, + const TDesC& aUri ); + + /** + * Initiate Check for Album Operation + * @param aDefaultAlbumId Album id. + */ + void CheckForAlbumExistenceL( const TUint32 aDefaultAlbumId ); + + public: // CActive + + /** + * Perform the next scheduled task + * @since 2.8 + */ + void RunL(); + + /** + * Cancels the active object + * @since 2.8 + */ + void DoCancel(); + + /** + * Handles a leave occuring in the request completion event handler + * @since 2.8 + * @param aError Error (leave) code. + */ + TInt RunError( TInt aError ); + + private: + + /** + * Performs the necessary add to album request + * Using the collection manager. + */ + void DoAddToAlbumOperationL(); + + /** + * We Perform the needed operation after we complete + * Checking for album existence + */ + void DoCheckAlbumOperationCompleteL(); + + /** + * Returns the Default Album Id from the CenRep key + */ + TUint32 DefaultAlbumIdFromCenRepL(); + + private: + + CGlxCollectionInfo* iCollectionInfo; + CGlxCollectionManager* iCollectionManager; + MCamAddToAlbumObserver& iObserver; + TInt iCurrentAlbumIndex; + RArray iSelectedAlbumIds; + TFileName iUri; + TBool iAddToAlbum; + TBool iCheckForAlbum; + }; + + +#endif // __CAMCOLLECTIONMANAGERAO_H__ diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamConstantsCamcorder.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamConstantsCamcorder.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definitions for the Camera Application* +*/ + + + + +// Constants + +#define KScreenWidthCC 320 +#define KScreenHeightCC 240 + +#define KCentralPaneHeightCC 192 + +#define KNaviPaneFontBaseCC 16 +#define KNaviPaneFontRightBorderCC 25 + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamConstantsPortrait.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamConstantsPortrait.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definitions for the Camera Application* +*/ + + + + +// Constants + +#define KScreenWidthPT 240 +#define KScreenHeightPT 320 + +#define KCentralPaneHeightPT 192 + +#define KNaviPaneFontBasePT 18 +#define KNaviPaneFontRightBorderPT 25 + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamConstantsViewMode.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamConstantsViewMode.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Product-specific Utility functions for the Camera Application* +*/ + + + +// Constants + +#define KScreenWidthVM 320 +#define KScreenHeightVM 240 + +#define KCentralPaneHeightVM 192 + +#define KNaviPaneFontBaseVM 13 +#define KNaviPaneFontRightBorderVM 25 + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamControllerObservers.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamControllerObservers.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines abstract API's for the controller observers* +*/ + + + + +#ifndef CAMCONTROLLEROBSERVERS_H +#define CAMCONTROLLEROBSERVERS_H + + + +/** +* Controller events that are reported to observers through the +* MCamControllerObserver interface +* +* @since 2.8 +*/ +enum TCamControllerEvent + { + ECamEventControllerReady, // New request can be issued to CCamAppController + + ECamEventEngineStateChanged, + ECamEventOperationStateChanged, + ECamEventSnapshotReady, + ECamEventCaptureComplete, + ECamEventRecordComplete, + ECamEventCounterUpdated, + ECamEventZoomStateChanged, + ECamEventFocusCancelled, + ECamEventFlashStateChanged, + ECamEventSceneStateChanged, + ECamEventAudioMuteStateChanged, + ECamEventContAFStateChanged, + ECamEventVideoFileTypeChanged, + ECamEventImageQualityChanged, + ECamEventVideoQualityChanged, + ECamEventSaveLocationChanged, + ECamEventSaveComplete, + ECamEventSaveCancelled, + ECamEventVideoPauseTimeout, + ECamEventMediaFileChanged, + ECamEventExitRequested, + ECamEventCallStateChanged, + ECamEventMemoryCardHotswap, + ECamEventCameraChanged, + ECamEventSetupStateChanged, + ECamEventZoomSetupChanged, + ECamEventMacroSwitchChanged, + ECamEventSliderOpen, + ECamEventSliderClosed, + ECamEventInvalidMemoryCard, + ECamEventVfOverlayChanged, // Yet only for CAMERAAPP_PRODUCT_SUPPORTS_VF_GRID + ECamEventUserModeChanged, + ECamEventHistogramChanged, + + ECamEventLocationSettingChanged, + ECamEventRestoreCameraSettings, + ECamEventExposureChanged, + ECamEventVideoStabChanged, + ECamEventImageData, + ECamEventFaceTrackingStateChanged, + ECamEventInitReady, + }; + +// FORWARD DECLARATIONS +class CFbsBitmap; + +// CLASS DECLARATION + +/** +* Abstract API for viewfinder observer. +* Derived classes may register as viewfinder observers to get +* related notifications from CCamAppController. +* +* @since 2.8 +*/ +//class MCamViewFinderObserver +// { +// public: +// /** +// * New viewfinder frame is available +// * @since 2.8 +// * @param aFrame pointer to the bitmap. This pointer is valid until +// * the call returns. Ownership not transferred. +// * @param aFrozen whether or not the viewfinder has been frozen +// */ +// virtual void ShowViewFinderFrame( const CFbsBitmap* aFrame, TBool aFrozen ) = 0; +// }; + +/** +* Abstract API for controller observer. +* Derived classes may register as controller observers to +* get related notifications about state changes in CCamAppController and +* engine notifications. +* +* @since 2.8 +*/ +class MCamControllerObserver + { + public: + /** + * Handle an event from CCamAppController. + * @since 2.8 + * @param aEvent the controller event that has occurred + * @param aError any reported error + */ + virtual void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ) = 0; + }; + +#endif // CAMCONTROLLEROBSERVERS_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamLocalViewIds.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamLocalViewIds.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ID's for all Camera Plugin Views +* +*/ + + +#ifndef CAMLOCALVIEWIDS_H +#define CAMLOCALVIEWIDS_H + +#include "CamAppUiBase.h" + +// +// Constants used from Camera Settings Plugin +// +const TUid KGSCamImageSettingsViewId = {50}; +const TUid KGSCamVideoSettingsViewId = {51}; + +// Uid to actually launch back the appropriate views from settings application +// and these are used only when camera plugin is launched from camera. +// the values are obtained from "CamAppUiBase.h" + +const TUid KImagePreCaptureId = { ECamViewIdStillPreCapture }; +const TUid KVideoPreCaptureId = { ECamViewIdVideoPreCapture }; + +// Following are the message uids which are used to communicate to the camera application +// to handle specific case seperately. + +// Message Uid meant for activating appropriate Image/Video Precapture view. +const TUid KMsgActivatePreCaptureView = {0}; + +// message uid meant for exiting camera from plugin +const TUid KMsgExitCameraFromPlugin = {1}; + +// message uid meant for resetting camera settings +const TUid KMsgRestoreSettingsUid = {2}; + +/* +* Id's to activate the local plugin views; used from both camera and setting plugin +*/ +const TInt KGSActivatePhotoSettingsView = 10; +const TInt KGSActivateVideoSettingsView = 20; +const TInt KGSSecondaryCameraPhotoSettingsView = 30; +const TInt KGSSecondaryCameraVideoSettingsView = 40; + +#endif //CamLocalViewIds_H +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamLogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamLogger.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Responsible for logging tests results to one or more files. +* +* CCopyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* +* +*/ + + +#ifndef CAMLOGGER_H +#define CAMLOGGER_H + +// INCLUDES +#include + +// CONSTANTS +#ifdef CAMERAAPP_LOGGING +enum TTestFileType { ETestFileFailed, ETestFilePassed, ETestFileLog }; +#endif + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +#ifndef CAMERAAPP_LOGGING + +// Add dummy file Identifiers here, for non test mode. One for each unit test. +#define CONTAINERUNITTESTLOGID +#define TIMERUNITTESTLOGID +#define UTILITY_UNIT_TESTS_LOG_ID +#define NAVICOUNTERUNITTESTLOGID +#define NAVIPROGRESSUNITTESTLOGID +#define FRAMEWORKUNITTESTLOGID +#define CONTROLLERUNITTESTLOGID +#define VIEWSUNITTESTLOGID +#define CAPTURESETUPUNITTESTLOGID +#define SIDEPANEUNITTESTLOGID +#define CAPTURESETUPMENUUNITTESTLOGID +#define BURSTARRAYUNITTESTLOGID +#define BURSTCAPTUREUNITTESTLOGID +#define SETTINGSLISTSUNITTESTLOGID +#define UNITTESTUSERSCENESETUPLOGID +#define UNITTESTUTILITYLOGID +#define GENERALUNITTESTLOGID + +#define CAM_LOG_DUMMYINITIALISELOGS( a, b ) +#define CAM_LOG_INITIALISELOGS( a ) +#define CAM_LOG_LOGHEADER( a, b ) +#define CAM_LOG_LOGTESTRESULT( a, b, c ) +#define CAM_LOG_LOGDETAIL( a, b, c, d ) + + +/** +* Class that does nothing. To be used in non-test mode. +*/ + +#else + +enum TTestResult +{ + UTStarted, + UTFinished, + UTFailed, + UTNumberOfTests, + UTAllTestsFinished +}; + +// Add file Identifiers here, for test code. One for each unit test. +#define TIMERUNITTESTLOGID _L("CamTimer Unit Tests ") +#define UTILITY_UNIT_TESTS_LOG_ID _L("CamUtility Unit Tests ") +#define NAVICOUNTERUNITTESTLOGID _L("CamNaviCounter Unit Tests ") +#define NAVIPROGRESSUNITTESTLOGID _L("CamNaviProgressBar Unit Tests ") +#define FRAMEWORKUNITTESTLOGID _L("Framework Unit Tests ") + +#define CONTROLLERUNITTESTLOGID _L("Controller Unit Tests ") +#define CONTAINERUNITTESTLOGID _L("Container Unit Tests ") + +#define SELFTIMERUNITTESTLOGID _L("Self Timer Unit Tests ") +#define BURSTARRAYUNITTESTLOGID _L("Burst Array Unit Tests ") +#define BURSTGRIDUNITTESTLOGID _L("Burst Grid Unit Tests ") +#define ZOOMPANEUNITTESTLOGID _L("Zoom Pane Unit Tests ") +#define SETTINGSLISTSUNITTESTLOGID _L("Settings Lists Units Tests ") + +#define VIEWSUNITTESTLOGID _L("Views Unit Tests ") +#define SETTINGSMODELUNITTESTLOGID _L("Settings Model Unit Tests") +#define CAPTURESETUPUNITTESTLOGID _L("Capture Setup Unit Tests") +#define CAPTURESETUPMENUUNITTESTLOGID _L("Capture Setup Menu Unit Tests") +#define SIDEPANEUNITTESTLOGID _L("Side Pane Unit Tests") +#define BURSTCAPTUREUNITTESTLOGID _L("Burst Capture Unit Tests ") +#define UNITTESTUSERSCENESETUPLOGID _L("Unit Test User Scene Setup Unit Tests ") +#define UNITTESTUTILITYLOGID _L("Unit Test Utility Unit Tests ") + + +#define GENERALUNITTESTLOGID _L("General Unit Tests ") + + +#define CAM_LOG_DUMMYINITIALISELOGS( a, b ) CamLogger::InitialiseLogsL( a, b ) +#define CAM_LOG_INITIALISELOGS( a ) CamLogger::InitialiseLogsL( a ) +#define CAM_LOG_LOGHEADER( a, b ) CamLogger::LogHeader( a, b ) +#define CAM_LOG_LOGTESTRESULT( a, b, c ) CamLogger::LogTestResult( a, b, c ) +#define CAM_LOG_LOGDETAIL( a, b, c, d ) CamLogger::LogDetail( GENERALUNITTESTLOGID, a, b, c, d ) + +#endif // __CAM_TEST_MODE__ + + +#endif // CAMLOGGER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamModeSelect.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamModeSelect.rh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource STRUCT definitions specifically for the camera* +*/ + +STRUCT CAM_MODE_SELECT_SUMMARY + { + WORD setting_value_id; + LONG summary_icon; + LTEXT summary_title_text; + LTEXT summary_description_text; + } + +STRUCT CAM_MODE_SELECT_SUMMARY_LAYOUT + { + STRUCT summary_rect; + STRUCT summary_inner_rect; + STRUCT summary_icon; + STRUCT summary_title[]; + STRUCT summary_description[]; + } + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamPSI.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamPSI.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,308 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A set of product specific values used by CamUtility* +*/ + + + +#ifndef CAMPSI_H +#define CAMPSI_H + +#include +#include +#include +#include "Cam.hrh" + +// DATA TYPES + +// This enum lists all Product Specific Information values that can be +// retrieved by the CamUtility::GetPSI methods. +enum TCamPsiKey + { + ECamPsiOrientation, // application orientation landscape, portrait or unspecified + // values are defined in CEikAppUi + ECamPsiPrimaryCameraOrientation, + ECamPsiSecondaryCameraOrientation, + ECamPsiEditingOrientation, + + ECamPsiSoftKeyPosition, + + ECamPsiSidePanePosition, + ECamPsiZoomInKey, + ECamPsiZoomOutKey, + ECamPsiVideoZoomSupport, + ECamPsiOverLaySidePane, + ECamPsiImageSizes, + ECamPsiViewFinderFreeze, + + ECamPsiSelfTimerPeriod1, + ECamPsiSelfTimerPeriod2, + ECamPsiSelfTimerPeriod3, + + ECamPsiLongCaptureKeyPressInterval, + ECamPsiMaxZoomSteps, + ECamPsiMaxExtendedZoomSteps, + ECamPsiMaxOpticalZoomSteps, + ECamPsiSpecificZoomValues, + ECamPsiNumSpecificZoomValues, + ECamPsiLeftNaviKey, + ECamPsiLeftNaviKeyCam2, + ECamPsiRightNaviKey, + + ECamPsiSecondaryZoomInKey, + ECamPsiSecondaryZoomOutKey, + + ECamPsiMaxBurstCapture, + ECamPsiZoomBarLAF, + ECamPsiSupportedStillResolutions, + ECamPsiSupportedVideoResolutions, + ECamPsiSupportedStillQualities, + ECamPsiSupportedVideoQualities, + // Supported scenes depend on user mode. + // Each mode has now own key. + // ECamPsiSupportedStillScenes, + // ECamPsiSupportedVideoScenes, + ECamPsiSupportedStillScenesNovice, + ECamPsiSupportedStillScenesAdvanced, + ECamPsiSupportedVideoScenesNovice, + ECamPsiSupportedVideoScenesAdvanced, + + ECamPsiCaptureDelayTiming, + + ECamPsiEVCompSliderInfo, + ECamPsiEVCompSliderBitmapId, + ECamPsiAPEVCompLegend, + ECamPsiEVCompSliderRangeResourceId, + ECamPsiEVCompSliderRangeResourceAHId, + ECamPsiUserSceneResourceIds, + + ECamPsiVideoViewFinderResolutions, + ECamPsiVideoVFResSecondaryCamera, + + ECamPsiCourtesyUiTimeoutValue, + + ECamPsiNumberSupportedStillQualities, + ECamPsiNumberSupportedVideoQualities, + ECamPsiStillMaxQualityResId, + + ECamPsiStillQualitySliderLegendInfo, + ECamPsiVideoQualitySliderLegendInfo, + ECamPsiVideoQualityIconIds, + ECamPsiVideoQualityFileTypeId, + ECamPsiStillQualityIconIds, + + ECamPsiPrecapStillQualityIconIds, + ECamPsiPrecapVideoQualityIconIds, + + ECamPsiPrecapLocationIconIds, + + ECamPsiModeKeyScanCode, + ECamPsiJpegDataSizes, + ECamPsiSequencePostProcessDataSizes, + ECamPsiSnapshotSize, + + + ECamPsiVideoUserModeNovDisabledSettings, + ECamPsiPhotoUserModeNovDisabledSettings, + ECamPsiEmbVideoUserModeNovDisabledSettings, + ECamPsiEmbPhotoUserModeNovDisabledSettings, + + // Has own mapping function now => key not needed. + // ECamPsiSharpnessValues, + + ECamPsiKeyNone + }; + +// Whether the side pane is on the left or right hand side of the screen +// in landscape mode. +enum TCamHandedness + { + ECamHandLeft, + ECamHandRight + }; + +// Which behaviour is implemented for the left and right arrow keys +enum TCamLeftRightNaviKeyBehaviour + { + ECamNaviKeyNone, + ECamNaviKeyIncreaseFlashSetting, + ECamNaviKeyDecreaseFlashSetting, + ECamNaviKeyHorizontalSelector, + ECamNaviKeyCaptureSetup + }; + +// Which keys initiate a capture event +enum TCamCaptureKeys + { + ECamCaptureKeyNaviSelect = EStdKeyDevice3 + }; + +// This enum lists the options available for zooming in relation to video +// capture. +enum TCamVideoZoom // NOTE: Use as a bitmask + { + ECamZoomWhenRecord = 0x1 // Can zoom when recording video. + }; + + +// --------------------------------------------------------------------------- +class TImageSizeArray + { +public: + TInt iNoOfImageQuality; + TInt iNoOfImageRes; + TInt iArray[3][4]; + }; + +// --------------------------------------------------------------------------- +const TInt KNoOfSelfTimerPeriods = 3; + +class TSelfTimerSetting + { + public: + + // Default constructor to init values to KErrNotSupported. + TSelfTimerSetting() + { + for( TInt i = 0; i < KNoOfSelfTimerPeriods; i++ ) + { + iThreshold [i] = KErrNotSupported; + iFlashPeriod[i] = KErrNotSupported; + iBeepPeriod [i] = KErrNotSupported; + } + iAutoFocus = KErrNotSupported; + }; + + TInt iThreshold[KNoOfSelfTimerPeriods]; // + TInt iFlashPeriod[KNoOfSelfTimerPeriods]; // + TInt iBeepPeriod[KNoOfSelfTimerPeriods]; // + TInt iAutoFocus; + }; + +// --------------------------------------------------------------------------- +// This class represents the maximum supported zoom step +// for photo and video resolutions +class TCamMaxZoomSteps + { + public: + + // Default constructor to init values to KErrNotSupported. + TCamMaxZoomSteps(): + iMaxPhotoStepW9MP (KErrNotSupported), + iMaxPhotoStepW6MP (KErrNotSupported), + iMaxPhotoStep12MP (KErrNotSupported), + iMaxPhotoStep8MP (KErrNotSupported), + iMaxPhotoStep5MP (KErrNotSupported), + iMaxPhotoStep3MP (KErrNotSupported), + iMaxPhotoStep2MP (KErrNotSupported), + iMaxPhotoStep1_3MP(KErrNotSupported), + iMaxPhotoStep1MP (KErrNotSupported), + iMaxPhotoStep0_8MP(KErrNotSupported), + iMaxPhotoStepSVGA (KErrNotSupported), + iMaxPhotoStepVGA (KErrNotSupported), + + iMaxVideoStepHD (KErrNotSupported), + iMaxVideoStepWVGA (KErrNotSupported), + iMaxVideoStepNHD (KErrNotSupported), + iMaxVideoStepVGA (KErrNotSupported), + iMaxVideoStepQVGA (KErrNotSupported), + iMaxVideoStepCIF (KErrNotSupported), + iMaxVideoStepQCIF (KErrNotSupported), + iMaxVideoStepSQCIF(KErrNotSupported), + + iMax2ndCamPhotoStep (KErrNotSupported), + + iMax2ndCamVideoStepCIF (KErrNotSupported), + iMax2ndCamVideoStepQCIF (KErrNotSupported), + iMax2ndCamVideoStepSQCIF(KErrNotSupported) + {}; + + // Primary camera Photo steps + TInt iMaxPhotoStepW9MP; + TInt iMaxPhotoStepW6MP; + TInt iMaxPhotoStep12MP; + TInt iMaxPhotoStep8MP; + TInt iMaxPhotoStep5MP; + TInt iMaxPhotoStep3MP; + TInt iMaxPhotoStep2MP; + TInt iMaxPhotoStep1_3MP; + TInt iMaxPhotoStep1MP; + TInt iMaxPhotoStep0_8MP; + TInt iMaxPhotoStepSVGA; + TInt iMaxPhotoStepVGA; + + // Primary camera Video steps + TInt iMaxVideoStepHD; + TInt iMaxVideoStepWVGA; + TInt iMaxVideoStepNHD; + TInt iMaxVideoStepVGA; + TInt iMaxVideoStepQVGA; + TInt iMaxVideoStepCIF; + TInt iMaxVideoStepQCIF; + TInt iMaxVideoStepSQCIF; + + TInt iMax2ndCamPhotoStep; + + TInt iMax2ndCamVideoStepCIF; + TInt iMax2ndCamVideoStepQCIF; + TInt iMax2ndCamVideoStepSQCIF; + }; + +// --------------------------------------------------------------------------- +// Contains details of the time interval between zoom steps, and the number +// of zoom steps to jump in each interval. +// Also has the colour of each segment of the zoom pane. +class TCamZoomLAF + { + public: + // Default constructor to init values. + TCamZoomLAF() : + iZoomSpeedOpt(1), iZoomStepsOpt(1), iZoomColourOpt(), + iZoomSpeedDig(1), iZoomStepsDig(1), iZoomColourDig(), + iZoomSpeedExt(1), iZoomStepsExt(1), iZoomColourExt(), + iSecondCameraZoomSteps(1) + {}; + + + TInt iZoomSpeedOpt; // Time per zoom tick in milliseconds + TInt iZoomStepsOpt; // No of zoom steps per tick + TRgb iZoomColourOpt; // Colour of optical zoom in zoom bar + + TInt iZoomSpeedDig; // Time per zoom tick in milliseconds + TInt iZoomStepsDig; // No of zoom steps per tick + TRgb iZoomColourDig; // Colour of optical zoom in zoom bar + + TInt iZoomSpeedExt; // Time per zoom tick in milliseconds + TInt iZoomStepsExt; // No of zoom steps per tick + TRgb iZoomColourExt; // Colour of optical zoom in zoom bar + + TInt iSecondCameraZoomSteps; + }; + +// --------------------------------------------------------------------------- +// EV comp slider range +class TCamEvCompRange + { + public: + // Default constructor to init values. + TCamEvCompRange(): + iMinValue(0), iMaxValue(0), iStepsPerUnit(-1) + {}; + + TInt iMinValue; // Minimum EV value displayed on slider + TInt iMaxValue; // Maximum EV value displayed on slider + TInt iStepsPerUnit; // Number of divisions per singe EV unit + }; + +#endif // CAMPSI_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamPanic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamPanic.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Panic function for the Camera Application* +*/ + + +#ifndef CAMPANIC_H +#define CAMPANIC_H + +// INCLUDES +#include + +// DATA TYPES + +/** Camera application panic codes */ +enum TCameraPanic + { + ECamPanicUi = 1, + ECamPanicEVUnexpectedNumerator, + ECamPanicResourceLeak, + ECamPanicInvalidState, + ECamPanicInvalidView, + ECamPanicFileSystemError, + ECamPanicNullImage, + ECamPanicNullPointer, + ECamPanicUnhandledCreateSettingItem, + ECamPanicUnknownSettingItem, + ECamPanicInvalidZoomValue, + ECamPanicCaptureSetupMenuUnknownItem, + ECamPanicUnhandledCommand, + ECamPanicUSSPairNotFound, + ECamPanicDefaultNotFoundInIniFile, + ECamPanicBadIndex, + ECamPanicMultipleSettingItemPreviews, + ECamPanicUnexpectedBitmapSize, + // add further panics here + ECamPanicInvalidResource, + ECamPanicInvalidActivePaletteItemType, + ECamPanicNonSettingActivePaletteTypeExpected, + ECamPanicNoSuitableIsoSettingFound, + ECamPanicHistogramError, + ECamPanicSecondaryQualityMissing, + ECamPanicMMSQualityMissing, + ECamPanicNotEnoughISOValuesSupported, + + ECamPanicNotSupported = 99, + }; + +GLREF_C void CamPanic( TCameraPanic aReason ); + +#endif // CAMPANIC_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamProductSpecificSettings.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamProductSpecificSettings.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This header file defines the default values for settings. +* +*/ + + +#ifndef CAMPRODUCTSPECIFICSETTINGS_HRH +#define CAMPRODUCTSPECIFICSETTINGS_HRH + +#include + + +// Minimum, maximum, and EV step values for exposure +#define KExposureMinimumEV -1.5f +#define KExposureMaximumEV 1.5f +#define KExposureStepEV 0.3f + +// List of default values for different dynamic settings... +#define KDefaultPhotoScene ECamSceneAuto +#define KDefaultVideoScene ECamSceneNormal +#define KDefaultWhiteBalance ECamWhiteBalanceAWB +#define KDefaultISO ECamISO50 +#define KDefaultColourFilter ECamColourFilterColour +#define KDefaultExposure ECamExposureZero +#define KDefaultFlash ECamFlashAuto + +#endif // CAMPRODUCTSPECIFICSETTINGS_HRH diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamSettingValueObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamSettingValueObserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines abstract API for burst mode observers* +*/ + + +#ifndef CAMSETTINGVALUEOBSERVER_H +#define CAMSETTINGVALUEOBSERVER_H + + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Mixin class used to inform an observer of a change +* in a setting value +* +* @since 2.8 +*/ +class MCamSettingValueObserver + { + public: + /* + * Used when a change in a setting value requires interaction + * by an observer + * @since 2.8 + * @param aNewValue The new value of the setting observed + */ + virtual void HandleSettingValueUpdateL( TInt aNewValue ) = 0; + }; + +#endif // CAMSETTINGVALUEOBSERVER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamSettings.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamSettings.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,295 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains constants which define the configuration of the camera +* +*/ + + +#ifndef CAMSETTINGS_HRH +#define CAMSETTINGS_HRH + +#include + +#include + + +// DATA TYPES + + + +// Ids for camera statup mode +// Values associated with the key "DefaultCaptureMode" for +// the shared.ini file +enum TCamStartupMode + { + ECamStillCapture, + ECamVideoCapture, + ECamBurstCapture + }; + +// Ids for different white balance settings +// Values associated with the key "UserSceneWhiteBalance" for +// the shared.ini file +enum TCamWhiteBalanceId + { + ECamWhiteBalanceAWB , + ECamWhiteBalanceDaylight, + ECamWhiteBalanceCloudy, + ECamWhiteBalanceTungsten, + ECamWhiteBalanceFlourescent, + ECamWhiteBalanceMax + }; + +// Ids for different exposure values (dynamic) +// Values associated with the key "UserSceneExposure" for +// the shared.ini file +// IMPORTANT: These values must be in order from lowest +// to highest. Otherwise, the mapping function ConvertSettingsModelEvToCameraAPIEv +// will not work correctly. +enum TCamExposureId + { + ECamExposureMinusTwo = -4, + ECamExposureMinusOnePointFive = -3, + ECamExposureMinusOne = -2, + ECamExposureMinusPointFive = -1, + ECamExposureZero = 0, + ECamExposurePointFive = 1, + ECamExposureOne = 2, + ECamExposureOnePointFive = 3, + ECamExposureTwo = 4, + ECamExposureMax = ECamExposureTwo + }; + +// Ids for different colour filter settings +// Values associated with the key "UserSceneColourFilter" for +// the shared.ini file +enum TCamColourFilterId + { + ECamColourFilterColour, + ECamColourFilterBlackAndWhite, + ECamColourFilterSepia, + ECamColourFilterNegative, + ECamColourFilterVivid, + ECamColourFilterMax + }; + +// Ids for different flash settings +// Values associated with the key "UserSceneFlash" for +// the shared.ini file +enum TCamFlashId + { + ECamFlashOff, + ECamFlashAuto, + ECamFlashForced, + ECamFlashAntiRedEye, + ECamFlashLastItem + }; + + +// Ids for different media storage +// Values associated with the keys "PhotoMemInUse" and "VideoMemInUse" +// for the shared.ini file +// ECamMediaStorageCurrent indicates use current media storage +// ECamMediaStorageNone indicates an uninitialised state +// IMPORTANT: These values are mapped in the camUtility file to +// CAknMemorySelectionDialog::TMemory values used in the settings list +// page for selecting the memory in use +enum TCamMediaStorage + { + ECamMediaStorageNone, + ECamMediaStoragePhone, + ECamMediaStorageCard, + ECamMediaStorageMassStorage, + ECamMediaStorageCurrent + }; + + +// Ids for different light sensitivities +enum TCamLightSensitivityId + { + ECamLightSensitivityAuto, + ECamLightSensitivityLow, + ECamLightSensitivityLowMed, + ECamLightSensitivityMed, + ECamLightSensitivityMedHigh, + ECamLightSensitivityHigh + }; + + +// +// The actual ISO rate identifier. +// Mapped from TCamLightSensitivityId in product configuration. +enum TCamIsoRate + { + ECamIsoRateAuto = 0, + ECamIsoRate50 = 50, + ECamIsoRate100 = 100, + ECamIsoRate200 = 200, + ECamIsoRate400 = 400, + ECamIsoRate800 = 800, + ECamIsoRate1600 = 1600, + ECamIsoRate3200 = 3200 + }; +// + + +// Ids for video clip length +// Values associated with the key "VideoClipLen" for the shared.ini file +enum TCamVideoClipLength + { + ECamVideoClipMax, + ECamVideoClipShort + }; + + +// No/Yes settings options +// Values associated with the keys "PhotoStoreAlbum" and "VideoStoreAlbum" +// for the shared.ini file +enum TCamSettingsNoYes + { + ECamSettNo, + ECamSettYes + }; + +// On/off settings options +// Values associated with the keys "PhotoFocusPoint", "PhotoShowCaptured", +// "VideoAudRec" and "VideoShowCaptured", "ContinuosAutofocus" for the shared.ini file +enum TCamSettingsOnOff + { + ECamSettOn, + ECamSettOff + }; + +// Values for the settings of zoom. +enum TCamSettingsDigitalZoom + { + // If product does not support paused extended zoom, then only "normal continuous" and "exteneded continuous" + // options are available. The values are thenused as booleans so one of them needs to be zero ("false"). + + ECamSettDigZoomNormalCont = 0x00, // Basic digital zoom enabled, no pause on optical-digital zoom boundary + ECamSettDigZoomExtendCont = 0x01, // Extended zoom enabled, no pauses on zoom barriers + ECamSettDigZoomNormalPause = 0x02, // Basic digital zoom enabled, pause on optical-digital zoom boundary + ECamSettDigZoomExtendPause = 0x03, // Extended zoom enabled, pause on optical-digital-extended zoom boundaries + ECamSettDigZoomNone = 0x04 // Digital and extended zoom disabled + }; + + +// Capture tone settings +// Values associated with the key "PhotoCaptureTone" +enum TCamSettingsCaptureTone + { + ECamSettTone1, + ECamSettTone2, + ECamSettTone3, + ECamSettTone4 + }; + +// File name base type settings +// Values associated with the keys "ImgNamType" and "VidNamType" for +// the shared.ini file +enum TCamNameBaseType + { + ECamNameBaseDate, + ECamNameBaseText + }; + +// Ids for different brightness settings (dynamic) +enum TCamBrightnessId + { + ECamBrightnessNorm, + ECamBrightnessPlus, + ECamBrightnessNeg + }; + +// Ids for different contrast settings (dynamic) +enum TCamContrastId + { + ECamContrastNorm, + ECamContrastPlus, + ECamContrastNeg + }; + +// Ids for different self-timer settings (dynamic) +enum TCamSelfTimerId + { + ECamSelfTimerOff, + ECamSelfTimer2, + ECamSelfTimer10, + ECamSelfTimer20 + }; + +// Ids for different image sharpness settings (dynamic) +enum TCamImageSharpnessId + { + ECamImageSharpnessHard, + ECamImageSharpnessNorm, + ECamImageSharpnessSoft + }; + +// Ids for different colour saturation settings (dynamic) +enum TCamColourSaturationId + { + ECamColourSaturationNorm, + ECamColourSaturationPlus, + ECamColourSaturationNeg + }; + +enum TCamFlickerCancellation + { + ECamFlickerCancellation50Hz, + ECamFlickerCancellation60Hz + }; + +enum TCamImageOrientation + { + ECamOrientation0, + ECamOrientation90, + ECamOrientation180, + ECamOrientation270, + ECamOrientationIgnore, + ECamOrientationCount + }; + +enum T2ndCamOrientation + { + E2ndCamUnknown, + E2ndCamAuto, // Follows qwerty state + E2ndCamPortraitForced, + E2ndCamLandscapeForced + }; + +enum TCameraSwitchRequired + { + ESwitchDone, + ESwitchToUnknown, + ESwitchPrimaryToSecondary, + ESwitchSecondaryToPrimary, + ESwitchSecondaryOrientation + }; + +#ifdef _DEBUG +#ifndef CAMERAAPP_PLUGIN_BUILD +const TUint16* const KCamOrientationNames[] = + { + (const TUint16* const)_S16("ECamOrientation0"), + (const TUint16* const)_S16("ECamOrientation90"), + (const TUint16* const)_S16("ECamOrientation180"), + (const TUint16* const)_S16("ECamOrientation270"), + (const TUint16* const)_S16("ECamOrientationIgnore") + }; +__ASSERT_COMPILE( (sizeof(KCamOrientationNames)/sizeof(TUint16*)) == ECamOrientationCount ); +#endif // CAMERAAPP_PLUGIN_BUILD +#endif // _DEBUG + +#endif // CAMSETTINGS_HRH diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamSettingsInternal.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamSettingsInternal.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,691 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains constants which define the configuration of the camera. +* These constants are internal to this application only. +* +*/ + + +#ifndef CAMSETTINGSINTERNAL_HRH +#define CAMSETTINGSINTERNAL_HRH + +// DATA TYPES + +// Ids for different settings list items. +enum TCamSettingItemIds + { + // Start mode photo or video + ECamSettingItemDefaultMode, // shared key is "DefaultCaptureMode" + + // ----------------------------------------------------- + // Static photo settings + ECamSettingItemStaticPhotoRangeMin, // Range marker for static photo settings + ECamSettingItemPhotoQuality, // shared key is "PhotoQuality" + ECamSettingItemPhotoShowFocusPoint, // shared key is "PhotoFocusPoint" + ECamSettingItemPhotoStoreInAlbum, // shared key is "PhotoStoreAlbum" + ECamSettingItemShowCapturedPhoto, // shared key is "PhotoShowCaptured" + ECamSettingItemPhotoCaptureTone, // shared key is "PhotoCaptureTone" + ECamSettingItemPhotoMediaStorage, // shared key is "PhotoMemInUse" + ECamSettingItemPhotoNameBase, // shared key is "ImgBase" from KSDUidCamcorder + ECamSettingItemPhotoNameBaseType, // shared key is "ImgNamType" + ECamSettingItemPhotoNumber, // shared key is "ImgCount" + ECamSettingItemPhotoDigitalZoom, // shared key is "PhotoExtDigZoom" + ECamSettingItemFaceTracking, // shared key is "PhotoFaceTracking" + ECamSettingItemImageRotation, + ECamSettingItemFlickerCancel, + + + ECamSettingItemPhotoSize, // shared key is "PhotoSize" + ECamSettingItemPhotoCompression, // not in shared data. Need to hold compression + // as this can change from standard for sports scene + // and sequence mode. + ECamSettingItemImageToolbarItems, + ECamSettingItemImageToolbarDefaultItems, + ECamSettingItemStaticPhotoRangeMax, // Range marker for static photo settings + // ----------------------------------------------------- + + // ----------------------------------------------------- + // Static Video settings + ECamSettingItemStaticVideoRangeMin, // Range marker for static video settings + ECamSettingItemVideoAudioRec, // shared key is "VideoAudRec" + ECamSettingItemContinuousAutofocus, // shared key is "KCamCrContinuosAutofocus" + ECamSettingItemVideoStoreInAlbum, // shared key is "VideoStoreAlbum" + ECamSettingItemVideoShowCapturedVideo, // shared key is "VideoShowCaptured" + ECamSettingItemVideoMediaStorage, // shared key is "VideoMemInUse" + ECamSettingItemVideoNameBase, // shared key is "VidBase" from KSDUidCamcorder + ECamSettingItemVideoNameBaseType, // shared key is "VidNamType" + ECamSettingItemVideoNumber, // shared key is "VidCount" + ECamSettingItemVideoQuality, // shared key is "VideoQuality" + ECamSettingItemVideoDigitalZoom, // shared key is "VidExtDigZoom" + ECamSettingItemVideoStab, + ECamSettingItemVideoOpZoomOff, // + ECamSettingItemVideoResolution, // shared key is "VideoRes" + ECamSettingItemVideoClipLength, // shared key is "VideoClipLen" + ECamSettingItemVideoFileType, // shared key is "VideoFileType" + ECamSettingItemStaticVideoRangeMax, // Range marker for static video settings + // ----------------------------------------------------- + + // ----------------------------------------------------- + // Static common settings + ECamSettingItemStaticCommonRangeMin, // Range marker for static common settings + ECamSettingItemUserMode, + ECamSettingItemDefaultAlbumId, + ECamSettingItemDefaultAlbumName, + ECamSettingItemRecLocation, + ECamSettingItemStaticCommonRangeMax, // Range marker for static common settings + // ----------------------------------------------------- + + // ----------------------------------------------------- + // User Scene Settings items (shared .ini data) + ECamSettingItemUserSceneRangeMin, // Range marker for user scene settings + ECamSettingItemUserSceneBasedOnScene, // shared key is "UserSceneBasedOnScene" + ECamSettingItemUserSceneWhitebalance, // shared key is "UserSceneWhiteBalance" + ECamSettingItemUserSceneColourFilter, // shared key is "UserSceneColourFilter" + ECamSettingItemUserSceneExposure, // shared key is "UserSceneExposure" + ECamSettingItemUserSceneFlash, // shared key is "UserSceneFlash" + ECamSettingItemUserSceneBrightness, // shared key is "UserSceneBrightness" + ECamSettingItemUserSceneContrast, // shared key is "UserSceneContrast" + ECamSettingItemUserSceneImageSharpness, + ECamSettingItemUserSceneColourSaturation, + ECamSettingItemUserSceneLightSensitivity, // shared key is "UserSceneLightSensitivity" + ECamSettingItemUserSceneRangeMax, // Range marker for user scene settings + + ECamSettingItemUserSceneReset, // This needs to be out of the range as it is not stored + // but is more of a command identifier. + // ----------------------------------------------------- + + // ----------------------------------------------------- + // Capture setup photo Settings items + ECamSettingItemDynamicPhotoRangeMin, // Range marker for dynamic photo settings + ECamSettingItemDynamicPhotoScene, + ECamSettingItemDynamicPhotoWhiteBalance, + ECamSettingItemDynamicPhotoExposure, + ECamSettingItemDynamicPhotoColourFilter, + ECamSettingItemDynamicPhotoFlash, + ECamSettingItemDynamicPhotoBrightness, + ECamSettingItemDynamicPhotoContrast, + ECamSettingItemDynamicPhotoImageSharpness, + ECamSettingItemDynamicPhotoColourSaturation, + ECamSettingItemDynamicSelfTimer, + ECamSettingItemDynamicPhotoLightSensitivity, + ECamSettingItemViewfinderGrid, + ECamSettingItemHistogram, + ECamSettingItemDynamicPhotoFocusMode, + ECamSettingItemDynamicPhotoRangeMax, // Range marker for dynamic photo settings + // ----------------------------------------------------- + + // ----------------------------------------------------- + // Capture setup video Settings items + ECamSettingItemDynamicVideoRangeMin, // Range marker for dynamic video settings + ECamSettingItemDynamicVideoScene, + ECamSettingItemDynamicVideoWhiteBalance, + ECamSettingItemDynamicVideoExposure, + ECamSettingItemDynamicVideoColourFilter, + ECamSettingItemDynamicVideoFlash, + ECamSettingItemDynamicVideoBrightness, + ECamSettingItemDynamicVideoContrast, + ECamSettingItemDynamicVideoColourSaturation, + ECamSettingItemDynamicVideoLightSensitivity, + ECamSettingItemDynamicVideoRangeMax, // Range marker for dynamic video settings + // ----------------------------------------------------- + + // ----------------------------------------------------- + // Scene Settings items + ECamSettingItemSceneRangeMin, // Range marker for scene settings + ECamSettingItemSceneAEMode, + ECamSettingItemSceneAWBMode, + ECamSettingItemSceneAFMode, + ECamSettingItemSceneFlashMode, + ECamSettingItemSceneMaxRes, + ECamSettingItemSceneSharpness, + ECamSettingItemSceneContrast, + ECamSettingItemSceneISO, + ECamSettingItemSceneEV, + ECamSettingItemSceneFramerate, + ECamSettingItemSceneRangeMax, // Range marker for scene settings + // ----------------------------------------------------- + + // ----------------------------------------------------- + // Command like setting items that are not stored in any setting list. + // Used to identify setting item in setting list, + // but value of the setting will never be stored in settings model. + + ECamSettingItemSequenceMode, // Not stored setting (could be made one) + ECamSettingItemVideoModeSelect, // Used in photo mode, but not storable setting + ECamSettingItemImageModeSelect, // Used in video mode, but not storable setting + + ECamSettingItemFullToolbar, // Used to add all items to Toolbar + ECamSettingItemCustomiseToolbar,// Used to identify "Customise toolbar" AP item + ECamSettingItemGotoPhotos, // Used to identify "Go to photos" AP item + ECamSettingItemRestoreCameraSettings, + ECamSettingItemSwitchCamera, // Used to switch between 1st and 2nd camera + + // ----------------------------------------------------- + + ECamSettingItemLast // Marker - keep this as the last item + }; + +// Video quality settings. +// Values associated with the key "VideoQuality" for the shared.ini file +enum TCamVideoQualitySettings + { + ECamVideoQualityHigh, + ECamVideoQualityNormalHigh, + ECamVideoQualityNormal, + ECamVideoQualityNormalLow, + ECamVideoQualitySharing + }; + +/** +* Video quality description enumeration +*/ +enum TCamVideoQualityDescription + { + ECamVideoQualityDescHDHighest, + ECamVideoQualityDescWidescreenHighest, + ECamVideoQualityDescTVHigh, + ECamVideoQualityDescHigh, + ECamVideoQualityDescWidescreenHigh, + ECamVideoQualityDescWidescreenNorm, + ECamVideoQualityDescTVNorm, + ECamVideoQualityDescNorm, + ECamVideoQualityDescWebHigh, + ECamVideoQualityDescWebNorm, + ECamVideoQualityDescMMS, + ECamVideoQualityDescSharing, + ECamVideoQualityDescLast + }; + +// Photo quality settings +// Values associated with the key "PhotoQuality" for the shared.ini file +enum TCamImageQualitySetting + { + ECamImageQualityPrint12m, + ECamImageQualityPrintW9m, + ECamImageQualityPrint8m, + ECamImageQualityPrintW6m, + ECamImageQualityPrint5m, + ECamImageQualityPrint3m, // 3 MegaPixel print quality + ECamImageQualityPrint2m, // 2 MegaPixel print quality + ECamImageQualityPrint1_3m, // 1.3 MegaPixel print quality + ECamImageQualityEmail1m, + ECamImageQualityEmail08m, + ECamImageQualityEmail05m, + ECamImageQualityMMS, + ECamImageQualitySecondary, + ECamImageQualityLast + }; + +/** +* Photo quality description enumeration +*/ +enum TCamPhotoQualityDescription + { + ECamPhotoQualityDesc12mLarge, + ECamPhotoQualityDescW9mLarge, + ECamPhotoQualityDesc8mLarge, + ECamPhotoQualityDescW6mLarge, + ECamPhotoQualityDesc5mLarge, + ECamPhotoQualityDesc3mLarge, + ECamPhotoQualityDesc2mLarge, + ECamPhotoQualityDesc3mMed, + ECamPhotoQualityDesc2mMed, + ECamPhotoQualityDesc1mMed, + ECamPhotoQualityDesc1_3mSmall, + ECamPhotoQualityDesc1mSmall, + ECamPhotoQualityDesc0_8mMed, + ECamPhotoQualityDescMms, + ECamPhotoQualityDescLast + }; + +// Ids for different photo compression levels. +enum TCamPhotoQualityId + { + ECamPhotoQualitySuperFine = 99, + ECamPhotoQualityFine = 85, + ECamPhotoQualityStandard = 70, + ECamPhotoQualityBasic = 50, + ECamPhotoQualityMMS = 25 + }; + +// Burst capture on product requires less than 85% quality to avoid +// hardware performing hardware post-processing on the images during +// a burst capture (which slows the saving of the burst down) +#define KCamPhotoQualityBurst 84 + +// Ids for different photo size settings. +enum TCamPhotoSizeId + { + ECamPhotoSizeVGA, // (640 x 480) + ECamPhotoSizeSVGA, // (800 X 600 ) + ECamPhotoSizeXGA, // 0.8MegaPixel (1024 x 768 ) + ECamPhotoSize1MP, + ECamPhotoSize1_3MP, // 1.3 Megapixel (1280x960) + ECamPhotoSize2MP, // 2 MegaPixel (1600 x 1200) + ECamPhotoSize3MP, // 3 MegaPixel (2048 x 1536) + ECamPhotoSize5MP, // 5 MegaPixel + ECamPhotoSize8MP, // 8 MegaPixel + ECamPhotoSize12MP, // 12 MegaPixel + ECamPhotoSizeW6MP, // 6 MegaPixel 16:9 (3264 x 1832) + ECamPhotoSizeW9MP, // 9 MegaPixel 16:9 (4000 x 2248) + ECamPhotoSizeCIF, + ECamPhotoSizeQVGA, + ECamPhotoSizeWVGA, // @todo: only VF layout implemented (VF size 640x356) + ECamPhotoSizeLast + }; + +// Ids for video resolution +enum TCamVideoResolution + { + ECamVideoResolutionSubQCIF, // Small (128 x 96) + ECamVideoResolutionQCIF, // Medium (176 x 144) + ECamVideoResolutionCIF, // Large (352 x 288) + ECamVideoResolutionVGA, // VGA (640 x 480) + ECamVideoResolutionQVGA, // QVGA (320 x 240) + ECamVideoResolutionNHD, // NHD (640 x 352) + ECamVideoResolutionWVGA, // WVGA (864 x 480) + ECamVideoResolutionHD, // HD (1280 x 720) + ECamVideoResolutionLast + }; + +// Ids for video file type +enum TCamVideoFileType + { + ECamVideoMpeg4, + ECamVideoH263, + ECamVideoTypeLast + }; + +// Ids for different scenes +// Values associated with the key "UserSceneBasedOnScene" for +// the shared.ini file +enum TCamSceneId + { + ECamSceneAuto, + ECamSceneUser, + ECamScenePortrait, + ECamSceneMacro, + ECamSceneScenery, // landscape + ECamSceneSports, + ECamSceneNight, + ECamSceneNightPortrait, + + ECamSceneNormal, + ECamSceneNightScenery, + ECamSceneCandlelight, + ECamSceneLowLight + }; + + + +// Ids for location setting +enum TCamLocationId + { + ECamLocationOff, + ECamLocationOn + }; + +// Ids for different AE mode settings of a scene +enum TCamSceneAEMode + { + ECamSceneAEModeAuto = 0x000, + ECamSceneAEModeNight = 0x001, + ECamSceneAEModeBacklight = 0x002, + ECamSceneAEModeCenter = 0x004, + ECamSceneAEModeSports = 0x008 + }; + +// Ids for different AF mode settings of a scene +enum TCamSceneAFMode + { + ECamSceneAFModeMacro = 0x001, + ECamSceneAFPortrait = 0x002, + ECamSceneAFModeNormal = 0x004, + ECamSceneAFModeInfinity = 0x008, + ECamSceneAFModeHyperfocal = 0x010, + ECamSceneAFModeContinuous = 0x020 + }; + +// Ids for different timelapse settings +enum TCamTimeLapse + { + ECamTimeLapseOff, + ECamTimeLapseMin, + ECamTimeLapse5sec, + ECamTimeLapse10sec, + ECamTimeLapse30sec, + ECamTimeLapse1min, + ECamTimeLapse5min, + ECamTimeLapse10min, + ECamTimeLapse15min, + ECamTimeLapse30min, + ECamTimeLapseEnd // Not a selectable option, just reflects the no of options + }; + + +// Viewfinder setting value enumeration +enum TCamVfGridState + { + ECamViewfinderGridOn = 0, // These are used as indexes to tooltips. + ECamViewfinderGridOff = 1 // + }; + +// Advanced / novice user mode setting values +enum TCamUserMode + { + ECamUserModeNovice = 0, + ECamUserModeAdvanced = 1 + }; + +// Photo mode precapture view Active palette item locations +// +// NOTE: +// !!! Current ActivePalette2 implementation ignores the index !!! +// +// 0 mode +// 1 scene +// 2 flash +// 3 face tracking +// 4 self timer +// 5 go to photos +// 6 sequence mode +// 7 colour tone +// 8 vf grid +// 9 white balance +// 10 exposure compensation +// 11 sharpness +// 12 contrast +// 13 light sensitivity +enum TCamPhotoPreCaptureAPSlot + { + ECamAPSlotPhotoPreCaptureMode = 0, + ECamAPSlotPhotoPreCaptureScene, + ECamAPSlotPhotoPreCaptureFlash, + ECamAPSlotPhotoPreCaptureFacetracking, + ECamAPSlotPhotoPreCaptureSelfTimer, + ECamAPSlotPhotoPreCaptureGotoPhotos, + ECamAPSlotPhotoPreCaptureSequence, + ECamAPSlotPhotoPreCaptureColour, + ECamAPSlotPhotoPreCaptureVfGrid, + ECamAPSlotPhotoPreCaptureWB, + ECamAPSlotPhotoPreCaptureEV, + ECamAPSlotPhotoPreCaptureSharpness, + ECamAPSlotPhotoPreCaptureBrightness, + ECamAPSlotPhotoPreCaptureContrast, + ECamAPSlotPhotoPreCaptureISO + }; + +enum TCamVideoPreCaptureAPSlot + { + ECamAPSlotVideoPreCaptureMode = 0, + ECamAPSlotVideoPreCaptureScene, + ECamAPSlotVideoPreCaptureVideoLight, + ECamAPSlotVideoPreCaptureWB, + ECamAPSlotVideoPreCaptureColour, + ECamAPSlotVideoPreCaptureGotoPhotos + }; + + + +// + +// Moved from camappui.h + + + +enum TCamCameraMode + { + ECamControllerIdle, + ECamControllerImage, + ECamControllerVideo, + ECamControllerShutdown + }; + +enum TCamImageCaptureMode + { + ECamImageCaptureNone, + ECamImageCaptureSingle, + ECamImageCaptureBurst, + ECamImageCaptureTimeLapse + }; + +enum TCamCaptureOperation + { + ECamNoOperation, + ECamFocusing, + ECamFocused, + ECamFocusFailed, + ECamCapturing, + ECamPausing, + ECamPaused, + ECamResuming, + ECamCompleting, + + ECamStandby + }; + +enum TCamActiveCamera + { + ECamActiveCameraPrimary, + ECamActiveCameraSecondary, + ECamActiveCameraNone + }; + +enum TCamSupportFlag + { + ECamSupportUnknown, + ECamSupportOff, + ECamSupportOn + }; + +// Moved from CCamZoomModel +/** +* Zoom mode +*/ +enum TCamZoomMode + { + ECamZoomModeUndefined, + ECamZoomModeOptical, + ECamZoomModeDigital, + ECamZoomModeExtended + }; + + + +// --------------------------------------------------------------------------- +// Strings for enumeration values +#ifndef CAMERAAPP_PLUGIN_BUILD +#ifdef _DEBUG + +#include // For TUint16 + +// TCamCameraMode names for debug prints +const TUint16* const KCamModeNames[] = + { + (const TUint16* const)_S16("ECamControllerIdle"), + (const TUint16* const)_S16("ECamControllerImage"), + (const TUint16* const)_S16("ECamControllerVideo"), + (const TUint16* const)_S16("ECamControllerShutdown") + }; + +// TCamImageCaptureMode names for debug prints +const TUint16* const KCamImageModeNames[] = + { + (const TUint16* const)_S16("ECamImageCaptureNone"), + (const TUint16* const)_S16("ECamImageCaptureSingle"), + (const TUint16* const)_S16("ECamImageCaptureBurst"), + (const TUint16* const)_S16("ECamImageCaptureTimeLapse") + }; + +// TCamCaptureOperation names for debug prints +const TUint16* const KCamCaptureOperationNames[] = + { + (const TUint16* const)_S16("ECamNoOperation"), + (const TUint16* const)_S16("ECamFocusing"), + (const TUint16* const)_S16("ECamFocused"), + (const TUint16* const)_S16("ECamFocusFailed"), + (const TUint16* const)_S16("ECamCapturing"), + (const TUint16* const)_S16("ECamPausing"), + (const TUint16* const)_S16("ECamPaused"), + (const TUint16* const)_S16("ECamResuming"), + (const TUint16* const)_S16("ECamCompleting"), + (const TUint16* const)_S16("ECamStandby") + }; + +const TUint16* const KCamSettingItemNames[] = + { + (const TUint16* const)_S16("ItemDefaultMode"), + // ----------------------------------------------------- + (const TUint16* const)_S16("ItemStaticPhotoRangeMin"), + (const TUint16* const)_S16("ItemPhotoQuality"), + (const TUint16* const)_S16("ItemPhotoShowFocusPoint"), + (const TUint16* const)_S16("ItemPhotoStoreInAlbum"), + (const TUint16* const)_S16("ItemShowCapturedPhoto"), + (const TUint16* const)_S16("ItemPhotoCaptureTone"), + (const TUint16* const)_S16("ItemPhotoMediaStorage"), + (const TUint16* const)_S16("ItemPhotoNameBase"), + (const TUint16* const)_S16("ItemPhotoNameBaseType"), + (const TUint16* const)_S16("ItemPhotoNumber"), + (const TUint16* const)_S16("ItemPhotoDigitalZoom"), + (const TUint16* const)_S16("ItemImageFaceTracking"), + (const TUint16* const)_S16("ItemImageRotation"), + (const TUint16* const)_S16("ItemFlickerCancel"), + (const TUint16* const)_S16("ItemPhotoSize"), + (const TUint16* const)_S16("ItemPhotoCompression"), + (const TUint16* const)_S16("ItemImageToolbarItems"), + (const TUint16* const)_S16("ItemImageToolbarDefaultItems"), + (const TUint16* const)_S16("ItemStaticPhotoRangeMax"), + // ----------------------------------------------------- + (const TUint16* const)_S16("ItemStaticVideoRangeMin"), + (const TUint16* const)_S16("ItemVideoAudioRec"), + (const TUint16* const)_S16("ItemContinuousAutofocus"), + (const TUint16* const)_S16("ItemVideoStoreInAlbum"), + (const TUint16* const)_S16("ItemVideoShowCapturedVideo"), + (const TUint16* const)_S16("ItemVideoMediaStorage"), + (const TUint16* const)_S16("ItemVideoNameBase"), + (const TUint16* const)_S16("ItemVideoNameBaseType"), + (const TUint16* const)_S16("ItemVideoNumber"), + (const TUint16* const)_S16("ItemVideoQuality"), + (const TUint16* const)_S16("ItemVideoDigitalZoom"), + (const TUint16* const)_S16("ItemVideoStab"), + (const TUint16* const)_S16("ItemVideoOpZoomOff"), + (const TUint16* const)_S16("ItemVideoResolution"), + (const TUint16* const)_S16("ItemVideoClipLength"), + (const TUint16* const)_S16("ItemVideoFileType"), + (const TUint16* const)_S16("ItemStaticVideoRangeMax"), + // ----------------------------------------------------- + (const TUint16* const)_S16("ItemStaticCommonRangeMin"), + (const TUint16* const)_S16("ItemUserMode"), + (const TUint16* const)_S16("ItemDefaultAlbumId"), + (const TUint16* const)_S16("ItemDefaultAlbumName"), + (const TUint16* const)_S16("ItemRecLocation"), + (const TUint16* const)_S16("ItemStaticCommonRangeMax"), + // ----------------------------------------------------- + (const TUint16* const)_S16("ItemUserSceneRangeMin"), + (const TUint16* const)_S16("ItemUserSceneBasedOnScene"), + (const TUint16* const)_S16("ItemUserSceneWhitebalance"), + (const TUint16* const)_S16("ItemUserSceneColourFilter"), + (const TUint16* const)_S16("ItemUserSceneExposure"), + (const TUint16* const)_S16("ItemUserSceneFlash"), + (const TUint16* const)_S16("ItemUserSceneBrightness"), + (const TUint16* const)_S16("ItemUserSceneContrast"), + (const TUint16* const)_S16("ItemUserSceneImageSharpness"), + (const TUint16* const)_S16("ItemUserSceneColourSaturation"), + (const TUint16* const)_S16("ItemUserSceneLightSensitivity"), + (const TUint16* const)_S16("ItemUserSceneRangeMax"), + (const TUint16* const)_S16("ItemUserSceneReset"), + // ----------------------------------------------------- + (const TUint16* const)_S16("ItemDynamicPhotoRangeMin"), + (const TUint16* const)_S16("ItemDynamicPhotoScene"), + (const TUint16* const)_S16("ItemDynamicPhotoWhiteBalance"), + (const TUint16* const)_S16("ItemDynamicPhotoExposure"), + (const TUint16* const)_S16("ItemDynamicPhotoColourFilter"), + (const TUint16* const)_S16("ItemDynamicPhotoFlash"), + (const TUint16* const)_S16("ItemDynamicPhotoBrightness"), + (const TUint16* const)_S16("ItemDynamicPhotoContrast"), + (const TUint16* const)_S16("ItemDynamicPhotoImageSharpness"), + (const TUint16* const)_S16("ItemDynamicPhotoColourSaturation"), + (const TUint16* const)_S16("ItemDynamicSelfTimer"), + (const TUint16* const)_S16("ItemDynamicPhotoLightSensitivity"), + (const TUint16* const)_S16("ItemViewfinderGrid"), + (const TUint16* const)_S16("ItemHistogram"), + (const TUint16* const)_S16("ItemDynamicPhotoFocusMode"), + (const TUint16* const)_S16("ItemDynamicPhotoRangeMax"), + // ----------------------------------------------------- + (const TUint16* const)_S16("ItemDynamicVideoRangeMin"), + (const TUint16* const)_S16("ItemDynamicVideoScene"), + (const TUint16* const)_S16("ItemDynamicVideoWhiteBalance"), + (const TUint16* const)_S16("ItemDynamicVideoExposure"), + (const TUint16* const)_S16("ItemDynamicVideoColourFilter"), + (const TUint16* const)_S16("ItemDynamicVideoFlash"), + (const TUint16* const)_S16("ItemDynamicVideoBrightness"), + (const TUint16* const)_S16("ItemDynamicVideoContrast"), + (const TUint16* const)_S16("ItemDynamicVideoColourSaturation"), + (const TUint16* const)_S16("ItemDynamicVideoLightSensitivity"), + (const TUint16* const)_S16("ItemDynamicVideoRangeMax"), + // ----------------------------------------------------- + (const TUint16* const)_S16("ItemSceneRangeMin"), + (const TUint16* const)_S16("ItemSceneAEMode"), + (const TUint16* const)_S16("ItemSceneAWBMode"), + (const TUint16* const)_S16("ItemSceneAFMode"), + (const TUint16* const)_S16("ItemSceneFlashMode"), + (const TUint16* const)_S16("ItemSceneMaxRes"), + (const TUint16* const)_S16("ItemSceneSharpness"), + (const TUint16* const)_S16("ItemSceneContrast"), + (const TUint16* const)_S16("ItemSceneISO"), + (const TUint16* const)_S16("ItemSceneEV"), + (const TUint16* const)_S16("ItemSceneFrameRate"), + (const TUint16* const)_S16("ItemSceneRangeMax"), + // ----------------------------------------------------- + (const TUint16* const)_S16("ItemSequenceMode"), + (const TUint16* const)_S16("ItemVideoModeSelect"), + (const TUint16* const)_S16("ItemImageModeSelect"), + (const TUint16* const)_S16("ItemSwitchCamera"), + (const TUint16* const)_S16("ItemFullToolbar"), + (const TUint16* const)_S16("ItemCustomiseToolbar"), + (const TUint16* const)_S16("ItemGotoPhotos"), + (const TUint16* const)_S16("ItemRestoreCameraSettings") + // ----------------------------------------------------- + }; +// Verifying there is a description for all the setting ids. +// The text array is indexed with the id value, so need to have these for all! +__ASSERT_COMPILE( (sizeof(KCamSettingItemNames) / sizeof(TUint16*)) == ECamSettingItemLast ); + + +const TUint16* const KCamSceneNames[] = + { + (const TUint16* const )_S16("ECamSceneAuto (still)"), + (const TUint16* const )_S16("ECamSceneUser (still)"), + (const TUint16* const )_S16("ECamScenePortrait (still)"), + (const TUint16* const )_S16("ECamSceneMacro (still)"), + (const TUint16* const )_S16("ECamSceneScenery (still)"), + (const TUint16* const )_S16("ECamSceneSports (still)"), + (const TUint16* const )_S16("ECamSceneNight (still)"), + (const TUint16* const )_S16("ECamSceneNightPortrait (still)"), + // Video scenes + (const TUint16* const )_S16("ECamSceneNormal (video)"), + (const TUint16* const )_S16("ECamSceneNightScenery (video)"), + (const TUint16* const )_S16("ECamSceneCandlelight (video)"), + (const TUint16* const )_S16("ECamSceneLowLight (video)") + }; + + +#endif // _DEBUG +#endif //CAMERAAPP_PLUGIN_BUILD +// --------------------------------------------------------------------------- + + +// + +#endif // CAMSETTINGSINTERNAL_HRH diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamStaticSettingsModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamStaticSettingsModel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,378 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Manages all static settings data. +* +*/ + + + +#ifndef CAMSTATICSETTINGSMODEL_H +#define CAMSTATICSETTINGSMODEL_H + +// INCLUDES + // Internal build flags, keep first. + +#include +#include +#include "Cam.hrh" +#include "mcamsettingsmodel.h" +#include "MCamStaticSettings.h" +#include "CamSettingsInternal.hrh" + +// FORWARD DECLARATIONS + +class CCamConfiguration; +class CCameraUiConfigManager; + +/** +* Manages all static settings data. +* @since 2.8 +*/ +class CCamStaticSettingsModel : public CBase, + public MCamStaticSettings + { + // ========================================================================= + public: // Constructors and destructor + + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aConfiguration + * engine changes. + */ + static CCamStaticSettingsModel* NewLC( CCamConfiguration& aConfiguration ); + + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aConfiguration + * engine changes. + */ + static CCamStaticSettingsModel* NewL( CCamConfiguration& aConfiguration ); + + /** + * Destructor. + */ + ~CCamStaticSettingsModel(); + + public: // New Fuctions + + /** + * Returns the current integer value for the specified setting + * @return the current integer setting value + * @param aSettingItem specifies which setting item that want the value of. + * @since 2.8 + */ + TInt IntegerSettingValue( TInt aSettingItem ) const; + + /** + * Sets a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want to set the value of. + * @param aSettingValue the new integer value for the specified setting item. + * @since 2.8 + */ + void SetIntegerSettingValueL( TInt aSettingItem, TInt aSettingValue ); + + /** + * Sets a new text value for the specified setting + * @param aSettingItem specifies which setting item that want to set the text value of. + * @param aSettingValue the new text value for the specified setting item. + * @since 2.8 + */ + void SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ); + + /** + * Returns the current text value for the specified setting + * @return the current text setting value + * @param aSettingItem specifies which setting item that want the text value of. + * @since 2.8 + */ + TPtrC TextSettingValue( TInt aSettingItem ) const; + +#ifndef CAMERAAPP_PLUGIN_BUILD + /** + * Loads the static settings from shared data. Required to update + * the settings whenever get foreground event, in case of external + * changes to the settings. + * @since 2.8 + * @param aIsEmbedded Specifies whether the application is embedded + * or not. + */ + void LoadStaticSettingsL( TBool aIsEmbedded ); + +#endif //CAMERAAPP_PLUGIN_BUILD + + /** + * Reads the specified key from the Central Repository, returns the + * content in HBufC + * + * @since 5.0 + * @param aCenRepKeyId The Central Repository key id to read + */ + HBufC* ReadCenRepStringL( TInt aCenRepKeyId ); + /* + * Reset repository file + * @since3.0 + */ + void ResetRepository(); + + /** + * Loads the image/common static settings from shared data. Required to update + * the settings whenever get foreground event, in case of external + * changes to the settings. + */ + void LoadPhotoStaticSettingsL( const TBool aResetFromPlugin ); + + /** + * Loads the video/common static settings from shared data. Required to update + * the settings whenever get foreground event, in case of external + * changes to the settings. + */ + void LoadVideoStaticSettingsL( const TBool aResetFromPlugin ); + + // New methods + public: + + /** + * Reads the specified setting from the Central Repository, and + * stores the new setting object in the array. + * @since 3.0 + * @param TCamSettingItemIds the settings range for static settings from CamSettingsInternals.hrh + * @param TCamSettingItemIds the settings range for static settings from CamSettingsInternals.hrh + * @param aArray The array to add the setting to + */ + void ReadFromCenRepL( const TInt aMinRange, + const TInt aMaxRange, + RPointerArray & aArray ); + + /** + * Reads the specified setting from the Central Repository, and + * stores the new setting object in the array. + * @since 3.0 + * @param aUiId The Settings Model ID to be loaded to the array + * @param aCenRepID The Central Repository setting ID to read + * @param aArray The array to add the setting to + */ + void ReadCenRepIntL( TCamSettingItemIds aUiId, + TInt aCenRepID, + RPointerArray & aArray ); + + + /** + * Saves the setting item from the array to the Central Repository. + * May leave with KErrNotFound if the item id 'aItemId' is not found + * in the array 'aArray'. + * @since 3.0 + * @param aItemId The Settings Model ID to be saved + * @param aCenRepID The Central Repository setting ID to saved to + * @param aArray The array to read the setting from + */ + void SaveCenRepItemL( TCamSettingItemIds aItemId, + TInt aCenRepId, + const RPointerArray& aArray ); + + /** + * Saves one static setting to Central Repository. + * @param aSettingId Id of the setting to be saved. + * @since Camera 4.0 + */ + void SaveStaticSettingL( TCamSettingItemIds aSettingId ); + + /** + * Stores the primary camera settings when changing to secondary camera + * that they can be reapplied when changing back + * @since 2.8 + */ + void StorePrimaryCameraSettingsL(); + + /** + * Restores the primary camera settings + * @since 2.8 + */ + void RestorePrimaryCameraSettingsL(); + + /* + * Resets a particular setting item value + */ + void ResetSettingItem( const TInt aSettingItem ); + + /** + * Get the associated Central Repository Key for given setting item. + * @param aSettingId Id of the setting for which the key is requested. + * @param aEmbedded Is request made for embedded mode setting or not. + * @since Camera 4.0 + */ + static TUint32 MapSettingItem2CRKey( TCamSettingItemIds aSettingId, + TBool aEmbedded ); + + /** + * Get the associated settings list for given setting item. + * @param aSettingId Id of the setting for which the list is requested. + * @since Camera 4.0 + */ + RPointerArray* + MapSettingItem2SettingsList( TCamSettingItemIds aSettingId ); + + /** + * Removes any previously loaded static settings. + * @since 2.8 + */ + void UnloadStaticSettings(); + + /** + * Loads a list of dynamic settings from the resource file + * @param aResourceId the id of the resource that contains the + * settings items id's and their default values. + * @param aSettingsList the list to populate with dynamic settings + * from the resource file. + * @since 2.8 + */ + void LoadSettingsFromResourceL( TInt aResourceId, + RPointerArray& aSettingsList ); + + /** + * Returns reference to CCamConfiguration object describing + * the device's camera configuration. + * @return configuration + */ + CCamConfiguration& Configuration() const; + + /* + * Handle to Camera Ui Config Manager + */ + CCameraUiConfigManager* UiConfigManagerPtr(); + + private: + + // + // CCamStaticSettingsModel::LoadCommonStaticSettingsL + // + void LoadCommonStaticSettingsL( const TBool aResetFromPlugin ); + + /* + * Searches for a setting item in the list of available list of items + */ + TInt SearchInSettingsListFor( + const RPointerArray& aSettingsList, + TInt aSettingItem ) const; + + /** + * Saves the static settings to shared data. + * @since 2.8 + */ + void SaveSettingsL(); + + /* + * Load embedded camera specific settings + */ + void LoadEmbeddedSettingsL(); + + // Constructors + private: + + /** + * C++ constructor. + * @since 2.8 + * @param aConfiguration + */ + CCamStaticSettingsModel( CCamConfiguration& aConfiguration ); + + /** + * C++ 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + /** + * Loads photo base name + * @since 2.8 + */ + void LoadPhotoBaseNameL(); + + /** + * Loads video base name + * @since 2.8 + */ + void LoadVideoBaseNameL(); + + /** + * Saves photo base name + * @since 2.8 + */ + void SavePhotoBaseNameL(); + + /** + * Saves video base name + * @since 2.8 + */ + void SaveVideoBaseNameL(); + + /** + * Saves name of the DefaultAlbum + */ + void SaveDefaultAlbumNameL(); + + /** + * Loads name of the DefaultAlbum + */ + void LoadDefaultAlbumNameL(); + + private: // data + + /** + * Stores information for front/back camera settings + * @since 2.8 + */ + class TCamCameraSettings + { + public: + TInt iPhotoQuality; + TInt iVideoQuality; + }; + + // Commom static settings. + RPointerArray iStaticCommonIntSettings; + + // List of setting item id/value pairs for static photo settings. + RPointerArray iStaticPhotoIntSettings; + + // List of setting item id/value pairs for static video settings. + RPointerArray iStaticVideoIntSettings; + + // Video file base name. + TBuf iVideoBaseName; + + // Photo file base name. + TBuf iPhotoBaseName; + + TBuf iDefaultAlbumName; + + // Specifies whether this application is embedded or not. + TBool iEmbedded; + + // Handle to actual setting storage object + CRepository* iRepository; + + // The cached primary camera settings + TCamCameraSettings iPrimaryCameraSettings; + // The cached secondary camera settings + TCamCameraSettings iSecondaryCameraSettings; + CCamConfiguration& iConfiguration; + CCameraUiConfigManager* iConfigManager; + }; + +#endif // CAMSETTINGSMODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamUtility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamUtility.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,452 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility functions for the Camera Application* +*/ + + + + +#ifndef CAMUTILITY_H +#define CAMUTILITY_H + +// INCLUDES +#include +#include + +#include +#include "CamPSI.h" // Product Specific Information +#include "CamSettings.hrh" // for TCamMediaStorage +#include "CamSettingsInternal.hrh" +#include "camlogging.h" +#include "camconfigurationtypes.h" + +#ifndef CAMERAAPP_PLUGIN_BUILD +#include "CamResourceIDs.h" +#endif //CAMERAAPP_PLUGIN_BUILD + +#include + +// CONSTANTS +/* estimated average image sizes */ +const TInt KCamImageSize3MP = 750000; +const TInt KCamImageSize2MP = 475000; +const TInt KCamImageSize1_3MP = 325000; +const TInt KCamImageSize1MP = 90000; +const TInt KCamImageSizeVGA = 56500; + +const TInt KCamLocationTrailStopped = 0; +const TInt KCamLocationTrailNoValidData = 1; +const TInt KCamLocationTrailSearchingDevice = 2; +const TInt KCamLocationTrailGPSDataAvail = 3; + +// A multiple of the image size is kept as a buffer to ensure that a +// complex last image can be captured +const TInt KCamImageDataBufferMultiplier = 1; + +// Name of the server that takes foreground when charger is inserted +_LIT( KAknCapServer, "akncapserver" ); +// Location data notification windows use this server. +_LIT( KAknNotifyServer, "aknnfysrv" ); + +// Phonebook server +_LIT( KPbkServer, "Pbk2ServerApp" ); + +// DATA TYPES +/** +* Memory card status, as returned by MemoryCardStatus() +*/ +enum TCamMemoryCardStatus + { + ECamMemoryCardNotInserted, + ECamMemoryCardLocked, + ECamMemoryCardInserted + }; + +#ifndef CAMERAAPP_PLUGIN_BUILD +#define ROID(resource_id) (CamUtility::ResourceOrientationID(resource_id)) + +// Capture tone resources +_LIT( KCamCaptureTone1, "z:\\system\\sounds\\digital\\cameraappCapture1.wav" ); +_LIT( KCamCaptureTone2, "z:\\system\\sounds\\digital\\cameraappCapture2.wav" ); +_LIT( KCamCaptureTone3, "z:\\system\\sounds\\digital\\cameraappCapture3.wav" ); +_LIT( KCamCaptureTone4, "z:\\system\\sounds\\digital\\cameraappCapture4.wav" ); +_LIT( KCamBurstCaptureTone1, "z:\\system\\sounds\\digital\\cameraappCaptureShort1.wav" ); +_LIT( KCamBurstCaptureTone2, "z:\\system\\sounds\\digital\\cameraappCaptureShort2.wav" ); +_LIT( KCamBurstCaptureTone3, "z:\\system\\sounds\\digital\\cameraappCaptureShort3.wav" ); +_LIT( KCamBurstCaptureTone4, "z:\\system\\sounds\\digital\\cameraappCaptureShort4.wav" ); +_LIT( KCamVideoStartTone, "z:\\system\\sounds\\digital\\cameraappStart.wav" ); +_LIT( KCamVideoPauseTone, "z:\\system\\sounds\\digital\\cameraappStop.wav" ); +_LIT( KCamVideoStopTone, "z:\\system\\sounds\\digital\\cameraappStop.wav" ); +_LIT( KCamAutoFocusComplete, "z:\\system\\sounds\\digital\\cameraappFocusSucc.wav" ); + +#endif //CAMERAAPP_PLUGIN_BUILD + +// CLASS DECLARATION + +/** +* Application wide utility functions +* +* @since 2.8 +*/ + +class CamUtility + { + public : // New functions + + /** + * Get free space in selected memory + * @since 2.8 + * @param aMemory memory card or internal memory + * @param aCriticalLevel The critical threshold on the specified drive + * @return free space in selected memory (in bytes) + */ + static TInt64 MemoryFree( + DriveInfo::TDefaultDrives aMemory, + TInt aCriticalLevel = 0 ); + + /** + * Returns the memory card status. + * @since 2.8 + * @return the status. + */ + static TCamMemoryCardStatus MemoryCardStatus(); + + /** + * Get drive number for memory card. + * @since 2.8 + * @return drive number for memory card + */ + static TInt MemoryCardDrive(); + + /** + * Get drive number for phone memory. + * @since 2.8 + * @return drive number for phone memory + */ + static TInt PhoneMemoryDrive(); + + + /** + * Get drive number for mass storage memory. + * @since 3.2 + * @return drive number for mass storage memory + */ + static TInt MassMemoryDrive(); + + /** + * Get drive type for a given drive number. + * @since 3.2 + * @return DriveInfo::TDefaultDrives type for the drive number + */ + static TInt GetDriveTypeFromDriveNumber( TInt aDrive ); + + /** + * Map camera storage location to memory selection dialog storage location + * @param aStorage The camera storage location to map + * @since 3.0 + * @return the memory selection dialog's mapped memory storage location value + */ + static TInt MapToSettingsListMemory( TInt aStorage ); + + /** + * Map memory selection dialog storage location to camera storage location + * @param aStorage The settings list memory location to map + * @since 3.0 + * @return the camera storage location mapped from the memory selection dialog's location value + */ + static TInt MapFromSettingsListMemory( TInt aStorage ); + + /** + * Suggest a new unique filename + * @since 2.8 + * @param aFilePath (in/out) drive and path for file name + * (must include trailing '\') + * On return contains the full path and + * generated file name with extension + * @param aFilename (in/out) filename (without path or extension) + * @param aSuggestedNumeral number initially appended to the name to ensure + * uniqueness, the actual number used may be higher + * @param aExt file extension (".jpg" or ".3gp") + */ + static void GetUniqueNameL( TDes& aFilePath, + TDes& aFilename, + TInt aSuggestedNumeral, + const TDesC& aExt ); + + /** + * Generate a image file name based on base name and counter. + * @since 2.8 + * @param aCounter image counter [1...] + * @param aBaseName name base + * @param aFilename descriptor to hold the generated file name. + * Does not include path or extension. Example: + * "Image(001)" + */ + static void FormatFileName( TUint aCounter, + const TDesC& aBaseName, + TDes& aFilename ); + + /** + * Checks if given filename contains illegal characters or + * is otherwise illegal. + * @since 2.8 + * @param aFilename descriptor that holds file name to check. + */ + static TBool CheckFileNameValidityL( const TDesC& aFilename ); + + /** + * Generate a file name based on date and counter. + * @since 2.8 + * @param aFilename descriptor to hold the generated file name. + * Does not include path or extension. Example: + * "240305(001)" + */ + static void FormatDateFileNameL( TDes& aFilename ); + + /** + * Format current date into given descriptor in a format + * suitable for file names. + * @since 2.8 + * @param aBuffer the buffer to receive the formatted date. + */ + static void GetCurrentDateForNameBaseL( TDes& aBuffer ); + + + /** + * Return the path and filename of the application MBM file + * @since 2.8 + * @param aResName Populated with path and filename of MBM file + */ + static void ResourceFileName( TDes& aResName ); + + /** + * Return Product Specific Information in the form of a TInt + * @since 2.8 + * @param aKey The enumeration key identifying the data required + * @param aValue A reference to TInt that will hold the data + * @return KErrNone if successful, KErrNotSupported if no valid data. + */ + static TInt GetPsiInt( TCamPsiKey aKey, TInt& aValue ); + + /** + * Return Product Specific Information in the form of a TInt array + * @since 3.0 + * @param aKey The enumeration key identifying the data required + * @param aValue A reference to a TInt array that will hold the data + * @return KErrNone if successful, KErrNotSupported if no valid data. + */ + static TInt GetPsiIntArrayL( TCamPsiKey aKey, RArray& aValue ); + + /** + * Return Product Specific Information in the form of a TInt + * @since 2.8 + * @param aKey The enumeration key identifying the data required + * @param aValue A reference to TInt that will hold the data + * @return KErrNone if successful, KErrNotSupported if no valid data. + */ + static TInt GetCommonPsiInt( TCamPsiKey aKey, TInt& aValue ); + + /** + * Return Product Specific Information in the form of a TAny* + * @since 2.8 + * @param aKey The enumeration key identifying the data required + * @param aValue A pointer to where the data should be copied to. + * note, data is Mem::Copied, so sufficient space must be + * available in the buffer passed in to "aValue" + * @return KErrNone if successful, KErrNotSupported if no valid data. + */ + static TInt GetPsiAnyL( TCamPsiKey aKey, TAny* aValue ); + + /** + * Return maximum size for an MMS message + * @since 2.8 + * @return The maximum size + */ + static TInt MaxMmsSizeInBytesL(); + + /** + * Compares two strings. + * @since 2.8 + * @param aFirst The first string. + * @param aSecond The second string + * @return ETrue if the strings are equivalent. + */ + static TBool CompareIgnoreCase( const TDesC& aFirst, + const TDesC& aSecond ); + + /** + * Deletes a video clip. + * @since 2.8 + * @param aFilename The filename of the video clip + */ + static void DeleteVideoL( const TDesC& aFilename ); + + /** + * Deletes an image. + * @since 2.8 + * @param aFilename The filename of the image + */ + static void DeleteStillImageL( const TDesC& aFilename ); + + /** + * Returns the thumbnail path for an image. + * @since 2.8 + * @param aImagePath The path of the image + * @param aThumbnailPath The path of the thumbnail image + */ + static void GetThumbnailPath( const TDesC& aImagePath, + TDes& aThumbnailPath ); + + /** + * Renames a still image. + * @since 2.8 + * @param aOldPath The old path of the image + * @param aNewName The new name of the image + * @param aNewPath Receives the new path of the image. + */ + static void RenameStillImageL( const TDesC& aOldPath, + const TDesC& aNewName, + TDes& aNewPath ); + + /** + * Takes a window group ID and a group name. Checks to see if the + * window group referred to by the ID has a name containing the + * window group name string. + * @since 3.0 + * @param aWindowId ID of the window group + * @param aWindowGroupName Name to check for + * @return ETrue if ID matches name + */ + static TBool IdMatchesName( TInt aWindowId, const TDesC& aWindowGroupName ); + + /** + * Returns the correct resource ID for the current orientation + * @since 3.0 + * @param aDefaultResourceID The resource ID for the default orientation + * @return The new resource ID + */ + + static TInt ResourceOrientationID( TInt aDefaultResourceID ); + + /** + * Map light sensitivity id to ISO rating value. + * + */ + static TInt MapLightSensitivity2IsoValueL( TCamLightSensitivityId aLightSensitivityId, RArray& aSupportedValues ); + + /** + * Map UI sharpness setting id to Camera sharpness setting value. + * + */ + static TInt MapSharpnessId2SharpnessValueL( TCamImageSharpnessId aSharpnessId ); + + /** + * Obtain resource id for specific video reoslution + * (for primary camera) + * @since 3.0 + * @param aResolution video reoslution + * @return resource id + */ + static TInt MapVideoQualityToViewFinderRes( TCamVideoResolution aResolution ); + + /** + * Determines if the battery power is good + * @since 3.0 + * @return ETrue if the battery is OK, and EFalse if it is + * low or almost empty + */ + static TBool IsBatteryPowerOK(); + + /** + * Determines if the battery power is empty + * @since 3.0 + * @return ETrue if the battery is Empty + */ + static TBool IsBatteryPowerEmpty(); + + /** + * Determines if the battery is being charged + * @since 3.0 + * @return ETrue if the battery is charging + */ + static TBool IsBatteryCharging(); + + /** + * Determines if LocationTrail is started + * @return ETrue if LocationTrail is started + */ + static TBool IsLocationAware(); + + /** + * Replaces original bitmap by bitmap with alpha channel. + * @since S60 5.0 + * @param aBmp, bitmap + * @param aMask, mask + * @param aColor, Color used instead of white. + */ + static void SetAlphaL( CFbsBitmap*& aBmp, CFbsBitmap*& aMask, + TRgb aColor = KRgbWhite ); + + /** + * Determines if USB is active + * @return ETrue if USB is active + */ + static TBool IsUsbActive(); + + /** + * Determines if the device has a NHD display. + * This method is meant to be used with the layouts only + * @return ETrue if NHD (640 x 360) display + */ + static TBool IsNhdDevice(); + + /** + * Determines device qwerty-mode state. + * This method is meant to be used with secondary camera. + * @return ETrue if qwerty keyboard is open + */ + static TBool IsQwertyOpen(); + + /** + * Get layout rectangle for given resolution in given mode. + * @param aMode ECamControllerVideo or ECamControllerImage. + * @param aResolution Resolution enumeration from + * CCamAppController::GetCurrentVideoResolution or + * CCamAppController::GetCurrentImageResolution depending + * on the mode. + * + */ + static TRect ViewfinderLayout( TCamCameraMode aMode, + TInt aResolution ); + + private: + + /** + * Helper method for ViewfinderLayout. + */ + static TAknWindowLineLayout ViewfinderLayoutTouch( TCamCameraMode aMode, + TInt aResolution ); + + /** + * Helper method for ViewfinderLayout. + */ + static TAknWindowLineLayout ViewfinderLayoutNonTouch( TCamCameraMode aMode, + TInt aResolution ); + + + }; + +#endif // CAMUTILITY_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamVideoQualityLevel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamVideoQualityLevel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container class for video quality data* +*/ + + + +#ifndef CAMVIDEOQUALITYLEVEL_H +#define CAMVIDEOQUALITYLEVEL_H + +// INCLUDES +#include +#include "camconfigurationconstants.h" + + +// CLASS DECLARATION + +/** +* Container class to hold video quality settings +* Read in from resource file +* +* @since 2.8 +*/ +class CCamVideoQualityLevel : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aReader resource reader for video quality level resources + * @return pointer to instances of CCamVideoQualityLevel + */ + static CCamVideoQualityLevel* NewL( TResourceReader& aReader ); + + /** + * Two-phased constructor. + * @param aReader resource reader for video quality level resources + * @param aVariantFlags The flags to specify operator variants + * @return pointer to instances of CCamVideoQualityLevel + */ + static CCamVideoQualityLevel* NewL( TVideoQualitySettings& aSettings ); + + /** + * Destructor. + */ + virtual ~CCamVideoQualityLevel(); + + public: // New functions + + /** + * Return video resolution associated with this quality level + * @since 2.8 + * @return Video resolution + */ + TVideoResolution VideoResolution(); + + /** + * Return video frame rate associated with this quality level + * @since 2.8 + * @return Video frame rate + */ + TReal FrameRate(); + + /** + * Return video bitrate associated with this quality level + * @since 2.8 + * @return Video bitrate + */ + TInt VideoBitRate(); + + /** + * Return audio bitrate associated with this quality level identifier + * @since 2.8 + * @return audio bitrate + */ + TInt AudioBitRate(); + + /** + * Return mime type required associated with this video quality level + * @since 2.8 + * @return descriptor containing mime type + */ + TPtrC8 VideoMimeType(); + + /** + * Return preferred supplier value associated with this video quality level + * @since 2.8 + * @return descriptor containing preferred supplier + */ + TPtrC PreferredSupplier(); + + /** + * Return video codec associated with this video quality level + * @since 2.8 + * @return descriptor containing codec + */ + TPtrC8 VideoFileType(); + + /** + * Return audio codec associated with this video quality level + * @since 2.8 + * @return descriptor containing audio codec + */ + TPtrC8 AudioType(); + + /** + * Return file type identier associated with this video quality level + * either Mpeg4 or 3GP + * @since 2.8 + * @return flags + */ + TInt VideoType(); + + /** + * Return file length associated with this video quality level + * either max or short + * @since 2.8 + * @return flags + */ + TInt VideoLength(); + + /** + * Return video quality level + * @since 3.0 + * @return quality level value + */ + TInt VideoQuality(); + + private: + + /** + * C++ default constructor. + */ + CCamVideoQualityLevel(); + + /** + * By default Symbian 2nd phase constructor is private. + * @param aReader resource reader for video quality level resources + * @param aVariantFlags The flags to specify operator variants + */ + void ConstructL( TVideoQualitySettings& aSettings ); + + /** + * By default Symbian 2nd phase constructor is private. + * @param aReader resource reader for video quality level resources + * @param aVariantFlags The flags to specify operator variants + */ + void ConstructFromResourceL( TResourceReader& aReader ); + + private: + /** + * Reads an LTEXT element from resources and returns + * it as HBufC8. + * @since 2.8 + * @param aReader Resource reader to read descriptor from + * @return HBufC8 containing string read from resource + */ + HBufC8* ReadHBufC8L( TResourceReader& aReader ) const; + + private: // Data + // Identifer + TInt iQualityLevel; + // Video reoslution + TVideoResolution iVideoResolution; + // Video Frame rate + TReal iVideoFrameRate; + // Video bit rate + TInt iVideoBitRate; + // Audio bit rate + TInt iAudioBitRate; + // Video mime type + HBufC8* iVideoMimeType; + // Preferred supplier + HBufC* iPreferredSupplier; + // Video file type + HBufC8* iVideoCodec; + // Audio codec + HBufC8* iAudioCodec; + // video type identifier (MPeg4 or 3GP) + TInt iVideoFileType; + // video length (max or short) + TInt iVideoLength; + }; + +#endif // CAMVIDEOQUALITYLEVEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CamWaitDialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CamWaitDialog.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wait dialog that doesn't consume key events* +*/ + + +#ifndef CAMWAITDIALOG_H +#define CAMWAITDIALOG_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + + +/** +* Wait Dialog without key event handling +* @since 2.8 +*/ +class CCamWaitDialog : public CAknWaitDialog + { + // ======================================================= + public: // Constructors and destructor + + /** + * A class constructor + * + * @param aSelfPtr Pointer to itself. The pointer needs to be + * valid when the dialog is dismissed and must not + * be on the stack. + * @param aVisibilityDelayOff If set ETrue the dialog will be visible + * immediality. Use only when the length of + * the process is ALWAYS over 1.5 seconds. + */ + CCamWaitDialog( CEikDialog** aSelfPtr, TBool aVisibilityDelayOff ); + + /** + * Destructor + */ + ~CCamWaitDialog(); + + public: // From base class + + /** + * From CAknWaitDialog + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + public: // New methods + + /** + * Set keyevents, which the component should not consume. + * @since 2.8 + * @param aNonConsumedKeys + */ + void SetNonConsumedKeysL( const RArray& aNonConsumedKeys ); + + // ======================================================= + private: // Data + + RArray iNonConsumedKeys; + + // ======================================================= + }; +#endif +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/CameraappPrivateCRKeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/CameraappPrivateCRKeys.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Cameraapp CenRep keys* +*/ + + +#ifndef CAMERAAPPPRIVATECRKEYS_H +#define CAMERAAPPPRIVATECRKEYS_H + + +// ========================================================= +// Cameraapp Settings +const TUid KCRUidCameraappSettings = {0x101FFA86}; + +const TUint32 KCamCrDefaultCaptureMode = 0x00; +const TUint32 KCamCrPhotoQuality = 0x01; +const TUint32 KCamCrPhotoSize = 0x02; +const TUint32 KCamCrFocusPoint = 0x03; +const TUint32 KCamCrPhotoStoreAlbum = 0x04; +const TUint32 KCamCrPhotoShowCaptured = 0x05; +const TUint32 KCamCrPhotoMemInUse = 0x06; +const TUint32 KCamCrPhotoNameBase = 0x07; +const TUint32 KCamCrPhotoNameType = 0x08; +const TUint32 KCamCrPhotoImgCount = 0x09; +const TUint32 KCamCrPhotoExtDigZoom = 0x0A; +const TUint32 KCamCrPhotoCaptureTone = 0x0B; +const TUint32 KCamCrPhotoFaceTracking = 0x0C; + +const TUint32 KCamCrVideoAudRec = 0x10; +const TUint32 KCamCrVideoRes = 0x11; +const TUint32 KCamCrVideoClipLen = 0x12; +const TUint32 KCamCrVideoFileType = 0x13; +const TUint32 KCamCrVideoStoreAlbum = 0x14; +const TUint32 KCamCrVideoShowCaptured = 0x15; +const TUint32 KCamCrVideoMemInUse = 0x16; +const TUint32 KCamCrVideoNameBase = 0x17; +const TUint32 KCamCrVideoQuality = 0x18; +const TUint32 KCamCrVideoNameType = 0x19; +const TUint32 KCamCrVideoCount = 0x1A; +const TUint32 KCamCrVideoExtDigZoom = 0x1B; +const TUint32 KCamCrEmbeddedVideoAudRec = 0x1D; +const TUint32 KCamCrContinuousAutofocus = 0x1E; + +const TUint32 KCamCrUserSceneBaseScene = 0x20; +const TUint32 KCamCrUserSceneWhiteBalance = 0x21; +const TUint32 KCamCrUserSceneColourFilter = 0x22; +const TUint32 KCamCrUserSceneExposure = 0x23; +const TUint32 KCamCrUserSceneFlash = 0x24; +const TUint32 KCamCrUserSceneBrightness = 0x25; +const TUint32 KCamCrUserSceneContrast = 0x26; +const TUint32 KCamCrUserSceneImageSharpness = 0x27; +const TUint32 KCamCrUserSceneColourSaturation = 0x28; +const TUint32 KCamCrUserSceneLightSensitivity = 0x29; + +const TUint32 KCamCrPhotoRotation = 0x30; +const TUint32 KCamCrVideoStabilisation = 0x31; +const TUint32 KCamCrFlickerCancellation = 0x32; +const TUint32 KCamCrZoomPaneOrientation = 0x33; +const TUint32 KCamCrZoomUsingVolumeKeys = 0x34; +const TUint32 KCamCrZoomUsingNaviKeys = 0x35; +const TUint32 KCamCrLastUsedMonthFolder = 0x36; + +const TUint32 KCamCrAlwaysDrawCourtesyUi = 0x37; + +const TUint32 KCamCrPhotoStoreLocation = 0x38; + +const TUint32 KCamCrUserMode = 0x50; + +// New CenRep key to hold the ID of the Default Album +const TUint32 KCamCrDefaultAlbumId = 0x51; + +// New CenRep key to hold the name of the Default Album +const TUint32 KCamCrDefaultAlbumTitle = 0x57; + +// Customise Toolbar keys +const TUint32 KCamCrImageToolbarItems = 0x58; +const TUint32 KCamCrImageToolbarDefaultItems = 0x59; + + + +// ========================================================= +// Cameraapp variant settings file +const TUid KCRUidCameraappVariant = {0x10208A43}; + +const TUint32 KCamCrVariantFlags = 0x01; // NOTE: "CameraVariant.hrh" + // contains the possible values + // of the flags + +const TUint32 KCamCrAppAlwaysRunning = 0x02; +const TUint32 KCamCrTimeLapseSupport = 0x03; +const TUint32 KCamCrVersionMajor = 0x04; +const TUint32 KCamCrVersionMinor = 0x05; +const TUint32 KCamCrBuildNumber = 0x06; + +// ========================================================= +#endif // CAMERAAPPPRIVATECRKEYS_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/MCamAddToAlbumObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/MCamAddToAlbumObserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: notifier of mc photos operation. + * +*/ + + + +#ifndef MCAMADDTOALBUMOBSERVER_H +#define MCAMADDTOALBUMOBSERVER_H + + +/** +* Abstract API for notifying the obersvers for completion event +* Once the Add to Album operation is complete via Collection +* Manager +*/ +class MCamAddToAlbumObserver + { + public: + + /** + * Notification once the asynchronous operations using + * CollectionManager interface have completed. + * + * @param aAlbumExists ETrue if album exists + * @param aAlbumTitle Title of the album + */ + virtual void CheckAlbumIdOperationCompleteL( + TBool aAlbumExists, const TDesC& aAlbumTitle ) = 0; + + /** + * Notification once the asynchronous operations using + * CollectionManager interface have completed. + */ + virtual void AddToAlbumIdOperationComplete() = 0; + + }; + +#endif // MCAMADDTOALBUMOBSERVER_H + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/MCamAppController.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/MCamAppController.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,183 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines abstract API's for the controller observers* +*/ + + +#ifndef MCAMAPPCONTROLLER_H +#define MCAMAPPCONTROLLER_H + +#include "CamSettings.hrh" + +#include "CamPSI.h" // TCamEvCompRange + +class MCamControllerObserver; +class CCameraUiConfigManager; +/** +* Abstract API for controller observer from the settings plugin. +* +*/ +class MCamAppController + { + public: + + /** + * Add a controller observer. + * @since 2.8 + * @param aObserver Pointer to an object implementing + * MCamControllerObserver + * @return ?description + */ + virtual void AddControllerObserverL( + const MCamControllerObserver* aObserver ) = 0; + + /** + * Remove a controller observer + * @since 2.8 + * @param aObserver Pointer to the observer to remove. The object + * does not have to be added as an observer. + */ + virtual void RemoveControllerObserver + ( const MCamControllerObserver* aObserver ) = 0; + + /** + * Return number of images that can still be captured + * @since 2.8 + * @param aStorage storage location - defaults to current loation + * @param aBurstActive - set to ETrue if burst mode is active + * @return the number of images + */ + virtual TInt ImagesRemaining( TCamMediaStorage aStorage, + TBool aBurstActive, + TInt aQualityIndex ) = 0; + + /* + * Return amount of video that can still be captured + * @since 2.8 + * @return the amount of video in secs + */ + virtual TTimeIntervalMicroSeconds RecordTimeRemaining() = 0; + + /** + * Previews a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want + * to preview. + * @param aSettingValue the new integer value for the specified + * setting item to be previewed. + * @since 2.8 + */ + virtual void PreviewSettingChangeL( TInt aSettingItem, + TInt aSettingValue ) = 0; + + + /** + * Cancels all preview changes, since last commit/cancel. + * @since 2.8 + */ + virtual void CancelPreviewChangesL() = 0; + + /** + * Commits last preview change. + * @since 2.8 + */ + virtual void CommitPreviewChanges() = 0; + + /** + * Restore Camera settings to default + * @since 3.0 + * @param aIsEmbedded if app is embedded + */ + virtual void RestoreFactorySettingsL( TBool aIsEmbedded ) = 0; + + + /** + * Returns the current integer value for the specified setting + * without the filtering usually performed on storage location. + * This is neccesary to allow the video/photo settings list to show + * the selected storage location rather than the forced storage location. + * @return the current integer setting value + * @param aSettingItem specifies which setting item that want the value of. + * @since 2.8 + */ + virtual TInt IntegerSettingValueUnfiltered( TInt aSettingItem ) const = 0; + + /** + * Returns the current integer value for the specified setting + * @return the current integer setting value + * @param aSettingItem specifies which setting item that want the value of. + * @since 2.8 + */ + virtual TInt IntegerSettingValue( TInt aSettingItem ) const = 0; + + /** + * Sets a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want to set the value of. + * @param aSettingValue the new integer value for the specified setting item. + * @since 2.8 + */ + virtual void SetIntegerSettingValueL( TInt aSettingItem, TInt aSettingValue ) = 0; + + /** + * Returns the current text value for the specified setting + * @return the current text setting value + * @param aSettingItem specifies which setting item that want the text value of. + * @since 2.8 + */ + virtual TPtrC TextSettingValue( TInt aSettingItem ) const = 0; + + /** + * Sets a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want to set the value of. + * @param aSettingValue the new integer value for the specified setting item. + * @since 2.8 + */ + virtual void SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ) = 0; + + /** + * Increments the engine usage count + * @since 2.8 + */ + virtual void IncCameraUsers() = 0; + + /** + * Decrements the engine usage count If the engine is no longer required + * then it is released. If it is still processing, the engine count will + * be checked when the current process completes and the engine will be + * released if it is no longer needed. + * @since 2.8 + */ + virtual void DecCameraUsers() = 0; + + /** + * Return range of EV value supported for current product + * @since 3.0 + * @return TEvRange struct + */ + virtual TCamEvCompRange EvRange() const = 0; + + /** + * Restart the idle timer + * @since 2.8 + */ + virtual void StartIdleTimer() = 0; + + /* + * Get handle to CameraUiConfigManager + */ + virtual CCameraUiConfigManager* UiConfigManagerPtr() = 0; + }; + +#endif // + \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/MCamStaticSettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/MCamStaticSettings.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines abstract interface observing add to album operation completion* +*/ + + + +#ifndef MCAMSTATICSETTINGS_H +#define MCAMSTATICSETTING_H + +class CCamConfiguration; + +/** +* Interface for static settings model. +*/ +class MCamStaticSettings + { + public: + + /** + * Returns the current integer value for the specified setting + * @return the current integer setting value + * @param aSettingItem specifies which setting item that want the value of. + * @since 2.8 + */ + virtual TInt IntegerSettingValue( TInt aSettingItem ) const = 0; + + /** + * Sets a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want to set the value of. + * @param aSettingValue the new integer value for the specified setting item. + * @since 2.8 + */ + virtual void SetIntegerSettingValueL( TInt aSettingItem, TInt aSettingValue ) = 0; + + /** + * Returns the current text value for the specified setting + * @return the current text setting value + * @param aSettingItem specifies which setting item that want the text value of. + * @since 2.8 + */ + virtual TPtrC TextSettingValue( TInt aSettingItem ) const = 0; + + /** + * Sets a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want to set the value of. + * @param aSettingValue the new integer value for the specified setting item. + * @since 2.8 + */ + virtual void SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ) = 0; + + /** + * Loads the image/common static settings from shared data. Required to update + * the settings whenever get foreground event, in case of external + * changes to the settings. + * @since 2.8 + */ + virtual void LoadPhotoStaticSettingsL( const TBool aResetFromPlugin ) = 0; + + /** + * Loads the video/common static settings from shared data. Required to update + * the settings whenever get foreground event, in case of external + * changes to the settings. + */ + virtual void LoadVideoStaticSettingsL( const TBool aResetFromPlugin ) = 0; + + /** + * Returns reference to CCamConfiguration object describing + * the device's camera configuration. + * @return configuration + */ + virtual CCamConfiguration& Configuration() const = 0; + }; + +#endif // MCAMSTATICSETTINGS_H +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/camconfiguration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/camconfiguration.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,370 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for camera dynamic configuration. +* +* +*/ + + +#ifndef CAMCONFIGURATION_H +#define CAMCONFIGURATION_H + +// INCLUDES + +#include +#include "CamSettingsInternal.hrh" +#include "CamPSI.h" +#include "camconfigurationtypes.h" +#include "imagingconfigmanager.h" +#include "CamSettings.hrh" + +// FORWARD DECLARATIONS + +class CImagingConfigManager; +struct TVideoQualitySet; +struct TImageQualitySet; + +// CLASS DECLARATION + +/** +* Class CCamConfiguration +* Queries supported image and video qualities for ICM and creates the related +* data and does the mappings needed by cameraapp application. These include +* quality descriptions and icons. +* +* In the initial phase, emulates the product specific configuration code, +* so only minimal changes are needed in cameraapp UI code. +*/ +class CCamConfiguration: public CBase +{ + public: // Constructors and destructors + + /** + * Destructor. + */ + ~CCamConfiguration(); + + /** + * Two-phased constructor. + * @return pointer to the created CCamConfiguration object + */ + static CCamConfiguration* NewL(); + + public: // New functions + + /** + * Returns number of image qualities configured using ICM. Setting data + * for these qualities is accessible via ImageQuality() function. + * @return Number of qualities + */ + TInt NumImageQualities() const; + + /** + * Returns index for primary camera MMS quality + * @return MMS quality index or KErrNotFound + */ + TInt MmsImageQuality() const; + + /** + * Returns index for secondary camera imagequality. + * @return Secondary image quality index or KErrNotFound + */ + TInt SecondaryCameraImageQuality() const; + + /** + * Returns settings of the requested quality + * @param aIndex Index of the quality (Must be TCamPhotoQualityDescription + * Video: TCamVideoQualitySettings => TCamVideoQualityDescription + * @param aVideoMode EFalse if image mode + * @param aQualityVal Quality value + * @return Description id + * + */ + TInt MapSupportedQualityToQualityDescriptor( TBool aVideoMode, + TInt aQualityVal ) const; + + /** + * Returns the the following image quality related integer arrays: + * - ECamPsiSupportedStillResolutions + * - ECamPsiJpegDataSizes + * - ECamPsiSequencePostProcessDataSizes + * - ECamPsiSupportedStillQualities + * - ECamPsiStillQualityIconIds + * - ECamPsiPrecapStillQualityIconIds + * And following video quality related arrays: + * - ECamPsiSupportedVideoQualities + * - ECamPsiPrecapVideoQualityIconIds + * - ECamPsiVideoQualityIconIds + * - ECamPsiVideoQualityFileTypeId + * + * @param aKey Key + * @param aArray Destination array + */ + void GetPsiIntArrayL( TCamPsiKey aKey, RArray& aArray ) const; + + /** + * Provides mapping between TCamImageResolution and TCamPhotoSizeId types + * @param aResolution + * @return Photo Size + */ + static TCamPhotoSizeId MapResolutionToPhotoSize( TCamImageResolution aResolution ); + + /** + * Provides mapping between TCamPhotoSizeId and TCamImageResolution types + * @param aSizeId + * @return Resolution + */ + static TCamImageResolution MapPhotoSizeToResolution( TCamPhotoSizeId aSizeId ); + + /** + * Calculate number of images than can still be taken with the current + * image size + * @param aStorage Storage media + * @param aSizeId The current photo resolution setting + * @param aCriticalLevel Critical threshold on the specified drive + * @param aBurstActive Whether or not burst mode is active + * @return Number of images + */ + TInt ImagesRemaining( TCamMediaStorage aStorage, + TCamPhotoSizeId aSizeId, + TInt aCriticalLevel, + TBool aBurstActive ) const; + + /** + * Returns the CMR average video bitrate scaler (obtained from ICM) + * This is used to scale bitrates for remaining video time calculation + * @return scaler + */ + TReal CMRAvgVideoBitRateScaler() const; + + /** + * Returns the default VideoQuality setting which has the highest + * iVideoQualitySetLevel value (obtained from ICM) + * This is used to get the default video quality setting when restore + * settings or frist start camera + * @return video quality + */ + TCamVideoQualitySettings GetDefaultVideoQualityFromIcmL(); + + /** + * Returns the index to the image quality required by embedding application + * @return index to icm image configuration array + */ + TInt GetRequiredImageQualityIndex( const TSize& aResolution ) const; + + /** + * Returns the resolution that matches closest to the required resolution by embedding application + * @return TSize of the resolution + */ + TSize MapRequiredResolutionToActualResolutionPhoto( const TSize& aRequiredResolution ) const; + + /** + * Returns the index to the video quality required by embedding application + * @return index to icm video configuration array + */ + TInt GetRequiredVideoQualityIndex( const TSize& aResolution ) const; + + /** + * Returns the resolution that matches closest to the required resolution by embedding application + * @return TSize of the resolution + */ + TSize MapRequiredResolutionToActualResolutionVideo( const TSize& aRequiredResolution ) const; + + + private: + /** + * C++ default constructor. + * @since 2.8 + */ + CCamConfiguration(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * Queries image qualities from ICM, converts enabled qualities to internal + * data formats and adds them to ordered arrays. + */ + void InitializeImageQualitiesL(); + + /** + * Initializes TCamImageQualityData contents based on TImageQualitySet, which + * we have received from the ICM. + * @param aSet Image quality set from ICM + * @param aData CamConfiguration image quality data structure + */ + void InitializeImageQualityL( const TImageQualitySet& aSet, TCamImageQualityData& aData ); + + /** + * Returns all data of the requested quality + * @param aIndex Index of the quality (Must be & aArray ); + + /** + * Adds the given video quality data to correct place in ordered video + * qualities data array. Ordering is done based on the image quality + * description enumeration. (Highest quality first) + * @param aQuality Image quality data + * @param aArray Ordered image quality data array + */ + static void AddToOrderedVideoQualitiesArrayL( TCamVideoQualityData& aQuality, + RArray& aArray ); + + /** + * Checks if the value for aValue is used for type aCheckType if the + * supported image qualities. If so, Appends the aAppendType value + * (or aValue, if aAppendType is ECamItemSame) of that quality to + * the array. + * + * @param aCheckType Type for checking existence of value + * @param aValue Item value (of checking type) + * @param aArray Integer array + * @param aAppendType Type of correspondin value to be appended + */ + void AppendIfSupportedL( TCamItemType aCheckType, TInt aValue, + RArray&aArray, TCamItemType aAppendType=ECamItemSame ) const; + + /** + * Appends value of item of type aType from image quality data to aArray. + * @param aType Item type + * @param aArray Destination array + * @param aData Image quality data + */ + static void AppendTypeL( TCamItemType aType, RArray&aArray, const TCamImageQualityData& aData ); + + /** + * @param aValue Video resolution value + * @param aArray Destination array + */ + void AppendVideoResIfSupportedL( TInt aValue, RArray&aArray ) const; + + /** + * Allocates memory for asciiz string given in aData. Returns pointer to the + * string in the allocated memory. + * @param aData + * @return String + */ + const TUint8* AllocString8L( const TUint8* aData ); + + /** + * Allocates memory for asciiz string given in aData, converts it to 16-bit + * and returns pointer to the 16-bit string in the allocated memory. + * @param aData + * @return String + */ + const TUint16* AllocString16L( const TUint8* aData ); + + private: // Data + + // Imaging configuration manager + CImagingConfigManager* iIcm; + + // Camera display ids. Used when querying ICM for supported image and + // video qualities. + TInt iPrimaryCameraDisplayId; + TInt iSecondaryCameraDisplayId; + + // Image qualities data for primary and secondary camera + RArray iPrimaryCameraPhotoQualities; + RArray iSecondaryCameraPhotoQualities; + + // Video quality data. Last item is shared between primary camera MMS + // quality and secondary camera. + RArray iVideoQualities; + TInt iSecondaryVideoQualityIndex; + + // Arrays for storing (video qualities) string data from ICM + // All the content is owned by CCamConfiguration + RPointerArray iStrings8; + RPointerArray iStrings16; + + // Average video bitrate scaler - needed for remaining time calculation + TReal iCMRAvgVideoBitRateScaler; +}; + +#endif // CAMCONFIGURATION_H + +// End of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/camconfigurationconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/camconfigurationconstants.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,421 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Constants used by camera dynamic configuration. +* Mappings between enums, resolutions, icons, description +* and CamcorderVisible values. +* +* +*/ + +#ifndef CAMCONFIGURATIONCONSTANTS_H +#define CAMCONFIGURATIONCONSTANTS_H + +#include "CamSettingsInternal.hrh" +#include "camconfigurationtypes.h" +#include + +// Display IDs for cameras, used when requesting data from ICM +const TInt KCamPrimaryCameraDisplayId = 2; +const TInt KCamSecondaryCameraDisplayId = 3; + +// Photo resolutions corresponding each photo size and image quality +// enum value +const TCamPhotoSize KCamPhotoSizes[] = + { + { ECamPhotoSizeVGA, EImageResolutionMMS, ECamImageQualityMMS, 640, 480 }, + { ECamPhotoSizeSVGA, EImageResolutionMMS, ECamImageQualityEmail05m, 800, 600 }, + { ECamPhotoSizeXGA, EImageResolution0_8MP, ECamImageQualityEmail08m, 1024, 768 }, + { ECamPhotoSize1MP, EImageResolution1MP, ECamImageQualityEmail1m, 1152, 864 }, + { ECamPhotoSize1_3MP, EImageResolution1_3MP, ECamImageQualityPrint1_3m, 1280, 960 }, + { ECamPhotoSize2MP, EImageResolution2MP, ECamImageQualityPrint2m, 1600, 1200 }, + { ECamPhotoSize3MP, EImageResolution3MP, ECamImageQualityPrint3m, 2048, 1536 }, + { ECamPhotoSize5MP, EImageResolution5MP, ECamImageQualityPrint5m, 2592, 1944 }, + { ECamPhotoSize8MP, EImageResolution8MP, ECamImageQualityPrint8m, 3264, 2448 }, + { ECamPhotoSize12MP, EImageResolution12MP, ECamImageQualityPrint12m, 4000, 3000 }, + { ECamPhotoSizeW6MP, EImageResolutionW6MP, ECamImageQualityPrintW6m, 3264, 1832 }, + { ECamPhotoSizeW9MP, EImageResolutionW9MP, ECamImageQualityPrintW9m, 4000, 2248 }, + { ECamPhotoSizeCIF, EImageResolutionMMS, ECamImageQualityMMS, 354, 288 }, + { ECamPhotoSizeQVGA, EImageResolutionQVGA, ECamImageQualityMMS, 320, 240 }, + { ECamPhotoSizeWVGA, EImageResolutionWVGA, ECamImageQualityPrint8m, 4000, 2672 } // @todo: fake values + }; +__ASSERT_COMPILE( (sizeof(KCamPhotoSizes) / sizeof(TCamPhotoSize)) == ECamPhotoSizeLast ); + + +// Mappings for image qualities and small/medium/large types (type +// is calculated based on ICM's CamcorderVisible value) +// In case a type is not supported for a quality, closest description +// and quality are used. +const TCamImageQualityMapping + KCamImageQualityMappings[][ECamImageTypeLast] = + { + // ECamPhotoSizeVGA + { + { ECamPhotoQualityDescMms, EImageQualityMMS }, // Small + { ECamPhotoQualityDescMms, EImageQualityMMS }, // Medium + { ECamPhotoQualityDescMms, EImageQualityMMS } // Large + }, + // ECamPhotoSizeSVGA - Not supported for any type! + { + { ECamPhotoQualityDescLast, EImageQualityEmail }, // Small + { ECamPhotoQualityDescLast, EImageQualityEmail }, // Medium + { ECamPhotoQualityDescLast, EImageQualityEmail } // Large + }, + // ECamPhotoSizeXGA + { + { ECamPhotoQualityDesc0_8mMed, EImageQualityEmail }, // Small + { ECamPhotoQualityDesc0_8mMed, EImageQualityEmail }, // Medium + { ECamPhotoQualityDesc0_8mMed, EImageQualityEmail } // Large + }, + // ECamPhotoSize1MP + { + { ECamPhotoQualityDesc1mSmall, EImageQualityEmail }, // Small + { ECamPhotoQualityDesc1mMed, EImageQualityEmail }, // Medium + { ECamPhotoQualityDesc1mMed, EImageQualityEmail } // Large + }, + // ECamPhotoSize1_3MP + { + { ECamPhotoQualityDesc1_3mSmall, EImageQualityEmail }, // Small + { ECamPhotoQualityDesc1_3mSmall, EImageQualityEmail }, // Medium + { ECamPhotoQualityDesc1_3mSmall, EImageQualityEmail } // Large + }, + // ECamPhotoSize2MP + { + { ECamPhotoQualityDesc2mMed, EImageQualityPrint }, // Small + { ECamPhotoQualityDesc2mMed, EImageQualityPrint }, // Medium + { ECamPhotoQualityDesc2mLarge, EImageQualityPrint } // Large + }, + // ECamPhotoSize3MP + { + { ECamPhotoQualityDesc3mMed, EImageQualityPrint }, // Small + { ECamPhotoQualityDesc3mMed, EImageQualityPrint }, // Medium + { ECamPhotoQualityDesc3mLarge, EImageQualityPrint } // Large + }, + // ECamPhotoSize5MP + { + { ECamPhotoQualityDesc5mLarge, EImageQualityPrint }, // Small + { ECamPhotoQualityDesc5mLarge, EImageQualityPrint }, // Medium + { ECamPhotoQualityDesc5mLarge, EImageQualityPrint } // Large + }, + // ECamPhotoSize8MP + { + { ECamPhotoQualityDesc8mLarge, EImageQualityPrint }, // Small + { ECamPhotoQualityDesc8mLarge, EImageQualityPrint }, // Medium + { ECamPhotoQualityDesc8mLarge, EImageQualityPrint } // Large + }, + // ECamPhotoSize12MP + { + { ECamPhotoQualityDesc12mLarge, EImageQualityPrint }, // Small + { ECamPhotoQualityDesc12mLarge, EImageQualityPrint }, // Medium + { ECamPhotoQualityDesc12mLarge, EImageQualityPrint } // Large + }, + // ECamPhotoSizeW6MP + { + { ECamPhotoQualityDescW6mLarge, EImageQualityPrint }, // Small + { ECamPhotoQualityDescW6mLarge, EImageQualityPrint }, // Medium + { ECamPhotoQualityDescW6mLarge, EImageQualityPrint } // Large + }, + // ECamPhotoSizeW9MP + { + { ECamPhotoQualityDescW9mLarge, EImageQualityPrint }, // Small + { ECamPhotoQualityDescW9mLarge, EImageQualityPrint }, // Medium + { ECamPhotoQualityDescW9mLarge, EImageQualityPrint } // Large + }, + // ECamPhotoSizeCIF + { + { ECamPhotoQualityDescMms, EImageQualityMMS }, // Small + { ECamPhotoQualityDescMms, EImageQualityMMS }, // Medium + { ECamPhotoQualityDescMms, EImageQualityMMS } // Large + }, + // ECamPhotoSizeQVGA + { + { ECamPhotoQualityDescMms, EImageQualityMMS }, // Small + { ECamPhotoQualityDescMms, EImageQualityMMS }, // Medium + { ECamPhotoQualityDescMms, EImageQualityMMS } // Large + }, + // ECamPhotoSizeWVGA // @todo: fake values + { + { ECamPhotoQualityDesc8mLarge, EImageQualityPrint }, // Small + { ECamPhotoQualityDesc8mLarge, EImageQualityPrint }, // Medium + { ECamPhotoQualityDesc8mLarge, EImageQualityPrint } // Large + }, + }; +__ASSERT_COMPILE( (sizeof(KCamImageQualityMappings) / (sizeof(TCamImageQualityMapping)*ECamImageTypeLast) ) == ECamPhotoSizeLast ); + +// Video resolutions corresponding enum values +const TCamVideoSize KCamVideoSizes[] = + { + { ECamVideoResolutionSubQCIF, EVideoResolutionQCIF, 128, 96 }, + { ECamVideoResolutionQCIF, EVideoResolutionQCIF, 176, 144 }, + { ECamVideoResolutionCIF, EVideoResolutionQCIF, 352, 288 }, + { ECamVideoResolutionVGA, EVideoResolutionVGA, 640, 480 }, + { ECamVideoResolutionQVGA, EVideoResolutionQVGA, 320, 240 }, + { ECamVideoResolutionNHD, EVideoResolutionNHD, 640, 352 }, + { ECamVideoResolutionWVGA, EVideoResolutionWVGA, 864, 480 }, + { ECamVideoResolutionHD, EVideoResolutionHD, 1280, 720 } + }; +__ASSERT_COMPILE( (sizeof(KCamVideoSizes) / sizeof(TCamVideoSize)) == ECamVideoResolutionLast ); + +// Image quality icons, settings view and precapture +// Array indexed quality description ID +const TCamQualityIcons KCamImageIcons[] = + { + + + // ECamPhotoQualityDesc12mLarge + { + EMbmCameraappQgn_indi_cam4_quality_12mp_high, + EMbmCameraappQgn_indi_cam4_quality_12mp_high_mask, + EMbmCameraappQgn_indi_cam4_quality_12mp_high, + EMbmCameraappQgn_indi_cam4_quality_12mp_high_mask + }, + // ECamPhotoQualityDescW9mLarge + { + EMbmCameraappQgn_indi_cam4_quality_9mp_high, + EMbmCameraappQgn_indi_cam4_quality_9mp_high_mask, + EMbmCameraappQgn_indi_cam4_quality_9mp_high, + EMbmCameraappQgn_indi_cam4_quality_9mp_high_mask + }, + // ECamPhotoQualityDesc8mLarge + { + EMbmCameraappQgn_indi_cam4_quality_8mp_high, + EMbmCameraappQgn_indi_cam4_quality_8mp_high_mask, + EMbmCameraappQgn_indi_cam4_quality_8mp_high, + EMbmCameraappQgn_indi_cam4_quality_8mp_high_mask + }, + // ECamPhotoQualityDescW6mLarge + { + EMbmCameraappQgn_indi_cam4_quality_6mp_high, + EMbmCameraappQgn_indi_cam4_quality_6mp_high_mask, + EMbmCameraappQgn_indi_cam4_quality_6mp_high, + EMbmCameraappQgn_indi_cam4_quality_6mp_high_mask + }, + // ECamPhotoQualityDesc5mLarge + { + EMbmCameraappQgn_indi_cam4_quality_5mp_high, + EMbmCameraappQgn_indi_cam4_quality_5mp_high_mask, + EMbmCameraappQgn_indi_cam4_quality_5mp_high, + EMbmCameraappQgn_indi_cam4_quality_5mp_high_mask + }, + // ECamPhotoQualityDesc3mLarge + { + EMbmCameraappQgn_indi_cam4_quality_3mp_high, + EMbmCameraappQgn_indi_cam4_quality_3mp_high_mask, + EMbmCameraappQgn_indi_cam4_quality_3mp_high, + EMbmCameraappQgn_indi_cam4_quality_3mp_high_mask + }, + // ECamPhotoQualityDesc2mLarge + { + EMbmCameraappQgn_indi_cam4_quality_2mp_high, + EMbmCameraappQgn_indi_cam4_quality_2mp_high_mask, + EMbmCameraappQgn_indi_cam4_quality_2mp_high, + EMbmCameraappQgn_indi_cam4_quality_2mp_high_mask + }, + // ECamPhotoQualityDesc3mMed + { + EMbmCameraappQgn_indi_cam4_quality_3mp_medium, + EMbmCameraappQgn_indi_cam4_quality_3mp_medium_mask, + EMbmCameraappQgn_indi_cam4_quality_3mp_medium, + EMbmCameraappQgn_indi_cam4_quality_3mp_medium_mask + }, + // ECamPhotoQualityDesc2mMed + { + EMbmCameraappQgn_indi_cam4_quality_2mp_medium, + EMbmCameraappQgn_indi_cam4_quality_2mp_medium_mask, + EMbmCameraappQgn_indi_cam4_quality_2mp_medium, + EMbmCameraappQgn_indi_cam4_quality_2mp_medium_mask + }, + // ECamPhotoQualityDesc1mMed + { + EMbmCameraappQgn_indi_cam4_quality_1mp_low, //Medium icon missing!! + EMbmCameraappQgn_indi_cam4_quality_1mp_low_mask, + EMbmCameraappQgn_indi_cam4_quality_1mp_low, + EMbmCameraappQgn_indi_cam4_quality_1mp_low_mask + }, + // ECamPhotoQualityDesc1_3mSmall + { + EMbmCameraappQgn_indi_cam4_quality_13mp_low, + EMbmCameraappQgn_indi_cam4_quality_13mp_low_mask, + EMbmCameraappQgn_indi_cam4_quality_13mp_low, + EMbmCameraappQgn_indi_cam4_quality_13mp_low_mask + }, + // ECamPhotoQualityDesc1mSmall + { + EMbmCameraappQgn_indi_cam4_quality_1mp_low, + EMbmCameraappQgn_indi_cam4_quality_1mp_low_mask, + EMbmCameraappQgn_indi_cam4_quality_1mp_low, + EMbmCameraappQgn_indi_cam4_quality_1mp_low_mask + }, + // ECamPhotoQualityDesc0_8mMed + { + EMbmCameraappQgn_indi_cam4_quality_08mp_low, + EMbmCameraappQgn_indi_cam4_quality_08mp_low_mask, + EMbmCameraappQgn_indi_cam4_quality_08mp_low, + EMbmCameraappQgn_indi_cam4_quality_08mp_low_mask + }, + // ECamPhotoQualityDescMms + { + EMbmCameraappQgn_indi_cam4_quality_03mp_low, + EMbmCameraappQgn_indi_cam4_quality_03mp_low_mask, + EMbmCameraappQgn_indi_cam4_quality_03mp_low, + EMbmCameraappQgn_indi_cam4_quality_03mp_low_mask + } + }; +__ASSERT_COMPILE( (sizeof(KCamImageIcons) / sizeof(TCamQualityIcons)) == ECamPhotoQualityDescLast ); + +// Video quality icons, settings view and precapture +// Array indexed quality description ID +const TCamQualityIcons KCamVideoIcons[] = + { + // ECamVideoQualityDescHDHighest + { + EMbmCameraappQgn_indi_cam4_quality_hd, + EMbmCameraappQgn_indi_cam4_quality_hd_mask, + EMbmCameraappQgn_indi_cam4_quality_hd, + EMbmCameraappQgn_indi_cam4_quality_hd_mask + }, + // ECamVideoQualityDescWidescreenHighest + { + EMbmCameraappQgn_indi_cam4_quality_wide_high, + EMbmCameraappQgn_indi_cam4_quality_wide_high_mask, + EMbmCameraappQgn_indi_cam4_quality_wide_high, + EMbmCameraappQgn_indi_cam4_quality_wide_high_mask + }, + // ECamVideoQualityDescTVHigh + { + EMbmCameraappQgn_indi_vid4_quality_tv_high, + EMbmCameraappQgn_indi_vid4_quality_tv_high_mask, + EMbmCameraappQgn_indi_vid4_quality_tv_high, + EMbmCameraappQgn_indi_vid4_quality_tv_high_mask + }, + // ECamVideoQualityDescHigh + { + EMbmCameraappQgn_indi_vid4_quality_high, + EMbmCameraappQgn_indi_vid4_quality_high_mask, + EMbmCameraappQgn_indi_vid4_quality_high, + EMbmCameraappQgn_indi_vid4_quality_high_mask + }, + // ECamVideoQualityDescWidescreenHigh + { + EMbmCameraappQgn_indi_cam4_quality_wide_high, + EMbmCameraappQgn_indi_cam4_quality_wide_high_mask, + EMbmCameraappQgn_indi_cam4_quality_wide_high, + EMbmCameraappQgn_indi_cam4_quality_wide_high_mask + }, + // ECamVideoQualityDescWidescreenNorm + { + // use high icons for now, until the correct ones can be found from the build + EMbmCameraappQgn_indi_cam4_quality_wide_high, + EMbmCameraappQgn_indi_cam4_quality_wide_high_mask, + EMbmCameraappQgn_indi_cam4_quality_wide_high, + EMbmCameraappQgn_indi_cam4_quality_wide_high_mask + //EMbmCameraappQgn_indi_cam4_quality_wide_normal, + //EMbmCameraappQgn_indi_cam4_quality_wide_normal_mask, + //EMbmCameraappQgn_indi_cam4_quality_wide_normal, + //EMbmCameraappQgn_indi_cam4_quality_wide_normal_mask + }, + // ECamVideoQualityDescTVNorm + { + EMbmCameraappQgn_indi_vid4_quality_tv_normal, + EMbmCameraappQgn_indi_vid4_quality_tv_normal_mask, + EMbmCameraappQgn_indi_vid4_quality_tv_normal, + EMbmCameraappQgn_indi_vid4_quality_tv_normal_mask + }, + // ECamVideoQualityDescNorm + { + EMbmCameraappQgn_indi_vid4_quality_normal, + EMbmCameraappQgn_indi_vid4_quality_normal_mask, + EMbmCameraappQgn_indi_vid4_quality_normal, + EMbmCameraappQgn_indi_vid4_quality_normal_mask + }, + // ECamVideoQualityDescWebHigh + { + EMbmCameraappQgn_indi_vid4_quality_email_high, + EMbmCameraappQgn_indi_vid4_quality_email_high_mask, + EMbmCameraappQgn_indi_vid4_quality_email_high, + EMbmCameraappQgn_indi_vid4_quality_email_high_mask + }, + // ECamVideoQualityDescWebNorm + { + EMbmCameraappQgn_indi_vid4_quality_email_normal, + EMbmCameraappQgn_indi_vid4_quality_email_normal_mask, + EMbmCameraappQgn_indi_vid4_quality_email_normal, + EMbmCameraappQgn_indi_vid4_quality_email_normal_mask + }, + // ECamVideoQualityDescMMS + { + EMbmCameraappQgn_indi_cam4_quality_sharing, + EMbmCameraappQgn_indi_cam4_quality_sharing_mask, + EMbmCameraappQgn_indi_cam4_quality_sharing, + EMbmCameraappQgn_indi_cam4_quality_sharing_mask + }, + // ECamVideoQualityDescSharing + { + EMbmCameraappQgn_indi_cam4_quality_sharing, + EMbmCameraappQgn_indi_cam4_quality_sharing_mask, + EMbmCameraappQgn_indi_cam4_quality_sharing, + EMbmCameraappQgn_indi_cam4_quality_sharing_mask + } + }; +__ASSERT_COMPILE( (sizeof(KCamVideoIcons) / sizeof(TCamQualityIcons)) == ECamVideoQualityDescLast ); + +// Icons and mask for each video type (mp4, 3gp etc.) +const TCamFileTypeIcons KCamVideoTypeIcons[] = + { + { + EMbmCameraappQgn_prop_cam4_codec_mp4, + EMbmCameraappQgn_prop_cam4_codec_mp4_mask + }, + { + EMbmCameraappQgn_prop_cam4_codec_3gp, + EMbmCameraappQgn_prop_cam4_codec_3gp_mask + } + }; +__ASSERT_COMPILE( (sizeof(KCamVideoTypeIcons) / sizeof(TCamFileTypeIcons)) == ECamVideoTypeLast ); + +// Mime types for mapping from strings to our enum +_LIT8( KCamMimeMp4, "video/mp4" ); +_LIT8( KCamMime3gpp, "video/3gpp" ); + +// Camera configuration panic id +_LIT( KCamConfigPanicId, "CAM-CONF" ); + +// Constants for mapping CamcorderVisible to small/medium/large image +const TInt KCamImageLargeTypeMin = 300; // >= 300 = large +const TInt KCamImageMediumTypeMin = 200; // 200-299 = medium, otherwise small + +// Constants for mapping CamcorderVisible value to video quality description +const TCamVideoQualityMapping + KCamVideoQualityMappings[] = + { + { ECamVideoQualityDescHDHighest, 500 }, + { ECamVideoQualityDescWidescreenHighest, 490 }, + { ECamVideoQualityDescTVHigh, 450 }, + { ECamVideoQualityDescHigh, 400 }, + { ECamVideoQualityDescWidescreenHigh, 375 }, + { ECamVideoQualityDescWidescreenNorm, 365 }, + { ECamVideoQualityDescTVNorm, 350 }, + { ECamVideoQualityDescNorm, 300 }, + { ECamVideoQualityDescWebHigh, 250 }, + { ECamVideoQualityDescWebNorm, 200 }, + { ECamVideoQualityDescMMS, 90 }, + { ECamVideoQualityDescSharing, 1 } + }; +__ASSERT_COMPILE( (sizeof(KCamVideoQualityMappings) / sizeof(TCamVideoQualityMapping)) == ECamVideoQualityDescLast ); + + +#endif // CAMCONFIGURATIONCONSTANTS_H + +// End of file + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/camconfigurationtypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/camconfigurationtypes.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,251 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Types used by camera dynamic configuration. Previously +* defined separately for each product in camproductconstants.h +* +* +*/ + + +#ifndef CAMCONFIGURATIONTYPES_H +#define CAMCONFIGURATIONTYPES_H + + +// Video qualities +// Used to also index to the KVideoQualitySettings array. +// Make sure the CamUtility returns rigth count of +// supported video qualities. +enum TCamVideoQuality + { + EVideoHigh, + EVideoNormal, + EVideoMMS, + EVideoQualityLast + }; + + +enum TCamImageQuality + { + EImageQualityPrintHigh, + EImageQualityPrint, + EImageQualityPrintLow, + EImageQualityEmail, + EImageQualityMMS, + EImageQualitySecondary, + EImageQualityLast + }; + +enum TCamImageResolution + { + EImageResolutionMMS, // 0.3 MPix / MMS + EImageResolution0_8MP, // 0.8 MPix = XGA + EImageResolution1MP, // 1 MPix + EImageResolution1_3MP, // 1.3 MPix + EImageResolution2MP, // 2 MPix + EImageResolution3MP, // 3 MPix + EImageResolution5MP, // 5 MPix + EImageResolution8MP, // 8 MPix + EImageResolution12MP, // 12 MPix + EImageResolutionW6MP, // 6 MPix 16:9 + EImageResolutionW9MP, // 9 MPix 16:9 + EImageResolutionCIF, // CIF + EImageResolutionQVGA, // QVGA, for secondary camera + EImageResolutionWVGA, // WVGA + EImageResolutionLast // End marker + }; + +// Supported video resolutions +// Converted to TCamVideoResolution in MapVideoResolution +enum TVideoResolution + { + EVideoResolutionQCIF, + EVideoResolutionQVGA, + EVideoResolutionVGA, + EVideoResolutionNHD, + EVideoResolutionWVGA, + EVideoResolutionHD + }; + +// Image compression levels +enum TCamImageCompression + { + EPhotoQualitySuperFine = 99, + EPhotoQualityFine = 85, // 1:10 + EPhotoQualityStandard = 70, + EPhotoQualityBasic = 50, // 1:20 + EPhotoQualityMMS = 25 + }; + +// Image quality data +// typedef struct +struct TCamPhotoQualitySetting + { + TCamImageQuality iPhotoQualityId; + TCamImageResolution iPhotoResolution; + TInt iQualityLevel; // TCamImageCompression + }; // TCamPhotoQualitySetting; + +// Structure representing a video quality level +// The text pointers must be const, so no const_casts are needed +struct TVideoQualitySettings + { + TInt iQualityLevel; // identifier + TInt iVideoResolution; // resolution (ie CIF/QCIF) + TReal iVideoFrameRate; // video frame rate + TInt iVideoBitRate; // video bit rate + TInt iAudioBitRate; // audio bit rate + const TUint8* iVideoMimeType; // MIME type + const TUint16* iPreferredSupplier; // Supplier + const TUint8* iVideoCodec; // video codec + const TUint8* iAudioCodec; // audio codec + TInt iVideoFileType; // video file type (i.e mpeg4, H263) + TInt iVideoLength; // video length (max or short for sharing) + }; + + +// New dynamic configuration related types +// ----------------------------------------------------------------- + +// Settings slider and precapture quality icons +// Used for image and video quality data +struct TCamQualityIcons + { + TInt iSettingsIconId; + TInt iSettingsIconMask; + TInt iPrecapIconId; + TInt iPrecapIconMask; + }; + +// File type icon +struct TCamFileTypeIcons + { + TInt iIconId; + TInt iMask; + }; + +// Item types, used when appending data into integer arrays +enum TCamItemType + { + ECamItemSame, + ECamItemPhotoSize, + ECamItemPhotoQuality, + ECamItemSettingsIconId, + ECamItemPrecapIconId, + ECamItemSecondaryIconId, + ECamItemPhotoJpegSize, + ECamItemSeqPostProcSize + }; + +// Photo size. Used to create image size data (resolution+enums) constant array +struct TCamPhotoSize + { + TCamPhotoSizeId iSizeId; + TCamImageResolution iResolution; + TCamImageQualitySetting iQualitySettingId; + TInt iWidth; + TInt iHeight; + }; + +// Video size. Used to create video size data (resolution+enums) constant array +struct TCamVideoSize + { + TCamVideoResolution iCamVideoRes; + TVideoResolution iVideoRes; + TInt iWidth; + TInt iHeight; + }; + +// Image quality data structure, which contains all the +// information needed for each quality/size in the application +struct TCamImageQualityData + { + // This quality is for primary camera + TBool iPrimaryCamera; + + // Two different ways of representing the same image quality, + // used in different parts of the application + TCamPhotoSize iPhotoSize; + TCamPhotoQualitySetting iPhotoQualitySetting; + + // Description Id. Combination of size (5m/3m...), usage (print/email/...) + // and size (small/medium/large ). + TCamPhotoQualityDescription iDescription; + + // Quality icons + TCamQualityIcons iQualityIcons; + + // Estimated file size + TInt iFileSize; + }; + +struct TCamVideoQualityData + { + // Quality settings (resolution, bitrate, file type etc), which were + // previously in constant array KVideoQualitySettings + // iQualitySettings.iQuality level (0,1,...X) is used for indexing, last one is MMS + TVideoQualitySettings iQualitySettings; + + // Video resolution + TCamVideoResolution iVideoResolution; + + // High/(normal high)/normal/(normal low)/sharing + TCamVideoQualitySettings iQualitySetting; + + // Description ID for the quality + TCamVideoQualityDescription iDescription; + + // Icon IDs + TCamQualityIcons iQualityIcons; + + TCamFileTypeIcons iFileTypeIcons; + }; + +// Image type - small/medium/large +enum TCamImageType + { + ECamImageTypeSmall, + ECamImageTypeMedium, + ECamImageTypeLarge, + ECamImageTypeLast + }; + +// Photo description and matching quality (print/email/mms etc) +struct TCamImageQualityMapping + { + TCamPhotoQualityDescription iDesc; + TCamImageQuality iQuality; + }; + +// Mapping between CamcorderVisible value and video description +struct TCamVideoQualityMapping + { + TCamVideoQualityDescription iDesc; + TInt iCamcorderVisibleMin; + }; + +// Panics +enum TCamConfigurationPanics + { + ECamConfigPanicUnknownKey, + ECamConfigPanicUnknownType, + ECamConfigPanicNoQuality, + ECamConfigPanicNoDescription, + ECamConfigPanicNoVideoRes, + ECamConfigPanicNoVideoType, + ECamConfigPanicInvalidNumberOfQualities, + ECamConfigPanicInvalidItem + }; + +#endif // CAMCONFIGURATIONTYPES_H + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/camconfigurationutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/camconfigurationutility.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper class for camera dynamic configuration +* +* +*/ + +#ifndef CAMCONFIGURATIONUTILITY_H +#define CAMCONFIGURATIONUTILITY_H + +#include +#include "camconfiguration.h" + +class CamConfigurationUtility + { + public: + + /** + * Returns index in KPhotoSizes table for given photo resolution + * @param aWidth Width + * @param aHeight Height + * @return Size index, or KErrNotFound + */ + static TInt PhotoSizeIndex( TInt aWidth, TInt aHeight ); + + /** + * Returns index in KVideoSizes table for given video resolution + * @param aWidth Width + * @param aHeight Height + * @return Size index, or KErrNotFound + */ + static TInt VideoSizeIndex( TInt aWidth, TInt aHeight ); + + /** + * Adjusts print qualities from ECamQualityPrint to ECamQualityPrintHigh and Low, + * where necessary. + * @param aPhotoQualities Array of image quality data + */ + static void AdjustPrintQualities( RArray& aPhotoQualities ); + + /** + * Sets video quality levels for an ordered array of video qualities data. + * + * @param aOrderedArray + */ + static void SetVideoQualityLevels( RArray& aOrderedArray ); + + /** + * Appends integer value to array, if the value is not yet present in the array. + * @param aValue Integer value + * @param aArray Integer array + */ + static void AddToArrayL( TInt aValue, RArray& aArray ); + + /** + * Returns index in KPhotoSizes table for given photo resolution + * @param aWidth Width + * @param aHeight Height + * @return Size id, or KErrNotFound + */ + static TInt VideoResolution( TInt aWidth, TInt aHeight ); + + /** + * Returns index in KPhotoSizes table for given photo resolution + * @param aWidth Width + * @param aHeight Height + * @return Size id, or KErrNotFound + */ + static TInt CamVideoResolution( TInt aWidth, TInt aHeight ); + + /** + * Returns TSize of for given photo resolution of the KPhotoSizes table + * @param Size id + * @return TSize resolution, or KErrNotFound + */ + static TSize CamVideoResolution( TCamVideoResolution aResolution ); + + /** + * + * @param aMimeType type + * @return Mime type + */ + static TInt VideoType( const TText8* aMimeType ); + + /** + * Converts CamcorderVisible value into video description id + * @param aQualityValue + * @return Description id + */ + static TCamVideoQualityDescription VideoDescId( TInt aQualityValue ); + + /** + * Converts CamcorderVisible value into image type + * @param aValue + * @return Image type + */ + static TCamImageType ImageType( TInt aValue ); + + + static TBool IsSupported( TInt aValue, TCamItemType aItemType, + const TCamImageQualityData& aData ); + + /** + * Get the scene setting id from dynamic setting id. + */ + static TInt MapDynamicSettingToSceneSetting( TInt aSettingId ); + }; + +#endif CAMCONFIGURATIONUTILITY_H + +// End of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/caminfolistboxitembase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/caminfolistboxitembase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of Info Listbox Item Base class. +* Adds support for comparison operator. +* +*/ + + +#ifndef CAM_INFOLISTBOXITEMBASE_H +#define CAM_INFOLISTBOXITEMBASE_H + +#include +#include "mcaminfolistboxitem.h" + +// =========================================================================== +// Forward declarations +class CFbsBitmap; + + +// =========================================================================== +// Class declarations +class CCamInfoListboxItemBase : public CBase, + public MCamInfoListboxItem + { + // ======================================================= + public: + virtual ~CCamInfoListboxItemBase(); + + // ------------------------------------------------------- + // from MCamInfoListboxItem + public: + + /** + * Returns a pointer to the item text + * @since 2.8 + * @return Pointer to the item text + */ + virtual TPtrC ItemText() const; + + /** + * Returns the item's value id + * @since 2.8 + * @return Value id + */ + virtual TInt ItemValue() const; + + /** + * Returns a pointer to the item's bitmap + * @since 2.8 + * @return Pointer to the bitmap + */ + virtual CFbsBitmap* Bitmap() const; + + /** + * Returns a pointer to the item's bitmap mask + * @since 2.8 + * @return Pointer to the bitmap mask + */ + virtual CFbsBitmap* BitmapMask() const; + + // ------------------------------------------------------- + public: + + /** + * Comparison operator that can be given as parameter to RPointerArray::Find. + * @param aFirstItemId Pointer to setting value id of first item + * @param aOtherItem Reference to the second item + * @return Boolean value describing if the items are equal by ids. + * + */ + static TBool EqualIds( const TInt* aFirstItemId, + const CCamInfoListboxItemBase& aOtherItem ); + + // ======================================================= + // Data + protected: + + // The text to be displayed in the list controls + HBufC* iListItemText; + // The id of the setting value represented by this item + TInt iSettingItemValueId; + // The id of the bitmap + TInt iBitmapId; + // The bitmap + CFbsBitmap* iBitmap; + // The bitmap mask + CFbsBitmap* iBitmapMask; + + // ======================================================= + }; + +#endif // CAM_INFOLISTBOXITEMBASE_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/camlayoututils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/camlayoututils.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: TCamLayoutUtils class declarations. +* Class provides compact representation +* for commonly used boolean layout queries. +* +*/ + + +#ifndef CAM_LAYOUTUTILS_H +#define CAM_LAYOUTUTILS_H + +#include + +class TCamLayoutUtils + { + public: + inline static TBool IsLayoutMirrored(); + inline static TBool IsApacVariant(); + }; + +#include "camlayoututils.inl" + +#endif // CAM_LAYOUTUTILS_H + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/camlayoututils.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/camlayoututils.inl Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Inline implementations of TCamLayoutUtils methods. +* +*/ + + + +#include + + +//inline +TBool +TCamLayoutUtils::IsLayoutMirrored() + { + return AknLayoutUtils::LayoutMirrored(); + }; + +//inline +TBool +TCamLayoutUtils::IsApacVariant() + { + return ( AknLayoutUtils::Variant() == EApacVariant ); + }; + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/camlogging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/camlogging.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CAM_LOGGING_H +#define CAM_LOGGING_H + +#include + +#ifdef _DEBUG +// Defines used for activeobject tracing. +#undef _AO_TRACKING +//#define _AO_TRACKING +#ifdef _AO_TRACKING +#define private public +#include +#undef private +#endif //_AO_TRACKING +#endif //_DEBUG + +// --------------------------------------------------------------------------- +#if !defined( PRINT3 ) + #ifdef _DEBUG + #define PRINT( txt ) RDebug::Print( txt ); + #define PRINT1( txt, arg1 ) RDebug::Print( txt, arg1 ); + #define PRINT2( txt, arg1, arg2 ) RDebug::Print( txt, arg1, arg2 ); + #define PRINT3( txt, arg1, arg2, arg3 ) RDebug::Print( txt, arg1, arg2, arg3 ); + #define PRINT4( txt, arg1, arg2, arg3, arg4 ) RDebug::Print( txt, arg1, arg2, arg3, arg4 ); + + // PRINT_FRQ macros are used for logging of frequently occurring events, + // for example draws done every time a viewfinder frame arrives. + // By default, logging these is disabled. + #undef LOG_FREQUENT + + #ifdef LOG_FREQUENT + #define PRINT_FRQ( txt ) RDebug::Print( txt ); + #define PRINT_FRQ1( txt, arg1 ) RDebug::Print( txt, arg1 ); + #define PRINT_FRQ2( txt, arg1, arg2 ) RDebug::Print( txt, arg1, arg2 ); + #define PRINT_FRQ3( txt, arg1, arg2, arg3 ) RDebug::Print( txt, arg1, arg2, arg3 ); + #define PRINT_FRQ4( txt, arg1, arg2, arg3, arg4 ) RDebug::Print( txt, arg1, arg2, arg3, arg4 ); + #else + #define PRINT_FRQ( txt ) + #define PRINT_FRQ1( txt, arg1 ) + #define PRINT_FRQ2( txt, arg1, arg2 ) + #define PRINT_FRQ3( txt, arg1, arg2, arg3 ) + #define PRINT_FRQ4( txt, arg1, arg2, arg3, arg4 ) + #endif // LOG_FREQUENT + + #else + #define PRINT( txt ) + #define PRINT1( txt, arg1 ) + #define PRINT2( txt, arg1, arg2 ) + #define PRINT3( txt, arg1, arg2, arg3 ) + #define PRINT4( txt, arg1, arg2, arg3, arg4 ) + + #define PRINT_FRQ( txt ) + #define PRINT_FRQ1( txt, arg1 ) + #define PRINT_FRQ2( txt, arg1, arg2 ) + #define PRINT_FRQ3( txt, arg1, arg2, arg3 ) + #define PRINT_FRQ4( txt, arg1, arg2, arg3, arg4 ) + + #endif +#endif +// --------------------------------------------------------------------------- + +#endif + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/camuiconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/camuiconstants.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of constants equired by external applications* +*/ + + + +#ifndef CAMUICONSTANTS_H +#define CAMUICONSTANTS_H + +// INCLUDES +#include + +// CONSTANTS + +// Initial value for direct viewfinder color key. +// const TUint KCamDirectColorVal = 0xFF8C8C8C; +const TUint KCamDirectColorVal = 0x00030303; + +// Precapture view background color. This color is used to +// paint the background during application startup and mode switches, +// when viewfinder is not yet running. +// In case of direct viewfinding, same value as for color key +// should be used, to avoid backround with different color showing +// when viewfinder is stopped before mode switch, but screen is +// not redrawn. +const TUint KCamPrecaptureBgColor = 0x00030303; + +// The last two decimals, ie. 8C, is the amount of +// transparency. 00 would be totally transparent +// and FF totally visible. +#define KRgbShadedWhite TRgb( 0xFF, 0xFF, 0xFF, 0x8C ) + +#endif // CAMUICONSTANTS_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/camuidconstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/camuidconstants.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: UID constants needed by the camera application +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* +* +*/ + + +#ifndef CAMUIDCONSTANTS_H +#define CAMUIDCONSTANTS_H + +// UID for P&S notification of latest file/foreground status +const TUid KPSUidCamcorderNotifier = { 0x101F882E }; + +// Camcorder feature variation central repository UID +const TUid KCRUidCamcorderFeatures = { 0x101F8809 }; + +// UID of the camera settings plugin +const TUid KCamGSPluginUid = { 0x2000F8E1 }; + +// Other applications +const TUid KBtNotifierServerUid = { 0x101F8872 }; // Bt Notifier server +const TUid KPhoneAppUid = { 0x100058B3 }; // Phone application + +#endif // CAMUIDCONSTANTS_H + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/lcam.hlp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/lcam.hlp.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// +// lcam.hlp.hrh +// + +// +// +// + +#ifndef __LCAM_HLP_HRH__ +#define __LCAM_HLP_HRH__ + + +_LIT( KLCAM_HLP_VIEWFINDER_VIDEO, "LCAM_HLP_VIEWFINDER_VIDEO" ); //Video mode viewfinder +_LIT( KLCAM_HLP_VIEWFINDER_PHOTO, "LCAM_HLP_VIEWFINDER_PHOTO" ); //Image mode viewfinder +_LIT( KLCAM_HLP_POST_VIDEO, "LCAM_HLP_POST_VIDEO" ); //Video post-capture view +_LIT( KLCAM_HLP_POST_PHOTO, "LCAM_HLP_POST_PHOTO" ); //Photo post-capture view +_LIT( KLCAM_HLP_POST_SEQ, "LCAM_HLP_POST_SEQ" ); //Photos taken in a sequence post-capture view +_LIT( KLCAM_HLP_STANDBY_STATE, "LCAM_HLP_STANDYBY_STATE" ); //Camera standby view +_LIT( KLCAM_HLP_STANDYBY_EM, "LCAM_HLP_STANDBY_EM" ); //Embedded camera standby view +_LIT( KLCAM_HLP_VIEWFINDER_VIDEO_EM, "LCAM_HLP_VIEWFINDER_VIDEO_EM" ); //Record videos in applications +_LIT( KLCAM_HLP_VIEWFINDER_PHOTO_EM, "LCAM_HLP_VIEWFINDER_PHOTO_EM" ); //Take photos in applications +_LIT( KLCAM_HLP_SETTINGS_VIDEO, "LCAM_HLP_SETTINGS_VIDEO" ); //Video settings view +_LIT( KLCAM_HLP_SETTINGS_PHOTO, "LCAM_HLP_SETTINGS_PHOTO" ); //Image settings view +_LIT( KLCAM_HLP_SCENES_VIDEO, "LCAM_HLP_SCENES_VIDEO" ); //Video scenes view +_LIT( KLCAM_HLP_SCENES_PHOTO, "LCAM_HLP_SCENES_PHOTO" ); //Photo scenes view +_LIT( KLCAM_HLP_SETTINGS_PHOUSER, "LCAM_HLP_SETTINGS_PHOUSER" ); //User scene setup view +_LIT( KLCAM_HLP_LIGHT_SENSITIVITY, "LCAM_HLP_LIGHT_SENSITIVITY" ); // ISO value setting page +_LIT( KLCAM_HLP_ADVANCED_SEQUENCE, "LCAM_HLP_ADVANCED_SEQUENCE" ); // Advanced sequence mode setting page. +_LIT( KLCAM_HLP_CUST_TOOLBAR, "LCAM_HLP_CUST_TOOLBAR" ); // Customise toolbar view +_LIT( KLCAM_HLP_SETTINGS, "LCAM_HLP_SETTINGS" ); // General settings View + +#endif diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/mcaminfolistboxitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/mcaminfolistboxitem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of Info Listbox Item. +* Provides a standard interface for Info Listbox items. +* +*/ + + +#ifndef M_CAM_INFOLISTBOXITEM_H +#define M_CAM_INFOLISTBOXITEM_H + + +// =========================================================================== +// Forward declarations +class CFbsBitmap; + + +// =========================================================================== +// Class declarations +class MCamInfoListboxItem + { + // ======================================================= + public: + + /** + * Returns a pointer to the item text + * @since 2.8 + * @return Pointer to the item text + */ + virtual TPtrC ItemText() const = 0; + + /** + * Returns the item's value id + * @since 2.8 + * @return Value id + */ + virtual TInt ItemValue() const = 0; + + /** + * Returns a pointer to the item's bitmap + * @since 2.8 + * @return Pointer to the bitmap + */ + virtual CFbsBitmap* Bitmap() const = 0; + + /** + * Returns a pointer to the item's bitmap mask + * @since 2.8 + * @return Pointer to the bitmap mask + */ + virtual CFbsBitmap* BitmapMask() const = 0; + + // ======================================================= + }; + +#endif // M_CAM_INFOLISTBOXITEM_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/mcamlistboxmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/mcamlistboxmodel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Listbox interface +* +*/ + + +#ifndef M_CAM_LISTBOXMODEL_H +#define M_CAM_LISTBOXMODEL_H + + + +#include + +class MCamListboxModel: public MListBoxModel + { + public : // from MListBoxModel + + /** + * virtual empty destructor + */ + virtual ~MCamListboxModel() {}; + + /** + * Returns the number of items. + * @since 2.8 + * Returns number of items in item array + * @return Number of items + */ + virtual TInt NumberOfItems() const = 0; + + /** + * Returns pointer to the MDesCArray + * @since 2.8 + * @return Handle to MDesCArray + */ + virtual const MDesCArray* MatchableTextArray() const = 0; + + public : + + /** + * Returns pointer to the item text + * @param aItemIndex index of the item + * @return pointer to the item text + */ + virtual TPtrC ItemText( TInt aItemIndex ) const = 0; + + /** + * Returns the value id of the specified item + * @param aItemIndex index of the item + * @return the item's value id + */ + virtual TInt ItemValue( TInt aItemIndex ) const = 0; + + /** + * Returns the bitmap for the specified item + * @param aItemIndex index of the item + * @return pointer to the icon bitmap + */ + virtual CFbsBitmap* Bitmap( TInt aItemIndex ) const = 0; + + /** + * Returns the bitmap mask for the specified item + * @param aItemIndex index of the item + * @return pointer to the icon mask + */ + virtual CFbsBitmap* BitmapMask( TInt aItemIndex ) const = 0; + + /** + * Returns the index of the item with the specified value id + * @param aValueId the value to find + * @return index of the matching item + */ + virtual TInt ValueIndex( TInt aValueId ) const = 0; + + + /** + * Returns whether the model represents a shooting mode selection listbox + * @since 2.8 + * @return TBool ETrue if the model is representing a shooting mode listbox instead of a general settings listbox + */ + virtual TBool ShootingModeListBox() const = 0; + + virtual TAknLayoutRect IconLayoutData() const = 0; + virtual TAknLayoutRect RadioButtonLayoutData() const = 0; + virtual TAknLayoutText TextLayoutData() const = 0; + virtual TAknLayoutRect ListItemLayoutData() const = 0; + + }; + +#endif // M_CAM_LISTBOXMODEL_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/inc/mcamsettingsmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/inc/mcamsettingsmodel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,299 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface to object that manages all settings data. +* +*/ + + + +#ifndef MCAMSETTINGSMODEL_H +#define MCAMSETTINGSMODEL_H + +// =========================================================================== +// INCLUDES +#include + +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" + +// =========================================================================== +// CONSTANTS + +// =========================================================================== +// FORWARD DECLARATIONS +class CCamVideoQualityLevel; +class MCamSettingsModelObserver; + + +// =========================================================================== +// STRUCTURES +class TIntSetting + { + public: + TInt iItemId; + TInt iValueId; + }; + +class TSceneData + { + public: // Destructor + ~TSceneData (); + + public: // Data + TInt iSceneId; + RPointerArray iSettings; + }; + +class TCamVariantInfo + { + public: + TCamVariantInfo(); + + public: + + TInt iFlags; + TCamSupportFlag iTimeLapseSupport; + TCamSupportFlag iAlwaysOnSupport; + TVersion iVersion; + }; + +// =========================================================================== +// CLASS DECLARATION + +/** +* Interface to object that manages all settings data. +* @since 2.8 +*/ +class MCamSettingsModel + { + public: // Interface + + /** + * This needs to be here to be able to greacefully delete + * an object of inherited class through mixin pointer. + * If this is not defined, deleting through the mixin pointer + * results in User-42 panic! + */ + virtual ~MCamSettingsModel() {}; + + /** + * Add a settings model observer. + * Observers will be notified of settings changes. + */ + virtual void AttachObserverL( const MCamSettingsModelObserver* aObserver ) = 0; + + /** + * Remove a settings model observer. + */ + virtual void DetachObserver( const MCamSettingsModelObserver* aObserver ) = 0; + + /** + * Resets all user scene settings to their defaults. + * @since 2.8 + */ + virtual void ResetUserSceneL() = 0; + + /** + * Previews a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want to preview the value of. + * @param aSettingValue the new integer value for the specified setting item to be previewed. + * @since 2.8 + */ +// virtual void PreviewSettingChangeL( TInt aSettingItem, TInt aSettingValue ) = 0; + + /** + * Cancels all preview changes, since last commit/cancel. + * @since 2.8 + */ +// virtual void CancelPreviewChangesL() = 0; + + /** + * Commits last preview change. + * @since 2.8 + */ +// virtual void CommitPreviewChanges() = 0; + + /** + * Returns the current integer value for the specified setting + * @return the current integer setting value + * @param aSettingItem specifies which setting item that want the value of. + * @since 2.8 + */ + virtual TInt IntegerSettingValue( TInt aSettingItem ) const = 0; + + /** + * Returns the setting value for a specific field of a scene + * @return the setting value + * @param aSceneId specifies which scene. + * @param aSceneId specifies which field of the scene. + * @since 2.8 + */ + virtual TInt SceneSettingValue( TInt aSceneId, TInt aSceneField ) const = 0; + + /** + * Sets a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want to set the value of. + * @param aSettingValue the new integer value for the specified setting item. + * @since 2.8 + */ + virtual void SetIntegerSettingValueL( TInt aSettingItem, TInt aSettingValue ) = 0; + + /** + * Sets a new text value for the specified setting + * @param aSettingItem specifies which setting item that want to set the text value of. + * @param aSettingValue the new text value for the specified setting item. + * @since 2.8 + */ + virtual void SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ) = 0; + + /** + * Returns the current text value for the specified setting + * @return the current text setting value + * @param aSettingItem specifies which setting item that want the text value of. + * @since 2.8 + */ + virtual TPtrC TextSettingValue( TInt aSettingItem ) const = 0; + + /** + * Returns whether a particular setting value can be set or not. + * @return ETrue if can be set. Otherwise, EFalse. + * @param aSettingValue the value in question. + * @param aSettingItem the setting item in question. + * @since 2.8 + */ + virtual TBool SettingValueEnabled( TInt aSettingItem, + TInt aSettingValue ) const = 0; + + /** + * Get the default value for a setting item. + * @param aSettingId The id of the setting. + * @return The default value for setting item or KErrNotFound if not found. + */ + virtual TInt DynamicSettingDefaultValue( TInt aSettingId ) const = 0; + + /** + * Sets all dynamic settings to their defaults. + * @since 2.8 + */ + virtual void SetDynamicSettingsToDefaults() = 0; + + /** + * Sets a single dynamic setting to its default. + * @since 2.8 + */ + virtual void SetDynamicSettingToDefault(TInt aSettingItem) = 0; + + /** + * Sets a single dynamic setting to scene default value. + * @param aSceneId Scene which the default value is taken from. + * @param aSceneField Id of the setting in scene data. + * @param aSettingId Id of the setting in dynamic settings. + * @param aVideoScene Is the scene a video scene. + * @return KErrNotFound, if setting could not be set. + */ + virtual TInt SetDynamicSettingToSceneDefaultL( TInt aSceneId, + TInt aSceneField, + TInt aSettingId, + TBool aVideoScene ) = 0; + + /** + * Loads the static settings from shared data. Required to update + * the settings whenever get foreground event, in case of external + * changes to the settings. + * @since 2.8 + * @param aIsEmbedded Specifies whether the application is embedded + * or not. + */ + virtual void LoadStaticSettingsL( TBool aIsEmbedded ) = 0; + + /** + * Return handle to video quality level array + * @since 2.8 + * @return reference to array of video quality levels + */ + virtual const RPointerArray& VideoQualityArray() = 0; + + /** + * Return handle to video resolution array + * @since 2.8 + * @param return reference to array of video resolutions + */ + virtual const RArray& VideoResolutions() = 0; + + /** + * Returns the image resolution for a given resolution index. + * @since 2.8 + * @param aIndex The index to get the resolution for + * @returns The X and Y dimensions in pixels of the resolution. + */ + virtual TSize ImageResolutionFromIndex( TCamPhotoSizeId aIndex ) = 0; + + /** + * Returns the current photo quality. + * @return the quality. + * @since 2.8 + */ + virtual TInt CurrentPhotoCompression() const = 0; + + /** + * Returns the current photo resolution from Settings + * @return the resolution. + * @since 2.8 + */ + virtual TCamPhotoSizeId CurrentPhotoResolution() const = 0; + + /** + * Returns the photo resolution for a particular quality + * @return the resolution. + * @param aQualityIndex The index of the quality + * @since 3.0 + */ + virtual TCamPhotoSizeId PhotoResolution( TInt aQualityIndex ) const = 0; + + /** + * Stores the primary camera settings when changing to secondary camera + * that they can be reapplied when changing back + * @since 2.8 + */ + virtual void StorePrimaryCameraSettingsL() = 0; + + /** + * Restores the primary camera settings + * @since 2.8 + */ + virtual void RestorePrimaryCameraSettingsL() = 0; + + /** + * Return variant info. + */ + virtual const TCamVariantInfo& VariantInfo() = 0; + + /* + * Reset repository file + * @since3.0 + */ + virtual void ResetRepository() = 0; + + /** + * Store FT user defined setting + * @since 5.0 + */ + virtual void StoreFaceTrackingValue() = 0; + }; +// =========================================================================== + +#endif // MCAMSETTINGSMODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/CamCaptureSetupListBox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/CamCaptureSetupListBox.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A list box that displays settings items with radio buttons* +*/ + + +// INCLUDE FILES +#include "CamCaptureSetupListBox.h" +#include "CamCaptureSetupListBoxModel.h" +#include "CamCaptureSetupListItemDrawer.h" +#include "CamSettingValueObserver.h" +#include + +#include "CamUtility.h" + +#include + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBox::CCamCaptureSetupListBox +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamCaptureSetupListBox::CCamCaptureSetupListBox( MCamSettingValueObserver* aObserver +#ifndef CAMERAAPP_PLUGIN_BUILD + ,CCamAppController& aController +#else + ,MCamAppController& aController +#endif //CAMERAAPP_PLUGIN_BUILD + ) +: iSettingObserver( aObserver ), iController( aController ) + { + iBorder = TGulBorder::ENone; + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBox::ConstructL +// 2nd phase construction +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupListBox::ConstructL( const CCoeControl* aParent, + TInt aArrayResourceId, + TInt aSettingItem, + TInt aFlags, + TBool aShootingModeListBox, + TBool aLocationSettingListBox + ) + { + + //Constructing model + CCamCaptureSetupListBoxModel* model = + CCamCaptureSetupListBoxModel::NewLC( iController, + aArrayResourceId, + aSettingItem, + aShootingModeListBox, + aLocationSettingListBox, + Rect() + ); + CCamCaptureSetupListItemDrawer* itemDrawer = + CCamCaptureSetupListItemDrawer::NewL( *model ); + + + itemDrawer->SetParentControl( aParent ); + // CEikListBox takes ownership before anything can leave. + // Do not need the model or drawer on the stack when call ConstructL, + // because CEikListBox assigns objects as member variables before + // ConstructL calls any leaving functions. + CleanupStack::Pop( model ); + CEikListBox::ConstructL( model, itemDrawer, aParent, aFlags ); + // The number of items is fixed after the list box has been constructed + const TInt KMaxListItems = 5; // This value should come from the LAF + // Find the number of items to be displayed in the list box + iRequiredHeightInNumOfItems = Min( Model()->NumberOfItems(), KMaxListItems ); + SetItemHeightL( iItemDrawer->MinimumCellSize().iHeight ); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBox destructor +// +// --------------------------------------------------------------------------- +// +CCamCaptureSetupListBox::~CCamCaptureSetupListBox() + { + PRINT( _L("Camera => ~CCamCaptureSetupListBox") ); + PRINT( _L("Camera <= ~CCamCaptureSetupListBox") ); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBox::InitializeL +// Initialize the current and selected item in the view +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupListBox::InitializeL( TInt aCurrentValueId ) + { + TInt selectedItemIndex = + static_cast( iModel )->ValueIndex( aCurrentValueId ); + + // if the item does not exist select the topmost item + selectedItemIndex = Max( selectedItemIndex, 0 ); + if ( selectedItemIndex < iModel->NumberOfItems() ) + { + iView->SetCurrentItemIndex( selectedItemIndex ); + iView->SetDisableRedraw( ETrue ); + iView->SelectItemL( selectedItemIndex ); + iView->SetDisableRedraw( EFalse ); + } + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBox::OfferKeyEventL +// Handle key presses +// --------------------------------------------------------------------------- +// +TKeyResponse CCamCaptureSetupListBox::OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType ) + { + PRINT( _L("Camera => CCamCaptureSetupListBox::OfferKeyEventL" )) + // If the Select or navi key select button is pressed, select the current item + if ( ( aKeyEvent.iCode == EKeyOK && aKeyEvent.iRepeats == 0 && aType == EEventKey ) + || aKeyEvent.iScanCode == EStdKeyDevice0 ) + { + iView->ClearSelection(); + iView->SelectItemL( iView->CurrentItemIndex() ); + } + //TInt oldCurrentItem = CurrentItemIndex(); + TKeyResponse response = CEikListBox::OfferKeyEventL( aKeyEvent, aType ); + /*TInt newCurrentItem = CurrentItemIndex(); + if ( newCurrentItem != oldCurrentItem ) + { + PRINT( _L("Camera => CCamCaptureSetupListBox::OfferKeyEventL set obs" )) + MCamListboxModel* model = static_cast( iModel ); + iSettingObserver->HandleSettingValueUpdateL( model->ItemValue( newCurrentItem ) ); + }*/ + return response; + } + + + + + + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBox::HandlePointerEventL +// Handle pointer events +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupListBox::HandlePointerEventL(const TPointerEvent& aPointerEvent) + { + /*TInt oldCurrentItem = CurrentItemIndex(); + TInt newCurrentItem = CurrentItemIndex(); + + // listbox does default handling + CEikListBox::HandlePointerEventL(aPointerEvent); + + newCurrentItem = CurrentItemIndex(); + + // handle settings update when focus changes + if ( newCurrentItem != oldCurrentItem ) + { + MCamListboxModel* model = static_cast( iModel ); + iSettingObserver->HandleSettingValueUpdateL( model->ItemValue( newCurrentItem ) ); + + }*/ + iController.StartIdleTimer(); // standby + CEikListBox::HandlePointerEventL(aPointerEvent); + } + + +//End of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/CamCaptureSetupListBoxModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/CamCaptureSetupListBoxModel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,331 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A model class for CCamCaptureSetupListBox* +*/ + + +// INCLUDE FILES +#include +#include + +#ifndef CAMERAAPP_PLUGIN_BUILD + #include + #include +#else + #include +#endif //CAMERAAPP_PLUGIN_BUILD + +#include "CamProductSpecificSettings.hrh" +#include "CamUtility.h" +#include "camlayoututils.h" +#include "CamCaptureSetupListItem.h" +#include "CamCaptureSetupListBoxModel.h" +#include "CameraUiConfigManager.h" + +#include + + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupListBoxModel::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupListBoxModel* CCamCaptureSetupListBoxModel::NewLC( +#ifndef CAMERAAPP_PLUGIN_BUILD + CCamAppController& aController, +#else // location setting will be moved to the plugin + MCamAppController& aController, +#endif + TInt aArrayResourceId, + TInt aSettingItem, + TBool aShootingModeListBox, + TBool aLocationSettingListBox, + TRect aListBoxRect + ) + { + CCamCaptureSetupListBoxModel* self = new( ELeave ) CCamCaptureSetupListBoxModel( aController, + aShootingModeListBox, + aLocationSettingListBox + ); + + CleanupStack::PushL( self ); + self->ConstructL( aArrayResourceId, aSettingItem, aListBoxRect ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBoxModel destructor +// +// --------------------------------------------------------------------------- +// +CCamCaptureSetupListBoxModel::~CCamCaptureSetupListBoxModel() + { + PRINT( _L("Camera => ~CCamCaptureSetupListBoxModel") ); + iItemArray.ResetAndDestroy(); + iItemArray.Close(); + PRINT( _L("Camera <= ~CCamCaptureSetupListBoxModel") ); + } + +// --------------------------------------------------------- +// CCamCaptureSetupListBoxModel::NumberOfItems +// Returns number of items that are in array +// --------------------------------------------------------- +// +TInt CCamCaptureSetupListBoxModel::NumberOfItems() const + { + return iItemArray.Count(); + } + +// --------------------------------------------------------- +// CCamCaptureSetupListBoxModel::MatchableTextArray +// Returns null, no support for incremental matching +// --------------------------------------------------------- +// +const MDesCArray* CCamCaptureSetupListBoxModel::MatchableTextArray() const + { + return NULL; + } + +// --------------------------------------------------------- +// CCamCaptureSetupListBoxModel::ItemText +// Returns a pointer to the item text +// --------------------------------------------------------- +// +TPtrC CCamCaptureSetupListBoxModel::ItemText( TInt aItemIndex ) const + { + return iItemArray[ aItemIndex ]->ItemText(); + } + +// --------------------------------------------------------- +// CCamCaptureSetupListBoxModel::ItemValue +// Returns the value id of the specified item +// --------------------------------------------------------- +// +TInt CCamCaptureSetupListBoxModel::ItemValue( TInt aItemIndex ) const + { + return iItemArray[aItemIndex]->ItemValue(); + } + +// --------------------------------------------------------- +// CCamCaptureSetupListBoxModel::Bitmap +// Returns a pointer to the bitmap of the specified item +// --------------------------------------------------------- +// +CFbsBitmap* CCamCaptureSetupListBoxModel::Bitmap( TInt aItemIndex ) const + { + return iItemArray[ aItemIndex ]->Bitmap(); + } + +// --------------------------------------------------------- +// CCamCaptureSetupListBoxModel::BitmapMask +// Returns a pointer to the mask of the specified item +// --------------------------------------------------------- +// +CFbsBitmap* CCamCaptureSetupListBoxModel::BitmapMask( TInt aItemIndex ) const + { + return iItemArray[ aItemIndex ]->BitmapMask(); + } + +// --------------------------------------------------------- +// CCamCaptureSetupListBoxModel::ItemIndexFromValueId +// Returns the index of the item with a matching value id +// --------------------------------------------------------- +// +TInt CCamCaptureSetupListBoxModel::ValueIndex( TInt aValueId ) const + { + return iItemArray.Find( aValueId, CCamInfoListboxItemBase::EqualIds ); + } + +// --------------------------------------------------------- +// CCamCaptureSetupListBoxModel::ShootingModeListBox +// Returns whether the model represents a shooting mode listbox +// --------------------------------------------------------- +// +TBool CCamCaptureSetupListBoxModel::ShootingModeListBox() const + { + return iShootingModeListBox; + } + + +TAknLayoutRect CCamCaptureSetupListBoxModel::IconLayoutData() const + { + return iIconLayoutData; + } +TAknLayoutRect CCamCaptureSetupListBoxModel::RadioButtonLayoutData() const + { + return iRadioButtonLayoutData; + } +TAknLayoutText CCamCaptureSetupListBoxModel::TextLayoutData() const + { + return iTextLayoutData; + } +TAknLayoutRect CCamCaptureSetupListBoxModel::ListItemLayoutData() const + { + return iListItemLayoutData; + } +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBoxModel::CCamCaptureSetupListBoxModel +// C++ constructor +// --------------------------------------------------------------------------- +// + +CCamCaptureSetupListBoxModel::CCamCaptureSetupListBoxModel( +#ifndef CAMERAAPP_PLUGIN_BUILD + CCamAppController& aController, +#else // location setting will be moved to the plugin + MCamAppController& aController, +#endif + TBool aShootingModeListBox, + TBool aLocationSettingListBox + ) +: iController( aController ), iShootingModeListBox ( aShootingModeListBox ), + iLocationSettingListBox ( aLocationSettingListBox ) + { + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBoxModel::ConstructL +// 2nd phase construction +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupListBoxModel::ConstructL( TInt aArrayResourceId, TInt aSettingItem, TRect aListBoxRect ) + { + ReadLayoutData( aListBoxRect ); + + // create array from resource + TResourceReader reader; + CEikonEnv::Static()->CreateResourceReaderLC( reader, aArrayResourceId ); + const TInt count = reader.ReadInt16(); + +#ifndef CAMERAAPP_PLUGIN_BUILD + iSupportedFlashModes = iController.SupportedFlashModes(); + iSupportedWBModes = iController.SupportedWBModes(); +#endif //CAMERAAPP_PLUGIN_BUILD + + // for each entry in the resource array, create a new list item + for ( TInt i = 0; i < count; i++ ) + { + CCamCaptureSetupListItem* listItem = + CCamCaptureSetupListItem::NewLC( reader, iIconLayoutData ); + + if( SettingValueSupportedL( listItem, aSettingItem ) ) + { + iItemArray.AppendL( listItem ); + } + + CleanupStack::Pop( listItem ); + } + CleanupStack::PopAndDestroy(); // reader + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBoxModel::ReadLayoutData +// Read in layout data from resource +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupListBoxModel::ReadLayoutData( TRect aListBoxRect ) + { + if ( CamUtility::IsNhdDevice() ) + { + iIconLayoutData.LayoutRect( aListBoxRect, + AknLayoutScalable_Apps::cset_list_set_pane_g3( 0 ) ); + iRadioButtonLayoutData.LayoutRect( aListBoxRect, + AknLayoutScalable_Apps::cset_list_set_pane_g1( 0 ) ); + iListItemLayoutData.LayoutRect( aListBoxRect, + AknLayoutScalable_Apps::cset_list_set_pane( 0 ) ); + } + else + { + TRect mnPane; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mnPane ); + TAknLayoutRect listLayoutRect; + listLayoutRect.LayoutRect( mnPane, + AknLayoutScalable_Apps::main_cset6_listscroll_pane( 4 ) ); + iIconLayoutData.LayoutRect( listLayoutRect.Rect(), + AknLayoutScalable_Apps::cset_list_set_pane_g3_copy1( 0 ) ); + iRadioButtonLayoutData.LayoutRect( listLayoutRect.Rect(), + AknLayoutScalable_Apps::cset_list_set_pane_g1_copy1( 0 ) ); + TAknWindowLineLayout l = AknLayoutScalable_Apps::cset_list_set_pane_copy1( 0 ); + if( !l.iH ) + { + l.iH = 73; // TODO Temporarily defined! + } + iListItemLayoutData.LayoutRect( listLayoutRect.Rect(), l ); + } + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListBoxModel::SettingValueSupportedL +// --------------------------------------------------------------------------- +// +TBool +CCamCaptureSetupListBoxModel::SettingValueSupportedL( CCamInfoListboxItemBase* aItem, TInt aSettingItem ) + { + TBool supported = EFalse; + TBool checkConfiguredItems = ETrue; + TInt val = aItem->ItemValue(); + + CCameraUiConfigManager* dynamicSettings = iController.UiConfigManagerPtr(); + RArray supportedItems; + CleanupClosePushL( supportedItems ); + supportedItems.Reset(); + + // just for flash to start with + if( aSettingItem == ECamSettingItemDynamicPhotoFlash ) + { +#ifndef CAMERAAPP_PLUGIN_BUILD + if ( dynamicSettings ) + { + dynamicSettings->SupportedFlashModeSettingsL( supportedItems ); + } +#endif //CAMERAAPP_PLUGIN_BUILD + } + else if( ECamSettingItemDynamicPhotoWhiteBalance == aSettingItem || + ECamSettingItemDynamicVideoWhiteBalance == aSettingItem ) + { +#ifndef CAMERAAPP_PLUGIN_BUILD + if ( dynamicSettings ) + { + dynamicSettings->SupportedWhiteBalanceSettingsL( supportedItems ); + } +#endif //CAMERAAPP_PLUGIN_BUILD + } + else if ( ECamSettingItemDynamicPhotoColourFilter == aSettingItem || + ECamSettingItemDynamicVideoColourFilter == aSettingItem ) + { +#ifndef CAMERAAPP_PLUGIN_BUILD + if ( dynamicSettings ) + { + dynamicSettings->SupportedColorToneSettingsL( supportedItems ); + } +#endif //CAMERAAPP_PLUGIN_BUILD + } + else + { + checkConfiguredItems = EFalse; + supported = ETrue; + } + + if ( checkConfiguredItems && supportedItems.Count() > 0 ) + { + supported = KErrNotFound != supportedItems.Find( val ); + } + + CleanupStack::PopAndDestroy( &supportedItems ); + return supported; + } +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/CamCaptureSetupListItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/CamCaptureSetupListItem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A list box item with text and a bitmap +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* +* +*/ + + +// INCLUDE FILES +#include "CamCaptureSetupListItem.h" +#include "CamUtility.h" +#include "camlogging.h" +#include // For CCoeAppUiBase +#include // For CEikApplication +#include +#include +#include +#include +// CONSTANTS + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupListItem::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupListItem* +CCamCaptureSetupListItem::NewLC( TResourceReader& aReader, + TAknLayoutRect& aIconLayout ) + { + CCamCaptureSetupListItem* self = + new( ELeave ) CCamCaptureSetupListItem( aIconLayout ); + CleanupStack::PushL( self ); + self->ConstructFromResourceL( aReader ); + return self; + } + +// ----------------------------------------------------------------------------- +// NewLC +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupListItem* +CCamCaptureSetupListItem::NewLC( + const TDesC& aItemText, + TInt aSettingId, + TInt aBitmapId, + TAknLayoutRect aIconLayout ) + { + CCamCaptureSetupListItem* self = + new( ELeave ) CCamCaptureSetupListItem( aIconLayout ); + CleanupStack::PushL( self ); + self->ConstructFromValuesL( aItemText, aSettingId, aBitmapId ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListItem::CCamCaptureSetupListItem +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamCaptureSetupListItem::CCamCaptureSetupListItem( TAknLayoutRect& aLayoutRect ) +: iIconLayout( aLayoutRect ) + { + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListItem::ConstructFromResourceL +// Extract the data from aReader to populate data members +// --------------------------------------------------------------------------- +// +void +CCamCaptureSetupListItem::ConstructFromResourceL( TResourceReader& aReader ) + { + // iListItemText = aReader.ReadTPtrC(); + iListItemText = aReader.ReadTPtrC().AllocL(); + iSettingItemValueId = aReader.ReadInt16(); + iBitmapId = aReader.ReadInt32(); + + ConstructL(); + } + + +// --------------------------------------------------------------------------- +// Construct the item from given data +// --------------------------------------------------------------------------- +// +void +CCamCaptureSetupListItem::ConstructFromValuesL( const TDesC& aItemText, + TInt aSettingId, + TInt aBitmapId ) + { + iListItemText = aItemText.AllocL(); + iSettingItemValueId = aSettingId; + iBitmapId = aBitmapId; + + ConstructL(); + } +// --------------------------------------------------------------------------- +// CCamCaptureSetupListItem::ConstructL +// Second phase construction +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupListItem::ConstructL() + { + if ( iBitmapId != KErrNotFound ) + { + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + + AknIconUtils::CreateIconL( iBitmap, iBitmapMask, resname, iBitmapId, iBitmapId ); + AknIconUtils::SetSize( iBitmap, TSize( iIconLayout.Rect().Width(), iIconLayout.Rect().Height() ) ); + } + } + + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CCamCaptureSetupListItem::~CCamCaptureSetupListItem() + { + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/CamCaptureSetupListItemDrawer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/CamCaptureSetupListItemDrawer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,565 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A drawer class for the capture setup list box items* +*/ + + + +// INCLUDE FILES +#include // For CCoeAppUiBase +#include // For CEikApplication +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // list_highlight_pane_g1_cp1 + +#include +#ifndef CAMERAAPP_PLUGIN_BUILD + #include + #include +#else + #include +#endif //CAMERAAPP_PLUGIN_BUILD + + +#include "CamCaptureSetupListItemDrawer.h" +#include "CamCaptureSetupListBoxModel.h" +#include "CamUtility.h" +#include "camlogging.h" + +#include + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST +#include +#include +#endif //RD_UI_TRANSITION_EFFECTS_LIST + +// CONSTANTS +static const TInt KRadioButtonSelectedIconIndex = 0; +static const TInt KRadioButtonUnselectedIconIndex = 1; + + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupListItemDrawer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupListItemDrawer* +CCamCaptureSetupListItemDrawer::NewL( MCamListboxModel& aListBoxModel ) + { + CCamCaptureSetupListItemDrawer* self = new( ELeave ) + CCamCaptureSetupListItemDrawer( aListBoxModel ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupListItemDrawer Destructor +// +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupListItemDrawer::~CCamCaptureSetupListItemDrawer() + { + PRINT( _L("Camera => ~CCamCaptureSetupListItemDrawer") ); + if ( iRadioButtonIconArray ) + { + delete iRadioButtonIconArray; + iRadioButtonIconArray = NULL; + } + PRINT( _L("Camera <= ~CCamCaptureSetupListItemDrawer") ); + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupListItemDrawer::CCamCaptureSetupListItemDrawer +// C++ constructor +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupListItemDrawer +::CCamCaptureSetupListItemDrawer( MCamListboxModel& aListBoxModel ) + : iModel( aListBoxModel ) + { + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListItemDrawer::ConstructL +// 2nd phase construction +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupListItemDrawer::ConstructL() + { + + + iCaptureSetupItemHeight = iModel.ListItemLayoutData().Rect().Height(); + + + const TInt KIconArrayGranularity = 4; + iRadioButtonIconArray = + new( ELeave ) CAknIconArray( KIconArrayGranularity ); + TResourceReader reader; + + CCoeEnv::Static()->CreateResourceReaderLC(reader, R_AVKON_SETTING_PAGE_RADIOBUTTON_ICONS); + + reader.ReadInt16(); //not needed, simple or complex + + HBufC* bmpFile = reader.ReadHBufCL(); + TInt count = reader.ReadInt16(); // count + + TInt32 bmpSelected = reader.ReadInt32(); + TInt32 bmpSelectedM = reader.ReadInt32(); + TInt32 bmp = reader.ReadInt32(); + TInt32 bmpM = reader.ReadInt32(); + CleanupStack::PopAndDestroy(); // reader + + CleanupStack::PushL(bmpFile); + + // create normally colored icons + CreateIconAndAddToArrayL( iRadioButtonIconArray, + KAknsIIDQgnIndiRadiobuttOn, + EAknsCIQsnIconColorsCG14, + *bmpFile, + bmpSelected, + bmpSelectedM ); + + CreateIconAndAddToArrayL( iRadioButtonIconArray, + KAknsIIDQgnIndiRadiobuttOff, + EAknsCIQsnIconColorsCG14, + *bmpFile, + bmp, + bmpM ); + + // create highlight colored icons + CreateIconAndAddToArrayL( iRadioButtonIconArray, + KAknsIIDQgnIndiRadiobuttOn, + EAknsCIQsnIconColorsCG18, + *bmpFile, + bmpSelected, + bmpSelectedM ); + + CreateIconAndAddToArrayL( iRadioButtonIconArray, + KAknsIIDQgnIndiRadiobuttOff, + EAknsCIQsnIconColorsCG18, + *bmpFile, + bmp, + bmpM ); + + const TSize radioButtonRectSize = + TSize( iModel.RadioButtonLayoutData().Rect().Width(), + iModel.RadioButtonLayoutData().Rect().Height() ); + AknIconUtils::SetSize( + iRadioButtonIconArray->At( KRadioButtonSelectedIconIndex )->Bitmap(), + radioButtonRectSize ); + AknIconUtils::SetSize( + iRadioButtonIconArray->At( KRadioButtonUnselectedIconIndex )->Bitmap(), + radioButtonRectSize ); + + + ReadLayout(); + + CleanupStack::PopAndDestroy(); // bmpfile + + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListItemDrawer::MinimumCellSize +// Calculate the minimum size of a cell +// --------------------------------------------------------------------------- +// +TSize +CCamCaptureSetupListItemDrawer::MinimumCellSize() const + { + PRINT( _L("Camera => CCamCaptureSetupListItemDrawer::MinimumCellSize") ); + + TSize cellSize; + cellSize.iWidth = iModel.ListItemLayoutData().Rect().Width(); + cellSize.iHeight = iModel.ListItemLayoutData().Rect().Height(); + + + PRINT2( _L("Camera => CCamCaptureSetupListItemDrawer::MinimumCellSize, return (%d x %d)"), cellSize.iWidth, cellSize.iHeight ); + return cellSize; + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListItemDrawer::DrawActualItem +// Draw the highlight, bitmap, radio button and item text. +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupListItemDrawer::DrawActualItem( TInt aItemIndex, + const TRect& aActualItemRect, + TBool aItemIsCurrent, + TBool /*aViewIsEmphasized*/, + TBool /*aViewIsDimmed*/, + TBool aItemIsSelected ) const + { + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( iGc ); + if ( transApi ) + { + transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); + } +#endif // RD_UI_TRANSITION_EFFECTS_LIST + // Draw unhighlighted rectangle that encapsulates the item text and bitmap. + DrawItemRect( aActualItemRect ); + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->StopDrawing(); + } +#endif // RD_UI_TRANSITION_EFFECTS_LIST + // If this item is currently selected, draw highlight + if ( aItemIsCurrent ) + { + DrawHighlight( aActualItemRect ); + } + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->StartDrawing( MAknListBoxTfxInternal::EListItem ); + } +#endif // RD_UI_TRANSITION_EFFECTS_LIST + // Determine drawing colour for text and radio buttons, from current skin + // ...text colour index if this item is not selected. + TRgb color; + TAknsQsnTextColorsIndex index = EAknsCIQsnTextColorsCG7; + // ...text colour index if this item is selected. + if( Flags() & CListItemDrawer::ESingleClickDisabledHighlight ) + { + aItemIsSelected = aItemIsCurrent; + aItemIsCurrent = EFalse; + } + + if ( aItemIsCurrent ) + { + index = EAknsCIQsnTextColorsCG10; // highlighted text colour + } + + // ...get colour from current skin for text colour index + MAknsSkinInstance *skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, index ); + + // ...make sure text/bitmap background colour does not overwrite skin background colour + iGc->SetBrushStyle( CGraphicsContext::ENullBrush ); + + if ( !iModel.ShootingModeListBox() ) + { + + // Draw text + // ...Create a text layout object for drawing the text + // ...inside of the list item's rectangle + TAknLayoutText layoutText; + layoutText.LayoutText( aActualItemRect, iTxtLayout ); + // ...Pass the text to be drawn, into the text layout object + // ...and draw it. + layoutText.DrawText( *iGc, iModel.ItemText( aItemIndex ), + ETrue, color ); + // Draw the bitmap. + // ...Create a rect layout object for drawing the bitmap + // ...inside of the list item's rectangle. + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( aActualItemRect, iBmpLayout ); + // ...Pass the bitmap to be drawn, into the rect layout object + // ...and draw it. + CFbsBitmap* bitmap = iModel.Bitmap( aItemIndex ); + // if the item has a bitmap + if ( bitmap ) + { + CFbsBitmap* bitmapMask = iModel.BitmapMask( aItemIndex ); + layoutRect.DrawImage( *iGc, bitmap, bitmapMask ); + } + + + DrawRadioButton( aActualItemRect, aItemIsSelected, color ); + } + else + { + // draw without radiobuttons + + // Draw text + // ...Create a text layout object for drawing the text + // ...inside of the list item's rectangle + TAknLayoutText layoutText; + layoutText.LayoutText( aActualItemRect, iTxtWithRbLayout ); + // ...Pass the text to be drawn, into the text layout object + // ...and draw it. + layoutText.DrawText( *iGc, iModel.ItemText( aItemIndex ), ETrue, color ); + + // Draw the bitmap. + // ...Create a rect layout object for drawing the bitmap + // ...inside of the list item's rectangle. + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( aActualItemRect, iBmpWithRbLayout ); + // ...Pass the bitmap to be drawn, into the rect layout object + // ...and draw it. + CFbsBitmap* bitmap = iModel.Bitmap( aItemIndex ); + // if the item has a bitmap + if ( bitmap ) + { + CFbsBitmap* bitmapMask = iModel.BitmapMask( aItemIndex ); + layoutRect.DrawImage( *iGc, bitmap, bitmapMask ); + } + + + } +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->StopDrawing(); + } +#endif //RD_UI_TRANSITION_EFFECTS_LIST + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListItemDrawer::DrawHighlight +// Draw the highlight as a bitmap before any other part of the item +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupListItemDrawer::DrawHighlight( const TRect& aActualItemRect ) const + { + if( Flags() & CListItemDrawer::ESingleClickDisabledHighlight ) + { + return; + } + +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( iGc ); + if ( transApi ) + { + transApi->BeginRedraw( MAknListBoxTfxInternal::EListHighlight, aActualItemRect ); + transApi->StartDrawing( MAknListBoxTfxInternal::EListHighlight ); + } +#endif //RD_UI_TRANSITION_EFFECTS_LIST + TAknLayoutRect highlightRectLayout; + highlightRectLayout.LayoutRect( aActualItemRect, iHighlightLayout ); + //highlightRectLayout.DrawOutLineRect(*iGc); + TRect highlightRect( highlightRectLayout.Rect() ); + + + + + // Draw highlight using the same highlight that is used for the Avkon settings list radio controls. + MAknsSkinInstance *skin = AknsUtils::SkinInstance(); + //TBool highlightDrawn = EFalse; + + TAknLayoutRect innerHighlightLayRect; + innerHighlightLayRect.LayoutRect( highlightRect, + AknLayoutScalable_Avkon::list_highlight_pane_g1_cp1() ); + + //highlightDrawn = + if ( Flags()&EPressedDownState ) + { + // This handles the darker pressed down highlights + AknsDrawUtils::DrawFrame( skin, + *iGc, + highlightRect, + innerHighlightLayRect.Rect(), + KAknsIIDQsnFrListPressed, + KAknsIIDQsnFrListCenterPressed ); + } + else + { + AknsDrawUtils::DrawFrame( skin, + *iGc, + highlightRect, + innerHighlightLayRect.Rect(), + KAknsIIDQsnFrList, //KAknsIIDQsnFrSetOptFoc other option? + KAknsIIDDefault ); + + } + + //(void)highlightDrawn; // avoid compiler warning + /* + // if the highlight has not be drawn + if ( !highlightDrawn ) + { + TAknLayoutRect highlightshadow; + TAknLayoutRect highlight; + highlightshadow.LayoutRect( highlightRect, + AKN_LAYOUT_WINDOW_List_pane_highlight_graphics__various__Line_1( highlightRect ) ); + highlight.LayoutRect( highlightRect, + AKN_LAYOUT_WINDOW_List_pane_highlight_graphics__various__Line_2( highlightRect ) ); + highlightshadow.DrawRect( *iGc ); + highlight.DrawRect( *iGc ); + } + */ +#ifdef RD_UI_TRANSITION_EFFECTS_LIST + if ( transApi ) + { + transApi->StopDrawing(); + transApi->EndRedraw( MAknListBoxTfxInternal::EListHighlight ); + } +#endif // RD_UI_TRANSITION_EFFECTS_LIST + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListItemDrawer::DrawRadioButton +// Draw the radio button +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupListItemDrawer::DrawRadioButton( const TRect& aActualItemRect, + TBool aItemIsSelected, const TRgb& /*aColor*/ ) const + { + PRINT( _L("Camera => CCamCaptureSetupListItemDrawer::DrawRadioButton")) + + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( aActualItemRect, AknLayoutScalable_Apps::cset_list_set_pane_g1( 0 ) ); + + // Pass the bitmap to be drawn into the rect layout object, and draw it + TInt index; + if (aItemIsSelected) + { + index = KRadioButtonSelectedIconIndex; + } + else + { + index = KRadioButtonUnselectedIconIndex; + } + + layoutRect.DrawImage( *iGc, + iRadioButtonIconArray->At(index)->Bitmap(), + iRadioButtonIconArray->At(index)->Mask() ); + + } + + +// --------------------------------------------------------- +// CCamCaptureSetupListItemDrawer::DrawItemRect +// Draws a rectangle for an item. +// --------------------------------------------------------- +// +void CCamCaptureSetupListItemDrawer::DrawItemRect( + const TRect& aActualItemRect ) // the rectangular area to be drawn + const + { + + /* + iGc->SetBrushColor( AKN_LAF_COLOR_STATIC(0) ); + iGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + iGc->SetPenStyle( CGraphicsContext::ENullPen ); + iGc->DrawRect( aActualItemRect ); + + */ + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + const CCoeControl* control = iParentControl; + MAknsControlContext* cc = AknsDrawUtils::ControlContext( control ); + + TBool bgDrawn( EFalse ); + if ( control ) + { + bgDrawn = AknsDrawUtils::Background( + skin, cc, control, *iGc, aActualItemRect, + KAknsDrawParamNoClearUnderImage | + KAknsDrawParamBottomLevelRGBOnly ); + } + + if ( !bgDrawn ) + { + iGc->Clear( aActualItemRect ); + } + + + /* + // Draw background to be the same colour as that for the Avkon settings list radio controls. + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); +// AknsDrawUtils::DrawCachedImage(skin, *iGc, aActualItemRect, KAknsIIDQsnFrSetOpt); + AknsDrawUtils::DrawCachedImage(skin, *iGc, aActualItemRect, KAknsIIDQsnBgScreenMp); +*/ + + } + +// --------------------------------------------------------- +// CCamCaptureSetupListItemDrawer::SetControl +// Sets the parent control of the listbox +// --------------------------------------------------------- +// +void CCamCaptureSetupListItemDrawer::SetParentControl( + const CCoeControl* aControl ) + { + iParentControl = aControl; + } + +// --------------------------------------------------------- +// CCamCaptureSetupListItemDrawer::ReadLayout +// --------------------------------------------------------- +// +void CCamCaptureSetupListItemDrawer::ReadLayout() + { + if ( CamUtility::IsNhdDevice() ) + { + iTxtLayout = AknLayoutScalable_Apps::cset_list_set_pane_t1( 0 ); + iBmpLayout = AknLayoutScalable_Apps::cset_list_set_pane_g3( 0 ); + iTxtWithRbLayout = AknLayoutScalable_Apps::cset_list_set_pane_t1( 1 ); + iBmpWithRbLayout = AknLayoutScalable_Apps::cset_list_set_pane_g3( 1 ); + iHighlightLayout = + AknLayoutScalable_Apps::list_highlight_pane_cp021( 0 ); + } + else + { + iTxtLayout = AknLayoutScalable_Apps::cset_list_set_pane_t1_copy1( 0 ); + iBmpLayout = AknLayoutScalable_Apps::cset_list_set_pane_g3_copy1( 0 ); + iTxtWithRbLayout = + AknLayoutScalable_Apps::cset_list_set_pane_t1_copy1( 1 ); + iBmpWithRbLayout = + AknLayoutScalable_Apps::cset_list_set_pane_g3_copy1( 1 ); + iHighlightLayout = + AknLayoutScalable_Apps::list_highlight_pane_cp021_copy1( 0 ); + } + } + +void CCamCaptureSetupListItemDrawer::CreateIconAndAddToArrayL( + CArrayPtr*& aIconArray, + const TAknsItemID& aId, + const TInt aColorIndex, + const TDesC& aBmpFile, + const TInt32 aBmp, + const TInt32 aBmpM ) + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + CFbsBitmap* bitmap = 0; + CFbsBitmap* mask = 0; + + AknsUtils::CreateColorIconLC( skin, + aId, + KAknsIIDQsnIconColors, + aColorIndex, + bitmap, + mask, + aBmpFile, + aBmp, + aBmpM, + KRgbBlack ); + + CGulIcon* gulicon = CGulIcon::NewL( bitmap, mask ); // ownership passed + CleanupStack::PushL( gulicon ); + + aIconArray->AppendL( gulicon ); + CleanupStack::Pop( 3 ); // mask, bitmap, gulicon + } + +//End of file + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/CamCollectionManagerAo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/CamCollectionManagerAo.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,274 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Collection Manager asynchronous operation +* + + Copyright (c) 2007 Nokia Corporation. +* This material, including documentation and any related +* computer programs, is protected by copyright controlled by +* Nokia Corporation. All rights are reserved. Copying, +* including reproducing, storing, adapting or translating, any +* or all of this material requires the prior written consent of +* Nokia Corporation. This material also contains confidential +* information which may not be disclosed to others without the +* prior written consent of Nokia Corporation. +* +* +*/ + + +#include "CamCollectionManagerAo.h" +#include +#include +#include "MCamAddToAlbumObserver.h" +#include "CamLogger.h" +#include "Cam.hrh" +#include "CamUtility.h" + + +// --------------------------------------------------------------------------- +// CCamCollectionManagerAO::CCamCollectionManagerAO() +// --------------------------------------------------------------------------- +// +CCamCollectionManagerAO::CCamCollectionManagerAO( MCamAddToAlbumObserver& aObserver ) +:CActive(EPriorityStandard),iObserver(aObserver) + { + CActiveScheduler::Add(this); + } + + +// --------------------------------------------------------------------------- +// CCamCollectionManagerAO::~CCamCollectionManagerAO() +// --------------------------------------------------------------------------- +// +CCamCollectionManagerAO::~CCamCollectionManagerAO() + { + Cancel(); + if ( iCollectionManager ) + { + delete iCollectionManager; + iCollectionManager = NULL; + } + if ( iCollectionInfo ) + { + delete iCollectionInfo; + iCollectionInfo = NULL; + } + iSelectedAlbumIds.Close(); + } + +// --------------------------------------------------------------------------- +// CCamCollectionManagerAO::StartAddtoAlbumOperationL +// +// Initiates Callback Mechanism for adding Images/Videos to albums +// --------------------------------------------------------------------------- +// +void CCamCollectionManagerAO::StartCallBackAddToAlbumL( + const RArray& aSelectedAlbumIds, + const TDesC& aUri + ) + { + PRINT( _L("Camera => CCamCollectionManagerAO::StartCallBackAddToAlbumL") ); + PRINT( _L("Camera <> CCamCollectionManagerAO::StartCallBackAddToAlbumL ... Calling CGlxCollectionManager::NewL()") ); + if (!iCollectionManager) + { + iCollectionManager = CGlxCollectionManager::NewL(); + } + PRINT( _L("Camera <> CCamCollectionManagerAO::StartCallBackAddToAlbumL ... CGlxCollectionManager::NewL() Success ") ); + iUri = aUri; + iSelectedAlbumIds.Reset(); + + for ( TInt i = 0; i < aSelectedAlbumIds.Count(); i++ ) + { + iSelectedAlbumIds.AppendL( aSelectedAlbumIds[i] ); + } + iCurrentAlbumIndex = 0; + PRINT( _L("Camera <> CCamCollectionManagerAO::StartCallBackAddToAlbumL ... Calling iCollectionManager->AddToCollectionL()") ); + iCollectionManager->AddToCollectionL( + aUri, + aSelectedAlbumIds[iCurrentAlbumIndex], + iStatus ); + PRINT( _L("Camera <> CCamCollectionManagerAO::StartCallBackAddToAlbumL ... iCollectionManager->AddToCollectionL() : Success") ); + iCurrentAlbumIndex++; + iAddToAlbum = ETrue; + SetActive(); + PRINT( _L("Camera <= CCamCollectionManagerAO::StartCallBackAddToAlbumL") ); + } + + + +// --------------------------------------------------------------------------- +// CCamCollectionManagerAO::CheckForAlbumExistenceL +// +// Initiates Callback Mechanism for checking if the album really exists +// --------------------------------------------------------------------------- +// +void CCamCollectionManagerAO::CheckForAlbumExistenceL( + const TUint32 aDefaultAlbumId ) + { + PRINT( _L("Camera => CCamCollectionManagerAO::CheckForAlbumExistenceL") ); + if (!iCollectionManager) + { + iCollectionManager = CGlxCollectionManager::NewL(); + } + if ( iCollectionInfo ) + { + delete iCollectionInfo; + iCollectionInfo = NULL; + } + iCollectionInfo = CGlxCollectionInfo::NewL( aDefaultAlbumId ); + iCollectionManager->CollectionInfoL( *iCollectionInfo, iStatus ); + iCheckForAlbum = ETrue; + SetActive(); + PRINT( _L("Camera <= CCamCollectionManagerAO::CheckForAlbumExistenceL") ); + } + +// --------------------------------------------------------------------------- +// CCamCollectionManagerAO::RunL() +// --------------------------------------------------------------------------- +// +void CCamCollectionManagerAO::RunL() + { + PRINT( _L("Camera => CCamCollectionManagerAO::RunL") ); + if ( iAddToAlbum ) + { + iAddToAlbum = EFalse; + if ( iStatus.Int() == KErrNone) + { + PRINT( _L("Camera <> CCamCollectionManagerAO::RunL() Finalizing") ); + DoAddToAlbumOperationL(); + } + else + { + // if there is any error, we pass and handle there + PRINT( _L("Camera <> CCamCollectionManagerAO::RunL() add to album has problems") ); + RunError( iStatus.Int() ); + } + } + else if ( iCheckForAlbum ) + { + iCheckForAlbum = EFalse; + if ( iStatus.Int() == KErrNone) + { + DoCheckAlbumOperationCompleteL(); + } + else + { + // if there is any error, we pass and handle there + RunError( iStatus.Int() ); + } + } + else + { + // Handling special cases if any + } + PRINT( _L("Camera <= CCamCollectionManagerAO::RunL") ); + } + + +// --------------------------------------------------------------------------- +// CCamCollectionManagerAO::DoAddToAlbumOperationL() +// --------------------------------------------------------------------------- +// +void CCamCollectionManagerAO::DoAddToAlbumOperationL() + { + PRINT( _L("Camera => CCamCollectionManagerAO::DoAddToAlbumOperationL") ); + PRINT1( _L("Camera <> CCamCollectionManagerAO::DoAddToAlbumOperationL ... iCurrentAlbumIndex (%d)"), iCurrentAlbumIndex ) + PRINT1( _L("Camera <> CCamCollectionManagerAO::DoAddToAlbumOperationL ... iSelectedAlbumIds.Count() (%d)"), iSelectedAlbumIds.Count() ) + if ( iCurrentAlbumIndex < iSelectedAlbumIds.Count() ) + { + PRINT( _L("Camera <> CCamCollectionManagerAO::DoAddToAlbumOperationL ... Enters If Loop") ); + iCollectionManager->AddToCollectionL( + iUri, + iSelectedAlbumIds[iCurrentAlbumIndex], + iStatus ); + iCurrentAlbumIndex++; + iAddToAlbum = ETrue; + SetActive(); + } + else + { + PRINT( _L("Camera <> CCamCollectionManagerAO::DoAddToAlbumOperationL ... Enters Else Loop") ); + iAddToAlbum = EFalse; + iSelectedAlbumIds.Reset(); + iObserver.AddToAlbumIdOperationComplete(); + } + PRINT1( _L("Camera <= CCamCollectionManagerAO::DoAddToAlbumOperationL ... Before leaving iCurrentAlbumIndex (%d)"), iCurrentAlbumIndex ) + } + + + +// --------------------------------------------------------------------------- +// CCamCollectionManagerAO::CheckAlbumOperationComplete +// --------------------------------------------------------------------------- +// +void CCamCollectionManagerAO::DoCheckAlbumOperationCompleteL() + { + PRINT( _L("Camera => CCamCollectionManagerAO::DoCheckAlbumOperationCompleteL") ); + if ( iCollectionInfo ) + { + iObserver.CheckAlbumIdOperationCompleteL( iCollectionInfo->Exists(), + iCollectionInfo->Title() ); + } + PRINT( _L("Camera <= CCamCollectionManagerAO::DoCheckAlbumOperationCompleteL") ); + } + + +// --------------------------------------------------------------------------- +// CCamCollectionManagerAO::DoCancel() +// +// Cancels the active object +// --------------------------------------------------------------------------- +// +void CCamCollectionManagerAO::DoCancel() + { + PRINT( _L("Camera => CCamCollectionManagerAO::DoCancel") ); + if ( iCollectionManager ) + { + iCollectionManager->Cancel(); + } + iSelectedAlbumIds.Reset(); + PRINT( _L("Camera <= CCamCollectionManagerAO::DoCancel") ); + } + + +// --------------------------------------------------------------------------- +// CCamCollectionManagerAO::RunError() +// +// Handles all leaves and its safe to handle them in this method +// --------------------------------------------------------------------------- +// +TInt CCamCollectionManagerAO::RunError( TInt /*aError*/ ) + { + PRINT( _L("Camera => CCamCollectionManagerAO::RunError") ); + // We make sure that if any error occurs, we cancel, + // the ongoing request and delete all the pointers + // so that no memory leaks occurs + if ( iCollectionManager ) + { + delete iCollectionManager; + iCollectionManager = NULL; + } + if ( iCollectionInfo ) + { + delete iCollectionInfo; + iCollectionManager = NULL; + } + iSelectedAlbumIds.Reset(); + + PRINT( _L("Camera <= CCamCollectionManagerAO::RunError") ); + return KErrNone; + } + +//End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/CamPanic.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/CamPanic.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Panic function for the Camera Application* +*/ + + + +// INCLUDE FILES +#include "CamPanic.h" + +GLDEF_C void CamPanic( TCameraPanic aReason ) + { + _LIT( KCategoryCamera, "Camera" ); + User::Panic( KCategoryCamera, aReason ); + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/CamStaticSettingsModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/CamStaticSettingsModel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1226 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Manages all static settings data.* +*/ + + + +// =========================================================================== +// Includes + +#include +#include +#include +#include +#ifndef CAMERAAPP_PLUGIN_BUILD +#include +#include +#include "camsettingconversion.h" +#else +#include +#endif + +#include "CamStaticSettingsModel.h" +#include "CamUtility.h" +#include "CamPanic.h" +#include "CamAppUiBase.h" +#include "CamVideoQualityLevel.h" +#include "CameraappPrivateCRKeys.h" // CR keys +#include "CameraUiConfigManager.h" +#include "camconfiguration.h" + + +// =========================================================================== +// Constants + +const TInt KCamCRStringInitialLength = 64; +const TInt KCamUseDefaultVideoQuality = -1; + +// =========================================================================== +// Local methods + +inline TBool SettingIdMatches( const TInt* aSettingId, + const TIntSetting& aSettingItem ) + { + return (*aSettingId == aSettingItem.iItemId); + }; + + +// =========================================================================== +// Class methods + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamStaticSettingsModel* +CCamStaticSettingsModel::NewL( CCamConfiguration& aConfiguration ) + { + CCamStaticSettingsModel* self + = CCamStaticSettingsModel::NewLC( aConfiguration ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamStaticSettingsModel* +CCamStaticSettingsModel::NewLC( CCamConfiguration& aConfiguration ) + { + CCamStaticSettingsModel* self + = new( ELeave ) CCamStaticSettingsModel( aConfiguration ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::IntegerSettingValue +// Returns the current integer value for the specified setting +// --------------------------------------------------------------------------- +// +TInt +CCamStaticSettingsModel::IntegerSettingValue( TInt aSettingItem ) const + { + TInt value = KErrNotFound; + // If setting item is in the static photo settings return it's value. + if( ECamSettingItemStaticPhotoRangeMax > aSettingItem + && ECamSettingItemStaticPhotoRangeMin < aSettingItem ) + { + TInt settingIndex = SearchInSettingsListFor( + iStaticPhotoIntSettings, + aSettingItem ); + value = iStaticPhotoIntSettings[settingIndex]->iValueId; + } + // Otherwise, if setting item is in the static video settings return it's value. + else if( ECamSettingItemStaticVideoRangeMax > aSettingItem + && ECamSettingItemStaticVideoRangeMin < aSettingItem ) + { + TInt settingIndex = SearchInSettingsListFor( iStaticVideoIntSettings, aSettingItem ); + value = iStaticVideoIntSettings[settingIndex]->iValueId; + } + // Look in static common settings. + else if( ECamSettingItemStaticCommonRangeMax > aSettingItem + && ECamSettingItemStaticCommonRangeMin < aSettingItem ) + { + TInt settingIndex = SearchInSettingsListFor( iStaticCommonIntSettings, aSettingItem ); + value = iStaticCommonIntSettings[settingIndex]->iValueId; + } + else + { + PRINT( _L("Camera <> Not found, PANIC !! ECamPanicUnknownSettingItem" )) + CamPanic( ECamPanicUnknownSettingItem ); + } + return value; + } + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::SetIntegerSettingValueL +// Sets a new integer value for the specified setting +// --------------------------------------------------------------------------- +// +void +CCamStaticSettingsModel::SetIntegerSettingValueL( TInt aSettingItem, + TInt aSettingValue ) + { + TCamSettingItemIds settingId( + static_cast(aSettingItem) ); + + // Static image settings + if( ECamSettingItemStaticPhotoRangeMin < settingId + && ECamSettingItemStaticPhotoRangeMax > settingId ) + { + PRINT( _L("Camera <> static photo setting") ); + TInt settingIndex = SearchInSettingsListFor( iStaticPhotoIntSettings, settingId ); + iStaticPhotoIntSettings[settingIndex]->iValueId = aSettingValue; + SaveStaticSettingL( settingId ); + + // Video / photo storage settings follow eachother + if ( ECamSettingItemPhotoMediaStorage == settingId ) + { + TInt index = SearchInSettingsListFor( iStaticVideoIntSettings, + ECamSettingItemVideoMediaStorage ); + if ( index != KErrNotFound ) + { + iStaticVideoIntSettings[index]->iValueId = aSettingValue; + SaveStaticSettingL( ECamSettingItemVideoMediaStorage ); + } + } + } + // ------------------------------------------------------- + // Static video settings + else if( ECamSettingItemStaticVideoRangeMin < settingId + && ECamSettingItemStaticVideoRangeMax > settingId ) + { + TInt settingIndex = SearchInSettingsListFor( iStaticVideoIntSettings, settingId ); + iStaticVideoIntSettings[settingIndex]->iValueId = aSettingValue; + SaveStaticSettingL( settingId ); + + // Video / photo storage settings follow eachother + if ( ECamSettingItemVideoMediaStorage == settingId ) + { + TInt index = SearchInSettingsListFor( iStaticPhotoIntSettings, + ECamSettingItemPhotoMediaStorage ); + if ( index != KErrNotFound ) + { + iStaticPhotoIntSettings[index]->iValueId = aSettingValue; + SaveStaticSettingL( ECamSettingItemPhotoMediaStorage ); + } + } + } + // ------------------------------------------------------- + // Static common settings + else if( ECamSettingItemStaticCommonRangeMin < settingId + && ECamSettingItemStaticCommonRangeMax > settingId ) + { + TInt settingIndex = SearchInSettingsListFor( iStaticCommonIntSettings, settingId ); + iStaticCommonIntSettings[settingIndex]->iValueId = aSettingValue; + SaveStaticSettingL( settingId ); + } + // ------------------------------------------------------- + else + { + // Ignored at the moment + PRINT( _L("Camera <> Setting item not found !!!") ); + } + // ------------------------------------------------------- + } + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::SetTextSettingValueL +// Sets a new text value for the specified setting +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ) + { +switch ( aSettingItem ) + { + case ECamSettingItemPhotoNameBase: + { + iPhotoBaseName = aSettingValue; + break; + } + case ECamSettingItemVideoNameBase: + { + iVideoBaseName = aSettingValue; + break; + } + case ECamSettingItemDefaultAlbumName: + { + iDefaultAlbumName = aSettingValue; + break; + } + default: + { + PRINT( _L("Camera <> CCamSettingsModel::ECamPanicUnknownSettingItem 4" )) + CamPanic( ECamPanicUnknownSettingItem ); + return; + } + } + SaveStaticSettingL( static_cast(aSettingItem) ); + } + + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::TextSettingValue +// Returns the current text value for the specified setting +// --------------------------------------------------------------------------- +// +TPtrC CCamStaticSettingsModel::TextSettingValue( TInt aSettingItem ) const + { + switch ( aSettingItem ) + { + case ECamSettingItemPhotoNameBase: return iPhotoBaseName; + case ECamSettingItemVideoNameBase: return iVideoBaseName; + case ECamSettingItemDefaultAlbumName: return iDefaultAlbumName; + default: + { + PRINT( _L("Camera =><= CCamSettingsModel::TextSettingValue, PANIC!!!" ) ); + CamPanic( ECamPanicUnknownSettingItem ); + } + } + return NULL; + } + +#ifndef CAMERAAPP_PLUGIN_BUILD +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::LoadStaticSettingsL +// Loads the static settings from shared data. Required to update +// the settings whenever get foreground event, incase of external +// changes to the settings. +// Note that static settings cannot be loaded until the AppUi has been created, +// as which settings to use is dependent on if app is embedded or not. +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::LoadStaticSettingsL( TBool aIsEmbedded ) + { + PRINT(_L("Camera => CCamStaticSettingsModel::LoadStaticSettingsL" )) + iEmbedded = aIsEmbedded; + + // Free all memory currently used by the static settings. + UnloadStaticSettings(); + + // Settings that depend on embedded status + // If this application is embedded in MMS load + // the embedded defaults for static settings. +#ifndef CAMERAAPP_PLUGIN_BUILD + if ( iEmbedded ) + { + LoadEmbeddedSettingsL(); + } +#endif //CAMERAAPP_PLUGIN_BUILD + + // Settings that *do not* depend on embedded status + LoadPhotoStaticSettingsL( EFalse ); + LoadVideoStaticSettingsL( EFalse ); + LoadCommonStaticSettingsL( EFalse ); + + PRINT(_L("Camera <= CCamSettingsModel::LoadStaticSettingsL" )) + } + +#endif //#ifndef CAMERAAPP_PLUGIN_BUILD + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::ReadCenRepIntL +// Reads the specified setting from Central Repository to the specified +// settings model array +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::ReadFromCenRepL( const TInt aMinRange, + const TInt aMaxRange, + RPointerArray & aArray ) + { + TUint32 crKey; + TBool ignore(EFalse); + for ( TInt i = aMinRange+1; i < aMaxRange; i++ ) + { + ignore = EFalse; + if ( i == ECamSettingItemPhotoNameBase ) + { + LoadPhotoBaseNameL(); + } + else if ( i == ECamSettingItemVideoNameBase ) + { + LoadVideoBaseNameL(); + } + else if ( i == ECamSettingItemDefaultAlbumName ) + { + LoadDefaultAlbumNameL(); + } + else + { + /* + * Settings that depend on embedded status, we ignore reading the settings + * if we are loading settings for embedded camera. + */ + if ( iEmbedded && + ( i == ECamSettingItemPhotoQuality || + i == ECamSettingItemShowCapturedPhoto || + i == ECamSettingItemVideoQuality || + i == ECamSettingItemVideoShowCapturedVideo || + i == ECamSettingItemVideoAudioRec ) ) + { + ignore = ETrue; + } + if ( !ignore ) + { + crKey = MapSettingItem2CRKey( static_cast( i ), + iEmbedded ); + ReadCenRepIntL( static_cast( i ), + crKey, + aArray ); + } + } + } + } + + +#ifndef CAMERAAPP_PLUGIN_BUILD +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::LoadEmbeddedSettingsL(); +// Reads the specified setting from Central Repository to the specified +// settings model array +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::LoadEmbeddedSettingsL() + { + LoadSettingsFromResourceL( R_CAM_PHOTO_EMBEDDED_STATIC_SETTINGS_DATA, + iStaticPhotoIntSettings ); + LoadSettingsFromResourceL( R_CAM_VIDEO_EMBEDDED_STATIC_SETTINGS_DATA, + iStaticVideoIntSettings ); + + // Video - Record Audio (not shared with standalone) + ReadCenRepIntL( ECamSettingItemVideoAudioRec, + KCamCrEmbeddedVideoAudRec, + iStaticVideoIntSettings ); + + TIntSetting* newSetting = new (ELeave) TIntSetting; + CleanupStack::PushL( newSetting ); + + // Read the data for this setting item from resource. + newSetting->iItemId = ECamSettingItemPhotoQuality; + + CCamAppUiBase* appUi = 0; + TSize requiredReso, requiredResolution; + // if using the second camera + if( static_cast( + CEikonEnv::Static()->AppUi() )->ActiveCamera() == ECamActiveCameraSecondary ) + { + PRINT(_L("Camera <=> CCamStaticSettingsModel::LoadEmbeddedSettingsL Setting secondary camera image quality" )) + newSetting->iValueId = iConfiguration.SecondaryCameraImageQuality(); + } + else + { + appUi = static_cast( CEikonEnv::Static()->AppUi() ); + requiredReso = appUi->RequestedNewFileResolution(); + requiredResolution = iConfiguration.MapRequiredResolutionToActualResolutionPhoto(requiredReso); + if ( requiredResolution == TSize(0,0) ) + { + PRINT(_L("Camera <=> CCamStaticSettingsModel::LoadEmbeddedSettingsL Setting mms image quality" )) + newSetting->iValueId = iConfiguration.MmsImageQuality(); + } + else + { + PRINT(_L("Camera <=> CCamStaticSettingsModdel::LoadEmbeddedSettingsL Setting custom image quality")); + TSize resolutionToGet = requiredResolution; + PRINT2(_L("Camera <=> CCamStaticSettingsModel::LoadEmbeddedSettingsL image resolutionToGet(%d,%d)"), resolutionToGet.iWidth, resolutionToGet.iHeight ); + TInt QualityIndex = iConfiguration.GetRequiredImageQualityIndex( resolutionToGet ); + PRINT1(_L("Camera <=> CCamStaticSettingsModel::LoadEmbeddedSettingsL image QualityIndex: %d"), QualityIndex ); + newSetting->iValueId = iConfiguration.ImageQuality( QualityIndex ).iPhotoQualityId; + PRINT1(_L("Camera <=> CCamStaticSettingsModel::LoadEmbeddedSettingsL image newSetting->iValueId: %d"), newSetting->iValueId ); + } + } + + // Add the new setting item and its associated key + // to the parallel arrays for static photo settings. + iStaticPhotoIntSettings.AppendL( newSetting ); + CleanupStack::Pop( newSetting ); + + newSetting = new (ELeave) TIntSetting; + CleanupStack::PushL( newSetting ); + + // Read the data for this setting item from resource. + newSetting->iItemId = ECamSettingItemVideoQuality; + + // if using the second camera + if( static_cast( + CEikonEnv::Static()->AppUi() )->ActiveCamera() == ECamActiveCameraSecondary ) + { + PRINT(_L("Camera <=> CCamStaticSettingsModel::LoadEmbeddedSettingsL Setting secondary camera image quality" )) + newSetting->iValueId = iConfiguration.SecondaryCameraVideoQuality(); + } + else + { + appUi = static_cast( CEikonEnv::Static()->AppUi() ); + requiredReso = appUi->RequestedNewFileResolution(); + requiredResolution = iConfiguration.MapRequiredResolutionToActualResolutionVideo(requiredReso); + if ( requiredResolution == TSize(0,0) ) + { + PRINT(_L("Camera <=> CCamStaticSettingsModel::LoadEmbeddedSettingsL Setting mms video quality" )) + newSetting->iValueId = iConfiguration.SecondaryCameraVideoQuality(); + } + else + { + TSize resolutionToGet = requiredResolution; + PRINT2(_L("Camera <=> CCamStaticSettingsModel::LoadEmbeddedSettingsL resolutionToGet(%d,%d)"), resolutionToGet.iWidth, resolutionToGet.iHeight ); + TInt QualityIndex = iConfiguration.GetRequiredVideoQualityIndex( resolutionToGet ); + PRINT1(_L("Camera <=> CCamStaticSettingsModel::LoadEmbeddedSettingsL QualityIndex: %d"), QualityIndex ); + newSetting->iValueId = iConfiguration.VideoQualitySetting( QualityIndex ); + PRINT1(_L("Camera <=> CCamStaticSettingsModel::LoadEmbeddedSettingsL newSetting->iValueId: %d"), newSetting->iValueId ); + } + } + + // Add the new setting item and its associated key + // to the parallel arrays for static photo settings. + iStaticVideoIntSettings.AppendL( newSetting ); + CleanupStack::Pop( newSetting ); + } + +#endif //CAMERAAPP_PLUGIN_BUILD + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::ReadCenRepIntL +// Reads the specified setting from Central Repository to the specified +// settings model array +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::ReadCenRepIntL( TCamSettingItemIds aUiId, + TInt aCenRepID, + RPointerArray & aArray ) + { + PRINT2(_L("Camera => CCamStaticSettingsModel::ReadCenRepIntL set id:%d, cenrep id: 0x%02X" ), aUiId, aCenRepID ) + TIntSetting* newSetting = new( ELeave ) TIntSetting; + CleanupStack::PushL( newSetting ); + newSetting->iItemId = aUiId; +#ifndef CAMERAAPP_PLUGIN_BUILD + // if using the second camera, then get the photo\video quality from + // the cached value, not the shared data file + if( ( aUiId == ECamSettingItemPhotoQuality || + aUiId == ECamSettingItemVideoQuality ) && + static_cast( + CEikonEnv::Static()->AppUi() )->ActiveCamera() == ECamActiveCameraSecondary ) + { + if ( aUiId == ECamSettingItemPhotoQuality ) + { + newSetting->iValueId = iSecondaryCameraSettings.iPhotoQuality; + } + else + { + newSetting->iValueId = iSecondaryCameraSettings.iVideoQuality; + } + } + else // get the value from the shared data file +#endif //CAMERAAPP_PLUGIN_BUILD + { + User::LeaveIfError( iRepository->Get( aCenRepID , newSetting->iValueId ) ); + + // When getting the default video qulity, should get the default setting + // from ICM + if(aUiId == ECamSettingItemVideoQuality && + newSetting->iValueId == KCamUseDefaultVideoQuality) + { + newSetting->iValueId = iConfiguration.GetDefaultVideoQualityFromIcmL(); + } + } + + aArray.AppendL( newSetting ); + CleanupStack::Pop( newSetting ); + PRINT(_L("Camera <= CCamStaticSettingsModel::ReadCenRepIntL" )) + } + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::SaveCenRepItemL +// Writes the specified setting to the Central Repository +// --------------------------------------------------------------------------- +// +void +CCamStaticSettingsModel::SaveCenRepItemL( + TCamSettingItemIds aItemId, + TInt aCenRepId, + const RPointerArray& aArray ) + { + PRINT( _L("Camera => CCamStaticSettingsModel::SaveCenRepItemL") ); + TInt settingIndex = SearchInSettingsListFor( aArray, aItemId ); + + if ( settingIndex != KErrNotFound ) + { + TInt settingValue = aArray[ settingIndex ]->iValueId; + User::LeaveIfError( iRepository->Set( aCenRepId, settingValue ) ); + } + else + { + User::Leave( settingIndex ); + } + PRINT( _L("Camera <= CCamStaticSettingsModel::SaveCenRepItemL") ); + } + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::SaveSettingsL +// Saves the static settings to the shared data ini file +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::SaveSettingsL() + { + // do nothing, from now whenever a setting is changed, + // we call savestaticsettingL. + } + + +// -------------------------------------------- +// CCamStaticSettingsModel::SaveStaticSettingL +// -------------------------------------------- +// +void +CCamStaticSettingsModel::SaveStaticSettingL( TCamSettingItemIds aSettingId ) + { + PRINT( _L("CCamStaticSettingsModel => SaveStaticSettingL") ); + + switch( aSettingId ) + { + // Special cases for text settings. + // KCamCrLastUsedMonthFolder is also in text form, but it cannot be accessed + // with a setting item id. + case ECamSettingItemPhotoNameBase: SavePhotoBaseNameL(); break; + case ECamSettingItemVideoNameBase: SaveVideoBaseNameL(); break; + case ECamSettingItemDefaultAlbumName: SaveDefaultAlbumNameL(); break; + + // Only save photo and video quality for primary camera + case ECamSettingItemPhotoQuality: + { + if ( !iEmbedded ) + { + #ifndef CAMERAAPP_PLUGIN_BUILD + CCamAppUiBase* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi->ActiveCamera() == ECamActiveCameraPrimary ) + #endif //CAMERAAPP_PLUGIN_BUILD + { + SaveCenRepItemL( ECamSettingItemPhotoQuality, + KCamCrPhotoQuality, + iStaticPhotoIntSettings ); + } + } + break; + } + case ECamSettingItemVideoQuality: + { + if ( !iEmbedded ) + { +#ifndef CAMERAAPP_PLUGIN_BUILD + CCamAppUiBase* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi->ActiveCamera() == ECamActiveCameraPrimary ) +#endif //CAMERAAPP_PLUGIN_BUILD + { + SaveCenRepItemL( ECamSettingItemVideoQuality, + KCamCrVideoQuality, + iStaticVideoIntSettings ); + } + } + break; + } + // Text settings which require no special handling + case ECamSettingItemImageToolbarItems: + case ECamSettingItemImageToolbarDefaultItems: + { + TUint32 crKey = MapSettingItem2CRKey( aSettingId, iEmbedded ); + TPtrC value = TextSettingValue( aSettingId ); + + User::LeaveIfError( iRepository->Set( crKey, value ) ); + break; + } + case ECamSettingItemShowCapturedPhoto: + case ECamSettingItemVideoShowCapturedVideo: + { + if ( iEmbedded ) + { + // if in the embedded mode, we dont save value to the CenRep + // because in Embedded mode show photo/video capture setting is + // always on. + return; + } + else + { + } + } + // Integer settings which require no special handling + default: + { + RPointerArray* settingArray = + MapSettingItem2SettingsList( aSettingId ); + + if( settingArray ) + { + TUint32 crKey = MapSettingItem2CRKey( aSettingId, iEmbedded ); + SaveCenRepItemL( aSettingId, crKey, *settingArray ); + } + else + { + CamPanic( ECamPanicUnknownSettingItem ); + } + break; + } + } // switch + + PRINT( _L("CCamStaticSettingsModel <= SaveStaticSettingL") ); + } + + +// --------------------------------------------------------------------------- +// MapSettingItem2CRKey <> +// --------------------------------------------------------------------------- +// +TUint32 +CCamStaticSettingsModel::MapSettingItem2CRKey( TCamSettingItemIds aSettingId, + TBool aEmbedded ) + { + PRINT( _L("Camera => CCamStaticSettingsModel::MapSettingItem2CRKey") ); + TUint32 crKey( 0 ); + + // ------------------------------------------------------- + // static photo settings + if( ECamSettingItemStaticPhotoRangeMin < aSettingId + && ECamSettingItemStaticPhotoRangeMax > aSettingId ) + { + PRINT( _L(" Camera <=> CCamStaticSettingsModel ECamSettingItemStaticPhoto") ); + switch( aSettingId ) + { + case ECamSettingItemPhotoQuality: crKey = KCamCrPhotoQuality; break; + case ECamSettingItemPhotoSize: crKey = KCamCrPhotoSize; break; + case ECamSettingItemPhotoShowFocusPoint: crKey = KCamCrFocusPoint; break; + case ECamSettingItemPhotoStoreInAlbum: crKey = KCamCrPhotoStoreAlbum; break; //KCamCrDefaultAlbumId + case ECamSettingItemShowCapturedPhoto: crKey = KCamCrPhotoShowCaptured; break; + case ECamSettingItemPhotoCaptureTone: crKey = KCamCrPhotoCaptureTone; break; + case ECamSettingItemFaceTracking: crKey = KCamCrPhotoFaceTracking; break; + case ECamSettingItemPhotoMediaStorage: crKey = KCamCrPhotoMemInUse; break; + case ECamSettingItemPhotoNameBase: crKey = KCamCrPhotoNameBase; break; + + case ECamSettingItemPhotoNameBaseType: crKey = KCamCrPhotoNameType; break; + case ECamSettingItemPhotoNumber: crKey = KCamCrPhotoImgCount; break; + case ECamSettingItemPhotoDigitalZoom: crKey = KCamCrPhotoExtDigZoom; break; + case ECamSettingItemImageRotation: crKey = KCamCrPhotoRotation; break; + case ECamSettingItemFlickerCancel: crKey = KCamCrFlickerCancellation; break; + + case ECamSettingItemImageToolbarItems: crKey = KCamCrImageToolbarItems; break; + case ECamSettingItemImageToolbarDefaultItems: crKey = KCamCrImageToolbarDefaultItems; break; + case ECamSettingItemContinuousAutofocus: + crKey = KCamCrContinuousAutofocus; + break; + + default: CamPanic( ECamPanicUnknownSettingItem ); + break; + } + } + // ------------------------------------------------------- + // static video settings + else if( ECamSettingItemStaticVideoRangeMin < aSettingId + && ECamSettingItemStaticVideoRangeMax > aSettingId ) + { + PRINT( _L(" Camera <=> CCamStaticSettingsModel : ECamSettingItemStaticVideoRange") ); + switch( aSettingId ) + { + case ECamSettingItemVideoAudioRec: + if( aEmbedded ) crKey = KCamCrEmbeddedVideoAudRec; + else crKey = KCamCrVideoAudRec; + break; + case ECamSettingItemContinuousAutofocus: + crKey = KCamCrContinuousAutofocus; + break; + case ECamSettingItemVideoResolution: crKey = KCamCrVideoRes; break; + case ECamSettingItemVideoClipLength: crKey = KCamCrVideoClipLen; break; + case ECamSettingItemVideoFileType: crKey = KCamCrVideoFileType; break; + case ECamSettingItemVideoStoreInAlbum: crKey = KCamCrVideoStoreAlbum; break; //KCamCrDefaultAlbumId + case ECamSettingItemVideoShowCapturedVideo: crKey = KCamCrVideoShowCaptured; break; + case ECamSettingItemVideoMediaStorage: crKey = KCamCrVideoMemInUse; break; + case ECamSettingItemVideoNameBase: crKey = KCamCrVideoNameBase; break; + case ECamSettingItemVideoNameBaseType: crKey = KCamCrVideoNameType; break; + case ECamSettingItemVideoNumber: crKey = KCamCrVideoCount; break; + case ECamSettingItemVideoQuality: crKey = KCamCrVideoQuality; break; + case ECamSettingItemVideoDigitalZoom: crKey = KCamCrVideoExtDigZoom; break; + case ECamSettingItemVideoStab: crKey = KCamCrVideoStabilisation; break; + default: CamPanic( ECamPanicUnknownSettingItem ); + break; + } + } + // ------------------------------------------------------- + // static common settings + else if( ECamSettingItemStaticCommonRangeMin < aSettingId + && ECamSettingItemStaticCommonRangeMax > aSettingId ) + { + PRINT( _L("Camera <=> CCamStaticSettingsModel ECamSettingItemStaticCommon") ); + switch( aSettingId ) + { + case ECamSettingItemUserMode: crKey = KCamCrUserMode; break; + case ECamSettingItemDefaultAlbumId: crKey = KCamCrDefaultAlbumId; break; + case ECamSettingItemDefaultAlbumName: crKey = KCamCrDefaultAlbumTitle; break; + case ECamSettingItemRecLocation: crKey = KCamCrPhotoStoreLocation; break; + default: CamPanic( ECamPanicUnknownSettingItem ); + break; + } + } + // ------------------------------------------------------- + else if( ECamSettingItemUserSceneRangeMin < aSettingId + && ECamSettingItemUserSceneRangeMax > aSettingId ) + { + PRINT( _L("Camera <=> CCamStaticSettingsModel ECamSettingItemUserSceneRange") ); + switch( aSettingId ) + { + case ECamSettingItemUserSceneBasedOnScene: crKey = KCamCrUserSceneBaseScene; break; + case ECamSettingItemUserSceneWhitebalance: crKey = KCamCrUserSceneWhiteBalance; break; + case ECamSettingItemUserSceneColourFilter: crKey = KCamCrUserSceneColourFilter; break; + case ECamSettingItemUserSceneExposure: crKey = KCamCrUserSceneExposure; break; + case ECamSettingItemUserSceneFlash: crKey = KCamCrUserSceneFlash; break; + case ECamSettingItemUserSceneBrightness: crKey = KCamCrUserSceneBrightness; break; + case ECamSettingItemUserSceneContrast: crKey = KCamCrUserSceneContrast; break; + case ECamSettingItemUserSceneImageSharpness: crKey = KCamCrUserSceneImageSharpness; break; + case ECamSettingItemUserSceneColourSaturation: crKey = KCamCrUserSceneColourSaturation; break; + case ECamSettingItemUserSceneLightSensitivity: crKey = KCamCrUserSceneLightSensitivity; break; + default: CamPanic( ECamPanicUnknownSettingItem ); + break; + } + } + else + { + PRINT( _L(" Camera <=> CCamStaticSettingsModel CamPanic( ECamPanicUnknownSettingItem )") ); + CamPanic( ECamPanicUnknownSettingItem ); + } + + PRINT( _L("Camera <= CCamSettingsModel::MapSettingItem2CRKey") ); + return crKey; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +RPointerArray* +CCamStaticSettingsModel::MapSettingItem2SettingsList( TCamSettingItemIds aSettingId ) + { + PRINT( _L("Camera => CCamStaticSettingsModel::MapSettingItem2SettingsList") ); + + RPointerArray* array( NULL ); + + if( ECamSettingItemStaticPhotoRangeMin < aSettingId && + ECamSettingItemStaticPhotoRangeMax > aSettingId ) + { + if( ECamSettingItemPhotoNameBase == aSettingId ) + array = NULL; + else + array = &iStaticPhotoIntSettings; + } + else if( ECamSettingItemStaticVideoRangeMin < aSettingId && + ECamSettingItemStaticVideoRangeMax > aSettingId ) + { + if( ECamSettingItemVideoNameBase == aSettingId ) + array = NULL; + else + array = &iStaticVideoIntSettings; + } + else if( ECamSettingItemStaticCommonRangeMin < aSettingId && + ECamSettingItemStaticCommonRangeMax > aSettingId ) + { + array = &iStaticCommonIntSettings; + } + else + { + CamPanic( ECamPanicUnknownSettingItem ); + array = NULL; + } + + PRINT( _L("Camera <= CCamStaticSettingsModel::MapSettingItem2SettingsList") ); + return array; + } + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::~CCamStaticSettingsModel +// Destructor +// --------------------------------------------------------------------------- +// +CCamStaticSettingsModel::~CCamStaticSettingsModel() + { + PRINT( _L("Camera => ~CCamStaticSettingsModel") ); + iStaticCommonIntSettings.ResetAndDestroy(); + iStaticCommonIntSettings.Close(); + + iStaticPhotoIntSettings.ResetAndDestroy(); + iStaticPhotoIntSettings.Close(); + + iStaticVideoIntSettings.ResetAndDestroy(); + iStaticVideoIntSettings.Close(); + delete iRepository; + delete iConfigManager; + iConfigManager = NULL; + PRINT( _L("Camera <= ~CCamStaticSettingsModel") ); + } + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::CCamStaticSettingsModel +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamStaticSettingsModel::CCamStaticSettingsModel( CCamConfiguration& aConfiguration ) + : iEmbedded( EFalse ), + iConfiguration( aConfiguration ) + { + iSecondaryCameraSettings.iVideoQuality + = iConfiguration.SecondaryCameraVideoQuality(); + iSecondaryCameraSettings.iPhotoQuality + = iConfiguration.SecondaryCameraImageQuality(); + + // Check that configuration can provide us secondary camera qualities + // If either of them is unavailable, all we can do is panic + PRINT( _L("Camera <> Checking secondary camera qualities") ); + __ASSERT_ALWAYS( iSecondaryCameraSettings.iVideoQuality > 0, + CamPanic( ECamPanicSecondaryQualityMissing ) ); + + __ASSERT_ALWAYS( iSecondaryCameraSettings.iPhotoQuality > 0, + CamPanic( ECamPanicSecondaryQualityMissing ) ); + } + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::ConstructL() + { + PRINT( _L("Camera => CCamStaticSettingsModel::ConstructL") ); + iRepository = CRepository::NewL( KCRUidCameraappSettings ); + iConfigManager = CCameraUiConfigManager::NewL(); + PRINT( _L("Camera <= CCamStaticSettingsModel::ConstructL") ); + } + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::SearchInSettingsListFor +// Searches in a settings list for a particular setting item. +// --------------------------------------------------------------------------- +// +TInt +CCamStaticSettingsModel::SearchInSettingsListFor( + const RPointerArray& aSettingsList, + TInt aSettingItem ) const + { + return aSettingsList.Find( aSettingItem, SettingIdMatches ); + } + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::ResetRepository +// Reset Camera central repository file +// --------------------------------------------------------------------------- +// + void CCamStaticSettingsModel::ResetRepository() + { + if( iRepository ) + { + iRepository->Reset(); + } + } + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::UnloadStaticSettings +// Remove any previously loaded static settings. +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::UnloadStaticSettings() + { + PRINT( _L("Camera => CCamStaticSettingsModel::UnloadStaticSettings()" )) + iStaticCommonIntSettings.ResetAndDestroy(); + iStaticPhotoIntSettings.ResetAndDestroy(); + iStaticVideoIntSettings.ResetAndDestroy(); + PRINT( _L("Camera <= CCamStaticSettingsModel::UnloadStaticSettings()" )) + } + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::LoadPhotoBaseNameL +// Loads the photo base name either from resource or from shared data +// as appropriate +// --------------------------------------------------------------------------- +// +void +CCamStaticSettingsModel::LoadPhotoBaseNameL() + { + User::LeaveIfError( iRepository->Get( KCamCrPhotoNameBase , iPhotoBaseName ) ); + // If photoname base not defined + if ( iPhotoBaseName.Length() == 0 ) + { + // Read base file name from resources and set the shared data key. + StringLoader::Load( iPhotoBaseName, R_CAM_NAMEBASE_IMAGE ); + } + } + +// +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::LoadVideoBaseNameL +// Loads the video base name either from resource or from shared data +// as appropriate +// --------------------------------------------------------------------------- +void +CCamStaticSettingsModel::LoadVideoBaseNameL() + { + User::LeaveIfError( iRepository->Get( KCamCrVideoNameBase , iVideoBaseName ) ); + if ( iVideoBaseName.Length() == 0 ) + { + // Read base file name from resources and set the shared data key. + StringLoader::Load( iVideoBaseName, R_CAM_NAMEBASE_VIDEO ); + } + } + + +// +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::LoadVideoBaseNameL +// Loads the video base name either from resource or from shared data +// as appropriate +// --------------------------------------------------------------------------- +void +CCamStaticSettingsModel::LoadDefaultAlbumNameL() + { + User::LeaveIfError( iRepository->Get( KCamCrDefaultAlbumTitle, + iDefaultAlbumName ) ); + } + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::SavePhotoBaseNameL +// Saves the photo base name after comparing against resource to see if we +// have switched back to the default base +// --------------------------------------------------------------------------- +// +void +CCamStaticSettingsModel::SavePhotoBaseNameL() + { + TBuf savedBaseName; + TBuf resourceBaseName; + TBuf sharedDataBaseName = iPhotoBaseName; + + User::LeaveIfError( iRepository->Get( KCamCrPhotoNameBase, + savedBaseName ) ); + StringLoader::Load(resourceBaseName, R_CAM_NAMEBASE_IMAGE ); + + if ( savedBaseName.Length() == 0 && iPhotoBaseName == resourceBaseName ) + { + sharedDataBaseName = KNullDesC; + } + User::LeaveIfError( iRepository->Set( KCamCrPhotoNameBase, + sharedDataBaseName ) ); + } + +// +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::SaveVideoBaseNameL +// Saves the video base name after comparing against resource to see if we +// have switched back to the default base +// --------------------------------------------------------------------------- +void CCamStaticSettingsModel::SaveVideoBaseNameL() + { + TBuf savedBaseName; + TBuf resourceBaseName; + TBuf sharedDataBaseName = iVideoBaseName; + + User::LeaveIfError( iRepository->Get( KCamCrVideoNameBase, + savedBaseName ) ); + StringLoader::Load(resourceBaseName, R_CAM_NAMEBASE_VIDEO ); + + if ( savedBaseName.Length() == 0 && + iVideoBaseName == resourceBaseName ) + { + sharedDataBaseName = KNullDesC; + } + + User::LeaveIfError( iRepository->Set( KCamCrVideoNameBase, + sharedDataBaseName ) ); + } + + +// +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::SaveDefaultAlbumNameL +// Saves the name of the default album set +// --------------------------------------------------------------------------- +void CCamStaticSettingsModel::SaveDefaultAlbumNameL() + { + User::LeaveIfError( iRepository->Set( KCamCrDefaultAlbumTitle, + iDefaultAlbumName ) ); + } + + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::ReadCenRepStringL +// --------------------------------------------------------------------------- +// +HBufC* +CCamStaticSettingsModel::ReadCenRepStringL( TInt aCenRepKeyId ) + { + PRINT1( _L("Camera => CCamSettingsModel::ReadCenRepStringL, key:0x%02x"), aCenRepKeyId ); + + HBufC* string = HBufC::NewLC( KCamCRStringInitialLength ); + + TPtr ptr = string->Des(); + TInt size = 0; + TInt status = iRepository->Get( aCenRepKeyId, ptr, size ); + + // Did not fit into the string, reserve more memory and try again + if( KErrOverflow == status ) + { + PRINT2( _L("Camera <> CCamSettingsModel: need bigger buffer, length: %d -> %d"), ptr.MaxLength(), size ); + CleanupStack::PopAndDestroy(); // String + string = HBufC::NewLC( size ); + ptr = string->Des(); + + status = iRepository->Get( aCenRepKeyId, ptr, size ); + } + + User::LeaveIfError( status ); + CleanupStack::Pop(); // string + PRINT1( _L("Camera <= CCamSettingsModel::ReadCenRepStringL, got string:[%S]"), string); + + return string; + } + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::ResetSettingItem +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::ResetSettingItem( const TInt aCenRepKeyId ) + { + TInt err = iRepository->Reset( aCenRepKeyId ); + if ( KErrNone != err ) + { + // Handle the error case + } + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::StorePrimaryCameraSettingsL +// Stores the primary camera settings so they can be reapplied when +// changing from front to back camera +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::StorePrimaryCameraSettingsL() + { + PRINT( _L("Camera => CCamSettingsModel::StorePrimaryCameraSettingsL")) + TInt settingIndex = SearchInSettingsListFor( iStaticPhotoIntSettings, + ECamSettingItemPhotoQuality ); + if ( settingIndex != KErrNotFound ) + { + iPrimaryCameraSettings.iPhotoQuality = + iStaticPhotoIntSettings[settingIndex]->iValueId; + } + + settingIndex = SearchInSettingsListFor( iStaticVideoIntSettings, + ECamSettingItemVideoQuality ); + if ( settingIndex != KErrNotFound ) + { + iPrimaryCameraSettings.iVideoQuality = + iStaticVideoIntSettings[settingIndex]->iValueId; + } + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::RestorePrimaryCameraSettingsL +// Restores the primary camera settings when +// changing from front to back camera +// --------------------------------------------------------------------------- +// +void CCamStaticSettingsModel::RestorePrimaryCameraSettingsL() + { + // set the stored primary camera settings + SetIntegerSettingValueL( ECamSettingItemPhotoQuality, + iPrimaryCameraSettings.iPhotoQuality ); + SetIntegerSettingValueL( ECamSettingItemVideoQuality, + iPrimaryCameraSettings.iVideoQuality ); + // set the secondary camera settings back to defaults + iSecondaryCameraSettings.iPhotoQuality = iConfiguration.SecondaryCameraImageQuality(); + iSecondaryCameraSettings.iVideoQuality = iConfiguration.SecondaryCameraVideoQuality(); + } + +#ifndef CAMERAAPP_PLUGIN_BUILD +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::LoadDynamicSettingsL +// Loads the dynamic settings from resource file for a +// particular group of settings. +// --------------------------------------------------------------------------- +// +void +CCamStaticSettingsModel::LoadSettingsFromResourceL( + TInt aResourceId, + RPointerArray& aSettingsList ) + { + // Create resource reader for reading photo static settings + TResourceReader reader; + CEikonEnv::Static()->CreateResourceReaderLC( reader, aResourceId ); + TInt count = reader.ReadInt16(); + + // for each entry in the resource, create a new setting item. + TInt i; + for ( i = 0; i < count; ++i ) + { + TIntSetting* newSetting = new (ELeave) TIntSetting; + CleanupStack::PushL( newSetting ); + + // Read the data for this setting item from resource. + newSetting->iItemId = reader.ReadInt16(); + newSetting->iValueId = reader.ReadInt16(); + + // Add the new setting item and its associated key + // to the parallel arrays for static photo settings. + aSettingsList.AppendL( newSetting ); + CleanupStack::Pop( newSetting ); + } + + CleanupStack::PopAndDestroy(); // reader + } +#endif //CAMERAAPP_PLUGIN_BUILD + +// --------------------------------------------------------------------------- +// CCamStaticSettingsModel::Configuration +// +// --------------------------------------------------------------------------- +// +CCamConfiguration& +CCamStaticSettingsModel::Configuration() const + { + return iConfiguration; + } + +// +// CCamStaticSettingsModel::LoadPhotoStaticSettingsL +// +void CCamStaticSettingsModel::LoadPhotoStaticSettingsL( const TBool aResetFromPlugin ) + { + if ( aResetFromPlugin ) + { + LoadCommonStaticSettingsL( aResetFromPlugin ); + iStaticPhotoIntSettings.ResetAndDestroy(); + } + // Load Photo/Image Settings + ReadFromCenRepL( static_cast( ECamSettingItemStaticPhotoRangeMin ), + static_cast( ECamSettingItemPhotoCompression ), + iStaticPhotoIntSettings ); + + } + +// +// CCamStaticSettingsModel::LoadVideoStaticSettingsL +// +void CCamStaticSettingsModel::LoadVideoStaticSettingsL( const TBool aResetFromPlugin ) + { + if ( aResetFromPlugin ) + { + LoadCommonStaticSettingsL( aResetFromPlugin ); + iStaticVideoIntSettings.ResetAndDestroy(); + } + // Load Video Settings + ReadFromCenRepL( static_cast( ECamSettingItemStaticVideoRangeMin ), + static_cast( ECamSettingItemVideoOpZoomOff ), + iStaticVideoIntSettings ); + + } + +// +// CCamStaticSettingsModel::LoadCommonStaticSettingsL +// +void CCamStaticSettingsModel::LoadCommonStaticSettingsL( const TBool aResetFromPlugin ) + { + if ( aResetFromPlugin ) + { + iStaticCommonIntSettings.ResetAndDestroy(); + } + // Load Common Settings + ReadFromCenRepL( static_cast( ECamSettingItemStaticCommonRangeMin ), + static_cast( ECamSettingItemStaticCommonRangeMax ), + iStaticCommonIntSettings ); + } + +/* + * Handle to Camera Ui Config Manager +*/ +CCameraUiConfigManager* CCamStaticSettingsModel::UiConfigManagerPtr() + { + return iConfigManager; + } +//End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/CamUtility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/CamUtility.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1708 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility functions for the Camera Application* +*/ + + + +// INCLUDE FILES +#include // for feature definitions + +#include // CEikonEnv::Static()->FsSession() +#include +#include + +#include +#include + +#include // SysUtil::DiskSpaceBelowCriticalLevelL() +#include +#include // CEikApplication +#include // TCollateMethod +#include +#include +#include // MMS cenrep keys +#include +#include // USB connection +#include +#include // KAknQwertyInputModeActive + +#include +#include + +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + #include +#endif // defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + + +#include + +#ifndef CAMERAAPP_PLUGIN_BUILD + #include + #include +#else + #include +#endif //CAMERAAPP_PLUGIN_BUILD + +#include "CamUtility.h" +#include "CamPanic.h" +#include "CameraappPrivateCRKeys.h" +#include "camuidconstants.h" + + +// CONSTANTS +const TInt KCamNhdWidth = 640; +const TInt KCamNhdHeight = 360; + +#ifndef CAMERAAPP_PLUGIN_BUILD + +#include "CamAppUi.h" +#include "CameraUiConfigManager.h" +#include "CamResourceLookup.h" + +// =========================================================================== +// CONSTANTS +const TInt KMicSecInHalfSec = 500000; +const TInt KMicSecInQuartSec = 250000; + +const TInt KCaptureLongPress = 500; // value in milliseconds + +// UI EV range +const TInt KEVCompMinVal = -2; +const TInt KEVCompMaxVal = 2; +const TInt KEVCompStepsPerUnit = 2; + +// Limit for burst captured images +const TInt KMaxBurstImages = 18; + +// Timeout value for courtesyUI +const TInt KCourtesyUiTimeoutValue = 5; + +// Self-timer constants +const TInt KMicroSecPerSec = 1000000; + +#endif //CAMERAAPP_PLUGIN_BUILD + + +// ============================ MEMBER FUNCTIONS =============================== + + +// --------------------------------------------------------------------------- +// CamUtility::MemoryFree +// Get free space in selected memory +// +// Returns: free space in selected memory (in bytes) minus the disk critical space +// --------------------------------------------------------------------------- +// + +TInt64 CamUtility::MemoryFree( + //AknCommonDialogsDynMem::TMemoryTypes aMemory, + DriveInfo::TDefaultDrives aMemory, + TInt aCriticalLevel ) + { + PRINT( _L("Camera => CamUtility::MemoryFree") ); + TVolumeInfo vinfo; + TInt error = KErrNone; + + // if measuring space on memory card + if ( aMemory == DriveInfo::EDefaultRemovableMassStorage )//AknCommonDialogsDynMem::EMemoryTypeMMC ) + { + error = CEikonEnv::Static()->FsSession().Volume( + vinfo, MemoryCardDrive() ); + if ( error || MemoryCardStatus() != ECamMemoryCardInserted ) + { + PRINT( _L("Camera <= CamUtility::MemoryFree, failed to get volume info 1!!") ); + return 0; + } + } + else if ( aMemory == DriveInfo::EDefaultMassStorage )//AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage ) + { + error = CEikonEnv::Static()->FsSession().Volume( + vinfo, MassMemoryDrive() ); + } + else // otherwise, measuring space on the phone memory + { + error = CEikonEnv::Static()->FsSession().Volume( + vinfo, PhoneMemoryDrive() ); + } + + if ( error ) // if getting the volume info failed + { + PRINT( _L("Camera <= CamUtility::MemoryFree, failed to get volume info 2!!") ); + return 0; // indicate not enough space + } + PRINT( _L("Camera <= CamUtility::MemoryFree") ); + return vinfo.iFree - aCriticalLevel; + } + +// --------------------------------------------------------------------------- +// CamUtility::MemoryCardStatus +// Returns the current status of the MMC +// --------------------------------------------------------------------------- +// +TCamMemoryCardStatus CamUtility::MemoryCardStatus() + { + PRINT( _L("Camera => CamUtility::MemoryCardStatus") ); + TDriveInfo driveInfo; + + CEikonEnv::Static()->FsSession().Drive( driveInfo, MemoryCardDrive() ); + + // Check if the MMC is currently locked. + // If mmc is locked, then driveInfo.iType is zero, therefore switch clause + // below does not notice new card + // Check iMediaAtt instead, if media can be locked and is currently locked + // and has password, then locked MMC is inserted + + TCamMemoryCardStatus mmcStatus( ECamMemoryCardNotInserted ); + + if ( ( driveInfo.iMediaAtt & ( KMediaAttLockable|KMediaAttLocked|KMediaAttHasPassword ) ) + == ( KMediaAttLockable|KMediaAttLocked|KMediaAttHasPassword ) ) + { + mmcStatus = ECamMemoryCardLocked; + } + else + { + switch( driveInfo.iType ) + { + case EMediaNotPresent: + { + mmcStatus = ECamMemoryCardNotInserted; + break; + } + default: + { + mmcStatus = ECamMemoryCardInserted; + break; + } + } + } + // Check that volume is valid (ie. MMC is not corrupted) + TVolumeInfo volumeInfo; + TInt error = CEikonEnv::Static()->FsSession().Volume( volumeInfo, MemoryCardDrive() ); + if ( error ) + { + mmcStatus = ECamMemoryCardNotInserted; + } + PRINT( _L("Camera <= CamUtility::MemoryCardStatus") ); + return mmcStatus; + } + + +// --------------------------------------------------------------------------- +// CamUtility::MemoryCardDrive +// Get drive number for memory card. +// --------------------------------------------------------------------------- +// +TInt CamUtility::MemoryCardDrive() + { + // Get the root path of the default memory card. + TInt drive; + TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive ); + if ( err != KErrNone ) + { + return err; + } + TFileName path; + err = PathInfo::GetRootPath( path, drive ); + if ( err != KErrNone ) + { + return err; + } + TInt res = 0; + err = RFs::CharToDrive( path[0], res ); + __ASSERT_ALWAYS( !err, CamPanic( ECamPanicFileSystemError ) ); + // return the memory card drive number + return res; + } + +// --------------------------------------------------------------------------- +// CamUtility::PhoneMemoryDrive +// Get drive number for phone memory. +// --------------------------------------------------------------------------- +// +TInt CamUtility::PhoneMemoryDrive() + { + // Get the root path of the default phone memory. + TInt drive; + TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, drive ); + if ( err != KErrNone ) + { + return err; + } + TFileName path; + err = PathInfo::GetRootPath( path, drive ); + if ( err != KErrNone ) + { + return err; + } + TInt res = 0; + err = RFs::CharToDrive( path[0], res ); + __ASSERT_ALWAYS( !err, CamPanic( ECamPanicFileSystemError ) ); + // return the phone memory drive number + return res; + } + +// --------------------------------------------------------------------------- +// CamUtility::MassMemoryDrive +// Get drive number for mass storage memory. +// --------------------------------------------------------------------------- +// +TInt CamUtility::MassMemoryDrive() + { + // Get the root path of the default mass storage memory. + TInt drive; + TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ); + if ( err != KErrNone ) + { + return err; + } + TFileName path; + err = PathInfo::GetRootPath( path, drive ); + if ( err != KErrNone ) + { + return err; + } + TInt res = 0; + err = RFs::CharToDrive( path[0], res ); + __ASSERT_ALWAYS( !err, CamPanic( ECamPanicFileSystemError ) ); + // return the mass storage memory drive number + return res; + } + + +TInt CamUtility::GetDriveTypeFromDriveNumber( TInt aDrive ) + { + TInt drive; + TInt returnVal = DriveInfo::EDefaultPhoneMemory; + DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, drive ); + if ( drive == aDrive ) + { + returnVal = DriveInfo::EDefaultPhoneMemory; + } + DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ); + if ( drive == aDrive ) + { + returnVal = DriveInfo::EDefaultMassStorage; + } + DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive ); + if ( drive == aDrive ) + { + returnVal = DriveInfo::EDefaultRemovableMassStorage; + } + return returnVal; + } + +// --------------------------------------------------------------------------- +// CamUtility::MapToSettingsListMemory +// Return settings list mapped value +// --------------------------------------------------------------------------- +// + +TInt CamUtility::MapToSettingsListMemory( TInt aStorage ) + { + TInt mappedMemory; + switch ( aStorage ) + { + case ECamMediaStoragePhone: + { + mappedMemory = DriveInfo::EDefaultPhoneMemory; + } + break; + case ECamMediaStorageCard: + { + mappedMemory = DriveInfo::EDefaultRemovableMassStorage; + } + break; + case ECamMediaStorageMassStorage: + { + mappedMemory = DriveInfo::EDefaultMassStorage; + } + break; + default: + { + mappedMemory = KErrNotFound; + } + break; + } + return mappedMemory; + } + +// --------------------------------------------------------------------------- +// CamUtility::MapFromSettingsListMemory +// Return camera storage location mapped from settings list value +// --------------------------------------------------------------------------- +// +TInt CamUtility::MapFromSettingsListMemory( TInt aStorage ) + { + TInt mappedMemory; + switch ( aStorage ) + { + case DriveInfo::EDefaultPhoneMemory: + { + mappedMemory = ECamMediaStoragePhone; + } + break; + case DriveInfo::EDefaultRemovableMassStorage: + { + mappedMemory = ECamMediaStorageCard; + } + break; + case DriveInfo::EDefaultMassStorage: + { + mappedMemory = ECamMediaStorageMassStorage; + } + break; + default: + { + mappedMemory = KErrNotFound; + } + break; + } + return mappedMemory; + } + +// --------------------------------------------------------------------------- +// CamUtility::GetUniqueNameL +// Suggest a new unique filename using the name stub provided in aFilename +// and adding a numbered postfix to ensure uniqueness +// The full filename is returned in aFilePath. The name of the file only, is +// returned in aFilename +// --------------------------------------------------------------------------- +// +void CamUtility::GetUniqueNameL( TDes& aFilePath, + TDes& aFilename, + TInt aSuggestedNumeral, + const TDesC& aExt ) + { + PRINT( _L("Camera => CamUtility::GetUniqueNameL") ); + // Leave if there is a problem with the passed directory path. + TEntry entry; + RFs rfs; + User::LeaveIfError( rfs.Connect( ) ); + CleanupClosePushL( rfs ); + User::LeaveIfError( rfs.Entry( aFilePath, entry ) ); + // check it actually is a directory + if( !entry.IsDir() ) + { + PRINT( _L("Camera => CamUtility::GetUniqueNameL not dir") ); + User::Leave( KErrCorrupt ); + } + + TInt namelen = aFilename.Length(); + + TFileName nameBase( aFilename.Left( namelen ) ); + + TBool done = EFalse; + TInt counter = aSuggestedNumeral; + + RFs& fs = CEikonEnv::Static()->FsSession(); + + while ( !done ) + { + // Generate new name + FormatFileName( counter, nameBase, aFilename ); + + TFileName newPath( aFilePath ); + newPath.Append( aFilename ); + newPath.Append( aExt ); + + // define new instance of TEntry to prevent LINT error + TEntry newEntry; + TInt ferr = fs.Entry( newPath, newEntry ); + // if there is no file in the current location with this name + if ( ferr == KErrNotFound ) + { + done = ETrue; + aFilePath.Copy( newPath ); + } + else if( ferr == KErrNone )// the filename has already been used in this location + { + // try the next number + ++counter; + } + else + { + User::Leave( ferr ); + } + } + CleanupStack::PopAndDestroy( &rfs ); + PRINT( _L("Camera => CamUtility::GetUniqueNameL") ); + } + +// --------------------------------------------------------------------------- +// CamUtility::FormatFileName +// Generate a file name based on base name and counter. +// --------------------------------------------------------------------------- +// +void CamUtility::FormatFileName( TUint aCounter, + const TDesC& aBaseName, + TDes& aFilename ) + { + const TUint KMax3Digits = 999; + _LIT( KCamNameFormatFirst, "%S" ); // "Photo" + _LIT( KCamNameFormat3Digits, "%S%03d" ); // "Photo001" + _LIT( KCamNameFormat4Digits, "%S%d" ); // "Photo1234" + + // if the number is 0 + if ( aCounter == 0 ) + { + aFilename.Format( KCamNameFormatFirst, &aBaseName ); + } + else if ( aCounter <= KMax3Digits ) // the number is 1 - 999 + { + aFilename.Format( KCamNameFormat3Digits, &aBaseName, aCounter ); + } + else // the number is > 999 + { + aFilename.Format( KCamNameFormat4Digits, &aBaseName, aCounter ); + } + } + +// --------------------------------------------------------------------------- +// CamUtility::CheckFileNameValidityL +// Checks if given filename contains illegal characters or +// is otherwise illegal. +// --------------------------------------------------------------------------- +// +TBool CamUtility::CheckFileNameValidityL( const TDesC& aFilename ) + { + // For filename validity checking + _LIT( KSingleDot, "." ); + _LIT( KDoubleDot, ".." ); + _LIT( KBackslash, "\\" ); + + // "." and ".." are not valid filenames + if ( aFilename.Compare( KSingleDot ) == 0 || + aFilename.Compare( KDoubleDot ) == 0 ) + { + CAknNoteWrapper* note = new ( ELeave ) CAknNoteWrapper(); + note->ExecuteLD( R_CAM_UNSUITABLE_FILENAME ); + return EFalse; + } + + // No backslashes in filenames. + // File server checks for other special characters. + if ( aFilename.Find( KBackslash ) != KErrNotFound || + !CCoeEnv::Static()->FsSession().IsValidName( aFilename ) ) + { + CAknNoteWrapper* note = new ( ELeave ) CAknNoteWrapper(); + note->ExecuteLD( R_CAM_ILLEGAL_CHARACTERS ); + return EFalse; + } + + // File name is okay. + return ETrue; + } + +// --------------------------------------------------------------------------- +// CamUtility::FormatDateFileNameL +// Generate a file name based on date and counter. +// --------------------------------------------------------------------------- +// +void CamUtility::FormatDateFileNameL( TDes& aFilename ) + { + const TInt KCamMaxDateLen = 8; + + _LIT( KCamNameFormatFirst, "%S" ); // "Image" + + TBuf date; + GetCurrentDateForNameBaseL( date ); + + aFilename.Format( KCamNameFormatFirst, &date ); + } + +// --------------------------------------------------------------------------- +// CamUtility::GetCurrentDateForNameBaseL +// Format current date into given descriptor in a format +// suitable for file names. +// --------------------------------------------------------------------------- +// +void CamUtility::GetCurrentDateForNameBaseL( TDes& aBuffer ) + { + const TInt KCamDateFormatLength = 8; + _LIT( KCamEuropeanDateFormat, "%F%D%M%Y" ); + _LIT( KCamAmericanDateFormat, "%F%M%D%Y" ); + _LIT( KCamJapaneseDateFormat, "%F%Y%M%D" ); + + TTime now; + now.HomeTime(); + TLocale locale; + TBuf dateFormat; + + switch ( locale.DateFormat() ) + { + case EDateAmerican: + { + dateFormat = KCamAmericanDateFormat; + break; + } + + case EDateJapanese: + { + dateFormat = KCamJapaneseDateFormat; + break; + } + + case EDateEuropean: + default: + { + dateFormat = KCamEuropeanDateFormat; + break; + } + } + + now.FormatL( aBuffer, dateFormat ); + } + +// --------------------------------------------------------------------------- +// CamUtility::ResourceFileName +// Return the name and path of the application MBM file. +// --------------------------------------------------------------------------- +// +void CamUtility::ResourceFileName( TDes& aResName ) + { + _LIT(KResName, "z:\\resource\\apps\\cameraapp.mbm"); + + aResName = KResName(); + } + + +// --------------------------------------------------------------------------- +// CamUtility::GetMaxMmsSizeL +// Get maximum MMS message size +// --------------------------------------------------------------------------- +// +TInt CamUtility::MaxMmsSizeInBytesL() + { + const TUint32 KCCorMaxMms = 0x00000006; + + TInt maxSize = 0; + + CRepository* mmsRepository = CRepository::NewLC( KCRUidMmsEngine ); + User::LeaveIfError( mmsRepository->Get( + KMmsEngineMaximumSendSize, maxSize ) ); + + if ( !maxSize ) + { + CRepository *repository = CRepository::NewLC( KCRUidCamcorderFeatures ); + + // Maximum MMS size not defined in Camcorder local variation + // ini file, try the MMS ini file + User::LeaveIfError( repository->Get( + KCCorMaxMms, + maxSize ) ); + + CleanupStack::PopAndDestroy( repository ); + } + + const TInt KKiloByte = 1024; + // How many bytes to allocate for other things than + // video in a MMS message + const TInt KMmsSizeReserve = 5 * KKiloByte; + + // Convert to kilobytes, leave some space for other things + maxSize = Max( maxSize - KMmsSizeReserve, 0 ); + + + + //delete mmsRepository; + CleanupStack::PopAndDestroy( mmsRepository ); + return maxSize; + } + +// --------------------------------------------------------------------------- +// CcorUtility::CompareIgnoreCase +// Compare two descriptors +// --------------------------------------------------------------------------- +// +TBool CamUtility::CompareIgnoreCase( const TDesC& aFirst, + const TDesC& aSecond ) + { + // Get the standard method + TCollationMethod m = *Mem::CollationMethodByIndex( 0 ); + m.iFlags |= TCollationMethod::EFoldCase; + m.iFlags |= TCollationMethod::EIgnoreNone; + + // Magic: Collation level 3 is used + return aFirst.CompareC( aSecond, 3, &m ) == 0; + } + +// --------------------------------------------------------------------------- +// CamUtility::DeleteVideoL +// Delete a video clip. +// --------------------------------------------------------------------------- +// +void CamUtility::DeleteVideoL( const TDesC& aFilename ) + { + TInt err = CEikonEnv::Static()->FsSession().Delete( aFilename ); + if ( err && err != KErrNotFound ) + { + User::Leave( err ); + } + } + +// --------------------------------------------------------------------------- +// CamUtility::DeleteStillImageL +// Delete a still image. +// --------------------------------------------------------------------------- +// +void CamUtility::DeleteStillImageL( const TDesC& aFilename ) + { + TInt err = CEikonEnv::Static()->FsSession().Delete( aFilename ); + if ( err && err != KErrNotFound ) + { + User::Leave( err ); + } + + TFileName thumbnailPath; + GetThumbnailPath( aFilename, thumbnailPath ); + + // ignore error + CEikonEnv::Static()->FsSession().Delete( thumbnailPath ); + } + +// --------------------------------------------------------------------------- +// CamUtility::GetThumbnailPath +// Get full path to a thumbnail file corresponding to given image file. +// --------------------------------------------------------------------------- +void CamUtility::GetThumbnailPath( const TDesC& aImagePath, + TDes& aThumbnailPath ) + { + TParsePtrC parse( aImagePath ); + aThumbnailPath = parse.DriveAndPath(); + aThumbnailPath.Append( PathInfo::ImagesThumbnailPath() ); + aThumbnailPath.Append( parse.NameAndExt() ); + } + +// --------------------------------------------------------------------------- +// CamUtility::RenameStillImageL +// Rename a still image file. +// --------------------------------------------------------------------------- +// +void CamUtility::RenameStillImageL( const TDesC& aOldPath, + const TDesC& aNewName, + TDes& aNewPath ) + { + CFileMan* fileMan = CFileMan::NewL( CEikonEnv::Static()->FsSession() ); + CleanupStack::PushL( fileMan ); + + TParsePtrC parse( aOldPath ); + TFileName fullNewPath; + fullNewPath = parse.DriveAndPath(); + fullNewPath.Append( aNewName ); + fullNewPath.Append( parse.Ext() ); + + // Rename image file + User::LeaveIfError( fileMan->Rename( aOldPath, fullNewPath, 0 ) ); + // NOTE: flags = 0 --> attempting overwrite will leave + + aNewPath = fullNewPath; + + // Rename thumbnail + TFileName oldThumbPath; + TFileName newThumbPath; + GetThumbnailPath( aOldPath, oldThumbPath ); + GetThumbnailPath( aNewPath, newThumbPath ); + + // ignore error + fileMan->Rename( oldThumbPath, newThumbPath, CFileMan::EOverWrite ); + + CleanupStack::PopAndDestroy(); // fileMan + } + + +// ----------------------------------------------------------------------------- +// CamUtility::IdMatchesName +// Checks whether the window ID corresponds to the ground name supplied. +// ----------------------------------------------------------------------------- +// +TBool CamUtility::IdMatchesName( TInt aWindowId, const TDesC& aWindowGroupName ) + { + PRINT2(_L("Camera => CamUtility::IdMatchesName ( %d, %S )"), aWindowId, &aWindowGroupName ); + + const TInt KMaxWGName = 256; + + TBuf name; + + // Look up the window group name from the supplied ID. + CEikonEnv::Static()->WsSession().GetWindowGroupNameFromIdentifier( aWindowId, name ); + + // We have to do some manipulation, as the window group name string + // contains NULL seperators which will stop a normal descriptor Find + // operation from finding the string needed. + for ( TInt i=0; i CamUtility::IsBatteryPowerOK")); + TBool isBatteryOK = EFalse; // Default to battery low + + TInt strength = EBatteryStatusUnknown; + TInt result = RProperty::Get( KPSUidHWRMPowerState, KHWRMBatteryStatus, strength ); + PRINT2(_L("Camera CamUtility::IsBatteryPowerOK result=%d, strength=%d"), result, strength); + if ( result == KErrNone && strength == EBatteryStatusOk ) + { + isBatteryOK = ETrue; + } + + PRINT1(_L("Camera <= CamUtility::IsBatteryPowerOK return(%d)"), isBatteryOK); + return isBatteryOK; + } + + +// ----------------------------------------------------------------------------- +// CamUtility::IsBatteryPowerEmpty +// Returns ETrue if the battery power is empty +// ----------------------------------------------------------------------------- +// +TBool CamUtility::IsBatteryPowerEmpty() + { + PRINT(_L("Camera => CamUtility::IsBatteryPowerEmpty")); + TBool isBatteryEmpty = EFalse; + + TInt strength = EBatteryStatusUnknown; + TInt result = RProperty::Get( KPSUidHWRMPowerState, KHWRMBatteryStatus, strength ); + PRINT2(_L("Camera CamUtility::IsBatteryPowerEmpty result=%d, strength=%d"), result, strength); + if ( result == KErrNone && strength == EBatteryStatusEmpty ) + { + isBatteryEmpty = ETrue; + } + + PRINT1(_L("Camera <= CamUtility::IsBatteryPowerEmpty return(%d)"), isBatteryEmpty); + return isBatteryEmpty; + } + + +// ----------------------------------------------------------------------------- +// CamUtility::IsBatteryCharging +// Returns ETrue if the battery is being charged +// ----------------------------------------------------------------------------- +// +TBool CamUtility::IsBatteryCharging() + { + PRINT(_L("Camera => CamUtility::IsBatteryCharging")); + TBool isCharging = EFalse; // Default to not charging + + TInt charge = EChargingStatusError; + TInt result = RProperty::Get( KPSUidHWRMPowerState, KHWRMChargingStatus, charge ); + PRINT2(_L("Camera CamUtility::IsBatteryCharging result=%d, charge=%d"), result, charge); + if ( (result == KErrNone) && (charge == EChargingStatusCharging || + charge == EChargingStatusAlmostComplete || + charge == EChargingStatusChargingContinued || + charge == EChargingStatusChargingComplete) ) + { + isCharging = ETrue; + } + PRINT1(_L("Camera <= CamUtility::IsBatteryCharging return(%d)"), isCharging); + + return isCharging; + } + + +// ----------------------------------------------------------------------------- +// CamUtility::IsLocationAware() +// Returns ETrue if LocationTrail is started and valid GPS data is available +// ----------------------------------------------------------------------------- +// +TBool CamUtility::IsLocationAware() + { +#ifndef __WINSCW__ + TBool ret = EFalse; + TInt keyVal; + TInt err = RProperty::Get( KPSUidLocationTrail, KLocationTrailState, keyVal ); + if( KErrNone == err ) + { + if( KCamLocationTrailGPSDataAvail == keyVal ) + { + ret = ETrue; + } + } + return ret; +#else + return ETrue; +#endif // !__WINSCW__ + } + +// --------------------------------------------------------- +// CamUtility::SetAlphaL +// --------------------------------------------------------- +// +void CamUtility::SetAlphaL( CFbsBitmap*& aBmp, CFbsBitmap*& aMask, + TRgb aColor ) + { + // Draw EColor16MA bitmap: + CFbsBitmap* bmpWithAlpha = new (ELeave) CFbsBitmap(); + User::LeaveIfError( + bmpWithAlpha->Create( aBmp->SizeInPixels(), EColor16MA) ); + CFbsBitmapDevice* device = CFbsBitmapDevice::NewL( bmpWithAlpha ); + CleanupStack::PushL( device ); + CFbsBitGc* gc; + User::LeaveIfError( device->CreateContext(gc) ); + CleanupStack::PushL(gc); + + gc->BitBlt( TPoint(0,0), aBmp ); + delete aBmp; + aBmp = NULL; + aBmp = bmpWithAlpha; + + CleanupStack::PopAndDestroy(gc); + CleanupStack::PopAndDestroy(device); + + // Ensure mask colour depth + TSize size = aMask->SizeInPixels(); + TBool inv( EFalse ); + if ( aMask->DisplayMode() != EGray256 ) + { + CFbsBitmap* bmp256 = new (ELeave) CFbsBitmap(); + User::LeaveIfError( + bmp256->Create( size, EGray256) ); + CFbsBitmapDevice* device = CFbsBitmapDevice::NewL( bmp256 ); + CleanupStack::PushL( device ); + CFbsBitGc* gc; + User::LeaveIfError( device->CreateContext(gc) ); + CleanupStack::PushL(gc); + gc->BitBlt( TPoint(0,0), aMask ); + delete aMask; + aMask = NULL; + aMask = bmp256; + CleanupStack::PopAndDestroy(gc); + CleanupStack::PopAndDestroy(device); + inv = ETrue; + } + + // Add Alpha values: + TUint32 dPitch = CFbsBitmap::ScanLineLength( size.iWidth, EColor16MA ) / 4; + TUint32 maskPitch = CFbsBitmap::ScanLineLength( size.iWidth, EGray256 ); + aMask->LockHeap(); + aBmp->LockHeap(); + + // Component is not expected to deal with the extended bitmap. + TUint32* destAddr = reinterpret_cast( aBmp->DataAddress() ); + + for ( TUint32 y = 0; y < size.iHeight; y++ ) + { + HBufC8* maskBuf = HBufC8::NewLC( maskPitch ); + TPtr8 maskPtr = maskBuf->Des(); + aMask->GetScanLine( maskPtr, TPoint(0, y), size.iWidth, EGray256 ); + for ( TUint32 x = 0; x < size.iWidth; x++ ) + { + TUint8 value = maskPtr[x]; + if ( inv ) + { + value = ~value; + } + // Round mask value to fully opaque or transparent + if ( value > 0x7f ) + { + // Opaque pixel. + destAddr[ y * dPitch + x ] &= aColor.Internal(); + destAddr[ y * dPitch + x ] |= 0xFF000000; + } + else + { + // Transparent pixel + destAddr[ y * dPitch + x ] = 0x00000000; + } + } + CleanupStack::PopAndDestroy(maskBuf); + } + + aBmp->UnlockHeap(); + aMask->UnlockHeap(); + + // Mask is not used for drawing + delete aMask; + aMask = NULL; + } + +// --------------------------------------------------------- +// CamUtility::IsUsbActive +// --------------------------------------------------------- +// +TBool CamUtility::IsUsbActive() + { + TInt usbState; + TInt err = RProperty::Get( KPSUidCoreApplicationUIs, + KCoreAppUIsUSBFileTransfer, + usbState ); + return !err && usbState == ECoreAppUIsUSBFileTransferActive; + } + +// --------------------------------------------------------- +// CamUtility::IsNhdDevice for Layouts only +// --------------------------------------------------------- +// +TBool CamUtility::IsNhdDevice() + { + TRect screenRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); + TRect nhdRectLandscape( TSize( KCamNhdWidth, KCamNhdHeight ) ); + TRect nhdRectPortrait( TSize( KCamNhdHeight, KCamNhdWidth ) ); + + return screenRect == nhdRectLandscape || screenRect == nhdRectPortrait; + } + +// --------------------------------------------------------------------------- +// CamUtility::GetPsiInt +// Allows retrieval of product specific information (TInt) +// --------------------------------------------------------------------------- +// +#ifndef CAMERAAPP_PLUGIN_BUILD + +TInt CamUtility::GetPsiInt( TCamPsiKey aKey, TInt& aValue ) + { + aValue = KErrNotSupported; + + switch ( aKey ) + { + case ECamPsiOrientation: + case ECamPsiPrimaryCameraOrientation: + case ECamPsiSecondaryCameraOrientation: + case ECamPsiEditingOrientation: + return CamUtility::GetCommonPsiInt( aKey, aValue ); + case ECamPsiOverLaySidePane: { aValue = ETrue; break; } + case ECamPsiSidePanePosition: { aValue = ECamHandRight; break; } + case ECamPsiSoftKeyPosition: { aValue = ECamHandRight; break; } + + case ECamPsiLeftNaviKey: { aValue = ECamNaviKeyCaptureSetup; break; } + case ECamPsiLeftNaviKeyCam2: { aValue = ECamNaviKeyNone; break; } + case ECamPsiRightNaviKey: { aValue = ECamNaviKeyNone; break; } + case ECamPsiVideoZoomSupport: { aValue = ECamZoomWhenRecord; break; } + + + // Interval: return the value in units of 1000 microseconds + case ECamPsiLongCaptureKeyPressInterval: { aValue = KCaptureLongPress; break; } + case ECamPsiMaxBurstCapture: { aValue = KMaxBurstImages; break; } + case ECamPsiCourtesyUiTimeoutValue: { aValue = KCourtesyUiTimeoutValue; break; } + case ECamPsiAPEVCompLegend: { aValue = R_CAM_CAPTURE_SETUP_MENU_PHOTO_EXPOSURE_ARRAY2; break; } + default: + { + return KErrNotSupported; + } + } + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CamUtility::GetPsiIntArrayL +// Allows retrieval of product specific information (TInt array) +// --------------------------------------------------------------------------- +// +TInt CamUtility::GetPsiIntArrayL( TCamPsiKey aKey, RArray& aArray ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + CCameraUiConfigManager* configManager = appUi->AppController().UiConfigManagerPtr(); + + switch ( aKey ) + { + // Resource ids for User Scene setup items + case ECamPsiUserSceneResourceIds: + { + User::LeaveIfError( aArray.Append( R_CAM_PHOTO_USER_SCENE_SETUP_LIST_SCENEBASE_DATA ) ); + if ( configManager->IsFlashModeSupported() ) + User::LeaveIfError( aArray.Append( R_CAM_PHOTO_USER_SCENE_SETUP_LIST_FLASH_DATA ) ); + if ( configManager->IsWhiteBalanceFeatureSupported() ) + User::LeaveIfError( aArray.Append( + R_CAM_PHOTO_USER_SCENE_SETUP_LIST_WHITEBALANCE_DATA ) ); + if ( configManager->IsEVSupported() ) + User::LeaveIfError( aArray.Append( R_CAM_PHOTO_USER_SCENE_SETUP_LIST_EV_DATA2 ) ); + + if ( configManager->IsColorToneFeatureSupported() ) + User::LeaveIfError( aArray.Append( + R_CAM_PHOTO_USER_SCENE_SETUP_LIST_COLOUREFFECT_DATA ) ); + if ( configManager->IsISOSupported() ) + { + if ( configManager->IsExtendedLightSensitivitySupported() ) + { + User::LeaveIfError( aArray.Append( R_CAM_PHOTO_USER_SCENE_SETUP_LIST_EXTENDED_LIGHTSENSITIVITY_DATA ) ); + } + else { + User::LeaveIfError( aArray.Append( R_CAM_PHOTO_USER_SCENE_SETUP_LIST_LIGHTSENSITIVITY_DATA ) ); + } + } + + if ( configManager->IsSharpnessFeatureSupported() ) + User::LeaveIfError( aArray.Append( + R_CAM_PHOTO_USER_SCENE_SETUP_LIST_IMAGESHARPNESS_DATA ) ); + + if ( configManager->IsContrastSupported() ) + User::LeaveIfError( aArray.Append( R_CAM_PHOTO_USER_SCENE_SETUP_LIST_CONTRAST_DATA ) ); + + User::LeaveIfError( aArray.Append( R_CAM_PHOTO_USER_SCENE_SETUP_LIST_RESET_DATA ) ); + break; + } + // ----------------------------------------------------- + default: + { + return KErrNotSupported; + } + } + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CamUtility::GetPsiAnyL +// Allows retrieval of product specific information (TAny) +// --------------------------------------------------------------------------- +// +TInt CamUtility::GetPsiAnyL( TCamPsiKey aKey, TAny* aValue ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + CCameraUiConfigManager* uiConfigManager = appUi->AppController().UiConfigManagerPtr(); + + RArray zoomValues; + CleanupClosePushL( zoomValues ); + zoomValues.Reset(); + + typedef TPckgBuf TCamZoomStepPckg; + typedef TPckgBuf TCamTimerSetPckg; + typedef TPckgBuf TCamZoomLAFPckg; + typedef TPckgBuf TCamEVCompPckg; + + switch ( aKey ) + { + // ----------------------------------------------------- + // Self timer periods + case ECamPsiSelfTimerPeriod1: + { + // Default constructor assigns KErrNotSupported to all fields. + // See CamPSI.h. + TSelfTimerSetting timerPeriod1; + + // First period is at 2-seconds remaining, "always on" + timerPeriod1.iThreshold [0] = 2*KMicroSecPerSec; + timerPeriod1.iFlashPeriod[0] = KMaxTInt; + timerPeriod1.iBeepPeriod [0] = KMaxTInt; + + // There are no other periods + + // Autofocus triggered on "2-seconds remaining" + timerPeriod1.iAutoFocus = 2*KMicroSecPerSec; + + TCamTimerSetPckg* ptr = static_cast( aValue ); + *ptr = timerPeriod1; + break; + } + case ECamPsiSelfTimerPeriod2: + { + TSelfTimerSetting timerPeriod2; + + // First period is at 10-seconds until capture, flashing once every second. + timerPeriod2.iThreshold [0] = 10*KMicroSecPerSec; + timerPeriod2.iFlashPeriod[0] = KMicSecInHalfSec; // 500ms on/500ms off + timerPeriod2.iBeepPeriod [0] = KMicroSecPerSec; // Beep every second + + // Second period starts at 3-seconds until capture, flashing twice every second + timerPeriod2.iThreshold [1] = 5*KMicroSecPerSec; + timerPeriod2.iFlashPeriod[1] = KMicSecInQuartSec; // 250ms on/250ms off + timerPeriod2.iBeepPeriod [1] = KMicSecInHalfSec; // Beep twice every second + + // Third period is not supported + timerPeriod2.iThreshold [2] = 3*KMicroSecPerSec; + timerPeriod2.iFlashPeriod[2] = KMaxTInt; + timerPeriod2.iBeepPeriod [2] = KMaxTInt; + + // Autofocus triggered on "3-seconds remaining" + timerPeriod2.iAutoFocus = 3*KMicroSecPerSec; + + TCamTimerSetPckg* ptr = static_cast( aValue ); + *ptr = timerPeriod2; + break; + } + case ECamPsiSelfTimerPeriod3: + { + TSelfTimerSetting timerPeriod3; + + // First period is at 20-seconds until capture, flashing once every second. + timerPeriod3.iThreshold [0] = 20*KMicroSecPerSec; + timerPeriod3.iFlashPeriod[0] = KMicSecInHalfSec; // 500ms on/500ms off + timerPeriod3.iBeepPeriod [0] = KMicroSecPerSec; // Beep every second + + // Second period starts at 3-seconds until capture, flashing twice every second + timerPeriod3.iThreshold [1] = 5*KMicroSecPerSec; + timerPeriod3.iFlashPeriod[1] = KMicSecInQuartSec; // 250ms on/250ms off + timerPeriod3.iBeepPeriod [1] = KMicSecInHalfSec; // Beep twice every second + + // Third period is not supported + timerPeriod3.iThreshold [2] = 3*KMicroSecPerSec; + timerPeriod3.iFlashPeriod[2] = KMaxTInt; + timerPeriod3.iBeepPeriod [2] = KMaxTInt; + + // Autofocus triggered on "3-seconds remaining" + timerPeriod3.iAutoFocus = 3*KMicroSecPerSec; + + TCamTimerSetPckg* ptr = static_cast( aValue ); + *ptr = timerPeriod3; + break; + } + // ----------------------------------------------------- + // Zoom steps. + case ECamPsiMaxOpticalZoomSteps: + { + // Default constructor defined to initialize + // all fields to KErrNotSupported. See CamPSI.h. + TCamMaxZoomSteps optSteps; + + // No optical zoom steps supported => nothing more to set. + + TCamZoomStepPckg* ptr = static_cast( aValue ); + *ptr = optSteps; + break; + } + case ECamPsiMaxZoomSteps: + { + TCamMaxZoomSteps digSteps; + + // the order the values read are exactly in the order defined in + // TCamMaxZoomSteps + + uiConfigManager->SupportedMaxZoomStepsL( zoomValues ); + + // all the values if they are supported or not will be run-time + TInt count = zoomValues.Count()-1; + TInt i = 0; + if ( zoomValues.Count() ) + { + digSteps.iMaxPhotoStepW9MP = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStepW6MP = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStep12MP = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStep8MP = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStep5MP = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStep3MP = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStep2MP = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStep1_3MP = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStep1MP = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStep0_8MP = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStepSVGA = zoomValues[Min(count,i++)]; + digSteps.iMaxPhotoStepVGA = zoomValues[Min(count,i++)]; + + + digSteps.iMaxVideoStepHD = zoomValues[Min(count,i++)]; + digSteps.iMaxVideoStepWVGA = zoomValues[Min(count,i++)]; + digSteps.iMaxVideoStepNHD = zoomValues[Min(count,i++)]; + digSteps.iMaxVideoStepVGA = zoomValues[Min(count,i++)]; + digSteps.iMaxVideoStepQVGA = zoomValues[Min(count,i++)]; + digSteps.iMaxVideoStepCIF = zoomValues[Min(count,i++)]; + digSteps.iMaxVideoStepQCIF = zoomValues[Min(count,i++)]; + digSteps.iMaxVideoStepSQCIF = zoomValues[Min(count,i++)]; + digSteps.iMax2ndCamPhotoStep = zoomValues[Min(count,i++)]; + digSteps.iMax2ndCamVideoStepCIF = zoomValues[Min(count,i++)]; + digSteps.iMax2ndCamVideoStepQCIF = zoomValues[Min(count,i++)]; + digSteps.iMax2ndCamVideoStepSQCIF = zoomValues[Min(count,i++)]; + } + else + { + User::Leave( KErrNotSupported ); + } + TCamZoomStepPckg* ptr = static_cast( aValue ); + *ptr = digSteps; + break; + } + case ECamPsiMaxExtendedZoomSteps: + { + TCamMaxZoomSteps extSteps; + + // the order the values read are exactly in the order defined in + // TCamMaxZoomSteps + + uiConfigManager->SupportedMaxExtendedZoomStepsL( zoomValues ); + + // TODO: some kind of check to see if there are all possible values in + // the array that we ask from config manager. + TInt count = zoomValues.Count()-1; + TInt i = 0; + if ( zoomValues.Count() > 0 ) + { + extSteps.iMaxPhotoStepW9MP = zoomValues[Min(count,i++)]; + extSteps.iMaxPhotoStepW6MP = zoomValues[Min(count,i++)]; + extSteps.iMaxPhotoStep12MP = zoomValues[Min(count,i++)]; //KMaxPhoto12MPExtZoomStep; + extSteps.iMaxPhotoStep8MP = zoomValues[Min(count,i++)]; //KMaxPhoto8MPExtZoomStep; + extSteps.iMaxPhotoStep5MP = zoomValues[Min(count,i++)]; //KMaxPhoto5MPExtZoomStep; + extSteps.iMaxPhotoStep3MP = zoomValues[Min(count,i++)]; //KMaxPhoto3MPExtZoomStep; + extSteps.iMaxPhotoStep2MP = zoomValues[Min(count,i++)]; //KMaxPhoto2MPExtZoomStep; + extSteps.iMaxPhotoStep1_3MP = zoomValues[Min(count,i++)]; //KMaxPhoto1_3MPExtZoomStep; + extSteps.iMaxPhotoStep1MP = zoomValues[Min(count,i++)]; //KMaxPhoto1MPExtZoomStep; + extSteps.iMaxPhotoStep0_8MP = zoomValues[Min(count,i++)]; //KMaxPhoto0_8MPExtZoomStep; + extSteps.iMaxPhotoStepSVGA = zoomValues[Min(count,i++)]; + extSteps.iMaxPhotoStepVGA = zoomValues[Min(count,i++)]; //KMaxPhotoVGAExtZoomStep; + } + else + { + User::Leave( KErrNotSupported ); + } + TCamZoomStepPckg* ptr = static_cast( aValue ); + *ptr = extSteps; + break; + } + // ----------------------------------------------------- + // Zoom appearance + case ECamPsiZoomBarLAF: + { + const TRgb KZoomColourDig = TRgb( 255, 140, 1 ); + const TRgb KZoomColourExt = TRgb( 255, 0, 0 ); + + TCamZoomLAF zoomLAF; + uiConfigManager->SupportedLAFZoomBarL( zoomValues ); + + if ( zoomValues.Count() > 0 ) + { + // Time per zoom tick in milliseconds + zoomLAF.iZoomSpeedDig = zoomValues[0]; //KZoomSpeedDig; + // No of zoom steps per tick + zoomLAF.iZoomStepsDig = zoomValues[2]; //KZoomStepsDig; + + // Time per ext zoom tick in milliseconds + zoomLAF.iZoomSpeedExt = zoomValues[1]; //KZoomSpeedExt; + // No of ext zoom steps per tick + zoomLAF.iZoomStepsExt = zoomValues[3]; //KZoomStepsExt; + + zoomLAF.iSecondCameraZoomSteps = zoomValues[4]; //K2ndCamZoomStepSize + } + else + { + User::Leave( KErrNotSupported ); + } + + // Colour of optical zoom in zoom bar + zoomLAF.iZoomColourDig = KZoomColourDig; + // Colour of optical zoom in zoom bar + zoomLAF.iZoomColourExt = KZoomColourExt; + + TCamZoomLAFPckg* ptr = static_cast( aValue ); + *ptr = zoomLAF; + break; + } + // ----------------------------------------------------- + // Exposure compensation values + case ECamPsiEVCompSliderInfo: + { + TCamEvCompRange evComp; + + evComp.iMinValue = KEVCompMinVal; + evComp.iMaxValue = KEVCompMaxVal; + evComp.iStepsPerUnit = KEVCompStepsPerUnit; + + TCamEVCompPckg* ptr = static_cast( aValue ); + *ptr = evComp; + break; + } + // ----------------------------------------------------- + default: + { + return KErrNotSupported; + } + // ----------------------------------------------------- + } + CleanupStack::PopAndDestroy( &zoomValues ); + return KErrNone; + } + + +// --------------------------------------------------------------------------- +// CamUtility::ResourceOrientationID +// Returns the resource for the given ID, based on the current Orientation +// --------------------------------------------------------------------------- +// +TInt +CamUtility::ResourceOrientationID( TInt aDefaultResourceID ) + { + TCamOrientation orientation; + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + // Make sure the resource ID is in a valid range + TBool inValidRange = Rng( 0, aDefaultResourceID, R_CAM_LAST_RESOURCE_ID ); + __ASSERT_DEBUG( inValidRange, CamPanic(ECamPanicInvalidResource) ); + + // This should never happen, but we may be being passed the original resource number + if( !inValidRange ) { return aDefaultResourceID; } + + // Get the current orientation + // If we don't have the AppUI, + // assume the app is starting up and use the default orientation + if( appUi ) { orientation = appUi->CamOrientation(); } + else { orientation = ECamOrientationDefault; } + + __ASSERT_DEBUG( (ECamOrientationTotal > orientation), CamPanic(ECamPanicBadIndex) ); + + return KRoidLookup[aDefaultResourceID][orientation]; + } + + +// --------------------------------------------------------------------------- +// MapLightSensitivity2IsoValueL +// Maps each general light sensitivity id (TCamLightSensitivityId) +// to a product specific ISO rating. +// --------------------------------------------------------------------------- +// +TInt +CamUtility::MapLightSensitivity2IsoValueL( TCamLightSensitivityId aLightSensitivityId, RArray& aSupportedValues ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + CCameraUiConfigManager* UiConfigManager = appUi->AppController().UiConfigManagerPtr(); + + aSupportedValues.Sort(); + TInt count = aSupportedValues.Count(); + if ( count == 0 ) + { + return ECamIsoRateAuto; + } + if ( UiConfigManager->IsExtendedLightSensitivitySupported() ) + { + // Make sure there is enough supported ISO values for extended light sensitivity + // first value is 0 which means automatic, there should be 5 or more other values + TBool enoughSupported = (count > 5); + if ( !enoughSupported ) { + CamPanic(ECamPanicNotEnoughISOValuesSupported); + } + switch ( aLightSensitivityId ) + { + // Supports: 100, 200, 400, 800, 1600, 3200. + case ECamLightSensitivityLow: return aSupportedValues[1]; + case ECamLightSensitivityLowMed: return aSupportedValues[2]; + case ECamLightSensitivityMed: return aSupportedValues[3]; + case ECamLightSensitivityMedHigh: return aSupportedValues[4]; + case ECamLightSensitivityHigh: return aSupportedValues[5]; + default: return ECamIsoRateAuto; + } + } + else + { + switch ( aLightSensitivityId ) + { + case ECamLightSensitivityLow: return aSupportedValues[0]; + case ECamLightSensitivityMed: return aSupportedValues[TInt(count/2)]; + case ECamLightSensitivityHigh: return aSupportedValues[count-1]; + default: return ECamIsoRateAuto; + } + } + } + + +// --------------------------------------------------------------------------- +// MapSharpnessId2SharpnessValueL +// Maps each general sharpness value (TCamImageSharpnessId) +// to a product specific value. +// --------------------------------------------------------------------------- +// +TInt +CamUtility::MapSharpnessId2SharpnessValueL( TCamImageSharpnessId aSharpnessId ) + { + TInt sharpnessValue = 0; + RArray supportedValues; + CleanupClosePushL( supportedValues ); + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi && appUi->AppController().UiConfigManagerPtr() ) + { + appUi->AppController().UiConfigManagerPtr()->SupportedSharpnessSettingsL( + supportedValues ); + } + + if ( supportedValues.Count() > 0 ) + { + switch( aSharpnessId ) + { + case ECamImageSharpnessHard: + sharpnessValue = supportedValues[supportedValues.Count()-1]; + break; + case ECamImageSharpnessSoft: + sharpnessValue = supportedValues[0]; + break; + case ECamImageSharpnessNorm: // <> + default: + sharpnessValue = supportedValues[1]; // normal value = 0 + break; + } + } + else + { + User::Leave( KErrNotSupported ); + } + CleanupStack::PopAndDestroy( &supportedValues ); + + return sharpnessValue; + } + + +// --------------------------------------------------------------------------- +// CamUtility::MapVideoQualityToViewFinderRes +// Return resource id for viewfinder resolution for primary camera +// --------------------------------------------------------------------------- +// +TInt +CamUtility::MapVideoQualityToViewFinderRes( TCamVideoResolution aResolution ) + { + PRINT1( _L("Camera => CamUtility::MapVideoQualityToViewFinderRes res (%d)"), aResolution ) + switch( aResolution ) + { + case ECamVideoResolutionVGA: return R_CAM_VIEWFINDER_RECT_QVGA_CAMCORDER; + case ECamVideoResolutionQVGA: return R_CAM_VIEWFINDER_RECT_QVGA_CAMCORDER; + case ECamVideoResolutionQCIF: return R_CAM_VIEWFINDER_RECT_CIF_CAMCORDER_ADJUSTED; + default: return R_CAM_VIEWFINDER_RECT_QVGA_CAMCORDER; + } + } + +#endif // CAMERAAPP_PLUGIN_BUILD +// --------------------------------------------------------------------------- +// CamUtility::GetCommonPsiInt +// Allows retrieval of product specific information (TInt) +// --------------------------------------------------------------------------- +// +TInt CamUtility::GetCommonPsiInt( TCamPsiKey aKey, TInt& aValue ) + { + aValue = KErrNotSupported; + + switch ( aKey ) + { + case ECamPsiOrientation: { aValue = CAknAppUiBase::EAppUiOrientationLandscape; break; } + case ECamPsiPrimaryCameraOrientation: { aValue = CAknAppUiBase::EAppUiOrientationLandscape; break; } + case ECamPsiSecondaryCameraOrientation: { aValue = CAknAppUiBase::EAppUiOrientationPortrait; break; } + case ECamPsiEditingOrientation: { aValue = CAknAppUiBase::EAppUiOrientationPortrait; break; } + + default: + { + return KErrNotSupported; + } + } + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CamUtility::IsQwertyOpen +// ----------------------------------------------------------------------------- +// +TBool CamUtility::IsQwertyOpen() + { + TBool retvalue = EFalse; + TInt status = 0; + TInt err = RProperty::Get( KCRUidAvkon, KAknQwertyInputModeActive, status ); + PRINT2(_L("Camera <> CamUtility::IsQwertyOpen err%d status%d"),err, status); + if ( !err && status ) + { + retvalue = ETrue; + } + return retvalue; + } + + +// ----------------------------------------------------------------------------- +// CamUtility::ViewfinderLayout +// +// Get resolution from CCamAppController::GetCurrentVideoResolution() +// or CCamAppController::GetCurrentImageResolution(). +// +// ----------------------------------------------------------------------------- +// +TRect +CamUtility::ViewfinderLayout( TCamCameraMode aMode, + TInt aResolution ) + { + PRINT1( _L("Camera => CamUtility::ViewfinderLayout - resolution[%d]"), aResolution ); + + TAknWindowLineLayout l = IsNhdDevice() + ? ViewfinderLayoutTouch(aMode, aResolution) + : ViewfinderLayoutNonTouch(aMode, aResolution); + + TRect screenRect; + if ( Layout_Meta_Data::IsLandscapeOrientation() || IsNhdDevice() ) + { + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); + } + else + { + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); + } + + TAknLayoutRect vfLayoutRect; + vfLayoutRect.LayoutRect( screenRect, l ); + TRect vfRect( vfLayoutRect.Rect() ); + + PRINT4( _L("Camera <= CamUtility::ViewfinderLayout - rect[x:%d y:%d w:%d h:%d]"), + vfRect.iTl.iX, vfRect.iTl.iY, vfRect.Width(), vfRect.Height() ); + + return vfRect; + } + + +// ----------------------------------------------------------------------------- +// CamUtility::ViewfinderLayoutTouch +// +// ----------------------------------------------------------------------------- +// +TAknWindowLineLayout +CamUtility::ViewfinderLayoutTouch( TCamCameraMode aMode, + TInt aResolution ) + { + TInt variant = Layout_Meta_Data::IsLandscapeOrientation(); + + // Default to 4:3 full screen + TAknWindowLineLayout l = + AknLayoutScalable_Apps::cam4_image_uncrop_pane( variant ); + + // ------------------------------------------------------- + // Video mode + if ( ECamControllerVideo == aMode ) + { + switch( aResolution ) + { + case ECamVideoResolutionQCIF: + case ECamVideoResolutionCIF: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutTouch - QCIF/CIF video resolution") ); + l = AknLayoutScalable_Apps::video4_image_uncrop_cif_pane( variant ); + break; + } + case ECamVideoResolutionNHD: + case ECamVideoResolutionHD: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutTouch - nHD/HD video resolution") ); + l = AknLayoutScalable_Apps::video4_image_uncrop_nhd_pane( variant ); + break; + } + default: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutTouch - 4:3 video resolution") ); + // All other video resolutions are expected to + // have 4:3 aspect ratio + l = AknLayoutScalable_Apps::video4_image_uncrop_vga_pane( variant ); + break; + } + } + } + // ------------------------------------------------------- + // Image mode + else if ( ECamControllerImage == aMode ) + { + switch( aResolution ) + { + case ECamPhotoSizeW9MP: + case ECamPhotoSizeW6MP: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutTouch - 16:9 still image resolution") ); + l = AknLayoutScalable_Apps::video4_image_uncrop_nhd_pane( variant ); + break; + } + default: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutTouch - 4:3 still image resolution") ); + l = AknLayoutScalable_Apps::cam4_image_uncrop_pane( variant ); + break; + } + } + } + // ------------------------------------------------------- + + return l; + } + + + +// --------------------------------------------------------------------------- +// CamUtility::ViewfinderLayoutNonTouch +// --------------------------------------------------------------------------- +// +TAknWindowLineLayout +CamUtility::ViewfinderLayoutNonTouch( TCamCameraMode aMode, + TInt aResolution ) + { + TInt variant = Layout_Meta_Data::IsLandscapeOrientation() ? 0 : 3; + + TAknWindowLineLayout l = + AknLayoutScalable_Apps::cam6_image_uncrop_pane( variant ); + + // ------------------------------------------------------- + // Video mode + if ( ECamControllerVideo == aMode ) + { + switch( aResolution ) + { + case ECamVideoResolutionQCIF: + case ECamVideoResolutionCIF: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutNonTouch - QCIF/CIF video resolution") ); + l = AknLayoutScalable_Apps::vid6_image_uncrop_cif_pane( variant ); + break; + } + case ECamVideoResolutionNHD: + case ECamVideoResolutionHD: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutNonTouch - nHD/HD video resolution") ); + l = AknLayoutScalable_Apps::vid6_image_uncrop_nhd_pane( variant ); + break; + } + case ECamVideoResolutionWVGA: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutNonTouch - WVGA video resolution") ); + l = AknLayoutScalable_Apps::vid6_image_uncrop_wvga_pane( variant ); + break; + } + default: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutNonTouch - 4:3 video resolution") ); + // All other video resolutions are expected to + // have 4:3 aspect ratio + l = AknLayoutScalable_Apps::vid6_image_uncrop_vga_pane( variant ); + break; + } + } + } + // ------------------------------------------------------- + // Image mode + else + { + switch( aResolution ) + { + case ECamPhotoSizeW9MP: + case ECamPhotoSizeW6MP: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutNonTouch - 16:9 still image resolution") ); + l = AknLayoutScalable_Apps::vid6_image_uncrop_nhd_pane( variant ); + } + default: + { + PRINT( _L("Camera <> CamUtility::ViewfinderLayoutNonTouch - 4:3 still image resolution") ); + l = AknLayoutScalable_Apps::cam6_image_uncrop_pane( variant ); + break; + } + } + } + // ------------------------------------------------------- + + return l; + } + + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/CamVideoQualityLevel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/CamVideoQualityLevel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,322 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Stores video qulaity leve linformation read from resource file* +*/ + + + +// INCLUDE FILES + +#include // CnvUtfConverter +#include "CameraVariant.hrh" + + +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "CamVideoQualityLevel.h" +#include "camlogging.h" +#include "CamUtility.h" + + +const TInt KQualityMaxStringLength = 64; + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::CCamVideoQualityLevel +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamVideoQualityLevel::CCamVideoQualityLevel() + { + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::ConstructFromResourceL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamVideoQualityLevel::ConstructFromResourceL( TResourceReader& aReader ) + { + // read identifier for this quality level + iQualityLevel = aReader.ReadInt16(); + // read resolution + iVideoResolution = TVideoResolution(aReader.ReadInt16()); + // read frame rate + iVideoFrameRate = aReader.ReadReal64(); + // read video bitrate + iVideoBitRate = aReader.ReadInt32(); + // read audio bitrate + iAudioBitRate = aReader.ReadInt32(); + // read mime type + iVideoMimeType = ReadHBufC8L( aReader ); + // read preferred supplier + iPreferredSupplier = aReader.ReadHBufC16L(); + // read video codec + iVideoCodec = ReadHBufC8L( aReader ); + // read audio codec + iAudioCodec = ReadHBufC8L( aReader ); + // read file type + iVideoFileType = aReader.ReadInt16(); + // read length + iVideoLength = aReader.ReadInt16(); + + // if sharing quality - check the flags +/* if ( iQualityLevel == ECamVideoQualitySharing ) + { + // sharing should be subqcif + if ( aVariantFlags & KCamCrQualityVideoSharingIsSubQCIF ) + { + iVideoResolution = ECamVideoResolutionSubQCIF; + } + } */ + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamVideoQualityLevel::ConstructL( TVideoQualitySettings& aSettings ) + { + // read identifier for this quality level + iQualityLevel = aSettings.iQualityLevel; + // read resolution + iVideoResolution = TVideoResolution(aSettings.iVideoResolution); + // read frame rate + iVideoFrameRate = aSettings.iVideoFrameRate; + // read video bitrate + iVideoBitRate = aSettings.iVideoBitRate; + // read audio bitrate + iAudioBitRate = aSettings.iAudioBitRate; + + // read mime type + iVideoMimeType = HBufC8::NewL( KQualityMaxStringLength ); + iVideoMimeType->Des().Copy(aSettings.iVideoMimeType); + + // read preferred supplier + iPreferredSupplier = HBufC::NewL( KQualityMaxStringLength ) ; + iPreferredSupplier->Des().Copy( aSettings.iPreferredSupplier); + + // read video codec + iVideoCodec = HBufC8::NewL( KQualityMaxStringLength ); + iVideoCodec->Des().Copy( aSettings.iVideoCodec ); + // read audio codec + iAudioCodec = HBufC8::NewL( KQualityMaxStringLength ); + iAudioCodec->Des().Copy( aSettings.iAudioCodec ); + + // read file type* + iVideoFileType = aSettings.iVideoFileType; + // read length + iVideoLength = aSettings.iVideoLength; + + // if sharing quality - check the flags +/* if ( iQualityLevel == ECamVideoQualitySharing ) + { + // sharing should be subqcif + if ( aVariantFlags & KCamCrQualityVideoSharingIsSubQCIF ) + { + iVideoResolution = ECamVideoResolutionSubQCIF; + } + }*/ + } + + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamVideoQualityLevel* CCamVideoQualityLevel::NewL( TResourceReader& aReader ) + { + CCamVideoQualityLevel* self = new( ELeave ) CCamVideoQualityLevel; + + CleanupStack::PushL( self ); + self->ConstructFromResourceL( aReader ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamVideoQualityLevel* CCamVideoQualityLevel::NewL( TVideoQualitySettings& aSettings ) + { + CCamVideoQualityLevel* self = new( ELeave ) CCamVideoQualityLevel; + CleanupStack::PushL( self ); + self->ConstructL( aSettings ); + CleanupStack::Pop(); + + return self; + } + +// Destructor +CCamVideoQualityLevel::~CCamVideoQualityLevel() + { + PRINT( _L("Camera => ~CCamVideoQualityLevel" )); + delete iVideoMimeType; + delete iPreferredSupplier; + delete iVideoCodec; + delete iAudioCodec; + PRINT( _L("Camera <= ~CCamVideoQualityLevel" )); + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::VideoResolution +// Return video resolution associated with this quality level +// ----------------------------------------------------------------------------- +// +TVideoResolution CCamVideoQualityLevel::VideoResolution() + { + return iVideoResolution; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::FrameRate +// Return video frame rate associated with this quality level +// ----------------------------------------------------------------------------- +// +TReal CCamVideoQualityLevel::FrameRate() + { + return iVideoFrameRate; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::VideoBitRate +// Return video bitrate associated with this quality level +// ----------------------------------------------------------------------------- +// +TInt CCamVideoQualityLevel::VideoBitRate() + { + return iVideoBitRate; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::AudioBitRate +// Return audio bitrate associated with this quality level identifier +// ----------------------------------------------------------------------------- +// +TInt CCamVideoQualityLevel::AudioBitRate() + { + return iAudioBitRate; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::VideoMimeType +// Return mime type required associated with this video quality level +// ----------------------------------------------------------------------------- +// +TPtrC8 CCamVideoQualityLevel::VideoMimeType() + { + return *iVideoMimeType; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::PreferredSupplier +// Return preferred supplier value associated with this video quality level +// ----------------------------------------------------------------------------- +// +TPtrC CCamVideoQualityLevel::PreferredSupplier() + { + return *iPreferredSupplier; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::VideoFileType +// Return video codec associated with this video quality level +// ----------------------------------------------------------------------------- +// +TPtrC8 CCamVideoQualityLevel::VideoFileType() + { + return *iVideoCodec; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::AudioType +// Return audio codec associated with this video quality level +// ----------------------------------------------------------------------------- +// +TPtrC8 CCamVideoQualityLevel::AudioType() + { + return *iAudioCodec; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::VideoType +// Return file type identier associated with this video quality level +// either Mpeg4 or 3GP +// ----------------------------------------------------------------------------- +// +TInt CCamVideoQualityLevel::VideoType() + { + return iVideoFileType; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::VideoLength +// Return length associated with this video quality level +// either max or short +// ----------------------------------------------------------------------------- +// +TInt CCamVideoQualityLevel::VideoLength() + { + return iVideoLength; + } + +// ----------------------------------------------------------------------------- +// CCamVideoQualityLevel::VideoQuality +// Return video quality level +// ----------------------------------------------------------------------------- +// +TInt CCamVideoQualityLevel::VideoQuality() + { + return iQualityLevel; + } + +// --------------------------------------------------------------------------- +// CCamVideoQualityLevel::ReadHBufC8L +// Reads an LTEXT element from resources and returns +// it as HBufC8. +// --------------------------------------------------------------------------- +// +HBufC8* CCamVideoQualityLevel::ReadHBufC8L( TResourceReader& aReader ) const + { + HBufC* tempBuf = NULL; + tempBuf = aReader.ReadHBufCL(); + if ( !tempBuf ) + { + return NULL; + } + + CleanupStack::PushL( tempBuf ); + + // Assume aSource only contains 7-bit ASCII characters. + // (ie. length of the string in UTF-8 is equal to the number of + // characters) + HBufC8* res = HBufC8::NewLC( tempBuf->Length() ); + TPtr8 resPtr( res->Des() ); + TPtr16 sourcePtr( tempBuf->Des() ); + CnvUtfConverter::ConvertFromUnicodeToUtf8( resPtr, sourcePtr ); + CleanupStack::Pop(); // res + CleanupStack::PopAndDestroy(); // tempBuf + return res; + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/CamWaitDialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/CamWaitDialog.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wait dialog that doesn't consume key events* +*/ + + + +// INCLUDE FILES +#include "CamWaitDialog.h" +#include "CamUtility.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// CCamWaitDialog::CCamWaitDialog +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamWaitDialog::CCamWaitDialog( CEikDialog** aSelfPtr, + TBool aVisibilityDelayOff ) + : CAknWaitDialog( aSelfPtr, aVisibilityDelayOff ) + { + } + +// --------------------------------------------------------------------------- +// CCamWaitDialog::~CCamWaitDialog +// C++ destructor +// --------------------------------------------------------------------------- +// +CCamWaitDialog::~CCamWaitDialog() + { + iNonConsumedKeys.Close(); + } + +// --------------------------------------------------------------------------- +// CCamWaitDialog::OfferKeyEventL +// Key event handling +// --------------------------------------------------------------------------- +// +TKeyResponse +CCamWaitDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + PRINT( _L("Camera => CCamWaitDialog::OfferKeyEventL") ); + if ( KErrNotFound != iNonConsumedKeys.Find( aKeyEvent.iScanCode ) ) + { + PRINT( _L("Camera <= CCamWaitDialog::OfferKeyEventL not consumed") ); + return EKeyWasNotConsumed; + } + else + { + PRINT( _L("Camera <= CCamWaitDialog::OfferKeyEventL offer to CAknWaitDialog") ); + return CAknWaitDialog::OfferKeyEventL( aKeyEvent, aType ); + } + } + + +// --------------------------------------------------------------------------- +// CCamWaitDialog::SetNonConsumedKeysL +// +// --------------------------------------------------------------------------- +// +void +CCamWaitDialog::SetNonConsumedKeysL( const RArray& aNonConsumedKeys ) + { + TInt n = aNonConsumedKeys.Count(); + + iNonConsumedKeys.Reset(); + for( TInt i = 0; i < n; i++ ) + { + User::LeaveIfError( iNonConsumedKeys.Append( aNonConsumedKeys[i] ) ); + } + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/camconfiguration.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/camconfiguration.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1198 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Dynamic Configuration +* +*/ + + +#include // RDebug +#include "camconfiguration.h" +#include "camconfigurationutility.h" +#include "imagingconfigmanager.h" +#include "CamUtility.h" +#include "camconfigurationconstants.h" + +const TInt KReserveedSpace = 160000; + +// --------------------------------------------------------------------------- +// CCamConfiguration::CCamConfiguration +// --------------------------------------------------------------------------- +// +CCamConfiguration::CCamConfiguration(): + iPrimaryCameraDisplayId( KCamPrimaryCameraDisplayId ), + iSecondaryCameraDisplayId( KCamSecondaryCameraDisplayId ) + { + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::~CCamConfiguration +// --------------------------------------------------------------------------- +// +CCamConfiguration::~CCamConfiguration() + { + // Quality data arrays + iPrimaryCameraPhotoQualities.Close(); + iSecondaryCameraPhotoQualities.Close(); + iVideoQualities.Close(); + + delete iIcm; + + // String data + for( TInt i=iStrings8.Count()-1; i>=0; i-- ) + { + HBufC8* str = iStrings8[i]; + iStrings8.Remove( i ); + delete str; + } + iStrings8.Close(); + for( TInt i=iStrings16.Count()-1; i>=0; i-- ) + { + HBufC16* str = iStrings16[i]; + iStrings16.Remove( i ); + delete str; + } + iStrings16.Close(); + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::NewL +// --------------------------------------------------------------------------- +// +CCamConfiguration* +CCamConfiguration::NewL() + { + CCamConfiguration* self = new (ELeave) CCamConfiguration; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::ConstructL +// --------------------------------------------------------------------------- +// +void +CCamConfiguration::ConstructL() + { + PRINT( _L("Camera => CCamConfiguration::ConstructL") ); + + PRINT( _L("Camera <> CCamConfiguration::ConstructL - Instantiate ICM") ); + iIcm = CImagingConfigManager::NewL(); + + PRINT( _L("Camera <> CCamConfiguration::ConstructL - Init image qualities") ); + InitializeImageQualitiesL(); + + PRINT( _L("Camera <> CCamConfiguration::ConstructL - Init video qualities") ); + InitializeVideoQualitiesL(); + + PRINT( _L("Camera <= CCamConfiguration::ConstructL") ); + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::InitializeImageQualitiesL +// --------------------------------------------------------------------------- +// +void +CCamConfiguration::InitializeImageQualitiesL() + { + PRINT( _L("Camera => CCamConfiguration::InitializeImageQualitiesL") ); + TInt totalLevels = iIcm->NumberOfImageQualityLevels(); + + CArrayFixFlat* levels + = new (ELeave) CArrayFixFlat( totalLevels ); + CleanupStack::PushL( levels ); + TImageQualitySet set; + TCamImageQualityData data; + + // Get primary camera levels + if( iPrimaryCameraDisplayId ) + { + PRINT( _L("Camera <> CCamConfiguration::InitializeImageQualitiesL *** Primary camera qualities ***") ); + iIcm->GetImageQualityLevelsL( *levels, iPrimaryCameraDisplayId ); + TInt numLevels( levels->Count() ); + PRINT1(_L("Camera <> CCamConfiguration::InitializeImageQualitiesL - Total number of levels: %d"), numLevels ); + + for( int i=0; iGetImageQualitySet( set, levels->At( i ), iPrimaryCameraDisplayId ); + if( set.iCamcorderVisible > 0 ) + { + PRINT1( _L("Camera <> CCamConfiguration::InitializeImageQualitiesL - Set %d CamcorderVisible"), i ); + + InitializeImageQualityL( set, data ); + AddToOrderedImageQualitiesArrayL( data, iPrimaryCameraPhotoQualities ); + } + } + } + + // Adjust print qualities - print => print high/print/print low + CamConfigurationUtility::AdjustPrintQualities( iPrimaryCameraPhotoQualities ); + TInt numQualities = iPrimaryCameraPhotoQualities.Count(); + + // Get secondary camera levels + if( iSecondaryCameraDisplayId ) + { + PRINT( _L("Camera <> CCamConfiguration::InitializeImageQualitiesL() *** Secondary camera qualities ***") ); + iIcm->GetImageQualityLevelsL( *levels, iSecondaryCameraDisplayId ); + TInt numLevels( levels->Count() ); + PRINT1( _L("Camera <> CCamConfiguration::InitializeImageQualitiesL - Total number of levels: %d"), numLevels ); + + for( int i=0; iGetImageQualitySet( set, levels->At( i ), iSecondaryCameraDisplayId ); + if( set.iCamcorderVisible > 0 ) + { + PRINT1( _L("Camera <> CCamConfiguration::InitializeImageQualitiesL - Set %d CamcorderVisible"), i ); + + InitializeImageQualityL( set, data ); + + // Force image quality to secondary + // data.iPhotoQualitySetting.iPhotoQualityId = EImageQualitySecondary; + data.iPhotoQualitySetting.iPhotoQualityId + = static_cast( numQualities++ ); + data.iPhotoSize.iQualitySettingId = ECamImageQualitySecondary; + + AddToOrderedImageQualitiesArrayL( data, iSecondaryCameraPhotoQualities ); + } + } + } + + CleanupStack::PopAndDestroy( levels ); + + PRINT( _L("Camera <= CCamConfiguration::InitializeImageQualitiesL") ); + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::InitializeVideoQualitiesL +// --------------------------------------------------------------------------- +// +void +CCamConfiguration::InitializeVideoQualitiesL() + { + PRINT(_L("Camera => CCamConfiguration::InitializeVideoQualitiesL") ); + TInt totalLevels = iIcm->NumberOfVideoQualityLevels(); + CArrayFixFlat* levels + = new (ELeave) CArrayFixFlat( totalLevels ); + CleanupStack::PushL( levels ); + TVideoQualitySet set; + + // Get primary camera levels + if( iPrimaryCameraDisplayId ) + { + iIcm->GetVideoQualityLevelsL( *levels, iPrimaryCameraDisplayId ); + TInt numLevels( levels->Count() ); + PRINT1(_L("Camera <> CCamConfiguration::InitializeVideoQualitiesL - Total number of levels: %d"), numLevels ); + + for( int i=0; iGetVideoQualitySet( set, levels->At( i ), iPrimaryCameraDisplayId ); + if( set.iCamcorderVisible > 0 ) + { + PRINT1(_L("Camera <> CCamConfiguration::InitializeVideoQualitiesL - Set %d CamcorderVisible"), i ); + + TCamVideoQualityData data( CreateVideoQualityDataL( set ) ); + AddToOrderedVideoQualitiesArrayL( data, iVideoQualities ); + } + } + + // Set the video quality values now that we have all data in sorted array + CamConfigurationUtility::SetVideoQualityLevels( iVideoQualities ); + } + + // Secondary camera video qualities from ICM are ignored. + // The last primary camera quality is used in seconcary camera as well. + + CleanupStack::PopAndDestroy( levels ); + + // Get the average video bitrate scaler + TCamcorderMMFPluginSettings mmfPluginSettings; + User::LeaveIfError( iIcm->GetCamcorderMMFPluginSettings( mmfPluginSettings ) ); + iCMRAvgVideoBitRateScaler = mmfPluginSettings.iCMRAvgVideoBitRateScaler; + + PRINT( _L("Camera <= CCamConfiguration::InitializeVideoQualitiesL") ); + } + + +// --------------------------------------------------------------------------- +// CCamConfiguration::InitializeVideoQualitiesL +// --------------------------------------------------------------------------- +// +void +CCamConfiguration::AddToOrderedImageQualitiesArrayL( TCamImageQualityData& aQuality, + RArray& aArray ) + { + TBool added = EFalse; + TInt numQualities = aArray.Count(); + TInt numPixels = aQuality.iPhotoSize.iWidth*aQuality.iPhotoSize.iHeight; + + for( TInt i=0; i& aArray ) + { + TBool added( EFalse ); + const TInt numQualities( aArray.Count() ); + const TInt currValue( aQuality.iDescription ); + + for( TInt i=0; i currValue ) + { + // aQuality should be before quality aArray[i] + aArray.InsertL( aQuality, i ); + added = ETrue; + break; + } + } + + if( !added ) + { + // Item is to be last in the array + aArray.AppendL( aQuality ); + } + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::InitializeImageQualityL +// --------------------------------------------------------------------------- +// +void +CCamConfiguration::InitializeImageQualityL( const TImageQualitySet& aSet, TCamImageQualityData& aData ) + { + PRINT3( _L("Camera => CCamConfiguration::InitializeImageQualityL - res: (%d, %d), compression: %d" ), + aSet.iImageWidth, aSet.iImageHeight, aSet.iCompressionQuality ); + // Find out the image quality/resolution id for the set + TInt index = KErrNotFound; + for( int i=0; i not supported + User::Leave( KErrNotSupported ); + } + + aData.iPhotoQualitySetting.iPhotoQualityId = KCamImageQualityMappings[index][type].iQuality; + aData.iQualityIcons = KCamImageIcons[ aData.iDescription ]; + + PRINT( _L("Camera <= CCamConfiguration::InitializeImageQualityL") ); + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::GetPsiIntArrayL +// --------------------------------------------------------------------------- +// +void +CCamConfiguration::GetPsiIntArrayL( TCamPsiKey aKey, RArray& aArray ) const + { + PRINT1( _L("Camera => CCamConfiguration::GetPsiIntArrayL Key: %d"), aKey ); + switch( aKey ) + { + case ECamPsiSupportedStillResolutions: + { + // Despite the name, returns array of TCamPhotoSizeId + // The array contents must be ordered in TCamPhotoSizeId enum order + for( TInt i=0; i CCamConfiguration::GetPsiIntArrayL - Unknown key!") ); + User::Panic( KCamConfigPanicId, ECamConfigPanicUnknownKey ); + } + + } + PRINT( _L("Camera <= CCamConfiguration::GetPsiIntArrayL") ); + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::AppendIfSupportedL +// --------------------------------------------------------------------------- +// +void +CCamConfiguration::AppendIfSupportedL( TCamItemType aCheckType, TInt aValue, + RArray&aArray, TCamItemType aAppendType ) const + { + TInt n( iPrimaryCameraPhotoQualities.Count() ); + for( TInt i=0; i&aArray, const TCamImageQualityData& aData ) + { + switch( aType ) + { + case ECamItemSettingsIconId: + { + aArray.AppendL( aData.iQualityIcons.iSettingsIconId ); + aArray.AppendL( aData.iQualityIcons.iSettingsIconMask ); + break; + } + case ECamItemPrecapIconId: + { + aArray.AppendL( aData.iQualityIcons.iPrecapIconId ); + aArray.AppendL( aData.iQualityIcons.iPrecapIconMask ); + break; + } + case ECamItemPhotoJpegSize: + { + aArray.AppendL( aData.iFileSize ); + break; + } + case ECamItemSeqPostProcSize: + { + aArray.AppendL( aData.iFileSize ); + break; + } + default: + { + User::Panic( KCamConfigPanicId, ECamConfigPanicUnknownType ); + } + } + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::NumImageQualities +// --------------------------------------------------------------------------- +// +TInt +CCamConfiguration::NumImageQualities() const + { + TInt count( iPrimaryCameraPhotoQualities.Count() ); + if( iSecondaryCameraPhotoQualities.Count() > 0 ) + { + // Only one quality currently supported for secondary cam + count++; + // count += iSecondaryCameraPhotoQualities.Count(); + } + + return count; + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::SecondaryCameraImageQuality +// --------------------------------------------------------------------------- +// +TInt +CCamConfiguration::MmsImageQuality() const + { + // As the primary camera image qualities are sorted, MMS quality is the + // last one in the qualities array. + TInt index = iPrimaryCameraPhotoQualities.Count()-1; + + return index < 0 ? + KErrNotFound : + iPrimaryCameraPhotoQualities[index].iPhotoQualitySetting.iPhotoQualityId; + } + + +// --------------------------------------------------------------------------- +// CCamConfiguration::SecondaryCameraImageQuality +// --------------------------------------------------------------------------- +// +TInt +CCamConfiguration::SecondaryCameraImageQuality() const + { + if( iSecondaryCameraPhotoQualities.Count() > 0 ) + { + return iSecondaryCameraPhotoQualities[0].iPhotoQualitySetting.iPhotoQualityId; + } + + return KErrNotFound; + } + + +// --------------------------------------------------------------------------- +// CCamConfiguration::ImageQuality +// --------------------------------------------------------------------------- +// +const TCamPhotoQualitySetting& +CCamConfiguration::ImageQuality( TInt aIndex ) const + { + const TInt count( iPrimaryCameraPhotoQualities.Count() ); + if( aIndex >= 0 && aIndex < count ) + { + return iPrimaryCameraPhotoQualities[aIndex].iPhotoQualitySetting; + } + else + { + TInt secIndex = aIndex - count; + if( secIndex >= 0 && + secIndex < iSecondaryCameraPhotoQualities.Count() ) + { + return iSecondaryCameraPhotoQualities[secIndex].iPhotoQualitySetting; + } + + User::Panic( KCamConfigPanicId, ECamConfigPanicNoQuality ); + return iPrimaryCameraPhotoQualities[0].iPhotoQualitySetting; // Get rid of warning + } + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::ImageQualityData +// --------------------------------------------------------------------------- +// +const TCamImageQualityData& +CCamConfiguration::ImageQualityData( TInt aIndex ) const + { + const TInt count( iPrimaryCameraPhotoQualities.Count() ); + if( aIndex >= 0 && aIndex < count ) + { + return iPrimaryCameraPhotoQualities[aIndex]; + } + else + { + TInt secIndex = aIndex - count; + if( secIndex >= 0 && + secIndex < iSecondaryCameraPhotoQualities.Count() ) + { + return iSecondaryCameraPhotoQualities[secIndex]; + } + + User::Panic( KCamConfigPanicId, ECamConfigPanicNoQuality ); + return iPrimaryCameraPhotoQualities[0]; // Get rid of warning + } + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::NumVideoQualities +// --------------------------------------------------------------------------- +// +TInt +CCamConfiguration::NumVideoQualities() const + { + return iVideoQualities.Count(); + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::NumPrimaryImageQualities +// --------------------------------------------------------------------------- +// +TInt +CCamConfiguration::NumPrimaryImageQualities() const + { + return iPrimaryCameraPhotoQualities.Count(); + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::SecondaryCameraVideoQuality +// --------------------------------------------------------------------------- +// +TInt +CCamConfiguration::SecondaryCameraVideoQuality() const + { + // Currently always the last of the video qualities + // Currently always the last of the video qualities + // As the camera video qualities are sorted, sharing quality is the + // last one in the qualities array. + TInt index = NumVideoQualities()-1; + + return index < 0 ? + KErrNotFound : + iVideoQualities[index].iQualitySettings.iQualityLevel; + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::VideoQualitySetting +// --------------------------------------------------------------------------- +// +TInt +CCamConfiguration::VideoQualitySetting( TInt aIndex ) const + { + return iVideoQualities[aIndex].iQualitySetting; + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::VideoQuality +// --------------------------------------------------------------------------- +// +const TVideoQualitySettings& +CCamConfiguration::VideoQuality( TInt aIndex ) const + { + return iVideoQualities[aIndex].iQualitySettings; + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::MapSupportedQualityToQualityDescriptor +// --------------------------------------------------------------------------- +// +TInt +CCamConfiguration::MapSupportedQualityToQualityDescriptor( TBool aVideoMode, + TInt aQualityVal ) const + { + if( aVideoMode ) + { + // Video mode + TInt n = iVideoQualities.Count(); + for( TInt i=0; i Not supported + User::Panic( KCamConfigPanicId, ECamConfigPanicNoDescription ); + return KErrNotSupported; + } + else + { + // Image mode + TInt n = iPrimaryCameraPhotoQualities.Count(); + for( TInt i=0; i Not supported + User::Panic( KCamConfigPanicId, ECamConfigPanicNoDescription ); + return KErrNotSupported; + } + + } + + +// --------------------------------------------------------------------------- +// CCamConfiguration::MapPhotoSizeToResolution +// --------------------------------------------------------------------------- +// +TCamImageResolution +CCamConfiguration::MapPhotoSizeToResolution( TCamPhotoSizeId aSizeId ) + { + for( TInt i=0; i CamUtility::ImagesRemaining") ); + TInt64 memoryfree = 0; + + // Get the current amount of free memory on the phone. + switch ( aStorage ) + { + case ECamMediaStoragePhone: + memoryfree + = CamUtility::MemoryFree( DriveInfo::EDefaultPhoneMemory, + aCriticalLevel ); + break; + + case ECamMediaStorageCard: + PRINT( _L("Camera => CamUtility::ImagesRemaining, ECamMediaStorageCard") ); + memoryfree + = CamUtility::MemoryFree( DriveInfo::EDefaultRemovableMassStorage, + aCriticalLevel ); + break; + + case ECamMediaStorageMassStorage: + PRINT( _L("Camera => CamUtility::ImagesRemaining, ECamMediaStorageMassStorage") ); + memoryfree + = CamUtility::MemoryFree( DriveInfo::EDefaultMassStorage, + aCriticalLevel ); + break; + default: + PRINT( _L("Camera => CamUtility::ImagesRemaining, default") ); + break; + }; + + TInt size = 1; + + TInt n=NumImageQualities(); + for( TInt i=0; i( images ); // (nothing greater than TInt) + } + + +// --------------------------------------------------------------------------- +// CCamConfiguration::AllocString8L +// --------------------------------------------------------------------------- +// +const TUint8* +CCamConfiguration::AllocString8L( const TUint8* aData ) + { + TPtrC8 ptr( aData ); + HBufC8* data = HBufC8::NewLC( ptr.Length() + 1 ); + data->Des().Copy( ptr ); + data->Des().Append( '\0' ); + + iStrings8.AppendL( data ); + + CleanupStack::Pop( data ); + + return data->Ptr(); + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::AllocString16L +// --------------------------------------------------------------------------- +// +const TUint16* +CCamConfiguration::AllocString16L( const TUint8* aData ) + { + TPtrC8 ptr( aData ); + HBufC16* data = HBufC16::NewLC( ptr.Length() + 1 ); + data->Des().Copy( ptr ); + data->Des().Append( '\0' ); + + iStrings16.AppendL( data ); + + CleanupStack::Pop( data ); + + return data->Ptr(); + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::CreateVideoQualityDataL +// --------------------------------------------------------------------------- +// +TCamVideoQualityData +CCamConfiguration::CreateVideoQualityDataL( const TVideoQualitySet& aSet ) + { + PRINT3( _L("Camera => CCamConfiguration::CreateVideoQualityDataL - res: (%d, %d), video bitrate: %d" ), + aSet.iVideoWidth, aSet.iVideoHeight, aSet.iVideoBitRate ); + + TInt resIndex( CamConfigurationUtility::VideoSizeIndex( + aSet.iVideoWidth, aSet.iVideoHeight ) ); + if( resIndex < 0 ) + { + User::Panic( KCamConfigPanicId, ECamConfigPanicNoVideoRes ); + } + + TCamVideoQualityDescription descType + = CamConfigurationUtility::VideoDescId( aSet.iCamcorderVisible ); + + TInt videoType = CamConfigurationUtility::VideoType( aSet.iVideoFileMimeType ); + + // Convert FourCC value from TFourCC to asciiz string + const TInt KFourCCLength = 5; // 4 characters + '\0' + TText8 fourCCBuf[KFourCCLength ]; + TPtr8 fourCC( fourCCBuf, KFourCCLength ); + aSet.iAudioFourCCType.FourCC( &fourCC ); + fourCC.Append( '\0' ); + + // Initialized as here to avoid const_casts for the text pointers + TCamVideoQualityData data = + { + // TVideoQualitySettings: + { + 0, // iQualityLevel - defined later + KCamVideoSizes[resIndex].iCamVideoRes, // iVideoResolution + aSet.iVideoFrameRate, // iVideoFrameRate + aSet.iVideoBitRate, // iVideoBitRate + aSet.iAudioBitRate, // iAudioBitRate + AllocString8L( aSet.iVideoFileMimeType ), // iVideoMimeType + AllocString16L( aSet.iPreferredSupplier ), // iPreferredSupplier + AllocString8L( aSet.iVideoCodecMimeType ), // iVideoCodec + AllocString8L( fourCCBuf ), // iAudioCodec + CamConfigurationUtility::VideoType( aSet.iVideoFileMimeType ), // iVideoFileType + ECamVideoClipMax // iVideoLength - changed later if necessary + }, + + KCamVideoSizes[resIndex].iCamVideoRes, // iVideoResolution + ECamVideoQualitySharing, // iQualitySetting - replaced later + descType, // iDescription + KCamVideoIcons[descType], + KCamVideoTypeIcons[videoType] + }; + + PRINT( _L("Camera <= CCamConfiguration::CreateVideoQualityDataL" ) ); + return data; + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::AppendVideoResIfSupportedL +// --------------------------------------------------------------------------- +// +void +CCamConfiguration::AppendVideoResIfSupportedL( TInt aValue, RArray&aArray ) const + { + TInt n( iVideoQualities.Count() ); + for( TInt i=0; i CCamConfiguration::MapRequiredResolutionToActualResolutionPhoto aRequiredResolution: (%d,%d)"), aRequiredResolution.iWidth, aRequiredResolution.iHeight ); + TInt MaxCount = NumPrimaryImageQualities(); + TCamImageQualityData QData; + TSize Reso( 0, 0 ); + TBool found = EFalse; + for ( TInt i = 0; i < MaxCount; i++ ) + { + QData = ImageQualityData( i ); + PRINT3(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionPhoto index: %d PhotoSize: (%d,%d)"), i,QData.iPhotoSize.iWidth, QData.iPhotoSize.iHeight ); + if ( QData.iPhotoSize.iWidth == aRequiredResolution.iWidth + && QData.iPhotoSize.iHeight == aRequiredResolution.iHeight ) + { + Reso = aRequiredResolution; + found = ETrue; + } + } + if ( !found && aRequiredResolution != TSize(0,0) ) { // TSize(0,0) should be returned the same as it means the mms quality + TInt referenceQuality = aRequiredResolution.iWidth*aRequiredResolution.iHeight; + TInt currentQuality = 0; + TInt closestMatch = Abs(referenceQuality-currentQuality); + PRINT1(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionPhoto closestMatch: (%d)"), closestMatch ); + TInt currentMatch = 0; + for ( TInt i = 0; i < MaxCount; i++ ) + { + QData = ImageQualityData( i ); + PRINT3(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionPhoto index: %d PhotoSize: (%d,%d)"), i, QData.iPhotoSize.iWidth, QData.iPhotoSize.iHeight ); + currentQuality = QData.iPhotoSize.iWidth*QData.iPhotoSize.iHeight; + currentMatch = Abs(referenceQuality-currentQuality); + PRINT1(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionPhoto currentMatch: (%d)"), currentMatch ); + if ( currentMatch < closestMatch ) + { + Reso.SetSize( QData.iPhotoSize.iWidth, QData.iPhotoSize.iHeight ); + closestMatch = currentMatch; + } + } + } + PRINT2(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionPhoto return resolution: (%d,%d)"), Reso.iWidth, Reso.iHeight ); + return Reso; +} + + +// --------------------------------------------------------------------------- +// CCamConfiguration::GetRequiredVideoQualityIndex +// --------------------------------------------------------------------------- +// +TInt CCamConfiguration::GetRequiredVideoQualityIndex( const TSize& aResolution ) const + { + PRINT2(_L("Camera <=> CCamConfiguration::GetRequiredVideoQualityIndex aResolution: (%d,%d)"), aResolution.iWidth, aResolution.iHeight ); + TInt QualityIndex = 0; + TInt MaxCount = NumVideoQualities(); + PRINT1(_L("Camera <=> CCamConfiguration::GetRequiredVideoQualityIndex MaxCount: %d"), MaxCount ); + TCamVideoQualityData QData; + TSize VideoResolution(0,0); + //for ( TInt i = 0; i < MaxCount; i++ ) + for ( TInt i = MaxCount-1; i >= 0; i-- ) + { + QData = iVideoQualities[i]; + VideoResolution = CamConfigurationUtility::CamVideoResolution( QData.iVideoResolution ); + PRINT3(_L("Camera <=> CCamConfiguration::GetRequiredVideoQualityIndex index: %d VideoResolution: (%d,%d)"), i, VideoResolution.iWidth, VideoResolution.iHeight ); + if ( VideoResolution.iWidth == aResolution.iWidth + && VideoResolution.iHeight == aResolution.iHeight ) + { + QualityIndex = i; + } + } + PRINT1(_L("Camera <=> CCamConfiguration::GetRequiredVideoQualityIndex return: %d"), QualityIndex ); + return QualityIndex; + } + +// --------------------------------------------------------------------------- +// CCamConfiguration::MapRequiredResolutionToActualResolutionVideo +// --------------------------------------------------------------------------- +// +TSize CCamConfiguration::MapRequiredResolutionToActualResolutionVideo( const TSize& aRequiredResolution ) const { + PRINT2(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionVideo aRequiredResolution: (%d,%d)"), aRequiredResolution.iWidth, aRequiredResolution.iHeight ); + TInt MaxCount = NumVideoQualities(); + TCamVideoQualityData QData; + TSize Reso( 0, 0 ); + TBool found = EFalse; + TSize VideoResolution(0,0); + for ( TInt i = 0; i < MaxCount; i++ ) + { + QData = iVideoQualities[i]; + VideoResolution = CamConfigurationUtility::CamVideoResolution( QData.iVideoResolution ); + PRINT3(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionVideo index: %d VideoResolution: (%d,%d)"), i, VideoResolution.iWidth, VideoResolution.iHeight ); + if ( VideoResolution.iWidth == aRequiredResolution.iWidth + && VideoResolution.iHeight == aRequiredResolution.iHeight ) + { + Reso = aRequiredResolution; + found = ETrue; + } + } + if ( !found && aRequiredResolution != TSize(0,0) ) { // TSize(0,0) should be returned the same as it means the mms quality + TInt referenceQuality = aRequiredResolution.iWidth*aRequiredResolution.iHeight; + TInt currentQuality = 0; + TInt closestMatch = Abs(referenceQuality-currentQuality); + PRINT1(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionVideo closestMatch: (%d)"), closestMatch ); + TInt currentMatch = 0; + for ( TInt i = 0; i < MaxCount; i++ ) + { + QData = iVideoQualities[i]; + VideoResolution = CamConfigurationUtility::CamVideoResolution( QData.iVideoResolution ); + PRINT3(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionVideo index: %d VideoResolution: (%d,%d)"), i, VideoResolution.iWidth, VideoResolution.iHeight ); + currentQuality = VideoResolution.iWidth*VideoResolution.iHeight; + currentMatch = Abs(referenceQuality-currentQuality); + PRINT1(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionVideo currentMatch: (%d)"), currentMatch ); + if ( currentMatch < closestMatch ) + { + Reso.SetSize( VideoResolution.iWidth, VideoResolution.iHeight ); + closestMatch = currentMatch; + } + } + } + PRINT2(_L("Camera <=> CCamConfiguration::MapRequiredResolutionToActualResolutionVideo return resolution: (%d,%d)"), Reso.iWidth, Reso.iHeight ); + return Reso; +} + +// --------------------------------------------------------------------------- +// CCamConfiguration::GetDefaultVideoQualityFromIcmL +// --------------------------------------------------------------------------- +// +TCamVideoQualitySettings CCamConfiguration::GetDefaultVideoQualityFromIcmL() + { + PRINT(_L("Camera => CCamConfiguration::GetDefaultVideoQualityFromIcmL") ); + TInt totalLevels = iIcm->NumberOfVideoQualityLevels(); + CArrayFixFlat* levels + = new (ELeave) CArrayFixFlat( totalLevels ); + CleanupStack::PushL( levels ); + TVideoQualitySet set; + TVideoQualitySet temp; + + if( iPrimaryCameraDisplayId ) + { + iIcm->GetVideoQualityLevelsL( *levels, iPrimaryCameraDisplayId ); + TInt numLevels( levels->Count() ); + PRINT1(_L("Camera <> CCamConfiguration::GetDefaultVideoQualityFromIcmL - Total number of levels: %d"), numLevels ); + + iIcm->GetVideoQualitySet( set, levels->At( 0 ), iPrimaryCameraDisplayId ); + + for( int i=1; iGetVideoQualitySet( temp, levels->At( i ), iPrimaryCameraDisplayId ); + if( temp.iCamcorderVisible > 0 && temp.iVideoQualitySetLevel > set.iVideoQualitySetLevel ) + { + set = temp; + } + } + } + CleanupStack::PopAndDestroy( levels ); + + TInt count = iVideoQualities.Count(); + TCamVideoQualityDescription descType + = CamConfigurationUtility::VideoDescId( set.iCamcorderVisible ); + for(TInt i = 0; i < count; i++) + { + if(iVideoQualities[i].iDescription == descType ) + { + PRINT( _L("Camera <= CCamConfiguration::GetDefaultVideoQualityFromIcmL") ); + return iVideoQualities[i].iQualitySetting; + } + } + + // In normal case application should not come to here + // If could not find the exact video qulity setting, just return WidescreenHigh + // Should be fixed in other product + return ECamVideoQualityNormalHigh; + } + +// End of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/camconfigurationutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/camconfigurationutility.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,367 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper class for CCamConfiguration +* +*/ + + +#include "camlogging.h" +#include "camconfigurationutility.h" +#include "camconfigurationconstants.h" + +// --------------------------------------------------------------------------- +// CamConfigurationUtility::PhotoSizeIndex +// --------------------------------------------------------------------------- +// +TInt +CamConfigurationUtility::PhotoSizeIndex( TInt aWidth, TInt aHeight ) + { + TInt index = KErrNotFound; + for( TInt i=0; i& aPhotoQualities ) + { + TInt n = aPhotoQualities.Count(); + + //TInt numPrint = 0; + //TInt lastPrintIndex = KErrNotFound; + + for( int i=0; i( i ); + } + + /* + if( EImageQualityPrint == quality ) + { + if( !numPrint ) + { + // This is the first print quality, so it should be print high + quality = EImageQualityPrintHigh; + } + + numPrint++; + lastPrintIndex = i; + } + } + + if( numPrint > 2 ) + { + // There ECamQualityPrintHigh and more than one EImageQualityPrint + // Change last of them to ECamImageQualityPrintLow + aPhotoQualities[lastPrintIndex].iPhotoQualitySetting.iPhotoQualityId + = EImageQualityPrintLow; + } + + */ + } + +// --------------------------------------------------------------------------- +// CamConfigurationUtility::SetVideoQualityLevels +// --------------------------------------------------------------------------- +// +void +CamConfigurationUtility::SetVideoQualityLevels( RArray& aOrderedArray ) + { + TInt n = aOrderedArray.Count(); + + // Set quality setting values for each quality + // Only 3 or 5 qualities are supported + if( n==3 ) + { + aOrderedArray[0].iQualitySetting = ECamVideoQualityHigh; + aOrderedArray[1].iQualitySetting = ECamVideoQualityNormalHigh; + aOrderedArray[2].iQualitySetting = ECamVideoQualitySharing; + aOrderedArray[2].iQualitySettings.iVideoLength = ECamVideoClipShort; + } + else + if( n==5 ) + { + aOrderedArray[0].iQualitySetting = ECamVideoQualityHigh; + aOrderedArray[1].iQualitySetting = ECamVideoQualityNormalHigh; + aOrderedArray[2].iQualitySetting = ECamVideoQualityNormal; + aOrderedArray[3].iQualitySetting = ECamVideoQualityNormalLow; + aOrderedArray[4].iQualitySetting = ECamVideoQualitySharing; + aOrderedArray[4].iQualitySettings.iVideoLength = ECamVideoClipShort; + } + else + { + PRINT1( _L("Camera <> CamConfigurationUtility::SetVideoQualityLevels - Invalid number of levels (%d)"), n ); + User::Panic( KCamConfigPanicId, ECamConfigPanicInvalidNumberOfQualities ); + } + + // Set quality level for iQualitySettings. This is just the + // quality's index in the array. + for( TInt i=0; i& aArray ) + { + if( aArray.Find( aValue ) == KErrNotFound ) + { + aArray.AppendL( aValue ); + } + } + +// --------------------------------------------------------------------------- +// CamConfigurationUtility::VideoResolution +// --------------------------------------------------------------------------- +// +TInt +CamConfigurationUtility::VideoResolution( TInt aWidth, TInt aHeight ) + { + RDebug::Print( _L("VideoResolution( %d, %d) "), aWidth, aHeight ); + for( TInt i=0; i= KCamVideoQualityMappings[i].iCamcorderVisibleMin ) + { + desc = KCamVideoQualityMappings[i].iDesc; + break; + } + } + + return desc; + } + +// --------------------------------------------------------------------------- +// CamConfigurationUtility::ImageType +// --------------------------------------------------------------------------- +// +TCamImageType +CamConfigurationUtility::ImageType( TInt aValue ) + { + if( aValue >= KCamImageLargeTypeMin ) + { + return ECamImageTypeLarge; + } + else if( aValue >= KCamImageMediumTypeMin ) + { + return ECamImageTypeMedium; + } + else + { + return ECamImageTypeSmall; + } + } + +// --------------------------------------------------------------------------- +// CamConfigurationUtility::IsSupported +// --------------------------------------------------------------------------- +// +TBool +CamConfigurationUtility::IsSupported( TInt aValue, TCamItemType aItemType, const TCamImageQualityData& aData ) + { + switch( aItemType ) + { + case ECamItemPhotoSize: + { + if( aValue == aData.iPhotoSize.iSizeId ) + { + return ETrue; + } + break; + } + case ECamItemPhotoQuality: + { + if( aValue == aData.iPhotoSize.iQualitySettingId ) + { + return ETrue; + } + break; + } + default: + { + User::Panic( KCamConfigPanicId, ECamConfigPanicInvalidItem ); + } + } + return EFalse; + } + + + + +// --------------------------------------------------------------------------- +// CamConfigurationUtility::MapDynamicSettingToSceneSetting +// Get the scene setting id from dynamic setting id. +// --------------------------------------------------------------------------- +// +TInt +CamConfigurationUtility::MapDynamicSettingToSceneSetting( TInt aSettingId ) + { + switch( aSettingId ) + { + case ECamSettingItemDynamicVideoWhiteBalance: // fall through + case ECamSettingItemDynamicPhotoWhiteBalance: + return ECamSettingItemSceneAWBMode; + + case ECamSettingItemDynamicVideoExposure: // fall through + case ECamSettingItemDynamicPhotoExposure: + return ECamSettingItemSceneEV; + + case ECamSettingItemDynamicVideoFlash: // fall through + case ECamSettingItemDynamicPhotoFlash: + return ECamSettingItemSceneFlashMode; + + case ECamSettingItemDynamicVideoContrast: // fall through + case ECamSettingItemDynamicPhotoContrast: + return ECamSettingItemSceneContrast; + + case ECamSettingItemDynamicPhotoImageSharpness: + return ECamSettingItemSceneSharpness; + + case ECamSettingItemDynamicVideoLightSensitivity: // fall through + case ECamSettingItemDynamicPhotoLightSensitivity: + return ECamSettingItemSceneISO; + + default: + return KErrNotFound; + } + } + +// End of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/common/src/caminfolistboxitembase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/common/src/caminfolistboxitembase.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementations of Info Listbox Item Base class methods. +* +*/ + + + +// =========================================================================== +// Includes +#include + +#include "camlogging.h" +#include "caminfolistboxitembase.h" + + +// =========================================================================== +// Class methods + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListItem destructor +// +// --------------------------------------------------------------------------- +// +CCamInfoListboxItemBase::~CCamInfoListboxItemBase() + { + PRINT( _L("Camera => ~CCamInfoListboxItemBase") ); + delete iListItemText; iListItemText = NULL; + delete iBitmap; iBitmap = NULL; + delete iBitmapMask; iBitmapMask = NULL; + PRINT( _L("Camera <= ~CCamInfoListboxItemBase") ); + } + +// =========================================================================== +// from MCamInfoListboxItem + +// --------------------------------------------------------------------------- +// CCamInfoListboxItemBase::ItemText +// Return a pointer to the item text +// --------------------------------------------------------------------------- +// +TPtrC CCamInfoListboxItemBase::ItemText() const + { + return *iListItemText; + } + +// --------------------------------------------------------------------------- +// CCamInfoListboxItemBase::ItemValue +// Return the id of the setting value represented by this item +// --------------------------------------------------------------------------- +// +TInt CCamInfoListboxItemBase::ItemValue() const + { + return iSettingItemValueId; + } + +// --------------------------------------------------------------------------- +// CCamInfoListboxItemBase::Bitmap +// Return a pointer to the bitmap +// --------------------------------------------------------------------------- +// +CFbsBitmap* CCamInfoListboxItemBase::Bitmap() const + { + return iBitmap; + } + +// --------------------------------------------------------------------------- +// CCamInfoListboxItemBase::BitmapMask +// Return a pointer to the bitmap mask +// --------------------------------------------------------------------------- +// +CFbsBitmap* CCamInfoListboxItemBase::BitmapMask() const + { + return iBitmapMask; + } + + +// =========================================================================== +// new methods + +// --------------------------------------------------------------------------- +// <> +// +// --------------------------------------------------------------------------- +// +TBool +CCamInfoListboxItemBase::EqualIds( const TInt* aSettingValueId, + const CCamInfoListboxItemBase& aOther ) + { + PRINT1( _L("Camera => CCamInfoListboxItemBase::EqualIds, pointer:%d"), aSettingValueId ); + TBool match( EFalse ); + if( aSettingValueId ) + { + PRINT2( _L("Camera <> CCamInfoListboxItemBase: %d =?= %d"), *aSettingValueId, aOther.ItemValue() ); + match = aOther.ItemValue() == *aSettingValueId; + } + PRINT1( _L("Camera <= CCamInfoListboxItemBase::EqualIds, return:%d"), match ); + return match; + } + + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/DummyViewfinder.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/DummyViewfinder.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/DummyViewfinder2.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/DummyViewfinder2.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/DummyViewfinder3.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/DummyViewfinder3.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/alphablend_landscape.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/alphablend_landscape.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/alphablend_landscape_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/alphablend_landscape_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/alphablend_landscape_small.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/alphablend_landscape_small.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/alphablend_landscape_small_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/alphablend_landscape_small_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/alphablend_portrait.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/alphablend_portrait.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/alphablend_portrait_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/alphablend_portrait_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_leftcap.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_leftcap.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_leftcap_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_leftcap_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_middle.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_middle.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_middle_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_middle_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_rightcap.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_rightcap.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_rightcap_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_alpha_rightcap_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_leftcap.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_leftcap.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_leftcap_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_leftcap_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_middle.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_middle.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_middle_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_middle_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_rightcap.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_rightcap.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_rightcap_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/blendedbg_checker_rightcap_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/checkerboard_landscape.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/checkerboard_landscape.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/checkerboard_landscape_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/checkerboard_landscape_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/checkerboard_landscape_small.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/checkerboard_landscape_small.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/checkerboard_landscape_small_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/checkerboard_landscape_small_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/checkerboard_portrait.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/checkerboard_portrait.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/checkerboard_portrait_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/checkerboard_portrait_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/qgn_indi_lcam_rec_progress.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/qgn_indi_lcam_rec_progress.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/bitmaps/qgn_indi_lcam_rec_progress_mask.bmp Binary file camerauis/cameraapp/generic/data/bitmaps/qgn_indi_lcam_rec_progress_mask.bmp has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraapp.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/cameraapp.rss Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resources for the camera application +* +* +*/ + + +NAME SCRF + +// =========================================================================== +// Includes + +#include +#include +#include +#include +#include // signature +#include +#include +#include + +#include // qtn_lcam_title_text_photo +#include "Cam.hrh" +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "Cam.rh" + +// =========================================================================== +// Resource definitions + +// --------------------------------------------------------- +// +// Define the resource file signature +// This resource should be empty. +// +// --------------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// --------------------------------------------------------- +// +// Default Document Name +// +// --------------------------------------------------------- +// +RESOURCE TBUF { buf=qtn_lcam_title_text_photo; } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_exit +// Softkeys definition which uses ECamCmdInternalExit +// instead of EAknSoftkeyExit (as in r_avkon_softkeys_exit) +// +//---------------------------------------------------- +RESOURCE CBA r_cameraapp_softkeys_options_exit + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; } + }; + } + +RESOURCE EIK_APP_INFO + { + cba = r_cameraapp_softkeys_options_exit; + } + +//---------------------------------------------------- +// +// r_cam_localisable_app_info +// Localisable app info +// +//---------------------------------------------------- +// +RESOURCE LOCALISABLE_APP_INFO r_cam_localisable_app_info + { + short_caption = qtn_apps_lcam_grid; + caption_and_icon = + CAPTION_AND_ICON_INFO + { + caption = qtn_apps_lcam_list; + number_of_icons = 1; + icon_file = "z:\\resource\\apps\\cameraapp_aif.mif"; + }; + } + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappCapture1.wav Binary file camerauis/cameraapp/generic/data/cameraappCapture1.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappCapture2.wav Binary file camerauis/cameraapp/generic/data/cameraappCapture2.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappCapture3.wav Binary file camerauis/cameraapp/generic/data/cameraappCapture3.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappCapture4.wav Binary file camerauis/cameraapp/generic/data/cameraappCapture4.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappCapture5.wav Binary file camerauis/cameraapp/generic/data/cameraappCapture5.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappCaptureShort1.wav Binary file camerauis/cameraapp/generic/data/cameraappCaptureShort1.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappCaptureShort2.wav Binary file camerauis/cameraapp/generic/data/cameraappCaptureShort2.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappCaptureShort3.wav Binary file camerauis/cameraapp/generic/data/cameraappCaptureShort3.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappCaptureShort4.wav Binary file camerauis/cameraapp/generic/data/cameraappCaptureShort4.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappFocusSucc.wav Binary file camerauis/cameraapp/generic/data/cameraappFocusSucc.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappStart.wav Binary file camerauis/cameraapp/generic/data/cameraappStart.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraappStop.wav Binary file camerauis/cameraapp/generic/data/cameraappStop.wav has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraapp_caption.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/cameraapp_caption.rss Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include + +RESOURCE CAPTION_DATA + { + caption = qtn_apps_lcam_grid; + shortcaption = qtn_apps_lcam_list; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/cameraapp_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/cameraapp_reg.rss Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: New rss file required for the new AIF framework* +*/ + + +#include +#include + +#include "../../generic/inc/CamAppUid.h" +#include + +UID2 KUidAppRegistrationResourceFile +UID3 KCameraappUID + +RESOURCE APP_REGISTRATION_INFO + { + app_file = "cameraapp"; + + localisable_resource_file = APP_RESOURCE_DIR"\\cameraapp"; + localisable_resource_id = R_CAM_LOCALISABLE_APP_INFO; + embeddability = KAppEmbeddable; + hidden = KAppNotHidden; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/capture.jpg Binary file camerauis/cameraapp/generic/data/capture.jpg has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/nhdcamsettings.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/nhdcamsettings.rss Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,3240 @@ +/* +* 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: Resource definitions for the Camera Application* +*/ + + +// RESOURCE IDENTIFIER +NAME NCSE // 4 letter ID, must be same as vgacamsettings.rss ID + +#include // signature +#include // AVKON_LAYOUT_TEXT AVKON_NOTE +#include // R_AVKON_SOFTKEYS_EMPTY +#include // LOCALISABLE_APP_INFO +#include +#include // EAknsMajorGeneric +#include // For EStdKeyDevice3 +#include // For AIW_INTEREST +#include // EMbmCameraappQgn_* +#include +#include + +#include "Cam.rh" // CAM_ENGINE_UPDATE +#include "CamConstantsCamcorder.hrh" +#include "CamConstantsViewMode.hrh" +#include "CamConstantsPortrait.hrh" + +// =========================================================================== +// Constants +#define KCamCaptureSoundFile1 "z:\\system\\sounds\\digital\\cameraappCapture1.wav" +#define KCamCaptureSoundFile2 "z:\\system\\sounds\\digital\\cameraappCapture2.wav" +#define KCamCaptureSoundFile3 "z:\\system\\sounds\\digital\\cameraappCapture3.wav" +#define KCamCaptureSoundFile4 "z:\\system\\sounds\\digital\\cameraappCapture4.wav" +#define KCamBurstCaptureSoundFile1 "z:\\system\\sounds\\digital\\cameraappCaptureShort1.wav" +#define KCamBurstCaptureSoundFile2 "z:\\system\\sounds\\digital\\cameraappCaptureShort2.wav" +#define KCamBurstCaptureSoundFile3 "z:\\system\\sounds\\digital\\cameraappCaptureShort3.wav" +#define KCamBurstCaptureSoundFile4 "z:\\system\\sounds\\digital\\cameraappCaptureShort4.wav" + +#define KCamStartSoundFile "z:\\system\\sounds\\digital\\cameraappStart.wav" +#define KCamStopSoundFile "z:\\system\\sounds\\digital\\cameraappStop.wav" +#define KCamPauseSoundFile "z:\\system\\sounds\\digital\\cameraappStop.wav" + +#define KCamAutoFocusSuccFile "z:\\system\\sounds\\digital\\cameraappFocusSucc.wav" + +#define CAMERAAPP_BITMAP_FILE "z:\\resource\\apps\\cameraapp.mif" + + + +// RESOURCE DEFINITIONS +RESOURCE RSS_SIGNATURE { } +RESOURCE TBUF { buf = "NCSE"; } + + +/******************************************** +* TBUF +*********************************************/ + +// --------------------------------------------------- +// +// r_cam_scene_title_auto +// Title of Auto scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_auto + { + buf = qtn_lcam_scene_auto; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_user +// Title of User scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_user + { + buf = qtn_lcam_scene_user; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_macro +// Title of Macro scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_macro + { + buf = qtn_lcam_scene_macro; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_landscape +// Title of Landscape scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_landscape + { + buf = qtn_lcam_scene_land; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_portrait +// Title of Portrait scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_portrait + { + buf = qtn_lcam_scene_port; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_text +// Title of Text scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_text + { + buf = qtn_lcam_scene_text; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_night +// Title of Night scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_night + { + buf = qtn_lcam_scene_night; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_sports +// Title of Sports scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_sports + { + buf = qtn_lcam_scene_sport; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal +// Title of Normal scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_normal + { + buf = qtn_lcam_scene_auto; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_night_landscape +// Title of Night Landscape scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_night_landscape + { + buf = qtn_lcam_scene_nightland; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_night_portrait +// Description of Night Portrait scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_night_portrait + { + buf = qtn_lcam_scene_nightport; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_candlelight +// Description of Candlelight scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_candlelight + { + buf = qtn_lcam_scene_candle; + } + +/************************************** +* Explanation text TBUF * +**************************************/ + +// --------------------------------------------------- +// +// r_cam_scene_title_auto +// Description of Auto scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_auto + { + buf = qtn_lcam_scene_auto_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_user +// Description of User scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_user + { + buf = qtn_lcam_scene_user_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_macro +// Description of macro scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_macro + { + buf = qtn_lcam_scene_macro_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_landscape +// Description of Landscape scene in scene settings view +// this is used when autofocus is not supported +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_landscape + { + buf = qtn_lcam_scene_land2_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_landscape_autofocus +// Description of Landscape scene in scene settings view +// this is used when autofocus is supported +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_landscape_autofocus + { + buf = qtn_lcam_scene_land_ex; + } + + +// --------------------------------------------------- +// +// r_cam_scene_description_portrait +// Description of Portrait scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_portrait + { + buf = qtn_lcam_scene_port2_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_text +// Description of Text scene in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE TBUF r_cam_scene_description_text + { + buf = qtn_lcam_scene_text_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_night +// Description of Night scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_night + { + buf = qtn_lcam_scene_night_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_sports +// Description of Sports scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_sports + { + buf = qtn_lcam_scene_sport_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_normal +// Description of Normal scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_normal + { + buf = qtn_lcam_scene_normal_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_night_landscape +// Description of Night Landscape scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_night_landscape + { + buf = qtn_lcam_scene_nightland_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_night_portrait +// Description of Night Portrait scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_night_portrait + { + buf = qtn_lcam_scene_nightport_ex; + } + +/************************************** +* Other structures * +**************************************/ + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_scenebase_data +// The data for the scene base item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_scenebase_data + { + id = ECamSettingItemUserSceneBasedOnScene; + text = qtn_lcam_set_user_scene; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneNight; + text = qtn_lcam_user_scene_night; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneMacro; + text = qtn_lcam_user_scene_macro; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamScenePortrait; + text = qtn_lcam_user_scene_port; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneAuto; + text = qtn_lcam_user_scene_auto; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneScenery; + text = qtn_lcam_user_scene_land; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneSports; + text = qtn_lcam_user_scene_sport; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneNormal; + text = qtn_lcam_user_scene_auto; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneNightScenery; + text = qtn_lcam_scene_nightland; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneNightPortrait; + text = qtn_lcam_user_scene_nightport; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneCandlelight; + text = qtn_lcam_scene_candle; + } + + }; + } + +RESOURCE ARRAY r_cam_capture_setup_list_user_scene_shooting_mode + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_auto; + setting_value_id = ECamSceneAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_macro; + setting_value_id = ECamSceneMacro; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_closeup; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_macro_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_port; + setting_value_id = ECamScenePortrait; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_portrait; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_port_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_land; + setting_value_id = ECamSceneScenery; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_landscape; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_land_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_sport; + setting_value_id = ECamSceneSports; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_sport; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_sport_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_night; + setting_value_id = ECamSceneNight; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_night; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_night_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_nightport; + setting_value_id = ECamSceneNightPortrait; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_portrait_night; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_nightport_s; + } + }; + } + +RESOURCE ARRAY r_cam_capture_setup_list_user_scene_shooting_mode_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneAuto; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_auto; + summary_title_text = qtn_lcam_scene_auto; + summary_description_text = qtn_lcam_scene_auto_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_auto_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneMacro; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_closeup; + summary_title_text = qtn_lcam_scene_macro; + summary_description_text = qtn_lcam_scene_macro_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_macro_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamScenePortrait; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_portrait; + summary_title_text = qtn_lcam_scene_port; + summary_description_text = qtn_lcam_scene_port2_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_port_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneScenery; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_landscape; + summary_title_text = qtn_lcam_scene_land; + // this is used when autofocus is not supported + summary_description_text = qtn_lcam_scene_land2_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_land_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneSports; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_sport; + summary_title_text = qtn_lcam_scene_sport; + summary_description_text = qtn_lcam_scene_sport_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_sport_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNight; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_night; + summary_title_text = qtn_lcam_scene_night; + summary_description_text = qtn_lcam_scene_night_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_night_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNightPortrait; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_portrait_night; + summary_title_text = qtn_lcam_scene_nightport; + summary_description_text = qtn_lcam_scene_nightport_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_nightport_l; + } + }; + } + +RESOURCE ARRAY r_cam_capture_setup_list_photo_shooting_mode + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_auto; + setting_value_id = ECamSceneAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_user; + setting_value_id = ECamSceneUser; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_userscene; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_user_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_macro; + setting_value_id = ECamSceneMacro; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_closeup; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_macro_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_port; + setting_value_id = ECamScenePortrait; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_portrait; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_port_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_land; + setting_value_id = ECamSceneScenery; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_landscape; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_land_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_sport; + setting_value_id = ECamSceneSports; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_sport; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_sport_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_night; + setting_value_id = ECamSceneNight; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_night; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_night_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_nightport; + setting_value_id = ECamSceneNightPortrait; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_portrait_night; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_nightport_s; + } + }; + } + + +RESOURCE ARRAY r_cam_capture_setup_list_photo_shooting_mode_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneAuto; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_auto; + summary_title_text = qtn_lcam_scene_auto; + summary_description_text = qtn_lcam_scene_auto_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_auto_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneUser; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_userscene; + summary_title_text = qtn_lcam_scene_user; + summary_description_text = qtn_lcam_scene_user_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_user_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneMacro; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_closeup; + summary_title_text = qtn_lcam_scene_macro; + summary_description_text = qtn_lcam_scene_macro_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_macro_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamScenePortrait; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_portrait; + summary_title_text = qtn_lcam_scene_port; + summary_description_text = qtn_lcam_scene_port2_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_port_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneScenery; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_landscape; + summary_title_text = qtn_lcam_scene_land; + // this is used when autofocus is not supported + summary_description_text = qtn_lcam_scene_land2_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_land_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneSports; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_sport; + summary_title_text = qtn_lcam_scene_sport; + summary_description_text = qtn_lcam_scene_sport_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_sport_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNight; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_night; + summary_title_text = qtn_lcam_scene_night; + summary_description_text = qtn_lcam_scene_night_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_night_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNightPortrait; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_portrait_night; + summary_title_text = qtn_lcam_scene_nightport; + summary_description_text = qtn_lcam_scene_nightport_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_nightport_l; + } + }; + } + +//////////////////////////////////////////// +// Common for both VGA and NHD resourses +//////////////////////////////////////////// + +//---------------------------------------------------- +// +// r_cam_namebase_video +// Base name for video files +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_namebase_video + { + buf = qtn_lcam_namebase_video; + } + + +//---------------------------------------------------- +// +// r_cam_namebase_image +// Base name for image files +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_namebase_image + { + buf = qtn_lcam_namebase_image; + } + + +//---------------------------------------------------- +// +// r_cam_generic_title_name +// Title name used in case of error +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_generic_title_name + { + buf = qtn_lcam_title_text_camera; + } + + +//---------------------------------------------------- +// +// r_cam_camera_subfolder +// Camera specific subfolder +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_camera_subfolder + { + buf = qtn_lcam_camera_subfolder; + } + + +//---------------------------------------------------- +// +// r_cam_sound_list +// Sound info list containing the Camera sounds +// +//---------------------------------------------------- +// +RESOURCE AVKON_SOUND_INFO_LIST r_cam_sound_list + { + list = + { + // Still image snap sounds + AVKON_SOUND_INFO + { + sid = ECamStillCaptureSoundId1; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamCaptureSoundFile1; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamStillCaptureSoundId2; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamCaptureSoundFile2; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamStillCaptureSoundId3; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamCaptureSoundFile3; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamStillCaptureSoundId4; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamCaptureSoundFile4; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamVideoStartSoundId; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamStartSoundFile; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamVideoStopSoundId; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamStopSoundFile; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamVideoPauseSoundId; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamPauseSoundFile; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamAutoFocusComplete; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamAutoFocusSuccFile; + volume = 5; + }, + // Self-timer beep + AVKON_SOUND_INFO + { + sid = ECamSelfTimerSoundId; + priority = EAvkonAlarmTonesPriority; + preference = EAknAudioPrefDefaultTone; + sequencelength = 6; + sequence = { 0, 17, 6, 118, 10, 11 }; + volume = 9; + } + + }; + } + +//---------------------------------------------------- +// +// r_cam_silent_ok_key_list +// Sound key list to disable selection key sound +// +//---------------------------------------------------- +// +RESOURCE AVKON_SKEY_LIST r_cam_silent_ok_key_list + { + list= + { + AVKON_SKEY_INFO + { + key = EStdKeyDevice3; + sid = EAvkonSIDNoSound; + }, + AVKON_SKEY_INFO + { + key = EStdKeyDevice3; + sid = EAvkonSIDNoSound; + type = ESKeyTypeLong; + }, + AVKON_SKEY_INFO + { + key = EStdKeyDevice3; + sid = EAvkonSIDNoSound; + type = ESKeyTypeRepeat; + }, + AVKON_SKEY_INFO + { + key = EStdKeyUpArrow; + sid = EAvkonSIDNoSound; + type = ESKeyTypeRepeat; + }, + AVKON_SKEY_INFO + { + key = EStdKeyUpArrow; + sid = EAvkonSIDNoSound; + type = ESKeyTypeLong; + }, + AVKON_SKEY_INFO + { + key = EStdKeyDownArrow; + sid = EAvkonSIDNoSound; + type = ESKeyTypeRepeat; + }, + AVKON_SKEY_INFO + { + key = EStdKeyDownArrow; + sid = EAvkonSIDNoSound; + type = ESKeyTypeLong; + } + }; + } + +//---------------------------------------------------- +// +// Button state extensions for toolbar and toolbar extension buttons. +// These is required to support skinned graphics for the buttons. +// +//---------------------------------------------------- +// + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_capture + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbCapture; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_video + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4Video; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_mode_camera + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4ModeCamera; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_record + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbRecord; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_camera + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4Camera; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_capture + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4Capture; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_autoflash + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4Autoflash; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_goto_photos + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4GotoGallery; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_add_to_album + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbAddToAlbum; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_send + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbSend; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_delete + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbDelete; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_light_off + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbLightOff; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_play + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbPlay; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_goto_photos + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbGotoGallery; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_upload + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbUpload; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_mark + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbMark; + } + +//---------------------------------------------------- +// +// r_cam_still_precapture_toolbar_portrait +// Toolbar for still pre-capture view for secondary +// camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_precapture_toolbar_portrait + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureImage; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_capture; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_capture_mask; + helptxt = qtn_lcam_tt_capture; + extension = r_cam_ext_qgn_indi_cam4_tb_capture; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewVideo; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_video; + bmpmask = EMbmCameraappQgn_indi_cam4_video_mask; + helptxt = qtn_lcam_tt_video_mode; + extension = r_cam_ext_qgn_indi_cam4_video; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSwitchCamera; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_tb_cam4_goto_main; + bmpmask = EMbmCameraappQgn_indi_tb_cam4_goto_main_mask; + helptxt = qtn_lcam_tt_camera_main; + extension = r_cam_ext_qgn_indi_cam4_mode_camera; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_precapture_toolbar_landscape +// Toolbar for still pre-capture view for secondary +// camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_precapture_toolbar_landscape + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureImage; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_capture; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_capture_mask; + helptxt = qtn_lcam_tt_capture; + extension = r_cam_ext_qgn_indi_cam4_tb_capture; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_video; + bmpmask = EMbmCameraappQgn_indi_cam4_video_mask; + helptxt = qtn_lcam_tt_video_mode; + extension = r_cam_ext_qgn_indi_cam4_video; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSwitchCamera; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_tb_cam4_goto_main; + bmpmask = EMbmCameraappQgn_indi_tb_cam4_goto_main_mask; + helptxt = qtn_lcam_tt_camera_main; + extension = r_cam_ext_qgn_indi_cam4_mode_camera; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_precapture_toolbar_portrait +// Toolbar and toolbar extension for video pre-capture view for secondary +// camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_precapture_toolbar_portrait + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdRecord; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_record; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_record_mask; + helptxt = qtn_lcam_tt_record; + extension = r_cam_ext_qgn_indi_cam4_tb_record; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewPhoto; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_camera; + bmpmask = EMbmCameraappQgn_indi_cam4_camera_mask; + helptxt = qtn_lcam_tt_still_mode; + extension = r_cam_ext_qgn_indi_cam4_camera; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSwitchCamera; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_tb_cam4_goto_main; + bmpmask = EMbmCameraappQgn_indi_tb_cam4_goto_main_mask; + helptxt = qtn_lcam_tt_camera_main; + extension = r_cam_ext_qgn_indi_cam4_mode_camera; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_video_precapture_toolbar_landscape +// Toolbar and toolbar extension for video pre-capture view for secondary +// camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_precapture_toolbar_landscape + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdRecord; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_record; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_record_mask; + helptxt = qtn_lcam_tt_record; + extension = r_cam_ext_qgn_indi_cam4_tb_record; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewPhoto; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_camera; + bmpmask = EMbmCameraappQgn_indi_cam4_camera_mask; + helptxt = qtn_lcam_tt_still_mode; + extension = r_cam_ext_qgn_indi_cam4_camera; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSwitchCamera; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_tb_cam4_goto_main; + bmpmask = EMbmCameraappQgn_indi_tb_cam4_goto_main_mask; + helptxt = qtn_lcam_tt_camera_main; + extension = r_cam_ext_qgn_indi_cam4_mode_camera; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_still_precapture_toolbar +// Toolbar and toolbar extension for still pre-capture view for primary +// camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_precapture_toolbar + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode | KAknToolbarNoBackground | KAknToolbarTransparent; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureImage; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_capture; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_capture_mask; + helptxt = qtn_lcam_tt_capture; + extension = r_cam_ext_qgn_indi_cam4_tb_capture; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupFlashStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_autoflash; + bmpmask = EMbmCameraappQgn_indi_cam4_autoflash_mask; + helptxt = qtn_lcam_tt_flash; + extension = r_cam_ext_qgn_indi_cam4_autoflash; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtToolbarExtension; + id = ECamCmdToolbarExtension; + + control = AVKON_TOOLBAR_EXTENSION + { + flags = KAknToolbarDsaMode | KAknButtonNoFrame; + helptxt = qtn_lcam_tt_open_extension; + + bmpFile = CAMERAAPP_BITMAP_FILE; + + bmpId = EMbmCameraappQgn_indi_cam4_tb_extension; + bmpMask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + bmpSkinIdMajor = EAknsMajorGeneric; + bmpSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + dimBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + dimBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + dimSkinIdMajor = EAknsMajorGeneric; + dimSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + pressBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + pressBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + pressSkinIdMajor = EAknsMajorGeneric; + pressSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupSceneStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_scenes; + } + }; + }; + }, + + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdToggleFacetracking; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_facedet_on; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdViewfinderGrid; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_show_viewfinder_grid; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupSelfTimer; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_st; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupColourFilterStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_coltone; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupWhiteBalanceStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_wb; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupExposureStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_ev; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupLightSensitivityStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_isosetting; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupContrastStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_contr; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupImageSharpnessStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_sharp; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdTimeLapseSlider; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_sequence; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_goto_gallery_mask; + txt = qtn_lcam_tb_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_goto_photos; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_video; + bmpmask = EMbmCameraappQgn_indi_cam4_video_mask; + txt = qtn_lcam_tb_switch_video_mode; + extension = r_cam_ext_qgn_indi_cam4_video; + } + }; + }; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar +// Toolbar and toolbar extension for still post-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarTransparent | KAknToolbarNoBackground; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_goto_gallery_mask; + helptxt = qtn_lcam_tt_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_tb_goto_photos; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar_upload +// Toolbar and toolbar extension for still post-capture view +// with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarTransparent | KAknToolbarNoBackground; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar_portrait +// Toolbar and toolbar extension for still post-capture +// portrait view +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar_portrait + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_goto_gallery_mask; + helptxt = qtn_lcam_tt_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_tb_goto_photos; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar_landscape +// Toolbar and toolbar extension for still post-capture +// portrait view +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar_landscape + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_goto_gallery_mask; + helptxt = qtn_lcam_tt_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_tb_goto_photos; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar_portrait_upload +// Toolbar and toolbar extension for still post-capture +// portrait view with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar_portrait_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar_landscape_upload +// Toolbar and toolbar extension for still post-capture +// portrait view with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar_landscape_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_video_precapture_toolbar_videolight +// Toolbar and toolbar extension for video pre-capture view for primary +// camera when using non-widescreen resolution +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_precapture_toolbar_videolight + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode | KAknToolbarNoBackground | KAknToolbarTransparent; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdRecord; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_record; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_record_mask; + helptxt = qtn_lcam_tt_start_video_rec; + extension = r_cam_ext_qgn_indi_cam4_tb_record; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdToggleVideoFlash; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_light_off; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_light_off_mask; + helptxt = qtn_lcam_tt_videoflash; + extension = r_cam_ext_qgn_indi_cam4_light_off; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtToolbarExtension; + id = ECamCmdToolbarExtension; + + control = AVKON_TOOLBAR_EXTENSION + { + flags = KAknToolbarDsaMode | KAknButtonNoFrame; + helptxt = qtn_lcam_tt_open_extension; + + bmpFile = CAMERAAPP_BITMAP_FILE; + + bmpId = EMbmCameraappQgn_indi_cam4_tb_extension; + bmpMask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + bmpSkinIdMajor = EAknsMajorGeneric; + bmpSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + dimBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + dimBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + dimSkinIdMajor = EAknsMajorGeneric; + dimSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + pressBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + pressBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + pressSkinIdMajor = EAknsMajorGeneric; + pressSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupSceneVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_scenes; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewPhoto; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_camera; + bmpmask = EMbmCameraappQgn_indi_cam4_camera_mask; + txt = qtn_lcam_tb_switch_mode; + extension = r_cam_ext_qgn_indi_cam4_camera; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupWhiteBalanceVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_wb; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupColourFilterVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_coltone; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_goto_gallery_mask; + txt = qtn_lcam_tb_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_goto_photos; + } + }; + }; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_precapture_toolbar +// Toolbar and toolbar extension for video pre-capture view for primary +// camera when using non-widescreen resolution +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_precapture_toolbar + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode | KAknToolbarNoBackground | KAknToolbarTransparent; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdRecord; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_record; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_record_mask; + helptxt = qtn_lcam_tt_start_video_rec; + extension = r_cam_ext_qgn_indi_cam4_tb_record; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupSceneVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + //txt = qtn_lcam_tb_scenes; + helptxt = qtn_lcam_tt_goto_scenemode_settings; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtToolbarExtension; + id = ECamCmdToolbarExtension; + + control = AVKON_TOOLBAR_EXTENSION + { + flags = KAknToolbarDsaMode | KAknButtonNoFrame; + helptxt = qtn_lcam_tt_open_extension; + + bmpFile = CAMERAAPP_BITMAP_FILE; + + bmpId = EMbmCameraappQgn_indi_cam4_tb_extension; + bmpMask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + bmpSkinIdMajor = EAknsMajorGeneric; + bmpSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + dimBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + dimBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + dimSkinIdMajor = EAknsMajorGeneric; + dimSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + pressBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + pressBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + pressSkinIdMajor = EAknsMajorGeneric; + pressSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewPhoto; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_camera; + bmpmask = EMbmCameraappQgn_indi_cam4_camera_mask; + txt = qtn_lcam_tb_switch_mode; + extension = r_cam_ext_qgn_indi_cam4_camera; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupWhiteBalanceVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_wb; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupColourFilterVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_coltone; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_goto_gallery_mask; + txt = qtn_lcam_tb_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_goto_photos; + } + }; + }; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar +// Toolbar and toolbar extension for video post-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarTransparent | KAknToolbarNoBackground; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar_upload +// Toolbar and toolbar extension for video post-capture view +// with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarTransparent | KAknToolbarNoBackground; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar_portrait +// Toolbar and toolbar extension for video post-capture +// portrait view +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar_portrait + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar_landscape +// Toolbar and toolbar extension for video post-capture +// portrait view +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar_landscape + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar_portrait_upload +// Toolbar and toolbar extension for video post-capture +// portrait view with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar_portrait_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar_landscape_upload +// Toolbar and toolbar extension for video post-capture +// portrait view with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar_landscape_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_empty_fixed_toolbar +// Toolbar for views that do not have any content for fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_empty_fixed_toolbar + { + lines = 0; + flags = KAknToolbarFixed | KAknToolbarWithoutCba; + items = + { + }; + } + + +//---------------------------------------------------- +// +// r_cam_burst_postcapture_toolbar +// Toolbar for sequence post-capture thumbnail view +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_burst_postcapture_toolbar + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarNoBackground; + items = + { + + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdToolbarMarkUnmark; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_mark; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_mark_mask; + helptxt = qtn_lcam_tt_mark_unmark; + extension = r_cam_ext_qgn_indi_cam4_tb_mark; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_burst_postcapture_toolbar_upload +// Toolbar for sequence post-capture thumbnail view +// with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_burst_postcapture_toolbar_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarNoBackground; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdToolbarMarkUnmark; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_mark; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_mark_mask; + helptxt = qtn_lcam_tt_mark_unmark; + extension = r_cam_ext_qgn_indi_cam4_tb_mark; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_qtn_lcam_tb_show_viewfinder_grid +// Text for the 'show grid' button in toolbar extension +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tb_show_viewfinder_grid + { + buf = qtn_lcam_tb_show_viewfinder_grid; + } + +//---------------------------------------------------- +// +// r_qtn_lcam_tb_hide_viewfinder_grid +// Text for the 'hide grid' button in toolbar extension +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tb_hide_viewfinder_grid + { + buf = qtn_lcam_tb_hide_viewfinder_grid; + } + +//---------------------------------------------------- +// +// r_qtn_lcam_tt_videoflash +// Tooltip for the video button in fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tt_videoflash + { + buf = qtn_lcam_tt_videoflash; // "Switch video light on" + } + +//---------------------------------------------------- +// +// r_qtn_lcam_tt_videoflash +// Tooltip for the video button in fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tt_flashoff + { + buf = qtn_lcam_tt_flashoff; // "Switch video light off" + } + +//---------------------------------------------------- +// +// qtn_lcam_tt_sendtocall +// Tooltip for the send button in fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tt_sendtocall + { + buf = qtn_lcam_tt_sendtocall; // "Send to caller" + } + +//---------------------------------------------------- +// +// qtn_lcam_tt_send +// Tooltip for the send button in fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tt_send + { + buf = qtn_lcam_tt_send; // "Send" + } + +//---------------------------------------------------- +// +// r_cam_one_click_upload_interest +// AIW interest for one-click upload +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_one_click_upload_interest + { + items= + { + AIW_CRITERIA_ITEM + { + id = KAiwCmdUpload; + serviceCmd = KAiwCmdUpload; + serviceClass = KAiwClassBase; + contentType = "image/*"; + defaultProvider = 0x2000BB53; //KShareAppUidVal; + maxProviders = 1; + } + }; + } +//---------------------------------------------------- +// +// qtn_lcam_tb_turn_sequence_off +// Text for sequence mode button in toolbar extension +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tb_turn_sequence_off + { + buf = qtn_lcam_tb_turn_sequence_off; // "To single shot" + } + +//---------------------------------------------------- +// +// qtn_lcam_tb_turn_sequence_on +// Tooltip for the send button in fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tb_turn_sequence_on + { + buf = qtn_lcam_tb_turn_sequence_on; // "Turn sequence on" + } + +//---------------------------------------------------- +// +// qtn_lcam_tb_sequence +// Text for sequence mode button in toolbar extension +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tb_sequence + { + buf = qtn_lcam_tb_sequence; // "Sequence" + } + +//----------------------------------------------------------------------------- +// +// r_qtn_processing_image +// Processing image text, displayed on blended background in the bottom of +// thescreen in pre- and postcapture view. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_processing_image_text + { + buf = qtn_lcam_note_processing_image; + } + +//----------------------------------------------------------------------------- +// +// r_qtn_processing_burst_image_text +// Processing images text with numbers, displayed on blended background in the bottom of +// thescreen in pre- and postcapture view. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_processing_burst_image_text + { + buf = qtn_lcam_note_processing_images; + } + +//----------------------------------------------------------------------------- +// +// r_qtn_fldr_cant_delete_file_open +// Error string that's used when trying to delete file that's already is use. +// Uses string defined in avkon.loc +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_fldr_cant_delete_file_open + { + buf = qtn_fldr_cant_delete_file_open; + } + +#include "CamConstantsCamcorder.hrh" +#include "CamConstantsViewMode.hrh" +#include "CamConstantsPortrait.hrh" + +// the Settings pages are in separate files for clarity +#include "CamProductSpecificSettings.ra" // Resources for photo and video settings +#include "CamSettings.ra" + +#include "CamAppWide.ra" +#include "CamAppWideCamcorder.ra" +#include "CamAppWidePortrait.ra" +#include "CamAppWideViewMode.ra" + +#include "CamCapture.ra" +#include "CamCaptureCamcorder.ra" +#include "CamCapturePortrait.ra" +#include "CamCaptureViewMode.ra" +#include "CamCaptureCamcorderLeft.ra" + +#include "CamStillCapture.ra" +#include "CamStillCaptureCamcorder.ra" +#include "CamStillCapturePortrait.ra" +#include "CamStillCaptureViewMode.ra" +#include "CamStillCaptureCamcorderLeft.ra" + +#include "CamVideoCapture.ra" +#include "CamVideoCaptureCamcorder.ra" +#include "CamVideoCapturePortrait.ra" +#include "CamVideoCaptureViewMode.ra" +#include "CamVideoCaptureCamcorderLeft.ra" + +#include "CamBurstCapture.ra" + +#include "CamCaptureSetup.ra" + +#include "CamSceneSetup.ra" +#include "CamSceneSetupCamcorder.ra" +#include "CamSceneSetupPortrait.ra" +#include "CamSceneSetupViewMode.ra" + +#include "CamStandby.ra" + +#include "CamEmbedded.ra" +#include "CamEmbeddedCamcorder.ra" +#include "CamEmbeddedPortrait.ra" +#include "CamEmbeddedViewMode.ra" + +#include "CamModeSelect.ra" + +#include "CamActivePalette.ra" + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamActivePalette.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamActivePalette.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for Active Palette component +* +*/ + + + +RESOURCE CAM_AP_POST_CAPTURE_ITEM r_cam_ap_photos + { + text = qtn_lcam_tt_go_to_photos; + bitmap_id = EMbmCameraappQgn_indi_cam4_goto_gallery; + } + +RESOURCE CAM_AP_POST_CAPTURE_ITEM r_cam_ap_delete + { + text = qtn_lcam_tt_delete; + bitmap_id = EMbmCameraappQgn_indi_cam4_tb_delete; + } + +RESOURCE CAM_AP_POST_CAPTURE_ITEM r_cam_ap_play + { + text = qtn_lcam_tt_play; + bitmap_id = EMbmCameraappQgn_indi_cam4_tb_play; + } + +RESOURCE CAM_AP_POST_CAPTURE_ITEM r_cam_ap_send + { + text = qtn_lcam_tt_send; + bitmap_id = EMbmCameraappQgn_indi_cam4_tb_send; + } + +RESOURCE CAM_AP_POST_CAPTURE_ITEM r_cam_ap_send_multimedia + { + text = qtn_lcam_tt_sendtocall; + bitmap_id = EMbmCameraappQgn_indi_cam4_tb_send; + } + + +/** +* Active Palette Item : Add to album +**/ +RESOURCE CAM_AP_POST_CAPTURE_ITEM r_cam_ap_add_to_album + { + text = qtn_lcam_tt_add_to_album; + bitmap_id = EMbmCameraappQgn_indi_cam4_tb_add_to_album; + } + +/** +* Active Palette Item : Properties (Add Detail) +**/ +RESOURCE CAM_AP_POST_CAPTURE_ITEM r_cam_ap_properties + { + text = qtn_lcam_tt_tags; + bitmap_id = EMbmCameraappQgn_indi_tb_cam4_photo_detail; + } + +RESOURCE CAM_AP_POST_CAPTURE_ITEM r_cam_ap_one_click_upload + { + text = ""; // Updated at run-time + bitmap_id = EMbmCameraappQgn_indi_cam4_tb_upload; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamAppWideCamcorder.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamAppWideCamcorder.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,19 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +// This file is not used diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamAppWidePortrait.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamAppWidePortrait.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,19 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamAppWideViewMode.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamAppWideViewMode.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,19 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility functions for the Camera Application* +*/ + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamBurstCapture.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamBurstCapture.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1395 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +#include "CamConstantsCamcorder.hrh" + +#define K9FirstColumnCellOffset 34 +#define K9SecondColumnCellOffset 118 +#define K9ThirdColumnCellOffset 202 +#define K9TopRowCellTop 5 +#define K9MiddleRowCellTop 69 +#define K9BottomRowCellTop 133 +#define K9CellWidth 84 +#define K9CellHeight 64 +#define K9FirstColumnHighOffset 35 +#define K9SecondColumnHighOffset 119 +#define K9ThirdColumnHighOffset 203 +#define K9TopRowHighTop 6 +#define K9MiddleRowHighTop 70 +#define K9BottomRowHighTop 134 +#define K9HighWidth 82 +#define K9HighHeight 62 +#define K9FirstColumnMarkOffset 106 +#define K9SecondColumnMarkOffset 190 +#define K9ThirdColumnMarkOffset 274 +#define K9TopRowMarkTop 12 +#define K9MiddleRowMarkTop 72 +#define K9BottomRowMarkTop 132 +#define K9MarkWidth 10 +#define K9MarkHeight 10 +#define K9FirstColumnThumbOffset 36 +#define K9SecondColumnThumbOffset 120 +#define K9ThirdColumnThumbOffset 204 +#define K9TopRowThumbTop 7 +#define K9MiddleRowThumbTop 71 +#define K9BottomRowThumbTop 135 +#define K9ThumbWidth 80 +#define K9ThumbHeight 60 +#define K9ThumbnailWidth 80 +#define K9ThumbnailHeight 60 +#define K6FirstColumnCellOffset 4 +#define K6SecondColumnCellOffset 108 +#define K6ThirdColumnCellOffset 212 +#define K6TopRowCellTop 20 +#define K6BottomRowCellTop 99 +#define K6CellWidth 104 +#define K6CellHeight 79 +#define K6FirstColumnHighOffset 5 +#define K6SecondColumnHighOffset 109 +#define K6ThirdColumnHighOffset 213 +#define K6TopRowHighTop 21 +#define K6BottomRowHighTop 100 +#define K6HighWidth 102 +#define K6HighHeight 77 +#define K6FirstColumnMarkOffset 93 +#define K6SecondColumnMarkOffset 197 +#define K6ThirdColumnMarkOffset 301 +#define K6TopRowMarkTop 24 +#define K6BottomRowMarkTop 103 +#define K6MarkWidth 10 +#define K6MarkHeight 10 +#define K6FirstColumnThumbOffset 6 +#define K6SecondColumnThumbOffset 110 +#define K6ThirdColumnThumbOffset 214 +#define K6TopRowThumbTop 22 +#define K6BottomRowThumbTop 101 +#define K6ThumbWidth 100 +#define K6ThumbHeight 75 +#define K6ThumbnailWidth 100 +#define K6ThumbnailHeight 75 +#define KTimelapseSliderLeft 160 +#define KTimelapseSliderLeftAH 160 //Left positions were identical in original +#define KTimelapseSliderTop 20 +#define KTimelapseSliderWidth 16 +#define KTimelapseSliderHeight 160 +#define KTimelapseSliderThumbWidth 16 +#define KTimelapseSliderThumbHeight 12 +#define KTimelapseSliderLegendWidth 60 +#define KTimelapseSliderLeftLegendLeft (0) +#define KTimelapseSliderLeftLegendLeftAH (0) +#define KTimelapseSliderLeftLegendRight (KTimelapseSliderLeft + 9) +#define KTimelapseSliderRightLegendLeft (KTimelapseSliderLeft + KTimelapseSliderWidth + 9) +#define KTimelapseSliderRightLegendLeftAH (KTimelapseSliderLeftAH + KTimelapseSliderWidth + 9) +#define KTimelapseSliderRightLegendRight (0) +#define KTimelapseSliderLegendSpacing ( ( KTimelapseSliderHeight - 8 ) / 8) +#define KSliderLegend1Bottom (KTimelapseSliderTop + 8) +#define KSliderLegend2Bottom (KSliderLegend1Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend3Bottom (KSliderLegend2Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend4Bottom (KSliderLegend3Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend5Bottom (KSliderLegend4Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend6Bottom (KSliderLegend5Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend7Bottom (KSliderLegend6Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend8Bottom (KSliderLegend7Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend9Bottom (KSliderLegend8Bottom + KTimelapseSliderLegendSpacing) +#define KSliderWaypointLeft 78 +#define KSliderWaypointRight 150 + + +// --------------------------------------------------- +// +// r_cam_burst_delete_multiple_note +// Dialog to display delete multiple image +// confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_burst_delete_multiple_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + + + +//----------------------------------------------------------------------------- +// +// r_cam_burst_delete_multiple_note_text +// Delete confirmation query text for multiple files +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_burst_delete_multiple_note_text + { + buf = qtn_fldr_del_items_query; + } + +//----------------------------------------------------------------------------- +// +// r_cam_burst_post_capture_grid_array +// Array storing the positions of the components in the Burst post-capture +// thumbnail grid +// NOTE: Cell_rect has to be a pixel wider and higher so adjacent cells +// share a border +// +//----------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_burst_post_capture_grid_array + { + items= + { + CAM_BURST_GRID_ITEM // Cell 0 (top left) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 1 (top middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 2 (top right) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 3 (middle left) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 4 (middle middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 5 (middle right) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 6 (bottom left) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 7 (bottom middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 8 (bottom right) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + } + }; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_burst_post_capture_grid_array_ah +// Array storing the positions of the components in the Burst post-capture +// thumbnail grid (Arabic/Hebrew version) +// NOTE: Cell_rect has to be a pixel wider and higher so adjacent cells +// share a border +// +//----------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_burst_post_capture_grid_array_ah + { + items= + { + CAM_BURST_GRID_ITEM // Cell 0 (top right) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 1 (top middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 2 (top left) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 3 (middle left) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 4 (middle middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 5 (middle right) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 6 (bottom left) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 7 (bottom middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 8 (bottom right) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + } + }; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_burst_post_capture_grid_array_upto_six +// Array storing the positions of the components in the Burst post-capture +// thumbnail grid +// NOTE: Cell_rect has to be a pixel wider and higher so adjacent cells +// share a border +// +//----------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_burst_post_capture_grid_array_upto_six + { + items= + { + CAM_BURST_GRID_ITEM // Cell 0 (top left) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 1 (top middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 2 (top right) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 3 (bottom left) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 4 (bottom middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 5 (bottom right) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + } + }; + } + + + + +//----------------------------------------------------------------------------- +// +// r_cam_burst_post_capture_grid_array_upto_six_ah +// Array storing the positions of the components in the Burst post-capture +// thumbnail grid +// NOTE: Cell_rect has to be a pixel wider and higher so adjacent cells +// share a border +// +//----------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_burst_post_capture_grid_array_upto_six_ah + { + items= + { + CAM_BURST_GRID_ITEM // Cell 0 (top right) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 1 (top middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 2 (top left) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 3 (bottom right) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 4 (bottom middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 5 (bottom left) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_burst_post_capture_grid_scrollbar_position +// Position of the scroll bar when more than 6 grid items on screen. +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_burst_post_capture_grid_scrollbar_position + { + l = 315; + t = 0; + W = 16; + H = KCentralPaneHeightCC; + } + + +//---------------------------------------------------- +// +// r_cam_burst_post_capture_grid_scrollbar_position_ah +// Position of the scroll bar when more than 6 grid items on screen. +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_burst_post_capture_grid_scrollbar_position_ah + { + l = 5; + t = 0; + W = 16; + H = KCentralPaneHeightCC; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_burst_post_capture_thumb_size +// The size of thumbnail images (in pixels) to be shown by burst thumbnail +// grid control +// +//----------------------------------------------------------------------------- +// +RESOURCE CAM_RECT_SIZE r_cam_burst_post_capture_thumb_size + { + width = K6ThumbnailWidth; + height = K6ThumbnailHeight; + } + + +// --------------------------------------------------------- +// +// r_cam_burst_thumbnail_menubar +// Menubar for burst thumbnail view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_burst_thumbnail_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_burst_thumbnail_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_burst_thumbnail_menu +// Options menu for burst thumbnail view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_burst_thumbnail_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdOpenPhoto; + txt = qtn_lcam_options_open_photo; + }, + MENU_ITEM + { + command = ECamCmdSend; + txt = qtn_options_send_via; + }, + MENU_ITEM + { + command = ECamCmdSendToCallerMultimedia; + txt = qtn_lcam_options_send_to_call; + }, + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + }, + MENU_ITEM + { + command = KAiwCmdAssign; + txt = qtn_lcam_use_image_postcapture_menu; + cascade = AIW_INTELLIGENT_CASCADE_ID; + }, + MENU_ITEM + { + command = ECamCmdShareOnOvi; + // AIW provider fills the menu item title. + // No submenu, only 1 provider acccepted. + txt = ""; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = ECamCmdMarkUnmarkMenu; + txt = qtn_options_list; + cascade = R_AVKON_MENUPANE_MARKABLE_LIST_IMPLEMENTATION; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + + +// --------------------------------------------------------- +// +// r_cam_burst_thumbnail_ok_menubar +// Ok menubar for burst thumbnail grid view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_burst_thumbnail_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_burst_thumbnail_ok_menu; + } + }; + } + + +// --------------------------------------------------------- +// +// r_cam_burst_thumbnail_ok_menu +// Context specific ok options menu for burst +// thumbnail grid view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_burst_thumbnail_ok_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + }, + MENU_ITEM + { + command = ECamCmdSend; + txt = qtn_options_send_via; + }, + MENU_ITEM + { + command = ECamCmdSendToCallerMultimedia; + txt = qtn_lcam_options_send_to_call; + }, + MENU_ITEM + { + command = ECamCmdMarkUnmarkMenu; + txt = qtn_options_list; + cascade = R_AVKON_MENUPANE_MARKABLE_LIST_IMPLEMENTATION; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_burst_thumbnail_view +// Thumbnail view after burst capture +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_burst_thumbnail_view + { + menubar = r_cam_burst_thumbnail_menubar; + cba = R_CAM_SOFTKEYS_OPTIONS_BACK__SELECT; + toolbar = r_cam_burst_postcapture_toolbar; + } + + +// --------------------------------------------------- +// +// r_cam_timelapse_image_text_layout +// Layout for captured and remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_image_text_layout + { + font = EAknLogicalFontSecondaryFont; C=0; l=26; B=234; W=100; J=ELayoutAlignLeft; + // font = EAknLogicalFontSecondaryFont; C=0; l=296; r=224; B=234; W=32; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_timelapse_image_text_layout_ah_camcorder +// Arabic/Hebrew layout for captured and remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_image_text_layout_ah + { + //font = EAknLogicalFontSecondaryFont; C=0; l=26; B=234; W=100; J=ELayoutAlignLeft; + font = EAknLogicalFontSecondaryFont; C=0; l=45; B=234; W=100; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_timelapse_countdown_text_layout +// Layout for remaining time till next timelapse capture +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_countdown_text_layout + { + font = EAknLogicalFontSecondaryFont; C=0; l=130; B=234; W=100; J=ELayoutAlignLeft; + // font = EAknLogicalFontSecondaryFont; C=0; l=224; r=174; B=234; W=45; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_timelapse_countdown_text_layout_ah_camcorder +// Arabic/Hebrew layout for remaining time till next timelapse capture +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_countdown_text_layout_ah + { + font = EAknLogicalFontSecondaryFont; C=0; l=130; B=234; W=100; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_timelapse_captured_text_layout +// Layout for count of captured images in post capture view +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_captured_text_layout + { + font = EAknLogicalFontSecondaryFont; C=0; l=20; B=234; W=100; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_timelapse_captured_text_layout_ah +// Arabic/Hebrew layout for count of captured images in post capture view +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_captured_text_layout_ah + { + //font = EAknLogicalFontSecondaryFont; C=0; l=20; B=234; W=100; J=ELayoutAlignLeft; + font = EAknLogicalFontSecondaryFont; C=0; l=22; B=234; W=100; J=ELayoutAlignLeft; + } + +// --------------------------------------------------------- +// +// r_cam_timelapse_in_capture_navicounter_decorations +// Decorations for the navicounter during timelapse capture +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_timelapse_in_capture_navicounter_decorations + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 0; // 20; // 0 + tl_y = 219; // 220; + width = 180; //220; // 200; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_timelapse_post_capture_navicounter_decorations +// Decorations for the navicounter in timelapse post capture view +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_timelapse_post_capture_navicounter_decorations + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 0; + tl_y = 219; + width = 167; + } + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_timelapse_images_captured +// String for the count of captured images in timelapse +// postcapture view +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_timelapse_images_captured + { + buf = qtn_lcam_images_captured; + } + +//---------------------------------------------------- +// +// r_cam_timelapse_countdown_time +// String for the remaining time till next capture +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_timelapse_countdown_time + { + buf = qtn_lcam_time_cap; + } + +//---------------------------------------------------- +// +// r_cam_sequence_icon_rect +// Position of the sequence capture icon +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_sequence_icon_rect + { + r = 199; + // Background top at 219 + // Background height 20 + // Icon height 16 + // => Icon top at 219 + (20/2 - 16/2) = 221 when centered + t = 221; + W = 16; + H = 16; + } + +//---------------------------------------------------- +// +// r_cam_sequence_icon_rect_ah +// Position of the sequence capture icon +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_sequence_icon_rect_ah + { + //l = 5; + r = 280; + t = 221; + W = 16; + H = 16; + } + +//---------------------------------------------------- +// +// r_cam_time_lapse_title +// Time lapse slider title string +// +//---------------------------------------------------- +RESOURCE TITLE_PANE r_cam_time_lapse_title + { + txt = qtn_lcam_selector_title_tl; //qtn_lcam_title_tl; + } + + + +// Time lapse listbox +RESOURCE ARRAY r_cam_capture_setup_list_sequence_mode + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_adv_seq_off; + setting_value_id = ECamTimeLapseOff; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_burst; + setting_value_id = ECamTimeLapseMin; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_burst; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_5secs; + setting_value_id = ECamTimeLapse5sec; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_5s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_10secs; + setting_value_id = ECamTimeLapse10sec; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_10s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_30secs; + setting_value_id = ECamTimeLapse30sec; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_30s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_1min; + setting_value_id = ECamTimeLapse1min; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_1min; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_5min; + setting_value_id = ECamTimeLapse5min; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_5min; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_10min; + setting_value_id = ECamTimeLapse10min; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_10min; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_30min; + setting_value_id = ECamTimeLapse30min; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_30min; + } + }; + } + +RESOURCE ARRAY r_cam_capture_setup_list_sequence_mode_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapseOff; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence; + summary_title_text = qtn_lcam_set_adv_seq_off; + summary_description_text = qtn_lcam_set_adv_seq_off_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapseMin; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_burst; + summary_title_text = qtn_lcam_set_burst; + summary_description_text = qtn_lcam_set_burst2_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse5sec; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_5s; + summary_title_text = qtn_lcam_set_seq_5secs; + summary_description_text = qtn_lcam_set_seq_5secs_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse10sec; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_10s; + summary_title_text = qtn_lcam_set_seq_10secs; + summary_description_text = qtn_lcam_set_seq_10secs_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse30sec; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_30s; + summary_title_text = qtn_lcam_set_seq_30secs; + summary_description_text = qtn_lcam_set_seq_30secs_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse1min; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_1min; + summary_title_text = qtn_lcam_set_seq_1min; + summary_description_text = qtn_lcam_set_seq_1min_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse5min; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_5min; + summary_title_text = qtn_lcam_set_seq_5min; + summary_description_text = qtn_lcam_set_seq_5min_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse10min; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_10min; + summary_title_text = qtn_lcam_set_seq_10min; + summary_description_text = qtn_lcam_set_seq_10min_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse30min; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_30min; + summary_title_text = qtn_lcam_set_seq_30min; + summary_description_text = qtn_lcam_set_seq_30min_ex; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_infolistbox_menubar +// Menubar for InfoListBox +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_infolistbox_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_infolistbox_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_scene_infolistbox_menu +// Options menu for InfoListBox +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_infolistbox_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdSelect; + txt = qtn_lcam_options_select; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamBurstCaptureV2.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamBurstCaptureV2.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1395 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +#include "CamConstantsCamcorder.hrh" + +#define K9FirstColumnCellOffset 34 +#define K9SecondColumnCellOffset 118 +#define K9ThirdColumnCellOffset 202 +#define K9TopRowCellTop 5 +#define K9MiddleRowCellTop 69 +#define K9BottomRowCellTop 133 +#define K9CellWidth 84 +#define K9CellHeight 64 +#define K9FirstColumnHighOffset 35 +#define K9SecondColumnHighOffset 119 +#define K9ThirdColumnHighOffset 203 +#define K9TopRowHighTop 6 +#define K9MiddleRowHighTop 70 +#define K9BottomRowHighTop 134 +#define K9HighWidth 82 +#define K9HighHeight 62 +#define K9FirstColumnMarkOffset 106 +#define K9SecondColumnMarkOffset 190 +#define K9ThirdColumnMarkOffset 274 +#define K9TopRowMarkTop 12 +#define K9MiddleRowMarkTop 72 +#define K9BottomRowMarkTop 132 +#define K9MarkWidth 10 +#define K9MarkHeight 10 +#define K9FirstColumnThumbOffset 36 +#define K9SecondColumnThumbOffset 120 +#define K9ThirdColumnThumbOffset 204 +#define K9TopRowThumbTop 7 +#define K9MiddleRowThumbTop 71 +#define K9BottomRowThumbTop 135 +#define K9ThumbWidth 80 +#define K9ThumbHeight 60 +#define K9ThumbnailWidth 80 +#define K9ThumbnailHeight 60 +#define K6FirstColumnCellOffset 4 +#define K6SecondColumnCellOffset 108 +#define K6ThirdColumnCellOffset 212 +#define K6TopRowCellTop 20 +#define K6BottomRowCellTop 99 +#define K6CellWidth 104 +#define K6CellHeight 79 +#define K6FirstColumnHighOffset 5 +#define K6SecondColumnHighOffset 109 +#define K6ThirdColumnHighOffset 213 +#define K6TopRowHighTop 21 +#define K6BottomRowHighTop 100 +#define K6HighWidth 102 +#define K6HighHeight 77 +#define K6FirstColumnMarkOffset 93 +#define K6SecondColumnMarkOffset 197 +#define K6ThirdColumnMarkOffset 301 +#define K6TopRowMarkTop 24 +#define K6BottomRowMarkTop 103 +#define K6MarkWidth 10 +#define K6MarkHeight 10 +#define K6FirstColumnThumbOffset 6 +#define K6SecondColumnThumbOffset 110 +#define K6ThirdColumnThumbOffset 214 +#define K6TopRowThumbTop 22 +#define K6BottomRowThumbTop 101 +#define K6ThumbWidth 100 +#define K6ThumbHeight 75 +#define K6ThumbnailWidth 100 +#define K6ThumbnailHeight 75 +#define KTimelapseSliderLeft 160 +#define KTimelapseSliderLeftAH 160 //Left positions were identical in original +#define KTimelapseSliderTop 20 +#define KTimelapseSliderWidth 16 +#define KTimelapseSliderHeight 160 +#define KTimelapseSliderThumbWidth 16 +#define KTimelapseSliderThumbHeight 12 +#define KTimelapseSliderLegendWidth 60 +#define KTimelapseSliderLeftLegendLeft (0) +#define KTimelapseSliderLeftLegendLeftAH (0) +#define KTimelapseSliderLeftLegendRight (KTimelapseSliderLeft + 9) +#define KTimelapseSliderRightLegendLeft (KTimelapseSliderLeft + KTimelapseSliderWidth + 9) +#define KTimelapseSliderRightLegendLeftAH (KTimelapseSliderLeftAH + KTimelapseSliderWidth + 9) +#define KTimelapseSliderRightLegendRight (0) +#define KTimelapseSliderLegendSpacing ( ( KTimelapseSliderHeight - 8 ) / 8) +#define KSliderLegend1Bottom (KTimelapseSliderTop + 8) +#define KSliderLegend2Bottom (KSliderLegend1Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend3Bottom (KSliderLegend2Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend4Bottom (KSliderLegend3Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend5Bottom (KSliderLegend4Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend6Bottom (KSliderLegend5Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend7Bottom (KSliderLegend6Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend8Bottom (KSliderLegend7Bottom + KTimelapseSliderLegendSpacing) +#define KSliderLegend9Bottom (KSliderLegend8Bottom + KTimelapseSliderLegendSpacing) +#define KSliderWaypointLeft 78 +#define KSliderWaypointRight 150 + + +// --------------------------------------------------- +// +// r_cam_burst_delete_multiple_note +// Dialog to display delete multiple image +// confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_burst_delete_multiple_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + + + +//----------------------------------------------------------------------------- +// +// r_cam_burst_delete_multiple_note_text +// Delete confirmation query text for multiple files +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_burst_delete_multiple_note_text + { + buf = qtn_fldr_del_items_query; + } + +//----------------------------------------------------------------------------- +// +// r_cam_burst_post_capture_grid_array +// Array storing the positions of the components in the Burst post-capture +// thumbnail grid +// NOTE: Cell_rect has to be a pixel wider and higher so adjacent cells +// share a border +// +//----------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_burst_post_capture_grid_array + { + items= + { + CAM_BURST_GRID_ITEM // Cell 0 (top left) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 1 (top middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 2 (top right) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 3 (middle left) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 4 (middle middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 5 (middle right) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 6 (bottom left) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9FirstColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 7 (bottom middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9SecondColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 8 (bottom right) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K9ThirdColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + } + }; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_burst_post_capture_grid_array_ah +// Array storing the positions of the components in the Burst post-capture +// thumbnail grid (Arabic/Hebrew version) +// NOTE: Cell_rect has to be a pixel wider and higher so adjacent cells +// share a border +// +//----------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_burst_post_capture_grid_array_ah + { + items= + { + CAM_BURST_GRID_ITEM // Cell 0 (top right) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 1 (top middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 2 (top left) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnCellOffset; t=K9TopRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnHighOffset; t=K9TopRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnMarkOffset; t=K9TopRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnThumbOffset; t=K9TopRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 3 (middle left) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 4 (middle middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 5 (middle right) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnCellOffset; t=K9MiddleRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnHighOffset; t=K9MiddleRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnMarkOffset; t=K9MiddleRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnThumbOffset; t=K9MiddleRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 6 (bottom left) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9FirstColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 7 (bottom middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9SecondColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 8 (bottom right) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnCellOffset; t=K9BottomRowCellTop; W=K9CellWidth; H=K9CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnHighOffset; t=K9BottomRowHighTop; W=K9HighWidth; H=K9HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnMarkOffset; t=K9BottomRowMarkTop; W=K9MarkWidth; H=K9MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K9ThirdColumnThumbOffset; t=K9BottomRowThumbTop; W=K9ThumbWidth; H=K9ThumbHeight; + }; + } + }; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_burst_post_capture_grid_array_upto_six +// Array storing the positions of the components in the Burst post-capture +// thumbnail grid +// NOTE: Cell_rect has to be a pixel wider and higher so adjacent cells +// share a border +// +//----------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_burst_post_capture_grid_array_upto_six + { + items= + { + CAM_BURST_GRID_ITEM // Cell 0 (top left) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 1 (top middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 2 (top right) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 3 (bottom left) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6FirstColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 4 (bottom middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6SecondColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 5 (bottom right) + { + cell_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + l=K6ThirdColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + } + }; + } + + + + +//----------------------------------------------------------------------------- +// +// r_cam_burst_post_capture_grid_array_upto_six_ah +// Array storing the positions of the components in the Burst post-capture +// thumbnail grid +// NOTE: Cell_rect has to be a pixel wider and higher so adjacent cells +// share a border +// +//----------------------------------------------------------------------------- +// +RESOURCE ARRAY r_cam_burst_post_capture_grid_array_upto_six_ah + { + items= + { + CAM_BURST_GRID_ITEM // Cell 0 (top right) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 1 (top middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 2 (top left) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnCellOffset; t=K6TopRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnHighOffset; t=K6TopRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnMarkOffset; t=K6TopRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnThumbOffset; t=K6TopRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + + CAM_BURST_GRID_ITEM // Cell 3 (bottom right) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6FirstColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 4 (bottom middle) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6SecondColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + }, + CAM_BURST_GRID_ITEM // Cell 5 (bottom left) + { + cell_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnCellOffset; t=K6BottomRowCellTop; W=K6CellWidth; H=K6CellHeight; + }; + high_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnHighOffset; t=K6BottomRowHighTop; W=K6HighWidth; H=K6HighHeight; + }; + mark_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnMarkOffset; t=K6BottomRowMarkTop; W=K6MarkWidth; H=K6MarkHeight; + }; + thmb_rect = AVKON_LAYOUT_RECT + { + r=K6ThirdColumnThumbOffset; t=K6BottomRowThumbTop; W=K6ThumbWidth; H=K6ThumbHeight; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_burst_post_capture_grid_scrollbar_position +// Position of the scroll bar when more than 6 grid items on screen. +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_burst_post_capture_grid_scrollbar_position + { + l = 315; + t = 0; + W = 16; + H = KCentralPaneHeightCC; + } + + +//---------------------------------------------------- +// +// r_cam_burst_post_capture_grid_scrollbar_position_ah +// Position of the scroll bar when more than 6 grid items on screen. +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_burst_post_capture_grid_scrollbar_position_ah + { + l = 5; + t = 0; + W = 16; + H = KCentralPaneHeightCC; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_burst_post_capture_thumb_size +// The size of thumbnail images (in pixels) to be shown by burst thumbnail +// grid control +// +//----------------------------------------------------------------------------- +// +RESOURCE CAM_RECT_SIZE r_cam_burst_post_capture_thumb_size + { + width = K6ThumbnailWidth; + height = K6ThumbnailHeight; + } + + +// --------------------------------------------------------- +// +// r_cam_burst_thumbnail_menubar +// Menubar for burst thumbnail view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_burst_thumbnail_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_burst_thumbnail_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_burst_thumbnail_menu +// Options menu for burst thumbnail view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_burst_thumbnail_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdOpenPhoto; + txt = qtn_lcam_options_open_photo; + }, + MENU_ITEM + { + command = ECamCmdSend; + txt = qtn_options_send_via; + }, + MENU_ITEM + { + command = ECamCmdSendToCallerMultimedia; + txt = qtn_lcam_options_send_to_call; + }, + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + }, + MENU_ITEM + { + command = KAiwCmdAssign; + txt = qtn_lcam_use_image_postcapture_menu; + cascade = AIW_INTELLIGENT_CASCADE_ID; + }, + MENU_ITEM + { + command = ECamCmdShareOnOvi; + // AIW provider fills the menu item title. + // No submenu, only 1 provider acccepted. + txt = ""; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = ECamCmdMarkUnmarkMenu; + txt = qtn_options_list; + cascade = R_AVKON_MENUPANE_MARKABLE_LIST_IMPLEMENTATION; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + + +// --------------------------------------------------------- +// +// r_cam_burst_thumbnail_ok_menubar +// Ok menubar for burst thumbnail grid view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_burst_thumbnail_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_burst_thumbnail_ok_menu; + } + }; + } + + +// --------------------------------------------------------- +// +// r_cam_burst_thumbnail_ok_menu +// Context specific ok options menu for burst +// thumbnail grid view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_burst_thumbnail_ok_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + }, + MENU_ITEM + { + command = ECamCmdSend; + txt = qtn_options_send_via; + }, + MENU_ITEM + { + command = ECamCmdSendToCallerMultimedia; + txt = qtn_lcam_options_send_to_call; + }, + MENU_ITEM + { + command = ECamCmdMarkUnmarkMenu; + txt = qtn_options_list; + cascade = R_AVKON_MENUPANE_MARKABLE_LIST_IMPLEMENTATION; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_burst_thumbnail_view +// Thumbnail view after burst capture +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_burst_thumbnail_view + { + menubar = r_cam_burst_thumbnail_menubar; + cba = R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE; + toolbar = r_cam_burst_postcapture_toolbar; + } + + +// --------------------------------------------------- +// +// r_cam_timelapse_image_text_layout +// Layout for captured and remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_image_text_layout + { + font = EAknLogicalFontSecondaryFont; C=0; l=26; B=234; W=100; J=ELayoutAlignLeft; + // font = EAknLogicalFontSecondaryFont; C=0; l=296; r=224; B=234; W=32; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_timelapse_image_text_layout_ah_camcorder +// Arabic/Hebrew layout for captured and remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_image_text_layout_ah + { + //font = EAknLogicalFontSecondaryFont; C=0; l=26; B=234; W=100; J=ELayoutAlignLeft; + font = EAknLogicalFontSecondaryFont; C=0; l=45; B=234; W=100; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_timelapse_countdown_text_layout +// Layout for remaining time till next timelapse capture +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_countdown_text_layout + { + font = EAknLogicalFontSecondaryFont; C=0; l=130; B=234; W=100; J=ELayoutAlignLeft; + // font = EAknLogicalFontSecondaryFont; C=0; l=224; r=174; B=234; W=45; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_timelapse_countdown_text_layout_ah_camcorder +// Arabic/Hebrew layout for remaining time till next timelapse capture +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_countdown_text_layout_ah + { + font = EAknLogicalFontSecondaryFont; C=0; l=130; B=234; W=100; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_timelapse_captured_text_layout +// Layout for count of captured images in post capture view +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_captured_text_layout + { + font = EAknLogicalFontSecondaryFont; C=0; l=20; B=234; W=100; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_timelapse_captured_text_layout_ah +// Arabic/Hebrew layout for count of captured images in post capture view +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_timelapse_captured_text_layout_ah + { + //font = EAknLogicalFontSecondaryFont; C=0; l=20; B=234; W=100; J=ELayoutAlignLeft; + font = EAknLogicalFontSecondaryFont; C=0; l=22; B=234; W=100; J=ELayoutAlignLeft; + } + +// --------------------------------------------------------- +// +// r_cam_timelapse_in_capture_navicounter_decorations +// Decorations for the navicounter during timelapse capture +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_timelapse_in_capture_navicounter_decorations + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 0; // 20; // 0 + tl_y = 219; // 220; + width = 180; //220; // 200; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_timelapse_post_capture_navicounter_decorations +// Decorations for the navicounter in timelapse post capture view +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_timelapse_post_capture_navicounter_decorations + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 0; + tl_y = 219; + width = 167; + } + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_timelapse_images_captured +// String for the count of captured images in timelapse +// postcapture view +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_timelapse_images_captured + { + buf = qtn_lcam_images_captured_v2; + } + +//---------------------------------------------------- +// +// r_cam_timelapse_countdown_time +// String for the remaining time till next capture +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_timelapse_countdown_time + { + buf = qtn_lcam_time_cap; + } + +//---------------------------------------------------- +// +// r_cam_sequence_icon_rect +// Position of the sequence capture icon +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_sequence_icon_rect + { + r = 199; + // Background top at 219 + // Background height 20 + // Icon height 16 + // => Icon top at 219 + (20/2 - 16/2) = 221 when centered + t = 221; + W = 16; + H = 16; + } + +//---------------------------------------------------- +// +// r_cam_sequence_icon_rect_ah +// Position of the sequence capture icon +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_sequence_icon_rect_ah + { + //l = 5; + r = 280; + t = 221; + W = 16; + H = 16; + } + +//---------------------------------------------------- +// +// r_cam_time_lapse_title +// Time lapse slider title string +// +//---------------------------------------------------- +RESOURCE TITLE_PANE r_cam_time_lapse_title + { + txt = qtn_lcam_selector_title_tl; //qtn_lcam_title_tl; + } + + + +// Time lapse listbox +RESOURCE ARRAY r_cam_capture_setup_list_sequence_mode + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_adv_seq_off; + setting_value_id = ECamTimeLapseOff; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_burst; + setting_value_id = ECamTimeLapseMin; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_burst; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_5secs; + setting_value_id = ECamTimeLapse5sec; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_5s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_10secs; + setting_value_id = ECamTimeLapse10sec; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_10s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_30secs; + setting_value_id = ECamTimeLapse30sec; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_30s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_1min; + setting_value_id = ECamTimeLapse1min; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_1min; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_5min; + setting_value_id = ECamTimeLapse5min; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_5min; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_10min; + setting_value_id = ECamTimeLapse10min; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_10min; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_set_seq_30min; + setting_value_id = ECamTimeLapse30min; + bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_30min; + } + }; + } + +RESOURCE ARRAY r_cam_capture_setup_list_sequence_mode_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapseOff; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence; + summary_title_text = qtn_lcam_set_adv_seq_off; + summary_description_text = qtn_lcam_set_adv_seq_off_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapseMin; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_burst; + summary_title_text = qtn_lcam_set_burst; + summary_description_text = qtn_lcam_set_burst2_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse5sec; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_5s; + summary_title_text = qtn_lcam_set_seq_5secs; + summary_description_text = qtn_lcam_set_seq_5secs_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse10sec; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_10s; + summary_title_text = qtn_lcam_set_seq_10secs; + summary_description_text = qtn_lcam_set_seq_10secs_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse30sec; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_30s; + summary_title_text = qtn_lcam_set_seq_30secs; + summary_description_text = qtn_lcam_set_seq_30secs_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse1min; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_1min; + summary_title_text = qtn_lcam_set_seq_1min; + summary_description_text = qtn_lcam_set_seq_1min_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse5min; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_5min; + summary_title_text = qtn_lcam_set_seq_5min; + summary_description_text = qtn_lcam_set_seq_5min_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse10min; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_10min; + summary_title_text = qtn_lcam_set_seq_10min; + summary_description_text = qtn_lcam_set_seq_10min_ex; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamTimeLapse30min; + summary_icon = EMbmCameraappQgn_indi_cam4_sequence_30min; + summary_title_text = qtn_lcam_set_seq_30min; + summary_description_text = qtn_lcam_set_seq_30min_ex; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_infolistbox_menubar +// Menubar for InfoListBox +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_infolistbox_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_infolistbox_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_scene_infolistbox_menu +// Options menu for InfoListBox +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_infolistbox_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdSelect; + txt = qtn_lcam_options_select; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamCaptureCamcorder.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamCaptureCamcorder.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,540 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + +#define KResolutionIndicatorCCBRx 72 +#define KResolutionIndicatorCCBRy 242 +#define KVidResolutionIndicatorCCBRx 85 +#define KVidResolutionIndicatorCCBRy 236 + +#define KIndicatorStatusCCSeparatorWidth 5 + +#define KIndicatorCaptureTypeCCTLx (KIndicatorStatusCCSeparatorWidth) +#define KIndicatorCaptureTypeCCTLy 3 + +#define KIndicatorStabilisationCCTLx (KIndicatorCaptureTypeCCTLx + KIndicatorCaptureTypeIconWidth + 10) +#define KIndicatorStabilisationCCTLy KIndicatorCaptureTypeCCTLy + +#define KIndicatorAudioMuteCCTLx (KIndicatorStabilisationCCTLx + KIndicatorAudioMuteIconCCWidth + KIndicatorStatusCCSeparatorWidth) +#define KIndicatorAudioMuteCCTLy KIndicatorCaptureTypeCCTLy + +#define KIndicatorVideoModeCCBRx (KVidResolutionIndicatorCCBRx + 15) +#define KIndicatorVideoModeCCBRy (KVidResolutionIndicatorCCBRy + 2) + +#define KIndicatorShakeWarningCCTLx (KIndicatorCaptureTypeCCTLx + KIndicatorCaptureTypeIconWidth + 10) +#define KIndicatorShakeWarningCCTLy KIndicatorCaptureTypeCCTLy + + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_camcorder +// Location for the Zoom Pane background frame. +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_camcorder + { + l = 13; + t = 61; + W = 11; + H = 218; + } + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_shaft_camcorder +// Location for the Zoom Pane shaft, drawn *within* the frame +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_shaft_camcorder + { + l = 15; + t = 63; + W = 7; + H = 214; + } + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_horiz_camcorder +// Location for the Zoom Pane background frame. +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_horiz_camcorder + { + l = 101; + t = 35; + W = 118; + H = 22; + } + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_shaft_horiz_camcorder +// Location for the Zoom Pane shaft, drawn *within* the frame +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_shaft_horiz_camcorder + { + l = 103; + t = 37; + W = 114; + H = 7; + } + + + +// --------------------------------------------------- +// +// r_cam_counter_icon_rect +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_counter_icon_rect_camcorder + { + l = 25; t = 342; W = 11; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_counter_icon_rect_ah +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_counter_icon_rect_ah_camcorder + { + l = 25; t = 342; W = 11; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_memory_location +// Layout rect for memory location icon in video navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_memory_location + { + // l = 5; t = 222; W = 11; H = 16; + //r = 280; t = 221; W = 16; H = 16; + //r = 206; t = 222; W = 16; H = 16; + r = 531; t = 342; W = 16; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_memory_location_ah +// Arabic/Hebrew layout rect for memory location icon in video navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_memory_location_ah + { + //l = 5; t = 222; W = 11; H = 16; + //r = 280; t = 221; W = 16; H = 16; + //l = 24; t = 222; W = 16; H = 16; + l = 56; t = 342; W = 16; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_memory_location +// Layout rect for memory location icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_memory_location + { + r = 536; t = 342; W = 16; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_memory_location_ah +// Arabic/Hebrew layout rect for memory location icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_memory_location_ah + { + r = 573; t = 342; W = 11; H = 14; + } + + +// --------------------------------------------------- +// +// r_cam_video_precap_file_type +// Layout rect for video file type icon in video navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_file_type + { + l = 6; t = 320; W = 9; H = 14; + + } + +// --------------------------------------------------- +// +// r_cam_video_precap_file_type_ah +// Arabic/Hebrew layout rect for video file type icon in video navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_file_type_ah + { + l = 6; t = 342; W = 9; H = 14; + } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_limit_file_type +// The size and position of the video filetype icon during capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_file_type + { + l = 42; t = 341; W = 16; H = 16; + } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_unlimit_file_type +// The size and position of the video filetype icon during capture +// when the progress bar is not visible. +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_file_type + { + l = 42; t = 341; W = 16; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_location +// Layout rect for location icon in image navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_location + { + r = 522; t = 342; W = 16; H = 16; + } +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_location_ah + { + //r = 200; t = 221; W = 14; H = 14; + r = 529; t = 341; W = 16; H = 16; + } +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_location_portrait + { + //r = 202; t = 221; W = 14; H = 14; + //removed from portrait mode + //r = 211; t = 221; W = 0; H = 0; + } +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_location_viewmode + { + //r = 202; t = 221; W = 14; H = 14; + r = 531; t = 341; W = 16; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_quality_icons +// Layout rect for image resolution icon in image navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_quality_icons + { + r = 592; t = 342; W = 24; H = 14; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_quality_icons_ah +// Arabic/Hebrew layout rect for image resolution icon in image navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_quality_icons_ah + { + r = 592; t = 342; W = 24; H = 14; + } + +//----------------------------------------------------------------------------- +// +// r_cam_video_precap_quality_icons +// The size and position of the video resolution icon +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_quality_icons + { + l = 24; t = 341; W = 16; H = 16; + } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_limit_quality_icons +// The size and position of the video resolution icon during capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_quality_icons + { + l = 24; t = 341; W = 16; H = 16; + } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_unlimit_quality_icons +// The size and position of the video resolution icon during capture +// when the progress bar is not visible. +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_quality_icons + { + l = 24; t = 341; W = 16; H = 16; + } + +//---------------------------------------------------- +// +// r_cam_sidepane +// Camera Sidepane +// +//---------------------------------------------------- +// +RESOURCE CAMERA_SIDEPANE r_cam_sidepane_camcorder + { + indicators = + { + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorVideoStabiliser; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = 0; + tl_y = 0; + br_x = 0; + br_y = 0; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_stabilize_on; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_stabilize_on_mask; } + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorAudioMute; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = 0; + tl_y = 0; + br_x = 0; + br_y = 0; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_audio_mute; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_audio_mute_mask; } + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorFaceTracking; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = 0; + tl_y = 0; + br_x = 0; + br_y = 0; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_facedet; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_facedet_mask; } + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorCaptureMode; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = 0; + tl_y = 0; + br_x = 0; + br_y = 0; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_camera; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_camera_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_video; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_video_mask; } + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorBurstMode; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = 0; + tl_y = 0; + br_x = 0; + br_y = 0; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_burst; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_burst_mask; } + }; + } + }; + } + +//---------------------------------------------------- +// r_cam_sidepane_rect_cam1 +// Layout rect for sidepane/zoompane in primary camera +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_sidepane_rect_cam1_camcorder + { + l = 599; t = 0; W = 0; H = 0; + } + +//---------------------------------------------------- +// r_cam_sidepane_rect_cam2 +// Layout rect for sidepane/zoompane in secondary camera +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_sidepane_rect_cam2_camcorder + { + l = 599; t = 2; W = 0; H = 0; + } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_still +// The size and position of the viewfinder in still capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_still_camcorder + { l = 80; t = 0; W = 480; H = 360; } // QHD OK + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_cif +// The size and position of the viewfinder in large video resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_cif_camcorder + { l = 144; t = 36; W = 352; H = 288; } // QHD OK + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_cif_camcorder_adjusted +// The size and position of the viewfinder in large video resolution - adjusted to 320x240 screen +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_cif_camcorder_adjusted + { l = 100; t = 0; W = 440; H = 360; } // QHD OK + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_qvga +// The size and position of the viewfinder in large video resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_qvga_camcorder + { l = 80; t = 0; W = 480; H = 360; } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_qcif +// The size and position of the viewfinder in medium video resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_qcif_camcorder + { l = 100; t = 0; W = 440; H = 360; } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_sqcif +// The size and position of the viewfinder in small video resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_sqcif_camcorder + { l = 80; t = 0; W = 480; H = 360; } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_secondary +// The size and position of the viewfinder in large video resolution +// for secondary camera +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_secondary_camcorder + { l = 80; t = 0; W = 480; H = 360; } + +//---------------------------------------------------- +// +// r_cam_zoom_pane_width +// Width of the zoom pane (not just the zoom shaft) +// +//---------------------------------------------------- +// +RESOURCE INT16 r_cam_zoom_pane_width_camcorder + { + value = 19; + } + +//---------------------------------------------------- +// +// r_cam_layout_battery_pane +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_battery_pane + { + l = 0; + t = 339; + W = 21; // Ignored + H = 21; // Ignored + } + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamCaptureCamcorderLeft.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamCaptureCamcorderLeft.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,303 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_camcorder_left +// Location for the Zoom Pane background frame. +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_camcorder_left + { + l = 299; + t = 61; + W = 11; + H = 118; + } + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_shaft_camcorder_left +// Location for the Zoom Pane shaft, drawn *within* the frame +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_shaft_camcorder_left + { + l = 301; + t = 63; + W = 7; + H = 114; + } + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_horiz_camcorder_left +// Location for the Zoom Pane background frame. +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_horiz_camcorder_left + { + l = 101; + t = 35; + W = 118; + H = 11; + } + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_shaft_horiz_camcorder_left +// Location for the Zoom Pane shaft, drawn *within* the frame +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_shaft_horiz_camcorder_left + { + l = 103; + t = 37; + W = 114; + H = 7; + } + + + +// --------------------------------------------------- +// +// r_cam_counter_icon_rect_camcorder_left +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_counter_icon_rect_camcorder_left + { + l = 276; t = 223; W = 11; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_counter_icon_rect_ah_camcorder_left +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_counter_icon_rect_ah_camcorder_left + { + l = 276; t = 223; W = 11; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_memory_location_left +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_memory_location_left + { + l = 257; t = 222; W = 11; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_memory_location_ah_left +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_memory_location_ah_left + { + l = 257; t = 222; W = 11; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_memory_location_left +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_memory_location_left + { + l = 302; t = 222; W = 11; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_memory_location_ah_left +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_memory_location_ah_left + { + l = 302; t = 222; W = 11; H = 16; + } + + +// --------------------------------------------------- +// +// r_cam_video_precap_file_type_left +// Layout rect for video file type icon in video navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_file_type_left + { + l = 302; t = 221; W = 9; H = 14; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_file_type_ah_left +// Arabic/Hebrew layout rect for video file type icon in video navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_file_type_ah_left + { + l = 302; t = 221; W = 9; H = 14; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_quality_icons_left +// Layout rect for image resolution icon in image navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_quality_icons_left + { + l = 247; t = 221; W = 24; H = 14; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_quality_icons_ah_left +// Arabic/Hebrew layout rect for image resolution icon in image navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_quality_icons_ah_left + { + l = 247; t = 221; W = 24; H = 14; + } + + +//---------------------------------------------------- +// +// r_cam_video_filetype_pane_camcorder_left +// Video file type indicator - uses side pane resource +// Allows specifying position and size for all +// video file type indicators +// +//---------------------------------------------------- +// +RESOURCE CAMERA_SIDEPANE r_cam_video_filetype_pane_camcorder_left + { + indicators = + { + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorVideoFileType; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = 0; + tl_y = 0; + br_x = 0; + br_y = 0; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_mp4; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_mp4_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_3gp; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_3gp_mask; } + }; + } + }; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_video_precap_quality_icons_left +// The size and position of the video resolution icon +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_quality_icons_left + { l = 276; t = 223; W = 19; H = 11; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_limit_quality_icons_left +// The size and position of the video resolution icon during capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_quality_icons_left + { l = 152; t = 223; W = 19; H = 11; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_unlimit_quality_icons_left +// The size and position of the video resolution icon during capture +// when the progress bar is not visible. +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_quality_icons_left + { l = 152; t = 223; W = 19; H = 11; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_limit_file_type_left +// The size and position of the video filetype icon during capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_file_type_left + { l = 66; t = 228; W = 11; H = 16; } + +//----------------------------------------------------------------------------- +// +// r_cam_vidfiletype_capture_icon_rect_camcorder_noprogbar_left +// The size and position of the video filetype icon during capture +// when the progress bar is not visible. +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_vidfiletype_capture_icon_rect_noprogbar_camcorder_left + { l = 66; t = 228; W = 11; H = 16; } + + +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_location_left + { + //r = 247; t = 221; W = 24; H = 14; + //r = 223; t = 221; W = 16; H = 16; + l = 211; t = 221; W = 16; H = 16; + } +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_location_left_ah + { + //r = 247; t = 221; W = 24; H = 14; + //r = 223; t = 221; W = 16; H = 16; + l = 211; t = 221; W = 16; H = 16; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamCapturePortrait.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamCapturePortrait.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,538 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +#include "camportraitnaviconstants.rh" + + + +#define KIndicatorStatusPTSeparatorWidth 2 + +#define KPhotoResolutionIndicatorPTBRx 234 +#define KPhotoResolutionIndicatorPTBRy 196 + +#define KVideoResolutionIndicatorPTBRx 218 +#define KVideoResolutionIndicatorPTBRy 215 + +#define KIndicatorVideoModePTBRx 234 +#define KIndicatorVideoModePTBRy 217 + +#define KIndicatorAudioMutePTBRx 199 +#define KIndicatorAudioMutePTBRy 215 + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_portrait +// Location for the Zoom Pane background frame. +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_portrait + { + l = 217; + t = 21; + W = 11; + H = 118; + } + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_shaft_portrait +// Location for the Zoom Pane shaft bitmap +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_shaft_portrait + { + l = 219; + t = 23; + W = 7; + H = 114; + } + + +// --------------------------------------------------- +// +// r_cam_counter_icon_rect_portrait +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_counter_icon_rect_portrait + { + // l = 136; t = 5; W = 9; H = 11; + r = KMemoryIconRight; + //t = (KNaviPaneHeight-KMemoryIconHeight)/2; + b = KNaviBottomClearance; + W = KMemoryIconWidth; + H = KMemoryIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_counter_icon_rect_ah_portrait +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_counter_icon_rect_ah_portrait + { + l = 0; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_memory_location_portrait +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_memory_location_portrait + { + //l = 136; t = 5; W = 9; H = 11; + r = KMemoryIconRight; + //t = (KNaviPaneHeight-KMemoryIconHeight)/2; + b = KNaviBottomClearance; + W = KMemoryIconWidth; + H = KMemoryIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_memory_location_ah_portrait +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_memory_location_ah_portrait + { + r = KNaviPaneFontRightBorderPT + 37 + 8; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_memory_location_portrait +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_memory_location_portrait + { + //l = 136; t = 5; W = 9; H = 11; + r = KMemoryIconRight; + //t = (KNaviPaneHeight-KMemoryIconHeight)/2; + b = KNaviBottomClearance; + W = KMemoryIconWidth; + H = KMemoryIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_memory_location_ah_portrait +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_memory_location_ah_portrait + { + r = KNaviPaneFontRightBorderPT + 34 + 11; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_img_post_storage_icon_rect_portrait +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_post_storage_icon_rect_portrait + { + //l = 124; t = 5; W = 9; H = 11; + r = KMemoryIconRight; + //t = (KNaviPaneHeight-KMemoryIconHeight)/2; + b = KNaviBottomClearance; + W = KMemoryIconWidth; + H = KMemoryIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_img_post_storage_icon_rect_ah_portrait +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_post_storage_icon_rect_ah_portrait + { + l = 0; t = 5; W = 9; H = 11; + } + + +//---------------------------------------------------- +// +// r_cam_sidepane +// Camera Sidepane +// +//---------------------------------------------------- +// +RESOURCE CAMERA_SIDEPANE r_cam_sidepane_portrait + { + indicators = + { + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorCaptureMode; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorCaptureTypeCCTLx; + tl_y = KIndicatorCaptureTypeCCTLy; + br_x = KIndicatorCaptureTypeCCTLx + KIndicatorCaptureTypeIconWidth; + br_y = KIndicatorCaptureTypeCCTLy + KIndicatorCaptureTypeIconHeight; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_camera; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_camera_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_video; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_video_mask; } + }; + }/* + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorScene; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorUnusedx - KIndicatorSceneIconWidth; + tl_y = KIndicatorUnusedy - KIndicatorSceneIconHeight; + br_x = KIndicatorUnusedx; + br_y = KIndicatorUnusedy; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_vid_norm; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_vid_norm_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_vid_night; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_vid_night_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_auto;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_auto_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_user;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_user_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_mac;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_mac_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_port;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_port_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_land;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_land_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_night;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_night_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_nightland;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_nightland_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_nightport;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_nightport_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_candle;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_candle_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_document;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_document_mask;} + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorFlash; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorUnusedx - KIndicatorFlashIconWidth; + tl_y = KIndicatorUnusedy; + br_x = KIndicatorUnusedx; + br_y = KIndicatorUnusedy + KIndicatorFlashIconHeight; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashauto; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashauto_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashoff; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashoff_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashredeye; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashredeye_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashforce;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashforce_mask;} + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorSelfTimer; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorUnusedx - KIndicatorSelfTimerIconWidth; + tl_y = KIndicatorUnusedy; + br_x = KIndicatorUnusedx; + br_y = KIndicatorUnusedy + KIndicatorSelfTimerIconHeight; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_selftimer; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_selftimer_mask; } + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorBurstMode; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorUnusedx - KIndicatorBurstModeIconWidth; + tl_y = KIndicatorUnusedy; + br_x = KIndicatorUnusedx; + br_y = KIndicatorUnusedy + KIndicatorBurstModeIconHeight; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_menu_seq_cap; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_menu_seq_cap_mask; } + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorVideoStabiliser; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorUnusedx - KIndicatorStabilisationIconWidth; + tl_y = KIndicatorUnusedy; + br_x = KIndicatorUnusedx; + br_y = KIndicatorUnusedy + KIndicatorStabilisationIconHeight; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_stabilize_on; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_stabilize_on_mask; } + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorAudioMute; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorAudioMutePTBRx - KIndicatorAudioMuteIconPTWidth; + tl_y = KIndicatorAudioMutePTBRy - KIndicatorAudioMuteIconPTHeight; + br_x = KIndicatorAudioMutePTBRx; + br_y = KIndicatorAudioMutePTBRy; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_audio_mute; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_audio_mute_mask; } + }; + }*/ + }; + } + +//---------------------------------------------------- +// +// r_cam_video_filetype_pane_portrait +// Video file type indicator - uses side pane resource +// Allows specifying position and size for all +// video file type indicators +// +//---------------------------------------------------- +// +RESOURCE CAMERA_SIDEPANE r_cam_video_filetype_pane_portrait + { + indicators = + { + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorVideoFileType; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = 0; + tl_y = 0; + br_x = 0; + br_y = 0; + } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_mp4; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_mp4_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_3gp; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_3gp_mask; } + }; + } + }; + } + +//---------------------------------------------------- +// r_cam_sidepane_rect_cam1 +// Layout rect for sidepane/zoompane in primary camera +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_sidepane_rect_cam1_portrait + { + l = 200; t = 0; W = 0; H = 0; + } + +//---------------------------------------------------- +// r_cam_sidepane_rect_cam2 +// Layout rect for sidepane/zoompane in secondary camera +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_sidepane_rect_cam2_portrait + { + l = 200; t = 0; W = 0; H = 0; + } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_still +// The size and position of the viewfinder in still capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_still_portrait + { l = 1; t = 0; W = 240; H = 180; } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_cif +// The size and position of the viewfinder in large video resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_cif_portrait + { l = 12; t = 11; W = 238; H = 180; } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_qcif +// The size and position of the viewfinder in medium video resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_qcif_portrait + { l = 32; t = 32; W = 176; H = 144; } + + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_sqcif +// The size and position of the viewfinder in small video resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_sqcif_portrait + { l = 56 ; t = 46; W = 128; H = 96; } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_secondary +// The size and position of the viewfinder in large video resolution +// for secondary camera +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_secondary_portrait + { l = 1; t = 0; W = 238; H = 180; } + + +//---------------------------------------------------- +// +// r_cam_zoom_pane_width +// Width of the zoom pane (not just the zoom shaft) +// +//---------------------------------------------------- +// +RESOURCE INT16 r_cam_zoom_pane_width_portrait + { + value = 19; + } + +//----------------------------------------------------------------------------- +// +// r_cam_img_precap_quality_icons_portrait +// The size and position of the image resolution icon +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_quality_icons_portrait + { + //l = 220; t = 180; W = 14; H = 16; + l = 206; t = 185; W = 29; H = 12; + } + +//----------------------------------------------------------------------------- +// +// r_cam_video_precap_quality_icons_portrait +// The size and position of the video resolution icon +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_quality_icons_portrait + { + //l = 205; t = 204; W = 13; H = 11; + l = 206; t = 193; W = 13; H = 11; + } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_limit_quality_icons_portrait +// The size and position of the video resolution icon during capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_quality_icons_portrait + { l = 206; t = 193; W = 13; H = 11; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_unlimit_quality_icons_portrait +// The size and position of the video resolution icon during capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_quality_icons_portrait + { l = 206; t = 193; W = 13; H = 11; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_limit_file_type_portrait +// The size and position of the video filetype icon during capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_file_type_portrait + { l = 224; t = 193; W = 10; H = 11; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_unlimit_file_type_portrait +// The size and position of the video filetype icon during capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_file_type_portrait + { l = 224; t = 193; W = 10; H = 11; } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamCaptureViewMode.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamCaptureViewMode.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,519 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +#define KIndicatorStatusVMSeparatorWidth 2 + +#define KResolutionIndicatorStillVMBRx 315 +#define KResolutionIndicatorStillVMBRy 187 + +#define KResolutionIndicatorVideoVMBRx 293 +#define KResolutionIndicatorVideoVMBRy 185 + +#define KIndicatorVideoModeVMBRx 314 +#define KIndicatorVideoModeVMBRy 187 + +#define KIndicatorAudioMuteVMBRx 315 +#define KIndicatorAudioMuteVMBRy 165 + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_viewmode +// Location for the Zoom Pane background frame. +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_viewmode + { + l = 297; + t = 22; + W = 11; + H = 134; + } + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_shaft_viewmode +// Location for the Zoom Pane shaft bitmap +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_shaft_viewmode + { + l = 299; + t = 35; + W = 7; + H = 114; + } + +//---------------------------------------------------- +// +// r_cam_layout_zoom_pane_thumb_viewmode +// Location for the Zoom Pane thumb +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_layout_zoom_pane_thumb_viewmode + { + l = 294; + t = 00; + W = 17; + H = 11; + } + +// --------------------------------------------------- +// +// r_cam_counter_icon_rect_viewmode +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_counter_icon_rect_viewmode + { + l = 173; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_counter_icon_rect_ah_viewmode +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_counter_icon_rect_ah_viewmode + { + l = 85; t = 5; W = 9; H = 11; + } +// --------------------------------------------------- +// +// r_cam_vid_pre_storage_icon_rect_viewmode +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_vid_pre_storage_icon_rect_viewmode + { + l = 173; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_vid_pre_storage_icon_rect_ah_viewmode +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_vid_pre_storage_icon_rect_ah_viewmode + { + l = 130; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_memory_location_viewmode +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_memory_location_viewmode + { + l = 173; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_img_pre_storage_icon_rect_ah_viewmode +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_pre_storage_icon_rect_ah_viewmode + { + l = 130; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_img_post_storage_icon_rect_viewmode +// Layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_post_storage_icon_rect_viewmode + { + l = 173; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_img_post_storage_icon_rect_ah_viewmode +// Arabic/Hebrew layout rect for icon in photo navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_post_storage_icon_rect_ah_viewmode + { + l = 130; t = 5; W = 9; H = 11; + } + + +//---------------------------------------------------- +// +// r_cam_sidepane_viewmode +// Camera Sidepane +// +//---------------------------------------------------- +// +RESOURCE CAMERA_SIDEPANE r_cam_sidepane_viewmode + { /* + indicators = + { + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorScene; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorUnusedx - KIndicatorSceneIconWidth; + tl_y = KIndicatorUnusedy - KIndicatorSceneIconHeight; + br_x = KIndicatorUnusedx; + br_y = KIndicatorUnusedy; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_vid_norm; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_vid_norm_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_vid_night; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_vid_night_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_auto;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_auto_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_user;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_user_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_mac;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_mac_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_port;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_port_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_land;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_land_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_night;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_night_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_sport_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_nightland;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_nightland_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_nightport;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_nightport_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_candle;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_candle_mask;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_document;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_pho_document_mask;} + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorFlash; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorUnusedx - KIndicatorFlashIconWidth; + tl_y = KIndicatorUnusedy; + br_x = KIndicatorUnusedx; + br_y = KIndicatorUnusedy + KIndicatorFlashIconHeight; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashauto; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashauto_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashoff; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashoff_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashredeye; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashredeye_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashforce;}, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_flashforce_mask;} + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorSelfTimer; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorUnusedx - KIndicatorSelfTimerIconWidth; + tl_y = KIndicatorUnusedy; + br_x = KIndicatorUnusedx; + br_y = KIndicatorUnusedy + KIndicatorSelfTimerIconHeight; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_selftimer; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_lcam_selftimer_mask; } + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorBurstMode; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorUnusedx - KIndicatorBurstModeIconWidth; + tl_y = KIndicatorUnusedy; + br_x = KIndicatorUnusedx; + br_y = KIndicatorUnusedy + KIndicatorBurstModeIconHeight; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_burst; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_cam4_sequence_burst_mask; } + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorVideoStabiliser; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = KIndicatorUnusedx - KIndicatorStabilisationIconWidth; + tl_y = KIndicatorUnusedy; + br_x = KIndicatorUnusedx; + br_y = KIndicatorUnusedy + KIndicatorStabilisationIconHeight; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_stabilize_on; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_stabilize_on_mask; } + }; + }, + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorAudioMute; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = 0; + tl_y = 0; + br_x = 0; + br_y = 0; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_audio_mute; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_indi_vid4_audio_mute_mask; } + }; + } + };*/ + } + +//---------------------------------------------------- +// +// r_cam_video_filetype_pane_viewmode +// Video file type indicator - uses side pane resource +// Allows specifying position and size for all +// video file type indicators +// +//---------------------------------------------------- +// +RESOURCE CAMERA_SIDEPANE r_cam_video_filetype_pane_viewmode + { + indicators = + { + CAMERA_INDICATOR + { + indicator_id = ECamIndicatorVideoFileType; + coords = + { + CAMERA_INDICATOR_COORDS + { tl_x = 0; + tl_y = 0; + br_x = 0; + br_y = 0; } + }; + bitmaps = + { + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_mp4; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_mp4_mask; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_3gp; }, + CAMERA_BITMAP { bitmap_id = EMbmCameraappQgn_prop_cam4_codec_3gp_mask; } + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_sidepane_rect_cam1_viewmode +// Layout rect for sidepane/zoompane in primary camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_sidepane_rect_cam1_viewmode + { + l = 220; t = 0; W = 0; H = 0; + } + +//---------------------------------------------------- +// +// r_cam_sidepane_rect_cam2_viewmode +// Layout rect for sidepane/zoompane in secondary camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_sidepane_rect_cam2_viewmode + { + l = 220; t = 0; W = 0; H = 0; + } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_still_viewmode +// The size and position of the viewfinder in still capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_still_viewmode + { l = 40; t = 6; W = 240; H = 180; } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_cif_viewmode +// The size and position of the viewfinder in large video resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_cif_viewmode + { l = 40; t = 6; W = 240; H = 180; } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_qcif_viewmode +// The size and position of the viewfinder in medium video resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_qcif_viewmode + { l = 72; t = 24; W = 176; H = 144; } + + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_sqcif_viewmode +// The size and position of the viewfinder in small video resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_sqcif_viewmode + { l = 96; t = 48; W = 128; H = 96; } + +//----------------------------------------------------------------------------- +// +// r_cam_viewfinder_rect_secondary_viewmode +// The size and position of the viewfinder in large video resolution +// for secondary camera +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_viewfinder_rect_secondary_viewmode + { l = 14; t = 14; W = 232; H = 164; } + + +//---------------------------------------------------- +// +// r_cam_zoom_pane_width_viewmode +// Width of the zoom pane (not just the zoom shaft) +// +//---------------------------------------------------- +// +RESOURCE INT16 r_cam_zoom_pane_width_viewmode + { + value = 19; + } + +//----------------------------------------------------------------------------- +// +// r_cam_img_precap_quality_icons_viewmode +// The size and position of the image resolution icon +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_quality_icons_viewmode + { l = 296; t = 171; W = 19; H = 16; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_precap_quality_icons_viewmode +// The size and position of the video resolution icon +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_precap_quality_icons_viewmode + { l = 280; t = 174; W = 13; H = 11; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_limit_quality_icons_viewmode +// The size and position of the video resolution icon during capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_quality_icons_viewmode + { l = 152; t = 225; W = 13; H = 11; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_unlimit_quality_icons_viewmode +// The size and position of the video resolution icon during capture +// when the progress bar is not visible.o +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_quality_icons_viewmode + { l = 152; t = 225; W = 13; H = 11; } + +//----------------------------------------------------------------------------- +// +// r_cam_vidfiletype_icon_rect_viewmode +// The size and position of the video filetype icon +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_vidfiletype_icon_rect_viewmode + { l = 303; t = 171; W = 11; H = 16; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_limit_file_type_viewmode +// The size and position of the video filetype icon during capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_file_type_viewmode + { l = 169; t = 222; W = 11; H = 16; } + +//----------------------------------------------------------------------------- +// +// r_cam_video_cap_unlimit_file_type_viewmode +// The size and position of the video filetype icon during capture +// when the progress bar is not visible. +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_file_type_viewmode + { l = 169; t = 222; W = 11; H = 16; } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamEmbedded.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamEmbedded.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +//---------------------------------------------------- +// +// r_cam_photo_embedded_static_settings_data +// Default values for the photo embedded static setting items +// +//---------------------------------------------------- +// +RESOURCE CAM_SETTING_ITEMS_DATA r_cam_photo_embedded_static_settings_data + { + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemPhotoSize; + default = ECamPhotoSizeVGA; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemPhotoShowFocusPoint; + default = ECamSettOn; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemShowCapturedPhoto; + default = ECamSettOn; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_embedded_static_settings_data +// Default values for the video embedded static setting items +// +//---------------------------------------------------- +// +RESOURCE CAM_SETTING_ITEMS_DATA r_cam_video_embedded_static_settings_data + { + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemVideoResolution; + default = ECamVideoResolutionQCIF; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemVideoClipLength; + default = ECamVideoClipShort; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemVideoFileType; + default = ECamVideoH263; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemVideoShowCapturedVideo; + default = ECamSettOn; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamEmbeddedCamcorder.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamEmbeddedCamcorder.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// --------------------------------------------------------- +// +// r_cam_still_embedded_pre_capture_menubar +// Menubar for embedded still pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_embedded_pre_capture_menubar_camcorder + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_embedded_pre_capture_menu_camcorder; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_embedded_pre_capture_menu +// Options menu for still pre capture view in embedded mode +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_embedded_pre_capture_menu_camcorder + { + items = + { + MENU_ITEM + { + command = ECamCmdSwitchCamera; + txt = qtn_lcam_options_cam2; + }, + MENU_ITEM + { + command = ECamCmdNewVideo; + txt = qtn_lcam_options_video_mode; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_lcam_options_back; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_embedded_pre_capture_menubar +// Menubar for embedded video pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_embedded_pre_capture_menubar_camcorder + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_embedded_pre_capture_menu_camcorder; + } + }; + } + + + +// --------------------------------------------------------- +// +// r_cam_video_embedded_pre_capture_menu +// Options menu for video pre capture view in embedded mode +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_embedded_pre_capture_menu_camcorder + { + items = + { + MENU_ITEM + { + command = ECamCmdSwitchCamera; + txt = qtn_lcam_options_cam2; + }, + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_photo_mode; + }, + MENU_ITEM + { + command = ECamCmdMute; + txt = qtn_lcam_options_mute; + }, + MENU_ITEM + { + command = ECamCmdUnmute; + txt = qtn_lcam_options_unmute; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_lcam_options_back; + } + }; + } + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamEmbeddedPortrait.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamEmbeddedPortrait.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// --------------------------------------------------------- +// +// r_cam_still_embedded_pre_capture_menubar_portrait +// Menubar for embedded still pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_embedded_pre_capture_menubar_portrait + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_embedded_pre_capture_menu_portrait; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_embedded_pre_capture_menu_portrait +// Options menu for still pre capture view in embedded mode +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_embedded_pre_capture_menu_portrait + { + items = + { + MENU_ITEM + { + command = ECamCmdSwitchCamera; + txt = qtn_lcam_options_cam2; + }, + MENU_ITEM + { + command = ECamCmdNewVideo; + txt = qtn_lcam_options_video_mode; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_lcam_options_back; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_embedded_pre_capture_menubar_portrait +// Menubar for embedded video pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_embedded_pre_capture_menubar_portrait + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_embedded_pre_capture_menu_portrait; + } + }; + } + + + +// --------------------------------------------------------- +// +// r_cam_video_embedded_pre_capture_menu_portrait +// Options menu for video pre capture view in embedded mode +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_embedded_pre_capture_menu_portrait + { + items = + { + MENU_ITEM + { + command = ECamCmdSwitchCamera; + txt = qtn_lcam_options_cam1; + }, + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_photo_mode; + }, + MENU_ITEM + { + command = ECamCmdMute; + txt = qtn_lcam_options_mute; + }, + MENU_ITEM + { + command = ECamCmdUnmute; + txt = qtn_lcam_options_unmute; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_lcam_options_back; + } + }; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamEmbeddedViewMode.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamEmbeddedViewMode.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// --------------------------------------------------------- +// +// r_cam_still_embedded_pre_capture_menubar_viewmode +// Menubar for embedded still pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_embedded_pre_capture_menubar_viewmode + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_embedded_pre_capture_menu_viewmode; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_embedded_pre_capture_menu_viewmode +// Options menu for still pre capture view in embedded mode +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_embedded_pre_capture_menu_viewmode + { + items = + { + MENU_ITEM + { + command = ECamCmdNewVideo; + txt = qtn_lcam_options_video_mode; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_lcam_options_back; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_embedded_pre_capture_menubar_viewmode +// Menubar for embedded video pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_embedded_pre_capture_menubar_viewmode + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_embedded_pre_capture_menu_viewmode; + } + }; + } + + + +// --------------------------------------------------------- +// +// r_cam_video_embedded_pre_capture_menu_viewmode +// Options menu for video pre capture view in embedded mode +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_embedded_pre_capture_menu_viewmode + { + items = + { + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_photo_mode; + }, + MENU_ITEM + { + command = ECamCmdMute; + txt = qtn_lcam_options_mute; + }, + MENU_ITEM + { + command = ECamCmdUnmute; + txt = qtn_lcam_options_unmute; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_lcam_options_back; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamHistogram.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamHistogram.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +// Constants +#define KCamHistogramLeftX 10 +#define KCamHistogramTopY 50 +#define KCamHistogramWidth 100 + +#define KCamHistogramGraphHeight 64 +#define KCamHistogramStepperHeight 20 + +#define KCamHistogramStepperNaviWidth 20 +#define KCamHistogramStepperValueWidth 30 +#define KCamHistogramStepperTextBottom 16 + +#define KCamHistogramTextColor 0 + + + +// Text for histogram setting title +RESOURCE TBUF r_cam_histogram_setting_title + { + buf = qtn_lcam_histogram_ev_exp; + } + + +// +// Layout rectangle for histogram graph +// +RESOURCE AVKON_LAYOUT_RECT r_cam_histogram_graph_box_layout + { + t = KCamHistogramTopY; + l = KCamHistogramLeftX; + H = KCamHistogramGraphHeight; + W = KCamHistogramWidth; + } + +// +// Layout rectangle for histogram stepper +// +RESOURCE AVKON_LAYOUT_RECT r_cam_histogram_stepper_box_layout + { + t = KCamHistogramTopY + KCamHistogramGraphHeight + 5; // TEST "5" + l = KCamHistogramLeftX; + H = KCamHistogramStepperHeight; + W = KCamHistogramWidth; + } + +// +// Layout for histogram stepper setting title +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_histogram_setting_title_text_layout + { + font = EAknLogicalFontSecondaryFont; + C = KCamHistogramTextColor; + l = 0; + r = 2*KCamHistogramStepperNaviWidth + KCamHistogramStepperValueWidth; + B = KCamHistogramStepperTextBottom; + J = ELayoutAlignLeft; + } + +// +// Layout for histogram stepper setting value +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_histogram_setting_value_text_layout + { + font = EAknLogicalFontSecondaryFont; + C = KCamHistogramTextColor; + l = KCamHistogramWidth - (KCamHistogramStepperNaviWidth + KCamHistogramStepperValueWidth); + r = KCamHistogramStepperNaviWidth; + B = KCamHistogramStepperTextBottom; + W = KCamHistogramStepperValueWidth; + J = ELayoutAlignCenter; + } + +// +// Layout for histogram stepper left navi indicator +// +RESOURCE AVKON_LAYOUT_RECT r_cam_histogram_left_navi_box_layout + { + t = 0; + l = KCamHistogramWidth - (2*KCamHistogramStepperNaviWidth + KCamHistogramStepperValueWidth); + W = KCamHistogramStepperNaviWidth; + H = KCamHistogramStepperHeight; + } + +// +// Layout for histogram stepper right navi indicator +// +RESOURCE AVKON_LAYOUT_RECT r_cam_histogram_right_navi_box_layout + { + t = 0; + l = KCamHistogramWidth - KCamHistogramStepperNaviWidth; + W = KCamHistogramStepperNaviWidth; + H = KCamHistogramStepperHeight; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamModeSelect.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamModeSelect.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,555 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +RESOURCE ARRAY r_cam_capture_setup_list_video_shooting_mode + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_auto; + setting_value_id = ECamSceneNormal; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_lowlight; + setting_value_id = ECamSceneLowLight; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_tungsten; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_night; + setting_value_id = ECamSceneNight; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_night; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_night_s; + } + }; + } + +RESOURCE ARRAY r_cam_capture_setup_list_video_shooting_mode_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNormal; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_auto; + summary_title_text = qtn_lcam_scene_auto; + summary_description_text = qtn_lcam_scene_vid_auto_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_auto_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneLowLight; + summary_icon = EMbmCameraappQgn_indi_cam4_wb_tungsten; + summary_title_text = qtn_lcam_scene_lowlight; + summary_description_text = qtn_lcam_scene_vid_lowlight_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_auto_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNight; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_night; + summary_title_text = qtn_lcam_scene_night; + summary_description_text = qtn_lcam_scene_vid_night_ex; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_night_l; + } + }; + } + +// The following layouts are used with shooting mode selection and InfoListBox +RESOURCE CAM_MODE_SELECT_SUMMARY_LAYOUT r_cam_capture_setup_list_summary_layout + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + l = 178; + t = 36 - 30; + W = 141; + H = 187; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + l = 181; + t = 38 - 30; + W = 137; + H = 183; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + l = 185; + t = 47 - 30; + W = 30; + H = 30; + } + }; + summary_title = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 220; + r = 3; + B = 61 - 30; + W = 89; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 220; + r = 3; + B = 75 - 30; + W = 89; + J = ELayoutAlignLeft; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 94 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 109 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 124 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 139 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 154 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 169 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 184 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 199 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 214 - 30; + W = 125; + J = ELayoutAlignLeft; + } + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_list_listbox_layout + { + l = 10; + t = 8; + W = 166; + H = 182; + } + +RESOURCE CAM_MODE_SELECT_SUMMARY_LAYOUT r_cam_capture_setup_list_summary_layout_apac + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + l = 178; + t = 36 - 30; + W = 141; + H = 187; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + l = 181; + t = 38 - 30; + W = 137; + H = 183; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + l = 190; + t = 47 - 30; + W = 30; + H = 30; + } + }; + summary_title = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 228; + r = 3; + B = 63 - 30; + W = 89; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 228; + r = 3; + B = 77 - 30; + W = 89; + J = ELayoutAlignLeft; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 96 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 111 - 30; + W = 121; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 126 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 141 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 156 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 171 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 186 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 201 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 216 - 30; + W = 125; + J = ELayoutAlignLeft; + } + + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_list_listbox_layout_apac + { + l = 10; + t = 6; + W = 166; + H = 182; + } + +RESOURCE CAM_MODE_SELECT_SUMMARY_LAYOUT r_cam_capture_setup_list_summary_layout_ah + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + r = 178; + t = 36 - 30; + W = 141; + H = 187; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + r = 181; + t = 38 - 30; + W = 137; + H = 183; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + r = 190; + t = 47 - 30; + W = 30; + H = 30; + } + }; + summary_title = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 228; + l = 3; + B = 61 - 30; + W = 89; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 228; + l = 3; + B = 75 - 30; + W = 89; + J = ELayoutAlignRight; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 94 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 109 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 124 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 139 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 154 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 169 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 184 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 199 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 214 - 30; + W = 125; + J = ELayoutAlignRight; + } + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_list_listbox_layout_ah + { + r = 10; + t = 8; + W = 166; + H = 182; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamModeSelectV2.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamModeSelectV2.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,555 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +RESOURCE ARRAY r_cam_capture_setup_list_video_shooting_mode + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_auto_v2; + setting_value_id = ECamSceneNormal; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_lowlight_v2; + setting_value_id = ECamSceneLowLight; + bitmap_id = EMbmCameraappQgn_indi_cam4_wb_tungsten; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_night_v2; + setting_value_id = ECamSceneNight; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_night; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_night_s; + } + }; + } + +RESOURCE ARRAY r_cam_capture_setup_list_video_shooting_mode_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNormal; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_auto; + summary_title_text = qtn_lcam_scene_auto_v2; + summary_description_text = qtn_lcam_scene_vid_auto_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_auto_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneLowLight; + summary_icon = EMbmCameraappQgn_indi_cam4_wb_tungsten; + summary_title_text = qtn_lcam_scene_lowlight_v2; + summary_description_text = qtn_lcam_scene_vid_lowlight_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_auto_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNight; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_night; + summary_title_text = qtn_lcam_scene_night_v2; + summary_description_text = qtn_lcam_scene_vid_night_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_night_l; + } + }; + } + +// The following layouts are used with shooting mode selection and InfoListBox +RESOURCE CAM_MODE_SELECT_SUMMARY_LAYOUT r_cam_capture_setup_list_summary_layout + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + l = 178; + t = 36 - 30; + W = 141; + H = 187; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + l = 181; + t = 38 - 30; + W = 137; + H = 183; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + l = 185; + t = 47 - 30; + W = 30; + H = 30; + } + }; + summary_title = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 220; + r = 3; + B = 61 - 30; + W = 89; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 220; + r = 3; + B = 75 - 30; + W = 89; + J = ELayoutAlignLeft; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 94 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 109 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 124 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 139 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 154 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 169 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 184 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 199 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 214 - 30; + W = 125; + J = ELayoutAlignLeft; + } + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_list_listbox_layout + { + l = 10; + t = 8; + W = 166; + H = 182; + } + +RESOURCE CAM_MODE_SELECT_SUMMARY_LAYOUT r_cam_capture_setup_list_summary_layout_apac + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + l = 178; + t = 36 - 30; + W = 141; + H = 187; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + l = 181; + t = 38 - 30; + W = 137; + H = 183; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + l = 190; + t = 47 - 30; + W = 30; + H = 30; + } + }; + summary_title = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 228; + r = 3; + B = 63 - 30; + W = 89; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 228; + r = 3; + B = 77 - 30; + W = 89; + J = ELayoutAlignLeft; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 96 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 111 - 30; + W = 121; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 126 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 141 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 156 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 171 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 186 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 201 - 30; + W = 125; + J = ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + l = 192; + r = 3; + B = 216 - 30; + W = 125; + J = ELayoutAlignLeft; + } + + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_list_listbox_layout_apac + { + l = 10; + t = 6; + W = 166; + H = 182; + } + +RESOURCE CAM_MODE_SELECT_SUMMARY_LAYOUT r_cam_capture_setup_list_summary_layout_ah + { + summary_rect = + { + AVKON_LAYOUT_RECT + { + C = 215; + r = 178; + t = 36 - 30; + W = 141; + H = 187; + } + }; + summary_inner_rect = + { + AVKON_LAYOUT_RECT + { + r = 181; + t = 38 - 30; + W = 137; + H = 183; + } + }; + summary_icon = + { + AVKON_LAYOUT_RECT + { + r = 190; + t = 47 - 30; + W = 30; + H = 30; + } + }; + summary_title = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 228; + l = 3; + B = 61 - 30; + W = 89; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 228; + l = 3; + B = 75 - 30; + W = 89; + J = ELayoutAlignRight; + } + }; + summary_description = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 94 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 109 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 124 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 139 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 154 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 169 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 184 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 199 - 30; + W = 125; + J = ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; + C = 213; + r = 192; + l = 3; + B = 214 - 30; + W = 125; + J = ELayoutAlignRight; + } + }; + } + +RESOURCE AVKON_LAYOUT_RECT r_cam_capture_setup_list_listbox_layout_ah + { + r = 10; + t = 8; + W = 166; + H = 182; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamProductSpecificSettings.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamProductSpecificSettings.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,20 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamSceneSetup.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamSceneSetup.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1761 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + + +//---------------------------------------------------- +// +// r_cam_photo_scene_night +// Data for the photo scene night settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_night + { + scene_item_id = ECamSceneNight; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeNight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_macro +// Data for the photo scene macro settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_macro + { + scene_item_id = ECamSceneMacro; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeMacro; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_auto +// Data for the photo scene macro settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_auto + { + scene_item_id = ECamSceneAuto; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_scenery +// Data for the photo scene scenery settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_scenery + { + scene_item_id = ECamSceneScenery; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceDaylight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeInfinity; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessHard; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_sports +// Data for the photo scene sports settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_sports + { + scene_item_id = ECamSceneSports; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeSports; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeHyperfocal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_portrait +// Data for the photo scene portrait settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_portrait + { + scene_item_id = ECamScenePortrait; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeBacklight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashAntiRedEye; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessSoft; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_night_landscape +// Data for the photo scene night landscape settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_night_landscape + { + scene_item_id = ECamSceneNightScenery; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_night_portrait +// Data for the photo scene night portrait settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_night_portrait + { + scene_item_id = ECamSceneNightPortrait; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeNight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashAntiRedEye; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_night_candlelight +// Data for the photo scene candlelight settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_candlelight + { + scene_item_id = ECamSceneCandlelight; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeBacklight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceDaylight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +// Scenes data for settings model. +//---------------------------------------------------- +// +// r_cam_photo_scenes_data +// Data for all the photo scene setting items (except user) +// +//---------------------------------------------------- +// +RESOURCE CAM_SETTING_ITEMS_DATA r_cam_photo_scenes_data + { + settings_items = + { + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_macro; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_auto; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_scenery; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_sports; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_portrait; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_night; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_night_landscape; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_night_portrait; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_candlelight; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_description_candlelight +// Description of Candlelight scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_candlelight + { + buf = qtn_lcam_scene_candle_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_list_photo +// Lists all scenes used to populate the photo scene list +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_list_photo + { + items = + { + INT16 + { + value = ECamSceneAuto; + }, + INT16 + { + value = ECamSceneUser; + }, + INT16 + { + value = ECamScenePortrait; + }, + INT16 + { + value = ECamSceneScenery; + }, + INT16 + { + value = ECamSceneSports; + }, + INT16 + { + value = ECamSceneNightScenery; + }, + INT16 + { + value = ECamSceneNightPortrait; + }, + INT16 + { + value = ECamSceneCandlelight; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_list_photo_cam2 +// Lists all scenes used to populate the photo +// scene list for the secondary camera +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_list_photo_cam2 + { + items = + { + INT16 + { + value = ECamSceneAuto; + }, + INT16 + { + value = ECamSceneNight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_list_user +// Lists all scenes used to populate the user scene list +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_list_user + { + items = + { + INT16 + { + value = ECamSceneAuto; + }, + INT16 + { + value = ECamScenePortrait; + }, + INT16 + { + value = ECamSceneScenery; + }, + INT16 + { + value = ECamSceneNight; + }, + INT16 + { + value = ECamSceneSports; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_list_video +// Lists all scenes used to populate the video scene list +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_list_video + { + items = + { + INT16 + { + value = ECamSceneNormal; + }, + INT16 + { + value = ECamSceneNight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_list_video_cam2 +// Lists all scenes used to populate the video +// scene list for the secondary camera +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_list_video_cam2 + { + items = + { + INT16 + { + value = ECamSceneAuto; + }, + INT16 + { + value = ECamSceneNight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_max_items_to_display +// Value for the maximum number of items displayed +// +// --------------------------------------------------- +// + +RESOURCE INT16 r_cam_scene_max_items_to_display + { + value = 4; + } + +// --------------------------------------------------------- +// +// r_cam_scene_setting_menubar +// Menubar for scene settings view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_scene_setting_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_scene_setting_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_scene_setting_menu +// Options menu for scene settings view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_scene_setting_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdSelect; + txt = qtn_lcam_options_select; + flags = EEikMenuItemAction; + }, + MENU_ITEM + { + command = ECamCmdEdit; + txt = qtn_lcam_options_edit_userdef; + flags = EEikMenuItemSpecific; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + + +// --------------------------------------------------------- +// +// r_cam_scene_setting_ok_menubar +// Ok menubar for scene setting list +// (only opens when user scene is highlighted) +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_scene_setting_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_scene_setting_ok_menu; + } + }; + } + + +// --------------------------------------------------------- +// +// r_cam_scene_setting_ok_menu +// Context specific options menu for scene setting list +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_scene_setting_ok_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdSelect; + txt = qtn_lcam_options_select; + flags = EEikMenuItemAction; + }, + MENU_ITEM + { + command = ECamCmdEdit; + txt = qtn_lcam_options_edit_userdef; + flags = EEikMenuItemAction; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_imagesharpness_data +// The data for the image sharpness item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_imagesharpness_data + { + id = ECamSettingItemUserSceneImageSharpness; + text = qtn_lcam_set_user_sharp; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamImageSharpnessHard; + text = qtn_lcam_set_hard; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamImageSharpnessNorm; + text = qtn_lcam_set_normal; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamImageSharpnessSoft; + text = qtn_lcam_set_soft; + } + + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_coloursaturation_data +// The data for the image sharpness item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_coloursaturation_data + { + id = ECamSettingItemUserSceneColourSaturation; + text = qtn_lcam_popm_colsat; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourSaturationNorm; + text = qtn_lcam_set_normal; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourSaturationPlus; + text = qtn_lcam_set_increased; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourSaturationNeg; + text = qtn_lcam_set_decreased; + } + + }; + } +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_whitebalance_data +// The data for the white balance item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_whitebalance_data + { + id = ECamSettingItemUserSceneWhitebalance; + text = qtn_lcam_set_user_wb; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamWhiteBalanceAWB; + text = qtn_lcam_set_awb; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamWhiteBalanceDaylight; + text = qtn_lcam_set_day; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamWhiteBalanceCloudy; + text = qtn_lcam_set_cloud; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamWhiteBalanceTungsten; + text = qtn_lcam_set_tung; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamWhiteBalanceFlourescent; + text = qtn_lcam_set_flu; + } + + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_coloureffect_data +// The data for the colour effect item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_coloureffect_data + { + id = ECamSettingItemUserSceneColourFilter; + text = qtn_lcam_set_user_ce; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourFilterColour; + text = qtn_lcam_set_col; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourFilterBlackAndWhite; + text = qtn_lcam_set_bw; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourFilterSepia; + text = qtn_lcam_set_sep; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourFilterNegative; + text = qtn_lcam_set_neg; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourFilterVivid; + text = qtn_lcam_set_viv; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_reset_data +// The data for the reset data item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_reset_data + { + id = ECamSettingItemUserSceneReset; + text = qtn_lcam_set_user_reset; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_flash_data +// The data for the flash item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_flash_data + { + id = ECamSettingItemUserSceneFlash; + text = qtn_lcam_set_user_flash; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamFlashAuto; + text = qtn_lcam_set_auto; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamFlashForced; + text = qtn_lcam_set_force; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamFlashAntiRedEye; + text = qtn_lcam_set_redeye; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamFlashOff; + text = qtn_lcam_set_flash_off; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_brightness_data +// The data for the brightness item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_brightness_data + { + id = ECamSettingItemUserSceneBrightness; + text = qtn_lcam_set_user_bright; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamBrightnessNorm; + text = qtn_lcam_set_normal; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamBrightnessPlus; + text = qtn_lcam_set_increased; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamBrightnessNeg; + text = qtn_lcam_set_decreased; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_ev_data +// The data for the EV item in the photo user +// scene setup list (for range -2 to +2 in steps of 1/3) +// +//---------------------------------------------------- +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_ev_data + { + id = ECamSettingItemUserSceneExposure; + text = qtn_lcam_set_user_ev; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 6; + text = qtn_lcam_ev_plus2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 5; + text = qtn_lcam_ev_plus1_7; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 4; + text = qtn_lcam_ev_plus1_3; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 3; + text = qtn_lcam_ev_plus1; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 2; + text = qtn_lcam_ev_plus0_7; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 1; + text = qtn_lcam_ev_plus0_3; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 0; + text = qtn_lcam_ev_0; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -1; + text = qtn_lcam_ev_minus0_3; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -2; + text = qtn_lcam_ev_minus0_7; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -3; + text = qtn_lcam_ev_minus1; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -4; + text = qtn_lcam_ev_minus1_3; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -5; + text = qtn_lcam_ev_minus1_3; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -6; + text = qtn_lcam_ev_minus2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_ev_data2 +// The data for the EV item in the photo user +// scene setup list (for range -2 to +2 in steps of 1/2) +// +//---------------------------------------------------- +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_ev_data2 + { + id = ECamSettingItemUserSceneExposure; + text = qtn_lcam_set_user_ev; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureTwo; + text = qtn_lcam_ev_plus2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureOnePointFive; + text = qtn_lcam_ev_plus1_5; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureOne; + text = qtn_lcam_ev_plus1; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposurePointFive; + text = qtn_lcam_ev_plus0_5; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureZero; + text = qtn_lcam_ev_0; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusPointFive; + text = qtn_lcam_ev_minus0_5; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusOne; + text = qtn_lcam_ev_minus1; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusOnePointFive; + text = qtn_lcam_ev_minus1_5; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusTwo; + text = qtn_lcam_ev_minus2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_ev_data3 +// The data for the EV item in the photo user +// scene setup list (for range -2 to +2 in steps of 1) +// +//---------------------------------------------------- +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_ev_data3 + { + id = ECamSettingItemUserSceneExposure; + text = qtn_lcam_set_user_ev; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureTwo; + text = qtn_lcam_ev_plus2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureOnePointFive; + text = qtn_lcam_ev_plus1_5; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureOne; + text = qtn_lcam_ev_plus1; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposurePointFive; + text = qtn_lcam_ev_plus0_5; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureZero; + text = qtn_lcam_ev_0; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusPointFive; + text = qtn_lcam_ev_minus0_5; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusOne; + text = qtn_lcam_ev_minus1; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusOnePointFive; + text = qtn_lcam_ev_minus1_5; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusTwo; + text = qtn_lcam_ev_minus2; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_lightsensitivity_data +// The data for the light sensitivity item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_lightsensitivity_data + { + id = ECamSettingItemUserSceneLightSensitivity; + text = qtn_lcam_set_user_iso; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityAuto; + text = qtn_lcam_set_iso_auto; // qtn_lcam_isoauto; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityLow; + text = qtn_lcam_set_iso_low; // qtn_lcam_isolow; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityMed; + text = qtn_lcam_set_iso_medium; // qtn_lcam_isomedium; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityHigh; + text = qtn_lcam_set_iso_high; // qtn_lcam_isohigh; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_extended_lightsensitivity_data +// The data for the light sensitivity item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_extended_lightsensitivity_data + { + id = ECamSettingItemUserSceneLightSensitivity; + text = qtn_lcam_set_user_iso; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityAuto; + text = qtn_lcam_set_iso_auto; // qtn_lcam_isoauto; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityLow; + text = qtn_lcam_set_iso_low; // qtn_lcam_isolow; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityLowMed; + text = qtn_lcam_set_iso_low_medium; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityMed; + text = qtn_lcam_set_iso_medium; // qtn_lcam_isomedium; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityMedHigh; + text = qtn_lcam_set_iso_medium_high; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityHigh; + text = qtn_lcam_set_iso_high; // qtn_lcam_isohigh; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_contrast_data +// The data for the contrast item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_contrast_data + { + id = ECamSettingItemUserSceneContrast; + text = qtn_lcam_set_user_contr; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamContrastNorm; + text = qtn_lcam_set_contrast_normal; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamContrastPlus; + text = qtn_lcam_set_contrast_increased; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamContrastNeg; + text = qtn_lcam_set_contrast_decreased; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_title_name +// Title name used in photo user scene setup +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_photo_user_scene_setup_title_name + { + txt = qtn_lcam_title_text_photoscene; + } + + +// --------------------------------------------------------- +// +// r_cam_setup_pane_scene_options_menubar +// Menubar for setup pane displaying scene options menu +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_setup_pane_scene_options_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_setup_pane_scene_options_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_setup_pane_scene_options_menu +// Options menu for setup pane when showing scene list +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_setup_pane_scene_options_menu + { + items = + { + MENU_ITEM + { + command = EAknSoftkeySelect; + txt = qtn_lcam_options_select; + flags = EEikMenuItemAction; + }, + MENU_ITEM + { + command = ECamCmdEdit; + txt = qtn_lcam_options_edit_userdef; + flags = EEikMenuItemAction; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + + + +//---------------------------------------------------- +// +// Confirmation query for changing the photo scene to +// "Sports" when resolution is too high. +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_sports_scene_change_confirmation_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = ECamCmdConfirmationQuerySportsSceneChange; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = qtn_lcam_conf_sport1m; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_user_scene_setup_title +// Title name used in the user scene setup +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_user_scene_setup_title + { + txt = qtn_lcam_title_text_photoscene; + } + + +//---------------------------------------------------- +// +// r_cam_user_scene_setup_view +// User scene setup view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_user_scene_setup_view + { + menubar = r_cam_user_scene_setup_menubar; + cba = R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE;//R_AVKON_SOFTKEYS_OPTIONS_BACK; + } + +//---------------------------------------------------- +// +// r_cam_user_scene_setup_menubar +// Menubar visible in photo and Video User Scene Setup views +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_user_scene_setup_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_user_scene_setup_menu; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_user_scene_setup_menu +// Menu visible in all user scene setup views +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_user_scene_setup_menu + { + items = + { + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_scene_night +// Data for the video scene night settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_video_scene_night + { + scene_item_id = ECamSceneNight; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeNight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeHyperfocal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamVideoResolutionCIF; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_scene_setting_title +// Title name used in video scene settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_video_scene_setting_title + { + txt = qtn_lcam_title_text_scenes_vid; + } + +//---------------------------------------------------- +// +// r_cam_video_scene_video +// Data for the video scene video settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_video_scene_video + { + scene_item_id = ECamSceneNormal; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeHyperfocal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamVideoResolutionCIF; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_scenes_data +// Data for all the video scene setting items (except user) +// +//---------------------------------------------------- +// +RESOURCE CAM_SETTING_ITEMS_DATA r_cam_video_scenes_data + { + settings_items = + { + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_video_scene_video; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_video_scene_night; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_reset_user_scene_note +// Reset user scene settings confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_reset_user_scene_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cam_reset_user_scene_note_text +// Reset user scene confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_reset_user_scene_note_text + { + buf = qtn_lcam_note_user_reset; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamSceneSetupCamcorder.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamSceneSetupCamcorder.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,612 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// --------------------------------------------------- +// +// r_cam_scene_highlight_description_array_camcorder +// Layout for highlighted scene descriptions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_description_array_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=58; W=232; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=112; W=232; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=166; W=232; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=220; W=232; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=274; W=232; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_description_array_ah_camcorder +// Arabic/Hebrew layout for highlighted scene descriptions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_description_array_ah_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=58; W=232; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=112; W=232; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=166; W=232; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=220; W=232; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=274; W=232; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_description_array_apac +// APAC layout for highlighted scene descriptions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_description_array_apac_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=62; W=232; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=116; W=232; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=170; W=232; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=224; W=232; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=278; W=232; J=ELayoutAlignLeft; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_highlight_layout_array +// Layout for highlight rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_layout_array_camcorder + { + items = + { + AVKON_LAYOUT_RECT + { + l = 4; t = 2; W = 312; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 56; W = 312; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 110; W = 312; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 164; W = 312; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 218; W = 312; H = 68; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_layout_array_ah_camcorder +// Arabic/Hebrew layout for highlight rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_layout_array_ah_camcorder + { + items = + { + AVKON_LAYOUT_RECT + { + r = 4; t = 2; W = 312; H = 68; + }, + AVKON_LAYOUT_RECT + { + r = 4; t = 56; W = 312; H = 68; + }, + AVKON_LAYOUT_RECT + { + r = 4; t = 110; W = 312; H = 68; + }, + AVKON_LAYOUT_RECT + { + r = 4; t = 164; W = 312; H = 68; + }, + AVKON_LAYOUT_RECT + { + r = 4; t = 218; W = 312; H = 68; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_highlight_title_array_camcorder +// Layout for highlighted scene titles in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_title_array_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=30; W=214; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=84; W=214; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=138; W=214; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=192; W=214; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=246; W=214; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_title_array_ah +// Arabic/Hebrew layout for highlighted scene titles in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_title_array_ah_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=30; W=214; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=84; W=214; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=138; W=214; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=192; W=214; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=246; W=214; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_title_array_apac +// APAC layout for highlighted scene titles in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_title_array_apac_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=26; W=214; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=80; W=214; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=134; W=214; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=188; W=214; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=242; W=214; J=ELayoutAlignLeft; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array_camcorder +// Layout for displaced icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_displaced_array_camcorder + { + items = + { + AVKON_LAYOUT_RECT { l = 26; t = 8; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 60; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 112; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 164; W = 40; H = 42; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array_ah_camcorder +// Layout for displaced icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_displaced_array_ah_camcorder + { + items = + { + AVKON_LAYOUT_RECT { r = 26; t = 8; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { r = 26; t = 60; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { r = 26; t = 112; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { r = 26; t = 164; W = 40; H = 42; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array_camcorder +// Layout for highlight icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_highlight_array_camcorder + { +items = + { + AVKON_LAYOUT_RECT { l = 16; t = 12; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 66; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 120; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 174; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 228; W = 58; H = 46; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array_ah_camcorder +// Arabic/Hebrew layout for highlight icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_highlight_array_ah_camcorder + { + items = + { + AVKON_LAYOUT_RECT { l = 342; t = 12; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 66; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 120; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 174; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 228; W = 58; H = 46; } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array_camcorder +// Layout for default icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_normal_array_camcorder + { + items = + { + AVKON_LAYOUT_RECT { l = 26; t = 80; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 132; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 184; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 236; W = 40; H = 42; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_normal_array_ah_camcorder +// Layout for default icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_normal_array_ah_camcorder + { + items = + { + AVKON_LAYOUT_RECT { r = 26; t = 80; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { r = 26; t = 132; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { r = 26; t = 184; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { r = 26; t = 236; W = 40; H = 42; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_scrollbar_position_camcorder +// Layout for scrollbar in scene settings view +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_scene_scrollbar_position_camcorder + { + l = 405; t = 0; W = 16; H = 288; + } + +// --------------------------------------------------- +// +// r_cam_scene_scrollbar_position_ah_camcorder +// Arabic/Hebrew layout for scrollbar in scene settings view +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_scene_scrollbar_position_ah_camcorder + { + r = 405; t = 0; W = 16; H = 288; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal_array +// Layout for scene titles default positions in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE ARRAY r_cam_scene_title_normal_array_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=112; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=164; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=216; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=268; W=218; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal_array_ah +// Arabic/Hebrew layout for scene titles default positions in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE ARRAY r_cam_scene_title_normal_array_ah_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=112; W=218; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=164; W=218; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=216; W=218; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=268; W=218; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal_array_apac +// APAC layout for scene titles default positions in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE ARRAY r_cam_scene_title_normal_array_apac_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=116; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=168; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=220; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=272; W=218; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_displaced_array +// Layout for scene titles displaced positions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_title_displaced_array_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=40; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=92; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=144; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=196; W=218; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_displaced_array_ah +// Arabic/Hebrew layout for scene titles displaced positions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_title_displaced_array_ah_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=40; W=218; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=92; W=218; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=144; W=218; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=196; W=218; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_displaced_array_apac +// APAC layout for scene titles displaced positions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_title_displaced_array_apac_camcorder + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=44; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=96; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=148; W=218; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=200; W=218; J=ELayoutAlignLeft; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamSceneSetupPortrait.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamSceneSetupPortrait.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,611 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// --------------------------------------------------- +// +// r_cam_scene_highlight_description_array +// Layout for highlighted scene descriptions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_description_array_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=58; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=112; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=166; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=220; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=274; W=328; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_description_array_ah +// Arabic/Hebrew layout for highlighted scene descriptions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_description_array_ah_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=58; W=328; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=112; W=328; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=166; W=328; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=220; W=328; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=274; W=328; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_description_array_apac +// APAC layout for highlighted scene descriptions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_description_array_apac_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=62; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=116; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=170; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=224; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=278; W=328; J=ELayoutAlignLeft; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_highlight_layout_array +// Layout for highlight rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_layout_array_portrait + { + items = + { + AVKON_LAYOUT_RECT + { + l = 4; t = 2; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 56; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 110; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 164; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 218; W = 398; H = 68; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_layout_array_ah +// Arabic/Hebrew layout for highlight rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_layout_array_ah_portrait + { + items = + { + AVKON_LAYOUT_RECT + { + l = 16; t = 2; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 16; t = 56; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 16; t = 110; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 16; t = 164; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 16; t = 218; W = 398; H = 68; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_highlight_title_array +// Layout for highlighted scene titles in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_title_array_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=30; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=84; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=138; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=192; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=246; W=310; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_title_array_ah +// Arabic/Hebrew layout for highlighted scene titles in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_title_array_ah_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=30; W=310; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=84; W=310; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=138; W=310; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=192; W=310; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=246; W=310; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_title_array_apac +// APAC layout for highlighted scene titles in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_title_array_apac_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=26; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=80; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=134; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=188; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=242; W=310; J=ELayoutAlignLeft; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array +// Layout for displaced icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_displaced_array_portrait + { + items = + { + AVKON_LAYOUT_RECT { l = 26; t = 8; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 60; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 112; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 164; W = 40; H = 42; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array_ah +// Layout for displaced icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_displaced_array_ah_portrait + { + items = + { + AVKON_LAYOUT_RECT { l = 350; t = 8; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 60; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 112; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 164; W = 40; H = 42; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array +// Layout for highlight icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_highlight_array_portrait + { +items = + { + AVKON_LAYOUT_RECT { l = 16; t = 12; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 66; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 120; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 174; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 228; W = 58; H = 46; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array_ah +// Arabic/Hebrew layout for highlight icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_highlight_array_ah_portrait + { + items = + { + AVKON_LAYOUT_RECT { l = 342; t = 12; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 66; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 120; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 174; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 228; W = 58; H = 46; } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array +// Layout for default icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_normal_array_portrait + { + items = + { + AVKON_LAYOUT_RECT { l = 26; t = 80; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 132; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 184; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 236; W = 40; H = 42; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_normal_array_ah +// Layout for default icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_normal_array_ah_portrait + { + items = + { + AVKON_LAYOUT_RECT { l = 350; t = 80; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 132; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 184; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 236; W = 40; H = 42; } + }; + } +// --------------------------------------------------- +// +// r_cam_scene_scrollbar_position +// Layout for scrollbar in scene settings view +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_scene_scrollbar_position_portrait + { + l = 405; t = 0; W = 16; H = 288; + } + +// --------------------------------------------------- +// +// r_cam_scene_scrollbar_position_ah +// Arabic/Hebrew layout for scrollbar in scene settings view +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_scene_scrollbar_position_ah_portrait + { + l = 0; t = 0; W = 16; H = 288; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal_array +// Layout for scene titles default positions in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE ARRAY r_cam_scene_title_normal_array_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=112; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=164; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=216; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=268; W=314; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal_array_ah +// Arabic/Hebrew layout for scene titles default positions in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE ARRAY r_cam_scene_title_normal_array_ah_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=112; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=164; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=216; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=268; W=314; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal_array_apac +// APAC layout for scene titles default positions in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE ARRAY r_cam_scene_title_normal_array_apac_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=116; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=168; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=220; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=272; W=314; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_displaced_array +// Layout for scene titles displaced positions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_title_displaced_array_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=40; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=92; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=144; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=196; W=314; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_displaced_array_ah +// Arabic/Hebrew layout for scene titles displaced positions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_title_displaced_array_ah_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=40; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=92; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=144; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=196; W=314; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_displaced_array_apac +// APAC layout for scene titles displaced positions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_title_displaced_array_apac_portrait + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=44; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=96; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=148; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=200; W=314; J=ELayoutAlignLeft; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamSceneSetupV2.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamSceneSetupV2.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1765 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + + +//---------------------------------------------------- +// +// r_cam_photo_scene_night +// Data for the photo scene night settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_night + { + scene_item_id = ECamSceneNight; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeNight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_macro +// Data for the photo scene macro settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_macro + { + scene_item_id = ECamSceneMacro; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeMacro; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_auto +// Data for the photo scene macro settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_auto + { + scene_item_id = ECamSceneAuto; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_scenery +// Data for the photo scene scenery settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_scenery + { + scene_item_id = ECamSceneScenery; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceDaylight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeInfinity; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessHard; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_sports +// Data for the photo scene sports settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_sports + { + scene_item_id = ECamSceneSports; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeSports; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeHyperfocal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_portrait +// Data for the photo scene portrait settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_portrait + { + scene_item_id = ECamScenePortrait; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeBacklight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashAntiRedEye; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessSoft; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_night_landscape +// Data for the photo scene night landscape settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_night_landscape + { + scene_item_id = ECamSceneNightScenery; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_night_portrait +// Data for the photo scene night portrait settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_night_portrait + { + scene_item_id = ECamSceneNightPortrait; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeNight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashAntiRedEye; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_scene_night_candlelight +// Data for the photo scene candlelight settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_photo_scene_candlelight + { + scene_item_id = ECamSceneCandlelight; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeBacklight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceDaylight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeNormal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamImageQualityPrint3m; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneSharpness; + default = ECamImageSharpnessNorm; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +// Scenes data for settings model. +//---------------------------------------------------- +// +// r_cam_photo_scenes_data +// Data for all the photo scene setting items (except user) +// +//---------------------------------------------------- +// +RESOURCE CAM_SETTING_ITEMS_DATA r_cam_photo_scenes_data + { + settings_items = + { + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_macro; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_auto; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_scenery; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_sports; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_portrait; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_night; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_night_landscape; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_night_portrait; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_photo_scene_candlelight; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_description_candlelight +// Description of Candlelight scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_candlelight + { + buf = qtn_lcam_scene_candle_ex; + } + +// --------------------------------------------------- +// +// r_cam_scene_list_photo +// Lists all scenes used to populate the photo scene list +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_list_photo + { + items = + { + INT16 + { + value = ECamSceneAuto; + }, + INT16 + { + value = ECamSceneUser; + }, + INT16 + { + value = ECamScenePortrait; + }, + INT16 + { + value = ECamSceneScenery; + }, + INT16 + { + value = ECamSceneSports; + }, + INT16 + { + value = ECamSceneNightScenery; + }, + INT16 + { + value = ECamSceneNightPortrait; + }, + INT16 + { + value = ECamSceneCandlelight; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_list_photo_cam2 +// Lists all scenes used to populate the photo +// scene list for the secondary camera +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_list_photo_cam2 + { + items = + { + INT16 + { + value = ECamSceneAuto; + }, + INT16 + { + value = ECamSceneNight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_list_user +// Lists all scenes used to populate the user scene list +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_list_user + { + items = + { + INT16 + { + value = ECamSceneAuto; + }, + INT16 + { + value = ECamScenePortrait; + }, + INT16 + { + value = ECamSceneScenery; + }, + INT16 + { + value = ECamSceneNight; + }, + INT16 + { + value = ECamSceneSports; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_list_video +// Lists all scenes used to populate the video scene list +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_list_video + { + items = + { + INT16 + { + value = ECamSceneNormal; + }, + INT16 + { + value = ECamSceneNight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_list_video_cam2 +// Lists all scenes used to populate the video +// scene list for the secondary camera +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_list_video_cam2 + { + items = + { + INT16 + { + value = ECamSceneAuto; + }, + INT16 + { + value = ECamSceneNight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_max_items_to_display +// Value for the maximum number of items displayed +// +// --------------------------------------------------- +// + +RESOURCE INT16 r_cam_scene_max_items_to_display + { + value = 4; + } + +// --------------------------------------------------------- +// +// r_cam_scene_setting_menubar +// Menubar for scene settings view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_scene_setting_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_scene_setting_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_scene_setting_menu +// Options menu for scene settings view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_scene_setting_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdSelect; + txt = qtn_lcam_options_select; + }, + MENU_ITEM + { + command = ECamCmdEdit; + txt = qtn_lcam_options_edit_userdef; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + + +// --------------------------------------------------------- +// +// r_cam_scene_setting_ok_menubar +// Ok menubar for scene setting list +// (only opens when user scene is highlighted) +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_scene_setting_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_scene_setting_ok_menu; + } + }; + } + + +// --------------------------------------------------------- +// +// r_cam_scene_setting_ok_menu +// Context specific options menu for scene setting list +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_scene_setting_ok_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdSelect; + txt = qtn_lcam_options_select; + }, + MENU_ITEM + { + command = ECamCmdEdit; + txt = qtn_lcam_options_edit_userdef; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_imagesharpness_data +// The data for the image sharpness item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_imagesharpness_data + { + id = ECamSettingItemUserSceneImageSharpness; + text = qtn_lcam_set_user_sharp; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamImageSharpnessHard; + text = qtn_lcam_set_hard_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamImageSharpnessNorm; + text = qtn_lcam_set_normal_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamImageSharpnessSoft; + text = qtn_lcam_set_soft_v2; + } + + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_coloursaturation_data +// The data for the image sharpness item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_coloursaturation_data + { + id = ECamSettingItemUserSceneColourSaturation; + text = qtn_lcam_popm_colsat; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourSaturationNorm; + text = qtn_lcam_set_normal_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourSaturationPlus; + text = qtn_lcam_set_increased_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourSaturationNeg; + text = qtn_lcam_set_decreased_v2; + } + + }; + } +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_whitebalance_data +// The data for the white balance item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_whitebalance_data + { + id = ECamSettingItemUserSceneWhitebalance; + text = qtn_lcam_set_user_wb; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamWhiteBalanceAWB; + text = qtn_lcam_set_awb_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamWhiteBalanceDaylight; + text = qtn_lcam_set_day_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamWhiteBalanceCloudy; + text = qtn_lcam_set_cloud_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamWhiteBalanceTungsten; + text = qtn_lcam_set_tung_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamWhiteBalanceFlourescent; + text = qtn_lcam_set_flu_v2; + } + + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_coloureffect_data +// The data for the colour effect item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_coloureffect_data + { + id = ECamSettingItemUserSceneColourFilter; + text = qtn_lcam_set_user_ce; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourFilterColour; + text = qtn_lcam_set_col_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourFilterBlackAndWhite; + text = qtn_lcam_set_bw_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourFilterSepia; + text = qtn_lcam_set_sep_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourFilterNegative; + text = qtn_lcam_set_neg_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamColourFilterVivid; + text = qtn_lcam_set_viv_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_reset_data +// The data for the reset data item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_reset_data + { + id = ECamSettingItemUserSceneReset; + text = qtn_lcam_set_user_reset; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_flash_data +// The data for the flash item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_flash_data + { + id = ECamSettingItemUserSceneFlash; + text = qtn_lcam_set_user_flash; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamFlashAuto; + text = qtn_lcam_set_auto_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamFlashForced; + text = qtn_lcam_set_force_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamFlashAntiRedEye; + text = qtn_lcam_set_redeye_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamFlashOff; + text = qtn_lcam_set_flash_off_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_brightness_data +// The data for the brightness item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_brightness_data + { + id = ECamSettingItemUserSceneBrightness; + text = qtn_lcam_set_user_bright; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamBrightnessNorm; + text = qtn_lcam_set_normal_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamBrightnessPlus; + text = qtn_lcam_set_increased_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamBrightnessNeg; + text = qtn_lcam_set_decreased_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_ev_data +// The data for the EV item in the photo user +// scene setup list (for range -2 to +2 in steps of 1/3) +// +//---------------------------------------------------- +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_ev_data + { + id = ECamSettingItemUserSceneExposure; + text = qtn_lcam_set_user_ev; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 6; + text = qtn_lcam_ev_plus2_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 5; + text = qtn_lcam_ev_plus1_7_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 4; + text = qtn_lcam_ev_plus1_3_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 3; + text = qtn_lcam_ev_plus1_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 2; + text = qtn_lcam_ev_plus0_7_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 1; + text = qtn_lcam_ev_plus0_3_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = 0; + text = qtn_lcam_ev_0_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -1; + text = qtn_lcam_ev_minus0_3_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -2; + text = qtn_lcam_ev_minus0_7_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -3; + text = qtn_lcam_ev_minus1_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -4; + text = qtn_lcam_ev_minus1_3_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -5; + text = qtn_lcam_ev_minus1_3_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = -6; + text = qtn_lcam_ev_minus2_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_ev_data2 +// The data for the EV item in the photo user +// scene setup list (for range -2 to +2 in steps of 1/2) +// +//---------------------------------------------------- +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_ev_data2 + { + id = ECamSettingItemUserSceneExposure; + text = qtn_lcam_set_user_ev; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureTwo; + text = qtn_lcam_ev_plus2_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureOnePointFive; + text = qtn_lcam_ev_plus1_5_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureOne; + text = qtn_lcam_ev_plus1_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposurePointFive; + text = qtn_lcam_ev_plus0_5_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureZero; + text = qtn_lcam_ev_0_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusPointFive; + text = qtn_lcam_ev_minus0_5_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusOne; + text = qtn_lcam_ev_minus1_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusOnePointFive; + text = qtn_lcam_ev_minus1_5_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusTwo; + text = qtn_lcam_ev_minus2_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_ev_data3 +// The data for the EV item in the photo user +// scene setup list (for range -2 to +2 in steps of 1) +// +//---------------------------------------------------- +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_ev_data3 + { + id = ECamSettingItemUserSceneExposure; + text = qtn_lcam_set_user_ev; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureTwo; + text = qtn_lcam_ev_plus2_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureOnePointFive; + text = qtn_lcam_ev_plus1_5_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureOne; + text = qtn_lcam_ev_plus1_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposurePointFive; + text = qtn_lcam_ev_plus0_5_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureZero; + text = qtn_lcam_ev_0_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusPointFive; + text = qtn_lcam_ev_minus0_5_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusOne; + text = qtn_lcam_ev_minus1_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusOnePointFive; + text = qtn_lcam_ev_minus1_5_v2; + }, + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamExposureMinusTwo; + text = qtn_lcam_ev_minus2_v22; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_lightsensitivity_data +// The data for the light sensitivity item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_lightsensitivity_data + { + id = ECamSettingItemUserSceneLightSensitivity; + text = qtn_lcam_set_user_iso; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityAuto; + text = qtn_lcam_set_iso_auto; // qtn_lcam_isoauto; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityLow; + text = qtn_lcam_set_iso_low; // qtn_lcam_isolow; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityMed; + text = qtn_lcam_set_iso_medium; // qtn_lcam_isomedium; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityHigh; + text = qtn_lcam_set_iso_high; // qtn_lcam_isohigh; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_extended_lightsensitivity_data +// The data for the light sensitivity item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_extended_lightsensitivity_data + { + id = ECamSettingItemUserSceneLightSensitivity; + text = qtn_lcam_set_user_iso; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityAuto; + text = qtn_lcam_set_iso_auto; // qtn_lcam_isoauto; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityLow; + text = qtn_lcam_set_iso_low; // qtn_lcam_isolow; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityLowMed; + text = qtn_lcam_set_iso_low_medium; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityMed; + text = qtn_lcam_set_iso_medium; // qtn_lcam_isomedium; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityMedHigh; + text = qtn_lcam_set_iso_medium_high; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamLightSensitivityHigh; + text = qtn_lcam_set_iso_high; // qtn_lcam_isohigh; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_contrast_data +// The data for the contrast item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_contrast_data + { + id = ECamSettingItemUserSceneContrast; + text = qtn_lcam_set_user_contr; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamContrastNorm; + text = qtn_lcam_set_contrast_normal_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamContrastPlus; + text = qtn_lcam_set_contrast_increased_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamContrastNeg; + text = qtn_lcam_set_contrast_decreased_v2; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_title_name +// Title name used in photo user scene setup +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_photo_user_scene_setup_title_name + { + txt = qtn_lcam_title_text_photoscene; + } + + +// --------------------------------------------------------- +// +// r_cam_setup_pane_scene_options_menubar +// Menubar for setup pane displaying scene options menu +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_setup_pane_scene_options_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_setup_pane_scene_options_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_setup_pane_scene_options_menu +// Options menu for setup pane when showing scene list +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_setup_pane_scene_options_menu + { + items = + { + MENU_ITEM + { + command = EAknSoftkeySelect; + txt = qtn_lcam_options_select; + }, + MENU_ITEM + { + command = ECamCmdEdit; + txt = qtn_lcam_options_edit_userdef; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + + + +//---------------------------------------------------- +// +// Confirmation query for changing the photo scene to +// "Sports" when resolution is too high. +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_sports_scene_change_confirmation_query + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = ECamCmdConfirmationQuerySportsSceneChange; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = qtn_lcam_conf_sport1m; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_user_scene_setup_title +// Title name used in the user scene setup +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_user_scene_setup_title + { + txt = qtn_lcam_title_text_photoscene; + } + + +//---------------------------------------------------- +// +// r_cam_user_scene_setup_view +// User scene setup view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_user_scene_setup_view + { + menubar = r_cam_user_scene_setup_menubar; + cba = R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE;//R_AVKON_SOFTKEYS_OPTIONS_BACK; + } + +//---------------------------------------------------- +// +// r_cam_user_scene_setup_menubar +// Menubar visible in photo and Video User Scene Setup views +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_user_scene_setup_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_user_scene_setup_menu; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_user_scene_setup_menu +// Menu visible in all user scene setup views +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_user_scene_setup_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdSelect; + txt = qtn_options_change; + }, + MENU_ITEM + { + command = ECamCmdSelectRestore; + txt = qtn_lcam_set_user_scene_restore_or; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_scene_night +// Data for the video scene night settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_video_scene_night + { + scene_item_id = ECamSceneNight; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeNight; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeHyperfocal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamVideoResolutionCIF; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_scene_setting_title +// Title name used in video scene settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_video_scene_setting_title + { + txt = qtn_lcam_title_text_scenes_vid; + } + +//---------------------------------------------------- +// +// r_cam_video_scene_video +// Data for the video scene video settings +// +//---------------------------------------------------- +// +RESOURCE CAM_SCENE_SETTING_DATA r_cam_video_scene_video + { + scene_item_id = ECamSceneNormal; + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAEMode; + default = ECamSceneAEModeAuto; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAWBMode; + default = ECamWhiteBalanceAWB; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneAFMode; + default = ECamSceneAFModeHyperfocal; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneFlashMode; + default = ECamFlashOff; + }, + + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneMaxRes; + default = ECamVideoResolutionCIF; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemSceneContrast; + default = ECamContrastNorm; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_scenes_data +// Data for all the video scene setting items (except user) +// +//---------------------------------------------------- +// +RESOURCE CAM_SETTING_ITEMS_DATA r_cam_video_scenes_data + { + settings_items = + { + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_video_scene_video; + }, + CAM_SCENE_SETTINGS_DATA_REF + { + scene_settings_data_ref = r_cam_video_scene_night; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_reset_user_scene_note +// Reset user scene settings confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_reset_user_scene_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cam_reset_user_scene_note_text +// Reset user scene confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_reset_user_scene_note_text + { + buf = qtn_lcam_note_user_reset; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamSceneSetupViewMode.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamSceneSetupViewMode.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,611 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// --------------------------------------------------- +// +// r_cam_scene_highlight_description_array +// Layout for highlighted scene descriptions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_description_array_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=58; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=112; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=166; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=220; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=274; W=328; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_description_array_ah +// Arabic/Hebrew layout for highlighted scene descriptions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_description_array_ah_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=58; W=328; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=112; W=328; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=166; W=328; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=220; W=328; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=88; B=274; W=328; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_description_array_apac +// APAC layout for highlighted scene descriptions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_description_array_apac_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=62; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=116; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=170; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=224; W=328; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontSecondaryFont; C=215; l=88; r=0; B=278; W=328; J=ELayoutAlignLeft; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_highlight_layout_array +// Layout for highlight rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_layout_array_viewmode + { + items = + { + AVKON_LAYOUT_RECT + { + l = 4; t = 2; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 56; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 110; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 164; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 4; t = 218; W = 398; H = 68; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_layout_array_ah +// Arabic/Hebrew layout for highlight rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_layout_array_ah_viewmode + { + items = + { + AVKON_LAYOUT_RECT + { + l = 16; t = 2; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 16; t = 56; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 16; t = 110; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 16; t = 164; W = 398; H = 68; + }, + AVKON_LAYOUT_RECT + { + l = 16; t = 218; W = 398; H = 68; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_highlight_title_array +// Layout for highlighted scene titles in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_title_array_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=30; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=84; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=138; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=192; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=246; W=310; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_title_array_ah +// Arabic/Hebrew layout for highlighted scene titles in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_title_array_ah_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=30; W=310; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=84; W=310; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=138; W=310; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=192; W=310; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=18; r=88; B=246; W=310; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_highlight_title_array_apac +// APAC layout for highlighted scene titles in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_highlight_title_array_apac_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=26; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=80; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=134; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=188; W=310; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=18; B=242; W=310; J=ELayoutAlignLeft; + } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array +// Layout for displaced icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_displaced_array_viewmode + { + items = + { + AVKON_LAYOUT_RECT { l = 26; t = 8; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 60; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 112; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 164; W = 40; H = 42; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array_ah +// Layout for displaced icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_displaced_array_ah_viewmode + { + items = + { + AVKON_LAYOUT_RECT { l = 350; t = 8; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 60; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 112; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 164; W = 40; H = 42; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array +// Layout for highlight icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_highlight_array_viewmode + { +items = + { + AVKON_LAYOUT_RECT { l = 16; t = 12; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 66; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 120; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 174; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 16; t = 228; W = 58; H = 46; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array_ah +// Arabic/Hebrew layout for highlight icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_highlight_array_ah_viewmode + { + items = + { + AVKON_LAYOUT_RECT { l = 342; t = 12; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 66; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 120; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 174; W = 58; H = 46; }, + AVKON_LAYOUT_RECT { l = 342; t = 228; W = 58; H = 46; } + }; + } + + +// --------------------------------------------------- +// +// r_cam_scene_icon_highlight_array +// Layout for default icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_normal_array_viewmode + { + items = + { + AVKON_LAYOUT_RECT { l = 26; t = 80; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 132; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 184; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 26; t = 236; W = 40; H = 42; } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_icon_normal_array_ah +// Layout for default icon rects in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_icon_normal_array_ah_viewmode + { + items = + { + AVKON_LAYOUT_RECT { l = 350; t = 80; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 132; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 184; W = 40; H = 42; }, + AVKON_LAYOUT_RECT { l = 350; t = 236; W = 40; H = 42; } + }; + } +// --------------------------------------------------- +// +// r_cam_scene_scrollbar_position +// Layout for scrollbar in scene settings view +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_scene_scrollbar_position_viewmode + { + l = 405; t = 0; W = 16; H = 288; + } + +// --------------------------------------------------- +// +// r_cam_scene_scrollbar_position_ah +// Arabic/Hebrew layout for scrollbar in scene settings view +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_scene_scrollbar_position_ah_viewmode + { + l = 0; t = 0; W = 16; H = 288; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal_array +// Layout for scene titles default positions in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE ARRAY r_cam_scene_title_normal_array_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=112; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=164; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=216; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=268; W=314; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal_array_ah +// Arabic/Hebrew layout for scene titles default positions in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE ARRAY r_cam_scene_title_normal_array_ah_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=112; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=164; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=216; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=268; W=314; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal_array_apac +// APAC layout for scene titles default positions in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE ARRAY r_cam_scene_title_normal_array_apac_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=116; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=168; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=220; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=272; W=314; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_displaced_array +// Layout for scene titles displaced positions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_title_displaced_array_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=40; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=92; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=144; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=196; W=314; J=ELayoutAlignLeft; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_displaced_array_ah +// Arabic/Hebrew layout for scene titles displaced positions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_title_displaced_array_ah_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=40; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=92; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=144; W=314; J=ELayoutAlignRight; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=14; r=88; B=196; W=314; J=ELayoutAlignRight; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_displaced_array_apac +// APAC layout for scene titles displaced positions in scene settings view +// +// --------------------------------------------------- +// +RESOURCE ARRAY r_cam_scene_title_displaced_array_apac_viewmode + { + items = + { + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=44; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=96; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=148; W=314; J=ELayoutAlignLeft; + }, + AVKON_LAYOUT_TEXT + { + font = EAknLogicalFontPrimaryFont; C=215; l=88; r=14; B=200; W=314; J=ELayoutAlignLeft; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamStandby.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamStandby.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + + +//---------------------------------------------------- +// +// r_cam_standby_camera_in_use_text +// Text string displayed in standby container +// when camera is in use by another application +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_standby_camera_in_use_text + { + buf = qtn_lcam_standby_camera_in_use; + } + +//---------------------------------------------------- +// +// r_cam_standby_camera_unavailable_text +// Text string displayed in standby container +// when camera hardware failure reported +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_standby_camera_unavailable_text + { + buf = qtn_lcam_standby_hardware_failure; + } + +//---------------------------------------------------- +// +// r_cam_standby_empty_text +// Text string displayed in standby container +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_standby_empty_text + { + buf = " "; + } + +// --------------------------------------------------------- +// +// r_cam_standby_menubar +// Menubar for standby mode +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_standby_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_standby_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_standby_menu +// Options menu for standby mode +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_standby_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdExitStandby; + txt = qtn_lcam_cmd_continue; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_standby_text +// Text string displayed in standby container +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_standby_text + { + buf = qtn_lcam_standby_timeout_expired; + } + +//---------------------------------------------------- +// +// r_cam_standby_camera_disabled_text +// Text string displayed in standby container +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_standby_camera_disabled_text + { + buf = qtn_camera_disabled_info_note; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamStillCapture.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamStillCapture.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,514 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + + +//---------------------------------------------------- +// +// r_cam_still_pre_capture_title_name +// Title name used in still pre-capture view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_still_pre_capture_title_name + { + txt = qtn_lcam_title_text_camera; + } + +// --------------------------------------------------- +// +// r_cam_image_saving_cancel_note +// Dialog to display cancel image saving +// confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_image_saving_cancel_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cam_image_saving_cancel_note_text +// Cancel confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_image_saving_cancel_note_text + { + buf = qtn_lcam_note_cancel_images; + } + +//---------------------------------------------------- +// +// r_cam_loading_image_wait_note +// Wait note shown when setting background image +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_loading_image_wait_note + { + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = ELoadingImageWaitNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_lcam_loading_image; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_move_to_still_image_interest +// This resource is used to register an interest in +// still-image Application InterWork (AIW) +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_move_to_still_image_interest + { + items = + { + AIW_CRITERIA_ITEM // PRINT still image + { + id = ECamCmdPrint; + serviceCmd = KAiwCmdPrint; + contentType = "image/*"; + serviceClass = KAiwClassMenu; + maxProviders = 5; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_move_to_still_image_interest_at +// This resource is used to register an interest in +// still-image Application InterWork (AIW) for use by +// Active Toolbar - which only supports QuickPrint app +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_move_to_still_image_interest_at + { + items = + { + AIW_CRITERIA_ITEM // PRINT still image + { + id = ECamCmdPrint; + serviceCmd = KAiwCmdPrint; + contentType = "image/*"; + serviceClass = KAiwClassBase; + maxProviders = 1; + loadOptions = AIW_OPTIONS_ROM_ONLY; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_move_to_still_image_sequence_interest +// This resource is used to register an interest in +// still-image Application InterWork (AIW) +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_move_to_still_image_sequence_interest + { + items = + { + AIW_CRITERIA_ITEM // PRINT still image + { + id = ECamCmdPrint; + serviceCmd = KAiwCmdPrint; + contentType = "image/*"; + serviceClass = KAiwClassMenu; + maxProviders = 5; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_share_on_ovi_interest +// This resource is used to register an interest in +// Share on Ovi Application InterWork (AIW) +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_share_on_ovi_interest + { + items = + { + AIW_CRITERIA_ITEM // Upload still image + { + id = ECamCmdShareOnOvi; + serviceCmd = KAiwCmdUpload; + //contentType = "image/*"; + contentType = "*"; + serviceClass = KAiwClassMenu; + maxProviders = 1; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_set_as_call_image_interest +// This resource is used to register an interest in +// Set as contact call image Application InterWork (AIW) +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_set_as_call_image_interest + { + items = + { + AIW_CRITERIA_ITEM // + { + id = KAiwCmdAssign; + serviceCmd = KAiwCmdAssign; + contentType = "*"; + serviceClass = KAiwClassMenu; + //maxProviders = 1; + //defaultProvider = 0x1020728f; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_saving_images_progress_note +// Dialog to display whilst saving images +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_saving_images_progress_note + { + flags = EAknProgressNoteFlags | EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = ESavingImagesProgressNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + singular_label = qtn_lcam_note_saving_images; + imagefile = AVKON_ICON_FILE; + imageid = EMbmAvkonQgn_note_progress; + imagemask = EMbmAvkonQgn_note_progress_mask; + }; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cam_self_timer_menu +// Cascade menu option for showing the self-timer periods +// +//----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_self_timer_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdSelfTimer1; + txt = qtn_lcam_st_2; + }, + MENU_ITEM + { + command = ECamCmdSelfTimer2; + txt = qtn_lcam_st_10; + }, + MENU_ITEM + { + command = ECamCmdSelfTimer3; + txt = qtn_lcam_st_20; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_still_post_capture_delete_note +// Dialog to display delete image confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_still_post_capture_delete_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_still_post_capture_delete_note_text +// Delete confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_still_post_capture_delete_note_text + { + buf = qtn_lcam_note_delete_photo; + } + +// --------------------------------------------------------- +// +// r_cam_timelapse_post_capture_menubar +// Menubar for timelapse capture post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_timelapse_post_capture_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_timelapse_post_capture_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_timelapse_post_capture_menu +// Options menu for timelapse post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_timelapse_post_capture_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_new_photos; + }, + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + }, + MENU_ITEM + { + command = ECamCmdDeleteSequence; + txt = qtn_lcam_options_deleteall; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + + + +// --------------------------------------------------------- +// +// r_cam_still_post_capture_ok_menubar +// Ok menubar for still image post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_post_capture_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_post_capture_ok_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_post_capture_ok_menu +// Context specific ok options menu for still +// image post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_post_capture_ok_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_new_photo; + }, + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cam_still_pre_capture_menu_burst_off_text +// Switch to normal mode text +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_still_pre_capture_menu_burst_off_text + { + buf = qtn_lcam_deact_seq_mode; + } + +//---------------------------------------------------- +// +// r_cam_still_scene_setting_title +// Title name used in still scene settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_still_scene_setting_title + { + txt = qtn_lcam_title_text_scenes_phot; + } + +//---------------------------------------------------- +// +// r_cam_still_sequence_mode_setting_title +// Title name used in still sequence mode settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_still_sequence_mode_setting_title + { + txt = qtn_lcam_selector_title_tl; + } + +//----------------------------------------------------------------------------- +// +// r_cam_img_precap_reticule +// The size and position of the still reticule +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_reticule + { + //l = 80; t = 60; W = 160; H = 120; + l = 200; t = 90; W = 240; H = 180; + +// { r = 142 ; t = 106; W = 36; H = 27; } + } + +//----------------------------------------------------------------------------- +// +// r_cam_img_precap_flash_icon +// The size and position of flash charging indicator +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_flash_icon + { r = 249 ; t = 3; W = 16; H = 16; } + + + +//---------------------------------------------------- +// +// r_cam_saving_image_wait_note +// Wait note shown when saving image after capture +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_processing_wait_note + { + flags = EAknWaitNoteFlags | EEikDialogFlagNoBackgroundFade; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = EGenProcessingWaitNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_gen_note_processing; + }; + } + }; + } + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamStillCaptureCamcorderLeft.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamStillCaptureCamcorderLeft.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +#define KPhotoQualitySliderLegendCentreX 20 + +// --------------------------------------------------- +// +// r_cam_img_precap_imgcounter_left +// Layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_img_precap_imgcounter_left + { + font = EAknLogicalFontSecondaryFont; C=0; l=267; r = 21; B=234; W=32; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_imgcounter_ah_left +// Arabic/Hebrew layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_img_precap_imgcounter_ah_left + { + font = EAknLogicalFontSecondaryFont; C=0; l=267; r=21; B=234; W=32; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_image_name_layout_left +// Layout for image name in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_name_layout_camcorder_left + { + font = EAknLogicalFontSecondaryFont; C=35; r=9; B=13; W=100; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_image_name_layout_ah_left +// Arabic/Hebrew layout for video name in post-capture +// navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_name_layout_ah_camcorder_left + { + font = EAknLogicalFontPrimaryFont; C=35; r=9; B=13; W=100; J=ELayoutAlignRight; + } + + +// --------------------------------------------------------- +// +// r_cam_still_precap_navicounter_decorations_camcorder_left +// Decorations for the navicounter in still precap +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_still_precap_navicounter_decorations_camcorder_left + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 269; + tl_y = 219; // 220; + width = 50; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_postcap_navicounter_decorations_camcorder_left +// Decorations for the navicounter in still precap +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_still_postcap_navicounter_decorations_camcorder_left + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 150; + tl_y = 0; + width = 167; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 317-75; + tl_y = 219; // 220; + width = 75; + } + }; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamStillCapturePortrait.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamStillCapturePortrait.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,400 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +#include "camportraitnaviconstants.rh" + +// --------------------------------------------------- +// +// r_cam_img_precap_imgcounter_portrait +// Layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_img_precap_imgcounter_portrait + { + //font = EAknLogicalFontSecondaryFont; C=0; l=0; r=KNaviPaneFontRightBorderPT; B=KNaviPaneFontBasePT; W=1; J=ELayoutAlignRight; + //font = EAknLogicalFontSecondaryFont; C=0; l=90; B=KNaviPaneFontBasePT; W=1; J=ELayoutAlignLeft; + font = ELatinPlain12; + C = 0; + r = KRemainingTimeRight; + B = KNaviPaneHeight - KNaviBottomClearance; + W = KRemainingTimePreCaptureWidth; + J = ELayoutAlignRight; + // font = EAknLogicalFontSecondaryFont; C=0; l=0; r=15; B=KNaviPaneFontBasePT - 3; W=1; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_imgcounter_ah_portrait +// Arabic/Hebrew layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_img_precap_imgcounter_ah_portrait + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=KNaviPaneFontRightBorderPT; B=KNaviPaneFontBasePT - 3; J=ELayoutAlignRight; + //font = EAknLogicalFontSecondaryFont; C=0; l=165; r=0; B=KNaviPaneFontBasePT - 3; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_image_size_layout_portrait +// Layout for image size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_size_layout_portrait + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r= 14; B=KNaviPaneFontBasePT; W=45; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_image_size_layout_ah_portrait +// Layout for image size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_size_layout_ah_portrait + { + font = EAknLogicalFontSecondaryFont; C=0; l=10; B=KNaviPaneFontBasePT; J=ELayoutAlignLeft; + } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_still_portrait +// The size and position of the snapshot in still post capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_still_portrait + { l = 1; t = 0; W = 238; H = 180; } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_cif_portrait +// The size and position of the snapshot in video post capture view +// for Large (CIF) resolutions +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_cif_portrait + { l = 1; t = 0; W = 238; H = 180; } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_near_cif_portrait +// The size and position of the snapshot in video post capture view +// for Large (CIF) resolutions in secondary camera +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_near_cif_portrait + { l = 32; t = 32; W = 176; H = 144; } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_sqcif +// The size and position of the snapshot in video post capture view +// for Small resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_sqcif_portrait +// { l = 80; t = 48; W = 256; H = 192; } + { l = 56 ; t = 46; W = 128; H = 96; } + +//----------------------------------------------------------------------------- +// +// r_cam_still_displayed_rect_secondary +// The size and position of the viewfinder frame or snapshot in still capture +// (secondary camera) +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_still_displayed_rect_secondary_portrait + { l = 1; t = 0; W = 238; H = 180; } + +//----------------------------------------------------------------------------- +// +// r_cam_still_requested_rect_secondary +// The size of the viewfinder and snapshot image requested from the engine in +// still capture (secondary camera). This is different from the displayed size +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_still_requested_rect_secondary_portrait + { l = 0; t = 0; W = 238; H = 180; } + + +//---------------------------------------------------- +// +// r_cam_post_capture_image_name_layout +// Layout for image name in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_name_layout_portrait + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=56; B=KNaviPaneFontBasePT; W=36; J=ELayoutAlignLeft; + } + + +//---------------------------------------------------- +// +// r_cam_post_capture_image_name_layout_ah_portrait +// Arabic/Hebrew layout for video name in post-capture +// navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_name_layout_ah_portrait + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=KNaviPaneFontRightBorderPT; B=KNaviPaneFontBasePT; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_exit__capture +// Softkeys definition which uses ECamMSKCmdAppCapture +// to handle the MSK event, without MSK label. +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_exit__capture + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; }, + CBA_BUTTON { id = ECamMSKCmdAppCapture; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_exit__capture_secondary +// Softkeys definition which uses ECamMSKCmdAppCapture +// to handle the MSK event, without MSK label. +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_exit__capture_secondary + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; }, + CBA_BUTTON { id = ECamMSKCmdAppCapture; txt = ""; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_exit__capture_txt +// Softkeys definition which uses ECamMSKCmdAppCapture +// to handle the MSK event, with MSK label. +// +//---------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_exit__capture_txt + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; }, + CBA_BUTTON { id = ECamMSKCmdAppCapture; txt = qtn_lcam_msk_capture; } + }; + } + +//---------------------------------------------------- +// +// r_cam_softkeys_options_exit +// +//---------------------------------------------------- +//RESOURCE CBA r_cam_softkeys_options_exit +// { +// buttons = +// { +// CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, +// CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; } +// }; +// } + +//---------------------------------------------------- +// +// r_cam_still_pre_capture_view_portrait +// Still pre-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_still_pre_capture_view_portrait + { + menubar = r_cam_still_pre_capture_menubar_portrait; + cba = r_cam_softkeys_options_exit__capture; + toolbar = r_cam_still_precapture_toolbar_portrait; + } + + +// --------------------------------------------------------- +// +// r_cam_still_pre_capture_menubar_portrait +// Menubar for still image pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_pre_capture_menubar_portrait + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_pre_capture_menu_portrait; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_pre_capture_menu_portrait +// Options menu for still image pre capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_pre_capture_menu_portrait + { + items = + { + MENU_ITEM + { + command = ECamCmdSwitchCamera; + txt = qtn_lcam_options_cam2; + }, + MENU_ITEM + { + command = ECamCmdSettings; + txt = qtn_lcam_cmd_settings; + }, + MENU_ITEM + { + command = ECamCmdNewVideo; + txt = qtn_lcam_options_video_mode; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_post_capture_view_portrait +// Still post-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_still_post_capture_view_portrait + { + menubar = r_cam_still_post_capture_menubar_portrait; + cba = r_cam_softkeys_back_secondary; + } + +// --------------------------------------------------------- +// +// r_cam_still_post_capture_menubar_portrait +// Menubar for still image post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_post_capture_menubar_portrait + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_post_capture_menu_portrait; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_post_capture_menu_portrait +// Options menu for still image post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_post_capture_menu_portrait + { + items = + { + MENU_ITEM + { + command = ECamCmdSend; + txt = qtn_options_send_via; + }, + MENU_ITEM + { + command = ECamCmdSendToCallerMultimedia; + txt = qtn_lcam_options_send_to_call; + }, + MENU_ITEM + { + command = KAiwCmdAssign; + txt = qtn_lcam_use_image_postcapture_menu; + cascade = AIW_INTELLIGENT_CASCADE_ID; + }, + MENU_ITEM + { + command = ECamCmdShareOnOvi; + // AIW provider fills the menu item title. + // No submenu, only 1 provider acccepted. + txt = ""; + }, + MENU_ITEM + { + command = ECamCmdRenameImage; + txt = qtn_lcam_cmd_rename_image; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamStillCaptureV2.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamStillCaptureV2.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,514 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + + +//---------------------------------------------------- +// +// r_cam_still_pre_capture_title_name +// Title name used in still pre-capture view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_still_pre_capture_title_name + { + txt = qtn_lcam_title_text_camera; + } + +// --------------------------------------------------- +// +// r_cam_image_saving_cancel_note +// Dialog to display cancel image saving +// confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_image_saving_cancel_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cam_image_saving_cancel_note_text +// Cancel confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_image_saving_cancel_note_text + { + buf = qtn_lcam_note_cancel_images; + } + +//---------------------------------------------------- +// +// r_cam_loading_image_wait_note +// Wait note shown when setting background image +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_loading_image_wait_note + { + flags = EAknWaitNoteFlags; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = ELoadingImageWaitNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_lcam_loading_image; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_move_to_still_image_interest +// This resource is used to register an interest in +// still-image Application InterWork (AIW) +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_move_to_still_image_interest + { + items = + { + AIW_CRITERIA_ITEM // PRINT still image + { + id = ECamCmdPrint; + serviceCmd = KAiwCmdPrint; + contentType = "image/*"; + serviceClass = KAiwClassMenu; + maxProviders = 5; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_move_to_still_image_interest_at +// This resource is used to register an interest in +// still-image Application InterWork (AIW) for use by +// Active Toolbar - which only supports QuickPrint app +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_move_to_still_image_interest_at + { + items = + { + AIW_CRITERIA_ITEM // PRINT still image + { + id = ECamCmdPrint; + serviceCmd = KAiwCmdPrint; + contentType = "image/*"; + serviceClass = KAiwClassBase; + maxProviders = 1; + loadOptions = AIW_OPTIONS_ROM_ONLY; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_move_to_still_image_sequence_interest +// This resource is used to register an interest in +// still-image Application InterWork (AIW) +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_move_to_still_image_sequence_interest + { + items = + { + AIW_CRITERIA_ITEM // PRINT still image + { + id = ECamCmdPrint; + serviceCmd = KAiwCmdPrint; + contentType = "image/*"; + serviceClass = KAiwClassMenu; + maxProviders = 5; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_share_on_ovi_interest +// This resource is used to register an interest in +// Share on Ovi Application InterWork (AIW) +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_share_on_ovi_interest + { + items = + { + AIW_CRITERIA_ITEM // Upload still image + { + id = ECamCmdShareOnOvi; + serviceCmd = KAiwCmdUpload; + //contentType = "image/*"; + contentType = "*"; + serviceClass = KAiwClassMenu; + maxProviders = 1; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_set_as_call_image_interest +// This resource is used to register an interest in +// Set as contact call image Application InterWork (AIW) +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_set_as_call_image_interest + { + items = + { + AIW_CRITERIA_ITEM // + { + id = KAiwCmdAssign; + serviceCmd = KAiwCmdAssign; + contentType = "*"; + serviceClass = KAiwClassMenu; + //maxProviders = 1; + //defaultProvider = 0x1020728f; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_saving_images_progress_note +// Dialog to display whilst saving images +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_saving_images_progress_note + { + flags = EAknProgressNoteFlags | EEikDialogFlagWait; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = ESavingImagesProgressNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + singular_label = qtn_lcam_note_saving_images; + imagefile = AVKON_ICON_FILE; + imageid = EMbmAvkonQgn_note_progress; + imagemask = EMbmAvkonQgn_note_progress_mask; + }; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cam_self_timer_menu +// Cascade menu option for showing the self-timer periods +// +//----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_self_timer_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdSelfTimer1; + txt = qtn_lcam_st_2_v2; + }, + MENU_ITEM + { + command = ECamCmdSelfTimer2; + txt = qtn_lcam_st_10_v2; + }, + MENU_ITEM + { + command = ECamCmdSelfTimer3; + txt = qtn_lcam_st_20_v2; + } + }; + } + +// --------------------------------------------------- +// +// r_cam_still_post_capture_delete_note +// Dialog to display delete image confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_still_post_capture_delete_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + + +//----------------------------------------------------------------------------- +// +// r_cam_still_post_capture_delete_note_text +// Delete confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_still_post_capture_delete_note_text + { + buf = qtn_lcam_note_delete_photo; + } + +// --------------------------------------------------------- +// +// r_cam_timelapse_post_capture_menubar +// Menubar for timelapse capture post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_timelapse_post_capture_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_timelapse_post_capture_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_timelapse_post_capture_menu +// Options menu for timelapse post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_timelapse_post_capture_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_new_photos; + }, + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + }, + MENU_ITEM + { + command = ECamCmdDeleteSequence; + txt = qtn_lcam_options_deleteall; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + + + +// --------------------------------------------------------- +// +// r_cam_still_post_capture_ok_menubar +// Ok menubar for still image post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_post_capture_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_post_capture_ok_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_post_capture_ok_menu +// Context specific ok options menu for still +// image post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_post_capture_ok_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_new_photo; + }, + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cam_still_pre_capture_menu_burst_off_text +// Switch to normal mode text +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_still_pre_capture_menu_burst_off_text + { + buf = qtn_lcam_deact_seq_mode; + } + +//---------------------------------------------------- +// +// r_cam_still_scene_setting_title +// Title name used in still scene settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_still_scene_setting_title + { + txt = qtn_lcam_title_text_scenes_phot; + } + +//---------------------------------------------------- +// +// r_cam_still_sequence_mode_setting_title +// Title name used in still sequence mode settings view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_still_sequence_mode_setting_title + { + txt = qtn_lcam_selector_title_tl; + } + +//----------------------------------------------------------------------------- +// +// r_cam_img_precap_reticule +// The size and position of the still reticule +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_reticule + { + //l = 80; t = 60; W = 160; H = 120; + l = 200; t = 90; W = 240; H = 180; + +// { r = 142 ; t = 106; W = 36; H = 27; } + } + +//----------------------------------------------------------------------------- +// +// r_cam_img_precap_flash_icon +// The size and position of flash charging indicator +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_img_precap_flash_icon + { r = 249 ; t = 3; W = 16; H = 16; } + + + +//---------------------------------------------------- +// +// r_cam_saving_image_wait_note +// Wait note shown when saving image after capture +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_processing_wait_note + { + flags = EAknWaitNoteFlags | EEikDialogFlagNoBackgroundFade; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = EGenProcessingWaitNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_gen_note_processing; + }; + } + }; + } + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamStillCaptureViewMode.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamStillCaptureViewMode.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,318 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// --------------------------------------------------- +// +// r_cam_img_precap_imgcounter_viewmode +// Layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_img_precap_imgcounter_viewmode + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=25; B=KNaviPaneFontBaseVM; W=1; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_img_precap_imgcounter_ah_viewmode +// Arabic/Hebrew layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_img_precap_imgcounter_ah_viewmode + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=10; B=KNaviPaneFontBaseVM; W=1; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_image_size_layout_viewmode +// Layout for image size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_size_layout_viewmode + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=25; B=KNaviPaneFontBaseVM; W=1; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_image_size_layout_ah_viewmode +// Layout for image size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_size_layout_ah_viewmode + { + font = EAknLogicalFontSecondaryFont; C=0; r=15; B=KNaviPaneFontBaseVM; J=ELayoutAlignRight; + } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_still_viewmode +// The size and position of the snapshot in still post capture +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_still_viewmode + { l = 40; t = 6; W = 240; H = 180; } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_cif_viewmode +// The size and position of the snapshot in video post capture view +// for Large (CIF) resolutions +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_cif_viewmode + { l = 40; t = 6; W = 240; H = 180; } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_near_cif_viewmode +// The size and position of the snapshot in video post capture view +// for Large (CIF) resolutions in secondary camera +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_near_cif_viewmode + { l = 72; t = 24; W = 176; H = 144; } + +//----------------------------------------------------------------------------- +// +// r_cam_snapshot_rect_sqcif_viewmode +// The size and position of the snapshot in video post capture view +// for Small resolution +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_snapshot_rect_sqcif_viewmode +// { l = 80; t = 48; W = 256; H = 192; } + { l = 96; t = 48; W = 128; H = 96; } + +//----------------------------------------------------------------------------- +// +// r_cam_still_displayed_rect_secondary_viewmode +// The size and position of the viewfinder frame or snapshot in still capture +// (secondary camera) +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_still_displayed_rect_secondary_viewmode + { l = 40; t = 6; W = 240; H = 180; } + +//----------------------------------------------------------------------------- +// +// r_cam_still_requested_rect_secondary_viewmode +// The size of the viewfinder and snapshot image requested from the engine in +// still capture (secondary camera). This is different from the displayed size +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_still_requested_rect_secondary_viewmode + { l = 0; t = 0; W = 352; H = 288; } + + +//---------------------------------------------------- +// +// r_cam_post_capture_image_name_layout_viewmode +// Layout for image name in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_name_layout_viewmode + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; W=0; B=-100; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_image_name_layout_ah_viewmode +// Arabic/Hebrew layout for video name in post-capture +// navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_image_name_layout_ah_viewmode + { + font = ELatinPlain12; C=0; l=4; r=45; B=-100; W=59; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_still_post_capture_view_viewmode +// Still post-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_still_post_capture_view_viewmode + { + menubar = r_cam_still_post_capture_menubar_viewmode; + cba = r_cam_softkeys_back; + } + +// --------------------------------------------------------- +// +// r_cam_still_post_capture_menubar_viewmode +// Menubar for still image post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_post_capture_menubar_viewmode + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_post_capture_menu_viewmode; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_post_capture_menu_viewmode +// Options menu for still image post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_post_capture_menu_viewmode + { + items = + { + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_new_photo; + }, + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + }, + MENU_ITEM + { + command = ECamCmdPrint; + txt = ""; + cascade = AIW_INTELLIGENT_CASCADE_ID; + }, + MENU_ITEM + { + command = ECamCmdSend; + txt = qtn_options_send_via; + }, + MENU_ITEM + { + command = ECamCmdSendToCallerMultimedia; + txt = qtn_lcam_options_send_to_call; + }, + MENU_ITEM + { + command = KAiwCmdAssign; + txt = qtn_lcam_use_image_postcapture_menu; + cascade = AIW_INTELLIGENT_CASCADE_ID; + }, + MENU_ITEM + { + command = ECamCmdShareOnOvi; + // AIW provider fills the menu item title. + // No submenu, only 1 provider acccepted. + txt = ""; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_pre_capture_view_viewmode +// Still pre-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_still_pre_capture_view_viewmode + { + menubar = r_cam_still_pre_capture_menubar_viewmode; + cba = r_cam_softkeys_options_exit; + } + +// --------------------------------------------------------- +// +// r_cam_still_pre_capture_menubar_viewmode +// Menubar for still image pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_still_pre_capture_menubar_viewmode + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_still_pre_capture_menu_viewmode; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_still_pre_capture_menu_viewmode +// Options menu for still image pre capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_still_pre_capture_menu_viewmode + { + items = + { + MENU_ITEM + { + command = ECamCmdNewVideo; + txt = qtn_lcam_options_video_mode; + }, + MENU_ITEM + { + command = ECamCmdSettings; + txt = qtn_lcam_cmd_settings; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamVideoCapture.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamVideoCapture.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,343 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +//---------------------------------------------------- +// +// r_cam_saving_video_wait_note +// Wait note shown whilst saving video after capturing +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_saving_video_wait_note + { + flags = EAknWaitNoteFlags | EEikDialogFlagNoBackgroundFade; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = ESavingVideoWaitNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_lcam_note_processing_video; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_dynamic_settings_data +// Default values for the video dynamic setting items +// +//---------------------------------------------------- +// +RESOURCE CAM_SETTING_ITEMS_DATA r_cam_video_dynamic_settings_data + { + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoWhiteBalance; + default = ECamWhiteBalanceAWB; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoExposure; + default = ECamExposureZero; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoColourFilter; + default = ECamColourFilterColour; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoScene; + default = ECamSceneNormal; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoFlash; + default = ECamFlashOff; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoBrightness; + default = ECamBrightnessNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoContrast; + default = ECamContrastNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoColourSaturation; + default = ECamColourSaturationNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoLightSensitivity; + default = ECamLightSensitivityAuto; + } + }; + } + + + +// --------------------------------------------------- +// +// r_cam_video_post_capture_delete_note +// Dialog to display delete video confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_video_post_capture_delete_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cam_video_post_capture_delete_note_text +// Delete confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_video_post_capture_delete_note_text + { + buf = qtn_lcam_note_delete_video; + } + +// --------------------------------------------------------- +// +// r_cam_video_post_capture_ok_menubar +// Ok menubar for video post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_post_capture_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_post_capture_ok_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_post_capture_ok_menu +// Context specific ok options menu for +// video post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_post_capture_ok_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdNewVideo; + txt = qtn_lcam_options_new_video; + }, + MENU_ITEM + { + command = ECamCmdPlay; + txt = qtn_lcam_options_play; + }, + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_pre_capture_title_name +// Title name used in video pre-capture view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_video_pre_capture_title_name + { + txt = qtn_lcam_title_text_video_camera; + } + +// --------------------------------------------------------- +// +// r_cam_video_pre_capture_ok_menubar +// Ok menubar for video pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_pre_capture_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_pre_capture_ok_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_pre_capture_ok_menu +// Context specific ok options menu for +// video pre capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_pre_capture_ok_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_photo_mode; + }, + MENU_ITEM + { + command = ECamCmdShootSetup; + txt = qtn_lcam_options_videoset; + }, + MENU_ITEM + { + command = ECamCmdSettings; + txt = qtn_lcam_cmd_settings; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_resolution_array +// Mapping of video resolution settings +// to actual numeric parameters. +// +//---------------------------------------------------- +// +RESOURCE CAM_RESOLUTION_ARRAY r_cam_video_resolution_array + { + resolutions = + { + // SubQCIF video (SubQCIF viewfinder) + CAM_RESOLUTION + { + width = 128; + height = 96; + }, + // QCIF video (QCIF viewfinder) + CAM_RESOLUTION + { + width = 176; + height = 144; + }, + // CIF video + CAM_RESOLUTION + { + width = 352; + height = 288; + }, + // VGA video + CAM_RESOLUTION + { + width = 640; + height = 480; + }, + // QVGA video + CAM_RESOLUTION + { + width = 320; + height = 240; + }, + // nHD video + CAM_RESOLUTION + { + width = 640; + height = 352; + }, + // WVGA video + CAM_RESOLUTION + { + width = 864; + height = 480; + }, + // HD 720 video + CAM_RESOLUTION + { + width = 1280; + height = 720; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_set_as_ring_tone_interest +// This resource is used to register an interest in +// assinging video to Application InterWork (AIW) +// services +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_set_as_ring_tone_interest + { + items = + { + AIW_CRITERIA_ITEM // + { + id = KAiwCmdAssign; + serviceCmd = KAiwCmdAssign; + contentType = "*"; + serviceClass = KAiwClassMenu; + //maxProviders = 1; + loadOptions = AIW_OPTIONS_ROM_ONLY; + //defaultProvider = 0x10281F18; + } + }; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamVideoCaptureCamcorderLeft.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamVideoCaptureCamcorderLeft.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,536 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// --------------------------------------------------- +// +// r_cam_video_precap_remaining_time_left +// Layout for remaining recording time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_precap_remaining_time_left + { + font = EAknLogicalFontSecondaryFont; C=0; l=221; r=67; B=234; W=32; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_remaining_time_ah_left +// Arabic/Hebrew layout for remaining recording time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_precap_remaining_time_ah_left + { + font = EAknLogicalFontSecondaryFont; C=0; l=221; r=67; B=234; W=32; J=ELayoutAlignRight; + } + + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_elapsed_time_left +// Layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_elapsed_time_left + { + font = EAknLogicalFontSecondaryFont; C=35; l=128; r=160; B=234; W=32; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_elapsed_time_ah_left +// Arabic/Hebrew layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_elapsed_time_ah_left + { + font = EAknLogicalFontSecondaryFont; C=35; l=221; B=234; W=56; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_elapsed_time_left +// Layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_elapsed_time_left + { + font = EAknLogicalFontSecondaryFont; C=35; l=128; r=160; B=234; W=32; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_elapsed_time_ah_left +// Arabic/Hebrew layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_elapsed_time_ah_left + { + font = EAknLogicalFontSecondaryFont; C=35; l=221; B=234; W=56; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_remaining_time_left +// Layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_remaining_time_left + { + font = EAknLogicalFontSecondaryFont; C=215; l=221; r=320-221-32; B=234; W=32; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_remaining_time_ah_left +// Arabic/Hebrew layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_remaining_time_ah_left + { + font = EAknLogicalFontSecondaryFont; C=215; l=128; r=160; B=234; W=32; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_remaining_time_left +// Layout for remaining time in navi pane when the progress bar is not visible +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_remaining_time_left + { + font = EAknLogicalFontSecondaryFont; C=215; l=221; r=320-221-32; B=234; W=32; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_remaining_time_ah_left +// Arabic/Hebrew layout for remaining time in navi pane when the progress bar is not visible +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_remaining_time_ah_left + { + font = EAknLogicalFontSecondaryFont; C=215; l=128; r=160; B=234; W=32; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_progress_bar_left +// Layout for progress bar during capture in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_progress_bar_left + { + l=164; t=225; W=53; H=10; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_progress_bar_ah_left +// Arabic/Hebrew layout for progress bar during capture in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_progress_bar_ah_left + { + l=164; t=225; W=53; H=10; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_memory_location_left +// Layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_memory_location_left + { + l = 257; t = 222; W = 11; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_memory_location_ah_left +// Arabic/Hebrew layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_memory_location_ah_left + { + l = 257; t = 222; W = 11; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimit_memory_location_left +// Layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_memory_location_left + { + l = 257; t = 222; W = 11; H = 16; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimit_memory_location_ah_left +// Arabic/Hebrew layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_memory_location_ah_left + { + l = 257; t = 222; W = 11; H = 16; + } + +//----------------------------------------------------------------------------- +// +// r_cam_recpause_indicator_layout_vid_main_rect_left +// Layout rect for the recording and paused indicators in the main video pane. +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_recpause_indicator_layout_vid_main_rect_camcorder_left + { + l=114; t=226; W=9; H=9; + } + + +//---------------------------------------------------- +// +// r_cam_post_capture_video_name_layout_left +// Layout for video name in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_name_layout_camcorder_left + { + font = EAknLogicalFontSecondaryFont; C=35; r=9; B=13; W=100; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_video_name_layout_ah_left +// Arabic/Hebrew layout for video name in post-capture +// navi-counter for secondary camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_name_layout_ah_camcorder_left + { + font = EAknLogicalFontSecondaryFont; C=35; r=9; B=13; W=100; J=ELayoutAlignRight; + } + + +// --------------------------------------------------------- +// +// r_cam_video_precap_navicounter_decorations_camcorder_left +// Decorations for the navicounter in video precap +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_precap_navicounter_decorations_camcorder_left + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 215; + tl_y = 219; // 220; + width = 60; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_limit_recording_icon_left +// Decorations and recording icon during capture, limited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_limit_recording_icon_left + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationDVFBlanker; + decoration = + { + CAM_DVF_BLANKER + { + tl_x = 112; + tl_y = 219; // 220; + width = 160; + height = 20; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 112; + tl_y = 219; // 220; + width = 160; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 112+5; + tl_y = 219+6;// 220+6; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_limit_recording_icon_ah_left +// Decorations and recording icon during capture, limited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_limit_recording_icon_ah_left + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationDVFBlanker; + decoration = + { + CAM_DVF_BLANKER + { + tl_x = 112; + tl_y = 219; // 220; + width = 160; + height = 20; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 112; + tl_y = 219; // 220; + width = 160; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 112+5; + tl_y = 219+6;// 220+6; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_unlimit_recording_icon_left +// Decorations and recording icon during capture, unlimited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_unlimit_recording_icon_left + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationDVFBlanker; + decoration = + { + CAM_DVF_BLANKER + { + tl_x = 112; + tl_y = 219; // 220; + width = 160; + height = 20; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 112; + tl_y = 219; // 220; + width = 160; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 112+5; + tl_y = 219+6; // 220+6; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_unlimit_recording_icon_ah_left +// Decorations and recording icon during capture, unlimited feature, Arabic/Hebrew +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_unlimit_recording_icon_ah_left + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationDVFBlanker; + decoration = + { + CAM_DVF_BLANKER + { + tl_x = 112; + tl_y = 219; // 220; + width = 160; + height = 20; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 112; + tl_y = 219; // 220; + width = 160; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 112+5; + tl_y = 219+6; // 220+6; + width = 9; + height = 9; + } + }; + } + }; + } +// --------------------------------------------------------- +// +// r_cam_video_postcap_navicounter_decorations_camcorder_left +// Decorations for the progress bar in video precap +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_postcap_navicounter_decorations_camcorder_left + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 150; + tl_y = 0; + width = 167; + } + }; + }, + CAM_DECORATION + { + type = ECamScreenDecorationBlendedBackground; + decoration = + { + CAM_BLENDED_BACKGROUND + { + tl_x = 237; + tl_y = 219; // 220; + width = 56; + } + }; + } + }; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamVideoCapturePortrait.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamVideoCapturePortrait.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,811 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + +#include "camportraitnaviconstants.rh" + +// --------------------------------------------------- +// +// r_cam_video_precap_remaining_time_portrait +// Layout for remaining recording time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_precap_remaining_time_portrait + { + font = ELatinPlain12; + C = 0; + r = KRemainingTimeRight; + B = KNaviPaneHeight - KNaviBottomClearance; + W = KRemainingTimePreCaptureWidth; + J = ELayoutAlignRight; + //font = EAknLogicalFontSecondaryFont; C=0; l=0; r=15; B=KNaviPaneFontBasePT - 3; W=36; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_remaining_time_ah_portrait +// Arabic/Hebrew layout for remaining recording time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_precap_remaining_time_ah_portrait + { + font = EAknLogicalFontSecondaryFont; C=0; l=90; /*r=KNaviPaneFontRightBorderPT - 1;*/ B=KNaviPaneFontBasePT - 3; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_remaining_time_portrait +// Layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_remaining_time_portrait + { + //font = ELatinPlain12; C=215; r=15; B=KNaviPaneFontBasePT - 2; W=KRemainingTimeInCaptureWidth; J=ELayoutAlignRight; + font = ELatinPlain12; + C = 215; + r = KRemainingTimeRight; + B = KNaviPaneHeight - KNaviBottomClearance; + W = KRemainingTimeInCaptureWidth; + J = ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_remaining_time_portrait +// Layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_remaining_time_portrait + { + //font = ELatinPlain12; C=215; r=15; B=KNaviPaneFontBasePT - 3; W=KRemainingTimeInCaptureWidth; J=ELayoutAlignRight; + font = ELatinPlain12; + C = 215; + r = KRemainingTimeRight; + B = KNaviPaneHeight - KNaviBottomClearance; + W = KRemainingTimeInCaptureWidth; + J = ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_remaining_time_ah_portrait +// Layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_remaining_time_ah_portrait + { + font = ELatinPlain12; C=215; r=12 + 80; B=KNaviPaneFontBasePT - 4; W=KRemainingTimeInCaptureWidth; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_remaining_time_ah_portrait +// Arabic/Hebrew layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_remaining_time_ah_portrait + { + font = ELatinPlain12; C=215; l=14; B=KNaviPaneFontBasePT - 2; J=ELayoutAlignLeft; + } + + + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_elapsed_time_portrait +// Layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_elapsed_time_portrait + { + //font=ELatinPlain12; C=35; l=12; B=KNaviPaneFontBasePT - 1; W=KElapsedTimeInCaptureWidth; J=ELayoutAlignLeft; + + font = ELatinPlain12; + C = 35; + r = KElapsedTimeRight; + B = KNaviPaneHeight - KNaviBottomClearance; + W = KElapsedTimeInCaptureWidth; + J = ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_elapsed_time_ah_portrait +// Arabic/Hebrew layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_elapsed_time_ah_portrait + { + font = ELatinPlain12; C=35; r=10; B=KNaviPaneFontBasePT - KNaviBottomClearance; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_elapsed_time_portrait +// Layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_elapsed_time_portrait + { + //font = ELatinPlain12; C=35; l=12; B=KNaviPaneFontBasePT - 1; W=24; J=ELayoutAlignLeft; + //font = ELatinPlain12; C=35; l=49; B=KNaviPaneFontBasePT - 3; W=KElapsedTimeInCaptureWidth; J=ELayoutAlignLeft; + font = ELatinPlain12; + C = 35; + r = KElapsedTimeRight; + B = KNaviPaneHeight - KNaviBottomClearance; + W = KElapsedTimeInCaptureWidth; + J = ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_elapsed_time_ah_portrait +// Arabic/Hebrew layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_elapsed_time_ah_portrait + { + font = ELatinPlain12; C=35; r=0 + 50; B=KNaviPaneFontBasePT - KNaviBottomClearance; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_video_size_layout_portrait +// Layout for video size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_size_layout_portrait + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=KNaviPaneFontRightBorderPT; B=KNaviPaneFontBasePT; W=36; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_video_size_layout_ah_portrait +// Layout for video size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_size_layout_ah_portrait + { + font = EAknLogicalFontSecondaryFont; C=0; l=10; B=KNaviPaneFontBasePT; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_progress_bar_portrait +// Layout for progress bar during capture in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_progress_bar_portrait + { + r = KProgressBarRight; + //t = (KNaviPaneHeight - KProgressBarHeight) / 2; + b = KNaviBottomClearance; + W = KProgressBarWidth; + H = KProgressBarHeight; + //l=37; t=8; W=71; H=10; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_progress_bar_ah_portrait +// Arabic/Hebrew layout for progress bar during capture in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_progress_bar_ah_portrait + { + r=37; t=8; W=71; H=10; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_memory_location_portrait +// Layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_memory_location_portrait + { + //r = 5; t = 7; W = 9; H = 11; + //l = 136; t = 5; W = 9; H = 11; + r = KMemoryIconRight; + //t = (KNaviPaneHeight-KMemoryIconHeight)/2; + b = KNaviBottomClearance; + W = KMemoryIconWidth; + H = KMemoryIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_memory_location_ah_portrait +// Arabic/Hebrew layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_memory_location_ah_portrait + { + l = 0; t = 6; W = 21; H = 28; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimit_memory_location_portrait +// Layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_memory_location_portrait + { + //r = 5; t = 7; W = 9; H = 11; + //l = 124; t = 5; W = 9; H = 11; + r = KMemoryIconRight; + //t = (KNaviPaneHeight-KMemoryIconHeight)/2; + b = KNaviBottomClearance; + W = KMemoryIconWidth; + H = KMemoryIconHeight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimit_memory_location_ah_portrait +// Arabic/Hebrew layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_memory_location_ah_portrait + { + l = 10; t = 5; W = 21; H = 28; + } + +//----------------------------------------------------------------------------- +// +// r_cam_recpause_indicator_layout_vid_main_rect +// Layout rect for the recording and paused indicators in the main video pane. +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_recpause_indicator_layout_vid_main_rect_portrait + { + l=8; t=6; W=18; H=18; + } + + +//---------------------------------------------------- +// +// r_cam_video_quality_slider_array_portrait +// Legend data for the video quality slider +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_slider_array_portrait + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 8; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_cif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_cif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 4; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_mp4; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_mp4_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 136; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_qcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_qcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 132; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 260; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_sqcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_sqcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 256; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_quality_slider_array_ah +// Legend data for the video quality slider (Arabic/Hebrew) +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_slider_array_ah_portrait + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 8; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_cif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_cif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 4; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_mp4; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_mp4_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 136; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_qcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_qcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 132; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 260; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_sqcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_sqcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 256; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + } + }; + } + +/* +//---------------------------------------------------- +// +// r_cam_video_quality_slider_array_cam2_portrait +// Legend data for the video quality slider ( for camera 2 ) +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_slider_array_cam2_portrait + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 8; W = 26; H = 22; }; + bitmap_id = EMbmCameraappQgn_indi_lcam_res_qcif; + mask_id = EMbmCameraappQgn_indi_lcam_res_qcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 4; W = 22; H = 32; }; + bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; + mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 260; W = 26; H = 22; }; + bitmap_id = EMbmCameraappQgn_indi_lcam_res_sqcif; + mask_id = EMbmCameraappQgn_indi_lcam_res_sqcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 56; W = 22; H = 32; }; + bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; + mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + } + }; + } +*/ + +//---------------------------------------------------- +// +// r_cam_post_capture_video_name_layout_portrait +// Layout for video name in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_name_layout_portrait + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=56; B=KNaviPaneFontBasePT; W=36; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_video_name_layout_ah_portrait +// Arabic/Hebrew layout for video name in post-capture +// navi-counter for secondary camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_name_layout_ah_portrait + { + font = EAknLogicalFontSecondaryFont; C=0; r=KNaviPaneFontRightBorderPT; B=KNaviPaneFontBasePT; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_video_pre_capture_view +// Video pre-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_video_pre_capture_view_portrait + { + menubar = r_cam_video_pre_capture_menubar_portrait; + cba = r_cam_softkeys_options_exit; + toolbar = r_cam_video_precapture_toolbar_portrait; + } + +// --------------------------------------------------------- +// +// r_cam_video_pre_capture_menubar +// Menubar for video pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_pre_capture_menubar_portrait + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_pre_capture_menu_portrait; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_pre_capture_menu_portrait +// Options menu for video pre capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_pre_capture_menu_portrait + { + items = + { + MENU_ITEM + { + command = ECamCmdSwitchCamera; + txt = qtn_lcam_options_cam2; + }, + MENU_ITEM + { + command = ECamCmdSettings; + txt = qtn_lcam_cmd_settings; + }, + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_photo_mode; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_post_capture_view +// Video post-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_video_post_capture_view_portrait + { + menubar = r_cam_video_post_capture_menubar_portrait; + cba = r_cam_softkeys_options_back_toggletoolbar_portrait; + toolbar = r_cam_video_postcapture_toolbar_portrait; + } + +// --------------------------------------------------------- +// +// r_cam_video_post_capture_menubar +// Menubar for video post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_post_capture_menubar_portrait + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_post_capture_menu_portrait; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_post_capture_menu_portrait +// Options menu for video post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_post_capture_menu_portrait + { + items = + { + MENU_ITEM + { + command = ECamCmdSend; + txt = qtn_options_send_via; + }, + MENU_ITEM + { + command = ECamCmdSendToCallerMultimedia; + txt = qtn_lcam_options_send_to_call; + }, + MENU_ITEM + { + command = KAiwCmdAssign; + txt = qtn_lcam_use_video_postcapture_menu; + cascade = AIW_INTELLIGENT_CASCADE_ID; + }, + MENU_ITEM + { + command = ECamCmdShareOnOvi; + // AIW provider fills the menu item title. + // No submenu, only 1 provider acccepted. + txt = ""; + }, + MENU_ITEM + { + command = ECamCmdRenameVideo; + txt = qtn_lcam_cmd_rename_video; + }, + MENU_ITEM + { + command = ECamCmdPhotos; + txt = qtn_lcam_options_go_to_photos; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_limit_recording_icon_portrait +// Recording icon during capture, limited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_limit_recording_icon_portrait + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = KNaviPaneWidth - (KRecordingIconRight + KRecordingIconWidth); + tl_y = KNaviPaneHeight - KRecordingIconHeight - KNaviBottomClearance; + width = KRecordingIconWidth; + height = KRecordingIconHeight; + //tl_x = 0; + //tl_y = 9; + //width = 9; + //height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_limit_recording_icon_ah_portrait +// Recording icon during capture, limited feature, Arabic/Hebrew +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_limit_recording_icon_ah_portrait + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 140; + tl_y = 9; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_unlimit_recording_icon_portrait +// Recording icon during capture, unlimited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_unlimit_recording_icon_portrait + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 80; + tl_y = 7; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_unlimit_recording_ah_icon_portrait +// Recording icon during capture, unlimited feature, Arabic/Hebrew +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_unlimit_recording_icon_ah_portrait + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 60; + tl_y = 7; + width = 9; + height = 9; + } + }; + } + }; + } + +//--------------------------------------------------------- +// +// r_cam_softkeys_options_exit__record +// Softkeys definition which uses ECamMSKCmdAppRecord +// to handle the MSK event, without MSK label. +// +//--------------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_exit__record + { + flags = EEikButtonGroupAddToStack | EEikCbaFlagTransparent; + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; }, + CBA_BUTTON { id = ECamMSKCmdAppRecord; txt = ""; } + }; + } + +//--------------------------------------------------------- +// +// r_cam_softkeys_options_exit__record_secondary +// Softkeys definition which uses ECamMSKCmdAppRecord +// to handle the MSK event, without MSK label. +// +//--------------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_exit__record_secondary + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; }, + CBA_BUTTON { id = ECamMSKCmdAppRecord; txt = ""; } + }; + } + +//--------------------------------------------------------- +// +// r_cam_softkeys_options_exit__record_txt +// Softkeys definition which uses ECamMSKCmdAppCapture +// to handle the MSK event, with MSK label. +// +//--------------------------------------------------------- +RESOURCE CBA r_cam_softkeys_options_exit__record_txt + { + buttons = + { + CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, + CBA_BUTTON { id = ECamCmdInternalExit; txt = text_softkey_exit; }, + CBA_BUTTON { id = ECamMSKCmdAppRecord; txt = qtn_lcam_msk_record; } + }; + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamVideoCaptureV2.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamVideoCaptureV2.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,343 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +//---------------------------------------------------- +// +// r_cam_saving_video_wait_note +// Wait note shown whilst saving video after capturing +// +//---------------------------------------------------- +// +RESOURCE DIALOG r_cam_saving_video_wait_note + { + flags = EAknWaitNoteFlags | EEikDialogFlagNoBackgroundFade; + buttons = R_AVKON_SOFTKEYS_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtNote; + id = ESavingVideoWaitNote; + control = AVKON_NOTE + { + layout = EWaitLayout; + animation = R_QGN_GRAF_WAIT_BAR_ANIM; + singular_label = qtn_lcam_note_processing_video_v2; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_dynamic_settings_data +// Default values for the video dynamic setting items +// +//---------------------------------------------------- +// +RESOURCE CAM_SETTING_ITEMS_DATA r_cam_video_dynamic_settings_data + { + settings_items = + { + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoWhiteBalance; + default = ECamWhiteBalanceAWB; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoExposure; + default = ECamExposureZero; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoColourFilter; + default = ECamColourFilterColour; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoScene; + default = ECamSceneNormal; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoFlash; + default = ECamFlashOff; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoBrightness; + default = ECamBrightnessNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoContrast; + default = ECamContrastNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoColourSaturation; + default = ECamColourSaturationNorm; + }, + CAM_NON_STATIC_SETTING_ITEM_DATA + { + id = ECamSettingItemDynamicVideoLightSensitivity; + default = ECamLightSensitivityAuto; + } + }; + } + + + +// --------------------------------------------------- +// +// r_cam_video_post_capture_delete_note +// Dialog to display delete video confirmation note +// +// --------------------------------------------------- +// +RESOURCE DIALOG r_cam_video_post_capture_delete_note + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO__YES; + + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = ""; + }; + } + }; + } + +//----------------------------------------------------------------------------- +// +// r_cam_video_post_capture_delete_note_text +// Delete confirmation query text. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_cam_video_post_capture_delete_note_text + { + buf = qtn_lcam_note_delete_video; + } + +// --------------------------------------------------------- +// +// r_cam_video_post_capture_ok_menubar +// Ok menubar for video post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_post_capture_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_post_capture_ok_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_post_capture_ok_menu +// Context specific ok options menu for +// video post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_post_capture_ok_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdNewVideo; + txt = qtn_lcam_options_new_video; + }, + MENU_ITEM + { + command = ECamCmdPlay; + txt = qtn_lcam_options_play; + }, + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_pre_capture_title_name +// Title name used in video pre-capture view +// +//---------------------------------------------------- +// +RESOURCE TITLE_PANE r_cam_video_pre_capture_title_name + { + txt = qtn_lcam_title_text_video_camera; + } + +// --------------------------------------------------------- +// +// r_cam_video_pre_capture_ok_menubar +// Ok menubar for video pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_pre_capture_ok_menubar + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_pre_capture_ok_menu; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_pre_capture_ok_menu +// Context specific ok options menu for +// video pre capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_pre_capture_ok_menu + { + items = + { + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_photo_mode; + }, + MENU_ITEM + { + command = ECamCmdShootSetup; + txt = qtn_lcam_options_videoset; + }, + MENU_ITEM + { + command = ECamCmdSettings; + txt = qtn_lcam_cmd_settings; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_resolution_array +// Mapping of video resolution settings +// to actual numeric parameters. +// +//---------------------------------------------------- +// +RESOURCE CAM_RESOLUTION_ARRAY r_cam_video_resolution_array + { + resolutions = + { + // SubQCIF video (SubQCIF viewfinder) + CAM_RESOLUTION + { + width = 128; + height = 96; + }, + // QCIF video (QCIF viewfinder) + CAM_RESOLUTION + { + width = 176; + height = 144; + }, + // CIF video + CAM_RESOLUTION + { + width = 352; + height = 288; + }, + // VGA video + CAM_RESOLUTION + { + width = 640; + height = 480; + }, + // QVGA video + CAM_RESOLUTION + { + width = 320; + height = 240; + }, + // nHD video + CAM_RESOLUTION + { + width = 640; + height = 352; + }, + // WVGA video + CAM_RESOLUTION + { + width = 864; + height = 480; + }, + // HD 720 video + CAM_RESOLUTION + { + width = 1280; + height = 720; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_set_as_ring_tone_interest +// This resource is used to register an interest in +// assinging video to Application InterWork (AIW) +// services +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_set_as_ring_tone_interest + { + items = + { + AIW_CRITERIA_ITEM // + { + id = KAiwCmdAssign; + serviceCmd = KAiwCmdAssign; + contentType = "*"; + serviceClass = KAiwClassMenu; + //maxProviders = 1; + loadOptions = AIW_OPTIONS_ROM_ONLY; + //defaultProvider = 0x10281F18; + } + }; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/CamVideoCaptureViewMode.ra --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/CamVideoCaptureViewMode.ra Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,693 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + + + +// --------------------------------------------------- +// +// r_cam_video_precap_remaining_time_viewmode +// Layout for remaining recording time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_precap_remaining_time_viewmode + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=KNaviPaneFontRightBorderVM; B=KNaviPaneFontBaseVM; W=36; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_precap_remaining_time_ah_viewmode +// Arabic/Hebrew layout for remaining recording time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_precap_remaining_time_ah_viewmode + { + font = EAknLogicalFontSecondaryFont; C=0; l=108; r=0; B=KNaviPaneFontBaseVM; W=36; J=ELayoutAlignLeft; + font = EAknLogicalFontSecondaryFont; C=0; r=15; B=KNaviPaneFontBaseVM; W=36; J=ELayoutAlignRight; + } + + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_elapsed_time_viewmode +// Layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_elapsed_time_viewmode + { + font = EAknLogicalFontSecondaryFont; C=35; l=0; r=460; B=KNaviPaneFontBaseVM; W=56; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_elapsed_time_ah_viewmode +// Arabic/Hebrew layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_elapsed_time_ah_viewmode + { + font = EAknLogicalFontSecondaryFont; C=35; l=470; r=0; B=KNaviPaneFontBaseVM; W=36; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_elapsed_time_viewmode +// Layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_elapsed_time_viewmode + { + font = EAknLogicalFontSecondaryFont; C=35; l=0; r=460; B=KNaviPaneFontBaseVM; W=56; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_elapsed_time_ah_viewmode +// Arabic/Hebrew layout for elapsed time in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_elapsed_time_ah_viewmode + { + font = EAknLogicalFontSecondaryFont; C=35; l=150; r=0; B=KNaviPaneFontBaseVM; W=36; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_video_size_layout +// Layout for video size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_size_layout_viewmode + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=KNaviPaneFontRightBorderVM; B=KNaviPaneFontBaseVM; W=36; J=ELayoutAlignRight; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_video_size_layout_ah_viewmode +// Layout for video size in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_size_layout_ah_viewmode + { + font = EAknLogicalFontSecondaryFont; C=0; r=KNaviPaneFontRightBorderVM; B=KNaviPaneFontBaseVM; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_progress_bar_viewmode +// Layout for progress bar during capture in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_progress_bar_viewmode + { + l=57; t=5; W=84; H=10; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_progress_bar_ah_viewmode +// Arabic/Hebrew layout for progress bar during capture in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_progress_bar_ah_viewmode + { + l=64; t=5; W=84; H=10; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_memory_location_viewmode +// Layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_memory_location_viewmode + { + l = 493; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limit_memory_location_ah_viewmode +// Arabic/Hebrew layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_limit_memory_location_ah_viewmode + { + l = 20; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimit_memory_location_viewmode +// Layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_memory_location_viewmode + { + l = 493; t = 5; W = 9; H = 11; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimit_memory_location_ah_viewmode +// Arabic/Hebrew layout rect for memory location icon while recording in navi pane progress. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_video_cap_unlimit_memory_location_ah_viewmode + { + l = 20; t = 5; W = 9; H = 11; + } + +//----------------------------------------------------------------------------- +// +// r_cam_recpause_indicator_layout_vid_main_rect_viewmode +// Layout rect for the recording and paused indicators in the main video pane. +// +//----------------------------------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_RECT r_cam_recpause_indicator_layout_vid_main_rect_viewmode + { + l=8; t=5; W=18; H=18; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_remaining_time_viewmode +// Layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_remaining_time_viewmode + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=24; B=KNaviPaneFontBaseVM; W=36; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_limited_remaining_time_ah_viewmode +// Arabic/Hebrew layout for remaining images in navi pane. +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_limited_remaining_time_ah_viewmode + { + font = EAknLogicalFontSecondaryFont; C=215; l=31; B=KNaviPaneFontBaseVM; J=ELayoutAlignLeft; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_remaining_time_viewmode +// Layout for remaining time in navi pane when the progress bar is not visible +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_remaining_time_viewmode + { + font = EAknLogicalFontSecondaryFont; C=215; l=0; r=24; B=KNaviPaneFontBaseVM; W=36; J=ELayoutAlignRight; + } + +// --------------------------------------------------- +// +// r_cam_video_cap_unlimited_remaining_time_ah_viewmode +// Arabic/Hebrew layout for remaining time in navi pane when the progress bar is not visible +// +// --------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_video_cap_unlimited_remaining_time_ah_viewmode + { + font = EAknLogicalFontSecondaryFont; C=215; l=31; B=KNaviPaneFontBaseVM; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_video_quality_slider_array_viewmode +// Legend data for the video quality slider +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_slider_array_viewmode + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 8; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_cif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_cif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 4; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_mp4; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_mp4_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 136; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_qcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_qcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 132; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 260; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_sqcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_sqcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 256; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_quality_slider_array_ah_viewmode +// Legend data for the video quality slider (Arabic/Hebrew) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_slider_array_ah_viewmode + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 8; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_cif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_cif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 4; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_mp4; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_mp4_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 136; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_qcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_qcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 132; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 260; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_sqcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_sqcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 256; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + } + }; + } + +/* +//---------------------------------------------------- +// +// r_cam_video_quality_slider_array_cam2_viewmode +// Legend data for the video quality slider ( for camera 2 ) +// +//---------------------------------------------------- +// +RESOURCE ARRAY r_cam_video_quality_slider_array_cam2_viewmode + { + items = + { + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 8; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_qcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_qcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 4; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 2; t = 260; W = 26; H = 22; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_res_sqcif; +// mask_id = EMbmCameraappQgn_indi_lcam_res_sqcif_mask; + }, + CAM_SLIDER_LEGEND_ITEM + { + item = ECamSliderLegendItemIcon; + position = AVKON_LAYOUT_RECT { l = 32; t = 56; W = 22; H = 32; }; +// bitmap_id = EMbmCameraappQgn_indi_lcam_vid_3gp; +// mask_id = EMbmCameraappQgn_indi_lcam_vid_3gp_mask; + } + }; + } +*/ + +//---------------------------------------------------- +// +// r_cam_post_capture_video_name_layout_viewmode +// Layout for video name in post-capture navi-counter +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_name_layout_viewmode + { + font = EAknLogicalFontSecondaryFont; C=0; l=0; r=86; B=-100; W=36; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_post_capture_video_name_layout_ah_viewmode +// Arabic/Hebrew layout for video name in post-capture +// navi-counter for secondary camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_LAYOUT_TEXT r_cam_post_capture_video_name_layout_ah_viewmode + { + font = ELatinPlain12; C=0; l=4; r=45; B=-100; W=59; J=ELayoutAlignLeft; + } + +//---------------------------------------------------- +// +// r_cam_video_pre_capture_view_viewmode +// Video pre-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_video_pre_capture_view_viewmode + { + menubar = r_cam_video_pre_capture_menubar_viewmode; + cba = r_cam_softkeys_options_exit; + } + +// --------------------------------------------------------- +// +// r_cam_video_pre_capture_menubar_viewmode +// Menubar for video pre-capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_pre_capture_menubar_viewmode + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_pre_capture_menu_viewmode; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_pre_capture_menu_viewmode +// Options menu for video pre capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_pre_capture_menu_viewmode + { + items = + { + MENU_ITEM + { + command = ECamCmdNewPhoto; + txt = qtn_lcam_options_photo_mode; + }, + MENU_ITEM + { + command = ECamCmdSettings; + txt = qtn_lcam_cmd_settings; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_post_capture_view +// Video post-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_cam_video_post_capture_view_viewmode + { + menubar = r_cam_video_post_capture_menubar_viewmode; + cba = r_cam_softkeys_back; + } + +// --------------------------------------------------------- +// +// r_cam_video_post_capture_menubar +// Menubar for video post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_cam_video_post_capture_menubar_viewmode + { + titles = + { + MENU_TITLE + { + menu_pane = r_cam_video_post_capture_menu_viewmode; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_post_capture_menu +// Options menu for video post capture view +// +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_cam_video_post_capture_menu_viewmode + { + items = + { + MENU_ITEM + { + command = ECamCmdNewVideo; + txt = qtn_lcam_options_new_video; + }, + MENU_ITEM + { + command = ECamCmdPlay; + txt = qtn_lcam_options_play; + }, + MENU_ITEM + { + command = ECamCmdDelete; + txt = qtn_lcam_options_delete; + }, + MENU_ITEM + { + command = ECamCmdSend; + txt = qtn_options_send_via; + }, + MENU_ITEM + { + command = ECamCmdSendToCallerMultimedia; + txt = qtn_lcam_options_send_to_call; + }, + MENU_ITEM + { + command = ECamCmdShareOnOvi; + // AIW provider fills the menu item title. + // No submenu, only 1 provider acccepted. + txt = ""; + }, + MENU_ITEM + { + command = EAknCmdHelp; + txt = qtn_options_help; + }, + MENU_ITEM + { + command = ECamCmdInternalExit; + txt = qtn_options_exit; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_limit_recording_icon_viewmode +// Recording icon during capture, limited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_limit_recording_icon_viewmode + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 17; + tl_y = 6; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_limit_recording_icon_ah_viewmode +// Recording icon during capture, limited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_limit_recording_icon_ah_viewmode + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 17; + tl_y = 6; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_unlimit_recording_icon_viewmode +// Recording icon during capture, unlimited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_unlimit_recording_icon_viewmode + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 17; + tl_y = 6; + width = 9; + height = 9; + } + }; + } + }; + } + +// --------------------------------------------------------- +// +// r_cam_video_cap_unlimit_recording_icon_ah_viewmode +// Recording icon during capture, unlimited feature +// +// --------------------------------------------------------- +// +RESOURCE CAM_DECORATIONS r_cam_video_cap_unlimit_recording_icon_ah_viewmode + { + decorations = + { + CAM_DECORATION + { + type = ECamScreenDecorationRecordingIcon; + decoration = + { + CAM_RECORDING_ICON + { + tl_x = 17; + tl_y = 6; + width = 9; + height = 9; + } + }; + } + }; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/resource_inc/camportraitnaviconstants.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/resource_inc/camportraitnaviconstants.rh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for the Camera Application* +*/ + + +#ifndef CAM_VIDEONAVICONSTANTS_RH +#define CAM_VIDEONAVICONSTANTS_RH + +#define KNaviPaneWidth 198 +#define KNaviPaneHeight 21 + +#define KNaviBottomClearance 5 +#define KNaviComponentClearance 2 + +//#define KTextBottomClearance 3 + +// Mem indicator right side coord, measured from parent (navipane) bottom right +#define KMemoryIconRight 1 +#define KMemoryIconWidth 10 // used to be 9 +#define KMemoryIconHeight 11 +// Remaining time right side, some clearance added +#define KRemainingTimeRight KMemoryIconRight + KMemoryIconWidth + KNaviComponentClearance +#define KRemainingTimeInCaptureWidth 28 +#define KRemainingTimePreCaptureWidth 36 +// Progress bar right side +#define KProgressBarRight KRemainingTimeRight + KRemainingTimeInCaptureWidth + KNaviComponentClearance +#define KProgressBarWidth 71 +#define KProgressBarHeight 10 +// Elapsed time right +#define KElapsedTimeRight KProgressBarRight + KProgressBarWidth + KNaviComponentClearance +#define KElapsedTimeInCaptureWidth 28 + +// Recording icon +#define KRecordingIconRight KElapsedTimeRight + KElapsedTimeInCaptureWidth + KNaviComponentClearance +#define KRecordingIconWidth 9 +#define KRecordingIconHeight 9 + +#endif + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/data/vgacamsettings.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/data/vgacamsettings.rss Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,3241 @@ +/* +* 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: Resource definitions for the Camera Application* +*/ + + +// RESOURCE IDENTIFIER +NAME NCSE // 4 letter ID, must be same as nhdcamsettings.rss ID + +#include // signature +#include // AVKON_LAYOUT_TEXT AVKON_NOTE +#include // R_AVKON_SOFTKEYS_EMPTY +#include // LOCALISABLE_APP_INFO +#include +#include // EAknsMajorGeneric +#include // For EStdKeyDevice3 +#include // For AIW_INTEREST +#include // EMbmCameraappQgn_* +#include +#include + + +#include "Cam.rh" // CAM_ENGINE_UPDATE +#include "CamConstantsCamcorder.hrh" +#include "CamConstantsViewMode.hrh" +#include "CamConstantsPortrait.hrh" + +// =========================================================================== +// Constants +#define KCamCaptureSoundFile1 "z:\\system\\sounds\\digital\\cameraappCapture1.wav" +#define KCamCaptureSoundFile2 "z:\\system\\sounds\\digital\\cameraappCapture2.wav" +#define KCamCaptureSoundFile3 "z:\\system\\sounds\\digital\\cameraappCapture3.wav" +#define KCamCaptureSoundFile4 "z:\\system\\sounds\\digital\\cameraappCapture4.wav" +#define KCamBurstCaptureSoundFile1 "z:\\system\\sounds\\digital\\cameraappCaptureShort1.wav" +#define KCamBurstCaptureSoundFile2 "z:\\system\\sounds\\digital\\cameraappCaptureShort2.wav" +#define KCamBurstCaptureSoundFile3 "z:\\system\\sounds\\digital\\cameraappCaptureShort3.wav" +#define KCamBurstCaptureSoundFile4 "z:\\system\\sounds\\digital\\cameraappCaptureShort4.wav" + +#define KCamStartSoundFile "z:\\system\\sounds\\digital\\cameraappStart.wav" +#define KCamStopSoundFile "z:\\system\\sounds\\digital\\cameraappStop.wav" +#define KCamPauseSoundFile "z:\\system\\sounds\\digital\\cameraappStop.wav" + +#define KCamAutoFocusSuccFile "z:\\system\\sounds\\digital\\cameraappFocusSucc.wav" + +#define CAMERAAPP_BITMAP_FILE "z:\\resource\\apps\\cameraapp.mif" + + + +// RESOURCE DEFINITIONS +RESOURCE RSS_SIGNATURE { } +RESOURCE TBUF { buf = "NCSE"; } + + +/******************************************** +* TBUF +*********************************************/ + +// --------------------------------------------------- +// +// r_cam_scene_title_auto +// Title of Auto scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_auto + { + buf = qtn_lcam_scene_auto_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_user +// Title of User scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_user + { + buf = qtn_lcam_scene_user_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_macro +// Title of Macro scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_macro + { + buf = qtn_lcam_scene_macro_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_landscape +// Title of Landscape scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_landscape + { + buf = qtn_lcam_scene_land_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_portrait +// Title of Portrait scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_portrait + { + buf = qtn_lcam_scene_port_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_text +// Title of Text scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_text + { + buf = qtn_lcam_scene_text; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_night +// Title of Night scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_night + { + buf = qtn_lcam_scene_night_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_sports +// Title of Sports scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_sports + { + buf = qtn_lcam_scene_sport_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_normal +// Title of Normal scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_normal + { + buf = qtn_lcam_scene_auto_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_night_landscape +// Title of Night Landscape scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_night_landscape + { + buf = qtn_lcam_scene_nightland_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_night_portrait +// Description of Night Portrait scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_night_portrait + { + buf = qtn_lcam_scene_nightport_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_title_candlelight +// Description of Candlelight scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_title_candlelight + { + buf = qtn_lcam_scene_candle; + } + +/************************************** +* Explanation text TBUF * +**************************************/ + +// --------------------------------------------------- +// +// r_cam_scene_title_auto +// Description of Auto scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_auto + { + buf = qtn_lcam_scene_auto_ex_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_user +// Description of User scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_user + { + buf = qtn_lcam_scene_user_ex_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_macro +// Description of macro scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_macro + { + buf = qtn_lcam_scene_macro_ex_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_landscape +// Description of Landscape scene in scene settings view +// this is used when autofocus is not supported +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_landscape + { + buf = qtn_lcam_scene_land2_ex_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_landscape_autofocus +// Description of Landscape scene in scene settings view +// this is used when autofocus is supported +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_landscape_autofocus + { + buf = qtn_lcam_scene_land_ex_v2; + } + + +// --------------------------------------------------- +// +// r_cam_scene_description_portrait +// Description of Portrait scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_portrait + { + buf = qtn_lcam_scene_port2_ex_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_text +// Description of Text scene in scene settings view +// +// --------------------------------------------------- +// + +RESOURCE TBUF r_cam_scene_description_text + { + buf = qtn_lcam_scene_text_ex_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_night +// Description of Night scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_night + { + buf = qtn_lcam_scene_night_ex_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_sports +// Description of Sports scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_sports + { + buf = qtn_lcam_scene_sport_ex_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_normal +// Description of Normal scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_normal + { + buf = qtn_lcam_scene_normal_ex_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_night_landscape +// Description of Night Landscape scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_night_landscape + { + buf = qtn_lcam_scene_nightland_ex_v2; + } + +// --------------------------------------------------- +// +// r_cam_scene_description_night_portrait +// Description of Night Portrait scene in scene settings view +// +// --------------------------------------------------- +// +RESOURCE TBUF r_cam_scene_description_night_portrait + { + buf = qtn_lcam_scene_nightport_ex_v2; + } + + +/************************************** +* Other structures * +**************************************/ + +//---------------------------------------------------- +// +// r_cam_photo_user_scene_setup_list_scenebase_data +// The data for the scene base item in the +// photo user scene setup list +// +//---------------------------------------------------- +// +RESOURCE CAM_USER_SCENE_SETUP_LIST_ITEM_DATA r_cam_photo_user_scene_setup_list_scenebase_data + { + id = ECamSettingItemUserSceneBasedOnScene; + text = qtn_lcam_set_user_scene; + user_scene_setup_list_item_values = + { + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneNight; + text = qtn_lcam_user_scene_night_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneMacro; + text = qtn_lcam_user_scene_macro_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamScenePortrait; + text = qtn_lcam_user_scene_port_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneAuto; + text = qtn_lcam_user_scene_auto_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneScenery; + text = qtn_lcam_user_scene_land_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneSports; + text = qtn_lcam_user_scene_sport_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneNormal; + text = qtn_lcam_user_scene_auto_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneNightScenery; + text = qtn_lcam_scene_nightland_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneNightPortrait; + text = qtn_lcam_user_scene_nightport_v2; + }, + + CAM_USER_SCENE_SETUP_LIST_ITEM_VALUE + { + id = ECamSceneCandlelight; + text = qtn_lcam_scene_candle; // not used + } + + }; + } + +RESOURCE ARRAY r_cam_capture_setup_list_user_scene_shooting_mode + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_auto_v2; + setting_value_id = ECamSceneAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_macro_v2; + setting_value_id = ECamSceneMacro; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_closeup; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_macro_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_port_v2; + setting_value_id = ECamScenePortrait; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_portrait; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_port_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_land_v2; + setting_value_id = ECamSceneScenery; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_landscape; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_land_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_sport_v2; + setting_value_id = ECamSceneSports; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_sport; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_sport_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_night_v2; + setting_value_id = ECamSceneNight; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_night; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_night_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_user_scene_nightport_v2; + setting_value_id = ECamSceneNightPortrait; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_portrait_night; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_nightport_s; + } + }; + } + + +RESOURCE ARRAY r_cam_capture_setup_list_user_scene_shooting_mode_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneAuto; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_auto; + summary_title_text = qtn_lcam_scene_auto_v2; + summary_description_text = qtn_lcam_scene_auto_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_auto_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneMacro; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_closeup; + summary_title_text = qtn_lcam_scene_macro_v2; + summary_description_text = qtn_lcam_scene_macro_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_macro_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamScenePortrait; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_portrait; + summary_title_text = qtn_lcam_scene_port_v2; + summary_description_text = qtn_lcam_scene_port2_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_port_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneScenery; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_landscape; + summary_title_text = qtn_lcam_scene_land_v2; + // this is used when autofocus is not supported + summary_description_text = qtn_lcam_scene_land2_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_land_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneSports; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_sport; + summary_title_text = qtn_lcam_scene_sport_v2; + summary_description_text = qtn_lcam_scene_sport_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_sport_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNight; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_night; + summary_title_text = qtn_lcam_scene_night_v2; + summary_description_text = qtn_lcam_scene_night_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_night_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNightPortrait; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_portrait_night; + summary_title_text = qtn_lcam_scene_nightport_v2; + summary_description_text = qtn_lcam_scene_nightport_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_nightport_l; + } + }; + } + +RESOURCE ARRAY r_cam_capture_setup_list_photo_shooting_mode + { + items= + { + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_auto_v2; + setting_value_id = ECamSceneAuto; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_auto; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_auto_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_user_v2; + setting_value_id = ECamSceneUser; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_userscene; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_user_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_macro_v2; + setting_value_id = ECamSceneMacro; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_closeup; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_macro_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_port_v2; + setting_value_id = ECamScenePortrait; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_portrait; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_port_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_land_v2; + setting_value_id = ECamSceneScenery; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_landscape; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_land_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_sport_v2; + setting_value_id = ECamSceneSports; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_sport; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_sport_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_night_v2; + setting_value_id = ECamSceneNight; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_night; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_night_s; + }, + CAPTURE_SETUP_LIST_ITEM + { + item_text = qtn_lcam_scene_nightport_v2; + setting_value_id = ECamSceneNightPortrait; + bitmap_id = EMbmCameraappQgn_indi_cam4_mode_portrait_night; + //bitmap_id = EMbmCameraappQgn_ico_lcam_sce_nightport_s; + } + }; + } + +RESOURCE ARRAY r_cam_capture_setup_list_photo_shooting_mode_summary + { + items = + { + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneAuto; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_auto; + summary_title_text = qtn_lcam_scene_auto_v2; + summary_description_text = qtn_lcam_scene_auto_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_auto_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneUser; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_userscene; + summary_title_text = qtn_lcam_scene_user_v2; + summary_description_text = qtn_lcam_scene_user_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_user_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneMacro; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_closeup; + summary_title_text = qtn_lcam_scene_macro_v2; + summary_description_text = qtn_lcam_scene_macro_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_macro_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamScenePortrait; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_portrait; + summary_title_text = qtn_lcam_scene_port_v2; + summary_description_text = qtn_lcam_scene_port2_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_port_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneScenery; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_landscape; + summary_title_text = qtn_lcam_scene_land_v2; + // this is used when autofocus is not supported + summary_description_text = qtn_lcam_scene_land2_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_land_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneSports; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_sport; + summary_title_text = qtn_lcam_scene_sport_v2; + summary_description_text = qtn_lcam_scene_sport_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_sport_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNight; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_night; + summary_title_text = qtn_lcam_scene_night_v2; + summary_description_text = qtn_lcam_scene_night_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_night_l; + }, + CAM_MODE_SELECT_SUMMARY + { + setting_value_id = ECamSceneNightPortrait; + summary_icon = EMbmCameraappQgn_indi_cam4_mode_portrait_night; + summary_title_text = qtn_lcam_scene_nightport_v2; + summary_description_text = qtn_lcam_scene_nightport_ex_v2; + //summary_icon = EMbmCameraappQgn_ico_lcam_sce_nightport_l; + } + }; + } + +//////////////////////////////////////////// +// Common for both VGA and NHD resourses +//////////////////////////////////////////// + +//---------------------------------------------------- +// +// r_cam_namebase_video +// Base name for video files +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_namebase_video + { + buf = qtn_lcam_namebase_video; + } + + +//---------------------------------------------------- +// +// r_cam_namebase_image +// Base name for image files +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_namebase_image + { + buf = qtn_lcam_namebase_image; + } + + +//---------------------------------------------------- +// +// r_cam_generic_title_name +// Title name used in case of error +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_generic_title_name + { + buf = qtn_lcam_title_text_camera; + } + + +//---------------------------------------------------- +// +// r_cam_camera_subfolder +// Camera specific subfolder +// +//---------------------------------------------------- +// +RESOURCE TBUF r_cam_camera_subfolder + { + buf = qtn_lcam_camera_subfolder; + } + + +//---------------------------------------------------- +// +// r_cam_sound_list +// Sound info list containing the Camera sounds +// +//---------------------------------------------------- +// +RESOURCE AVKON_SOUND_INFO_LIST r_cam_sound_list + { + list = + { + // Still image snap sounds + AVKON_SOUND_INFO + { + sid = ECamStillCaptureSoundId1; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamCaptureSoundFile1; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamStillCaptureSoundId2; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamCaptureSoundFile2; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamStillCaptureSoundId3; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamCaptureSoundFile3; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamStillCaptureSoundId4; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamCaptureSoundFile4; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamVideoStartSoundId; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamStartSoundFile; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamVideoStopSoundId; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamStopSoundFile; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamVideoPauseSoundId; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamPauseSoundFile; + volume = 5; + }, + AVKON_SOUND_INFO + { + sid = ECamAutoFocusComplete; + priority = EAvkonKeyClickPriority; + preference = EAknAudioPrefCamera; + file = KCamAutoFocusSuccFile; + volume = 5; + }, + // Self-timer beep + AVKON_SOUND_INFO + { + sid = ECamSelfTimerSoundId; + priority = EAvkonAlarmTonesPriority; + preference = EAknAudioPrefDefaultTone; + sequencelength = 6; + sequence = { 0, 17, 6, 118, 10, 11 }; + volume = 9; + } + + }; + } + +//---------------------------------------------------- +// +// r_cam_silent_ok_key_list +// Sound key list to disable selection key sound +// +//---------------------------------------------------- +// +RESOURCE AVKON_SKEY_LIST r_cam_silent_ok_key_list + { + list= + { + AVKON_SKEY_INFO + { + key = EStdKeyDevice3; + sid = EAvkonSIDNoSound; + }, + AVKON_SKEY_INFO + { + key = EStdKeyDevice3; + sid = EAvkonSIDNoSound; + type = ESKeyTypeLong; + }, + AVKON_SKEY_INFO + { + key = EStdKeyDevice3; + sid = EAvkonSIDNoSound; + type = ESKeyTypeRepeat; + }, + AVKON_SKEY_INFO + { + key = EStdKeyUpArrow; + sid = EAvkonSIDNoSound; + type = ESKeyTypeRepeat; + }, + AVKON_SKEY_INFO + { + key = EStdKeyUpArrow; + sid = EAvkonSIDNoSound; + type = ESKeyTypeLong; + }, + AVKON_SKEY_INFO + { + key = EStdKeyDownArrow; + sid = EAvkonSIDNoSound; + type = ESKeyTypeRepeat; + }, + AVKON_SKEY_INFO + { + key = EStdKeyDownArrow; + sid = EAvkonSIDNoSound; + type = ESKeyTypeLong; + } + }; + } + +//---------------------------------------------------- +// +// Button state extensions for toolbar and toolbar extension buttons. +// These is required to support skinned graphics for the buttons. +// +//---------------------------------------------------- +// + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_capture + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbCapture; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_video + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4Video; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_mode_camera + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4ModeCamera; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_record + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbRecord; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_camera + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4Camera; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_capture + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4Capture; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_autoflash + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4Autoflash; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_goto_photos + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4GotoGallery; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_add_to_album + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbAddToAlbum; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_send + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbSend; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_delete + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbDelete; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_light_off + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbLightOff; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_play + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbPlay; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_goto_photos + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbGotoGallery; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_upload + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbUpload; + } + +RESOURCE AVKON_BUTTON_STATE_EXTENSION r_cam_ext_qgn_indi_cam4_tb_mark + { + bmbSkinIdMajor = EAknsMajorGeneric; + bmbSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbMark; + } + +//---------------------------------------------------- +// +// r_cam_still_precapture_toolbar_portrait +// Toolbar for still pre-capture view for secondary +// camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_precapture_toolbar_portrait + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureImage; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_capture; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_capture_mask; + helptxt = qtn_lcam_tt_capture; + extension = r_cam_ext_qgn_indi_cam4_tb_capture; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewVideo; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_video; + bmpmask = EMbmCameraappQgn_indi_cam4_video_mask; + helptxt = qtn_lcam_tt_video_mode; + extension = r_cam_ext_qgn_indi_cam4_video; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSwitchCamera; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_tb_cam4_goto_main; + bmpmask = EMbmCameraappQgn_indi_tb_cam4_goto_main_mask; + helptxt = qtn_lcam_tt_camera_main; + extension = r_cam_ext_qgn_indi_cam4_mode_camera; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_precapture_toolbar_landscape +// Toolbar for still pre-capture view for secondary +// camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_precapture_toolbar_landscape + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureImage; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_capture; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_capture_mask; + helptxt = qtn_lcam_tt_capture; + extension = r_cam_ext_qgn_indi_cam4_tb_capture; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_video; + bmpmask = EMbmCameraappQgn_indi_cam4_video_mask; + helptxt = qtn_lcam_tt_video_mode; + extension = r_cam_ext_qgn_indi_cam4_video; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSwitchCamera; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_tb_cam4_goto_main; + bmpmask = EMbmCameraappQgn_indi_tb_cam4_goto_main_mask; + helptxt = qtn_lcam_tt_camera_main; + extension = r_cam_ext_qgn_indi_cam4_mode_camera; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_precapture_toolbar_portrait +// Toolbar and toolbar extension for video pre-capture view for secondary +// camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_precapture_toolbar_portrait + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdRecord; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_record; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_record_mask; + helptxt = qtn_lcam_tt_record; + extension = r_cam_ext_qgn_indi_cam4_tb_record; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewPhoto; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_camera; + bmpmask = EMbmCameraappQgn_indi_cam4_camera_mask; + helptxt = qtn_lcam_tt_still_mode; + extension = r_cam_ext_qgn_indi_cam4_camera; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSwitchCamera; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_tb_cam4_goto_main; + bmpmask = EMbmCameraappQgn_indi_tb_cam4_goto_main_mask; + helptxt = qtn_lcam_tt_camera_main; + extension = r_cam_ext_qgn_indi_cam4_mode_camera; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_video_precapture_toolbar_landscape +// Toolbar and toolbar extension for video pre-capture view for secondary +// camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_precapture_toolbar_landscape + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdRecord; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_record; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_record_mask; + helptxt = qtn_lcam_tt_record; + extension = r_cam_ext_qgn_indi_cam4_tb_record; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewPhoto; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_camera; + bmpmask = EMbmCameraappQgn_indi_cam4_camera_mask; + helptxt = qtn_lcam_tt_still_mode; + extension = r_cam_ext_qgn_indi_cam4_camera; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSwitchCamera; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_tb_cam4_goto_main; + bmpmask = EMbmCameraappQgn_indi_tb_cam4_goto_main_mask; + helptxt = qtn_lcam_tt_camera_main; + extension = r_cam_ext_qgn_indi_cam4_mode_camera; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_still_precapture_toolbar +// Toolbar and toolbar extension for still pre-capture view for primary +// camera +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_precapture_toolbar + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode | KAknToolbarNoBackground | KAknToolbarTransparent; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureImage; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_capture; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_capture_mask; + helptxt = qtn_lcam_tt_capture; + extension = r_cam_ext_qgn_indi_cam4_tb_capture; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupFlashStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_autoflash; + bmpmask = EMbmCameraappQgn_indi_cam4_autoflash_mask; + helptxt = qtn_lcam_tt_flash; + extension = r_cam_ext_qgn_indi_cam4_autoflash; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtToolbarExtension; + id = ECamCmdToolbarExtension; + + control = AVKON_TOOLBAR_EXTENSION + { + flags = KAknToolbarDsaMode | KAknButtonNoFrame; + helptxt = qtn_lcam_tt_open_extension; + + bmpFile = CAMERAAPP_BITMAP_FILE; + + bmpId = EMbmCameraappQgn_indi_cam4_tb_extension; + bmpMask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + bmpSkinIdMajor = EAknsMajorGeneric; + bmpSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + dimBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + dimBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + dimSkinIdMajor = EAknsMajorGeneric; + dimSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + pressBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + pressBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + pressSkinIdMajor = EAknsMajorGeneric; + pressSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupSceneStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_scenes; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdToggleFacetracking; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_facedet_on; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdViewfinderGrid; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_show_viewfinder_grid; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupSelfTimer; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_st; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupColourFilterStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_coltone; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupWhiteBalanceStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_wb; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupExposureStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_ev; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupLightSensitivityStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_isosetting; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupContrastStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_contr; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupImageSharpnessStill; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_sharp; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdTimeLapseSlider; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = ""; // only used with nhd + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_goto_gallery_mask; + txt = qtn_lcam_tb_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_goto_photos; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_video; + bmpmask = EMbmCameraappQgn_indi_cam4_video_mask; + txt = qtn_lcam_tb_switch_video_mode; + extension = r_cam_ext_qgn_indi_cam4_video; + } + }; + }; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar +// Toolbar and toolbar extension for still post-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarTransparent | KAknToolbarNoBackground; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_goto_gallery_mask; + helptxt = qtn_lcam_tt_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_tb_goto_photos; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar_upload +// Toolbar and toolbar extension for still post-capture view +// with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarTransparent | KAknToolbarNoBackground; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar_portrait +// Toolbar and toolbar extension for still post-capture +// portrait view +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar_portrait + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_goto_gallery_mask; + helptxt = qtn_lcam_tt_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_tb_goto_photos; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar_landscape +// Toolbar and toolbar extension for still post-capture +// portrait view +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar_landscape + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_goto_gallery_mask; + helptxt = qtn_lcam_tt_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_tb_goto_photos; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar_portrait_upload +// Toolbar and toolbar extension for still post-capture +// portrait view with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar_portrait_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_still_postcapture_toolbar_landscape_upload +// Toolbar and toolbar extension for still post-capture +// portrait view with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_still_postcapture_toolbar_landscape_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_video_precapture_toolbar_videolight +// Toolbar and toolbar extension for video pre-capture view for primary +// camera when using non-widescreen resolution +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_precapture_toolbar_videolight + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdRecord; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_record; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_record_mask; + helptxt = qtn_lcam_tt_start_video_rec; + extension = r_cam_ext_qgn_indi_cam4_tb_record; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdToggleVideoFlash; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_light_off; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_light_off_mask; + helptxt = qtn_lcam_tt_videoflash; + extension = r_cam_ext_qgn_indi_cam4_light_off; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtToolbarExtension; + id = ECamCmdToolbarExtension; + + control = AVKON_TOOLBAR_EXTENSION + { + flags = KAknToolbarDsaMode | KAknButtonNoFrame; + helptxt = qtn_lcam_tt_open_extension; + + bmpFile = CAMERAAPP_BITMAP_FILE; + + bmpId = EMbmCameraappQgn_indi_cam4_tb_extension; + bmpMask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + bmpSkinIdMajor = EAknsMajorGeneric; + bmpSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + dimBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + dimBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + dimSkinIdMajor = EAknsMajorGeneric; + dimSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + pressBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + pressBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + pressSkinIdMajor = EAknsMajorGeneric; + pressSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupSceneVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_scenes; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewPhoto; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_camera; + bmpmask = EMbmCameraappQgn_indi_cam4_camera_mask; + txt = qtn_lcam_tb_switch_mode; + extension = r_cam_ext_qgn_indi_cam4_camera; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupWhiteBalanceVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_wb; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupColourFilterVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_coltone; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_goto_gallery_mask; + txt = qtn_lcam_tb_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_goto_photos; + } + }; + }; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_precapture_toolbar +// Toolbar and toolbar extension for video pre-capture view for primary +// camera when using non-widescreen resolution +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_precapture_toolbar + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode | KAknToolbarNoBackground | KAknToolbarTransparent; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdRecord; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_record; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_record_mask; + helptxt = qtn_lcam_tt_start_video_rec; + extension = r_cam_ext_qgn_indi_cam4_tb_record; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupSceneVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + //txt = qtn_lcam_tb_scenes; + helptxt = qtn_lcam_tt_goto_scenemode_settings; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtToolbarExtension; + id = ECamCmdToolbarExtension; + + control = AVKON_TOOLBAR_EXTENSION + { + flags = KAknToolbarDsaMode | KAknButtonNoFrame; + helptxt = qtn_lcam_tt_open_extension; + + bmpFile = CAMERAAPP_BITMAP_FILE; + + bmpId = EMbmCameraappQgn_indi_cam4_tb_extension; + bmpMask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + bmpSkinIdMajor = EAknsMajorGeneric; + bmpSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + dimBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + dimBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + dimSkinIdMajor = EAknsMajorGeneric; + dimSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + pressBmpid = EMbmCameraappQgn_indi_cam4_tb_extension; + pressBmpmask = EMbmCameraappQgn_indi_cam4_tb_extension_mask; + pressSkinIdMajor = EAknsMajorGeneric; + pressSkinIdMinor = EAknsMinorGenericQgnIndiCam4TbExtension; + + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdNewPhoto; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_camera; + bmpmask = EMbmCameraappQgn_indi_cam4_camera_mask; + txt = qtn_lcam_tb_switch_mode; + extension = r_cam_ext_qgn_indi_cam4_camera; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupWhiteBalanceVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_wb; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdCaptureSetupColourFilterVideo; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + txt = qtn_lcam_tb_coltone; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPhotos; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_goto_gallery; + bmpmask = EMbmCameraappQgn_indi_cam4_goto_gallery_mask; + txt = qtn_lcam_tb_go_to_photos; + extension = r_cam_ext_qgn_indi_cam4_goto_photos; + } + }; + }; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar +// Toolbar and toolbar extension for video post-capture view +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarTransparent | KAknToolbarNoBackground; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar_upload +// Toolbar and toolbar extension for video post-capture view +// with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarTransparent | KAknToolbarNoBackground; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar_portrait +// Toolbar and toolbar extension for video post-capture +// portrait view +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar_portrait + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar_landscape +// Toolbar and toolbar extension for video post-capture +// portrait view +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar_landscape + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar_portrait_upload +// Toolbar and toolbar extension for video post-capture +// portrait view with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar_portrait_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_video_postcapture_toolbar_landscape_upload +// Toolbar and toolbar extension for video post-capture +// portrait view with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_video_postcapture_toolbar_landscape_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarDsaMode; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdPlay; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_play; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_play; + helptxt = qtn_lcam_tt_play; + extension = r_cam_ext_qgn_indi_cam4_tb_play; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + flags = KAknButtonNoFrame; + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_cam_empty_fixed_toolbar +// Toolbar for views that do not have any content for fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_empty_fixed_toolbar + { + lines = 0; + flags = KAknToolbarFixed | KAknToolbarWithoutCba; + items = + { + }; + } + + +//---------------------------------------------------- +// +// r_cam_burst_postcapture_toolbar +// Toolbar for sequence post-capture thumbnail view +// +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_burst_postcapture_toolbar + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarNoBackground; + items = + { + + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdToolbarMarkUnmark; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_mark; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_mark_mask; + helptxt = qtn_lcam_tt_mark_unmark; + extension = r_cam_ext_qgn_indi_cam4_tb_mark; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdSend; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_send; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_send_mask; + helptxt = qtn_lcam_tt_send; + extension = r_cam_ext_qgn_indi_cam4_send; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + +//---------------------------------------------------- +// +// r_cam_burst_postcapture_toolbar_upload +// Toolbar for sequence post-capture thumbnail view +// with one-click upload support +//---------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_cam_burst_postcapture_toolbar_upload + { + lines = 3; + flags = KAknToolbarFixed | KAknToolbarNoBackground; + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdToolbarMarkUnmark; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_mark; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_mark_mask; + helptxt = qtn_lcam_tt_mark_unmark; + extension = r_cam_ext_qgn_indi_cam4_tb_mark; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdOneClickUpload; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_upload; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_upload_mask; + helptxt = ""; // Tooltip is set at run-time + extension = r_cam_ext_qgn_indi_cam4_tb_upload; + } + }; + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = ECamCmdDelete; + control = AVKON_BUTTON + { + states = + { + AVKON_BUTTON_STATE + { + bmpfile = CAMERAAPP_BITMAP_FILE; + bmpid = EMbmCameraappQgn_indi_cam4_tb_delete; + bmpmask = EMbmCameraappQgn_indi_cam4_tb_delete_mask; + helptxt = qtn_lcam_tt_delete; + extension = r_cam_ext_qgn_indi_cam4_delete; + } + }; + }; + } + }; + } + + +//---------------------------------------------------- +// +// r_qtn_lcam_tb_show_viewfinder_grid +// Text for the 'show grid' button in toolbar extension +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tb_show_viewfinder_grid + { + buf = qtn_lcam_tb_show_viewfinder_grid; + } + +//---------------------------------------------------- +// +// r_qtn_lcam_tb_hide_viewfinder_grid +// Text for the 'hide grid' button in toolbar extension +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tb_hide_viewfinder_grid + { + buf = qtn_lcam_tb_hide_viewfinder_grid; + } + +//---------------------------------------------------- +// +// r_qtn_lcam_tt_videoflash +// Tooltip for the video button in fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tt_videoflash + { + buf = qtn_lcam_tt_videoflash; // "Switch video light on" + } + +//---------------------------------------------------- +// +// r_qtn_lcam_tt_videoflash +// Tooltip for the video button in fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tt_flashoff + { + buf = qtn_lcam_tt_flashoff; // "Switch video light off" + } + +//---------------------------------------------------- +// +// qtn_lcam_tt_sendtocall +// Tooltip for the send button in fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tt_sendtocall + { + buf = qtn_lcam_tt_sendtocall; // "Send to caller" + } + +//---------------------------------------------------- +// +// qtn_lcam_tt_send +// Tooltip for the send button in fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tt_send + { + buf = qtn_lcam_tt_send; // "Send" + } + +//---------------------------------------------------- +// +// r_cam_one_click_upload_interest +// AIW interest for one-click upload +// +//---------------------------------------------------- +// +RESOURCE AIW_INTEREST r_cam_one_click_upload_interest + { + items= + { + AIW_CRITERIA_ITEM + { + id = KAiwCmdUpload; + serviceCmd = KAiwCmdUpload; + serviceClass = KAiwClassBase; + contentType = "image/*"; + defaultProvider = 0x2000BB53; //KShareAppUidVal; + maxProviders = 1; + } + }; + } +//---------------------------------------------------- +// +// qtn_lcam_tb_turn_sequence_off +// Text for sequence mode button in toolbar extension +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tb_turn_sequence_off + { + buf = ""; // this string is only used with nhd layouts + } + +//---------------------------------------------------- +// +// qtn_lcam_tb_turn_sequence_on +// Tooltip for the send button in fixed toolbar +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tb_turn_sequence_on + { + buf = ""; // this string is only used with nhd layouts + } + +//---------------------------------------------------- +// +// qtn_lcam_tb_sequence +// Text for sequence mode button in toolbar extension +// +//---------------------------------------------------- +// +RESOURCE TBUF r_qtn_lcam_tb_sequence + { + buf = ""; // this string is only used with nhd layouts + } + +//----------------------------------------------------------------------------- +// +// r_qtn_processing_image +// Processing image text, displayed on blended background in the bottom of +// thescreen in pre- and postcapture view. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_processing_image_text + { + buf = qtn_lcam_note_processing_image_v2; + } + +//----------------------------------------------------------------------------- +// +// r_qtn_processing_burst_image_text +// Processing images text with numbers, displayed on blended background in the bottom of +// thescreen in pre- and postcapture view. +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_processing_burst_image_text + { + buf = qtn_lcam_note_processing_images_v2; + } + +//----------------------------------------------------------------------------- +// +// r_qtn_fldr_cant_delete_file_open +// Error string that's used when trying to delete file that's already is use. +// Uses string defined in avkon.loc +// +//----------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_fldr_cant_delete_file_open + { + buf = qtn_fldr_cant_delete_file_open; + } + +#include "CamConstantsCamcorder.hrh" +#include "CamConstantsViewMode.hrh" +#include "CamConstantsPortrait.hrh" + +// the Settings pages are in separate files for clarity +#include "CamProductSpecificSettings.ra" // Resources for photo and video settings +#include "CamSettingsV2.ra" + +#include "CamAppWideV2.ra" +#include "CamAppWideCamcorder.ra" +#include "CamAppWidePortrait.ra" +#include "CamAppWideViewMode.ra" + +#include "CamCapture.ra" +#include "CamCaptureCamcorder.ra" +#include "CamCapturePortrait.ra" +#include "CamCaptureViewMode.ra" +#include "CamCaptureCamcorderLeft.ra" + +#include "CamStillCaptureV2.ra" +#include "CamStillCaptureCamcorder.ra" +#include "CamStillCapturePortrait.ra" +#include "CamStillCaptureViewMode.ra" +#include "CamStillCaptureCamcorderLeft.ra" + +#include "CamVideoCaptureV2.ra" +#include "CamVideoCaptureCamcorder.ra" +#include "CamVideoCapturePortrait.ra" +#include "CamVideoCaptureViewMode.ra" +#include "CamVideoCaptureCamcorderLeft.ra" + +#include "CamBurstCaptureV2.ra" + +#include "CamCaptureSetupV2.ra" + +#include "CamSceneSetupV2.ra" +#include "CamSceneSetupCamcorder.ra" +#include "CamSceneSetupPortrait.ra" +#include "CamSceneSetupViewMode.ra" + +#include "CamStandby.ra" + +#include "CamEmbedded.ra" +#include "CamEmbeddedCamcorder.ra" +#include "CamEmbeddedPortrait.ra" +#include "CamEmbeddedViewMode.ra" + +#include "CamModeSelectV2.ra" + +#include "CamActivePalette.ra" + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/dummyengine/CameraappDummyCallbackActive.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/dummyengine/CameraappDummyCallbackActive.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,396 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dummy callback active object class for Cameraapp Unit Tests* +*/ + + + +// INCLUDE FILES +#include "CameraappDummyCallbackActive.h" +#include "CameraappTestBitmapManager.h" +#include + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCameraappDummyCallbackActive::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCameraappDummyCallbackActive* CCameraappDummyCallbackActive::NewL( + MCamAppEngineObserver& aController ) + { + CCameraappDummyCallbackActive* self = new( ELeave ) CCameraappDummyCallbackActive( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +CCameraappDummyCallbackActive::~CCameraappDummyCallbackActive() + { + delete iBitmapManager; + } + +void CCameraappDummyCallbackActive::Cancel() + { + CActive::Cancel(); + DoCancel(); + } + +void CCameraappDummyCallbackActive::SetBurstObserver( MCaeStillBurstObserver* aBurstObserver ) + { + iBurstObserver = aBurstObserver; + } + +CCameraappDummyCallbackActive::CCameraappDummyCallbackActive( + MCamAppEngineObserver& aController ) + : CActive( EPriorityLow ), + iController( aController ) + { + } + +void CCameraappDummyCallbackActive::InitComplete( ) + { + iInitComplete = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +void CCameraappDummyCallbackActive::StillPrepareComplete( ) + { + iStillPrepareComplete = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +void CCameraappDummyCallbackActive::VideoPrepareComplete( ) + { + iVideoPrepareComplete = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +void CCameraappDummyCallbackActive::SendViewFinderFrames( ) + { + iViewFinderFrame = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +void CCameraappDummyCallbackActive::StopViewFinderFrames() + { + iViewFinderFrame = EFalse; + } + +void CCameraappDummyCallbackActive::CaptureStill() + { + iCaptureStill = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +void CCameraappDummyCallbackActive::CaptureBurst( TInt aImageCount ) + { + iStopBurst = EFalse; + iCaptureBurst = ETrue; + iBurstCount = aImageCount; + iBurstCaptureImage = 0; + iBurstSnapImage = 0; + iCompletedBurst = 0; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +void CCameraappDummyCallbackActive::StopBurst() + { + iStopBurst = ETrue; + } + +void CCameraappDummyCallbackActive::VideoRecordingStopped() + { + iVideoStopped = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +void CCameraappDummyCallbackActive::VideoRecordingPaused() + { + iVideoPaused = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +void CCameraappDummyCallbackActive::VideoRecordingResumed() + { + iVideoResumed = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +void CCameraappDummyCallbackActive::SetActiveAndCompleteRequest() + { + SetActive(); + TRequestStatus* statusPtr = &iStatus; + User::RequestComplete( statusPtr, KErrNone ); + } + +void CCameraappDummyCallbackActive::DoInitComplete( ) + { + iController.McaeoInitComplete( KErrNone ); + iInitComplete = EFalse; + } + +// ----------------------------------------------------------------------------- +// CCameraappDummyCallbackActive::StillPrepareComplete +// Prepare CCamAppControllerBase and CamAppEngine for current mode +// ----------------------------------------------------------------------------- +// +void CCameraappDummyCallbackActive::DoStillPrepareComplete() + { + iController.McaeoStillPrepareComplete( KErrNone ); + iStillPrepareComplete = EFalse; + } + +// ----------------------------------------------------------------------------- +// CCameraappDummyCallbackActive::VideoPrepareComplete +// Prepare CCamAppControllerBase and CamAppEngine for current mode +// ----------------------------------------------------------------------------- +// +void CCameraappDummyCallbackActive::DoVideoPrepareComplete() + { + iController.McaeoVideoPrepareComplete( KErrNone ); + + TTimeIntervalMicroSeconds timeElapsed( 1 ); + TTimeIntervalMicroSeconds timeRem( 100000000 ); + iController.McaeoVideoRecordingTimes( timeElapsed, timeRem, KErrNone ); + iVideoPrepareComplete = EFalse; + } + +// ----------------------------------------------------------------------------- +// CCameraappDummyCallbackActive::ViewFinderFrame +// Start the viewfinder +// ----------------------------------------------------------------------------- +// +void CCameraappDummyCallbackActive::DoViewFinderFrame() + { + iController.McaeoViewFinderFrameReady( iBitmapManager->NextBitmap(), KErrNone ); + if ( iViewFinderFrame ) + { + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + } + +void CCameraappDummyCallbackActive::DoCaptureStillL() + { + iCaptureStill = EFalse; + iController.McaeoSnapImageReady( iBitmapManager->Bitmap( 2 ), KErrNone ); + HBufC8* testData = HBufC8::NewL( KTestData( ).Length() ); + testData->Des().Copy( KTestData ); + // ownership of testData transferred to iController + iController.McaeoStillImageReady( NULL, testData, KErrNone ); + } + +void CCameraappDummyCallbackActive::DoCaptureBurstL() + { + if ( !iBurstObserver ) + { + return; + } + // if we are still taking burst images + if ( iBurstCaptureImage < iBurstCount ) + { + if ( iStopBurst ) + { + iBurstCount = iBurstCaptureImage; + } + else + { + iBurstObserver->McaesboStillBurstCaptureMoment( KErrNone ); + if (!iStopBurst ) + { + iBurstCaptureImage++; + } + } + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + // if we are sending back snap images + else if ( iBurstSnapImage < iBurstCount ) + { + iBurstSnapImage++; + iController.McaeoSnapImageReady( iBitmapManager->Bitmap( 2 ), KErrNone ); + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + // if we are sending back still images + else if ( iCompletedBurst < iBurstCount ) + { + iCompletedBurst++; + // ownership of testData transferred to iController + HBufC8* testData = HBufC8::NewL( KTestData( ).Length() ); + testData->Des().Copy( KTestData ); + iController.McaeoStillImageReady( NULL, testData, KErrNone ); + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + else // all finished + { + iCaptureBurst = EFalse; + iBurstObserver->McaesboStillBurstComplete( iBurstCount, KErrNone ); + iBurstCount = 0; + iCompletedBurst = 0; + iBurstSnapImage = 0; + iBurstCaptureImage = 0; + } + } + +void CCameraappDummyCallbackActive::DoVideoPaused() + { + iVideoPaused = EFalse; + iController.McaeoVideoRecordingPaused( KErrNone ); + } + +void CCameraappDummyCallbackActive::DoVideoResumed() + { + iVideoResumed = EFalse; + iController.McaeoVideoRecordingOn( KErrNone ); + } + +void CCameraappDummyCallbackActive::DoVideoStopped() + { + iVideoStopped = EFalse; + iController.McaeoVideoRecordingComplete( KErrNone ); + } + +void CCameraappDummyCallbackActive::ConstructL() + { + CActiveScheduler::Add( this ); + iBitmapManager = CCameraappTestBitmapManager::NewL(); + } + +// ----------------------------------------------------------------------------- +// CCameraappDummyCallbackActive::DoCancel +// Cancels the active object +// ----------------------------------------------------------------------------- +// +void CCameraappDummyCallbackActive::DoCancel() + { + iInitComplete = EFalse; + iStillPrepareComplete = EFalse; + iVideoPrepareComplete = EFalse; + iViewFinderFrame = EFalse; + iVideoPaused = EFalse; + iVideoResumed = EFalse; + } + +void CCameraappDummyCallbackActive::RunL() + { + if ( iInitComplete ) + { + DoInitComplete(); + } + else if ( iStillPrepareComplete ) + { + DoStillPrepareComplete(); + } + else if ( iVideoPrepareComplete ) + { + DoVideoPrepareComplete(); + } + else if ( iCaptureStill ) + { + DoCaptureStillL(); + } + else if ( iCaptureBurst ) + { + DoCaptureBurstL(); + } + else if ( iVideoPaused ) + { + DoVideoPaused(); + } + else if ( iVideoResumed ) + { + DoVideoResumed(); + } + else if ( iVideoStopped ) + { + DoVideoStopped(); + } + else + { + } + + if ( iViewFinderFrame ) + { + DoViewFinderFrame(); + } + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/dummyengine/CameraappDummyEngine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/dummyengine/CameraappDummyEngine.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,390 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera Application Engine implementation still capturing,* +*/ + + + +// INCLUDE FILES + +#include +#include "CameraappDummyEngine.h" // Engine implementation header. +#include "CamLogger.h" +#include "CameraappDummyCallbackActive.h" + + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CCaeEngine::NewL +// Two-phased constructor. Calls CCaeEngineImp's NewL(). +// ----------------------------------------------------------------------------- +// +CCaeEngine* CCameraappDummyEngine::NewL() + { + return CCameraappDummyEngineImp::NewL(); + } + + +// ----------------------------------------------------------------------------- +// CCameraappDummyEngineImp::CCameraappDummyEngineImp +// Default constructor. +// ----------------------------------------------------------------------------- +// +CCameraappDummyEngineImp::CCameraappDummyEngineImp() + { + } + +void CCameraappDummyEngineImp::SetCamAppEngineObserver( MCamAppEngineObserver& aObserver ) + { + iObserver = &aObserver; + if ( !iCallBackActive ) + { + TRAPD( ignore, iCallBackActive = CCameraappDummyCallbackActive::NewL( *iObserver ) ) + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + } + } + +// ----------------------------------------------------------------------------- +// CCameraappDummyEngineImp::~CCameraappDummyEngineImp +// Destructor. +// ----------------------------------------------------------------------------- +// +CCameraappDummyEngineImp::~CCameraappDummyEngineImp() + { + if ( iCallBackActive ) + { + iCallBackActive->Cancel(); + delete iCallBackActive; + } + } + +void CCameraappDummyEngineImp::InitL( TBool /*aCreateSnapImage*/ ) + { + if ( iCallBackActive ) + { + iCallBackActive->InitComplete(); + } + } + +void CCameraappDummyEngineImp::Reserve() + { + if ( iCallBackActive ) + { + iCallBackActive->InitComplete(); + } + } + +void CCameraappDummyEngineImp::StartViewFinderBitmapsL( TSize& /*aSize*/ ) + { + iIsViewFinding = ETrue; + if ( !iCallBackActive ) + { + iCallBackActive = CCameraappDummyCallbackActive::NewL( *iObserver ); + } + + if ( iCallBackActive ) + { + iCallBackActive->SendViewFinderFrames(); + } + } + +void CCameraappDummyEngineImp::StopViewFinder() + { + if ( iIsViewFinding ) + { + iIsViewFinding = EFalse; + if ( iCallBackActive ) + { + iCallBackActive->StopViewFinderFrames(); + } + } + } + +TBool CCameraappDummyEngineImp::IsViewFinding() const + { + return iIsViewFinding; + } + +void CCameraappDummyEngineImp::SetCaeStillBurstObserver( MCaeStillBurstObserver& aObserver ) + { + if ( iCallBackActive ) + { + iCallBackActive->SetBurstObserver( &aObserver ); + } + } + +void CCameraappDummyEngineImp::StopStillBurstCapture() + { + if ( iCallBackActive ) + { + iCallBackActive->StopBurst(); + } + } + + +TInt CCameraappDummyEngineImp::SetStillCaptureImageCountL( TInt aImageCount ) + { + iImageCount = aImageCount; + return KErrNone; + } + +void CCameraappDummyEngineImp::PrepareStillCaptureL( + const TSize& /*aSize*/, + CCamera::TFormat /*aFormat*/, + TInt /*aCompressionQuality*/, + const TRect& /*aCropRect*/, + TSize& /*aSnapSize*/ ) + { + iVideoPrepared = EFalse; + if ( iCallBackActive ) + { + iCallBackActive->StillPrepareComplete(); + } + } + +void CCameraappDummyEngineImp::CaptureStill() + { + if ( iImageCount < 1 || !iCallBackActive ) + { + return; + } + if ( iImageCount == 1 ) + { + iCallBackActive->CaptureStill(); + } + else + { + iCallBackActive->CaptureBurst( iImageCount ); + } + } + +void CCameraappDummyEngineImp::StopVideoRecording() + { + if ( iCallBackActive ) + { + iCallBackActive->VideoRecordingStopped(); + } + } + +void CCameraappDummyEngineImp::PauseVideoRecording() + { + if ( iCallBackActive ) + { + iCallBackActive->VideoRecordingPaused(); + } + } + +void CCameraappDummyEngineImp::StartVideoRecording() + { + if ( iCallBackActive ) + { + iCallBackActive->VideoRecordingResumed(); + } + } + +void CCameraappDummyEngineImp::ResumeVideoRecording() + { + if ( iCallBackActive ) + { + iCallBackActive->VideoRecordingResumed(); + } + } + +void CCameraappDummyEngineImp::SetVideoRecordingFileNameL( + const TDesC& /*aVideoClipFileName*/ ) + { + if ( iVideoPrepared && iCallBackActive ) + { + iCallBackActive->VideoPrepareComplete(); + } + } + +void CCameraappDummyEngineImp::PrepareVideoRecordingL( + const TSize& /*aFrameSize*/, + TReal32 /*aFrameRate*/, + TInt /*aBitRate*/, + TBool /*aAudioEnabled*/, + TInt /*aAudioBitRate*/, + const TDesC8& /*aMimeType*/, + const TDesC& /*aPreferredSupplier*/, + const TDesC8& /*aVideoType*/, + const TDesC8& /*aAudioType*/ ) + { + iVideoPrepared = ETrue; + if ( iCallBackActive ) + { + iCallBackActive->VideoPrepareComplete(); + } + } + +// ----------------------------------------------------------------------------- +// CCameraappDummyEngineImp::ConstructL +// Symbian 2nd phase constructor that can leave. +// ----------------------------------------------------------------------------- +// +void CCameraappDummyEngineImp::ConstructL() + { + iImageCount = 1; + } + + + + +void CCameraappDummyEngineImp::GetInfo( TCamAppEngineInfo& aInfo ) const + { + aInfo.iMaxDigitalZoom = 20; + aInfo.iFlashModesSupported = CCamera::EFlashNone | + CCamera::EFlashAuto | + CCamera::EFlashForced; + + aInfo.iWhiteBalanceModesSupported = CCamera::EWBAuto | + CCamera::EWBDaylight | + CCamera::EWBCloudy | + CCamera::EWBTungsten | + CCamera::EWBFluorescent; + } + + +void CCameraappDummyEngineImp::SetZoomValueL( TInt aZoomValue ) + { + iZoomValue = aZoomValue; + + TBuf <100> buf; + buf.Format( _L("__zm %d, val %d__"), iZoomMode, iZoomValue ); + User::InfoPrint( buf ); + } + + + +TInt CCameraappDummyEngineImp::ZoomValue() const + { + return iZoomValue; + } + + +void CCameraappDummyEngineImp::SetZoomModeL( CCaeEngine::TZoomMode aZoomMode ) + { + iZoomMode = aZoomMode; + + TBuf <100> buf; + buf.Format( _L("__zm %d, val %d__"), iZoomMode, iZoomValue ); + User::InfoPrint( buf ); + } + +void CCameraappDummyEngineImp::GetOrderL( RCaeOrderedFeatureList& /*aOrderedFeatureList*/ ) + { + } + +void CCameraappDummyEngineImp::SetOrderL( const RCaeOrderedFeatureList& /*aOrderedFeatureList*/ ) + { + } + +void CCameraappDummyEngineImp::SetSnapImageSourceL( TSnapImageSource /*aSnapImageSource*/ ) + { + } + +void CCameraappDummyEngineImp::SetImageCodecsL( TUid/*aDecoderUid*/, TUid /*aEncoderUid*/ ) + { + } + +TInt CCameraappDummyEngineImp::CamerasAvailable() + { + return 2; + } + + +TInt CCameraappDummyEngineImp::EnumerateVideoFrameSizeL( const TSize& /*aSize*/ ) { return 0; }; + +TInt CCameraappDummyEngineImp::CCameraHandle() const { return 1; }; + +void CCameraappDummyEngineImp::EnableVideoRecording() {}; + +void CCameraappDummyEngineImp::DisableVideoRecording() {}; + +void CCameraappDummyEngineImp::SetCaeExtensionModeL( TBool aExtModeActive, TBool aCreateSnapImage ) + { + (void)aExtModeActive; // removes compiler warning + (void)aCreateSnapImage; // removes compiler warning + } + +void CCameraappDummyEngineImp::ProcessExtViewFinderFrameReadyL( CFbsBitmap& aFrame ) + { + (void)aFrame; // removes compiler warning + } + +void CCameraappDummyEngineImp::ProcessExtSnapImageL( CFbsBitmap& aSnapImage ) + { + (void)aSnapImage; // removes compiler warning + } + +void CCameraappDummyEngineImp::ProcessExtCapturedImageL( CFbsBitmap& aBitmap, TBool aLastImage ) + { + (void)aBitmap; // removes compiler warning + (void)aLastImage; // removes compiler warning + } + +void CCameraappDummyEngineImp::ProcessExtCapturedImageL( HBufC8* aImageData, TBool aLastImage ) + { + (void)aImageData; // removes compiler warning + (void)aLastImage; // removes compiler warning + } + +void CCameraappDummyEngineImp::ProcessExtCapturedImageL( TDesC8& aImageDataDes, TBool aLastImage ) + { + (void)aImageDataDes; //removes compiler warning + (void)aLastImage; // removes compiler warning + } + +void CCameraappDummyEngineImp::ProcessExtCancel() + { + } + +void CCameraappDummyEngineImp::SkippedExtensionListL( RCaeOrderedFeatureList& aSkippedExtensions ) + { + (void)aSkippedExtensions; // removes compiler warning + } + +void CCameraappDummyEngineImp::SetSkippedExtensionList( RCaeOrderedFeatureList& aSkippedExtensions ) + { + (void)aSkippedExtensions; // removes compiler warning + } + +TInt CCameraappDummyEngineImp::SetAsyncVideoStopMode( TBool aAsyncVideoStopEnabled ) + { + (void)aAsyncVideoStopEnabled; // removes compiler warning + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCaeEngineImp::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCameraappDummyEngineImp* CCameraappDummyEngineImp::NewL() + { + CCameraappDummyEngineImp* self = new( ELeave ) CCameraappDummyEngineImp(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/dummyengine/CameraappTestBitmapManager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/dummyengine/CameraappTestBitmapManager.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dummy controller class for Cameraapp Unit Tests* +*/ + + + +// INCLUDE FILES +#include "CameraappTestBitmapManager.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +const TInt KMaxBitmaps = 3; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCameraappTestBitmapManager::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCameraappTestBitmapManager* CCameraappTestBitmapManager::NewL() + { + CCameraappTestBitmapManager* self = new( ELeave ) CCameraappTestBitmapManager; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +CCameraappTestBitmapManager::~CCameraappTestBitmapManager() + { + iBitmaps.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// CCameraappTestBitmapManager::SnapshotImage +// Get post-exposure snapshot bitmap, if available. +// +// Returns: pointer to post-exposure snapshot bitmap. Does not transfer ownership. +// May be NULL if no image available. +// +// --------------------------------------------------------------------------- +// +CFbsBitmap& CCameraappTestBitmapManager::Bitmap( TInt aBitmapIndex ) const + { + if ( aBitmapIndex < iBitmaps.Count() ) + { + return *( iBitmaps[aBitmapIndex] ); + } + else + { + return *( iBitmaps[iBitmaps.Count() - 1] ); + } + } + +CFbsBitmap& CCameraappTestBitmapManager::NextBitmap() + { + IncrementBitmapIndex(); + return *(iBitmaps[iBitmapIndex]); + } + +// ----------------------------------------------------------------------------- +// CCameraappTestBitmapManager::CCameraappTestBitmapManager +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCameraappTestBitmapManager::CCameraappTestBitmapManager() +: iBitmapIndex( -1 ) + { + } + +// ----------------------------------------------------------------------------- +// CCameraappTestBitmapManager::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCameraappTestBitmapManager::ConstructL() + { + // load test bitmaps + _LIT( bitmapFile, "z:\\system\\apps\\cameraapp\\DummyViewFinder.mbm" ); + for ( TInt i = 0 ; i < KMaxBitmaps ; i++ ) + { + CFbsBitmap* bitmap = new( ELeave ) CFbsBitmap; + CleanupStack::PushL( bitmap ); + + User::LeaveIfError( bitmap->Load( bitmapFile, i ) ); + User::LeaveIfError( iBitmaps.Append( bitmap ) ); + CleanupStack::Pop( bitmap ); + } + } + +void CCameraappTestBitmapManager::IncrementBitmapIndex() + { + iBitmapIndex = ++iBitmapIndex % iBitmaps.Count(); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/dummyengine/TestAFExtension.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/dummyengine/TestAFExtension.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object used to emulate the auto focus custom extension* +*/ + + +// INCLUDE FILES +#include + +#include "CamAppControllerBase.h" +#include "TestAFExtension.h" + +const TInt KAutoFocusTimeout = 1500000; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CTestAFExtension::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CTestAFExtension* CTestAFExtension::NewL( CCamAppControllerBase& aController, TBool aFailAutoFocus ) + { + CTestAFExtension* self = NewLC( aController, aFailAutoFocus ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CTestAFExtension::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CTestAFExtension* CTestAFExtension::NewLC( CCamAppControllerBase& aController, TBool aFailAutoFocus ) + { + CTestAFExtension* self = new ( ELeave ) CTestAFExtension( aController, aFailAutoFocus ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// Destructor +CTestAFExtension::~CTestAFExtension() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// CTestAFExtension::Start +// Start 'auto focus' procedure. +// --------------------------------------------------------------------------- +// +void CTestAFExtension::Start() + { + // Notify observers that AF procedure has started + TUid uid = KUidCamExtAutoFocus; + TAny* p1 = static_cast< TAny* > ( &uid ); + TCamExtAutoFocus focusState = ECamExtAutoFocusFocusing; + TAny* p2 = static_cast< TAny* > ( &focusState ); + iController.Notify( p1, p2 ); + After( KAutoFocusTimeout ); + } + +#ifdef CAMERAAPP_UNIT_TEST +// --------------------------------------------------------------------------- +// CTestAFExtension::SetFailAutoFocus +// Set whether or not the autofocus operation returns a failure +// --------------------------------------------------------------------------- +// +void CTestAFExtension::SetFailAutoFocus( TBool aFailAutoFocus ) + { + iFailAutoFocus = aFailAutoFocus; + } +#endif + +// --------------------------------------------------------------------------- +// CTestAFExtension::RunL +// From CActive, handle timeout expiration +// --------------------------------------------------------------------------- +// +void CTestAFExtension::RunL() + { + TUid uid = KUidCamExtAutoFocus; + TAny* p1 = static_cast< TAny* > ( &uid ); + TCamExtAutoFocus focusState; + if ( iFailAutoFocus ) + { + // Notify the controller that focus procedure has failed + focusState = ECamExtAutoFocusFailed; + } + else + { + // Notify the controller that focus has been achieved + focusState = ECamExtAutoFocusFocused; + } + TAny* p2 = static_cast< TAny* > ( &focusState ); + iController.Notify( p1, p2 ); + } + +// --------------------------------------------------------------------------- +// CTestAFExtension::CTestAFExtension +// C++ constructor +// --------------------------------------------------------------------------- +// +CTestAFExtension::CTestAFExtension( CCamAppControllerBase& aController, TBool aFailAutoFocus ) +: CTimer( EPriorityStandard ), iController( aController ), iFailAutoFocus( aFailAutoFocus ) + { + } + +// --------------------------------------------------------------------------- +// CTestAFExtension::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CTestAFExtension::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/dummyengine/TestAFExtension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/dummyengine/TestAFExtension.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object used to emulate the auto focus custom extension* +*/ + + +#ifndef TESTAFEXTENSION_H +#define TESTAFEXTENSION_H + +// INCLUDES +#include + + +// FORWARD DECLARATIONS +class CCamAppControllerBase; + +#include "cam.hrh" + +// CLASS DECLARATION + +/** +* Stub implementation for engine side autofocus notification +*/ +class CTestAFExtension : public CTimer + { + public: // Constructors and destructor + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aController reference to CamController + * @param aFailAutoFocus if ETrue autofocus operations will fail + * @return pointer to a newly instantiated CTestAFExtension object + */ + static CTestAFExtension* NewL( CCamAppControllerBase& aController, TBool aFailAutoFocus ); + + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aController reference to CamController + * @param aFailAutoFocus if ETrue autofocus operations will fail + * @return pointer to a newly instantiated CTestAFExtension object + */ + static CTestAFExtension* NewLC( CCamAppControllerBase& aController, TBool aFailAutoFocus ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CTestAFExtension(); + + public: // New functions + /** + * Start timer. + * @since 2.8 + */ + void Start(); + +#ifdef CAMERAAPP_UNIT_TEST + /** + * Set whether or not the autofocus operation will fail + * @since 2.8 + * @param aFailAutoFocus autofocus fails if ETrue + */ + void SetFailAutoFocus( TBool aFailAutoFocus ); +#endif + + public: // Functions from base classes + /** + * From CActive, handle timeout expiration + * @since 2.8 + */ + void RunL(); + + private: // New functions + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CamController + * @param aFailAutoFocus if ETrue autofocus operations will fail + */ + CTestAFExtension( CCamAppControllerBase& aController, TBool aFailAutoFocus ); + + /** + * Symbian 2nd phase constructor + * @since 2.8 + */ + void ConstructL(); + + private: + // Reference to the application controller + CCamAppControllerBase& iController; + // Whether or not autofocus operations should fail + TBool iFailAutoFocus; + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/icons/QGN_INDI_LCAM_AP_ST_2.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/icons/QGN_INDI_LCAM_AP_ST_2.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,28 @@ + + + + +]> + + + + + + + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/icons/qgn_indi_lcam_recording.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/icons/qgn_indi_lcam_recording.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,12 @@ + + + + +]> + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/icons/qgn_indi_lcam_recpause.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/icons/qgn_indi_lcam_recpause.svg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,14 @@ + + + + +]> + + + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamApp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamApp.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main application class* +*/ + + + + +#ifndef CAMAPP_H__ +#define CAMAPP_H__ + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Application class. +* Provides factory to create concrete document object. +* +* @since 2.8 +*/ + +class CCamApp : public CAknApplication + { + public: // Functions from base classes + + /** + * From CAknApplication Return the application UID value. + * @since 2.8 + * @return UID of the application + */ + TUid AppDllUid() const; + + protected: // Functions from base classes + + /** + * From CAknApplication Create an instance of CApaDocument + * and return a pointer to it. + * @since 2.8 + * @return Newly created CCamDocument instance + */ + CApaDocument* CreateDocumentL(); + + /** + * From CEikApplication + * Creates first-stage constructed file server application + * @since 3.0 + * @param aAppServer pointer to AppServer object + */ + void NewAppServerL( CApaAppServer*& aAppServer ); + + }; + +#endif // __CAMAPP_H__ + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamAppController.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamAppController.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,2574 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for managing intercommunication between Camcera UI* +*/ + + +#ifndef CAMAPPCONTROLLER_H +#define CAMAPPCONTROLLER_H + + +// =========================================================================== +// INCLUDES +#include +#include + +#include // publish zoom state related +#include + +#include +#include +#include + +#include "MCamAppController.h" +#include "CamControllerObservers.h" +#include "mcamsettingsmodelobserver.h" +#include "CamSettings.hrh" +#include "Cam.hrh" // TCamSoundId +#include "CamSettingsInternal.hrh" + +#include "mcamplayerobserver.h" + +#include "CamImageSaveActive.h" +#include "CamCallStateAo.h" +#include "CamObserver.h" +#include "CamBurstModeObserver.h" +#include "CamPerformance.h" + +#ifndef __WINSCW__ +#include +#endif + +#include "CamPropertyObserver.h" + +// +#include "mcamcameraobserver.h" +#include "camcamerarequests.h" +#include "camfolderutility.h" +#include "camcameracontroller.h" +#include "CamDriveChangeNotifier.h" +#include "CamSyncRotatorAo.h" + + +// =========================================================================== +// CONSTANTS + +// !Do not change the order of these without careful consideration! +// +enum TCamCameraState + { + ECamCameraIdle = 0, + ECamCameraReserved = 1 << 0, + ECamCameraPowerOn = 1 << 1, + ECamCameraPreparedImage = 1 << 2, + ECamCameraPreparedVideo = 1 << 3, + ECamCameraStateLast // Not valid state, only marker + }; + +/** +* Flags for ongoing operations +*/ +enum TCamBusyFlags + { + EBusyNone = 0, + EBusyRequest = 1<<0, + EBusySequence = 1<<1, + EBusySetting = 1<<2, + EBusyLast // Marker + }; + + +// =========================================================================== +// FORWARD DECLARATIONS +class CRepository; +//class CCamSettingsModelBase; +class MCamAppController; +class MCamSettingsModel; +class MCamSettingPreviewHandler; // +//class CCamConstantSettingProvider; // +class CCamSettingProvider; // +class CCamTimer; +class CCamObserverHandler; +class CCamBurstCaptureArray; +class CCamAudioPlayerController; +class MCamStaticSettings; +class CCamGSInterface; +class CCameraUiConfigManager; +class CCamPropertyWatcher; + + + +class CCamFlashStatus; +class CCamConfiguration; +class CCFClient; + +// =========================================================================== +// CLASS DECLARATION + +class TCamAppControllerInfo + { + public: + TCamAppControllerInfo(); + + public: + TCamActiveCamera iActiveCamera; + + TCamCameraMode iMode; + TCamCameraMode iTargetMode; + + TCamImageCaptureMode iImageMode; // ECamImageCaptureNone in video controller mode + TCamImageCaptureMode iTargetImageMode; + + TCamCaptureOperation iOperation; // Current operation + + // Target viewfinder state and mode + TCamCameraTriState iTargetVfState; + TBool iViewfinderMirror; // set when viewfinder initialized + + // Target image parameters + TInt iTargetImageResolution; + TInt iTargetImageQuality; + + // Target video parameters + /** not supported yet */ + + // Request being handled + TCamCameraRequestId iBusyRequestId; + }; + + +/** +* Handle intercommunication between camcorder UI and engine. +* +* @since 2.8 +*/ +class CCamAppController : public CBase, + public MCamAppController, + public MCamSettingsModelObserver, + public MCamCameraObserver, + public MCamImageSaveObserver, + public MCamCallStateObserver, + public MPropertyObserver, + public MSensrvDataListener, + public MCamPlayerObserver, + public MCamObserver, + public MCamBurstModeObserver, + public MCFListener + ,public MCamDriveChangeNotifierObserver + ,public MBitmapRotationObserver + + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @return pointer to the created CCamAppController object + */ + static CCamAppController* NewL(); + + + /** + * Complete construction of the engine and issue notification requests. + * The camera engine cannot be instantiated until the application + * orientation has been set by the CCamAppUi. This does not + * exist when the CCamAppController is constructed. CompleteConstructionL + * must be called in the CCamAppUi::ConstructL() + * @since 3.0 + */ + void CompleteConstructionL(); + + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamAppController(); + + public: + /** + * Calls CamSettingModel to save user defined FT setting + * @since S60 5.0 + * @param None + * @return None + */ + void StoreFaceTrackingValue(); + + // ------------------------------------------------------- + // From MCamCameraObserver + public: + + virtual void HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData /*= NULL*/ ); + + + + // ------------------------------------------------------- + // from MCamSettingsModelObserver + public: + + virtual void IntSettingChangedL( TCamSettingItemIds aSettingItem, + TInt aSettingValue ); + virtual void TextSettingChangedL( TCamSettingItemIds aSettingItem, + const TDesC& aSettingValue ); + + + // ------------------------------------------------------- + // from MCamBurstModeObserver + + /** + * Burst mode activation has changed + * @since 2.8 + * @param aActive whether or not burst mode is active + * @param aStillModeActive whether or not still capture is active + */ + virtual void BurstModeActiveL( TBool aActive, TBool aStillModeActive ); + + // ------------------------------------------------------- + // from MCamAudioPlayerObserver + virtual void PlayComplete( TInt aStatus, TInt aSoundId ); + + + // ------------------------------------------------------- + public: + // From MCFListener ( Context framework for publishing zoom state. + /** + * Indicates a change in context for subscribed clients. + * If client has subscribed to partial context class path, + * only the changed context will be indicated. + * + * @since S60 4.0 + * @param aIndication: Context indication. + * @return None + */ + inline void ContextIndicationL( + const CCFContextIndication& /*aChangedContext*/ ) {}; + + /** + * Indicates that specified action is needed to be executed. + * When action indication is received certain rule has been triggered + * and action is needed to be performed. + * + * @since S60 4.0 + * @param aActionToExecute Action indication. + * @return None + */ + inline void ActionIndicationL( + const CCFActionIndication& /*aActionToExecute*/ ) {}; + + /** + * Indicates that error has occured. + * @since S60 4.0 + * @param aError Error code. + * @return None + */ + inline void HandleContextFrameworkError( TCFError /*aError*/, + const TDesC& /*aSource*/, + const TDesC& /*aType*/ ){}; + + /** + * Returns an extension interface. + * The extension interface is mapped with the extension UID. + * + * If the client does not support the requested interface, + * client must return NULL. Otherwise client needs to return + * the correct interface combined with the UID. + * + * @since S60 5.0 + * @param aExtensionUid: The identifier of the extension. + * @return Pointer to the extension. + */ + inline TAny* Extension( const TUid& /*aExtensionUid*/ ) const { return NULL; }; + + // New Function + + /* + * Method to publish the zoom key and setting the + * value or the state to enabled or disabled. + * @Paran aEnabled used to set the the state of zoom key + * to be enabled or disabled. + */ + void PublishZoomStateL( const TBool aEnabled ); + + public: + + /** + * Returns whether or not the current profile is silent + * @since 3.0 + * @return ETrue if current profile is silent + */ + TBool IsProfileSilent(); + + /** + * Returns whether or not we have touch screen support in the device + * @return ETrue if device supports touch screen + */ + TBool IsTouchScreenSupported(); + + /** + * Returns whether or not we have direct screen viewfinder support in the device + * @return ETrue if device supports direct screen viewfinder + */ + TBool IsDirectScreenVFSupported( TBool aPrimaryCamera = ETrue ); + + // --------------------------------------------------------------------------- + //Helper function for making notification about deleted files + //Added this method to do notification if files have been + //deleted outside camera application and then camera is + //put back to foreground in postcapture view. + //Security note. Contents of the files might have been + //changed when camera was in background. + // --------------------------------------------------------------------------- + // + void MediaFileChangedNotification(); + + TBool EngineRequestsPending() const; + /** + * Set settings restore to be done at earliest + * convenient time. + */ + void SetSettingsRestoreNeeded(); + + /** + * Set the flag to indicate that the original values + * of remaining images is stored + */ + void SetRemainingImageStored(); + + /** + * Returns the flag that indicates if the original value + * of remaing images is stored or not. + */ + TBool IsRemainingImageStored() const; + + /** + * Return whether saving is still in progress. + */ + TBool IsSavingInProgress() const; + + /** + * Return if settings restore is set pending. + */ + TBool IsSettingsRestoreNeeded() const; + + + void RestartTimeLapseTimerL(); + + + static TInt CamerasAvailable(); + + /** + * Is time lapse supported. + * Value read from Central Repository. + */ + TBool TimeLapseSupported(); + + /** + * Is time lapse supported. + * Value read from Central Repository. + */ + TBool AlwaysOnSupported(); + + /** + * Release version number. + * Value read from Central Repository. + */ + const TVersion& Version(); + + /*** + * Can a new request be made to controller or not. + * Shutdown may be requested at any moment. + */ + TBool Busy() const; + + /** + * Returns true if the last captured image was saved + * @since 2.8 + * @return ETrue if the last captured image has been saved. + */ + TBool SavedCurrentImage() const; + + /** + * Rename image/video. + * @since 2.8 + * @param aNewName the new name for the current capture array file. + * @param aMode the current capture mode. + * @return ETrue if the file has been renamed successfully. + */ + TBool RenameCurrentFileL( const TDesC& aNewName, + const TCamCameraMode& aMode ); + + /** + * Add a controller observer. + * @since 2.8 + * @param aObserver Pointer to an object implementing + * MCamControllerObserver + * @return ?description + */ + void AddControllerObserverL( const MCamControllerObserver* aObserver ); + + /** + * Remove a controller observer + * @since 2.8 + * @param aObserver Pointer to the observer to remove. The object + * does not have to be added as an observer. + */ + void RemoveControllerObserver + ( const MCamControllerObserver* aObserver ); + + /** + * Add camera observer. + * Forwards call to CCamCameraController. + * @see CCamCameraController for more details. + */ + void AddCameraObserverL( const MCamCameraObserver* aObserver, + const TUint& aEventInterest ); + + /** + * Removes camera observer. + * Forwards call to CCamCameraController. + * @see CCamCameraController for more details. + */ + void RemoveCameraObserver( const MCamCameraObserver* aObserver ); + + void AddSettingsObserverL( const MCamSettingsModelObserver* aObserver ); + void RemoveSettingsObserver( const MCamSettingsModelObserver* aObserver ); + + TBool CameraControllerBusy() const; + TUint CameraControllerState() const; + + TCamCameraState CameraState() const; + TCamCameraMode CurrentMode() const; + TCamCameraMode TargetMode() const; + TCamImageCaptureMode CurrentImageModeSetup() const; + TCamCaptureOperation CurrentOperation() const; + TCamCaptureOperation CurrentImageOperation() const; + TCamCaptureOperation CurrentVideoOperation() const; + TCamImageCaptureMode CurrentImageMode() const; + + + TInt CaptureLimit() const; + TInt CaptureLimitSetting() const; + void SetCaptureLimitL( TInt aLimit ); + + /** + * From MBitmapRotationObserver + * Notification of bitmap rotation complete events + * @param aErr KErrNone if successful + */ + void RotationCompleteL( TInt aErr ); + +private: + void ReadVariantFlagsL(); + + + void SetMode( const TCamCameraMode& aNewMode ); + void SetTargetMode( const TCamCameraMode& aNewMode ); + + void SetImageMode( const TCamImageCaptureMode& aNewMode ); + void SetTargetImageMode( const TCamImageCaptureMode& aNewMode ); + + void SetOperation( TCamCaptureOperation aNewOperation, + TInt aError = KErrNone ); + + TCamCameraTriState ViewfinderTargetState() const; + + +public: + /* + * Handle to Camera Ui Config Manager + */ + CCameraUiConfigManager* UiConfigManagerPtr(); + + /* + * De-register harvester client events. + */ + void DeRegisterHarverterClientEvents(); + + /** + * Return resource id for video viewfinder layout + * @since 3.0 + * @param aResolution for current resolution + * @return Resource id for video viewfinder layout + */ + TInt VideoViewFinderResourceId( TCamVideoResolution aResolution ); + + /** + * Start the viewfinder for the specified mode + * as soon as the engine is intialised + * @since 2.8 + * @param aMode The viewfinder mode being entered + */ + void EnterViewfinderMode( const TCamCameraMode& aMode ); + + /** + * ExitViewinderMode + * @since 2.8 + * @param aMode The viewfinder mode being exited + */ + void ExitViewfinderMode( const TCamCameraMode& aMode ); + + /** + * FreezeViewFinder + * @since 2.8 + * @param aFreeze Whether or not the viewfinder is + * being frozen after this frame + */ + void FreezeViewFinder( TBool aFreeze ); + + /** + * Return number of images that can still be captured + * @since 2.8 + * @param aStorage storage location - defaults to current loation + * @param aBurstActive - set to ETrue if burst mode is active + * @return the number of images + */ + TInt ImagesRemaining( TCamMediaStorage aStorage, + TBool aBurstActive ); + + /** + * Return number of images that can still be captured for a particular + * image quality + * @since 2.8 + * @param aStorage storage location - defaults to current loation + * @param aBurstActive - set to ETrue if burst mode is active + * @param aQualityIndex - index of the image quality + * @return the number of images + */ + TInt ImagesRemaining( TCamMediaStorage aStorage, + TBool aBurstActive, + TInt aQualityIndex ); + + /** + * Return amount of video that has been captured + * @since 2.8 + * @return the amount of video in micro secs + */ + TTimeIntervalMicroSeconds RecordTimeElapsed() const; + + + /** + * Set amount of video that has been captured + * @param aElapsed - recorded video time. + */ + void RecordTimeElapsed(TTimeIntervalMicroSeconds aElapsed ); + + + /* + * Return amount of video that can still be captured + * @since 2.8 + * @return the amount of video in secs + */ + TTimeIntervalMicroSeconds RecordTimeRemaining(); + + /** + * Updates the interval used in next TimeLapse capture + * @since 3.0 + * @param aInterval The new interval to use + */ + void SetTimeLapseInterval( TTimeIntervalMicroSeconds aInterval ); + + /** + * Returns the interval used in next TimeLapse capture + * @since 3.0 + * @return The current time lapse interval in microseconds + */ + TTimeIntervalMicroSeconds TimeLapseInterval(); + + /** + * Returns the remaining time lapse interval until the next capture + * @since 3.0 + * @return The remaining time to the next timelapse capture + */ + TTimeIntervalMicroSeconds TimeLapseCountdown(); + + /** + * Start the autofocus procedure + * @since 2.8 + */ + void StartAutoFocus(); + + /** + * Begin the capture procedure + * @since 2.8 + */ + void Capture(); + + /** + * Stop the burst capture operation + * @since 2.8 + */ + void StopSequenceCaptureL(); + + /** + * Whether or not a still capture operation is pending + * i.e. a request to start still capture has been made and is + * waiting for the focus operation to complete. + * @since 2.8 + * @return ETrue if a still capture operation is pending + */ + TBool CapturePending() const; + + /** + * Whether or not a capture key pressed during image saving + * @since 2.8 + * @return ETrue if capture key is pressed during image saving + */ + TBool CaptureKeyPressedWhileImageSaving() const; + + /** + * Stores shutter key press during saving image + * @since 2.8 + */ + void SetCaptureKeyPressedWhileImageSaving(TBool aCaptureKeyPressed); + + /** + * Whether or not a video recording operation is pending + * i.e. a request to start video recording has been made and is + * waiting for the engine to complete a video name update operation. + * @since 2.8 + * @return ETrue if a record operation is pending + */ + TBool VideoRecordPending() const; + + /** + * Whether or not a sequence capture is in progress + * @since 2.8 + * @return ETrue if a sequence capture is in progress + */ + TBool SequenceCaptureInProgress() const; + + /** + * Begin the recording procedure + * @since 2.8 + */ + void StartVideoRecordingL(); + + /** + * End the recording procedure + * @since 2.8 + */ + void StopVideoRecording(); + + /** + * End the recording procedure + * @since 5.0 + */ + void StopVideoRecordingAsync(); + + /** + * Store the cause of the video stop + * @since 3.0 + */ + void SetVideoStoppedForPhoneApp( TBool aIsPhoneApp ); + + /** + * Pause the recording procedure + * @since 2.8 + */ + void PauseVideoRecording(); + + /** + * Continue the recording procedure + * @since 2.8 + */ + void ContinueVideoRecording(); + + /** + * Issue AF request. + */ + TBool TryAFRequest( TInt aAFRequest ); + + /** + * Cancel ongoing AutoFocus. + */ + void CancelAFNow(); + + /** + * Cancel a requested capture + * @since 2.8 + */ + void CancelFocusAndCapture(); + + /** + * Return the current snapshot image + * @since 2.8 + * @return the current snapshot image + */ + const CFbsBitmap* SnapshotImage() const; + + /** + * Sets the specified burst mode item as the current image, in + * preparation for a Post-capture view of the image. + * @since 2.8 + * @param aIndex The index of the burst item in "CCamBurstCaptureArray" + */ + void SetAsCurrentImage( TInt aIndex ); + + /** + * Get the user-visible name for next image. + * @since 2.8 + * @return file name for the current image or video without path or + * extension + */ + const TDesC& CurrentImageName() const; + + /** + * Delete the current image/video file + * @since 2.8 + * @param aNofity Should notification be sent to observers about + * change in media files. When this call is made + * several times in a row, it's worth to do the + * notification only once. + * @return KErrNone if delete successful, otherwise system-wide + * error code + */ + TInt DeleteCurrentFile( TBool aNotify = ETrue ); + + /** + * Delete the timelapse sequence files + * @since 3.0 + */ + void DeleteTimeLapseFiles(); + + /** + * Indicate whether or not the controller is actively engaged in still + * or video capture - this includes paused video, saving photos/videos, + * periods in between timelapse captures and pending captures + * (captures that have been requested but not yet started) + * @since 3.0 + * @return EFalse if not currently capturing, otherwise ETrue + */ + TBool IsProcessingCapture(); + + /** + * Complete current capture asap, then report completion to the observer + * @since 3.0 + * @param aObserver To be notified when the current capture process completes + * @param aSafeCompletion ETrue if all captures should be saved. EFalse to complete + * sooner and lose any images that have not yet begun to save + */ + void CompleteCaptureAndNotifyL( MCamObserver* aObserver, TBool aSafeCompletion ); + + /** + * The application is closing. Complete any active operations then + * exit the application. + * @param aImmediateShutdown ETrue: shutdown immediately or + * EFalse: wait for pending operations to complete. + * @since 2.8 + */ + void EnterShutdownMode( TBool aImmediateShutdown ); + + /** + * Whether or not the controller is in shutdown mode + * @since 2.8 + * @return ETrue if the controller is in shutdown mode else EFalse + */ + TBool IsInShutdownMode() const; + + /** + * Returns true if AppUi has been constructed, and not yet + * destructed. + */ + TBool IsAppUiAvailable() const; + + /** + * Sets AppUi availablility (see IsAppUiAvailable()) + */ + void SetAppUiAvailable( TBool aAvailable ); + + + /** + * Called to return the range of supported zoom values + * @since 2.8 + * @param aMinZoom on return contains the minimum zoom value + * @param aMaxZoom on return contains the maximum zoom value + */ + void GetZoomRange( TInt& aMinZoom, TInt& aMaxZoom ) const; + + /** + * Called to return current zoom value + * @since 2.8 + * @return the current zoom value + */ + TInt ZoomValue() const; + + /** + * Sets the current zoom value + * @since 2.8 + * @param aValue the new zoom value to be used + */ + void SetZoomValue( TInt aValue ); + + /** + * Resets all user scene settings to their defaults. + * @since 2.8 + */ + void ResetUserSceneL(); + + /** + * Previews a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want + * to preview. + * @param aSettingValue the new integer value for the specified + * setting item to be previewed. + * @since 2.8 + */ + void PreviewSettingChangeL( TInt aSettingItem, TInt aSettingValue ); + + /** + * Cancels all preview changes, since last commit/cancel. + * @since 2.8 + */ + void CancelPreviewChangesL(); + + /** + * Commits last preview change. + * @since 2.8 + */ + void CommitPreviewChanges(); + + /** + * Re-prepare video after e.g. a setting change requires this. + */ + void RePrepareVideoL(); + + /** + * Returns the current integer value for the specified setting + * @return the current integer setting value + * @param aSettingItem specifies which setting item that want + * the value of. + * @since 2.8 + */ + TInt IntegerSettingValue( TInt aSettingItem ) const; + + /** + * Returns the current integer value for the specified setting + * without the filtering usually performed on storage location. + * This is neccesary to allow the video/photo settings list to show + * the selected storage location rather than the forced storage location. + * @return the current integer setting value + * @param aSettingItem specifies which setting item that want the value of. + * @since 2.8 + */ + TInt IntegerSettingValueUnfiltered( TInt aSettingItem ) const; + + /** + * Sets a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want + * to set the value of. + * @param aSettingValue the new integer value for the specified + * setting item. + * @since 2.8 + */ + void SetIntegerSettingValueL( TInt aSettingItem, TInt aSettingValue ); + + /** + * Sets pathnames for video and image files to point to the specified storage + * @param aMediaStorage specifies phone memory or MMC + * @since 2.8 + */ + void SetPathnamesToNewStorageL( TCamMediaStorage aMediaStorage ); + + /** + * Sets a new text value for the specified setting + * @param aSettingItem specifies which setting item that want to set + * the text value of. + * @param aSettingValue the new text value for the specified setting + * item. + * @since 2.8 + */ + void SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ); + + + /** + * Returns the current text value for the specified setting + * @return the current text setting value + * @param aSettingItem specifies which setting item that want + * the text value of. + * @since 2.8 + */ + TPtrC TextSettingValue( TInt aSettingItem ) const; + + /** + * Returns whether a particular setting value can be set or not. + * @return ETrue if can be set. Otherwise, EFalse. + * @param aSettingItem the setting item in question. + * @param aSettingValue the value in question. + * @since 2.8 + */ + TBool SettingValueEnabled( TInt aSettingItem, TInt aSettingValue ) const; + + /** + * Loads the settings from shared data, or if unable to from the + * resource file. + * @param aIsEmbedded whether or not the application is running in + * embedded mode. + * @since 2.8 + */ + void LoadStaticSettingsL( TBool aIsEmbedded ); + + /** + * Get the default value for a setting item. + * @param aSettingId The id of the setting. + * @return The default value for setting item or KErrNotFound if not found. + */ + TInt DynamicSettingDefaultValue( TInt aSettingId ) const; + + /** + * Sets all dynamic settings to their defaults. + * @since 2.8 + */ + void SetDynamicSettingsToDefaults(); + + /** + * Sets a single dynamic setting to its default. + * @since 2.8 + */ + void SetDynamicSettingToDefault(TInt aSettingItem); + + /** + * Set scene default value to a dynamic setting. + * @param aSceneId Id of the scene to use. + * @param aSceneField Id of scene field. + * @param aSettingId If of the dynamic setting to set. + * @param aVideoScene Does aSceneId refer to a video scene. + * @return KErrNotFound, if setting could not be set. + */ + TInt SetDynamicSettingToSceneDefaultL( TInt aSceneId, + TInt aSceneField, + TInt aSettingId, + TBool aVideoScene ); + + +#ifdef PRODUCT_USES_GENERIC_SETUP_INDICATOR + /** + * Returns whether or not the video setup settings are set to the + * defaults for its current scene. + * @since 2.8 + * @return ETrue if set to defaults. Otherwise, EFalse + */ + TBool VideoSceneDefaultsAreSet(); + + /** + * Returns whether or not the photo setup settings are set to the + * defaults for its current scene. + * @since 2.8 + * @return ETrue if set to defaults. Otherwise, EFalse + */ + TBool PhotoSceneDefaultsAreSet(); +#endif // PRODUCT_USES_GENERIC_SETUP_INDICATOR + + /** + * Returns the file name of the most recent saved image/video clip + * @return Filename of most recent captured image/video + * @since 2.8 + */ + const TDesC& CurrentFullFileName() const; + + /** + * Get the current video filename. + */ + const TDesC& CurrentVideoFileName() const; + + /** + * Returns a pointer to an array representing the images in a burst + * capture + * @return reference to the burst capture array + * @since 2.8 + */ + CCamBurstCaptureArray* BurstCaptureArray() const; + + /** + * Returns the number of non-deleted items in the array + * @return count of non-deleted items + * @since 2.8 + */ + TInt CurrentItemCount(); + + /** + * Returns the number of burst capture moments that have taken + * place in a current burst. If no burst is active this returns + * 0 + * @return count of burst capture moments + * @since 3.0 + */ + TInt CurrentCapturedCount(); + + /** + * Returns the number of items in a timelapse sequence + * @return count of timelapse sequence items + * @since 3.0 + */ + TInt TimeLapseImageCount(); + + /** + * Resets the array of filenames used in timelapse capture + * @since 3.0 + */ + void ResetTimelapseArray(); + + /** + * Initiates the playing of the specified sound. + * @since 2.8 + * @param aSoundId The enum value of the sound to play + * @param aEnableCallback Whether we want a callback when play complete + */ + void PlaySound( TCamSoundId aSoundId, TBool aEnableCallback ); + + /** + * Initiates the playing of the specified tone + * @since 2.8 + * @param aToneHz The frequency of the tone to play in Hertz + * @param aLenMicSec The length of tone to play in microseconds + * @param aVolume The volume of the tone, range 0.0 to 1.0 + * @param aEnableCallback Whether to be called back when playback complete + */ + void PlayTone( TInt aToneHz, TInt aLenMicSec, TReal32 aVolume, TBool aEnableCallback ); + + /** + * Releases the camera hardware for other apps to use + * @since 2.8 + */ + void ReleaseCamera(); + + /** + * Increments the engine usage count + * @since 2.8 + */ + void IncCameraUsers(); + + /** + * Decrements the engine usage count If the engine is no longer required + * then it is released. If it is still processing, the engine count will + * be checked when the current process completes and the engine will be + * released if it is no longer needed. + * @since 2.8 + */ + void DecCameraUsers(); + + /* + * Gets the handle to the static settings model, which is used inturn by the + * plugin to call the interfaces for performing needed actions. + */ + MCamStaticSettings& StaticSettingsModel(); + + /* + * Check if image/video scene mode is supported + */ + TBool IsSceneSupported( const TInt aSceneId, TBool aPhotoScene = ETrue ) const; + + /** + * Whether a call is active, including the ringing state + * @since 2.8 + * @return ETrue if in call or ringing, else EFalse + */ + TBool InCallOrRinging() const; + + /** + * Whether a video call is active, including the ringing state + * @return ETrue if in videocall or ringing, else EFalse + */ + TBool InVideocallOrRinging(); + + /** + * Whether or not a video clip is currently being saved + * @since 2.8 + * @return ETrue if saving, else EFalse + */ + TBool CurrentlySavingVideo() const; + + /** + * Returns whether all the settings list options for a particular setting + * item are visible or not + * @since 2.8 + * @param aSettingItem The setting item to be checked. + * @param aRevisedResourceId Receives the id of a resource if the return + * value is EFalse. The resource contains the list of visible + * options. + * @return ETrue if all options are visible. Otherwise, EFalse. + */ + TBool AllOptionsVisibleForSettingItem( TInt aSettingItem, + TInt& aRevisedResourceId ); + + /** + * Switches the camera being used + * @since 2.8 + */ + void SwitchCameraL(); + + /** + * Returns the active camera + * @since 2.8 + * @return @return either primary, secondary or none ( if in process of switching ) + */ + TCamActiveCamera ActiveCamera() const; + + /** + * Whether we currently have a camera switch required + * @since 2.8 + * @return TCameraSwitchRequired a camera switch is required or not + */ + TCameraSwitchRequired CameraSwitchQueued() const; + + /** + * Check if exit is required + * @since 2.8 + * @return TBool True if exit is required + */ + TBool CheckExitStatus(); + + /** + * Informs the controller that an end key event is waiting + * to close the app, or has been acted upon + * This is used when the end key is pressed during sequence capture + * @since 2.8 + */ + void SetEndKeyExitWaiting( TBool aEndKeyWaiting ); + + /** + * Returns the status of the camera slide + * @since 2.8 + * @return the status of the camera slide + */ + TInt CameraSlideState() const; + + /** + * Informs the controller that a slider close event has + * been reacted to by 'pretending' to exit + * @since 2.8 + */ + void SliderCloseEventActioned(); + + /** + * Set camera switch to queue + */ + void SetCameraSwitchRequired( TCameraSwitchRequired aSwitchRequired ); + + /** + * Check slide state and schedule camera switch if required + * @since 2.8 + */ + void CheckSlideStatus(); + + + /** + * Return range of EV value supported for current product + * @since 3.0 + * @return TEvRange struct + */ + TCamEvCompRange EvRange() const; + + public: // Derived from MCamCallStateObserver base class + /** + * Callback for when the current phone call state changes + * @since 3.0 + * @param aState The new call state + * @param aError An error code associated with the event + */ + void CallStateChanged( TPSCTsyCallState aState, TInt aError ); + + /** + * Returns the file size of the specified file + * @since 3.0 + * @param aFilename The file to retrieve the size of. + * @return The size of the file or KErrNotFound + */ + TInt FileSize( TDesC& aFilename ) const; + + /** + * Returns whether the current scene uses forced + * autofocus (so no AF required at capture time) + * @since 3.0 + * @return ETrue if forced, EFalse if not + */ + TBool CurrentSceneHasForcedFocus() const; + +public: + + /** + * Get the actual resolution (WxH) of current image quality. + */ + TSize GetCurrentImageDimensions() const; + + /** + * Retrieves the current image resolution, taking into account + * the user settings and and modifications due to zoom state. + * @since 2.8 + * @returns The current image resolution. + */ + TCamPhotoSizeId GetCurrentImageResolution() const; + + /** + * Retrieves the current image compression + * @since 2.8 + * @returns The current image compression. + */ + TInt GetCurrentImageCompression() const; + + /** + * Retrieves the current video resolution. + * @since 2.8 + * @returns The current video resolution. + */ + TCamVideoResolution GetCurrentVideoResolution() const; + + /** + * Force use of phone memory storage + * @since 2.8 + */ + void UsePhoneMemoryL() const; + + /** + * Sets the correct memory to be used based on settings + * and availability of MMC. + * @since 4.0 + * @return ETrue if memory location changed + */ + TBool CheckMemoryToUseL(); + + /** + * Indicate whether the phone memory is being force-used + * because of un-availability or errors in MMC. + * @since 4.0 + */ + TBool IsPhoneMemoryForced(); + + /** + * Retrieves the current image resolution from Settings. + * @since 2.8 + * @returns The current image from Settings + */ + TCamPhotoSizeId SettingsPhotoResolution() const; + + + /** + * Indication that a view has finished using the capture array + * @since 2.8 + * @param aForcedRelease Should the array be released even if + * the apparent usage count is not null. + */ + void ReleaseArray( TBool aForcedRelease = EFalse ); + + /** + * Restore Camera settings to default + * @since 3.0 + * @param aIsEmbedded if app is embedded + */ + void RestoreFactorySettingsL( TBool aIsEmbedded ); + +private: + /** + * Called when playback of a sound has completed + * @since 2.8 + */ + void PlaySoundComplete(); +public: + + /** + * Non-leaving version of StartViewFinderL() + * @since 2.8 + */ + void StartViewFinder(); + + /** + * Stop viewfinder + * @since 2.8 + */ + void StopViewFinder(); + + /** + * Stop viewfinder Ecam only + * Needed with async video recording stopping + * @since 5.0 + */ + void StopViewFinderEcam(); + + /** + * Sets the zoom mode of the engine + * @param aZoomMode The zoom mode to set + * @since 3.0 + */ + // Only digital mode supported currently - no need for this + //void SetZoomMode( const TCamZoomMode& aZoomMode ); + + /** + * Report whether a capture mode transition is currently in progress + * @since 2.8 + * @return TBool ETrue if transition (i.e. still/video capture prepare) is + * currently in progress, EFalse otherwise; + */ + TBool CaptureModeTransitionInProgress(); + + /** + * Check if viewfinder is active + * @since 2.8 + * @returns ETrue if viewfinding + */ + TBool IsViewFinding() const; + + /** + * Check if capture key needs to be released before starting + * new capture process. Used in post capture state to prevent + * image capture before viewfinder is completely shown. + * @since S60 v5.0 + * @return ETrue if waiting key release before next capture + */ + TBool IsDemandKeyRelease(); + + /** + * Set iDemandKeyRelease value + * @param aDemand Demand to release capture key + * @since S60 v5.0 + */ + void SetDemandKeyRelease( TBool aDemand ); + + /** + * Stop the idle timer + * @since 2.8 + */ + void StopIdleTimer(); + + /** + * Restart the idle timer + * @since 2.8 + */ + void StartIdleTimer(); + + + /** + * Flash modes supported by engine + * @since 3.0 + * @return supported flash modes + */ + TUint32 SupportedFlashModes(); + + + /** + * White balance modes supported by engine + * @since 3.0 + * @return supported white balance modes + */ + TUint32 SupportedWBModes(); + + /** + * EV modes supported by engine + * @since 3.0 + * @return supported EV modes + */ + TUint32 SupportedEVModes(); + + /** + * Capture state + * @return TInt capture state + */ + TInt CaptureState(); + + /** + * Returns the current capture-tone id + * @since 3.0 + * @return the current capture-tone id + */ + TCamSoundId CaptureToneId( ); + +#ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT + public: + void SetPerformanceState( TCamPerformanceState aState ); +#endif + + /** + * Set pointer to settings plug-in. Takes ownership! + * @param aPlugin Pointer to settings plug-in. This object + * takes ownership. + * @since S60 v5.0 + */ +void SetSettingsPlugin( CCamGSInterface* aPlugin ); + + /** + * Set viewfinder window for direct screen viewfinder. The handle must remain + * valid as long as viewfinder is running. + * @since S60 v5.0 + * @param aWindow Handle to viewfinder window. Must remain valid while + * viewfinder is running. Ownership not transferred. + */ + void SetViewfinderWindowHandle( RWindowBase* aWindow ); + + /** + * Notify that the viewfinder window is about to be deleted. Viewfinder + * will be stopped if this window handle is currently used for the + * viewfinder. + * @since S60 v5.0 + * @param aWindow Handle to viewfinder window. Ownership not transferred. + */ + void ViewfinderWindowDeleted( RWindowBase* aWindow ); + +protected: // New functions + + /** + * C++ default constructor. + * @since 2.8 + */ + CCamAppController(); + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + +// ----------------------------------------------------- +// Burst related +public: + + /** + * Stop burst in a soft way: + * - if have not moved yet to long burst mode, + * wait until the short burst ends and do not + * enter long burst mode (if aFastStop is true, + * stop asap when atleast 2 images captured). + * - if long burst already entered, stop capturing + * after the next capture. + * @param aFastStop Stop also short burst asap, but so that + * atleast 2 images are captured. + */ + void SoftStopBurstL( TBool aFastStop = EFalse ); + + /** + * Set iNoBurstCancel flag which is used to prevent stopping burst + * when actual burst capture has started after focusing. + */ + void SetNoBurstCancel( TBool aValue ); + + /** + * Set iKeyUPl flag which is used to prevent late + * activated burst timer when capturekey is up already + * before burstcapture has started. + */ + void SetKeyUp( TBool aValue = EFalse ); + + /** + * Returns amount of images captured in burst mode + * @return Amount of captured images + * + */ + TInt CapturedImages() const; + +private: + + /** + * Start the burst timer for changing to long burst mode. + */ + void StartBurstTimerL(); + + /* + * Stop the burst timer. + */ + void StopBurstTimer(); + + /** + * Callback for short burst timer. + * @param aController Pointer to app controller instance. + * @return Always zero, implies no repeated callbacks wanted. + */ + static TInt ShortBurstTimeout( TAny* aController ); + + /** + * Helper method for short burst timer callback. + */ + void DoShortBurstTimeoutL(); + + + // ----------------------------------------------------- + private: + + /** + * Return number of images that can still be captured for a particular + * image photo resolution + * @since 2.8 + * @param aStorage storage location - defaults to current loation + * @param aBurstActive - set to ETrue if burst mode is active + * @param aSize - the id of the photo resolution + * @return the number of images + */ + TInt ImagesRemaining( TCamMediaStorage aStorage, + TBool aBurstActive, + TCamPhotoSizeId aSize ); + + /** + * Change the controller's current state + * Notifies controller observers of change + * @since 2.8 + * @param aNewState new state code + */ + void ChangeState( const TCamCameraState& aNewState ); + + /** + * Change the controller's target state. The state will not be + * altered if the controller is already in shutdown mode. + * @since 2.8 + * @param aNewState new state code + */ + void ChangeTargetState( const TCamCameraState& aNewState ); + + /** + * Change the controller's current operation + * Notifies controller observers of change + * @since 2.8 + * @param aNewOperation new operation code + * @param aError error code associated with new state (if any) + */ + void ChangeOperation( TCamCaptureOperation aNewOperation, + TInt aError = KErrNone ); + + /** + * Notify controller observers of an event. + * @since 2.8 + * @param aEvent event code + * @param aError error code + */ + void NotifyControllerObservers( TCamControllerEvent aEvent, + TInt aError = KErrNone ) const; + + /** + * Starts the viewfinder if the engine has been prepared for the + * current mode. + * @since 2.8 + */ + void StartViewFinderL(); + + /** + * Initiate image capture + * @since 2.8 + * @return ETrue if the capture was initiated otherwise EFalse + */ + TBool DoCaptureL(); + + /** + * Initiate video recording + * @since 2.8 + */ + void DoRecord(); + + /** + * Make a local copy of the viewfinder frame to use when + * the viewfinder is frozen + * @since 2.8 + */ + void CopyFrameL( const CFbsBitmap& aBitmap ); + + /** + * Reserve a set of file names for the current capture + * Store the reserved name(s) in iCaptureArray + * @since 2.8 + * @param aCaptureMode still, burst or video mode + * @param aForcePhoneMem force path to use Phone memory (C:) + */ + void ReserveFileNamesL( + const TCamCameraMode& aCaptureMode, + const TCamImageCaptureMode& aImageMode, + TBool aForcePhoneMem = EFalse ); + + /** + * Create a file ready for saving captured image into + * @since 2.8 + * @param aFs: Handle to RFs + * @param aFullPath: Full path including drive and extension + * @return error code from file creation + */ + TInt CreateDummyFileL( RFs& aFs, const TDesC& aFullPath ); + + + /** + * Store file name and full file name (incl. path) + * to burst capture array + * @since 2.8 + * @param aFullPath: Full path including drive and extension + */ + void StoreNextFileNameL( const TDesC& aFullPath ); + + /** + * Generate a new file name and full path for saving the next video + * according to the specified mode (unless specified otherwise) + * @since 2.8 + * @param aForcePhoneMem force path to use Phone memory (C:) + */ + void GenerateNextVideoFilePathL( TBool aForcePhoneMem = EFalse ); + + /** + * Generate a new path for saving the next image + * @since 3.0 + */ + void GenerateNextValidImagesPathL(); + + /** + * Generate a new file name and full path for saving the next video + * according to the specified mode. File will always be + * available. + * @since 2.8 + */ + void GenerateNextValidVideoPathL(); + + /** + * Handle a notification from the autofocus custom extension + * @since 2.8 + */ + void HandleAutoFocusNotification( TCamExtAutoFocus aNotification ); + + /** + * Static callback function for idle timer expiry + * @since 2.8 + * @param aPtr Pointer to an instance of the CCamAppController + * @return TInt to indicate if function should be called again + */ + static TInt IdleTimeoutL( TAny* aPtr ); + + /** + * Static callback function for time lapse timer expiry + * @since 3.0 + * @param aPtr Pointer to an instance of the CCamAppController + * @return TInt to indicate if function should be called again + */ + static TInt TimeLapseTimeoutL( TAny* aPtr ); + +private: // Deep sleep timer + /** + * Static callback function for camera deep sleep + * @since S60 5.0 + * @param aPtr Pointer to an instance of the CCamAppController + * @return TInt dummy + */ + static TInt DeepSleepTimeout( TAny* aPtr ); + + /** + * Deep sleep timeout handler + */ + void DoDeepSleepTimeout(); + +public: // Deep sleep timer + /** + * Start deep sleep timer + */ + void DeepSleepTimerStart(); + + /** + * Cancel deep sleep timer + */ + void DeepSleepTimerCancel(); + +private: + /** + * Set video length (max or short) + * @param aLength Length of video + * @since 2.8 + */ + void SetVideoLengthL( TInt aLength ); + + /** + * Returns the current photo storage location. + * @return the photo storage location + * @since 2.8 + */ + TInt CurrentPhotoStorageLocation() const; + + /** + * Returns the current video storage location. + * @return the video storage location + * @since 2.8 + */ + TInt CurrentVideoStorageLocation() const; + + /** + * Returns ETrue if the supplied toneId should be silent if the profile is + * set to silent. Does *not* take into account network variant forcing + * sounds on. + * @since 3.0 + * @param aSoundId The tone to check + * @return ETrue if sound should always be played, else EFalse + */ + TBool ToneShouldBeSilent( TCamSoundId aSoundId ); + + /** + * Report to any observers that capture processing has completed + * @since 3.0 + */ + void HandleCaptureCompletion(); + + /** + * Tries to autofocus, will do nothing if camera in use is not + * primary camera, or focus range has not been set first + * @since 3.0 + * @return Whether or not auto focus has been initiated + */ + TBool TryAutoFocus(); + + /** + * Checks the current scene, and where required, updates the autofocus + * mode in use. Called when the photo scene or based-on-scene change + * @since 3.0 + * @param aForceAFReset Whether to force a ResetToIdle independant of scene mode + */ + void CheckAfModeForScene( TBool aForceAFReset = EFalse ); + + /** + * Initalises the AutoFocus interface, if needed + * @since 3.0 + */ + void InitAutoFocusL(); + + /** + * Timeout to play capture tone after delay (to match + * capture tone to actual capture event) + * @since 3.0 + * @param aPtr TAny* ptr (cast to CCamAppController) + * @return Error code retruned by function + */ + static TInt CaptureToneDelayTimeout( TAny* aPtr ); + + /** + * Play the capture tone (called from capture delay timeout) + * @since 3.0 + */ + void PlayDelayedCaptureTone(); + + /** + * Copy Snapshot if needed. Helper function for McaeoSnapImageReady + * @since 3.0 + * @param aSnapshot the snapshot to copy + * @param aError Error code KErrNone to indicate success or a + * standard Symbian OS error code. + */ + void CopySnapshotIfNeeded(const CFbsBitmap& aSnapshot, TInt aError); + + + /** + * Checks whether flash is required for taking a picture. + * @return true if flash is required current mode + */ + TBool FlashRequired() const; + + +private: // Functions from base classes + + /** + * From MCamImageSaveObserver, image save has completed + * @since 2.8 + */ + void HandleSaveEvent( TCamSaveEvent aEvent ); + + /** + * From MCamImageSaveObserver, image save has completed + * @since 2.8 + */ + void HandleFileHarvestingComplete(); + + /** + * Idle timeout expiry - invoke switch to standby mode + * @since 2.8 + * @return TInt to indicate if function should be called again + */ + TInt DoIdleTimeoutL(); + + /** + * Time lapse timeout expiry - update the remaining time countdown + * or initiate the next capture if the full period has expired + * @return TInt to indicate if function should be called again + */ + TInt DoTimeLapseTimeoutL(); + + /** + * Force the application to use phone memory for Video and Image saving. + * Typically called when attempting to access MMC fails. + * @since 2.8 + */ + void ForceUsePhoneMemoryL( TBool aEnable = ETrue ); + + /** + * Complete the burst operation + * @since 2.8 + */ + void CompleteBurstOperation(); + + /** + * Complete the time lapse operation + * @since 3.0 + */ + void CompleteTimeLapseOperation(); + + + /** + * Whether or not the engine is currently processing a capture + * still, video or sequence. + * @since 2.8 + * @return ETrue if the engine is performing a capture operation + */ + TBool EngineProcessingCapture() const; + + /** + * Handle an arriving call. Stops video and cancels sequence capture + * in early stages. + * @since 2.8 + */ + void HandleIncomingCall(); + + /** +* Cleans up the controller active camera state + * @param aAny Pointer to the object which is the target + * of the cleanup operation + * @since 2.8 + */ + static void Cleanup( TAny* aAny ); + + /** + * Immediately cancels a still capture at any stage. + * @since 2.8 + */ + void CancelStillCaptureNow(); + + /** + * Attempt to cleanup capture array if burst capture fails + * @since 2.8 + * @param aImageCountDelivered number of images delivered + * @param aError error returned from burst capture operation + */ + void TidyCaptureArray( TInt aImageCountDelivered, + TInt aError ); + + /** + * Load 2ndary caera specifc settings (on construction or camera switch) + * @since 3.0 + */ + void LoadSecondaryCameraSettingsL(); + + // ------------------------------------------------------- + // Orientation sensor / rotation related +public: + + /** + * Get current orientation to be used on image rotation. + * Always ECamOrientation0 if rotation setting is OFF. + * @return Current image orientation value. + */ + TCamImageOrientation ImageOrientation() const; + + /** + * Checks if mass storage exist in current phone. + * @ return True if Mass storage exist + */ + TBool ExistMassStorage() const; + + /** + * Checks if a memory type is available on the phone. + * @param aStorage TCamMediaStorage enum specifiying the type of storage; + * default=ECamMediaStorageCurrent + * @return ETrue if the Memory type is available + */ + TBool IsMemoryAvailable( const TCamMediaStorage aStorage = + ECamMediaStorageCurrent, TBool aIgnoreUsbPersonality = EFalse ) const; + + public: + + /** + * Update the sensor api object + * @since 3.0 + * @param aStartupApi eTrue if we need to recreate the Api + */ + void UpdateSensorApiL( TBool aStartupApi ); + + /** + * Forces a refresh of the local copy of the back slide status + * @since 2.8 + */ + void RefreshSlideStatus(); + + private: + + /** + * From MSensrvDataListener receive Sensor Data + * + * Indicates data is available in the receiving buffer. A client can read + * the data through GetData()-function in the related channel object. Data + * is valid until the data received notification occurs again. + * + * @since 5.0 + * @param[in] aChannel Reference to the related channel object + * @param[in] aCount Data object count in receiving buffer. + * @param[in] aDataLost Number of lost data items. Data loss can occur if + * the client does not request new data from server fast enough. This + * can happen + * when system is under heavy load and the client process has lower + * priority than sensor server process. If data loss is a problem, + * consider using higher object count in data listening, which will reduce + * number of expensive IPC calls used in data transmission. + */ + void DataReceived( CSensrvChannel& aChannel, + TInt aCount, + TInt aDataLost ); + /** + * From MSensrvDataListener receive data error notice + * + * Data listening failed. + * If error was fatal, channel has also been closed and sensor server session + * terminated. If error was minor, some data has potentially been lost. + * + * @since 5.0 + * @param[in] aChannel Reference to the related channel object + * @param[in] aError Error code. + */ + void DataError( CSensrvChannel& aChannel, + TSensrvErrorSeverity aError ); + + /** + * From MSensrvDataListener + * + * Returns a pointer to a specified interface - to allow future extension + * of this class without breaking binary compatibility + * + * @since S60 5.0 + * @param aInterfaceUid Identifier of the interface to be retrieved + * @param aInterface A reference to a pointer that retrieves the specified interface. + */ + void GetDataListenerInterfaceL( TUid aInterfaceUid, + TAny*& aInterface ); + + /** + * Set image rotation parameters + * @since 3.0 + */ + void SetImageOrientationL(); + + /** + * Mapping from Sensor orientation data type to our own + * image orientation type. + * @param aSensorOrientation Orientation Sensor device orientation value. + * @return Camera orientation value. + */ + static TCamImageOrientation MapSensorOrientatio2CamOrientation( + const TSensrvOrientationData::TSensrvDeviceOrientation& aSensorOrientation, TCamImageOrientation aLastImageOrientation); + + /** + * Mapping from camera orientation data type to bitmap orientation type. + * @param camera orientation value. + * @return CBitmapRotator::TRotationAngle. + */ + static CBitmapRotator::TRotationAngle MapCamOrientation2RotationAngle( + const TCamImageOrientation aOrientation ); + + // ------------------------------------------------------- + + private: + + /** + * From MPropertyObserver Handle change in a watched property + * @since 2.8 + * @param aCategory The type of property + * @param aKey The property that has changed + */ + void HandlePropertyChangedL( const TUid& aCategory, const TUint aKey ); + + private: + + /** + * Callback function that is called when lens cover state changes. + * Used to implement delayed handling of lens cover events. + * @param aPtr Pointer to CCamAppController + * @return + */ + static TInt LensCoverUpdateL( TAny* aPtr ); + + /** + * Handles the slide closed event + * @since 2.8 + */ + void HandleSlideClosedL(); + + /** + * Handles the slide open event + * @since 2.8 + */ + void HandleSlideOpenedL(); + + + private: // Functions from base classes + + /** + * From MCamObserver + * Receives event codes from observables + * @since 3.0 + * @param aEvent The event code + */ + void HandleObservedEvent( TCamObserverEvent aEvent ); + + /** + * Returns whether or not the current profile is silent + * @since 3.0 + * @return ETrue if current profile is silent + */ + TBool IsProfileSilentL(); + + /** + * Static callback function for backlight timer reset + * since 3.0 + * @param aPtr Pointer to an instance of the CCamAppController + * @return TInt to indicate if function should be called again + */ + static TInt ResetInactivityTimer( TAny* aPtr ); + + /** + * Enable or disable the system screensaver + * @since 3.0 + * @param aEnable ETrue if the screensaver is enabled + * else EFalse + */ + void EnableScreenSaver( TBool aEnable ); + + /** + * Static callback function for timer callback for closing + * location trail. + * @since S60 v5.0 + * @param aPtr Pointer to an instance of the CCamAppController + * @return TInt to indicate if function should be called again + */ + static TInt RetryStopLocationTrail( TAny* aPtr ); + + public: + void StartLocationTrailL(); + void StopLocationTrail( TBool aCloseSession = EFalse ); + + public: + /** + * Returns a pointer to flash status object. Never NULL if + * ConstructL has been executed successfully. + * @return flashStatusPointer + */ + CCamFlashStatus* FlashStatus() const; + + /** + * Returns false, if a picture cannot be taken, due to flash being + * required and recharged, true otherwise. + * @return flashstatus + */ + TBool CheckFlash() const; + + /** + * Called when about to switch to burst or timelapse mode. Stores + * the current flash mode and scene. + */ + void SaveFlashMode(); + + /** + * Called when switching to single image capture mode. Restores + * flash mode, if using same scene mode as was used when the + * flash mode was stored. Otherwise clears the stored info. + */ + void RestoreFlashMode(); + + public: + /** + * Returns a pointer to dynamic Configuration Manager. + * + * Never NULL if ConstructL has been executed successfully. + * @return Pointer to Configuration Manager + */ + CCamConfiguration* Configuration() const; + + + /** + * Returns whether or not the keylock is on + * @since 5.0 + * @return ETrue if keylock is on, otherwise EFalse + */ + TBool IsKeyLockOn(); + + /** + * Used to get whether user is sliding in the self timer preview. + * @return ETrue if user is sliding in the self timer preview. + */ + inline TBool IsSlideInSelfTimerPreview() const { return iSlideInSelfTimerPreview; }; + + /** + * Used to set whether user is sliding in the self timer preview. + * @param aValue the value to indicate whether user is sliding in the self timer preview. + */ + inline void SetSlideInSelfTimerPreview( TBool aValue ) { iSlideInSelfTimerPreview = aValue; }; + + /** + * Used to get the current storage. + * @return the current storage. + */ + TCamMediaStorage CurrentStorage(); + + /** + * Returns whether autofocus is still needed before capturing. + * @return ETrue if it's necessary to try autofocus one more time before the capture. + */ + TBool IsAfNeeded(); + + /** + * Sets an autofocus needed flag, so that autofocus is done after cancel and range set are finished. + */ + void SetAfNeeded( TBool aAfNeeded ); + + /** + * Returns whether recording was stopped because USB was connected. + * @return ETrue if video recording was stopped because USB was connected. + */ + TBool IsCaptureStoppedForUsb(); + + /** + * set the flag of iSetCaptureStoppedForUsb. + */ + void SetCaptureStoppedForUsb( TBool aCaptureStoppedForUsb ); + + /** + * Cancels the memory card dismount monitoring + */ + void CancelDismountMonitoring(); + + /** + * Start the memory card dismount monitoring + */ + void StartDismountMonitoring(); + + /** + * Returns whether all snapshots have been received in burst mode + * @return ETrue if all snapshots have been received in burst mode. + */ + TBool AllSnapshotsReceived(); + + /** + * Returns the last made autofocusrequest type or 0, if there are + * no pending autofocus requests. + */ + TInt PendingAFRequest(); + + /** + * Calculates the remaining video recording time based on video + * quality settings (instead of getting the value from camera + * controller) + * @param aStorage TCamMediaStorage enum specifying the type of storage; + * default=ECamMediaStorageCurrent + * @return remaining time + */ + TTimeIntervalMicroSeconds + CalculateVideoTimeRemainingL(const TCamMediaStorage + aStorage = ECamMediaStorageCurrent); + /** + * Sets orientation of the application to CCamera + * + */ + void SetCameraOrientationModeL( TInt aOrientation ); + + /** + * Final part in constructing cameracontroller + * + */ + void CompleteCameraConstructionL(); + + /** + * Returns index of current image. + */ + TInt CurrentImageIndex(); + + /** + * Sets the value defining the need for CAE video init and prepare + */ + void SetVideoInitNeeded( TBool aVideoInitNeeded ); + + /** + * Returns the value defining the need for CAE video init and prepare + */ + TBool VideoInitNeeded(); + + private: + + // ----------------------------------------------------- + // Construction parts + + void ConstructCameraControllerL( TInt aCameraIndex ); + + // ----------------------------------------------------- + // Helper utility methods + TInt GetCriticalMemoryLevelL( const TCamMediaStorage& aStorage ); + + // ----------------------------------------------------- + // Events and requests handling + void EventHandlingErrorRecovery( TInt aError ); + + void HandleSequenceEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData ); + + void HandleRequestEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData ); + + void HandleSettingEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData ); + + void HandleImageCaptureEventL( TInt aStatus, + CCamBufferShare* aShare ); + void HandleImageStopEventL( TInt aStatus, + TInt aFullCaptureCount ); + + void HandleViewfinderFrame( TInt aStatus, CFbsBitmap* aFrame ); + void HandleSnapshotEvent( TInt aStatus, CFbsBitmap* aBitmap ); + void HandleVideoAsyncStopEvent( TInt aStatus ); + void HandleVideoStopEvent( TInt aStatus ); + + void IssueModeChangeSequenceL( TBool aStartup = EFalse ); + void GenerateModeChangeSequenceL( RCamRequestArray& aSequence ); + void GenerateStartupSequenceL( RCamRequestArray& aSequence ); + + void IssueRequestL( const TCamCameraRequestId& aId ); + void IssueDirectRequestL( const TCamCameraRequestId& aId ); + void IssueSettingsChangeRequestL(); + + void ProceedPendingOrNotifyReadyL(); + + void DoVideoNameRetryL( TInt aStatus ); + + /** + * Sets the current image/video settings from UI to camera, by calling + * RestoreSettingIfNecessaryL for each supported setting, and starting + * the setting process if any of them needs setting. + * This function needs to be called after camera release and switches + * between image/video mode. + */ + void RestoreSettingsToCameraL(); + + /** + * Checks if the setting needs restoring (UI setting value doesn't match + * the actual setting value in camera). In that case, function adds + * this setting to the list of pending settings. + * @param aSettingItem Setting item id + */ + void RestoreSettingIfNecessaryL( TCamSettingItemIds aSettingItem ); + + /** + * Checks if the setting needs restoring (UI setting value doesn't match + * the actual setting value in camera). In that case, function + * directly set settting to camera + * @param aSettingItem Setting item id + */ + void DirectRestoreSettingIfNecessaryL( TCamSettingItemIds aSettingItem ); + + /** + * Set internal state based on camera event. + */ + void SetStateFromEvent( TCamCameraEventId aEventId ); + + void InitCaptureLimitL(); + + static TCamCameraRequestId + NextRequestL( const TCamCameraState& aFrom, + const TCamCameraState& aTo ); + + static TCamCameraEventId + ResponseForRequest( const TCamCameraRequestId& aRequestId ); + + + /** + * Called when mmc is about to be dismounted + */ + TInt DriveChangeL( TCamDriveChangeType aType ); + + /** + * Rotate the snapshot copy before thumbnail creation + */ + void RotateSnapshotL(); + + /** + * Handle change in image quality setting. + * Handle stopping viewfinder, re-preparing quality and + * restarting viewfinder if viewfinder is running. + * Notify observers about quality change. + */ + void HandleImageQualitySettingChangeL(); + + // ======================================================= + private: // Data + TBool iValueIsStored; + CCamCameraController* iCameraController; + CCamSettingProvider* iSettingProvider; + + TUint iBusyFlags; // TCamBusyFlags values + TCamAppControllerInfo iInfo; + + // Temporarily stop notifications to observers + TBool iMuteNotifications; + + // Observers of controller events + RPointerArray iControllerObservers; + TInt iCameraReferences; + + // The settings model for dynamic and static data. + // CCamSettingsModelBase* iSettingsModel; + MCamSettingsModel* iSettingsModel; + MCamSettingPreviewHandler* iSettingsPreviewHandler; // Currently same object as iSettingsModel. + RArray iPreviewRollbacks; // Used when cancelling previews. + + // Used to indicate whether user is sliding in the self timer preview. + TBool iSlideInSelfTimerPreview; + + TBool iVideoPrepareNeeded; // Video re-prepare needed due to setting change + + // Boolean to record if view finder should be frozen at next frame + TBool iFreezeViewFinder; + // Boolean to indicate that the frozen frame should be updated + TBool iUpdateFrozenFrame; + + // name for next file, including path and extension + TFileName iSuggestedVideoPath; + // Used to indicate that the media storage has been changed tbe + // pathnames need to be checked + TCamMediaStorage iSetNewPathnamesPending; + // Counters used for creating multiple month folders + TInt iMonthFolderCounters[CCamFolderUtility::ECamFolderTypeLast]; + // Counter for image number. + // Stored locally to avoid performance problems during burst. + TInt iImageNumberCache; + + // Whether or not the engine is initialized for video recording + TBool iVideoRecorderInitialized; + + // estimate of record time elapsed + TTimeIntervalMicroSeconds iVideoTimeElapsed; + // estimate of record time remaining + TTimeIntervalMicroSeconds iVideoTimeRemaining; + + // Whether or not a capture mode transition is in progress + TBool iCaptureModeTransitionInProgress; + + // Active object for saving images to file asynchronously + CCamImageSaveActive* iImageSaveActive; + // Array containing data that represents the images in a burst capture + CCamBurstCaptureArray* iCaptureArray; + // Index into burst capture array used to determine current image for + // SnapshotImage(), CurrentImageName(), CurrentFullFileName() and + // DeleteCurrentFile(). Set by call to SetAsCurrentImage(). + // Single capture and video always use index 0. + TInt iCurrentImageIndex; + // Filenames for a timelapse sequence used for the delete sequence option + CDesCArray* iSequenceFilenameArray; + // Tracks usage of the capture array, for timely release of memory + TInt iArrayUsageCount; + // Capture count requested. + // Used in burst and self-timer+timelapse modes. + TInt iRequestedCaptureCount; + // Indicates wheter autofocuscancel requests should be handled or not.. + // Used in CancelFocusAndCapture. + TBool iNoBurstCancel; + + // Indicates if capturekey has been raised or not. This is used to + // determine if bursttimer should be activated or not. + TBool iKeyUP; + + // Timer to control when short burst is changed to press and hold burst. + CCamTimer* iBurstTimer; + // Timer for switch to standby mode + CCamTimer* iIdleTimer; + // Timer for initiating Time Lapse captures + CCamTimer* iTimeLapseTimer; + + // Status variable for location trail + TBool iLocationTrailStarted; + + // Timer for stopping location trail + CCamTimer* iLocationTrailTimer; + + // Whether or not a capture key pressed during image saving + TBool iCaptureKeyPressedWhileImageSaving; + // flag to indicate current VF status + TBool iViewFinding; + // timer to keep backlight active while VF is running + CPeriodic* iBacklightTimer; + // Class for playing sounds + CCamAudioPlayerController* iSoundPlayer; + CRepository* iRepository; + TInt iDiskCriticalLevel; // critical threshold for card storage + TInt iRamDiskCriticalLevel; // critical threshold for phone memory storage + // Whether we are currently in a call or ringing + TBool iInCallOrRinging; + // Keep track of whether we are currently saving a video clip or image + TBool iSaving; + TBool iSaveStarted; + // Keep track of whether a ReleaseEngine call has been made while an Init call has been made + TBool iPendingRelease; + TBool iEndKeyWaiting; + TBool iCompleteTimeLapsePending; + TBool iAutoFocusRequested; + TBool iCaptureRequested; + TBool iVideoRequested; + TBool iAfNeeded; + + TBool iDemandKeyRelease; // Demand to release capture key + + // Keep track of the camera that the next switch will activate + TInt iNextSwitchIsToPrimaryCamera; + + // Flag for queued Camera switch operation + TCameraSwitchRequired iCameraSwitchRequired; + + TBool iForceUseOfPhoneMemory; + + // Keeps track of the number of times we have attempted to set the video name + TInt iVideoNameRetries; + + // Specified whether an image save request is pending. That is, + // we are waiting for the engine to return with an image that can be saved. + // Required to let post-capture know whether an image has been saved yet. + TBool iImageSaveRequestPending; + + // Keeps track of the camera slider state so that + // we don't have to keep accessing the shared data file + TInt iSlideState; + TInt iNewSlideState; + + // callback used for delayed slider update + CPeriodic* iSliderCallBack; + + // Slider event flag + TBool iSliderCloseEvent; + + // The period between each timelapse capture + TTimeIntervalMicroSeconds iTimeLapseInterval; + // The time at which the previous timelapse capture was initiated + TTime iTimeLapseStartTime; + + + + CSensrvChannel* iAccSensorChannel; + TBool iAccSensorListening; + TBool iAccSensorInfoInitialized; + // Flag to allow delayed re-preparation of engine + TBool iOrientationChangeOccured; + + // Outside flags, as available for Camera Controller at all times. + TCamImageOrientation iImageOrientation; + TCamImageOrientation iLastImageOrientation; + + // Property watcher to report changes in the slide state + CCamPropertyWatcher* iSlideStateWatcher; + // Property watcher to report changes in the keylock state + CCamPropertyWatcher* iKeyLockStatusWatcher; + // Set to ETrue if shutter sound always played + // otherwise playing shutter sound depends on + // current profile + TBool iShutterSndAlwaysOn; + // Active object to listen to the call state. + CCamCallStateAo* iCallStateAo; + // Organises notifications to observers of capture completion + CCamObserverHandler* iCaptureCompletionObserverHandler; + TInt iActualBurst; + CCamTimer* iCaptureToneDelayTimer; + // Whether or not the video was stopped due to the phone app + // having the foreground + TBool iVideoStoppedForPhoneApp; + // used to simulate the receipt of a viewfinder frame when + // timelapse capturing. + CFbsBitmap* iSnapShotCopy; + // estimated snapshot size in bytes - used when monitoring free + // RAM during burst capture + TInt iSnapshotDataSize; + // array of estimated jpeg sizes in bytes for different image + // resolutions - used when monitoring free RAM during burst capture + RArray iJpegDataSizes; + // array of estimated post capture sizes required in bytes for + // different image resolutions - used when monitoring free RAM + // during burst capture + RArray iSequencePostProcessDataSizes; + // Array of CameraEventInterested observers which wanted to be camera + // observers when camera wasn't yet created. When camera is created + // Observers from this array should be attached first and array should + // be cleared. + RArray iPendingObserversArray; + RArray iCameraEventInterested; + + // Used to wake the camera hardware approximately 2-3 seconds before + // a timelapse capture + TBool iCameraWoken; + TBool iZoomWaitingForCamera; + TBool iNewZoomPending; + TInt iDesiredZoomVal; + + TBool iSequenceCaptureInProgress; + TInt iLongSequenceLimit; + + // Boolean to determine whether filename has already been + // reserved for the image being currently captured. Reserving + // is done when either the image's snapshot snapshot or + // image data arrives. (But not again when the other one comes) + TBool iFilenameReserved; + TCamEvCompRange iEvRange; + +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) + RLocationTrail iLocationUtility; + TBool iLocationUtilityConnected; +#endif // __WINSCW__ + +#ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT + TCamPerformanceState iPerformanceState; +#endif + + TBool iAppUiAvailable; + // If this boolean is set to true, the next focus successful + // or focus failed event should be ignored as it's resulted by + // moving lens to hyperfocal position when cancelling AF. + TBool iAFCancelInProgress; + // Holds last made autofocusrequest type or 0, if there are no + // pending autofocus requests. + TInt iPendingAFRequest; + // AFrequest currently in processing. + TInt iCurrentAFRequest; + CCamFlashStatus* iFlashStatus; + TBool iFlashModeSaved; + TCamSceneId iSavedFlashScene; + TCamFlashId iSavedFlashMode; + TBool iSettingsRestoreNeeded; + CCamConfiguration* iConfiguration; //< Configuration Manager. *owned* + CCFClient* iContextFwClient; + TBool iDefineContextSuccessful; + TBool iStorageChangeProcessOngoing; + // own. + CCamGSInterface* iPlugin; + TBool iSilentProfile; + TInt iTimeLapseCaptureCount; + RFs iFs; + CCamDriveChangeNotifier* iDriveChangeNotifier; + TCamMediaStorage iCurrentStorage; + TCamMediaStorage iPreferredStorageLocation; + TCamMediaStorage iForcedStorageLocation; + TCamMediaStorage iInitialVideoStorageLocation; + TBool iCaptureStoppedForUsb; + TBool iDismountPending; + TBool iAllSnapshotsReceived; + CCamTimer* iDeepSleepTimer; // own + TBool iDeepSleepTimerExpired; + // not owned by camappcontroller + CCameraUiConfigManager* iConfigManager; + TBool iVideoInitNeeded; // Used to decide if the need to call CAE video init //PS + CCamSyncRotatorAo* iRotatorAo; + CFbsBitmap* iRotatedSnapshot; + CCamBurstCaptureArray* iRotationArray; + // orientation at capture time + TCamImageOrientation iCaptureOrientation; + + }; + +#endif // CAMAPPCONTROLLER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamAppUi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamAppUi.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1811 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: App UI class for cameraapp +* +*/ + + +#ifndef CAMAPPUI_H +#define CAMAPPUI_H + +// =========================================================================== +// INCLUDES +#include "CamAppUiBase.h" +#include "CamNewFileService.h" +#include "CamSelfTimerObserver.h" +#include "CamVolumeKeyObserver.h" +#include "mcamcameraobserver.h" +#include "CamFileCheckAo.h" + +#include "MCamAddToAlbumObserver.h" + +class CFbsBitGc; +class CAknNavigationDecorator; +class CAknNavigationControlContainer; +class CCamWaitDialog; +class CCamTimerBase; +class CCamNaviCounterControl; +class CCamNaviCounterModel; +class CCamNaviProgressBarControl; +class CCamNaviProgressBarModel; +class CCamSelfTimer; +class MCamBurstModeObserver; +class CDocumentHandler; +class CTextResolver; +class CCamSidePane; +class CCamZoomPane; +class MCamResourceLoader; +class CCamTimer; +class CIdle; +class CAknStylusPopUpMenu; + +class CGSPluginInterface; +class CGSTabHelper; +class CCamGSInterface; + +class CAknGlobalNote; + +//class CASpaAppLauncherActionData; +//class CSFIUtilsAppInterface; // InCall Send interface +class CCamPropertyWatcher; +class CRepository; +class MActivePalette2UI; +class CCamActivePaletteHandler; +class CAknLocalScreenClearer; +class CAknStaticNoteDialog; +class CCamCollectionManagerAO; +class CCamStillPreCaptureView; +class CCamVideoPreCaptureView; +class CCamMemoryMonitor; + +// =========================================================================== +// CLASS DECLARATION + +/** +* AppUi class for Camera +* +* @since 2.8 +*/ +class CCamAppUi : public CCamAppUiBase, + public MCamSelfTimerObserver, + public MCamControllerObserver, + public MCamVolumeKeyObserver, + public MCamFileCheckObserver, + public MCamCameraObserver + ,public MCamAddToAlbumObserver + { + // ======================================================= + // Data Types + private: + + // enumeration to describe the type of view switch required when + // the capture mode or view state changes + enum TCamViewSwitch + { + ECamViewSwitchNone, // no switch required + ECamViewSwitchModeOnly,// only capture mode or view state need updating + ECamViewSwitch // full view switch required including state + // and mode update + }; + + /** + * Enumeration used for the state of delayed postacapture views + * construction. Only used if CAMERAAPP_DELAYED_POSTCAPTURE_CREATION is + * enabled. + */ + enum TCamPostCapConstruction + { + ECamConstructStillPostCap, + ECamConstructBurstPostCap, + ECamConstructVideoPostCap, + ECamPostCapsDone + }; + + enum TSoftkeyIndex + { + ESoftkeyIndex1 = 0, + ESoftkeyIndex2 = 2 + }; + + enum TPendingViewSwitchType + { + EPendingViewSwitchNone = 0, + EPendingViewSwitchNormal, + EPendingViewSwitchDeactivateFirst + }; + + /** + * Memory card status + */ + enum TCamMemoryStatus + { + ECamMemoryStatusOK, + ECamMemoryStatusFull, + ECamMemoryStatusInternalFull, + ECamMemoryStatusCardNotInserted, + ECamMemoryStatusCardReadOnly, + ECamMemoryStatusCardLocked, + ECamMemoryStatusMassStorageFull + }; + + // ======================================================= + // Methods + + // ------------------------------------------------------- + // Constructors and destructor + public: + + /** + * C++ constructor. + * @since 2.8 + * @param aController Reference to CCamAppController + * @return Pointer to CCamAppUi + */ + CCamAppUi( CCamAppController& aController ); + + /** + * Perform the second phase construction of a CCamAppUi object. + * @since 2.8 + */ + void ConstructL(); + + /** + * Destructor. + */ + virtual ~CCamAppUi(); + + // ------------------------------------------------------- + // From MCamCameraObserver + public: + + /** + * Handle camera event. + * + * @param aStatus Status code describing the event status. + * @param aEventId Identifier for the event. + * @param aEventData Event associated data. If such data is provided with + * the event, it is mentioned in the documentation of + * particular event id. + * Ownership not transferred to observer. + */ + void HandleCameraEventL( + TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData = NULL ); + + // ------------------------------------------------------- + // From MCamFileCheckObserver + public: + + /** + * Callback to notify that file checking operation has completed. + * @param aStatus Number of files that were missing + * @param aError Error code + */ + void FileCheckingCompleteL( TInt aStatus, TInt aError ); + + // ------------------------------------------------------- + // New functions + public: + /** + * Returns whether or the toolbar has been activated/visible + * Will return ETrue when when the toolbar is active/visible + * @since 3.2 + * @return ETrue if toolbar is active/visible, else returns EFalse + */ + virtual TBool IsToolBarVisible() const; + + /** + * Check if given view state indicates that "internal", + * CCamViewBase inherited view is in question. + */ + TBool IsInternalView( TCamViewState aViewState ) const; + + /** + * Set status of standby mode. + */ + void SetStandbyStatus( TInt aStatus ); + + /** + * Get status of standby mode. + */ + TInt StandbyStatus() const; + + /* + * Check for file name deletion/renaming outside camera + */ + void StartFileNameCheck(); + + /** + * Determines whether or not all construction has been completed + * Used on view activation to determine if the view should + * open in standby mode. This will happen if the app is waiting for + * an orientation switch to complete or for the initial view to be set + * when launched in embedded + * @since 3.0 + * @return ETrue if all construction has completed, else EFalse + */ + TBool IsConstructionComplete() const; + + /** + * Set title pane text from a resource. + * @since 2.8 + * @param aResourceId resource to read from + */ + void SetTitleL( TInt aResourceId ); + + /** + * Set title pane text from a descriptor. + * @since 2.8 + * @param aText title pane text + */ + void SetTitleL( const TDesC& aText ); + + /** + * In embedded mode set title to name of embedding application + * @since 2.8 + */ + void SetTitleEmbeddedL(); + + /** + * Push navi pane indicators on to navi pane stack. + * @since 2.8 + */ + void PushNaviPaneCounterL(); + + /** + * Push navi pane progress bar on to navi pane stack. + * @since 2.8 + */ + void PushNaviPaneProgressBarL(); + + /** + * Push default navi pane on to navi pane stack. + * @since 2.8 + */ + void PushDefaultNaviPaneL(); + + /** + * Call DisplayDeleteNoteL on the current view + * @return whether the delete was performed + * @since 2.8 + */ + TBool DisplayDeleteNoteL(); + + /** + * Enable or disable self-timer functionality + * @since 2.8 + * @param aEnable The selftimer functionality to use + */ + void SelfTimerEnableL( TCamSelfTimerFunctions aEnable ); + + /** + * Returns current self-timer state + * @since 2.8 + * @return Returns whether or not Self Timer is currently enabled. + */ + TBool SelfTimerEnabled() const; + + /** + * Returns pointer to self-timer + * @since 2.8 + * @return pointer to CCamSelfTimer object. + */ + CCamSelfTimer* SelfTimer(); + + /** + * Registers an observer for changes in burst mode activation + * @since 2.8 + * @param aBurstModeObserver the object observing burst mode changes + */ + void AddBurstModeObserverL( MCamBurstModeObserver* aBurstModeObserver ); + + /** + * Removes an observer for changes in burst mode activation + * @since 2.8 + * @param aBurstModeObserver the observer to remove + */ + void RemoveBurstModeObserver( const MCamBurstModeObserver* aBurstModeObserver ); + + /** + * Returns whether or not burst capture mode is enabled. + * Will return ETrue when burst mode is enabled for still capture + * even if the application is currently in video capture mode + * @since 2.8 + * @return ETrue if burst mode is enabled, else returns EFalse + */ + TBool IsBurstEnabled() const; + + /* + * Gets the handle to the controller, which is used inturn by the + * plugin to call the interfaces for performing needed actions. + */ + MCamAppController& AppController(); + + /* + * Gets the handle to the settings model, which is used inturn by the + * plugin to call the interfaces for performing needed actions. + */ + MCamStaticSettings& StaticSettingsModel(); + + /** + * Returns the currently enabled burst mode. + * @since 3.0 + * @return the currently enable burst mode or ECamImageCaptureNone if + * burst is not enabled + */ + TCamImageCaptureMode CurrentBurstMode() const; + + /** + * Sets the current capture mode ( and target capture mode ) + * @since 2.8 + */ + void SetCaptureMode( + TCamCameraMode aMode, + TCamImageCaptureMode aImageMode = ECamImageCaptureNone ); + + /** + * Changes the state of sequence capture + * @since 3.0 + * @param aImageMode Single/Multi/Timelapse + * @param aReprepare Whether or not the engine should be reprepared with sequence + * settings (Do not reprepare if the engine is about to be deleted/released) + * @param aUpdateUi Whether or not to do Ui update related things. Those are not + * needed/allowed if this method is called just to return sequence mode setting + * to default value (single capture). + */ + void SwitchStillCaptureModeL( TCamImageCaptureMode aImageMode, + TBool aReprepare, + TBool aUpdateUi = ETrue ); + + + /** + * Returns whether or the secondary camera has been activated + * Will return ETrue when when the second camera is active + * @since 2.8 + * @return ETrue if second camera is active, else returns EFalse + */ + TBool IsSecondCameraEnabled() const; + + /** + * Secondary camera orientation is constructed according to this flag. + * Flag can be forced to portrait/landscape or it can follow qwerty + * state. Variation is handled via KCamCr2ndCamOrientation CenRep key. + * @param aLock, Lock orientation state flag. + * ETrue, ask state and lock it. + * EFalse, ask current state. + * @return ETrue if secondary camera orientation must be landscape + */ + TBool IsQwerty2ndCamera( TBool aLock = EFalse ); + + /** + * + * @return ETrue if wait dialog exist + */ + TBool CCamAppUi::IsWaitDialog() const; + + /** + * Returns the active camera + * @since 2.8 + * @return either primary, secondary or none ( if in process of switching ) + */ + TCamActiveCamera ActiveCamera() const; + + /** + * Called just prior to capture. Checks if there is sufficient memory + * available for capture and handles out of memory/error conditions. + * @since 2.8 + * @return ETrue if there is memory available for capture + */ + TBool CheckMemoryL(); + + /** + * Display error note - with OK softkey only + * @since 2.8 + * @param aStatus error status + */ + void ShowErrorNoteL( TCamMemoryStatus aStatus ); + + /** + * Display error note for OOM condition - OK and Cancel softkeys + * @since 2.8 + * @param aLabel text to be shown + * @param aWithCancel Enables cancel softkey; default=ETrue + * @return Response code returned from Out of memory dialog + */ + TInt ShowOOMNoteL( TDesC& aLabel, TBool aWithCancel = ETrue); + + /** + * Set the requested resolution for a new file + * @since 3.2 + * @param aRequestedResolution the requested resolution from the new file request. + */ + void SetRequestedNewFileResolution( const TSize& aRequestedResolution ); + + /** + * Get the requested resolution for a new file + * @since 3.2 + * @return the requested resolution from the new file request. + * Default is TSize(0,0) which interpreted as mms quality resolution + */ + TSize RequestedNewFileResolution() const; + + /** + * Shows the mmc removal note if it is required + * @since 2.8 + */ + void ShowMMCRemovalNoteIfRequiredL(); + + /** + * Check memory card for available space and card status + * @since 2.8 + * @param aFull on return contains ETrue if card is full + * @param aStatus on return contains the card status + * @param aCurrentLocation current storage location + */ + void CheckMemoryCard( TBool& aFull, + TCamMemoryStatus& aStatus, TCamMediaStorage aCurrentLocation ); + + /** + * Checks if aStorage location is full + * @since 2.8 + * @param aStorage target storage location + * @param aCurrentLocation current storage location + * @return ETrue if aStorage location is full + */ + TBool MemoryFull( TCamMediaStorage aStorage, TCamMediaStorage aCurrentLocation ); + + /** + * Starts the video/photo capture + * @since 2.8 + * @param aKeyEvent Key used to start the capture + * @return whether the key was consumed by the function + */ + TKeyResponse StartCaptureL( const TKeyEvent& aKeyEvent ); + + /** + * Stops the video capture + * @since 2.8 + */ + void EndCapture(); + + /** + * Changes the orientation to aNewOrientation + * If aNewOrientation is EAppUiOrientationUnspecified, switches + * to the normal orientation (this may depend on the currently + * activated camera) + * @since 3.0 + */ + void SwitchOrientationIfRequiredL( TInt aNewOrientation ); + + /** + * Returns pointer to side-pane + * @since 2.8 + * @return pointer to CCamSidePane object constructed by appUi + */ + CCamSidePane* SidePane(); + + /** + * Returns pointer to zoom-pane + * @since 2.8 + * @return pointer to CCamZoomPane object constructed by appUi + */ + CCamZoomPane* ZoomPane(); + + /** + * Returns current camera orientation + * @since 3.0 + * @return current camera orientation + */ + TCamOrientation CamOrientation(); + + /** + * set current camera orientation as landscape + */ + void SetCamOrientationToLandscape(); + + /** + * Returns current viewstate + * @since 3.0 + * @return current viewstate + */ + TCamViewState CurrentViewState() const; + + /** + * Returns target view state + * @since 4.0 + * @return target view state + */ + TCamViewState TargetViewState(); + + /** + * Returns the target mode of current mode switch + * (Image/Video/Idle/Shutdown). The returned value + * should equal to current state, if no switch is + * in progress + */ + TCamCameraMode TargetMode() const; + + /** + * Handles the shutter key press + * @param aPressed ETrue if the shutter is pressed, EFalse if released + * @since 2.8 + */ + void HandleShutterKeyL( TBool aPressed ); + + /** + * Set embedding flag + * @param aEmbedding ETrue if we are embedding (ie Messaging, Realplayer), + * EFalse if not + * @since 2.8 + */ + void SetEmbedding( TBool aEmbedding ); + + /** + * Return embedding flag + * @return ETrue if we are embedding (ie Messaging, Realplayer), + * EFalse if not + * @since 2.8 + */ + TBool Embedding() const; + + /** + * Set SendAs flag + * @param aSendAsInProgress ETrue if SendAs in progress, EFalse if not + * @since 2.8 + */ + void SetSendAsInProgressL( TBool aSendAsInProgress ); + + /** + * Get SendAs flag value + * @return ETrue if SendAs in progress, EFalse if not + * @since 4.0 + */ + virtual TBool SendAsInProgress() const; + + /** + * Offers a pointer to appui's TextResolver instance + * @return pointer to appui's TextResolver instance + */ + CTextResolver* TextResolver(); + +#ifndef __WINSCW__ + /** + * Get pointer to SFI utility class + * @since 3.0 + * @return pointer to CSFIUtilsAppInterface + */ + //CSFIUtilsAppInterface* SFIUtility() const; + + /** + * Return whether we are currently in-call send + * @since 3.0 + * @return TBool true if we are in in-call send mode + */ + //TBool IsInCallSend() const; + + /** + * Send media file using SFI utility + * @since 3.0 + */ + //void DoInCallSendL() const; +#endif //WINSCW + + /** + * Whether or not the application is in the background + * @since 2.8 + * @param aIncludeNotifier If EFalse then the application is not + * classed as being in the background if the foreground application is + * a notifier, e.g. charging enabled. + * @return ETrue if the application is in the background + */ + TBool AppInBackground( TBool aIncludeNotifier ) const; + + /** + * Indicates whether or not the application is in a simulated exit situation + * @return ETrue if the application has pretended to exit, else EFalse + */ + TBool IsInPretendExit() const; + + /** + * Returns whether an MMC removed note is pending + * @since 3.0 + * @return TBool ETrue if the UI needs to show an MMC + */ + TBool IsMMCRemovedNotePending() const; + + /** + * Returns the pointer to the NaviCounter pane + * @since 3.0 + * @return The Navi Counter pointer + */ + CCamNaviCounterControl* NaviCounterControl(); + + /** + * Returns the pointer to the NaviProgress pane + * @since 3.0 + * @return The Navi Progress pointer + */ + CCamNaviProgressBarControl* NaviProgressBarControl(); + + /** + * Returns the pointer to the Navi Counter ModelProgress pane + * @since 3.0 + * @return The Navi Counter Model pointer + */ + CCamNaviCounterModel* NaviCounterModel(); + + /** + * Return handle to active palette if supported + * @since 3.0 + * @return Handle to Active palette + */ + MActivePalette2UI* ActivePalette() const; + + /** + * Get pointer to Active Palette handler instance. + * + * @return Pointer to Active Palette handler instance. Ownership not + * transferred. + */ + CCamActivePaletteHandler* APHandler() const; + + /** + * Tries to show or hide the Active Toolbar + * @since 3.0 + * @param aShown True to show it, False to hide it + */ + void SetActivePaletteVisibility( TBool aShown ); + + /** + * Returns whether the user has set the icons to always display in pre-capture + * @since 3.0 + * @return ETrue if the optional icons should always be displayed + */ + TBool AlwaysDrawPreCaptureCourtesyUI() const; + + /** + * Returns whether the user has set the icons to always display in post-capture + * @since 3.0 + * @return ETrue if the optional icons should always be displayed + */ + TBool AlwaysDrawPostCaptureCourtesyUI() const; + + /** + * Set whether the icons should always display in pre-capture + * @since 3.0 + * @param aNewSetting True if they should always be drawn; False if they should only be drawn when the UI is raised + */ + void SetAlwaysDrawPreCaptureCourtesyUI( TBool aNewSetting ); + + /** + * Set whether the icons should always display in post-capture + * @since 3.0 + * @param aNewSetting True if they should always be drawn; False if they should only be drawn when the UI is raised + */ + void SetAlwaysDrawPostCaptureCourtesyUI( TBool aNewSetting ); + + /** + * Check whether a key event should cause the courtesy UI to be raised + * @since 3.0 + * @param aKeyEvent The key event + * @param aType The type of key event + * @param aInPreCapture Whether the key was pressed in precapture mode + * @return Whether the key was consumed or not + */ + TKeyResponse CheckCourtesyKeyEventL( const TKeyEvent aKeyEvent, TEventCode aType, TBool aInPreCapture ); + + /** + * Whether to draw the complete UI in precapture mode + * @since 3.0 + * @return True if it should all be drawn + */ + TBool DrawPreCaptureCourtesyUI() const; + + /** + * Whether to draw the complete UI in postcapture mode + * @since 3.0 + * @return True if it should all be drawn + */ + TBool DrawPostCaptureCourtesyUI() const; + + /** + * Bring the complete UI to the fore in precapture + * @param aShowZoomBar Briefly shows the zoombar first, if necessary + * @since 3.0 + */ + void RaisePreCaptureCourtesyUI(TBool aShowZoomBar); + + /** + * Bring the complete UI to the fore in postcapture + * @since 3.0 + */ + void RaisePostCaptureCourtesyUI(); + + /** + * Hide the optional UI in precapture + * @since 3.0 + */ + void SubmergePreCaptureCourtesyUI(); + + /** + * Hide the optional UI in postcapture + * @since 3.0 + */ + void SubmergePostCaptureCourtesyUI(); + + /** + * Ensures the zoom pane gets shown and updated, specifically in direct viewfinder/active toolbar modes. Calling this method + * is not sufficient to show the zoom pane however, other methods in CZoomPane must be called to achieve this. + * @param aRedraw Whether to force a redraw event + * @since 3.0 + */ + void ShowZoomPane( TBool aRedraw ); + + /** + * Ensures the zoom pane gets hidden, specifically in direct viewfinder/active toolbar modes. As above, not sufficient to + * hide the zoom pane. + * @param aRedraw Whether to force a redraw event + * @since 3.0 + */ + void HideZoomPane( TBool aRedraw ); + + /** + * Refreshes the CBA based on current view and app state + * @since 2.8 + */ + void UpdateCba(); + + /** + * Sets the softkeys to the specified Resource ID + * @since 3.0 + * @param aResource ID of the softkey resource to use + */ + void SetSoftKeysL( TInt aResource ); + + /** + * Returns whether the time lapse slider is shown + * @since 3.0 + * @return ETrue if time lapse slider is shown + */ + TBool TimeLapseSliderShown() const; + + /** + * Detects whether the direct viewfinder is in use or not + * @since 3.0 + * @return True if it is active, otherwise false + */ + TBool IsDirectViewfinderActive(); + + /** + * Let the AppUi know what is being shown in pre-capture + * @param aMode What's being shown + */ + void SetPreCaptureModeL(TCamPreCaptureMode aMode); + + /** + * Let the AppUi know what is being shown in pre-capture + * @param aMode What's being shown + */ + void SetPreCaptureMode(TCamPreCaptureMode aMode); + + /** + * Whether or not the telephone application is in the foreground + * @since 3.0 + * @return ETrue if the telephone application is in the foreground + */ + TBool ForegroundAppIsPhoneApp() const; + + /** + * Whether to show the post capture view in current mode + * @return ETrue iff we should show the post capture view in current mode + */ + TBool ShowPostCaptureView() const; + + /** + * Whether the automatic UI-rise should be suppressed on next viewfinder start event + * e.g. when postcapture is set to off, the UI is off and a photo is taken + * @return Whether the automatic UI-rise should be suppressed + */ + TBool SuppressUIRiseOnViewfinderStart() const; + + /** + * Set whether the automatic UI-rise should be suppressed on next viewfinder start event + * @see SuppressUIRiseOnViewfinderStart + * @param aSuppress Whether the automatic UI-rise should be suppressed + */ + void SetSuppressUIRiseOnViewfinderStart(TBool aSuppress); + + /** + * Whether the current capture was selftimer initiated + * @return ETrue if the current capture was started via selftimer + */ + TBool IsSelfTimedCapture() const; + + + /** + * Set the 'freeing memory' flag. + * + * @param aFreeingMemory New value for the 'freeing memory' flag. + */ + void SetFreeingMemory( TBool aFreeingMemory ); + + /** + * Get the current state of the 'freeing memory' flag. + * + * @return Current value for the 'freeing memory' flag. + */ + TBool IsFreeingMemory() const; + + + /** + * Checks whether its safe to draw controls + * @return ETrue if its safe to draw the controls + */ + TBool ReadyToDraw() const; + + /** + * Set toolbar visibility in according to whether current view and mode are fit. + */ + void SetToolbarVisibility(); + + /** + * Hide the toolbar. + */ + void SubmergeToolbar(); + + public: // Functions from base classes + /** + * Draw the counter to the bitmap used in the navi pane + * @since 3.0 + * @param aBmpGc The graphics context for the bitmap + * @param aBmpMaskGc The graphics context for the bitmap mask + */ + void CreateNaviBitmapsL( TBool aDrawStorageIconAndCounter ); + + /** + * From CAknAppUi Handle user menu selections + * @since 2.8 + * @param aCommand The enumerated code for the option selected + */ + void HandleCommandL( TInt aCommand ); + + /** + * From MCamControllerObserver + * @since 2.8 + * @param aEvent The enumerated code for the event received + * @param aError The error code associated with the event + */ + void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + /** + * Return whether we are in embedded mode (if we have a pointer to a + * MApaEmbeddedDocObserver). + * @since 2.8 + * @return TBool if tthere is a handle to MApaEmbeddedDocObserver + */ + TBool IsEmbedded() const; + + /** + * Handle window server event. + * @since 2.8 + * @param aEvent the window server event + * @param aDestination the control associated with the event. + * Only valid for pointer events. + */ + void HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ); + + + /** + * Start application as file server application + * @since 3.0 + * @param aEmbeddedObserver service observer + * @param aMode Service type (image or video) + */ + void StartAsServerAppL( MCamEmbeddedObserver *aEmbeddedObserver, + TInt aMode ); + + /** + * Closes the application + * @since 2.8 + */ + void CloseAppL(); + + /** + * Closes the application + * @since 2.8 + * Exits the application according to current state, if the app always + * running flag is set, the application goes to the background but if + * embedded, or app always running flag is not set or in an error situation + * the application truly exits + */ + void InternalExitL(); + + /** + * Inform the controller of the count of images required at the next + * capture. Called before every still capture request. + * @since 2.8 + */ + void InitCaptureCountL(); + + /** + * From MCamVolumeKeyObserver - pick up volume key events + * @since 3.1 + * @param aOperationId - operation id (i.e. volume key up/down) + * @param aButtonAct bitton action press/click/release + */ + void HandleVolumeKeyEvent( TRemConCoreApiOperationId aOperationId, + TRemConCoreApiButtonAction aButtonAct); + + /** + * Handle an event from CCamSelfTimer. + * @since S60 v5.0 + * @param aEvent the self timer event + * @param aCountDown self timer countdown duration + */ + void HandleSelfTimerEvent( TCamSelfTimerEvent aEvent, + TInt aCountDown ); + + + public: // new fuctions + + /** + * We handle the case when settings plugin exists + **/ + void SettingsPluginExitedL( TCamSettingsPluginExitMessage aType ); + + /** + * We keep track of lauching settings plugin within camera + * to control the behaviour of the camera when the plugin exists and + * returns to camera + **/ + TBool SettingsLaunchedFromCamera() const; + + /** + * Checks if the memory type is full or unavailable + * @param aStorage TCamMediaStorage enum specifying the memory type; + * default=ECamMediaStorageCurrent + * @return ETrue if the specified memory is full or unavailable + **/ + TBool + IsMemoryFullOrUnavailable(const TCamMediaStorage + aStorage = ECamMediaStorageCurrent) const; + + /** + * Checks if all memories are full and unavailable + * @return ETrue if all memories are full or unavailable + **/ + TBool AllMemoriesFullOrUnavailable() const; + + + private: // New functions + + /** + * Helper method to handle controller event for + * going to standby mode. + */ + void HandleStandbyEventL( TInt aStatus ); + + /** + * Notify our views of application level events, like focus gained/lost. + */ + void NotifyViews( const TCamAppEvent& aEvent ); + + + /** + * Construct views + * Construct pre capture views + * @since 2.8 + */ + void ConstructPreCaptureViewsL(); + + /** + * Construct post capture views + * @since 2.8 + */ + void ConstructPostCaptureViewsL(); + + /** + * Construct settings, user scene setup, and postcapture views + * @since 2.8 + */ + void ConstructViewIfRequiredL(); + + /** + * Construct navi pane + * @since 2.8 + */ + void ConstructNaviPaneL(); + + /** + * Switch to pre-capture view + * @since 2.8 + * @return TInt to indicate if function should be called again + */ + TInt DoPostCaptureTimeoutL(); + + /** + * Try to switch active view. + * @since 2.8 + */ + void TrySwitchViewL( TBool aDeactivateFirst = EFalse ); + + /** + * Determines if a switch of the active view required. + * @param aDeactivateFirst Deactivate before check + * @since 2.8 + */ + TCamViewSwitch ViewSwitchRequired( TBool aDeactivateFirst = EFalse ) const; + + /** + * Get uid of view with requested view and mode. + * @since 2.8 + * @param aState View state + * @param aMode Main camera mode (image/video) + * @param aImageMode In image mode, image capture type (single/burst/timelapse) + * @param aUid Uid of view passed by reference and populated in function + * @param aMessageUid A message Uid to pass to the view + * @return Whether or not a valid view uid can be obtained + */ + TBool ViewId( TCamViewState aState, + TCamCameraMode aMode, + TCamImageCaptureMode aImageMode, + TUid& aUid, + TUid& aMessageUid, + TBool aDeactivateFirst ); + + /** + * Return a pointer to the navi pane. + * @since 2.8 + * @return pointer to the status pane's navigation control container + */ + CAknNavigationControlContainer* NaviPaneL(); + + /** + * Display the wait dialog when saving video + * @since 2.8 + */ + void DisplayWaitDialogL(); + + /** + * Get the default startup mode from settings + * If this is not defined the factory default will be used + * @since 2.8 + * @return The default startup capture mode + */ + TCamStartupMode StartupMode() const; + + /** + * Save the current capture mode to settings. + * This will be used as the startup mode + * @since 2.8 + */ + void SaveCaptureMode(); + + /** + * Save the current state of the UI to settings. + * + */ + + void SaveCourtesyUiState(); + + /** + * Override HandleScreenDeviceChangedL() and trigger a re-layout + * of the main controls from this - addition for 2.8 + * @since 2.8 + */ + void HandleScreenDeviceChangedL(); + + /** + * Called when the video is ready to be stopped + * @since 2.8 + * @param aPtr pointer to the object that called the timer + * @return Error code + */ + static TInt StopVideoRecording( TAny* aPtr ); + + /** + * Called when the application is ready to exit + * @since 2.8 + * @param aAny pointer to the object that called the timer + * @return Error code + */ + static TInt CallExit( TAny* aAny ); + + /** + * Callback used when the application needs to switch view + * @since 2.8 + * @param aAny pointer to the object that called the timer + * @return Error code + */ + static TInt CallSwitch( TAny* aAny ); + + /** + * Launch the context sensitive help application + * @since 2.8 + */ + void LaunchHelpL(); + + /** + * Returns the AppUi orientation (e.g. Portrait or Landscape) for the given product-specific orientation + * @since 3.0 + * @param aCamOrientation The product-specific orientation + * @return The AppUi orientation (e.g. Portrait or Landscape) + */ + TAppUiOrientation AppUiOrientation( TCamOrientation aCamOrientation ); + + /** + * Returns the camera orientation based on the layout state set by the phone + * @since 3.0 + * @param aLayoutState The layout state set by the phone + * @return The camera orientation + */ + TCamOrientation LayoutStateToOrientation( TInt aLayoutState ); + + /** + * Returns the camera orientation based on the layout state set by the phone + * @since 3.0 + * @return The camera orientation based on the layout state set by the phone + */ + TCamOrientation ReadCurrentDeviceOrientation(); + + /** + * Returns whether or not the full screen viewfinder is being shown + * @return Whether or not the full screen viewfinder is being shown + */ + TBool FullScreenViewfinderEnabled() const; + + /** + * Construct a postcapture view if not already constructed + * + * The following parameter combinations can be used: + * Still postcapture view: sViewState = ECamViewStatePostCapture, aMode = ECamControllerImage + * Burst thumbnail view: aViewState = ECamViewStateBurstThumbnail + * Video Postcapture view: aViewState = ECamViewStatePostCapture, aMode = ECamControllerVideo + * + * @param aViewState + * @param aCaptureMode + * @since 2.8 + */ + void ConstructPostCaptureViewIfRequiredL( TCamViewState aViewState, + TCamCameraMode aMode ); + + /* + * Initiate the check operation using collection manager + */ + /** + * We start check operation to see if "Default Album exists" + * Usecase: Whenever the camera returns from background/startup we + * first start checking the default album which is set, if any, to make + * sure that album really exists. If not, then we set back the value + * of setting item "Add to album" to "No" in Image/Video setting + * image settings + */ + void StartCheckingDefaultAlbumIdL(); + + +#ifdef CAMERAAPP_DELAYED_POSTCAPTURE_CREATION + + /** + * Starts calls to PostCapIdleCallBack during processor idle time. The calls + * are continued until PostCapIdleCallBack is done. + * @since 3.1 + */ + void StartPostCapIdleL(); + + /** + * Handles postcapture view construction so that each call to this function + * constructs one postcapture view. Returns ETrue if there are still more views + * to construct, EFalse if all are finished and no further calls are required. + * + * @param aSelf pointer to current CCamAppUi object + * @return construction status + * @since 3.1 + */ + static TInt PostCapIdleCallBack( TAny* aSelf ); + +#endif // CAMERAAPP_DELAYED_POSTCAPTURE_CREATION + + + /** + * Initiates a call to SensorIdleCallback during processor idle time + * @since 3.1 + */ + void StartSensorIdleL(); + + /** + * Cancels the (possibly) pending call to SensorIdleCallBack + * @since 3.1 + */ + void CancelSensorIdle(); + + /** + * Initializes the sensor API by calling iController.UpdateSensorApiL() + * + * @param aSelf pointer to current CCamAppUi object + * @return construction status + * @since 3.1 + */ + static TInt SensorIdleCallBack( TAny* aSelf ); + + + private: // Functions from base classes + +#ifndef __WINSCW__ + /** + * From CEikAppUi. + * Processes shell commands. + * @since 3.0 + * @param aCommand The command line command + * @param aDocumentName The name of the document to open + * @param aTail Not used. + * @return TBool + */ + TBool ProcessCommandParametersL( TApaCommand aCommand, + TFileName& aDocumentName, + const TDesC8& aTail ); + /** + * From CEikAppUi. + * Handle the external message. + * @since 3.0 + * @param aClientHandleOfTargetWindowGroup Handle. + * @param aMessageUid Message id. + * @param aMessageParameters Message parameters. + * @return Response to the message. + */ + MCoeMessageObserver::TMessageResponse HandleMessageL( + TUint32 aClientHandleOfTargetWindowGroup, + TUid aMessageUid, + const TDesC8& aMessageParameters ); + +#endif //WINSCW + + private: // new functions + +#ifndef __WINSCW__ + /** + * Bring the Phone application back to foreground after in-call send completion + * @since 3.0 + */ + void BringPhoneAppToForeGroundL(); +#endif //WINSCW + + /** + * Sends the camera application to the background, to pretend we're closing + * @since 2.8 + */ + void SendCameraAppToBackgroundL(); + + /** + * Hides the application from task list, to pretend that camera app is closed + * @since 3.0 (added back since its useful in certain situation) + * @param aHide whether to hide or make visible + */ + void HideTaskL(TBool aHide); + + public: + /** + * Display error note + * @since 2.8 + * @param aError The error code + */ + void HandleCameraErrorL( TInt aError ); + + + /** + * Set iAssumePostCaptureView flag + * @param aValue ETrue sets flag on, EFalse off + */ + void SetAssumePostCaptureView( TBool aValue ); + + /** + * Set iLensCoverExit flag + * @param aValue ETrue sets flag on, EFalse off + */ + void SetLensCoverExit( TBool aValue ); + + /** + * Set iDrawPreCaptureCourtesyUI flag + * @param aValue ETrue sets flag on, EFalse off + */ + void SetDrawPreCaptureCourtesyUI(TBool iDraw); + + /** + * Finishes the AppUI construction by calling + * CompleteAppUIConstructionL + */ + static TInt AppUIConstructCallbackL( TAny* aAny ); + + /** + * returns ETrue if appUi construction is complete + */ + TBool IsUiConstructionComplete(); + + /** + * set whether camera viewfinder stop or not + * @param aViewFinderStopped ETrue viewfinder is stoped,EFalse viewfinder is runing + * + */ + void SetViewFinderStoppedStatus(TBool aViewFinderStopped); + + /** + * Getter for iViewFinderInTransit + * @return ETrue if viewfinder handle is in transit between different windows + */ + TBool IsViewFinderInTransit(); + + /** + * Setter for iViewFinderInTransit + * @param aInTransit Set to ETrue if viewfinder window handle is in transit + * @return void + */ + void SetViewFinderInTransit(TBool aInTransit); + + public: //MCamAddToAlbumObserver + + + /* + * From MCamAddToAlbumObserver + * Notification once the aysnchronous operations using + * CollectionManager interface are done completly + * Status of the operation are returned using aStatus + * e.g. KErrNone + */ + void AddToAlbumIdOperationComplete() {}; + + /** + * From MCamAddToAlbumObserver + * Notification once the asynchronous operations using + * CollectionManager interface have completed. + * + * @param aAlbumExists ETrue if album exists + * @param aAlbumTitle Title of the album + */ + void CheckAlbumIdOperationCompleteL( + TBool aAlbumExists, const TDesC& aAlbumTitle ); + + + private: + + /** + * Called when the courtesy timer ends + * @since 3.0 + * @param aPtr The CCamAppUI object the timer has completed on + */ + static TInt CourtesyTimeout( TAny* aPtr ); + + /** + * Called when the courtesy timer ends + * @since 3.0 + */ + TInt DoCourtesyTimeout(); + + /** + * Called to set the correct navicounter / naviprogress controls to "active" + * @since 3.0 + */ + void UpdateNaviModelsL( TBool aUpdateNavi = ETrue ); + + + /** + /** + * Dismisses out of memory / memory card removed note, if active. + */ + void DismissMemoryNoteL(); + + /** + * Register to capture half and full shutter press key events + * @since 3.0 + */ + void RegisterCaptureKeysL(); + + /** + * Release capture of half and full shutter press key events + * @since 3.0 + */ + void UnRegisterCaptureKeys(); + + /** + * Select the setting for viewfinder grid. + */ + void SelectViewFinderGridSettingL(); + + /** + * Starts the Photos application command line + **/ + void StartAppCmdLineL( const TDes8& aData ); + + /** + * Check if it's applicable to use the courtesy UI + * @since S60 v5.0 + * @return ETrue if courtesy UI can be used + */ + TBool CourtesyUiApplies() const; + + /** + * Finish the AppUI construction + **/ + void CompleteAppUIConstructionL(); + + // ======================================================= + // Data + private: + + CCamAppController& iController; + + TCamSelfTimerFunctions iInSelfTimerMode; + + // Own + CCamSelfTimer* iSelfTimer; + + // Not own. + CCamNaviCounterControl* iNaviPaneCounterControl; + + // Not own. + CCamNaviProgressBarControl* iNaviPaneProgressBarControl; + + // Own. + CAknNavigationDecorator* iDecoratedNaviPaneCounter; + + // Own. + CAknNavigationDecorator* iDecoratedNaviPaneProgressBar; + + + // NOT owned; this pointer is just for checking + // if the wait dialog object still exists, or + // whether it has deleted itself + CCamWaitDialog* iWaitDialog; + + // Not own. + CCamStillPreCaptureView* iStillCaptureView; + + // Not own. + CCamVideoPreCaptureView* iVideoCaptureView; + + // Not own. + CAknView* iViaPlayerView; + + TCamViewState iViewState; + TCamViewState iTargetViewState; + TCamCameraMode iMode; + TCamCameraMode iTargetMode; + + TCamImageCaptureMode iImageMode; + TCamImageCaptureMode iTargetImageMode; + TInt iStandbyStatus; + + TBool iKeyShutter; + + // Used to determine whether or not the startup view has been + // set when app is launched embedded + TBool iEmbeddedViewSet; + + // Name of parent app if we're embedded + // Own. + HBufC* iParentAppName; + + // Whether or not the cba has been blanked + TBool iCbaIsDisabled; + + // Whether or not the burst mode has been activated + TBool iBurstModeEnabled; + + // Observer that needs to know when burst mode is switched on/off + // Observer objects are not owned. + RPointerArray iBurstModeObservers; + + // handle of the camera key captured + TInt iCameraKeyHandle; + + // timer to assist with displaying wait dialog + // Own. + CPeriodic* iWaitTimer; + + // Whether or not the wait timer should be used + TBool iApplyTimer; + + // Used for opening (and playing) video clips + // Own. + CDocumentHandler* iDocHandler; + + // the id of the application's window group + TInt iMyWgId; + + // the id of the eikon server window group + TInt iEikonServerWindowGroupId; + + // Whether or not a view switch is pending, used to delay switch to + // post capture view when the application is in the background + TPendingViewSwitchType iPendingViewSwitch; + + // Keeps track of the state before focus gained events + TBool iReturnFromBackground; + + // Side-pane handler + // Own. + CCamSidePane* iCamSidePane; + + // Zoom-pane handler + // Own. + CCamZoomPane* iCamZoomPane; + + // Used to access settings + // Own. + CRepository* iRepository; + + // Flag to indicate when video recording has stopped due to incoming call + // Post capture timer is not started when this flag is set, delays the + // timeout of the video post capture view + TBool iDelayVideoPostCaptureTimeout; + + // Indicates if the mmc was detected as removed at startup, requiring + // the user to be informed + TBool iMMCRemoveNoteRequired; + + // Indicates if the mmc was detected as removed whilst we were in focus, + // requiring us to inform the user when capture is attempted. + TBool iMMCRemoveNoteRequiredOnCapture; + + // Only the precapture views are created on construction + // These flags indicate whether or not the other views have been created + TBool iPostCaptureViewsConstructed; + TBool iUserSceneSetupViewConstructed; + TBool iCustomiseToolbarViewConstructed; + + // Used to resolve error message texts + // Own. + CTextResolver* iTextResolver; + +//#ifndef __WINS__ + // in-call send utility class + // Own. + //CSFIUtilsAppInterface* iSFIUtils; + + // Whether in in-call send mode + //TBool iSendFileInCall; +//#endif + + // embedded observer + // Not own. + MCamEmbeddedObserver* iEmbeddedObserver; + + // embedded start up capture mode + TInt iApplicationMode; + + // Pointer to the only navicounter model + // Own. + CCamNaviCounterModel* iNaviCounterModel; + + //Pointer to the only naviprogressbar model + // Own. + CCamNaviProgressBarModel* iNaviProgressBarModel; + + // Pointer to the NaviCounter control + // Own. + CCamNaviCounterControl* iNaviCounterControl; + + // Pointer to the NaviProgress control + // Own. + CCamNaviProgressBarControl* iNaviProgressBarControl; + + TCamOrientation iCamOrientation; + + // Keeps a list of MCamResourceLoaders that this class owns + RPointerArray iResourceLoaders; + + // Own. + CCamActivePaletteHandler* iActivePaletteHandler; + + // Maximum no if images in burst capture + TInt iMaxBurstCaptureNum; + + // Whether the Coutesy UI should currently be displayed (precapture) + TBool iDrawPreCaptureCourtesyUI; + // Whether the user has set the UI to always be on (precapture) + TBool iAlwaysDrawPreCaptureCourtesyUI; + + // Whether the Coutesy UI should currently be displayed (postcapture) + TBool iDrawPostCaptureCourtesyUI; + // Whether the user has set the UI to always be on (postcapture) + TBool iAlwaysDrawPostCaptureCourtesyUI; + + // The courtesy timer: when this ends, the UI should be hidden if applicable + // Own. + CCamTimer* iCourtesyTimer; + + // Whether the timer was started in precapture mode or not + TBool iCourtesyTimerInPreCapture; + + // True if the zoom pane is currently being shown, False if not + TBool iZoomPaneShown; + + // True when application is started + TBool iFirstBoot; + + // Flag to show if a screen redraw event is being processed + TBool iProcessingScreenRedraw; + + // Whether the active palette should be prevented from being shown: + // used during saving of an image/video + TBool iPreventActivePaletteDisplay; + + // Used to delay engine creation on app startup or camera switch + // if the orientation has not completed initialising. + TBool iEngineConstructionDelayed; + TBool iCameraSwitchDelayed; + + // Set to true in the case where we pretend to exit the app, but are still really + // running in the background. The app should behave slightly differently when we + // are next brought to the foreground. + TBool iPretendExit; + + // flag to indicate whether we are currently embedding another application + TBool iEmbedding; + + // flag to indicate if "Send As" is in progress + TBool iSendAsInProgress; + + // + TInt iFullShutterPressHandle; + TInt iHalfShutterPressHandle; + TInt iFullShutterUpDownHandle; + + // Window group ID for Bluetooth server + TInt iBTServerWindowGroupId; + + // Window group ID for Telephone application + TInt iPhoneAppWindowGroupId; + + // position of softkeys in landscape mode (left or right) + TInt iSoftkeyPosition; + + /// The current pre capture mode shown + TCamPreCaptureMode iPreCaptureMode; + + // flag to indicate viewfinder stopped + TBool iViewFinderStopped; + + // flag used to say whether we want to suppress auto-UI rise on next viewfinder start event + TBool iSuppressUIRise; + + // Flag used to indicate that focus was lost to an incoming call during sequence capture + TBool iFocusLostToCallDuringSequenceCapture; + + // observer to receive volume key presses + // Own. + CCamRemConObserver* iVolumeKeyObserver; + + TBool iZoomUsingVolumeKeys; + + // Own + CAknLocalScreenClearer* iScreenClearer; + + // Status of postcapture views construction + TBool iStillPostCaptureViewConstructed; + TBool iBurstThumbnailViewConstructed; + TBool iVideoPostCaptureViewConstructed; + +#ifdef CAMERAAPP_DELAYED_POSTCAPTURE_CREATION + // CIdle object used for late construction of the postcapture views + // Own. + CIdle* iPostCapIdle; + + // Status of the views creation + TCamPostCapConstruction iPostCapProgress; +#endif // CAMERAAPP_DELAYED_POSTCAPTURE_CREATION + + // Own. + CIdle* iSensorIdle; + TBool iSensorIdleRunning; + + // Own. + HBufC* iLowRamNoteText; + + // Used to allow postcapture view to show for selftimed captures + TBool iSelfTimedCapture; + + TBool iDSASupported; + + TInt iNoteId; + + // View UID if the ViaPlayerApplication view + TUid iViaPlayerUid; + // LeftSoftKey is Pressed + TBool iLeftSoftKeyPressed; + TBool iEndKeyPressed; + + TBool iCheckOperationInProgress; + CCamCollectionManagerAO* iCollectionManager; + + // Own. + CCamGSInterface* iPlugin; + + TBool iSettingsPluginLaunched; + + TBool iReturnedFromPlugin; + + // Own + CCamFileCheckAo *iFileCheckAo; + + // Own + CAknStylusPopUpMenu* iTouchPopupMenu; + + // Own + CAknStaticNoteDialog* iMemoryNote; + + TSize iRequestedNewFileResolution; + + TBool iLostFocusToNewWindow; + TBool iToolbarVisibility; + TBool iRotatedKeyEvent; + + // flag that tells us that we are exiting app because lens cover is closed + // used to skip post-capture view in these cases + TBool iLensCoverExit; + // flag that indicates whether view finder start is the + // first one after camera startup + TBool iFirstVFStart; + + TUid iLastHiddenViewId; + + TCamMediaStorage iInternalStorage; //Points to either Phone or Internal Mass storage based on availability + T2ndCamOrientation iLockedQwertyState; + TBool iUiConstructionComplete; + CCamMemoryMonitor* iMemoryMonitor; + + //Flag to monitor viewfinder window handle switch + TBool iViewFinderInTransit; + }; + +// =========================================================================== +// Debug strings + +#ifdef _DEBUG +const TUint16* const KCamViewStateNames[] = + { + (const TUint16* const)_S16("ECamViewStateRangeInternalMin"), + + (const TUint16* const)_S16("ECamViewStatePreCapture"), + (const TUint16* const)_S16("ECamViewStatePostCapture"), + (const TUint16* const)_S16("ECamViewStateBurstThumbnail"), + (const TUint16* const)_S16("ECamViewStateSettings"), + (const TUint16* const)_S16("ECamViewStateStandby"), + (const TUint16* const)_S16("ECamViewStateUserSceneSetup"), + (const TUint16* const)_S16("ECamViewStateWhiteBalanceUser"), + (const TUint16* const)_S16("ECamViewStateColourFilterUser"), + (const TUint16* const)_S16("ECamViewStateFlashUser"), + (const TUint16* const)_S16("ECamViewStateSceneUser"), + (const TUint16* const)_S16("ECamViewStateSceneStill"), + (const TUint16* const)_S16("ECamViewStateCaptureSetupMenu"), + (const TUint16* const)_S16("ECamViewStateSceneSettingList"), + (const TUint16* const)_S16("ECamViewStateExposureUser"), + (const TUint16* const)_S16("ECamViewStateCustomiseToolbar"), + (const TUint16* const)_S16("ECamViewStatePrePortraitCapture"), + + (const TUint16* const)_S16("ECamViewStateRangeInternalMax"), + (const TUint16* const)_S16("ECamViewStateRangeExternalMin"), + + (const TUint16* const)_S16("ECamViewStateViaPlayer"), + (const TUint16* const)_S16("ECamViewStateGsCamcorderPlugin"), + + (const TUint16* const)_S16("ECamViewStateRangeExternalMax") + }; +__ASSERT_COMPILE( (sizeof(KCamViewStateNames)/sizeof(TUint16*)) == ECamViewStateCount ); +#endif // _DEBUG + +#endif // CAMAPPUI_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamAppUid.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamAppUid.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of the camera application uid* +*/ + + +#ifndef CAMAPPUID_H +#define CAMAPPUID_H + +// INCLUDES + +// CONSTANTS + +#ifndef KCameraappUID + // Camera Application UID + // Note the hard coded value is used in mmp files because of OST trace compiler limitations + #define KCameraappUID 0x101F857A +#endif // KCameraappUID + + +#endif // CAMAPPUID_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamApplicationPane.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamApplicationPane.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,180 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Control for containing the NaviPane +* +* CCopyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#ifndef CAMAPPLICATIONPANE_H +#define CAMAPPLICATIONPANE_H + +// INCLUDES +#include +#include +#include "CamSettings.hrh" +#include "CamAppController.h" + +// FORWARD DECLARATIONS +class MAknsSkinInstance; +class CAknsBasicBackgroundControlContext; +class CCamNaviCounter; +class CCamNaviProgressBar; +class CCamBurstThumbnailGridModel; +class CCamTitlePane; + +// CLASS DECLARATION + +/** +* Control for containing the NaviPane +* @since 2.8 +*/ +class CCamApplicationPane : public CCoeControl + { + private: + // Enumeration used to indicate the pane currently visible + enum TAppPane + { + EAppPaneUndefined, + EAppPaneCounter, + EAppPaneProgress + }; + + public: // Constructors and destructor + /** + * Static factory construction function + * @since 3.0 + * @param aController Reference to CCamAppController + * @return pointer to constructed instance of CCamApplicationPane + */ + static CCamApplicationPane* NewL( CCamAppController& aController ); + + /** + * Destructor. + */ + ~CCamApplicationPane(); + + public: // New functions + /** + * Shows the NaviProgress control in the Application Pane + * @since 3.0 + */ + void ShowProgress(); + + /** + * Shows the NaviCounter control in the Application Pane + * @since 3.0 + */ + void ShowCounter(); + + /** + * Sets the capture mode the pane should indicate + * @since 3.0 + * @param aCaptureMode The capture mode to use + */ + void SetCaptureMode( TCamCameraMode aMode ); + + /** + * Sets the burst model to use if app pane showing burst filenames + * @since 3.0 + * @param aModel The grid model to get filenames from + */ + void SetBurstModelL( CCamBurstThumbnailGridModel* aModel ); + + /** + * Sets the owned panes to a known good state (all invisible) + * @since 3.0 + */ + void InitialisePanesL(); + + public: // Functions from base classes + /** + * Returns the number of component controls + * @since 3.0 + * @return The number of owned controls to display + */ + TInt CountComponentControls() const; + + /** + * Returns the specified component control + * @since 3.0 + * @param aIndex The index of the control to return + * @return Pointer to the specified control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + protected: + /** + * C++ constructor. + * @since 3.0 + * @param aController Reference to CCamAppController + */ + CCamApplicationPane( CCamAppController& aController ); + + /** + * Symbian OS 2nd phase constructor. + * @since 3.0 + */ + void ConstructL(); + + private: // Functions from base classes + + /** + * From CCoeControl + * @since 3.0 + * Set the size and position of its component controls. + */ + void SizeChanged(); + + /** + * From CCoeControl Draw the view + * @since 3.0 + * @param aRect area where to draw + */ + void Draw( const TRect& aRect ) const; + + + protected: //data + // The current pane displayed in the Application Pane + TAppPane iPaneInUse; + + // Instance of Navi Counter control + CCamNaviCounter* iNaviCounter; + + // Instance of Navi Progress control + CCamNaviProgressBar* iNaviProgressBar; + + // Controller used to initialise the Navi controls. Not owned + CCamAppController& iController; + + // Instance of the Title Pane control + CCamTitlePane* iTitlePane; + + // Layout for the Application Pane rectangle + TAknLayoutRect iAppPaneLayoutRect; + }; + +#endif // CAMAPPLICATIONPANE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamBmpRotatorAo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamBmpRotatorAo.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility class to rotate bitmaps* +*/ + + + + + +#ifndef __CAMBMPROTATORAO_H +#define __CAMBMPROTATORAO_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Utility class to help in the rotating of bitmaps (for Zoom Pane) +* +* @since 3.0 +*/ +class CCamBmpRotatorAo : public CActive + { + private: + // This structure stores the details of a rotation task. + // Used only internally, the bitmap is *not* owned by this + // class, and will be overwritten by the rotation operation. + class CRotateTask : public CBase + { + public: + // The source bitmap to be rotated (and overwritten) + CFbsBitmap* iBitmap; + + // The angle to rotate the bitmap by + CBitmapRotator::TRotationAngle iAngle; + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamBmpRotatorAo* NewL(); + + /** + * Destructor. + */ + virtual ~CCamBmpRotatorAo(); + + public: // New functions + /** + * Rotates the specified bitmap by the supplied angle. + * Note that the original bitmap will be overwritten + * @since 3.0 + * @param aBitmap The bitmap to rotate + * @param aRotation The angle to rotate the bitmap + */ + void AddToQueueL( CFbsBitmap* aBitmap, CBitmapRotator::TRotationAngle aRotation ); + + /** + * Starts the next rotation task in the queue (if there is one) + * @since 3.0 + */ + void StartNextRotate(); + + public: // Functions from base classes + /** + * Called when a rotate operation has completed + * @since 3.0 + */ + void RunL(); + + /** + * Called to cancel an outstanding operation (eg when class is being destroyed) + * @since 3.0 + */ + void DoCancel(); + + private: + + /** + * C++ default constructor. + * @since 3.0 + */ + CCamBmpRotatorAo(); + + /** + * By default Symbian 2nd phase constructor is private. + * @since 3.0 + */ + void ConstructL(); + + private: // Data + // List of outstanding rotation tasks to perform + RPointerArray iQueue; + + // ICL utility class that actually does the bitmap rotation + CBitmapRotator* iRotator; + }; + +#endif // __CAMBMPROTATORAO_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamBurstCaptureArray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamBurstCaptureArray.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,356 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A class that represents a set of capture items +* +* Copyright © 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#ifndef CAMBURSTCAPTUREARRAY_H +#define CAMBURSTCAPTUREARRAY_H + +// INCLUDES + +#include + +// CONSTANTS + +// FORWARD DECLARATIONS +class CFbsBitmap; +class CCamImageSaveActive; + +/** +* A capture burst array, maintains a set of CCamBurstCaptureItem objects +*/ +class CCamBurstCaptureArray : public CBase + { + public: + + /** + * Two-phased constructor. + * @since 2.8 + * @param aImageSaveActive class that manages image saving, + * informed if a save request was previously made + * for a file now being marked for deletion. + * @return pointer to the created CCamBurstCaptureArray object + */ + static CCamBurstCaptureArray* NewL( CCamImageSaveActive& aImageSaveActive ); + + /** + * Destructor. + * @since 2.8 + */ + ~CCamBurstCaptureArray(); + + public: // New methods + + /** + * Sets an item's full file path and image name + * @since 2.8 + * @param aFullFileName the full file path and image name for the item + * @param aImageName the name of the image displayed in the UI + * @param aIndex the index of the item to name. + */ + void SetNameL( const TDesC& aFullFileName, const TDesC& aImageName, + TInt aIndex ); + + /** + * Returns whether a particular file has already been saved. + * @since 2.8 + * @param aFilename the name of the file to check. + * @return ETrue if the file has been saved. + */ + TBool AlreadySavedFile( const TDesC& aFilename ); + + /** + * Returns whether a particular file is in the process of being saved. + * @since 2.8 + * @param aFilename the name of the file to check. + * @return ETrue if the file is in the process of being saved. + */ + TBool CurrentlySavingFile( const TDesC& aFilename ); + + /** + * Returns the number of items in the array + * @since 2.8 + * @return count of items in the array + */ + TInt Count() const; + + /** + * Returns the number of un-deleted items in the array + * @since 2.8 + * @return count of items in the array that are not marked for deletion + */ + inline TInt ImagesRemaining() const; + + /** + * Delete unwanted items from the array, releasing memory + * @since 2.8 + * @param aRequiredCount the number of items required + */ + void Reset( TInt aRequiredCount = 0 ); + + /** + * Sets the item's full file path and image name + * @since 2.8 + * @param aFullFileName the full file path and image name for the item + * @param aImageName the name of the image displayed in the UI + */ + void SetNextNameL( const TDesC& aFullFileName, const TDesC& aImageName ); + + /** + * Stores the snapshot bitmap in the item + * @since 2.8 + * @param aSnapshot the snapshot image returned by the camera engine + */ + void SetNextSnapshotL( const CFbsBitmap& aSnapshot ); + + /** + * Sets the item's deletion state + * @since 2.8 + * @param aItemIndex Index of the item + * @param aDeleted ETrue if the item has been selected for deletion + * @return system wide error code or KErrNone + */ + TInt SetDeleted( TInt aItemIndex, TBool aDeleted ); + + /** + * Skips the next image if marked for deletion + * @since 2.8 + * @return Whether or not the image was skipped + */ + TBool IsNextImageDeleted(); + + /** + * Returns a pointer to the next full file path and name in the array + * since the last one requested + * @since 2.8 + * @return Pointer to the filename + */ + const TDesC& NextFileName(); + + /** + * Returns the index of the next full file path and name in the array + * since the last one requested by NextFileName() + * This can be used to determine any unsaved images + * @since 2.8 + * @return Index of the next filename + */ + TInt NextFileIndex() const; + + /** + * Returns a pointer to the full file path and name + * @since 2.8 + * @param aItemIndex Index of the item + * @return Pointer to the filename + */ + const TDesC& FileName( TInt aItemIndex ) const; + + /** + * Returns a pointer to the image name + * @since 2.8 + * @param aItemIndex Index of the item + * @return Pointer to the image name + */ + const TDesC& ImageName( TInt aItemIndex ) const; + + /** + * Returns a pointer to the snapshot image + * @since 2.8 + * @param aItemIndex Index of the item + * @return the snapshot image + */ + const CFbsBitmap* Snapshot( TInt aItemIndex ) const; + + /** + * Indicates whether the item has been selected for deletion + * @since 2.8 + * @param aItemIndex Index of the item + * @return the item's deletion state + */ + TBool IsDeleted( TInt aItemIndex ) const; + + /** + * Replaces the bitmap in the given index. + * @since 3.0 + * @param aBitmap The new bitmap to replace current + * @param aItemIndex Index of the replaced item + * @return Success of the replacement + */ + TBool ReplaceSnapshot( const CFbsBitmap* aBitmap, TInt aItemIndex ); + + private: + + /** + * A capture burst item, holds the full file path and name, the snapshot image and + * indication of whether or not the item has been selected for deletion + */ + class CCamBurstCaptureItem : public CBase + { + public: + + /** + * Two-phased constructor. + * @since 2.8 + * + * @return pointer to the created CCamBurstCaptureItem object + */ + static CCamBurstCaptureItem* NewLC(); + + /** + * Destructor. + * @since 2.8 + */ + ~CCamBurstCaptureItem(); + + public: // New methods + + /** + * Sets the item's full file path and image name + * @since 2.8 + * @param aFullFileName the full file path and image name for the item + * @param aImageName the name of theimage displayed in the UI + */ + void SetNameL( const TDesC& aFullFileName, const TDesC& aImageName ); + + /** + * Stores the snapshot bitmap in the item + * @since 2.8 + * @param aSnapshot the snapshot image returned by the camera engine + */ + void SetSnapshotL( const CFbsBitmap& aSnapshot ); + + /** + * Sets the item's deletion state + * @since 2.8 + * @param aDeleted ETrue if the item has been selected for deletion + */ + void SetDeleted( TBool aDeleted ); + + /** + * Returns a pointer to the full file path and name + * @since 2.8 + * @return Pointer to the filename + */ + const TDesC& FileName() const; + + /** + * Returns a pointer to the image name + * @since 2.8 + * @return Pointer to the image name + */ + const TDesC& ImageName() const; + + /** + * Returns a reference to the snapshot image + * @since 2.8 + * @return the snapshot image + */ + const CFbsBitmap* Snapshot() const; + + /** + * Indicates whether the item has been selected for deletion + * @since 2.8 + * @return the item's deletion state + */ + TBool IsDeleted() const; + + /** + * Replaces the bitmap. + * @since 3.0 + * @param aBitmap The new bitmap to replace current + * @return Success of the replacement + */ + TBool ReplaceSnapshot( const CFbsBitmap* aBitmap ); + + private: + + /** + * C++ default constructor. + * @since 2.8 + */ + CCamBurstCaptureItem(); + + /** + * Second phase construction + */ + void ConstructL(); + + private: + // The full path and filename for the image + HBufC* iFileName; + // The image name + HBufC* iImageName; + // The snapshot image + CFbsBitmap* iSnapshot; + // The item's deletion state + TBool iIsDeleted; + }; + + private: + + /** + * C++ default constructor. + * @since 2.8 + * @param aImageSaveActive class that manages image saving, + * informed if a save request was previously made + * for a file now being marked for deletion. + */ + CCamBurstCaptureArray( CCamImageSaveActive& aImageSaveActive ); + + /** + * Second phase construction + */ + void ConstructL(); + + /** + * Create a new item in the array if necessary + * @since 2.8 + * @param aRequiredIndex the expected index for an item + */ + void CheckArraySizeL( TInt aRequiredIndex ); + + private: + + // Array of items each representing an image in a burst capture + RPointerArray iBurstItems; + // Active object that manages file saving and deletion + CCamImageSaveActive& iImageSaveActive; + // Index used to manage storage of file names and image names + TInt iNextSetName; + // Index used to manage retrieval of file names + TInt iNextGetName; + // Index used to manage storage of snapshot images + TInt iNextSnapshot; + // Counter for the number of undeleted items + TInt iImagesRemaining; + }; + +#include "CamBurstCaptureArray.inl" + + +#endif // CAMBURSTCAPTUREARRAY_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamBurstCaptureArray.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamBurstCaptureArray.inl Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of CCamBurstCaptureArray +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::ItemsRemaining +// Return the number of non-deleted items in the array +// --------------------------------------------------------------------------- +// +inline TInt CCamBurstCaptureArray::ImagesRemaining() const + { + return iImagesRemaining; + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamBurstModeObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamBurstModeObserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines abstract API for burst mode observers* +*/ + + +#ifndef CAMBURSTMODEOBSERVER_H +#define CAMBURSTMODEOBSERVER_H + + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Abstract API for burst mode observer. +* Derived classes may register as a burst mode observer to get +* related notifications from CCamAppUiBase +* +* @since 2.8 +*/ +class MCamBurstModeObserver + { + public: + /** + * Burst mode activation has changed + * @since 2.8 + * @param aActive whether or not burst mode is active + * @param aStillModeActive whether or not still capture is active + */ + virtual void BurstModeActiveL( TBool aActive, TBool aStillModeActive ) = 0; + }; + +#endif // CAMBURSTMODEOBSERVER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamBurstThumbnailContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamBurstThumbnailContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for burst thumbnail view +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + + +#ifndef CAMBURSTTHUMBNAILCONTAINER_H +#define CAMBURSTTHUMBNAILCONTAINER_H + +// INCLUDES +#include "CamContainerBase.h" + +// FORWARD DECLARATIONS +class CCamAppController; +class CAknView; +class CCamBurstThumbnailGrid; +class CCamBurstThumbnailGridModel; +class MTouchFeedback; + +// CLASS DECLARATION + +/** +* Container for burst thumbnail view +*/ +class CCamBurstThumbnailContainer : public CCamContainerBase + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aController reference to CCamAppController instance + * @param aView reference to the view containing this container + * @param aRec Frame rectangle for container. + * @param aGridModel Model representing the grid contents + * @return pointer to the created CCamBurstThumbnailContainer object + */ + static CCamBurstThumbnailContainer* NewL( CCamAppController& aController, + CAknView& aView, + const TRect& aRec, + CCamBurstThumbnailGridModel& aGridModel ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamBurstThumbnailContainer(); + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppController instance + * @param aView reference to the view containing this container + * @param aGridModel Model representing the grid contents + */ + CCamBurstThumbnailContainer( CCamAppController& aController, + CAknView& aView, + CCamBurstThumbnailGridModel& aGridModel ); + + public: // Functions from base classes + /** + * From CamContainerBase + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From CoeControl + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + + protected: // Functions from base classes + /** + * From CoeControl + * @since 2.8 + * @return number of contained controls + */ + TInt CountComponentControls() const; + + /** + * From CoeControl + * @since 2.8 + * @param aIndex The index of the control required + * @return the requested control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + + /** + * From CCoeControl + * @since 2.8 + * @param aRect area where to draw + */ + void Draw( const TRect& aRect ) const; + + private: // Data + // Pointer to the CCoeControl for the thumbnail grid + CCamBurstThumbnailGrid* iGridControl; + + // The model describing the contents of the grid control + CCamBurstThumbnailGridModel& iGridModel; + + // touch feedback interface for providing tactile feedback + MTouchFeedback* iFeedback; + }; + +#endif // CAMBURSTTHUMBNAILCONTAINER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamBurstThumbnailGrid.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamBurstThumbnailGrid.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,296 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for displaying the images captured by a Burst session.* +*/ + + + +#ifndef CAMBURSTTHUMBNAILGRID_H +#define CAMBURSTTHUMBNAILGRID_H + +// =========================================================================== +// INCLUDES + +#include +#include +#include +#include // For Scroll component +#include // For ScrollModel +#include // For TAknLayoutRect + +#include "CamBurstThumbnailGridModel.h" + + +// =========================================================================== +// CONSTANTS +const TInt KGridWidth = 3; // Number of cells left to right + +const TInt KGridHeight= 3; // Number of cells top to bottom + +const TInt KGridSize = KGridWidth*KGridHeight; + + +const TInt KBurstGridDefaultThumbnails = 6; +const TInt KBurstGridMaxVisibleThumbnails = 9; + +enum BurstGridLayoutTypes + { + EDefaultOrLessThumbnails = 0, + EMaxVisibleThumbnails, + EScrollbarNeeded + }; + +const TInt KNumberOfBurstGridLayoutTypes = 3; + +// MACROS + +// =========================================================================== +// DATA TYPES + +// =========================================================================== +// FUNCTION PROTOTYPES + +// =========================================================================== +// FORWARD DECLARATIONS +class CFbsBitmap; +class CCamBurstThumbnailGridModel; +class CBitmapScaler; +class CEikScrollBar; + + +// =========================================================================== +// CLASS DECLARATION + +/** +* Utility class used to group together related layout information into one +* object, and construct itself using a supplied resource reader. +* +* @since 2.8 +*/ +class TCamBurstGridCellLayout + { +public: + /** + * Constructs the layout information for the object + * @since 2.8 + * @param aReader The resource reader to use for construction + * @param aRect The parent rect for the layout entries + */ + void ConstructFromResource( TResourceReader& aReader, TRect& aRect ); + +public: + TAknLayoutRect iCellRect; // Rectangle of the cell + TAknLayoutRect iHighRect; // Rectangle of the Highlight + TAknLayoutRect iMarkRect; // Rectangle of the "mark" + TAknLayoutRect iThmbRect; // Rectangle of the thumbnail + }; + + +/** +* Handles the drawing of the Burst Post-Capture control +* +* @since 2.8 +*/ +class CCamBurstThumbnailGrid : public CCoeControl, + public MThumbModelObserver, + public MEikScrollBarObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamBurstThumbnailGrid* NewL( const CCoeControl* aParent, CCamBurstThumbnailGridModel& aModel ); + + /** + * Destructor. + */ + virtual ~CCamBurstThumbnailGrid(); + + public: // New functions + + /** + * Constructs the layout information for the grid + * @since 2.8 + */ + void ReadLayout(); + + /** + * Returns the ID of the resource to use for the grid structure + * @since 2.8 + * @returns The resource ID to use + */ + TInt ResourceId(); + + /** + * Tests if the given coordinates match to any item on burst grid + * @param aPosition Coordinates to be tested + * @return TInt Grid item index that macthes the coordinates. Negative value returned + * if position does not match any grid item + */ + TInt HitTestGridItems( TPoint aPosition ); + + public: // Functions from base classes + + /** + * From CCoeControl + * @since 2.8 + * @param aRect Area to be redrawn + */ + void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl + * @since 2.8 + * @return The number of controls owned by this control + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl + * @since 2.8 + * @param aIndex The index of the required control + * @return Returns the requested control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl + * @since 2.8 + */ + void SizeChanged(); + + /** + * From CCoeControl + * @since 2.8 + * @param aKeyEvent Details of the key event + * @param aType The keypress type + * @return TKeyResponse whether the key event was handled or ignored + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) ; + + /** + * From MThumbModelObserver. + * Called when the highlight has changed + * @since 2.8 + */ + void HighlightChanged(); + + /** + * From MThumbModelObserver + * Called when an image has been deleted. + * @since 2.8 + */ + void ImagesDeleted(); + + /** + * From MThumbModelObserver + * Called when a new thumbnail has been generated + * @since 2.8 + */ + void ThumbnailGenerated(); + + /** + * From MEikScrollBarObserver + * Called when a new thumbnail has been generated + * @since 2.8 + * @param aScrollBar + * @param aEventType + */ + void HandleScrollEventL( CEikScrollBar* aScrollBar, TEikScrollEvent aEventType ); + + /** + * Creates the scrollbar control. SetMopParent must be called before this. + * @since 3.0 + */ + void CreateScrollBarL(); + + /** + * Creates the scrollbar control. + * @since 3.0 + */ + void DeleteScrollBar(); + + /** + * Sets up the scroll bar, used on start up and when items are deleted + * to update the state + * @since 3.0 + */ + void SetupScrollbarL(); + + /** + * Returns the height of the grid control. + * @since 3.0 + * @return Height of the grid control in cells + */ + TInt GridSize() const; + + protected: // New functions + + /** + * Updates layouts. Used to reload layouts when images are deleted. + */ + void UpdateLayout(); + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CCamBurstThumbnailGrid( CCamBurstThumbnailGridModel& aModel ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const CCoeControl* aParent ); + + + + public: // Data + + protected: // Data + + private: // Data + // Passed in by (and owned by) View + CCamBurstThumbnailGridModel& iModel; + + // Array of layout objects read from the resource file. + // Each object represents a "cell" on the grid + TCamBurstGridCellLayout iGridCellLayout[KGridSize]; + + // Bitmap and mask for the "mark" check box for an image + CFbsBitmap* iBitmapMark; + CFbsBitmap* iBitmapMarkMask; + + CEikScrollBarFrame* iScrollFrame; + TAknDoubleSpanScrollBarModel ivModel; // model for double span (side) scrollbar + TAknLayoutRect iScrollLayout; + + // As the grid size is potentially variable depending on whether + // limited or unlimited capture is used, need to keep track of the + // grid size used. + TInt iGridSize; + + }; + + + +#endif // CAMBURSTTHUMBNAILGRID_H + +// =========================================================================== +// End of File + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamBurstThumbnailGridModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamBurstThumbnailGridModel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,480 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model class holding thumbnail grid state information* +*/ + + + +#ifndef CAMBURSTTHUMBNAILGRIDMODEL_H +#define CAMBURSTTHUMBNAILGRIDMODEL_H + +// INCLUDES +#include +#include +#include + +#include // For Scroll component +#include // For ScrollModel + +#include "CamAppController.h" +#include "CamBurstThumbnailGridSizer.h" + +// CONSTANTS +// The max number of items in the small grid layout +const TInt KSmallGridCellCount = 6; + +// The height of the small grid in cells +const TInt KSmallGridHeight = 2; + +// The height of the large grid in cells +const TInt KLargeGridHeight = 3; + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CCamThumbnailGridSizer; + +// CLASS DECLARATION + +/** +* Simple class representing a burst capture image's attributes +* +* @since 2.8 +*/ +class CThumbnailGridItem : public CBase + { +public: + // Constructor + CThumbnailGridItem(); + + // Destructor + ~CThumbnailGridItem(); + +public: + // Scaled-down thumbnail for display in the Grid control + CFbsBitmap* iDisplayThumb; + + // Whether or not this item has been marked. + TBool iMarked; + }; + + +/** +* Mix-in class used for listening to GridModel events. +* +* @since 2.8 +*/ +class MThumbModelObserver + { +public: + /** + * Called when the highlighted option changes + * @since 2.8 + */ + virtual void HighlightChanged(); + + /** + * Called when one or more images have been deleted + * @since 2.8 + */ + virtual void ImagesDeleted(); + + /** + * Called when a new thumbnail has been generated + * @since 2.8 + */ + virtual void ThumbnailGenerated(); + }; + + +/** +* Contains the state of the Burst Post-Capture control +* +* @since 2.8 +*/ +class CCamBurstThumbnailGridModel : public CBase, + public MBitmapScaler + { + public: + // Bitmask used to identify the events to register for. + enum TModelEvent + { + EModelEventHighlight = 0x1, + EModelEventDeleted = 0x2, + EModelEventThumb = 0x4 + }; + + // Used to represent the direction of highlight movement + enum TMoveSelect + { + EMoveSelectUp, + EMoveSelectDown, + EMoveSelectLeft, + EMoveSelectRight, + }; + + // Used to represent the internal state for the image resizing operation + enum TTmbState + { + ETmbStateScaling, // Currently scaling an image + ETmbStateIdle // Image finished, but more to do + }; + + public: + /** + * Two-phased constructor. + */ + static CCamBurstThumbnailGridModel* NewL(); + + /** + * Destructor. + */ + ~CCamBurstThumbnailGridModel(); + + public: // New functions + /** + * Attempts to move the selection highlight a specified direction + * @since 2.8 + * @param aDir The direction to move the hightlight + * @return TBool indicating whether the move was possible or not + */ + TBool MoveHighlight( TMoveSelect aDir ); + + TBool SetHighlight( TInt aIndex ); + + /** + * Sets new size for the scaling + * @param aThumbSize The new size + */ + void SetThumbnailSize( const TSize aThumbSize ); + + /** + * Returns the number of valid (non-deleted) cells. Used by thumbnail + * grid to find how many cells it may need to draw. + * @since 2.8 + * @return Number of cells + */ + TInt NoOfValidCells(); + + /** + * Returns a specific grid item based on the supplied index. + * @since 2.8 + * @param aValidIndex The index of the grid item to retrieve + * @return Pointer to the required item + */ + CThumbnailGridItem* GridItem( TInt aValidIndex ); + + /** + * Returns a specific bitmap based on the supplied index. + * @since 2.8 + * @param aValidIndex The index of the bitmap to retrieve + * @return Pointer to the required bitmap + */ + const CFbsBitmap* Snapshot( TInt aValidIndex ); + + /** + * Set the burst array for the model to use + * @since 2.8 + * @param aArray pointer to the burst array + */ + void SetBurstArrayL( CCamBurstCaptureArray* aArray ); + + /** + * Returns the grid index for the cell in the top-left of the display + * @since 2.8 + * @return The index to top left cell + */ + TInt TopLeftGridIndex(); + + /** + * Returns the position of the highlight. + * @since 2.8 + * @return The index to the valid (non-deleted) list + */ + TInt HighlightedGridIndex(); + + /** + * Returns the index of the hightlighted entry in the CONTROLLER's + * burst array. This array includes deleted and NON-DELETED items + * @since 2.8 + * @return The index to the controller's burst array + */ + TInt HighlightedBurstIndex(); + + /** + * Sets (or clears) the selection 'mark' of the currently highlighted + * cell item + * @since 2.8 + * @param aSet Whether to set or clear the mark + */ + void SetCurrentMark( TBool aSet ); + + /** + * Marks or un-marks all non-deleted items + * @since 2.8 + * @param aMark ETrue to set the mark, EFalse to clear it. + */ + void MarkAll( TBool aMark ); + + /** + * Returns the number of images that have been "marked" + * @since 2.8 + * @return The number of marked images. + */ + TInt NoOfMarkedImages() const; + + /** + * Returns the total number of images including 'deleted' images + * @since 2.8 + * @return The number of images. + */ + TInt NoOfImages() const; + + /** + * Returns whether the specified item is marked or not. + * @since 2.8 + * @param aIndex The index of the item to check + * @return ETrue if it is marked, else EFalse + */ + TInt IsMarkedL( TInt aIndex ); + + /** + * Deletes all marked items + * @since 2.8 + */ + void DeleteMarkedL(); + + /** + * Deletes currently highlighted object + * @since 2.8 + */ + void DeleteHighlightL(); + + /** + * Adds an observer to a specified set of events + * @since 2.8 + * @param aObserver The component to be notified + * @param aBitMask The bitmask of events to be reported + */ + void AddModelObserverL( MThumbModelObserver* aObserver, TInt aBitMask ); + + /** + * Remove an observer to a specified set of events + * @since 2.8 + * @param aObserver The component to not be notified + * @param aBitMask The bitmask of events to not be reported + */ + void RemoveModelObserver( MThumbModelObserver* aObserver, TInt aBitMask ); + + /** + * Notify all observers to a specific event + * @since 2.8 + * @param aEvent The event which has occurred. + * @param aParam Optional parameter to be passed with the event + */ + void NotifyModelObserver( TModelEvent aEvent, TInt aParam = 0 ); + + /** + * Returns the image name (no path or extension) of the currently + * highlighted item. + * @since 2.8 + * @return The image name + */ + TPtrC HighlightedImageName(); + + /** + * Returns the height of the visible grid, typically 2 or 3 cells high. + * @since 2.8 + * @returns the height of the visible grid. + */ + TInt GridHeight(); + + /** + * Returns the image name (no path or extension) of an item. + * @since 2.8 + * @param aIndex The index of the item. + * @return The image name + */ + TPtrC ImageName( TInt aIndex ); + + /** + * Returns the image name (with path and extension) of an item. + * Uses the index in the global array (including deleted items) + * @since 2.8 + * @param aIndex The index of the item (in the global array). + * @return The image full name and path + */ + TPtrC ImageFileName( TInt aIndex ) const; + + /** + * Refreshes internal state by checking whether the currently + * highlighted item has been deleted. This may happen if an item + * is viewed in post capture, then deleted. + * @since 2.8 + */ + void RefreshL(); + + /** + * Used to update where the top-left view on the grid is located. + * @since 2.8 + * @param aMovingUp whether the update is because the curor is moving up. + */ + void UpdateViewableGrid( TBool aMovingUp ); + + /** + * Converts from the "valid-only" list of items to the global "AllThumb" + * list. + * @since 2.8 + * @param aValidIndex The valid index to convert from. + * @return The global index, or KErrNotFound. + */ + TInt ConvertFromValidToGlobalIndex( TInt aValidIndex ); + + /** + * + */ + void ScrollGrid( TBool aScrollDown, TInt aNewScrollPos ); + + /** + * Cancels the thumbnail scaling + * @since 2.8 + */ + void CancelThumbnails(); + + /** + * Notifies model that images have been deleted outside of camera + */ + void ImageFilesDeleted(); + + public: // Functions from base classes + /** + * Called by sizer utility class when a bitmap rescale operation + * has completed. + * @since 2.8 + * @param aErr Indicates the completion code (standard epoc error codes possible) + * @param aBitmap The resized bitmap (called class takes ownership) + */ + void BitmapScaleCompleteL( TInt aErr, CFbsBitmap* aBitmap, TInt32 aInfo ); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CCamBurstThumbnailGridModel(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Adds the specified cell to the internal structures. Takes ownership + * of the supplied cell object + * @since 2.8 + * @param aCell The grid item to add + */ + void AddCellL( CThumbnailGridItem* aCell ); + + /** + * Used for the generation of the specified thumbnail + * @since 2.8 + * @param aIndex The index (global) of the item to resize + */ + void StartThumbnailL( TInt aIndex ); + + /** + * Force a check for thumbs; deleting those not visible and generating + * new thumbs for newly visible cells. + * @since 2.8 + */ + void RecalculateThumbs(); + + /** + * Queues thumbnails to be resized as required. + * @since 2.8 + */ + void QueueThumbnailsL(); + + /** + * Internal function used by the various delete functions + * @since 2.8 + * @param aGlobalIndex The global index of the item to delete + */ + void DeleteItemL( TInt aGlobalIndex ); + + /** + * Internal function used by the various delete functions + * @since 2.8 + * @param aHighlightDeleted Whether the delete operation this call + * followed involved the deletion of the highlight + */ + void DoPostDeleteGridCheck( TBool aHighlightDeleted ); + + + private: // Data + TInt iCurrHighlight; // Grid index of current highlight + TInt iImagesMarked; // Number of images marked + TInt iTmpThumbIndex; // The record we are creating a thumb for + + // An array of ALL thumbnail grid items, the "global" list. + // Includes delete and non-deleted + RPointerArray iAllThumbGrid; + + // An array of VALID (non-deleted) items only. + RPointerArray iValidThumbGrid; + + + // Pointer to the burst mode capture array. + CCamBurstCaptureArray* iBurstArray; // Not owned + + // Utility class used for resizing bitmaps + CCamThumbnailGridSizer* iGridSizer; + + // Current internal state (referring to resizing) + TTmbState iState; + + // List of objects requesting bitmap state updates + RPointerArray iThumbObserver; + + // Array of observers for the hightlight changed + RPointerArray iHighlightObserver; + + // Array of observers for the delete events + RPointerArray iDeleteObserver; + + // Grid index of "top left" cell. + TInt iTopLeftIndex; + + // Either 2 (if upto 6 images) or 3 (if more than 6 images) + TInt iGridHeight; + + // Size of the scaled thumbnails + TSize iThumbSize; + }; + + +#endif // CAMBURSTTHUMBNAILGRIDMODEL_H + +// End of File + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamBurstThumbnailGridSizer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamBurstThumbnailGridSizer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,191 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class used to for resizing burst mode thumbnails* +*/ + + + +#ifndef CAMBURSTTHUMBNAILGRIDSIZER_H +#define CAMBURSTTHUMBNAILGRIDSIZER_H + +// INCLUDES +#include // For CBitmapScaler + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +// Helper class +class CScaleTask : public CBase + { + // ======================================================= + public: + + static CScaleTask* NewL( const CFbsBitmap& aBitmap, + const TSize& aSize, + TInt32 aInfo ); + + virtual ~CScaleTask(); + + private: + + CScaleTask( const TSize& aSize, + TInt32 aInfo ); + + void ConstructL( const CFbsBitmap& aBitmap ); + + // ------------------------------------------------------- + public: + + inline const CFbsBitmap* Bitmap() const { return iSrc; }; + inline const TSize& Size() const { return iSize; }; + inline TInt32 Info() const { return iInfo; }; + + // ======================================================= + private: + + CFbsBitmap* iSrc; //< owned + TSize iSize; + TInt32 iInfo; + + // ======================================================= + }; + + +// Interface definition for notification of when an image has been resized. +class MBitmapScaler + { +public: + /** + * Mixin interface to be implemented by any object wishing to receive + * notification of scale complete events. + * @since 2.8 + * @param aErr KErrNone if successful, on error other Epoc codes possible + * @param aBitmap The resized bitmap (called class takes ownership) + * @param aInfo Optional parameter that will be passed back when scale completes + */ + virtual void BitmapScaleCompleteL( TInt aErr, CFbsBitmap* aBitmap, TInt32 aInfo ) = 0 ; + }; + +/** +* Utility class used by the Thumbnail Grid Model for resizing/scaling bitmaps +* +* @since 2.8 +*/ +class CCamThumbnailGridSizer : public CActive + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aObserver The object to be notified of scaling completion + * @param aSize The default size of the bitmap to scale TO + * @return An instance of the sizer object + */ + static CCamThumbnailGridSizer* NewL( MBitmapScaler* aObserver, TSize& aSize ); + + /** + * Destructor. + */ + virtual ~CCamThumbnailGridSizer(); + + public: // New functions + + + /** + * Sets new size for the scaling + * @param aThumbSize The new size + */ + void SetSize( const TSize aThumbSize ); + + /** + * Scales from a source bitmap to a target bitmap, using the dimentions + * of the target bitmap to define the scale + * @since 2.8 + * @param aSrc Source bitmap, scaling from + */ + void StartScaleL( const CFbsBitmap& aSrc ); + + /** + * Scales from a source bitmap to a target bitmap, using the dimensions + * of the target bitmap to define the scale + * @since 2.8 + * @param aSrc Source bitmap, scaling from + * @param aSize The size of the bitmap to scale to + * @param aInfo Optional parameter that will be passed back when scale completes + */ + void StartScaleL( const CFbsBitmap& aSrc, TSize& aSize, TInt32 aInfo ); + + public: // Functions from base classes + + protected: // New functions + + protected: // Functions from base classes + + /** + * From CActive + */ + void DoCancel(); + + /** + * From CActive + */ + void RunL(); + + private: + + /** + * C++ default constructor. + * @param aObserver The object to be notified of scaling completion + * @param aSize The default size of the bitmap to scale TO + */ + CCamThumbnailGridSizer( MBitmapScaler* aObserver, TSize& aSize ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Allows specifying of specific sizing task to start + * @param aTask The task to begin + * @since 3.0 + */ + void StartScaleL( CScaleTask* aTask ); + + private: // Data + // Bitmap scaling object, actually does the scaling + CBitmapScaler* iScaler; + + // The object to be notified when scaling is complete. + MBitmapScaler* iObserver; + + // Temporary bitmap used while performing the scaling operation + CFbsBitmap* iTmpBitmap; + + // The size of the bitmap to scale to + TSize iThumbSize; + + // List of outstanding scaling tasks + RPointerArray iScaleTaskArray; + }; + +#endif // CAMBURSTTHUMBNAILGRIDSIZER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamBurstThumbnailView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamBurstThumbnailView.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,260 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View class to display a thumbnail grid after burst capture* +*/ + + +#ifndef CAMBURSTTHUMBNAILVIEW_H +#define CAMBURSTTHUMBNAILVIEW_H + +// INCLUDES +#include "CamViewBase.h" +#include "CamPostCaptureViewBase.h" +#include "CamBurstThumbnailGridModel.h" +#include "AiwServiceHandler.h" // for CAiwServiceHandler + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* View class to display a grid of thumbnails representing the images captured by +* a single burst capture operation +* +* @since 2.8 +*/ +class CCamBurstThumbnailView : public CCamPostCaptureViewBase, + public MThumbModelObserver, + public MAiwNotifyCallback + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aController Reference to either the application controller + * base class or test base class + * @return pointer to the created CCamBurstThumbnailView object + */ + static CCamBurstThumbnailView* NewLC( CCamAppController& aController ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamBurstThumbnailView(); + + public: // New functions + + /** + * Shows the delete note for the required number of files, and if the + * user confirms, will trigger the deletion of the marked files + * @since 2.8 + * @return ETrue if ok to delete, else EFalse + */ + TBool DisplayDeleteNoteL(); + + /** + * Deletes the currently marked or highlighted items + * @since 3.0 + */ + void DoDeleteL(); + + public: // Functions from base classes + + /** + * From CAknView. + * @since 2.8 + * @return UID of view + */ + TUid Id() const; + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aResourceId Resource Id of the menu + * @param aMenuPane Pointer to the pane showing the menu + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * From CAknView Handles the foreground/background event + * @since 2.8 + * @param aForeground ETrue if this view is on foreground, else EFalse. + */ + void HandleForegroundEventL( TBool aForeground ); + + /** + * From CAknView. + * @since 2.8 + * @param aPrevViewId the ID for previous view we are switching from + * @param aCustomMessageId the Uid for message passed to this view + * @param aCustomMessage descriptor containing data content for view specific message + */ + void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * From base class MAiwNotifyCallback. + * Handles any notification caused by asynchronous ExecuteCommandL + * or event. + * @param aCmdId Service command associated to the event. + * @param aEventId Occured event + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL + * @return error code for the callback + */ + TInt HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CAiwGenericParamList& aEventParamList, + const CAiwGenericParamList& aInParamList ); + + + /** + * From CAknView. + * @since 2.8 + */ + void DoDeactivate(); + + /** + * From MThumbModelObserver. + * Called when the highlight has changed + * @since 2.8 + */ + void HighlightChanged(); + + /** + * From MThumbModelObserver. + * Called when files have been deleted + * @since 2.8 + */ + void ImagesDeleted(); + + /** + * Check if renaming to the given name is valid. + * @since 2.8 + * @param aFilename The new name to check. + * @return ETrue if the name is valid. + */ + TBool IsNewNameValidL( const TDesC& aFilename ); + + + /** + * Returns whether the view is a burst capture postcapture view or not + * @since 3.0 + * @returns ETrue if view is burst post capture postcapture + */ + TBool IsBurstPostCapture(); + + + /** + * Notifies view that image file(s) have been deleted outside of camera + */ + void ImageFilesDeleted(); + + + protected: // New functions + + /** + * C++ default constructor. + * @since 2.8 + * @param aController Reference to either the application controller + * base class or test base class + */ + CCamBurstThumbnailView( CCamAppController& aController ); + + /** + * Symbian 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + /** + * Create message. + * @since 2.8 + */ + virtual void DoSendAsL() const; + + /** + * If no items are marked, returns the ID of the currently + * highlighted item. Otherwise returns the ID of the first + * marked item (to be called when up to 1 items are marked). + * @return Index of item that is marked / highlighted + * @since 3.0 + */ + TInt SingleSelectionGridIndexL() const; + +#ifndef __WINS__ + /** + * Send file to current caller using SFI functionality + * @since 2.8 + */ + //virtual void DoInCallSendL() const; +#endif + + /** + * Dim one-click upload button if more than one image is marked. + * @since S60 v5.0 + */ + void UpdateOneClickUploadButton(); + + /** + * Handles dynamic initialisation for aiw menus + * @since 9.1 + */ + void DynInitAiwMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: // Functions from base classes + + /** + * From CCamViewBase + * Create the container associated with this view. + * @since 2.8 + */ + void CreateContainerL(); + + /** + * From CCamViewBase + * Set the view's title text + * @since 2.8 + */ + void SetTitlePaneTextL(); + + /** + * Calculates the size of a single thumbnail based on the infromation + * how many images are alltogether on the burst grid + * @param aNumberOfBurstImages Total amount of burst images + */ + TSize CalculateThumbnailSize( TInt aNumberOfBurstImages ); + + private: + // The model describing the contents of the thumbnail grid + CCamBurstThumbnailGridModel* iGridModel; + + // Whether we should reset the model when view deactivated + TBool iResetModelOnDeactivate; + }; + +#endif // CAMBURSTTHUMBNAILVIEW_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCallStateAo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCallStateAo.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Listens for changes to the call state* +*/ + + +#ifndef CAMCALLSTATEAO_H +#define CAMCALLSTATEAO_H + +// INCLUDES +#include +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* +* Mix-in class specifying the callback interface to be used with CCamCallStateAo +* +* @since 3.0 +*/ +class MCamCallStateObserver + { + public: + /** + * Callback function, called when the call state changes + * @since 3.0 + * @param aState The new call state + * @param aError The error associated with request completion + */ + virtual void CallStateChanged( TPSCTsyCallState aState, TInt aError ) = 0; + }; + + +/** +* Active Object class to watch the call state +* +* @since 3.0 +*/ +class CCamCallStateAo : public CActive + + { + public: // Constructors and destructor + /** + * Two-phased constructor. + * @since 3.0 + * @param aObserver The observer requesting callback on call events + * @return Constructed instance of the class + */ + static CCamCallStateAo* NewL( MCamCallStateObserver* aObserver ); + + /** + * Destructor. + */ + ~CCamCallStateAo(); + + protected: // Functions from base classes + /** + * From CActive + * Cancels an outstanding request + * @since 3.0 + */ + void DoCancel(); + + /** + * From CActive + * Called on completion of a request + * @since 3.0 + */ + void RunL(); + + /** + * From CActive + * Called when an error occurs during a request + * @since 3.0 + * @param aError The Epoc-error code for the error. + * @return KErrNone + */ + TInt RunError( TInt aError ); + + private: + /** + * C++ default constructor. + * @since 3.0 + * @param aObserver The observer requesting callback on call events + */ + CCamCallStateAo( MCamCallStateObserver* aObserver ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + + public: // Data + // The observer to be notified on an event + MCamCallStateObserver* iObserver; + + // Publish and Subscribe property handle + RProperty iProperty; + }; + +#endif // CAMCALLSTATEAO_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCaptureSetupContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCaptureSetupContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,216 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for displaying capture set-up controls* +*/ + + +#ifndef CAMCAPTURESETUPCONTAINER_H +#define CAMCAPTURESETUPCONTAINER_H + +// INCLUDES +#include +#include + +#include "CamContainerBase.h" +#include "CamControllerObservers.h" +#include "mcamcameraobserver.h" + + +// FORWARD DECLARATIONS +class CCamCaptureSetupControlHandler; +class MTouchFeedback; + + +// CLASS DECLARATION + +/** +* Container base class +*/ +class CCamCaptureSetupContainer : public CCamContainerBase, + public MCamCameraObserver, + public MEikListBoxObserver +// public MCamViewFinderObserver + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aController Controller reference + * @param aView View reference + * @param aControlHandler Handler reference + * @param aRect Frame rectangle for container. + */ + static CCamCaptureSetupContainer* NewL( + CCamAppController& aController, + CAknView& aView, + CCamCaptureSetupControlHandler& aControlHandler, + const TRect& aRect ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamCaptureSetupContainer(); + + + // ----------------------------------------------------- + // From CCoeControl + private: + + /** + * @since 2.8 + * @return number of contained controls + */ + TInt CountComponentControls() const; + + /** + * @since 2.8 + * @param aIndex the index of the control + * @return pointer to the component control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * @since 2.8 + * @param aRect area where to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /* + * From CoeControl + * @param aPointerEvent the pointer event to handle + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + /** + * From MEikListBoxObserver + */ + void HandleListBoxEventL(CEikListBox* aListBox, + TListBoxEvent aEventType ); + + // ----------------------------------------------------- + // From MCamCameraObserver + public: + + + /** + * Handle events sending app to foreground or background + * @param aForeground whether the event brings the app to fore or background + */ + + void HandleForegroundEventL( TBool aForeground ); + + + /** + * @since Camera 4.0 + * @see MCamCameraObserver + */ + virtual void HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData = NULL ); + + // ----------------------------------------------------- + // Other methods + private: + + /** + * Calculates the position for the settings editing control + * @since 2.8 + * @return the top left corner position for the control + */ + TPoint ControlPositionL() const; + + /** + * Read nontouch layout + * @return TRect, listbox rectangle + */ + TRect NonTouchLayout(); + + /** + * Read touch layout + * @return TRect, listbox rectangle + */ + TRect TouchLayout(); + + /** + * Enters viewfinder mode either in image or videomode + * depending current visible view. Also starts idle timer. + */ + void ReserveAndStartVF(); + + // ----------------------------------------------------- + // Constructors + private: + + /** + * C++ constructor + * @param aController Controller reference + * @param aView View reference + * @param aControlHandler Handler reference + * @since 2.8 + */ + CCamCaptureSetupContainer( + CCamAppController& aController, + CAknView& aView, + CCamCaptureSetupControlHandler& aControlHandler ); + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + */ + void ConstructL( const TRect& aRect ); + + + // ===================================================== + // Data + protected: + + // The control handler that creates the setting editing control + CCamCaptureSetupControlHandler& iControlHandler; + // The control that edits the setting value + CCoeControl* iCaptureSetupControl; + // The text shown as the title of the container + HBufC* iTitleText; + // Whether or not the container displays a viewfinder preview pane + TBool iViewFinding; + + // Layout rect for cropped viewfinder display + TAknLayoutRect iViewFinderRectLayout; + + TAknLayoutRect iSetupControlRectLayout; + + // Layout rect for title text + TAknLayoutText iTitleTextRectLayout; + + // width of list-box + TInt iListBoxWidth; + + TBool iActivateOnTouchRelease; + MTouchFeedback* iFeedback; // not own + TRect iLayoutAreaRect; + }; + +#endif // CAMCAPTURESETUPCONTAINER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCaptureSetupControlHandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCaptureSetupControlHandler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for creating, initializing and observing* +*/ + + + +#ifndef CAMCAPTURESETUPCONTROLHANDLER_H +#define CAMCAPTURESETUPCONTROLHANDLER_H + +// INCLUDES +#include + +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "CamSettingValueObserver.h" + +// CONSTANTS + +// FORWARD DECLARATIONS +class CCamAppController; +class CCoeControl; + +// CLASS DECLARATION + +/** +* Class to create, initialize and observe a capture set-up control +* +* @since 2.8 +*/ +class CCamCaptureSetupControlHandler : public CBase, + public MCamSettingValueObserver + + { + public: // Constructors and destructor + + /** + * Constructor. + * @since 2.8 + * @param aController The application controller providing access to the + * camera settings + * @param aSettingType An enumeration value used to indicate the setting + * to be edited + */ + CCamCaptureSetupControlHandler( CCamAppController& aController, + TCamSettingItemIds aSettingType ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamCaptureSetupControlHandler(); + + public: // New functions + + /** + * Create and initialize a new capture setup control + * ownership of the control is transferred to the calling class. + * @since 2.8 + * @return A pointer to the new control + */ + CCoeControl* CreateCaptureSetupControlL( const CCoeControl* aParent ); + + /** + * From MCamSettingValueObserver + * Handle an update to the setting that is created by the capture setup controller + * @since 2.8 + */ + void HandleSettingValueUpdateL( TInt aNewValue ); + + /** + * Return the id of the title pane resource for the current setting type + * @since 2.8 + * @return A title pane resource id + */ + TInt ControlTitleResourceId() const; + + /** + * Whether or not the control requires a viewfinder preview pane + * @since 2.8 + * @return ETrue if the control needs a viewfinder pane, else EFalse + */ + TBool ControlUsesViewFinder() const; + + /** + * Whether or not the control is of listbox type + * @return ETrue if listbox, else EFalse + */ + TBool ControlIsListBox() const; + + /** + * Whether or not the control is of slider type + * @return ETrue if slider, else EFalse + */ + TBool ControlIsSlider() const; + + /** + * Return the id of the position resource for the current setting type + * @since 2.8 + * @return A position resource id + */ + TInt ControlPositionResourceId() const; + + /** + * Return the id of the viewfinder resource for the current setting type + * @since 2.8 + * @return A viewfinder resource id + */ + TInt ViewfinderResourceId() const; + + /** + * Return Identifies which setting is being edited + * @since 2.8 + * @return Identifies which setting is being edited + */ + TCamSettingItemIds SettingType() const; + + private: + + /** + * Return the id of the resource to construct the control + * @since 2.8 + * @return the control's resource id + */ + TInt ResourceForControl() const; + + private: // Data + // Provides access to the settings model + CCamAppController& iController; + // Identifies which setting is being edited + TCamSettingItemIds iSettingType; + }; + +#endif // CAMCAPTURESETUPCONTROLHANDLER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCaptureSetupMenu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCaptureSetupMenu.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,191 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the listbox that draws the Capture Setup Menu.* +*/ + + +#ifndef CAMCAPTURESETUPMENU_H +#define CAMCAPTURESETUPMENU_H + +// INCLUDES +#include "CamContainerBase.h" +#include + +// FORWARD DECLARATIONS +class CCamCaptureSetupMenuListBox; + +// CLASS DECLARATION + +/** +* CCamCaptureSetupMenu container control class. +* +*/ +class CCamCaptureSetupMenu : public CCamContainerBase, public MAknFadedComponent + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aController used by the list box model to get list item values. + * @param aView the view that this container belongs to. + * @param aRect the client rectangular area. + * @param aResourceId the id of the resource that will be used to populate the list box. + * @param aSelectedItemIndex the index of the selected item. + * @return pointer to the created capture setup menu container. + */ + static CCamCaptureSetupMenu* NewL( + CCamAppController& aController, + CAknView& aView, + const TRect& aRect, + TInt aResourceId, + TInt aSelectedItemIndex = 0 ); + /** + * Destructor. + * @since 2.8 + */ + ~CCamCaptureSetupMenu(); + + public: // New functions + /** + * Returns the list index of the currently selected item. + * @since 2.8 + * @return the list index + */ + TInt CurrentItemIndex() const; + + /** + * Fades everything behind this menu. + * @since 2.8 + * @param aFade ETrue if everything is to be faded. Otherwise EFalse. + */ + void FadeBehind( TBool aFade ); + + public: // Functions from base class MAknFadedComponent + + /** + * Returns the number of components that are not faded + * when the fader object is active. + * @since 2.8 + * @return the number of unfaded components. + */ + TInt CountFadedComponents(); + + /** + * Returns a pointer to a non-faded component. + * @since 2.8 + * @param aIndex the index of the non-faded component. + * @return the CCoeControl pointer. + */ + CCoeControl* FadedComponent(TInt aIndex); + + public: // Functions from base classes + + /** + * Handles commands. + * @since 2.8 + * @param aCommand the command id. + */ + void HandleCommandL( TInt aCommand ); + + + private: // Constructors. + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppController instance + * @param aView reference to the view containing this container + */ + CCamCaptureSetupMenu( CCamAppController& aController, + CAknView& aView ); + + /** + * 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + * @param aResourceId the id of the resource to populate the list box with. + * @param aSelectedItemIndex the index of the selected item. + */ + void ConstructL( const TRect& aRect, TInt aResourceId, TInt aSelectedItemIndex ); + + private: // Functions from base classes + + /** + * Returns number of component controls in this container. + * @since 2.8 + * @return the number of component controls. + */ + TInt CountComponentControls() const; + + /** + * Returns a component control. + * @since 2.8 + * @param aIndex the index of the desired component control. + * @return the component control. + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * Draws the container. + * @since 2.8 + * @param aRect the client rectangular area. + */ + void Draw( const TRect& aRect ) const; + + /** + * Handles key events. + * @since 2.8 + * @param aKeyEvent the key event. + * @param aType the type of key event. + * @return whether the key has been consumed or not. + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + + + private: // New functions + + /** + * Creates the list box. + * @since 2.8 + * @param aRect the client rectangular area. + * @param aResourceId the id of the resource to populate the list. + * @param aSelectedItemIndex Index of the item to be selected. + */ + void CreateCaptureSetupListBoxL( TRect& aRect, TInt aResourceId, TInt aSelectedItemIndex ); + + /** + * Returns the command id for activating the current list item control. + * @since 2.8 + * @return the command id. + */ + TInt CommandIdForActivatingCurrentItemControl(); + + /** + * Handles the pressing of the softkey selection. + * @since 2.8 + */ + void HandleSelectionL(); + + private: //data + + // The list box. + CCamCaptureSetupMenuListBox* iCaptureSetupListBox; + + // Fader object used to fade everything except this menu and the CBA. + TAknPopupFader iPopupFader; + + }; + +#endif // CAMCAPTURESETUPMENU_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCaptureSetupMenuListBox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCaptureSetupMenuListBox.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,120 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Encapsulates the Capture Setup Menu listbox.* +*/ + + +#ifndef CAMCAPTURESETUPMENULISTBOX_H +#define CAMCAPTURESETUPMENULISTBOX_H + +// INCLUDES +#include +//#include +#include +// FORWARD DECLARATIONS +class CCamCaptureSetupMenuListBoxModel; +class CCamAppController; + +// CLASS DECLARATION + +/** +* Capture setup menu listbox +* Main class of list box +* +*/ +class CCamCaptureSetupMenuListBox : public CEikListBox + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aParent the container for this list box + * @param aReader the resource readerthat will be used to populate the list box. + * @param aController used by the list box model to get list item values. + * @param aSelectedItemIndex the index of the list item that should be highlighted. + * @return pointer to the created list item. + */ + static CCamCaptureSetupMenuListBox* NewL( const CCoeControl* aParent, TResourceReader& aReader, CCamAppController& aController, TInt aSelectedItemIndex ); + + /** + * Destructor. + * @since 2.8 + */ + ~CCamCaptureSetupMenuListBox(); + + public: // New functions + + /** + * Returns the settings model id that corresponds with the + * specified list item index. + * @since 2.8 + * @param aItemIndex the index of the list item. + * @return the settings model id associated with the list item. + */ + TInt ItemSettingsId( TInt aItemIndex ); + + protected: // Functions from base class CEikListBox + + /** + * Returns instance to view + * @since 2.8 + * @return Instance to CListBoxView + */ + virtual CListBoxView* MakeViewClassInstanceL(); + + public: // Functions from base class CEikListBox + + /** + * Handles key events. If a control wishes to process key events, it should + * implement this function. The implementation must ensure that the + * function returns EKeyWasNotConsumed if it does not do anything in + * response to a key event otherwise, other controls or dialogs may be + * prevented from receiving the key event. If it is able to process the + * event it should return EKeyWasConsumed. When a key event occurs, the + * control framework calls this function for each control on the control + * stack, until one of them can process the key event + * (and returns EKeyWasConsumed). + * @since 2.8 + * @param aKeyEvent The key event + * @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown + * @return Indicates whether or not the key event was used by this control + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + private: // Constructors + + /** + * Constructor + * @since 2.8 + */ + CCamCaptureSetupMenuListBox(); + + /** + * 2nd phase constructor + * @since 2.8 + * @param aParent the container for this list box + * @param aReader the resource readerthat will be used to populate the list box. + * @param aController used by the list box model to get list item values. + * @param aSelectedItemIndex the index of the list item that should be highlighted. + */ + void ConstructL( const CCoeControl* aParent, TResourceReader& aReader, + CCamAppController& aController, TInt aSelectedItemIndex ); + + private: // New functions + + private: // Data + }; + +#endif //CAMCAPTURESETUPMENULISTBOX_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCaptureSetupMenuListBoxModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCaptureSetupMenuListBoxModel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model class of capture setup menu list box.* +*/ + + +#ifndef CAMCAPTURESETUPMENULISTBOXMODEL_H +#define CAMCAPTURESETUPMENULISTBOXMODEL_H + +// INCLUDES +#include +#include + +// CLASS DECLARATION +class CFbsBitmap; +class CCamAppController; +class CCamCaptureSetupMenuListItem; +class TResourceReader; + +/** +* Model class of capture setup menu list box +* +*/ +class CCamCaptureSetupMenuListBoxModel : public CBase, public MListBoxModel + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aController used to obtain setting model values for list items. + * @param aReader used to construct the model's array of list items from resources. + * @return pointer to the created model. + */ + static CCamCaptureSetupMenuListBoxModel* NewLC + ( CCamAppController& aController, TResourceReader& aReader ); + + /** + * Destructor. + * @since 2.8 + */ + ~CCamCaptureSetupMenuListBoxModel(); + + public: // New functions + + /** + * Queries whether the item has icon text. + * @since 2.8 + * @return bool result. + */ + TBool ItemHasIconText( TInt aItemIndex ) const; + + /** + * Returns the bitmap to be used for a particular list item. + * @since 2.8 + * @param aItemIndex index of the list item. + * @param aMask ETrue to return the mask bitmap + * @return pointer to the bitmap. + */ + CFbsBitmap* BitmapForItem( TInt aItemIndex, TBool aMask ); + + /** + * Returns the text to be used for a particular list item. + * @since 2.8 + * @param aItemIndex index of the list item. + * @return Ref to the item text. + */ + const TDesC& TextForItem( TInt aItemIndex ) const; + + /** + * Returns the text to be used in place of an icon for a particular list item. + * @since 2.8 + * @param aItemIndex index of the list item. + * @return Ref to the icon text. + */ + const TDesC& IconTextForItem( TInt aItemIndex ) const; + + /** + * Returns the settings model id associated with a particular list item. + * @since 2.8 + * @param aItemIndex index of the list item. + * @return the settings model id. + */ + TInt SettingsModelIdAssociatedWithItem( TInt aItemIndex ) const; + + public: // Functions from MListBoxModel + + /** + * From MListBoxModel returns number of items in item array + * @since 2.8 + * @return Number of items + */ + TInt NumberOfItems() const; + + /** + * Returns pointer to the MDesCArray + * @since 2.8 + * @return Handle to MDesCArray + */ + const MDesCArray* MatchableTextArray() const; + + private: // Constructors + + /** + * C++ default constructor. + * @since 2.8 + * @param aController used to obtain setting model values for list items. + */ + CCamCaptureSetupMenuListBoxModel( CCamAppController& aController ); + + /** + * 2nd phase constructor. + * @since 2.8 + * @param aReader used to construct the model's array of list items from resources. + */ + void ConstructFromResourceL( TResourceReader& aReader ); + + + + private: //New functions + + private: // Data + + // Reference to the controller. + CCamAppController& iController; + + //Matchable text array + MDesCArray* iMatchableTextArray; + + // Array of all the list items. + RPointerArray iListItemPtrArray; + }; + +#endif // CAMCAPTURESETUPMENULISTBOXMODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCaptureSetupMenuListItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCaptureSetupMenuListItem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Encapsulates the data for a particular Capture Setup Menu item.* +*/ + + + +#ifndef CAMCAPTURESETUPMENULISTITEM_H +#define CAMCAPTURESETUPMENULISTITEM_H + +// INCLUDES +#include +#include + + +// FORWARD DECLARATIONS +class CFbsBitmap; +class TResourceReader; + +// CONSTANTS +const TInt KListItemMaximumTextLength = 40; +const TInt KListItemMaximumIconTextLength = 5; + +typedef TBuf TIconText; + + +// CLASS DECLARATION + +/** +* Encapsulates the data for a particular Capture Setup Menu item. +* @since 2.8 +*/ +class CCamCaptureSetupMenuListItem: public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aReader reader that is used to construct the data for this list item + * @return pointer to the created list item. + */ + static CCamCaptureSetupMenuListItem* NewL( TResourceReader& aReader ); + + /** + * Destructor. + */ + ~CCamCaptureSetupMenuListItem(); + + public: // New functions + + /** + * Returns the bitmap that represents the current settings model + * value for this list item. + * @since 2.8 + * @return A pointer to the bitmap. + */ + CFbsBitmap* Bitmap() const; + + /** + * Returns the mask that represents the current settings model + * value for this list item. + * @since 2.8 + * @return A pointer to the bitmap. + */ + CFbsBitmap* Mask() const; + + /** + * Returns text used in place of an icon for this list item. + * @since 2.8 + * @param aSettingVal The setting value used to return the text for + * @return A reference to the icon text. + */ + const TDesC& IconText( TInt aSettingVal ) const; + + /** + * Returns text that describes the setting represented by this list item. + * @since 2.8 + * @return A reference to the text. + */ + const TDesC& Text() const; + + /** + * Returns the cached settings model value that the current bitmap represents. + * @since 2.8 + * @return the cached settings model value. + */ + TInt CurrentValue() const; + + /** + * Returns the id of the settings model item that this list item represents. + * @since 2.8 + * @return the settings model item id. + */ + TInt SettingsModelItemId() const; + + /** + * Changes the cached settings model value and the bitmap that represents it. + * @since 2.8 + * @param aNewValueId the new settings model value id. + */ + void SetValueTo( TInt aNewValueId ); + + private: // Constructors + + /** + * C++ default constructor. + * @since 2.8 + */ + CCamCaptureSetupMenuListItem(); + + /** + * By default Symbian 2nd phase constructor is private. + * @since 2.8 + * @param aReader reader that is used to construct the data for this list item + * from resources + */ + void ConstructFromResourceL( TResourceReader& aReader ); + + private: // New functions + /** + * Returns the array index for the brightness/contrast setting value + * @since 2.8 + * @param aValue in:the setting value to map to an array index + * out: the array index + */ + void GetBrightnessContrastArrayIndex( TInt& aValue ) const; + + private: // Data + // Provides a list of all the bitmaps that are associated with + // a particular setting item value id. + RPointerArray iBitmaps; + RPointerArray iMasks; + + // Text to be used in place of an icon for this list item. + CArrayFixFlat* iIconTexts; + + // id of the setting item that is associated with this list item. + TInt iSettingsModelItemId; + + // The text description for this list item. + TBuf iText; + + // The settings model id of the currently set value for this list item. + TInt iCurrentSettingItemValueId; + }; + +#endif // CAMCAPTURESETUPMENULISTITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCaptureSetupMenuListItemDrawer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCaptureSetupMenuListItemDrawer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Draws individual list items.* +*/ + + +#ifndef CAMCAPTURESETUPMENULISTITEMDRAWER_H +#define CAMCAPTURESETUPMENULISTITEMDRAWER_H + +// INCLUDES +#include +#include + +// STRUCTS + +// FORWARD DECLARATIONS +class CCamCaptureSetupMenuListBoxModel; +class TResourceReader; + +// CLASS DECLARATION + +/** +* Draws individual list items. +*/ +class CCamCaptureSetupMenuListItemDrawer : public CListItemDrawer + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aListBoxModel Model that is used to get content information + * about list item being drawn. + * @param aReader Used to populate drawer with layout information for + * list box elements it draws. + * @return pointer to the created list item drawer. + */ + static CCamCaptureSetupMenuListItemDrawer* NewL( + CCamCaptureSetupMenuListBoxModel* aListBoxModel, + TResourceReader& aReader ); + + /** + * Destructor. + */ + ~CCamCaptureSetupMenuListItemDrawer(); + + public: // New functions + /** + * Sets the parent control of the listbox + * @since 2.8 + * @param aControl pointer the the listbox's parent + */ + void SetParentControl( const CCoeControl* aControl ); + + public: // Functions from base class CListItemDrawer + + /** + * Draws currentitem and highlights if needed + * @since 2.8 + * @param aItemIndex An index of item + * @param aActualItemRect Rect of item + * @param aItemIsCurrent ETrue if current item + * @param aViewIsEmphasized ETrue if emphasized + * @param aViewIsDimmed ETrue if dimmed + * @param aItemIsSelected ETrue if selected + */ + virtual void DrawActualItem( TInt aItemIndex, const + TRect& aActualItemRect, TBool aItemIsCurrent, + TBool aViewIsEmphasized, TBool aViewIsDimmed, + TBool aItemIsSelected )const; + + + + private: // Constructors + /** + * C++ default constructor. + * @since 2.8 + * @param aListBoxModel Handle to ListBoxModel + */ + CCamCaptureSetupMenuListItemDrawer( CCamCaptureSetupMenuListBoxModel* aListBoxModel ); + + /** + * 2nd phase constructor. + * @since 2.8 + * @param aReader Used to populate drawer with layout information for + * list box elements it draws. + */ + void ConstructFromResourceL( TResourceReader& aReader ); + + private: // New functions + + /** + * Draws a highlighted rectangle for an item. + * @since 2.8 + * @param aActualItemRect the rectangular area to be highlighted. + */ + void DrawHighlightedItemRect( const TRect& aActualItemRect ) const; + + /** + * Draws a rectangle for an item. + * @since 2.8 + * @param aActualItemRect the rectangular area to be drawn. + */ + void DrawItemRect( const TRect& aActualItemRect ) const; + + + + private: // Data + // Used to get the current value of a list item. + CCamCaptureSetupMenuListBoxModel* iModel; + + // Specifies the layout for drawing a list item's text. + AknLayoutUtils::SAknLayoutText iLayoutDataForText; + + // Specifies the layout for drawing a list item's icon text (if defined). + AknLayoutUtils::SAknLayoutText iLayoutDataForIconText; + + // Specifies the layout for drawing a list item's bitmap. + AknLayoutUtils::SAknLayoutRect iLayoutDataForBitmap; + + // Highlight offset loaded from resource + TInt iHighlightOffset; + + // The parent control of the list box + const CCoeControl* iParentControl; + }; + +#endif // CAMCAPTURESETUPMENULISTITEMDRAWER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCaptureSetupSlider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCaptureSetupSlider.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,308 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for showing the EV slider* +*/ + + + +#ifndef __CCAMCAPTURESETUPSLIDER_H +#define __CCAMCAPTURESETUPSLIDER_H + +// INCLUDES +#include +#include // for TAknLayoutText + +#include "CamSettingsInternal.hrh" +#include "CamSettings.hrh" +#include "Cam.hrh" +#include "CamSettingValueObserver.h" + + +/** +* Utility class used to group together related layout information into one +* object, and construct itself using a supplied resource reader. +* +* @since 2.8 +*/ +class CCamSliderLegend : public CBase + { +public: + virtual ~CCamSliderLegend(); + + /** + * Constructs the layout information for a text object + * @since 5.0 + * @param aRect The parent rect for the layout entries + * @param aLayout Layout for the text + */ + void ConstructTextL( + TResourceReader& aReader, + const TRect& aRect, + const TAknTextComponentLayout& aLayout ); + + /** + * Constructs the layout information for an icon object + * @since 5.0 + * @param aRect The parent rect for the layout entries + * @param aLayout Layout for the icon + */ + void ConstructIconL( + TResourceReader& aReader, + const TRect& aRect, + const TAknWindowComponentLayout& aLayout ); + + /** + * Draws the legend + * @since 2.8 + * @param aGc The window contest to use for the drawing + */ + void Draw( CWindowGc& aGc ) const; + + /** + * Returns the rect for the legend + * @since 2.8 + * @return The rect for the legend + */ + TRect Rect() const; + +private: + TCamSliderLegendItem iItem; + TAknLayoutText iPosition; + HBufC* iText; + TAknLayoutRect iIconRect; + CFbsBitmap* iBitmap; + CFbsBitmap* iMask; + }; + + + +/** +* Slider for showing Exposure Value in capture settings +* +* @since 2.8 +*/ +class CCamCaptureSetupSlider : public CCoeControl + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamCaptureSetupSlider* NewL( const CCoeControl* aParent, + MCamSettingValueObserver* aObserver, + TCamSettingItemIds aSettingType, + TInt aSteps ); + + /** + * Destructor. + */ + virtual ~CCamCaptureSetupSlider(); + + public: // New functions + + /** + * Sets up the range and initial value of the slider + * @since 2.8 + * @param aValue The value to start with on the slider. + */ + void InitializeL( TInt aValue ); + + /** + * Returns the minium slider value + * @since 2.8 + * @return The minimum slider value + */ + TInt MinValue() const; + + /** + * Returns the maximum slider value + * @since 2.8 + * @return The maximum slider value + */ + TInt MaxValue() const; + + + /** + * Sets the minimum and maximum values of the slider control + * @since 3.0 + * @param aMin The minimum slider value + * @param aMax The maximum slider value + */ + void SetRange( TInt aMin, TInt aMax ); + + public: // Functions from base classes + + /** + * From CCoeControl + * @since 2.8 + * @param aRect Rect indicating the specific area to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * From CCoeControl + * @since 2.8 + * @param aKeyEvent Details of the key event + * @param aType The keypress type + * @return TKeyResponse whether the key event was handled or ignored + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) ; + + /** + * From CCoeControl + * @since 2.8 + * @return The minimum size required for the control to display + */ + TSize MinimumSize(); + + /** + * From CCoeControl + * @since 2.8 + */ + void SizeChanged(); + + /** + * From CCoeControl + * @ + */ + void HandlePointerEventL(const TPointerEvent& aPointerEvent); + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CCamCaptureSetupSlider( MCamSettingValueObserver* aObserver, + TCamSettingItemIds aSettingType, + TInt aSteps ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( const CCoeControl* aParent ); + + /** + * Called to read the layout information from a resource + * @since 2.8 + */ + void ReadLayoutL(); + + /* + * Read touch layout + */ + void TouchLayoutL(); + + /* + * Read non-touch layout + */ + void NonTouchLayoutL(); + + /* + * Read touch contrast layout + */ + void TouchContrastLayoutL( const TRect& aParentRect ); + + /* + * Read non-touch contrast layout + */ + void NonTouchContrastLayoutL( const TRect& aParentRect ); + + /* + * Read touch exposure value layout + */ + void TouchEVLayoutL( const TRect& aParentRect ); + + /* + * Read non-touch exposure value layout + */ + void NonTouchEVLayoutL( const TRect& aParentRect ); + + /* + * Initialzing slider values + */ + void InitializeSliderValuesL(); + + + public: // Data + + protected: // Data + + private: // Data + + // Bitmap and mask for slider "shaft" + CFbsBitmap* iBitmapShaft; + CFbsBitmap* iBitmapShaftMask; + + // Bitmap and mask for slider "thumb" + CFbsBitmap* iBitmapThumb; + CFbsBitmap* iBitmapThumbMask; + + // Bitmap and mask for pressed slider "thumb" + CFbsBitmap* iBitmapThumbSelected; + CFbsBitmap* iBitmapThumbSelectedMask; + + // Bitmap and mask for slider "thumb" currently in use + CFbsBitmap* iBitmapThumbCurrent; + CFbsBitmap* iBitmapThumbCurrentMask; + + // Current level to be indicated by the thumb + TInt iValue; + + // Pointer to the observer of slider events + MCamSettingValueObserver* iSettingObserver; + + // Point of where the top-left of the thumb bitmap will be drawn + TPoint iThumbPoint; + + // The values that + RPointerArray iLegendArray; + + // Layout structure for the Shaft + TAknLayoutRect iShaftLayout; + + // Layout structure for the Thumb + TAknLayoutRect iThumbLayout; + + // Main parent + TRect iLayoutAreaRect; + + // The minimum size the control requires to be drawn + TSize iMinimumSize; + + // The parent control of the slider + const CCoeControl* iParentControl; + + // The maximum slider value + TInt iMaxSliderValue; + + // The minium slider value + TInt iMinSliderValue; + + // the number of slider values + TInt iNumSliderValues; + + // Identifies which setting is being edited + TCamSettingItemIds iSettingType; + + // number of slider steps + TInt iSteps; + }; + +#endif // __CCAMCAPTURESETUPSLIDER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCaptureSetupViewBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCaptureSetupViewBase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,295 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for pre capture views* +*/ + + +#ifndef CAMCAPTURESETUPVIEWBASE_H +#define CAMCAPTURESETUPVIEWBASE_H + +// INCLUDES +#include "CamViewBase.h" + +// FORWARD DECLARATIONS +class CCamCaptureSetupControlHandler; +class CCamCaptureSetupContainer; +class CCamShootingModeContainer; +class CCamInfoListBoxContainer; + +// CLASS DECLARATION + +/** +* Base class for views that need to run capture setup +* +* @since 2.8 +*/ +class CCamCaptureSetupViewBase : public CCamViewBase + { + public: // data types + + /** + * Setting mode + */ + enum TCamSettingMode + { + ECamSettingModeNone, + ECamSettingModeCaptureMenu, + ECamSettingModeCapture, + ECamSettingModeScene, + ECamSettingModeInfoListBox + }; + + // Info listbox mode + enum TCamInfoListBoxMode + { + EInfoListBoxModeNone, + EInfoListBoxModeTimeLapse, + EInfoListBoxModeISO + }; + + public: // Constructors and destructor + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamCaptureSetupViewBase(); + + public: // Functions from base classes + + /** + * Handle events sending app to foreground or background + * @param aForeground whether the event brings the app to fore or background + */ + void HandleForegroundEventL( TBool aForeground ); + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * Handle change of focus to another application + * This only handles another application coming to the foreground when + * the camera application is already in the background behind an eikon + * server window + * @since 2.8 + */ + void HandleFocusLossL(); + + /** + * Revert to normal mode + * @since 2.8 + */ + virtual void ExitAllModesL(); + + public: // New functions + + /** + * From CAknView deactivate the view (free resources) + * @return void + */ + void DoDeactivate(); + + /** + * Sets the iSceneSettingModeActive flag + * @param aActive What to set iSceneSettingModeActive to + */ + void SetSceneSettingMode(TBool aActive); + + /** + * Sets the iInfoListBoxActive flag + * @param aActive What to set iInfoListBoxActive to + */ + void SetInfoListBoxMode(TBool aActive); + + /** + * Sets the iCaptureSetupModeActive flag + * @param aActive What to set iCaptureSetupModeActive to + */ + void SetCaptureSetupModeActive(TBool aActive); + + protected: // New functions + + /** + * C++ default constructor. + * @param aController Reference to either the application controller + * base class or test base class + * @since 2.8 + */ + CCamCaptureSetupViewBase( CCamAppController& aController ); + + /** + * Creates a control handler for the appropriate control type + * @since 2.8 + * @param aSetupCommand The command that initiated capture setup mode, used to + * determine the required control type + */ + void CreateCaptureSetupControlHandlerL( TInt aSetupCommand ); + + /** + * Enter capture setup mode. + * Creates a capture setup control handler and a second container to replace + * the normal container on the control stack. Updates the Cba, title pane + * and navi pane. + * Derived classes should override this method to add any additional + * functionality they require e.g. starting the viewfinder in the + * appropriate capture mode if it is not already active. + * @since 2.8 + * @param aSetupCommand The command that initiated capture setup mode, used to + * determine the required control type + */ + virtual void SwitchToCaptureSetupModeL( TInt aSetupCommand ); + + /** + * Exit capture setup mode. + * Replaces the normal container on the control stack. + * Reverts the Cba and title pane. + * Derived classes should override this method to add any additional + * functionality they require e.g exiting the viewfinder and + * reverting the navi pane if necessary when switching back to the view's + * normal mode. + * @since 2.8 + */ + virtual void ExitCaptureSetupModeL(); + + + /** + * Enter scene setting mode. + * Creates a container to replace the normal container on the control stack. + * Updates the Cba, title pane and navi pane. + * @since 2.8 + */ + virtual void SwitchToSceneSettingModeL(); + + /** + * Exit capture setup mode. + * Replaces the normal container on the control stack. + * Reverts the Cba and title pane. + * @since 2.8 + */ + virtual void ExitSceneSettingModeL(); + + /** + * Enter InfoListBox mode + * Creates a container to replace the normal container on the control stack. + * Updates the Cba, title pane and navi pane. + * @param aMode + * @since 3.0 + */ + virtual void SwitchToInfoListBoxL( TCamInfoListBoxMode aMode ); + + /** + * Handle InfoListBox item selection + * Updates the Cba, title pane and navi pane. + * @since 3.0 + */ + virtual void HandleInfoListBoxSelectionL(); + + /** + * Exit InfoListBox + * Updates the Cba, title pane and navi pane. + * @since 3.0 + */ + virtual void ExitInfoListBoxL(); + + /** + * Determine the title pane resource for the current setup mode + * @since 2.8 + * @return Id of the title pane text for current setup mode + */ + TInt SetupModeTitlePaneResourceId(); + + /** + * From MEikMenuObserver Changes MenuPane dynamically + * @param aResourceId Resource Id + * @param aMenuPane Handle to menu pane + * @since 2.8 + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: + + /** + * Cleans up the capture setup container if a leave occurs + * while switching to capture setup mode + * @param aAny pointer to the object to cleanup + * @since 2.8 + */ + static void CleanupCaptureSetupContainer( TAny* aAny ); + + /** + * Cleans up the scene setting container if a leave occurs + * while switching to scene setting mode + * @param aAny pointer to the object to cleanup + * @since 2.8 + */ + static void CleanupSceneSettingContainer( TAny* aAny ); + + /** + * Cleans up InfoListBox if a leave occurs + * while switching to scene setting mode + * @param aAny pointer to the object to cleanup + * @since 2.8 + */ + static void CleanupInfoListBox( TAny* aAny ); + + /** + * Cleans up the containers if a leave occurs + * while exiting scene setting/capture setup mode + * @param aAny pointer to the object to cleanup + * @since 2.8 + */ + static void CleanupExit( TAny* aAny ); + + protected: // data + // Used to determine when the view is in capture setup mode + TBool iCaptureSetupModeActive; + + // Used to determine when the view is in scene settings mode + TBool iSceneSettingModeActive; + + // Used to determine InfoListBox is visible + TBool iInfoListBoxActive; + + // Resource Id for title view when in capture setup or scene setting mode + TInt iSettingModeTitleResourceId; + + // Used to determine when user has pressed change button + TBool iChangeButtonPressed; + + protected: + // A container that the view uses when in scene settings mode + CCamShootingModeContainer* iSceneSettingContainer; + + // Container for other settings using info listbox + CCamInfoListBoxContainer* iInfoListBoxContainer; + // Purpose of current instance of iInfoListBoxContainer + TCamInfoListBoxMode iInfoListBoxMode; + + private: // data + + // Handler for the capture setup control + CCamCaptureSetupControlHandler* iCaptureSetupControlHandler; + + // A second container that the view uses when in capture setup mode + CCamCaptureSetupContainer* iCaptureSetupContainer; + + }; + +#endif // CAMCAPTURESETUPVIEWBASE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamCommandHandlerAo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamCommandHandlerAo.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object for handling toolbar commands +* +*/ + + +#ifndef CAMCOMMANDHANDLERAO_H +#define CAMCOMMANDHANDLERAO_H + +// INCLUDES + +#include + +// FORWARD DECLARATIONS +class CAknView; + +/** +* Class to manage the asynchronous command handling +* @since S60 v5.0 +*/ +class CCamCommandHandlerAo : public CActive + { + public: // Constructors and destructor + + ~CCamCommandHandlerAo(); + + /** + * Two-phased constructor. + * @since S60 v5.0 + */ + static CCamCommandHandlerAo* NewL( CAknView* aView ); + + private: + + /** + * Constructor + * @since S60 v5.0 + */ + CCamCommandHandlerAo( CAknView* aView ); + + /** + * 2nd phase construction + * @since S60 v5.0 + */ + void ConstructL(); + + /** + * Cancels the active object + * @since S60 v5.0 + */ + void DoCancel(); + + /** + * Perform the next scheduled task + * @since S60 v5.0 + */ + void RunL(); + + /** + * Perform error reporting and cleanup + * @since S60 v5.0 + */ + TInt RunError( TInt aError ); + + public: + + /** + * Adds the command to queue and sets active + * @since S60 v5.0 + */ + void HandleCommandL( TInt aCommandId ); + + private: + + // Not own + CAknView* iView; + + RArray< TInt > iCommandQueue; + + }; + +#endif // CAMCOMMANDHANDLERAO_H + +// End of File + + + + \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamContainerBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamContainerBase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,403 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for all camera application containers +* +* Copyright © 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + + +#ifndef CAMCONTAINERBASE_H +#define CAMCONTAINERBASE_H + + + +// INCLUDES +#include +#include +#include "CamAppUiBase.h" // For TCamAppViewIds + +// FORWARD DECLARATIONS +class CCamAppController; +class CAknView; +class MAknsControlContext; + +class CEnhancedSoftKeys; + +class CCamNaviCounterControl; +class CCamNaviProgressBarControl; +class MActivePalette2UI; +class CCamBackupContainer; + +const TInt KCamPreCaptureWindowOrdinalPos = 100; +const TInt KCamPostCaptureWindowOrdinalPos = 101; + + +// CLASS DECLARATION + +/** +* Container base class +*/ +class CCamContainerBase : public CCoeControl + { + // ======================================================= + // Typenames + public: + + // Was defined in multiple child classes, now moved here. + enum TVfState // ViewFinder states + { + EVfStateActive, + EVfStateFrozenDimmed, + EVfStateActiveMasked + }; + + + // Enumeration used to indicate the pane currently visible + enum TCamActiveNaviPane + { + ECamPaneUndefined, + ECamPaneCounter, + ECamPaneProgress + }; + + // ======================================================= + // Methods + + // Constructors and destructor + public: + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamContainerBase(); + + // ------------------------------------------------------- + // From CCoeControl + public: + + /** + * Return this controls window. + * This is needed for direct viewfinding. + * Protected in CCoeControl. (not virtual) + */ + RWindow& Window() const; + + /** + * Handle events sending app to foreground or background + * @since 2.8 + * @param aForeground whether the event brings the app to fore or background + */ + virtual void HandleForegroundEventL( TBool aForeground ); + + /** + * Gets an object whose type is encapsulated by the specified TTypeUid object. + * @since 2.8 + * @param aId Encapsulates the Uid that identifies the type of object required. + * @return Encapsulates the pointer to the object provided. + */ + TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); + + /** + * This method should change its client rect area and redraw properly. + * @since 2.8 + * @param aType resource change + */ + virtual void HandleResourceChange( TInt aType ); + + /** + * Handle application level event. + * For example focus gained and lost are notified through this method. + * Default implementation is empty, to be replaced in inherited classes. + * @param aEvent Event type + */ + virtual void HandleAppEvent( const TCamAppEvent& aEvent ); + + + + /** + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + // ------------------------------------------------------- + // New functions + public: + + /** + * Passes the value of the previous view to the container + * @since 2.8 + * @param aId The ID of the previous view + */ + void SetPreviousViewId( TCamAppViewIds aId ); + + /** + * Sets up a navipane for use by this container + * @param aNaviPane specifies which navipane to set up. + * @since 3.0 + */ + void SetupNaviPanesL( TCamActiveNaviPane aNaviPane ); + + /** + * Will show the zoom pane for a set time + * Only implemented by pre capture containers + * @since 2.8 + */ + virtual void ShowZoomPaneWithTimer(); + + /** + * Create the ActivePalette control + * @since 3.0 + */ + void CreateActivePaletteL(); + + /** + * Destroys the ActivePalette control + * @since 3.0 + */ + static void DestroyActivePalette(); + + /** + * Requests that the camera application redraws the supplied area + * @since 3.0 + * @param aArea the area to redraw + */ + virtual void Redraw(const TRect& aArea); + + + /** + * Load layouts for the text + */ + void PrepareProcessingBackgroundL(); + + /** + * Load processing image/video text from resources. + */ + void PrepareProcessingTextL( TBool aStillMode ); + + /** + * Delete and null processing text, after which + * the text will no longer be drawn. + */ + void DismissProcessingText(); + + /** + * Load processing image text for burst from resources. + */ + void PrepareBurstProcessingTextL(); + + /** + * Update processing image text for burst. + * @param aHandled number of imagedata received + * @param aTotal number of snapshots received + */ + void UpdateBurstProcessingTextL( TInt aHandled, TInt aTotal ); + + /** + * Delete and null processing text, after which + * the text will no longer be drawn. + */ + void DismissBurstProcessingText(); + + /** + * Viewfinder layout rect + * @param aTargetMode target mode for which viewfinder rect is required. Default(ECamControllerIdle) corresponds to current active mode. + * @return TRect viewfinder rect from layout + */ + TRect ViewFinderFrameRect(TCamCameraMode aTargetMode = ECamControllerIdle) const; + + /** + * We check for the file name whenever we call the UMP + * or Properties view and come back. + */ + virtual void CheckForFileName( TBool aDoCheck ); + + protected: + + /** + * Whether or not this key is considered to be capture key + * in the current context + * @since 3.0 + * @param aKeyEvent the key event + * @param aType the type of event + * @return ETrue if this is a capture key, otherwise EFalse + */ + TBool IsCaptureKeyL( const TKeyEvent& aKeyEvent, + TEventCode aType ) ; + + /** + * Whether or not this key is considered to be shutter key + * in the current context + * @since 3.0 + * @param aKeyEvent the key event + * @param aType the type of event + * @return ETrue if this is a shutter key, otherwise EFalse + */ + TBool IsShutterKeyL( const TKeyEvent& aKeyEvent, + TEventCode aType ) ; + + /** + * Whether or not this key is considered to be zoom key + * in the current context + * @since 3.0 + * @param aKeyEvent the key event + * @param aType the type of event + * @return ETrue if this is a zoom key, otherwise EFalse + */ + TBool IsZoomKeyL( const TKeyEvent& aKeyEvent, + TEventCode aType ) ; + /** + * Is zoom operation currently possible? + * @since 3.0 + */ + TBool ZoomAvailable(); + + /** + * Is Primary Capture Key + * @since 9.1 + */ + TBool IsPrimaryCameraCaptureKey( const TKeyEvent& aKeyEvent ) const ; + + /** + * Is Secondary Capture Key + * @since 9.1 ( checking for scan codes ) + */ + TBool IsSecondaryCameraCaptureKey( const TKeyEvent& aKeyEvent ) const ; + // ------------------------------------------------------- + // Constructors + protected: + + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppController instance + * @param aView reference to the view containing this container + */ + CCamContainerBase( CCamAppController& aController, + CAknView& aView ); + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + */ + void BaseConstructL( const TRect& aRect ); + + protected: + /** + * Create background context (iBgContext). May be overridden by + * derived classes. + * @since S60 v5.0 + */ + virtual void CreateBackgroundContextL(); + +public: + + /** + * Returns the number of component controls + * @since 3.0 + * @return The number of owned controls to display + */ + TInt CountComponentControls() const; + + /** + * Returns the specified component control + * @since 3.0 + * @param aIndex The index of the control to return + * @return Pointer to the specified control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + // ======================================================= + private: + /* + * Checks for the zoom key with the mapped key's scan code + */ + TBool CheckForZoomKey( const TKeyEvent& aKeyEvent ); + + /* + * Checks for the zoom-in/out key from the mapped key's scan code + * from the zoom array + */ + TBool CheckInZoomKeyArray( const TKeyEvent& aKeyEvent ); + + // Data + protected: + + CAknView& iView; + CCamAppController& iController; + + // The ID of the previous view + TCamAppViewIds iPrevViewId; + + // context for skin background drawing + MAknsControlContext* iBgContext; + + // The current pane displayed in the Application Pane + TCamActiveNaviPane iPaneInUse; + + // Instance of Navi Counter control (not owned) + CCamNaviCounterControl* iNaviCounterControl; + + // Instance of Navi Progress control (not owned) + CCamNaviProgressBarControl* iNaviProgressBarControl; + + // Instance of ActivePalette2 control (not owned) + static MActivePalette2UI* iActivePalette; + + // ETrue if shutter key (half-press) has been made + TBool iKeyShutter; + + // zoom keys for primary and secondary camera + RArray iPrimaryZoomInKeys; + RArray iPrimaryZoomOutKeys; + RArray iSecondaryZoomInKeys; + RArray iSecondaryZoomOutKeys; + + // capture keys + RArray iPrimaryCameraCaptureKeys; + RArray iSecondaryCameraCaptureKeys; + + // AF key or half capture key press scan codes + RArray iPrimaryCameraAFKeys; + + /// Remember current orientation, so we only redraw when necessary + TCamOrientation iCamOrientation; + + TAknLayoutText iProcessingTextLayout; + HBufC* iProcessingText; + TAknLayoutText iBurstProcessingTextLayout; + HBufC* iBurstProcessingText; + + //Backup child container to keep the background of viewfinder window always opaque + CCamBackupContainer* iBackupContainer; + }; + +#endif // CAMCONTAINERBASE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamContextAwareSettingItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamContextAwareSettingItem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item type for CAknEnumeratedItems.* +*/ + + + + +#ifndef CAMCONTEXTAWARESETTINGITEM_H +#define CAMCONTEXTAWARESETTINGITEM_H + +// INCLUDES + +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CCamAppController; + +// CLASS DECLARATION + +/** +* Setting item class similar to standard avkon CAknEnumeratedTextPopupSettingItem. +* Allows the text array to be updated dynamically on construction according +* to any limitations on available items imposed by other setting values or available +* memory +* +* @since 2.8 +*/ + +class CCamContextAwareSettingItem : public CAknEnumeratedTextPopupSettingItem + { +public: + /** + * Construct a list, storing in it a resource (to be read at 2nd stage construction) + * and a reference to an externally owned integer - the value to be manipulated + * @since 2.8 + * @param aController reference the the application controller + * provides access to query for a revised resource id + * @param aSettingItemId the setting item being constructed + * @param aValue the current value of the item + */ + CCamContextAwareSettingItem( CCamAppController& aController, + TInt aSettingItemId, + TInt& aValue ); + + + +private: // Functions from base classes + + /** + * From CAknEnumeratedTextPopupSettingItem + * Virtual Method called by framework to create the setting page. + * Creates setting page that switches cba depending on setting value + * that user navigates to. + * @since 2.8 + */ + CAknSettingPage* CreateSettingPageL(); + + /** + * From CAknEnumeratedTextPopupSettingItem + * Virtual Method called by framework to complete construction of + * the setting page. + * Determines whether or not the value list is to be limited (visually) + * and replaces the popup text array with a new array created from the + * revised resource id. + * @since 2.8 + */ + void CompleteConstructionL(); + +private: // data + + // Used to determine whether a particular setting value can be + // set by the user. + CCamAppController& iController; + + }; + +#endif // CAMCONTEXTAWARESETTINGITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamContextAwareSettingPage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamContextAwareSettingPage.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for CAknEnumeratedItems.* +*/ + + + + +#ifndef CAMCONTEXTAWARESETTINGPAGE_H +#define CAMCONTEXTAWARESETTINGPAGE_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CAknEnumeratedTextPopupSettingItem; +class CCamAppController; + +// CLASS DECLARATION + +/** +* Setting page class similar to standard avkon CAknPopupSettingPage. +* Allows the Cba to be updated dynamically according to any limitations +* on available items imposed by other setting values or available +* memory +* +* @since 2.8 +*/ + +class CCamContextAwareSettingPage : public CAknPopupSettingPage + { +public: // Constructors, etc. + /** + * Construct a list, storing in it a resource (to be read at 2nd stage construction) + * and a reference to an externally owned integer - the value to be manipulated + * @since 2.8 + * @param aSettingText Text at top of setting pane + * @param aSettingNumber Number at top left (if present) + * @param aControlType Determines the type constructed and how its resource is read + * @param aEditorResourceId Editor resource to use in the setting page (if present) + * @param aSettingPageResourceId Setting Page to use (if present) + * @param aQueryValue reference to a query value object + * @param aParent reference to the list that created this page. + * @param aController reference the the application controller + */ + CCamContextAwareSettingPage( + const TDesC* aSettingText, + TInt aSettingNumber, + TInt aControlType, + TInt aEditorResourceId, + TInt aSettingPageResourceId, + MAknQueryValue& aQueryValue, + CAknEnumeratedTextPopupSettingItem& aParent, + CCamAppController& aController ); + + /** + * Destructor + * @since 2.8 + */ + ~CCamContextAwareSettingPage(); + + /** + * Symbian 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + +public: // From base class + + /** + * From CAknSettingPage + * Called when the state of the list box changes. + * Used to update the Cba when the list box is navigated. + * @since 2.8 + */ + void UpdateSettingL(); + + /** + * From CAknSettingPage + * Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack + * to accept or cancel the pop-up. + * @since 2.8 + * @param aCommandId Event Id from the soft-key + */ + void ProcessCommandL( TInt aCommandId ); + + /** + * From CAknSettingPage + * Puts up a constructed dialog. Part of the non-waiting API calls. + * Activity to perform as soon as the setting page is displayed + * @since 2.8 + * @return Whether check succeeded + */ + TBool PostDisplayCheckL(); + +private: + /** + * Called when the setting value is to be previewed + * @since 2.8 + * @param aPtr pointer to the object that called the timer + * @return Error code + */ + static TInt PreviewSettingChange( TAny* aPtr ); + +private: // data + // Used to retrieve the settings value for the currently + // highlighted list item. + CAknEnumeratedTextPopupSettingItem& iParent; + // Used to determine whether a particular setting value is + // enabled or disabled for selection. + CCamAppController& iController; + // Used to perform the preview setting change + CPeriodic* iTimer; + // the current value of the setting item + TInt iCurrentVal; + }; + +#endif // CAMCONTEXTAWARESETTINGITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamDecorator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamDecorator.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera UI decorator* +*/ + + + +#ifndef CAMDECORATOR_H +#define CAMDECORATOR_H + +#include + + +class TResourceReader; +class CBlendedBackground; +class CBitmapContext; +class TRect; +class CCamAppController; +class CCamRecordingIconDecoration; +class MCamObserver; + +class CCamDecorator : public CBase + { +public: + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aResourceId The resource that describes the decorations required. If 0, a blank decorator is created (i.e. Draw() will have no effect) + * @param aObserver If creator is interested, will be registered with observable decorations + * @return New instance of class + */ + static CCamDecorator* NewL( CCamAppController& aController, + TInt aResourceId, + MCamObserver* aObserver = NULL ); + + /** + * Destructor + */ + ~CCamDecorator(); + +protected: + /** + * Constructor + */ + CCamDecorator( CCamAppController& aController ); + + /** + * Second-phase constructor + * @param aResourceId The resource that describes the decorations required. If 0, a blank decorator is created (i.e. Draw() will have no effect) + * @param aObserver If creator is interested, will be registered with observable decorations + */ + void ConstructL( TInt aResourceId, MCamObserver* aObserver ); + +public: // New functions + /** + * Draws all decorations + * @param aGc The context to use while drawing + * @param aDrawRect Rectangle passed on to decorations - meaning varies depending on decoration + * @param aForceBlankers Forces the display of the blanking components + */ + void Draw( CBitmapContext& aGc, const TRect& aDrawRect, const TBool aForceBlankers = EFalse ); + +private: // New functions + /** + * Reads in the details of a blended background, and stores an object based on this + * @param aResourceReader The resource reader to use + */ + void CreateBlendedBackgroundL(TResourceReader& aResourceReader); + + /** + * Reads in the details of a blanker, and stores an object based on this + * @param aResourceReader The resource reader to use + */ + void CreateDVFBlankerL(TResourceReader& aResourceReader); + + /** + * Reads in the details of a recording icon, and stores an object based on this + * @param aResourceReader The resource reader to use + */ + void CreateRecordingIconL(TResourceReader& aResourceReader); + +private: // Data + // Lists of all decorator elements + RArray iDVFBlankers; + RPointerArray iRecordingIcons; + + // Controller + CCamAppController& iController; + + // An observer to add to observable decorations, if wanted. May be NULL. + MCamObserver* iPossibleObserver; + + // If true, nothing will be drawn on call to Draw. Optimization. + TBool iDrawNothing; + }; + +#endif // CAMDECORATOR_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamDefaultNameSettingItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamDefaultNameSettingItem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item for name base type (date/text)* +*/ + + + + +#ifndef CAMDEFAULTNAMESETTINGITEM_H +#define CAMDEFAULTNAMESETTINGITEM_H + +// INCLUDES +#include "CamAppController.h" +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Setting item for name base type (date/text) +* @since 2.8 +*/ +class CCamDefaultNameSettingItem : public CAknEnumeratedTextPopupSettingItem + { + public: // Constructors and destructor + /** + * C++ constructor + * @since 2.8 + * @param aNameBase current name base + * @param aMode current mode (video or still image) + * @param aIdentifier setting page resource id + * @param aValue current name base type + */ + CCamDefaultNameSettingItem( TDes& aNameBase, + TCamCameraMode aMode, + TInt aIdentifier, + TInt& aValue ); + + /** + * Destructor + */ + virtual ~CCamDefaultNameSettingItem(); + + protected: // Functions from base classes + /** + * From CAknEnumeratedTextPopupSettingItem + * @since 2.8 + * Framework method for constructing the launching setting page. + * @return a constructed CAknSettingPage object on the heap + */ + CAknSettingPage* CreateSettingPageL(); + + private: // Data + // Reference to the cuurent name base. + TDes& iNameBase; + // The current mode of capture. + TCamCameraMode iMode; + }; + + +#endif // CAMDEFAULTNAMESETTINGITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamDocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamDocument.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Document class for Camera* +*/ + + +#ifndef CAMDOCUMENT_H +#define CAMDOCUMENT_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CCamAppUi; +class CEikApplication; +class CCamAppController; + + +// CLASS DECLARATION + +/** +* Document class for the Camera application +* +* @since 2.8 +*/ +class CCamDocument : public CAknDocument + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aApp reference to the CCamApp + * @return pointer to the created CCamDocument + */ + static CCamDocument* NewL( CEikApplication& aApp ); + + /** + * Two-phased constructor. + * @since 2.8 + * @param aApp reference to the CCamApp + * @return pointer to the created CCamDocument + */ + static CCamDocument* NewLC( CEikApplication& aApp ); + + /** + * Destructor. + * @since 2.8 + */ + ~CCamDocument(); + + public: // Functions from base classes + + /** + * From CAknDocument Create a CCamAppUi object and return a pointer to it. + * @since 2.8 + * @return A pointer to the instance of the AppUi created + */ + CEikAppUi* CreateAppUiL(); + + private: + + /** + * C++ default constructor. + * @since 2.8 + * @param aApp reference to the CCamApp + */ + CCamDocument(CEikApplication& aApp); + + + /** + * Symbian 2nd phase constructor + * @since 2.8 + */ + void ConstructL(); + + private: // Data + // For communication between the UI and engine. + CCamAppController* iController; + }; + +#endif // CAMDOCUMENT_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamDriveChangeNotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamDriveChangeNotifier.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 CAMDISKCHANGELISTENER_H +#define CAMDISKCHANGELISTENER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MCamDriveChangeNotifierObserver; + +// CLASS DECLARATION + +/** +* Mmc Change Notifier. +* +* @since 5.0 +*/ +class MCamDriveChangeNotifierObserver + { + public: + enum TCamDriveChangeType + { + EDriveDismount, + EDriveMount + }; + + public: // New functions + + /** + * This method is used to notify changes. + */ + virtual TInt DriveChangeL( TCamDriveChangeType aType ) = 0; + + + protected: + + /** + * Destructor. + */ + virtual ~MCamDriveChangeNotifierObserver() {} + + }; + +/** +* Mmc Change Notifier. +* +* @since 5.0 +*/ +class CCamDriveChangeNotifier : public CBase + + { + private: + class CCamDiskChangeListener : public CActive + { + public: + static CCamDiskChangeListener* NewLC( + RFs& aFs, + TDriveNumber aDrive, + MCamDriveChangeNotifierObserver::TCamDriveChangeType aType, + CCamDriveChangeNotifier& aObserver ); + ~CCamDiskChangeListener(); + + void Start(); + void Stop(); + + protected: + CCamDiskChangeListener( + RFs& aFs, + TDriveNumber aDrive, + MCamDriveChangeNotifierObserver::TCamDriveChangeType aType, + CCamDriveChangeNotifier& aObserver ); + + private: + /** + * From CActive + */ + void DoCancel(); + + /** + * From CActive + */ + void RunL(); + + private: + RFs& iFs; + TDriveNumber iDrive; + MCamDriveChangeNotifierObserver::TCamDriveChangeType iType; + CCamDriveChangeNotifier& iObserver; + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamDriveChangeNotifier* NewL( + RFs& aFs, + MCamDriveChangeNotifierObserver& aObserver ); + + /** + * Destructor. + */ + ~CCamDriveChangeNotifier(); + + public: + /** + * Called from listeners + */ + TInt NotifyChangeL( + MCamDriveChangeNotifierObserver::TCamDriveChangeType aType ); + + /** + * Called by the observer when pending dismount can be done. + */ + void SendAllowDismount(); + + // New functions + + void StartMonitoring(); + void CancelMonitoring(); + + private: + + /** + * C++ default constructor. + */ + CCamDriveChangeNotifier( + RFs& aFs, + MCamDriveChangeNotifierObserver& aObserver ); + + private: // Data + // Ref. + MCamDriveChangeNotifierObserver& iObserver; + + // Ref. File server session + RFs& iFs; + + RPointerArray iListeners; + + }; + +#endif // CAMDISKCHANGELISTENER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamFileCheckAo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamFileCheckAo.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object that checks if files have been deleted outside camera +* +*/ + + +#ifndef CAMFILECHECKAO_H +#define CAMFILECHECKAO_H + +// INCLUDES +#include +#include +#include "CamAppController.h" +#include "CamBurstCaptureArray.h" + + +/** +* Abstract API for file check observer. +* Provides an asynchronous 'callback' method to inform derived classes +* that the file checking operation has been completed. +* +* @since 2.8 +*/ +class MCamFileCheckObserver + { + public: + + /** + * Callback to notify that file checking operation has completed. + * @param aStatus Number of files that were missing + * @param aError Error code + */ + virtual void FileCheckingCompleteL( TInt aStatus, TInt aError ) = 0; + }; + +/** +* Class to manage the asynchronous file deletion checking +* @since 2.8 +*/ +class CCamFileCheckAo : public CActive + { + public: // Constructors and destructor + ~CCamFileCheckAo(); + /** + * Two-phased constructor. + * @since 2.8 + * @param aObserver Informed when image saving has completed + */ + static CCamFileCheckAo* NewL( CCamAppController& aController, MCamFileCheckObserver& aObserver ); + + void Start(); + + + private: + + /** + * Constructor + * @since 2.8 + * @param aObserver Informed when image saving has completed + */ + CCamFileCheckAo( CCamAppController& aController, MCamFileCheckObserver& aObserver ); + + /** + * 2nd phase construction + * @since 2.8 + */ + void ConstructL(); + + /** + * Cancels the active object + * @since 2.8 + */ + void DoCancel(); + + /** + * Perform the next scheduled task + * @since 2.8 + */ + void RunL(); + + + /** + * Perform error reporting and cleanup + * @since 2.8 + */ + TInt RunError( TInt aError ); + + /** + * + */ + void StartRequest(); + + private: + + CCamAppController& iController; + MCamFileCheckObserver& iObserver; // informed when file checking has completed + + TInt iFileIndex; + TInt iFileCount; + CCamBurstCaptureArray* iArray; + RFs iFs; + TBool iEmptyRun; + }; + +#endif // CAMFILECHECKAO_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamGSInterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamGSInterface.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface for General Setting plug-in. +* +*/ + + +#include +#include + +class CCamGSInterface : public CAknView + { + public: // New functions + + /** + * Wraps ECom object instantitation. + * @param aUid Specifies the concrete implementation. + */ + static CCamGSInterface* NewL( const TUid aUid ); + + + /** + * Notifies framwork that this instance is being destroyed and resources + * can be released. + */ + void DestroyPlugin(); + + protected: + /** iDtor_ID_Key Instance identifier key. When instance of an + * implementation is created by ECOM framework, the + * framework will assign UID for it. The UID is used in + * destructor to notify framework that this instance is + * being destroyed and resources can be released. + */ + TUid iDtor_ID_Key; + }; + + +// ---------------------------------------------------- +// CCamGSInterface::NewL +// Creates General Settings plugin. +// ---------------------------------------------------- +// +inline CCamGSInterface* CCamGSInterface::NewL( const TUid aUid ) + { + TAny* ext = REComSession::CreateImplementationL( + aUid, _FOFF( CCamGSInterface, iDtor_ID_Key ) ); + + CCamGSInterface* result = + reinterpret_cast< CCamGSInterface* >( ext ); + return result; + } + + +// ---------------------------------------------------- +// CCamGSInterface::DestroyPlugin +// Destroy Ecom plugin. +// ---------------------------------------------------- +// +inline void CCamGSInterface::DestroyPlugin() + { + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamImageSaveActive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamImageSaveActive.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,396 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object that manages saving and deletion of images* +*/ + + + + +#ifndef CAMIMAGESAVEACTIVE_H +#define CAMIMAGESAVEACTIVE_H + +// INCLUDES + +#include +#include +#include +#include +#include + +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) +#include +#endif // defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + +// DATA TYPES +/** +* Save event type +*/ +enum TCamSaveEvent + { + ECamSaveEventStarted, + ECamSaveEventComplete, + ECamSaveEventBurstComplete, + ECamSaveEventUserCancelled, + ECamSaveEventDeleted, + ECamSaveEventSaveError, + ECamSaveEventCriticalError + }; + +// CONSTANTS +#ifdef _DEBUG +const TUint16* const KCamSaveEventNames[] = + { + (const TUint16* const)_S16("ECamSaveEventStarted"), + (const TUint16* const)_S16("ECamSaveEventComplete"), + (const TUint16* const)_S16("ECamSaveEventBurstComplete"), + (const TUint16* const)_S16("ECamSaveEventUserCancelled"), + (const TUint16* const)_S16("ECamSaveEventDeleted") + }; +#endif + +// FORWARD DECLARATIONS +class CAknProgressDialog; +class CEikProgressInfo; +class CCamBufferShare; +class CCamAppController; +class CCamBurstCaptureArray; + +// CLASS DECLARATIONS + +/** +* Abstract API for image save observer. +* Provides an asynchronous 'callback' method to inform derived classes +* that the save operation has been completed. +* +* @since 2.8 +*/ +class MCamImageSaveObserver + { + public: + /** + * The image saving operation has completed + * @since 2.8 + * @param aEvent the type of event + */ + virtual void HandleSaveEvent( TCamSaveEvent aEvent ) = 0; + + /** + * + */ + virtual void HandleFileHarvestingComplete() = 0; + }; + +/** +* Class to manage the asynchronous saving and synchronous deletion +* of images. +* @since 2.8 +*/ +class CCamImageSaveActive : public CActive +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + ,private MHarvestObserver +#endif // defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + , public MThumbnailManagerObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aObserver Informed when image saving has completed + */ + static CCamImageSaveActive* NewL( MCamImageSaveObserver& aObserver, + CCamAppController& aController ); + + /** + * Destructor. + */ + virtual ~CCamImageSaveActive(); + + public: // Functions from base classes + + /** + * From CActive, cancels the active object + * Deletes all files remaining in the save arrays except any currently + * saving file. If currently saving, the active object waits until the + * save completes then performs cleanup.. This method is synchronous + * even when it involves a wait for save completion. + * @since 2.8 + */ + void Cancel(); + + public: // New functions + + /** + * A request for a file to be saved asynchronously, will be scheduled + * immediately if no other save is current, otherwise the save is queued + * @since 2.8 + * @param aFilename the full path and filename to save the image to + * @param aImageData the image data to save + * @return Whether or not the image data has been successfully added + * to the pending save list. + */ + TBool AddToSave( const TDesC& aFilename, + CCamBufferShare* aImageData ); + + /** + * A request for a file to be deleted. Will prevent any pending save. + * If the file to delete is currently saving the deletion will occur + * when the save operation completes. + * @since 2.8 + * @param aFilename the full path and name of the file to be deleted + * @param aSaveRequested whether or not a previous request to save this file + * has been made. + * @return System wide error code to indicate success or failure of the deletion + */ + TInt DeleteFile( const TDesC& aFilename, TBool aSaveRequested ); + + /** + * Returns whether a particular file has already been saved. + * @since 2.8 + * @param aFilename the name of the file to check. + * @return ETrue if the file has been saved. + */ + TBool AlreadySavedFile( const TDesC& aFilename ) const; + + /** + * Returns whether a particular file is in the process of being saved. + * @since 2.8 + * @param aFilename the name of the file to check. + * @return ETrue if the file is in the process of being saved. + */ + TBool CurrentlySavingFile( const TDesC& aFilename ) const; + + /** + * A request for the progress note to be displayed + * @since 2.8 + * @param aExpectedImages the number of images to be saved + */ + void DisplayProgressNote( TInt aExpectedImages ); + + /** + * A request for the progress note to be dismissed when the save completes + * @since 2.8 + */ + void DismissProgressNote(); + + /** + * Set the "Add to album" setting for photos + * determines whether or not photos are added to the default capture album + * after a successful save + * @since 2.8 + * @param aAdding ETrue if "Add to album" is on, otherwise EFalse + */ + void SetAddImageToAlbum( const TBool aAdding, + const TUint32 aDefaultAlbumId ); + + /** + * Add the specified file to the default capture album + * Called internally for images when save completes. Called externally for + * videos as video saving is handled elsewhere. Calls AddToAlbumL(). + * @since 2.8 + * @param aFilename The photo or video to add to the capture album + * @param aPhoto Indicates if the specified file is a photo or video + */ + void AddToAlbum( const TDesC& aFilename, + const TBool aPhoto, + const TUint32 aDefaultAlbumId ); + + /** + * The number of items in the saving arrays + * @since 2.8 + * @return A count of items + */ + TInt Count() const; + + /** + * Retrieves the file size of the specified file. + * @since 3.0 + * @param aFilename The file to return the size of. + * @return The size of the file in bytes, or KErrNotFound + */ + TInt FileSize( const TDesC& aFilename ) const; + + /** + * Stores filename and snapshot handle for thumbnail creation + */ + void CreateThumbnailsL( const CCamBurstCaptureArray& aArray ); + + /** + * Calls thumbnailmanager to create thumbnails + */ + void DoCreateThumbnailL(); + + /** + * Cancels thumbnail creation for a given snapshot. + * @param aSnapshotIndex Index of the snapshot in burst array. + */ + void CancelThumbnail( TInt aSnapshotIndex ); + + void ForceCancel(); + /** + * From MThumbnailManagerObserver, not used + */ + void ThumbnailPreviewReady( MThumbnailData& aThumbnail, + TThumbnailRequestId aId ); + + /** + * From MThumbnailManagerObserver, not used + */ + void ThumbnailReady( TInt aError, + MThumbnailData& aThumbnail, + TThumbnailRequestId aId ); + +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + /* + * RegisterForHarvesterEvents + */ + void RegisterForHarvesterEvents(); + + /* + * DeRegisterHarverterClientEvents + */ + void DeRegisterHarverterClientEvents(); + + private: // From MHarvestObserver + + /* + * HarvestingComplete + */ + void HarvestingComplete( TDesC& aURI +#ifdef RD_MDS_2_5 + , TInt aError +#endif //RD_MDS_2_5 + ); + +#endif // defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + + private: + + /** + * Constructor + * @since 2.8 + * @param aObserver Informed when image saving has completed + */ + CCamImageSaveActive( MCamImageSaveObserver& aObserver, + CCamAppController& aController ); + + /** + * 2nd phase construction + * @since 2.8 + */ + void ConstructL(); + + /** + * Schedule to run immediately + * @since 2.8 + */ + void SetActiveAndCompleteRequest(); + + /** + * Cancels the active object + * @since 2.8 + */ + void DoCancel(); + + /** + * Perform the next scheduled task + * @since 2.8 + */ + void RunL(); + + /** + * Handle leave in RunL. + * @param aError The error (leave) code from RunL. + */ + TInt RunError( TInt aError ); + + /** + * Tidy up after a previous save has completed + * @param aDoFlush Should an asyncrhonous flush be done + * @since 2.8 + */ + void CompleteSaveOperation( TBool aDoFlush ); + + /** + * Carry out the next pending save operation + * @since 2.8 + */ + void DoSaveL(); + + /** + * Display the progress note + * @since 2.8 + */ + void DoDisplayProgressNoteL(); + + /** + * Dismiss the progress note when the saves have completed + * @since 2.8 + */ + void DoDismissProgressNote(); + + /** + * Indicate to observers that saving has completed + * @param aEvent the cause of completion + * @since 2.8 + */ + void ReportToObserver( TCamSaveEvent aEvent ); + + /** + * Helper method to release all the shared buffers in the array. + */ + void ReleaseAllAndDestroy( RPointerArray& aArray ); + + + private: + + MCamImageSaveObserver& iObserver; // informed when image saving has completed + CCamAppController& iController; + + CDesCArray* iSaveArray; // reserved filenames + RPointerArray iImageArray; // image data (order reflects iSaveArray) + CDesCArray* iNameArray; // filenames for thumbnail creation + RPointerArray iSnapArray; // snapshots for thumbnail creation + CThumbnailManager* iManager; // TN manager + + RFile iFile; // Handle to a file object + TBool iSaveCurrent; // Indicates if a saving operation is ongoing + TBool iDeleteCurrent; // If the currently saving file needs deleting + TBool iDoCancel; // If further saves should be cancelled + TBool iShowNote; // If the progress note should be displayed + TBool iDismissNote; // If the progress note should be dismissed + // when all saves complete + TInt iExpectedImages; // The number of images expected for progress info + TInt iSaveProgressCount; // The count of images saved for this progress + TBool iCompletedBurst; // If a set of burst images has completed + CActiveSchedulerWait iWait; // To make asychronous synchronous during cancellation + // Progress note shown when the applicaiton must wait for saving to complete + CAknProgressDialog* iSaveProgressDialog; + // The progress bar shown in iSaveProgressDialog + CEikProgressInfo* iSaveProgressInfo; + TBool iAddImageToAlbum; // Whether or not images should be added to album + TUint32 iDefaultAlbumId; // To store the default album id from appcontroller + TBool iFlushing; + RArray iThumbnailRequests; // thumbnail request ids + +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + RHarvesterClient iHarvesterClient; + TBool iRegisteredForHarvesterEvents; + TBool iHarvesterClientConnected; +#endif // defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + }; + +#endif // CAMIMAGESAVEACTIVE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamIndicator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamIndicator.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera Indicator class* +*/ + + +#ifndef CAMINDICATOR_H +#define CAMINDICATOR_H + +// INCLUDES + +#include + +// FORWARD DECLARATIONS +class CCamBitmapItem; + +// CLASS DECLARATION +/** +* Camera Indicator class for drawing indicators in the viewfinder +*/ +class CCamIndicator : public CBase + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aRect frame rectangle for control + */ + static CCamIndicator* NewL( const TRect& aRect ); + + /** + * Destructor. + */ + virtual ~CCamIndicator(); + + private: + + /** + * C++ constructor + * @since 2.8 + * @param aRect frame rectangle for control + */ + CCamIndicator( const TRect& aRect ); + + /** + * C++ default constructor. + * @since + */ + CCamIndicator(); + + public: // New functions + /** + * Called to add a bitmap to array of available + * icons for the camera indicator + * @since 2.8 + * @param aBitmapId bitmap identifier + * @param aMaskId mask identifier + */ + void AddIconL( TInt32 aBitmapId, TInt32 aMaskId ); + + // This is needed because location icon is from svg file + void AddSvgIconL( TInt32 aBitmapId, TInt32 aMaskId, const TSize& aSize ); + + // update the rect according to new coordinates + void UpdateRect( TRect& aRect ); + + /** + * Called to set the icon (no redraw request) + * @since 2.8 + * @param aIndex index into available icons for this indicator + */ + void SetIcon( TInt aIndex ); + + /** + * Called to clear the icon + * @since 2.8 + */ + void ClearIcon(); + + /** + * Called to show the icon + * @since 2.8 + */ + void DisplayIcon(); + + /** + * Called to check if indicator is currently flashing + * @since 2.8 + * @return ETrue if indicator is in flashing state + */ + TBool IsFlashing() const; + + /** + * Called to set indicator flashing state + * @since 2.8 + * @param aFlashing set to ETrue to set flashing state on + */ + void SetFlashing( TBool aFlashing ); + + /** + * Allows the position to be overriden + * @since 3.0 + * @param aPos The new position + */ + void OverridePosition( const TPoint& aPos ); + + /** + * Resets the position set by OverridePosition and causes the + * indicator to be displayed in the originally speficied position. + * @since 3.0 + */ + void CancelOverridePosition(); + + /** + * @since 2.8 + * @param aGc The graphics context to use for drawing + */ + void Draw( CBitmapContext& aGc ) const; + + /** + * Returns indicators layout rect + * @since 5.0 + */ + TRect LayoutRect(); + + /** + * Sets new size for all icons + * @since S60 5.0 + * @param aRect the new size for the icons + */ + void SetRect( const TRect& aRect ); + +private: + + private: // Data + RPointerArray iIcons; // array of available icons + TInt iCurrentIcon; // index into icon array + TBool iClear; // set to ETrue to clear the indicator + + TBool iFlashing; // set to ETrue for a flashing indicator + + // rect of the indicator in the viewfinder + TRect iRect; + + // stores the originally specified (ie not overridden) rect + TRect iDefaultRect; + + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamIndicatorData.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamIndicatorData.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Encapsulates the data specific to a single indicator.* +*/ + + +#ifndef CAMINDICATORDATA_H +#define CAMINDICATORDATA_H + +// INCLUDES + + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* +*/ +class CCamIndicatorData : public CBase + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aReader reference to resource reader object + */ + static CCamIndicatorData* NewLC( TResourceReader& aReader ); + + /** + * Destructor. + */ + virtual ~CCamIndicatorData(); + + private: + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aReader reference to resource reader object + */ + void ConstructL( TResourceReader& aReader ); + + /** + * C++ constructor + * @since 2.8 + */ + CCamIndicatorData(); + + public: // New functions + /** + * returns the indicator identifier + * @since 2.8 + * @return indicator id + */ + TInt IndicatorId() const; + + /** + * returns the indicator rectangle + * @since 2.8 + * @return indicator rectangle + */ + TRect IndicatorRect() const; + + /** + * returns the number of available bitmaps for the indicator + * @since 2.8 + * @return number of bitmaps + */ + TInt IndicatorBitmapCount() const; + + /** + * returns a bitmap identifier + * @since 2.8 + * @param aIndex indx into array of available bitmaps + * @return bitmap id at specified index + */ + TInt32 IndicatorBitmapId( TInt aIndex ) const; + + private: // Data + TInt iIndicatorId; + TRect iRect; + TInt iIndicatorBitmapCount; + RArray iBitmapIdArray; + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamIndicatorResourceReader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamIndicatorResourceReader.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera Indicator Resource Reader class* +*/ + + +#ifndef CAMINDICATORRESOURCEREADER_H +#define CAMINDICATORRESOURCEREADER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CCamIndicatorData; + +// CLASS DECLARATION + +/** +* Side Pane control +*/ +class CCamIndicatorResourceReader : public CBase + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aReader reference to resource reader + */ + static CCamIndicatorResourceReader* NewLC( TResourceReader& aReader ); + + /** + * Destructor. + */ + virtual ~CCamIndicatorResourceReader(); + + private: + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aReader reference to resource reader + */ + void ConstructL( TResourceReader& aReader ); + + /** + * C++ constructor + * @since 2.8 + */ + CCamIndicatorResourceReader(); + + public: + /** + * return indicator data + * @since 2.8 + * @return array of indicator data + */ + + CArrayPtrFlat& IndicatorData(); + + private: // Data + CArrayPtrFlat* iIndicatorArray; + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamInfoListBox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamInfoListBox.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Listbox used by CamInfoListBoxContainer* +*/ + + +#ifndef CAMINFOLISTBOX_H +#define CAMINFOLISTBOX_H + +// INCLUDES +#include "CamCaptureSetupListBox.h" +#include "CamAppController.h" + +// CLASS DECLARATION + +/** +* List box for camera scenes. +* @since 3.0 +*/ +class CCamInfoListBox : public CCamCaptureSetupListBox + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~CCamInfoListBox(); + + /** + * C++ default constructor. + */ + CCamInfoListBox( MCamSettingValueObserver* aObserver, + CCamAppController& aController); + + /** + * By default Symbian 2nd phase constructor is private. + * @param aParent Parent control (i.e. Shooting mode container) + * @param aSummaryTitleTextArray - array of shooting mode (scene) titles + * @param aSummaryDescriptionTextArray - array of shooting mode (scene) descriptions + */ + void ConstructL( CCamAppController& aController, + const CCoeControl* aParent, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray, + TInt aResourceId ); + + private: + + // Scenes supported by product + RArray iSupportedScenes; + + // camera mode (still/video) + TCamCameraMode iMode; + }; + +#endif // CAMINFOLISTBOX_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamInfoListBoxContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamInfoListBoxContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,247 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for Image/Video quality.* +*/ + + +#ifndef CAMINFOLISTBOXCONTAINER_H +#define CAMINFOLISTBOXCONTAINER_H + +// INCLUDES +#include "CamContainerBase.h" +#include "CamAppController.h" +#include "CamSettingValueObserver.h" +#include "CamSettings.hrh" +#include +#include + + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAknQueryValue; +class CCamInfoListBox; +class CAknInfoPopupNoteController; +class MTouchFeedback; + +// CLASS DECLARATION + +/** +* Implements a general setting control, with a listbox with choices +* in the left and a icon and highlighted item description in the right. +* +* @since 2.8 +*/ + +class CCamInfoListBoxContainer : public CCamContainerBase, + public MCamSettingValueObserver, + public MEikListBoxObserver + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aRect Frame rectangle for container. + * @param aView Reference to the view containing this container + * @param aController reference to CCamAppControllerBase instance + * @param aListBoxResource Listbox resource data + * @param aSummaryResource Summary resource data + * @param aSettingValue Initial setting value + */ + static CCamInfoListBoxContainer* NewL( const TRect& aRect, + CAknView& aView, + CCamAppController& aController, + TInt aListBoxResource, + TInt aSummaryResource, + TInt aSettingValue, + TInt aTitleResource ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamInfoListBoxContainer(); + + private: + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + * @param aListBoxResource + * @param aSummaryResource + */ + void ConstructL( const TRect& aRect, TInt aListBoxResource, TInt aSummaryResource, TInt aTitleResource ); + + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppControllerBase instance + * @param aView Reference to the view containing this container + * @param aSettingValue Initial setting value + * display the base scenes for the user scene. + */ + CCamInfoListBoxContainer( CCamAppController& aController, + CAknView& aView, + TInt aSettingValue ); + + public: + + /** + * Gets the settings item value ID of the current item + * @since 2.8 + * @return the settings item value of the currently highlighted item + */ + TInt CurrentSettingItemValue() const; + + /** + * Returns ETrue if the setting item value has changed + * @since 2.8 + * @return setting value change status + */ + TBool SettingValueChanged() const; + + /** + * Gets the index in the item array that has the specified settings + * item value ID of the current item + * @since 3.0 + * @return the index of the item with the specified value id + */ + TInt IndexForValueId( TInt aValueId ) const; + + public: //Functions from base classes + /** + * From MCamSettingValueObserver + * Handles a change in the slider value + * @since 2.8 + * @param aNewValue the new value of the setting + */ + void HandleSettingValueUpdateL( TInt aNewValue ); + + + protected: // Functions from base classes + /** + * From CoeControl + * @since 2.8 + * @return number of contained controls + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl + * @since 2.8 + * @param aIndex The index of the required control + * @return Returns the requested control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl + * @since 2.8 + * @param aRect area where to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * From CamContainerBase + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + private: + /** + * Sets up the summary pane detail arrays + * @since 2.8 + * @param aResourceId The resource that defines the summary pane details + */ + void ConstructSummaryDetailsFromResourceL(TInt aResourceId); + + + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + /** + * From MEikListBoxObserver + */ + void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); + void ShowTooltipL(); + void ConstructContainerTitleFromResourceL( TInt aResourceId ); + + /** + * Draws the summary title and description text + * @param aGc The graphics context to draw to + */ + void DrawSummaryTextL( CWindowGc& aGc ) const; + + /** + * Read touch layout + * @return TRect, listbox rectangle + */ + TRect TouchLayout(); + + /** + * Read non-touch layout + * @return TRect, listbox rectangle + */ + TRect NonTouchLayout(); + + private: // data + + // The listbox itself + CCamInfoListBox* iListBox; + + // Array of bitmaps for the large summary icon + RPointerArray iSummaryBitmapArray; + // Array of all shooting mode titles + RPointerArray iTitleArray; + // Array of all shooting mode descriptions + RPointerArray iDescArray; + + TInt iSettingValue; + + + // The text shown as the title of the container + HBufC16* iListboxTitle; + + // info tooltip + CAknInfoPopupNoteController* iTooltipController; + TBool iShowTooltip; + TInt iTooltipIndex; + + // Layout rect for title text + TAknLayoutText iTitleTextRectLayout; + TAknLayoutRect iListboxLayoutRect; + TRect iLayoutAreaRect; + TRect iExplanationRect; + TInt iExplLineCount; // Number of available layouts + TAknLayoutRect iExplIconLayout; + TAknLayoutText iExplTitleLayout; + RArray iExplTxtLinesLayout; + CArrayFixFlat* iCurrentDescLineArray; // own + + TBool iActivateOnTouchRelease; + + MTouchFeedback* iFeedback; // not own + + }; + +#endif //CAMINFOLISTBOXCONTAINER_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamInfoListBoxModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamInfoListBoxModel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model for CamInfoListBox* +*/ + + +#ifndef CAMINFOLISTBOXMODEL_H +#define CAMINFOLISTBOXMODEL_H + +// INCLUDES +#include "CamCaptureSetupListBoxModel.h" +#include "CamAppController.h" + +// CLASS DECLARATION + +/** +* List box model for Camera scenes +* +* @since 3.0 +*/ +class CCamInfoListBoxModel : public CCamCaptureSetupListBoxModel + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamInfoListBoxModel* NewLC( CCamAppController& aController, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray, + TInt aResourceId, + TRect aListBoxRect ); + + /** + * Destructor. + */ + virtual ~CCamInfoListBoxModel(); + + + private: + + /** + * C++ default constructor. + */ + CCamInfoListBoxModel( CCamAppController& aController, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( TInt aResourceId, TRect aListBoxRect ); + + /** + * Get settings for all supported scenes + * @since 3.0 + * @param aResourceId ID of resource definition for scenes + */ + void GetListboxDataL( TInt aResourceId ); + + + private: // Data + + // Array of title descriptions for the summary title lines + RPointerArray& iSummaryTitleTextArray; + // Array of descriptons for the summary description lines + RPointerArray& iSummaryDescriptionTextArray; + + }; + +#endif // CAMINFOLISTBOXMODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamLocationIconController.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamLocationIconController.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for CCamLocationIconController class. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#ifndef CAMLocationIconCONTROLLER_H +#define CAMLocationIconCONTROLLER_H + +// INCLUDES + +#include +#include "CamPropertyObserver.h" // MPropertyObserver +#include "CamControllerObservers.h" + +// CONSTANTS + +const TInt KLocationSettingStateOff = 0; +const TInt KLocationSettingStateOn = 1; + +// FORWARD DECLARATIONS + +class CCamAppController; +class CCamIndicator; +class CCamPropertyWatcher; +class CWindowGc; +class CBitmapContext; +class CEikonEnv; + +// CLASS DECLARATION + +/** +* Abstract API for location icon observer. +* Derived classes, which have subscribed to CCamLocationIconController +* receive notification when the location icon contents change +*/ +class MCamLocationIconObserver + { + public: + /** + * The location icon contents have changed + */ + virtual void LocationIconUpdated() = 0; + }; + +/** +* Watches changes in location state properties. +* Notifies observer of changes in the location indocator. +* Handles drawing requests by passing them to owned CCamLocationIconDrawer +* object. +*/ +class CCamLocationIconController: public CBase, public MPropertyObserver, public MCamControllerObserver + { + + public: // Construction and destruction + /** + * Descructor + */ + ~CCamLocationIconController(); + /** + * Two-phased constructor + * @param aObserver location indicator observer + * @param aCallbackActive Callback to the observer active + * @return Pointer to the created + */ + static CCamLocationIconController* NewL( CCamAppController& aController, + MCamLocationIconObserver& aObserver, + TBool aCallbackActive, TRect& aRect ); + + + public: // From MPropertyObserver + /** + * The value of a watched property has changed + * @param aCategory The category of the property + * @param aKey the Identifier of the property + */ + void HandlePropertyChangedL( const TUid& aCategory, const TUint aKey ); + + + public: // New functions + /** + * Activate or deactivate callbacks to observer when there + * are changes in the location indicator. + * @param aActive Callback to observer active + */ + void SetCallbackActive( TBool aActive ); + + /** + * Set location state. + * @param aState location state + */ + void SetLocationState( TInt aState ); + + /** + * location indicator's rectangle + * @return rectangle + */ + TRect Rect() const; + + /** + * Draw the location icon + * @param aGc Graphics context + */ + void Draw( CBitmapContext& aGc ) const; + //void Draw( CWindowGc& aGc ) const; + + /** + * From MCamControllerObserver + * @since 2.8 + * @param aEvent The enumerated code for the event received + * @param aError The error code associated with the event + */ + void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + protected: + /** + * Second phase constructor + */ + void ConstructL( TRect& aRect ); + + private: + /** + * Constructor. + * @param aObserver location indocator observer + * @param aCallbackActive Callback to the observer active + */ + CCamLocationIconController( CCamAppController& aController, + MCamLocationIconObserver& aObserver, + TBool aCallbackActive ); + + void CreateLocationIndicatorL(); + void UpdateRect( TBool aSecondCameraEnabled ); + void UpdateRect(); + //TRect Rect() const; + + /** + * Notifies observer of changes in the location indicator, + * if iCallbackActive is set + */ + void NotifyObserver(); + + /** + * Read current status of the properties. Set location state accordingly + */ + void ReadCurrentState(); + + private: + CCamAppController& iController; + // Array of pointer to the location indicators + RPointerArray iLocationIndicators; + // The current location indicator + TInt iLocationState; + const CEikonEnv * iEnv; + // Observer of the location indicator changes + MCamLocationIconObserver& iObserver; + TBool iCallbackActive; + TRect iRect; + + // Property watchers for location state changes + CCamPropertyWatcher* iLocationStateWatcher; + }; + +#endif diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamMemoryMonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamMemoryMonitor.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 free memory and attempts to free it if necessary +* +*/ + +#ifndef CAMMEMORYMONITOR_H +#define CAMMEMORYMONITOR_H + +#include +#include + + +class CCamAppController; +class CCamAppUi; + +/** + * Class that monitors free memory and attempts to free it if necessary + * + */ +class CCamMemoryMonitor : public CActive +{ + +public: + + static CCamMemoryMonitor* NewL( CCamAppUi* aAppUi, CCamAppController* aController ); + + virtual ~CCamMemoryMonitor(); + + /** + * Start monitoring free memory. If available memory drop below given limit, + * requests memory from OomManager. + * + * @param aLimit Monitored memory limit + * @param aRequestAmount Amount of memory to be requested if below aLimit + */ + void StartMonitoring( TInt aLimit, TInt aRequestAmount ); + + /** + * Start monitoring free memory. Uses default or previously given + * values for limit and request amount + */ + void StartMonitoring(); + + /** + * Stop monitoring free memory. + * + */ + void StopMonitoring(); + + /** + * Checks for free memory and requests more if below given limit. + * + * @param aLimit Memory limit to be checked + * @param aRequestAmount Amount of memory to be requested if below aLimit + * @param aShowNote If ETrue, note will be shown during memory request + */ + TInt CheckAndRequestMemoryL( TInt aLimit, TInt aRequestAmount, TBool aShowNote ); + + /** + * Checks for free memory and requests more if below given limit. Uses + * default values for limit and request amount. + * + * @param aShowNote If ETrue, note will be shown during memory request + */ + TInt CheckAndRequestMemoryL( TBool aShowNote ); + + + + void RunL(); + void DoCancel(); + +private: + CCamMemoryMonitor( CCamAppUi* aAppUi, CCamAppController* aController ); + void ConstructL(); + + static TInt MemoryCheck( TAny* aPtr ); + + void CheckMemory(); +private: + // data + + TInt iLimit; + TInt iRequestAmount; + + CCamAppUi* iAppUi; + CCamAppController* iController; + CPeriodic* iMemoryCheckTimer; + ROomMonitorSession iOomMonitor; +}; + +#endif /* CCAMMEMORYMONITOR_H_ */ diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamModeSetupPaneHandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamModeSetupPaneHandler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,341 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setup pane handler/controller class. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#ifndef CAMMODESETUPPANEHANDLER_H +#define CAMMODESETUPPANEHANDLER_H + +// INCLUDES +#include +#include +#include "CamSetupPaneModel.h" +#include "CamLastCaptureHelper.h" + +// FORWARD DECLARATIONS +class CCamAppController; +class CCoeControl; +class CCamSetupPaneItemArray; +class CCamSetupPane; + + +// CLASS DECLARATION + +/** +* Mode setup pane controller class. +*/ +class CCamModeSetupPaneHandler : public CBase, + public MCamSetupPaneModel + { +public: + enum TEvent + { + EEventLeft, + EEventRight, + EEventSelect, + EEventCancel, + EEventEditUser + }; +public: + /** + * Two-phase class constructor. + * @since 3.0 + * @param aController - A ref to a base app controller. + * @return The new object. + */ + static CCamModeSetupPaneHandler* NewLC( CCamAppController& aController ); + + /** + * Two-phase class constructor. + * @since 3.0 + * @param aController - A ref to a base app controller. + * @return The new object. + */ + static CCamModeSetupPaneHandler* NewL( CCamAppController& aController ); + + /** + * C++ class destructor. + * @since 3.0 + */ + ~CCamModeSetupPaneHandler(); + +public: + /** + * Creates and returns a new pane control. + * @since + * @param aParent - The parent (container) control. + * @param aRect - the rectangle this control is to occupy. + * @return The new pane control. + */ + CCoeControl* CreatePaneControlL( CCoeControl* aParent, const TRect& aRect ); + + /** + * Handles events forwarded from the pane control. + * @since 3.0 + * @param aEvent - The event to handle + */ + void HandleEvent( TEvent aEvent ); + + /** + * Moves the current highlight item. + * @since 3.0 + */ + void MoveToPreviousItem(); + + /** + * Moves the current highlight item. + * @since 3.0 + */ + void MoveToNextItem(); + + /** + * Sets the context of the Setup Pane, based on the mode it is in + * @since 3.0 + * @param aFirstCamera ETrue if first camera in use, else EFalse + * @param aPhoto ETrue if in photo mode, else EFalse if in video + * @param aUserSceneSetup ETrue if in user scene setup mode. + */ + void SetMenuContextL( TBool aFirstCamera, TBool aPhoto, TBool aUserSceneSetup = EFalse ); + + /** + * Activates a particular sub-menu. + * @since 3.0 + * @param aMenuItem The id of the submenu to activate. + */ + void ActivateMenuItem( TInt aMenuItem ); + + /** + * Set whether SetupPane control is in foreground or not + * @since 3.0 + * @param aForeground ETrue if in foreground, EFalse if in background + */ + void SetForeground( TBool aForeground ); + +public: + /** + * From MCamSetupPaneModel + * @since 3.0 + * @return The number of items in the model. + */ + TInt NumberOfItems() const; + + /** + * From MCamSetupPaneModel + * @since 3.0 + * @return The title text in the model. + */ + const TDesC& TitleText() const; + + /** + * From MCamSetupPaneModel + * @since 3.0 + * @return The descriptor text in the model. + */ + const TDesC& DescriptorText() const; + + /** + * From MCamSetupPaneModel + * @since 3.0 + * @param aItemIndex - The model item index to get an icon for. + * @return The corresponding icon. + */ + CGulIcon& Icon( TInt aItemIndex ); + + /** + * From MCamSetupPaneModel + * @since 3.0 + * @return The index of the highlighted model item. + */ + TInt HighlightedItemIndex() const; + + /** + * From MCamSetupPaneModel + * @since 3.0 + * @return The id of the highlighted model item. + */ + TInt HighlightedItemId() const; + + /** + * From MCamSetupPaneModel + * @since 3.0 + * @param aItemIndex Index of the SetupPane menu item + * @return ETrue if this item is the LastCaptured thumbnail, else EFalse + */ + TBool IconIsThumbnail( TInt aItemIndex ) const; + + /** + * From MCamSetupPaneModel + * @since 3.0 + * @param aSmall Whether requesting the small (ETrue) or large (EFalse) thumbnail icon + * @return The number of items in the model. + */ + CGulIcon& Thumbnail( TBool aSmall ); + + /** + * From MCamSetupPaneModel + * @since 3.0 + */ + void Refresh(); + +private: + /** + * C++ constructor. + * @since 3.0 + * @param aController - A ref to a base app controller object. + */ + CCamModeSetupPaneHandler( CCamAppController& aController ); + + /** + * Carriers out two-phase class construction. + * @since 3.0 + */ + void ConstructL(); + + /** + * Handles a pane highlighted item change. + * @since 3.0 + */ + void HandlePaneItemChanged(); + + /** + * Handles a pane highlighted item change. + * @since 3.0 + */ + void HandlePaneItemLevelItemChanged(); + + /** + * Handles a pane highlighted menu item selection. + * @since 3.0 + * @param aValueToBeHighlighted The value of the selected pane to be highlighted. + */ + void HandlePaneMenuLevelSelection( TInt aValueToBeHighlighted ); + + /** + * Handles user selection of the "LastCapture" thumbnail where available + * @since 3.0 + */ + void HandleLastCaptureSelection(); + + /** + * Handles a pane highlighted item-level selection. + * @since 3.0 + */ + void HandlePaneItemLevelSelection(); + + /** + * Handles a pane highlighted item-level selection. + * @since 3.0 + */ + void HandlePaneCancel(); + + /** + * Updates the setup pane based on the specified resource + * @since 3.0 + * @param aResource The resource specifying the new pane contents + */ + void UpdateFromResourceL( TInt aResource ); + + /** + * Deletes the contents of the array, and resets internal state + * @since 3.0 + */ + void ResetArray(); + + /** + * Switches to the User Scene Setup view. + * @since 3.0 + */ + void SwitchToUserSceneView(); + + +private: + // Setup pane modes - top ('menu') level, or bottom ('item') level. + enum TSetupPaneLevel + { + EMenuLevel, + EItemLevel + }; + + // Various definitions: + enum + { + KSettingsArrayCount = 6, // Number of settings arrays. + KItemArrayGranularity = 4, // Granularity of item arrays. + KMaxTitleCharLength = 32 // Max character length of title text. + }; + +private: + // The app controller object (gives access to settings). + CCamAppController& iController; + + // The current level that the pane is at (menu or item level). + TSetupPaneLevel iPaneLevel; + + // The zero-based index of the currently highlighted item. + TInt iHighlightedItemIndex; + + // Zero-based index of the current settings array (=the selected menu item). + TInt iCurrentSettingsArrayIndex; + + // IDs of the pane menu items (+ one dynamic item). + TInt iMenuItemIds[KSettingsArrayCount + 1]; + + // Title text for each menu item (+ one dynamic item) + TBuf iMenuTitles[KSettingsArrayCount + 1]; + + // 'Item-level' settings item arrays. + CCamSetupPaneItemArray* iSettingItems[KSettingsArrayCount]; + + // Pointer to a pane control object (not owned). + CCamSetupPane* iPaneControl; + + // Pointer to the owning object (not owned) + CCoeControl* iParent; + + // Number of settings in the iSettingItems array + TInt iNoOfSettingsItems; + + // Specifies whether the user scene setup is currently being edited. + TBool iUserSceneSetupMode; + + // Helper class to get the last-captured thumbnails where available. + CCamLastCaptureHelper* iLastCaptureHelper; + + // The current mode. ETrue if Photo mode, EFalse if video mode + TBool iPhotoMode; + + // Whether the SetupPane is currently in foreground or not. + TBool iForeground; + + // Title to use for the LastCapture selection + HBufC16* iLastCapTitle; + + // Filename of last capture + TFileName iLastCapName; + }; + +#endif diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamNaviCounterControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamNaviCounterControl.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Control for displaying remaining images in navi pane. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#ifndef CAMNAVICOUNTERCONTROL_H +#define CAMNAVICOUNTERCONTROL_H + +// INCLUDES +#include +#include +#include "CamAppController.h" +#include "CamSettings.hrh" +#include "CamResourceLoader.h" +#include "CamNaviCounterModel.h" +#include "CamObserver.h" + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Control for displaying recording time info in navi pane. +* @since 2.8 +*/ +class CCamNaviCounterControl : public CCoeControl, + public MCamObserver + { + public: // Constructors and destructor + /** + * Static factory construction function + * @since 2.8 + * @param aModel Counter model reference + * @return pointer to constructed instance of CCamNaviCounterControl + */ + static CCamNaviCounterControl* NewL( CCamNaviCounterModel& aModel ); + + /** + * Destructor. + */ + ~CCamNaviCounterControl(); + + public: // New functions + + /** + * Force update of navi-pane (i.e after dismissal of MMC removed error note) + * @since 2.8 + */ + void ForceNaviPaneUpdate(); + + /** + * Draw Navi-Counter + * @since 3.0 + * @param aGc Handle to graphics context + */ + void DrawNaviCtr( CBitmapContext& aGc ) const; + + /** + * Sets whether this control is active. If not, it cannot affect the model, or use it to render. + * @param aActive Whether to set it active or not + */ + void SetActiveL( TBool aActive ); + + public: // From MCamObserver + + /** + * From MCamObserver + * @param aEvent Observed object's event code + */ + void HandleObservedEvent(TCamObserverEvent aEvent); + + protected: + /** + * C++ constructor. + * @since 2.8 + * @param aModel Counter model reference + */ + CCamNaviCounterControl( CCamNaviCounterModel& aModel ); + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + private: // Functions from base classes + + /** + * From CCoeControl + * @since 2.8 + * Set the size and position of its component controls. + */ + void SizeChanged(); + + /** + * From CCoeControl Draw the view + * @since 2.8 + * @param aRect area where to draw + */ + void Draw( const TRect& aRect ) const; + + protected: //data + CCamNaviCounterModel& iModel; + + private: //data + TBool iActive; + + }; + +#endif // CAMNAVICOUNTERCONTROL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamNaviCounterModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamNaviCounterModel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,595 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Control for displaying remaining images in navi pane. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#ifndef CAMNAVICOUNTERMODEL_H +#define CAMNAVICOUNTERMODEL_H + +// INCLUDES +#include +#include +#include +#include "CamAppController.h" +#include "CamSettings.hrh" +#include "CamResourceLoader.h" +#include "CamObservable.h" +#include "CamObserverHandler.h" + +#include "CamSelfTimerObserver.h" + +#include "CamBurstModeObserver.h" + +#include "CamAppUiBase.h" + +// CONSTANTS +const TInt KMaxTextLength = 40; + +// FORWARD DECLARATIONS +class MAknsSkinInstance; +class CCamDecorator; +class CCamTextItem; +class CAknNavigationDecorator; +class CFbsBitmap; +// CLASS DECLARATION + + +/** +* Control for displaying recording time info in navi pane. +* @since 2.8 +*/ +class CCamNaviCounterModel : public CBase, + public MCamControllerObserver, + public MCamObservable, + public MCamResourceLoader, + public MCamSelfTimerObserver, + public MCamBurstModeObserver + + { + public: // Constructors and destructor + /** + * Static factory construction function + * @since 2.8 + * @param aController Reference to CCamAppController + * @return pointer to constructed instance of CCamNaviCounterModel + */ + static CCamNaviCounterModel* NewL( CCamAppController& aController ); + + /** + * Destructor. + */ + ~CCamNaviCounterModel(); + + private: // New functions + /** + * Update remaining image counter + * @since 2.8 + */ + void UpdateCounter(); + + /** + * Update remaining time till next timelapse capture + * @since 3.0 + */ + void UpdateTimeLapseCountdownL(); + + /** + * Update captured and remaining image count during burst and timelapse capture + * @since 3.0 + */ + void UpdateSequenceImageCount(); + + /** + * Update remaining record time + * @since 2.8 + */ + void UpdateRecordTimeAvailableL(); + + public: // From MCamResourceLoader + /** + * From MCamResourceLoader + * @since 3.0 + */ + void LoadResourceDataL(); + + /** + * From MCamResourceLoader + * @since 3.0 + */ + void UnloadResourceData(); + + /** + * From MCamResourceLoader + * @since 3.0 + */ + void ReloadResourceDataL(); + + public: // From MCamObservable + /** + * From MCamObservable + * @param aObserver Observer to register + * @since 3.0 + */ + void RegisterObserverL(MCamObserver* aObserver); + + /** + * From MCamObservable + * @param aObserver Observer to deregister + * @since 3.0 + */ + void DeregisterObserver(MCamObserver* aObserver); + + /** + * From MCamObservable + * @param aEvent Event code to broadcast + * @since 3.0 + */ + void BroadcastEvent(TCamObserverEvent aEvent); + + public: // New functions + /* + * Draws counter and storage icon in the navi pane. + */ + void CreateNaviBitmapsL( TBool aFlag = ETrue ); + + /** + * Set capture mode (defines which counter to use) + * @since 2.8 + * @param aCaptureMode Specifies the current capture mode in use + */ + void SetCaptureModeL( TCamCameraMode aCaptureMode, + TCamImageCaptureMode aImageMode ); + + /** + * Draw the storage icon + * @since 2.8 + * @param aGc The graphics context to use + */ + void DrawStorageIcon( CBitmapContext& aGc ) const; + + /** + * Draw the video file type icon + * @since 2.8 + * @param aGc The graphics context to use + */ + void DrawVideoFileTypeIndicator( CBitmapContext& aGc ) const; + + /** + * Force update of navi-pane (i.e after dismissal of MMC removed error note) + * @since 2.8 + */ + void ForceNaviPaneUpdate(); + + /** + * Sets a new extent to render into + * @param aExtent New extent + */ + void SetExtentL( TRect aExtent ); + + public: // Functions from base class MCamSelfTimerObserver + /** + * Handle an event from CCamSelfTimer. + * @since 2.8 + * @param aEvent the self timer event + * @param aCountDown self timer countdown duration + */ + void HandleSelfTimerEvent( TCamSelfTimerEvent aEvent, + TInt aCountDown ); + + public: // Functions from base class MCamBurstModeObserver + /** + * Handle sequence state change + * @since 2.8 + * @param aActive ETrue if sequence now active, else EFalse + */ + void BurstModeActiveL( TBool aActive, TBool aStillModeActive ); + + /** + * Draw the counter to the bitmap used in the navi pane + * @since 3.0 + * @param aBmpGc The graphics context for the bitmap + * @param aBmpMaskGc The graphics context for the bitmap mask + */ + void DrawCounterToBitmaps( CFbsBitGc& aBmpGc, CFbsBitGc& aBmpMaskGc ) const; + + /** + * Draw Navi-Counter + * @since 3.0 + * @param aGc Handle to graphics context + * @param aControl Pointer to the control + */ + void DrawNaviCtr( CBitmapContext& aGc, const CCoeControl* aControl ) const; + + protected: + /** + * C++ constructor. + * @since 2.8 + * @param aController Reference to CCamAppController + */ + CCamNaviCounterModel( CCamAppController& aController ); + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + private: // Functions from base classes + + /** + * Draw the navi-counter + * @since 3.0 + * @param aGc Handle to graphics context + * @param aControl Pointer to the control + */ + void DrawCounter( CBitmapContext& aGc, const CCoeControl* aControl ) const; + + /** + * Draw the storage icon to the bitmap used in the navi pane + * @since 3.0 + * @param aBmpGc The graphics context for the bitmap + * @param aBmpMaskGc The graphics context for the bitmap mask + */ + void DrawStorageIconToBitmap( CFbsBitGc& aBmpGc, CFbsBitGc& aBmpMaskGc ) const; + + /** + * Draw the text + * @since 2.8 + * @param aSkin the current skin + * @param aText A Reference to the text + */ + void DrawText( MAknsSkinInstance* aSkin, + const TDesC& aText, + CBitmapContext& aGc ) const; + + /** + * Draw the countdown text (timelapse mode) + * @since 3.0 + * @param aSkin the current skin + * @param aGc the graphics context + */ + void DrawTimeLapseCountdown( MAknsSkinInstance* aSkin, + CBitmapContext& aGc ) const; + + /** + * Draw the captured and remaining image text (timelapse and burst mode) + * @since 3.0 + * @param aSkin the current skin + * @param aGc the graphics context + */ + void DrawSequenceImageText( MAknsSkinInstance* aSkin, + CBitmapContext& aGc ) const; + + /** + * Draw the count of captured images (timelapse mode - postcapture) + * @since 3.0 + * @param aSkin the current skin + * @param aGc the graphics context + */ + void DrawImagesCapturedTextL( MAknsSkinInstance* aSkin, + CBitmapContext& aGc ) const; + + /** + * Draw the current file size + * @since 3.0 + * @param aSkin the current skin + */ + void DrawCurrentFileSizeL( MAknsSkinInstance* aSkin, + CBitmapContext& aGc ) const; + + /** + * Construct the member variables for selftimer icon + * in the navi-pane + * @since 2.8 + * @param aResname The resource file name + */ + void ConstructNaviSelfTimerL( TPtrC& aResname ); + + /** + * Draw the selftimer icon and text + * @since 2.8 + * @param aGc The graphics context to use + * @param aSkin The current skin + */ + void DrawNaviSelfTimer( CBitmapContext& aGc, + MAknsSkinInstance* aSkin ) const; + + /** + * Construct the member variables for sequence icon + * in the navi-pane + * @since 2.8 + * @param aResname The resource file name + */ + void ConstructNaviSequenceL( TPtrC& aResname ); + + /** + * Draw the sequence icon + * @since 2.8 + * @param aGc The graphics context to use + */ + void DrawNaviSequence( CBitmapContext& aGc ) const; + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + /** + * Construct the member variables for general setup icon + * in the navi-pane + * @since 2.8 + * @param aResname The resource file name + */ + void ConstructNaviGenericSetupL( TPtrC& aResname ); + + /** + * Draw the generic setup icon + * @since 2.8 + * @param aGc The graphics context to use + */ + void DrawNaviGenericSetup( CBitmapContext& aGc ) const; +#endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + + /** + * Construct the member variables for audio mute icon + * in the navi-pane + * @since 2.8 + * @param aResname The resource file name + */ + void ConstructNaviAudioMuteL( TPtrC& aResname ); + + /** + * Draw the audio mute icon + * @since 2.8 + * @param aGc The graphics context to use + */ + void DrawNaviAudioMute( CBitmapContext& aGc ) const; + + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + /** + * Construct the member variables for mode subtitle + * in the navi-pane + * @since 2.8 + * @param aResname The resource file name + */ + void ConstructNaviModeSubtitleL( TPtrC& aResname ); + + /** + * Draw the mode subtitle icon and text + * @since 2.8 + * @param aGc The graphics context to use + * @param aSkin The current skin + */ + void DrawNaviModeSubtitle( CBitmapContext& aGc, MAknsSkinInstance* aSkin ) const; +#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + + /** + * From MCamControllerObserver + * Handle an event from CCamAppController. + * @since 2.8 + * @param aEvent the type of event + * @param aError error code + */ + void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + /** + * Read nontouch layout for primary camera + */ + void NonTouchLayoutL(); + + /** + * Read nontouch layout for primary camera + */ + void NonTouchLayoutSecondaryL(); + + /** + * Read touch layout + */ + void TouchLayoutL(); + + protected: //data + TInt iOriginalValueForEachBurst; + TBool iCounterNeedUpdate; + CCamAppController& iController; // camera app controller + + // text array - used to store remaining images as text + TBuf iCounterText; + + // string used to store remaining time till next + // timelapse capture + HBufC* iCountDownText; + + // text array - used to store captured and remaining image + // count in timelapse and burst modes + TBuf iSequenceImageText; + + // text array - used to store remaining record time as text + TBuf iRemainingTimeText; + + // Layout information for drawing the counter text. + TAknLayoutText iPhotoTextLayout; + TAknLayoutText iVideoTextLayout; + + // own + CCamTextItem* iPhotoTextItem; + + // own + CCamTextItem* iVideoTextItem; + + // Text items for drawing timelapse and burst text. + // own + CCamTextItem* iSequenceImageTextItem; + + // own + CCamTextItem* iSequenceCapturedTextItem; + + // own + CCamTextItem* iTimeLapseCountdownTextItem; + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_FILENAME + // Layout information for drawing the current filename text. + TAknLayoutText iPhotoNameLayout; + TAknLayoutText iVideoNameLayout; +#endif // PRODUCT_SUPPORTS_NAVIPANE_FILENAME + + // current capture mode info + TCamCameraMode iMode; + TCamImageCaptureMode iImageMode; + + // storage location bitmaps + CFbsBitmap* iPhoneIcon; + CFbsBitmap* iPhoneIconMask; + CFbsBitmap* iMMCIcon; + CFbsBitmap* iMMCIconMask; + CFbsBitmap* iMassStorageIcon; + CFbsBitmap* iMassStorageIconMask; + + CFbsBitmap* iMpeg4Icon; + CFbsBitmap* iMpeg4IconMask; + CFbsBitmap* i3GPIcon; + CFbsBitmap* i3GPIconMask; + + // current storage location (phone or card) + TCamMediaStorage iStorageLocation; + + // set to ETrue when engine has initialised video recorder + TBool iVideoInitialised; + + // Layout information for the video storage icon (in postcapture state). + TAknLayoutRect iVidPostStorageIconRect; + + // Layout information for the video storage icon (in precapture state). + TAknLayoutRect iVidPreStorageIconRect; + + // Layout information for the image storage icon. + TAknLayoutRect iImgStorageIconRect; + + // Layout information for the video file type icon. + TAknLayoutRect iVideoFileTypeIconRect; + + // Layout information for drawing the self timer icon. + TAknLayoutRect iSelfTimerIconRect; + + // Self timer bitmaps. + CFbsBitmap* iSelfTimerIcon; + CFbsBitmap* iSelfTimerMask; + + // Specifies whether the self timer should be drawn or not. + TBool iDrawSelfTimer; + + // Layout information for drawing the self timer text. + TAknLayoutText iSelfTimerTextLayout; + + // text array - used to store self timer countdown as text + TBuf iSelfTimerText; + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + // Specifies whether the sequence should be drawn or not. + TBool iDrawSequence; +#endif // PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + + // Layout information for drawing the sequence icon. + TAknLayoutRect iSequenceIconRect; + + // Sequence bitmap and mask + CFbsBitmap* iSequenceIcon; + CFbsBitmap* iSequenceMask; + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + // Layout information for drawing the generic setup icon. + TAknLayoutRect iGenericIconRect; + + // Generic setup bitmap and mask + CFbsBitmap* iGenericIcon; + CFbsBitmap* iGenericMask; +#endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + + // Layout information for drawing the audio mute icon. + TAknLayoutRect iAudioMuteIconRect; + + // Audio mute bitmap and mask + CFbsBitmap* iAudioMuteIcon; + CFbsBitmap* iAudioMuteMask; + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + // Layout information for the subtitles text + TAknLayoutText iSubtitlePhotoTextLayout; + TAknLayoutText iSubtitleVideoTextLayout; + + // Text strings for photo/video subtitles + HBufC16* iSubtitlePhotoText; + HBufC16* iSubtitleVideoText; + + // Layout information for the subtitle icons (video and photo mode) + TAknLayoutRect iSubtitlePhotoRect; + TAknLayoutRect iSubtitleVideoRect; + + // Photo and video mode bitmaps and masks + CFbsBitmap* iSubtitlePhotoIcon; + CFbsBitmap* iSubtitlePhotoMask; + CFbsBitmap* iSubtitleVideoIcon; + CFbsBitmap* iSubtitleVideoMask; +#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + + // Layout information for Photo size text + TAknLayoutText iPhotoSizeLayout; + + // Layout information for Video size text + TAknLayoutText iVideoSizeLayout; + + // Resource string used to format the time text + HBufC* iTimeFormat; + + // set to ETrue if burst (sequence) mode enabled + TBool iBurstActive; + + // Current orientation + TCamOrientation iCamOrientation; + + // Decorators for various layouts + CCamDecorator* iPhotoPrecapDecorator; + CCamDecorator* iVideoPrecapDecorator; + CCamDecorator* iSequenceInCaptureDecorator; + CCamDecorator* iPhotoPostcapDecorator; + CCamDecorator* iVideoPostcapDecorator; + CCamDecorator* iTimeLapsePostCaptureDecorator; + + // Where the counter should be drawn + TRect iExtent; + + // To help handle the observers + CCamObserverHandler* iObserverHandler; + + TBool iLocationIconVisible; + + // Used to display items in the navi pane + CAknNavigationDecorator* iNaviDec; + CFbsBitmap* iNaviBitmap; + CFbsBitmap* iNaviBitmapMask; + }; + +#endif // CAMNAVICOUNTERMODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamNaviProgressBarControl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamNaviProgressBarControl.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Control for displaying remaining images in navi pane. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#ifndef CAMNAVIPROGRESSBARCONTROL_H +#define CAMNAVIPROGRESSBARCONTROL_H + +// INCLUDES +#include +#include +#include "CamAppController.h" +#include "CamSettings.hrh" +#include "CamResourceLoader.h" +#include "CamNaviProgressBarModel.h" +#include "CamObserver.h" + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Control for displaying recording time info in navi pane. +* @since 2.8 +*/ +class CCamNaviProgressBarControl : public CCoeControl, + public MCamObserver + { + public: // Constructors and destructor + /** + * Static factory construction function + * @since 2.8 + * @param aModel Reference to the progress bar model + * @return pointer to constructed instance of CCamNaviProgressBarControl + */ + static CCamNaviProgressBarControl* NewL( CCamNaviProgressBarModel& aModel ); + + /** + * Destructor. + */ + ~CCamNaviProgressBarControl(); + + public: // New functions + + /** + * Draw Navi-Counter + * @since 3.0 + * @param aGc Handle to graphics context + */ + void DrawProgressBar( CBitmapContext& aGc ) const; + + /** + * Sets whether this control is active. If not, it cannot affect the model, or use it to render. + * @param aActive Whether to set it active or not + */ + void SetActiveL( TBool aActive ); + + public: // From MCamObserver + + /** + * From MCamObserver + * @param aEvent Observed object's event code + */ + void HandleObservedEvent(TCamObserverEvent aEvent); + + protected: + + /** + * C++ constructor. + * @since 2.8 + * @param aModel Reference to the progress bar model + */ + CCamNaviProgressBarControl( CCamNaviProgressBarModel& aModel ); + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + private: // Functions from base classes + + /** + * From CCoeControl + * @since 2.8 + * Set the size and position of its component controls. + */ + void SizeChanged(); + + /** + * From CCoeControl Draw the view + * @since 2.8 + * @param aRect area where to draw + */ + void Draw( const TRect& aRect ) const; + + protected: //data + + CCamNaviProgressBarModel& iModel; + + private: //data + + TBool iActive; + + }; + +#endif // CAMNAVIPROGRESSBARCONTROL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamNaviProgressBarModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamNaviProgressBarModel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,320 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Control for displaying recording progress bar in navi pane. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +*/ + + +#ifndef CAMNAVIPROGRESSBARMODEL_H +#define CAMNAVIPROGRESSBARMODEL_H + +// INCLUDES +#include + +#include +#include +#include "CamAppController.h" +#include "CamSettings.hrh" +#include "CamResourceLoader.h" +#include "CamAppUiBase.h" +#include "CamObservable.h" +#include "CamObserver.h" +#include "mcamcameraobserver.h" + +class CCamObserverHandler; +class CCamTextItem; + +// CONSTANTS +const TInt KMaxRecordTimeTextLength = 40; + +// FORWARD DECLARATIONS +class MAknsSkinInstance; +class CCamDecorator; + +// CLASS DECLARATION + +/** +* Control for displaying recording time info in navi pane. +* @since 2.8 +*/ +class CCamNaviProgressBarModel : public CBase, + public MCamCameraObserver, + public MCamControllerObserver, + public MCamResourceLoader, + public MCamObservable, + public MCamObserver + { + public: // Constructors and destructor + + /** + * Static factory construction function + * @since 2.8 + * @param aController Reference to CCamAppController + * @return pointer to constructed instance of CCamNaviProgressBarModel + */ + static CCamNaviProgressBarModel* NewL( CCamAppController& aController ); + + /** + * Destructor. + */ + virtual ~CCamNaviProgressBarModel(); + + // ------------------------------------------------------- + // From MCamCameraObserver + public: + + virtual void HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData = NULL ); + + // ------------------------------------------------------- + public: + + /** + * Draw Navi-progress bar + * @since 3.0 + * @param aGc Handle to Window graphics context + * @param aControl Pointer to the Control + */ + void DrawProgressBar( CBitmapContext& aGc, const CCoeControl* aControl ) const; + + /** + * Sets a new extent to render into + * @param aExtent New extent + */ + void SetExtentL( const TRect& aExtent ); + + protected: + + /** + * C++ constructor. + * @since 2.8 + * @param aController Reference to CCamAppController + */ + CCamNaviProgressBarModel( CCamAppController& aController ); + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + private: // Functions from base classes + + /** + * From CCoeControl Draw the view + * @since 3.0 + * @param aGc Handle to Window graphics context + * @param aControl Pointer to the control + */ + virtual void DrawProgBar( CBitmapContext& aGc, const CCoeControl* aControl ) const; + + + /** + * From MCamControllerObserver + * Handle an event from CCamAppController. + * @since 2.8 + * @param aEvent the type of event + * @param aError error code + */ + virtual void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + public: // From MCamResourceLoader + + /** + * From MCamResourceLoader + * @since 3.0 + */ + void LoadResourceDataL(); + + /** + * From MCamResourceLoader + * @since 3.0 + */ + void UnloadResourceData(); + + /** + * From MCamResourceLoader + * @since 3.0 + */ + void ReloadResourceDataL(); + + public: // From MCamObservable + + /** + * From MCamObservable + * @param aObserver Observer to register + * @since 3.0 + */ + void RegisterObserverL(MCamObserver* aObserver); + + /** + * From MCamObservable + * @param aObserver Observer to deregister + * @since 3.0 + */ + void DeregisterObserver(MCamObserver* aObserver); + + /** + * From MCamObservable + * @param aEvent Event code to broadcast + * @since 3.0 + */ + void BroadcastEvent(TCamObserverEvent aEvent); + + public: // From MCamObserver + + /** + * From MCamObserver + * @param aEvent The event code + * @since 3.0 + */ + virtual void HandleObservedEvent(TCamObserverEvent aEvent); + + private: // New functions + + /** + * Formats the elapsed/remaining record times + * @since 2.8 + */ + void FormatTimeL(); + + /** + * Draws the elapsed record time to the navi pane + * @since 2.8 + */ + void DrawElapsedTimeText( CBitmapContext& aGc ) const; + + /** + * Draws the remaining record time to the navi pane + * @since 2.8 + */ + void DrawRemainingTimeText( CBitmapContext& aGc, + MAknsSkinInstance* aSkin ) const; + + /** + * Draws the progress bar in the navi pane + */ + void DrawProgressBar( CBitmapContext& aGc ) const; + + /** + * Callback for the minute-minder flash timer + */ + static TInt FlashCallBack( TAny* aAny ); + + /** + * Read nontouch layout for primary camera + */ + void NonTouchLayoutL(); + + /** + * Read nontouch layout for secondary camera + */ + void NonTouchLayoutSecondaryL(); + + /** + * Read touch layout + */ + void TouchLayoutL(); + + protected: //data + + CCamAppController& iController; + + TTimeIntervalMicroSeconds iRecordTimeElapsed; + TTimeIntervalMicroSeconds iRecordTimeRemaining; + + TBuf iElapsedTimeText; + TBuf iRemainingTimeText; + + // Rectangle for drawing the elapsed time text to. + TAknLayoutText iElapsedTimeTextLayout; + TAknLayoutText iRemainingTimeTextLayout; + + // own + CCamTextItem* iElapsedTimeTextItem; + + // own + CCamTextItem* iRemainingTimeTextItem; + + CFbsBitmap* iPhoneIcon; + CFbsBitmap* iPhoneIconMask; + CFbsBitmap* iMMCIcon; + CFbsBitmap* iMMCIconMask; + CFbsBitmap* iMassStorageIcon; + CFbsBitmap* iMassStorageIconMask; + + /** + * Progress bar graphic. + * + * Own. + */ + CFbsBitmap* iProgressBarBitmap; + + /** + * Mask for progress bar graphic. + * + * Own. + */ + CFbsBitmap* iProgressBarMask; + + /** + * Background for progress bar area. + * + * Own. + */ + CFbsBitmap* iProgressBarFrame; + + TCamMediaStorage iStorageLocation; + + // Resource string used to format the time text + HBufC* iTimeFormat; + + TAknLayoutRect iProgressIconRect; + TAknLayoutRect iProgressBarRect; + + // Layout information for the video storage icon. + TAknLayoutRect iVidStorageIconRect; + + TCamOrientation iCamOrientation; + + CCamDecorator* iDecorator; + + // Rect to draw into + TRect iExtent; + + // Handles observers + CCamObserverHandler* iObserverHandler; + + // Timer for the flashing of the elapsed time every minute + CPeriodic* iFlashingTimer; + + // When true, the elapsed time isn't drawn + TBool iFlash; + }; + +#endif // CAMNAVIPROGRESSBARMODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamNewFileService.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamNewFileService.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for file server service. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* --------------------------------------------------------------------------- +* +*/ + + +#ifndef __CAMNEWFILESERVICE_H__ +#define __CAMNEWFILESERVICE_H__ + +// INCLUDES +#include + +// CONSTANTS + +// CLASS DECLARATION + +/** +* An observer class used to notify objects that embedded recording +* was completed +* @since 3.0 +*/ +class MCamEmbeddedObserver + { + + public: // new methods + + /** + * This function is called when application wants to notify + * the observer that embedded image or clip was recorded + * @param aName The name of the file that was recorded + */ + virtual void FileCompleteL( const TDesC& aName ) = 0; + + /** + * This function may be used to inform server to abort transfer. + * If operation already has completed, nothing is done. + */ + virtual void AbortL() = 0; + }; + +/** +* Class for file server service. (embedding) +* @since 3.0 +*/ +class CCamNewFileService: public CNewFileServiceBase, + public MCamEmbeddedObserver + { + + public: + /** + * Constructor. + * @since 3.0 + */ + static CCamNewFileService* NewL(); + + /** + * Destructor. + */ + ~CCamNewFileService(); + + + /* + * Receive message from service to record new files + * @since 3.0 + * @param aObserver service observer + * @param aFileNameArray array for filename + * @param aType service type (image or video) + * @param aMultipleFiles if False only one file possible + */ + void HandleNewFileL( MNewFileServiceObserver* aObserver, + CDesCArray& aFilenameArray, + TNewServiceFileType aType, + TBool aMultipleFiles ); + /* + * Receive message from service to record new files + * @since 3.0 + * @param aObserver service observer + * @param aFile file to record clip + * @param aType service type (image or video) + */ + void HandleNewFileL( MNewFileServiceObserver* aObserver, + RFile& aFile, + TNewServiceFileType aType ); + + /* + * Receive message from service that file service has completed + * and can be closed + * @since 3.0 + */ + void ServiceCompleteL(); + + public: // MCamEmbeddedObserver + + /* + * Receive comand from application that file has been recorded + * @since 3.0 + * @param aName file name and location + */ + void FileCompleteL( const TDesC& aName ); + + /* + * Receive command from application that file service must be aborted + * @since 3.0 + */ + void AbortL(); + + private: // data + MNewFileServiceObserver* iObserver; + CDesCArray* iCamFilenameArray; // renamed from iFilenameArray to avoid Lint warning about + // the same private member name used in the base class + TBool iCompleted; + CActiveSchedulerWait iActiveWait; + + }; + + +#endif // __CAMNEWFILESERVICE_H__ + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamObservable.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamObservable.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Abstract interface for observable classes +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +// INCLUDE FILES +#include "Cam.hrh" + +#ifndef MCAMOBSERVABLE_H +#define MCAMOBSERVABLE_H + +class MCamObserver; + +class MCamObservable + { +public: + /** + * Registers an observer if not previously registered + * @param aObserver The observer concerned + * @since 3.0 + */ + virtual void RegisterObserverL( MCamObserver* aObserver ) = 0; + + /** + * Deregisters an observer if previously registered + * @param aObserver The observer concerned + * @since 3.0 + */ + virtual void DeregisterObserver( MCamObserver* aObserver ) = 0; + + /** + * Broadcasts an event code to all registered observers + * @param aEvent The event code + */ + virtual void BroadcastEvent( TCamObserverEvent aEvent ) = 0; + }; + +#endif // MCAMOBSERVABLE_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamObserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Abstract interface for observer classes +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +// INCLUDE FILES +#include "Cam.hrh" + +#ifndef MCAMOBSERVER_H +#define MCAMOBSERVER_H + +class MCamObserver + { +public: + /** + * Receives event codes from observables + * @param aEvent The event code + * @since 3.0 + */ + virtual void HandleObservedEvent(TCamObserverEvent aEvent) = 0; + }; + +#endif // MCAMOBSERVER_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamObserverHandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamObserverHandler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: observer handler class +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#include +#include "CamObservable.h" + +#ifndef CAMOBSERVERHANDLER_H +#define CAMOBSERVERHANDLER_H + +class CCamObserverHandler : public CBase, public MCamObservable + { +public: + /** + * Static factory construction function + * @since 2.8 + * @return pointer to constructed instance of CCamNaviCounterModel + */ + static CCamObserverHandler* NewL(); + + /** + * Destructor. + */ + ~CCamObserverHandler(); + + +public: + /** + * Registers an observer if not previously registered + * @param aObserver The observer concerned + * @since 3.0 + */ + void RegisterObserverL(MCamObserver* aObserver); + + /** + * Deregisters an observer if previously registered + * @param aObserver The observer concerned + * @since 3.0 + */ + void DeregisterObserver(MCamObserver* aObserver); + + /** + * Broadcasts an event code to all registered observers + * @param aEvent The event code + */ + void BroadcastEvent(TCamObserverEvent aEvent); + +protected: + /** + * C++ Constructor + */ + CCamObserverHandler(); + + /** + * Second-phase constructor + */ + void ConstructL(); + +private: + // Internal list of observers + RPointerArray iObservers; + }; + +#endif // CAMOBSERVERHANDLER_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamPerformance.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamPerformance.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,463 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Macros, event definitions and memory logging class header* +*/ + + +#ifndef CAM_PERFORMANCE_H +#define CAM_PERFORMANCE_H + +// INCLUDES +#include // RDebug +#include // CCoeStatic + +// FORWARD DECLARATIONS +class TLogItem; +class RFileWriteStream; + +// #define CAMERAAPP_PERFORMANCE_MEASUREMENT + +/* +CAMERAAPP PERFORMANCE MEASUREMENT FRAMEWORK + +If the flag CAMERAAPP_PERFORMANCE_MEASUREMENT is defined, the following +macros can be used for logging: + +LEVEL 1 (High level): +PERF_EVENT_START_L1( EVENT ) +PERF_EVENT_END_L1( EVENT ) +PERF_MESSAGE_L1( MESSAGE ) +PERF_ENGINE_STATE_CHANGE( STATE ) +PERF_OPERATION_STATE_CHANGE( STATE ) + +LEVEL 2 (Intermediate level): +PERF_EVENT_START_L2( EVENT ) +PERF_EVENT_END_L2( EVENT ) +PERF_MESSAGE_L2( MESSAGE ) + +LEVEL 3 (Low level): +PERF_EVENT_START_L3( EVENT ) +PERF_EVENT_END_L3( EVENT ) +PERF_MESSAGE_L3( MESSAGE ) +*/ + +#ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT +// Log levels +#define CAMERAAPP_PERF_L1 // High level logging enabled +#define CAMERAAPP_PERF_L2 // Intermediate level logging enabled +#define CAMERAAPP_PERF_L3 // Low level logging enabled + +// Different methods of logging in use +// Memory log data is written to disk when application is closed +#define CAMERAAPP_PERF_LOG_TRACES // Logging to traces enabled +#define CAMERAAPP_PERF_LOG_MEMORY // Logging to memory enabled + +#endif // CAMERAAPP_PERFORMANCE_MEASUREMENT + + +// Log data to traces using event names, instead of numeric event values +// For example: e_123_1 -> e_EEventName_1 +#define CAMERAAPP_PERF_LOG_TRACES_AS_TEXT + +// Log filename for memory logs output +_LIT( KPerfLogFilename, "C:\\CameraPerf.log" ); + +// Perform analysis of event data after memory logging +#define CAMERAAPP_PERF_LOG_ANALYZE_EVENTS +_LIT( KPerfAnalysisFileName, "C:\\CameraPerfAnalysis.log" ); + +// Show warnings about invalid start/end events in event analysis log +#define CAMERAAPP_PERF_ANALYSIS_WARN_END_WITHOUT_START +#define CAMERAAPP_PERF_ANALYSIS_WARN_START_WITHOUT_END +#define CAMERAAPP_PERF_ANALYSIS_WARN_MULTIPLE_START + +// Event definitions +enum TCamEvent + { + EPerfEventAppFirstStartup = 0, + EPerfEventApplicationShutdown, + EPerfEventSwitchToStillMode, + EPerfEventSwitchToVideoMode, + EPerfEventKeyToCapture, + EPerfEventShotToSnapshot, + EPerfEventShotToStillImageReady, + EPerfEventShotToSave, + EPerfEventAutoFocus, + EPerfEventSequenceCapture, + EPerfEventStartVideoRecording, + EPerfEventVideoStopToSave, + EPerfEventBurstCaptureMomentToViewfinderFrame, + EPerfEventAvkonUIConstruction, + EPerfEventCAEConstruction, + EPerfEventCAEInit, + EPerfEventPreCaptureViewConstruction, + EPerfEventActivePaletteConstruction, + EPerfEventPrepareStill, + EPerfEventPostCaptureViewConstruction, + EPerfEventVideoPreCaptureViewActivation, + EPerfEventStillPreCaptureViewDeactivation, + EPerfEventPrepareVideo, + EPerfEventVideoPreCaptureViewDeactivation, + EPerfEventStillPreCaptureViewActivation, + EPerfEventStillPostCaptureViewActivation, + EPerfEventSaveImage, + EPerfEventBurstThumbnailViewActivation, + EPerfEventAppSubsequentStartup, + EPerfEventLastEvent + }; + +// Message definitions +enum TCamMessage + { + EPerfMessageTestMessage = 0, + EPerfMessageStartingViewFinder, + EPerfMessageActivePaletteAnimationStarting, + EPerfMessageStoppingViewFinder, + EPerfMessageBurstSnapshotReady, + EPerfMessageBurstStillimageReady, + EPerfMessageStartingRecord, + EPerfMessagePausingViewFinder, + EPerfMessageCaptureKeyHalfPressed, + EPerfMessageLastMessage + }; + +enum TCamPerformanceState + { + EPerfWaitingForStartup = 0, + EPerfIdle, + EPerfWaitingForStillMode, + EPerfWaitingForVideoMode, + EPerfWaitingForBurstFrame + }; + +// Macros that handle the logging to traces +#ifdef CAMERAAPP_PERF_LOG_TRACES_AS_TEXT + // Log enum arguments with their names, for example: e_EEventApplicationStartup_1 + #define PERF_EVENT_START_TRACE( EVENT ) RDebug::Print( KPerfEventStartText, &(_L( #EVENT )) ); + #define PERF_EVENT_END_TRACE( EVENT ) RDebug::Print( KPerfEventEndText, &(_L( #EVENT )) ); + #define PERF_MESSAGE_TRACE( EVENT ) RDebug::Print( KPerfMessageText, &(_L( #EVENT )) ); + #define PERF_ENGINE_STATE_CHANGE_TRACE( STATE ) RDebug::Print( KPerfEngineStateChange, STATE ); + #define PERF_OPERATION_STATE_CHANGE_TRACE( STATE ) RDebug::Print( KPerfOperationStateChange, STATE ); +#else + // Log enum arguments as their integer values, for example: e_123_1 + #define PERF_EVENT_START_TRACE( EVENT ) RDebug::Print( KPerfEventStart, EVENT ); + #define PERF_EVENT_END_TRACE( EVENT ) RDebug::Print( KPerfEventEnd, EVENT ); + #define PERF_MESSAGE_TRACE( EVENT ) RDebug::Print( KPerfMessage, EVENT ); + #define PERF_ENGINE_STATE_CHANGE_TRACE( STATE ) RDebug::Print( KPerfEngineStateChange, STATE ); + #define PERF_OPERATION_STATE_CHANGE_TRACE( STATE ) RDebug::Print( KPerfOperationStateChange, STATE ); +#endif // CAMERAAPP_PERF_LOG_AS_TEXT + +// Macros that handle logging to memory +#define PERF_EVENT_START_MEMORY( EVENT ) CCamPerformanceLogger::Logger()->EventStart( EVENT ); +#define PERF_EVENT_END_MEMORY( EVENT ) CCamPerformanceLogger::Logger()->EventEnd( EVENT ); +#define PERF_MESSAGE_MEMORY( EVENT ) CCamPerformanceLogger::Logger()->Message( EVENT ); +#define PERF_ENGINE_STATE_CHANGE_MEMORY( STATE ) CCamPerformanceLogger::Logger()->EngineState( STATE ); +#define PERF_OPERATION_STATE_CHANGE_MEMORY( STATE ) CCamPerformanceLogger::Logger()->OperationState( STATE ); + +// High level (L1) logging macro definitions +#ifdef CAMERAAPP_PERF_L1 + + #if defined (CAMERAAPP_PERF_LOG_TRACES) && defined (CAMERAAPP_PERF_LOG_MEMORY) + // Log to traces and memory + #define PERF_EVENT_START_L1( EVENT ) PERF_EVENT_START_TRACE( EVENT ); PERF_EVENT_START_MEMORY( EVENT ); + #define PERF_EVENT_END_L1( EVENT) PERF_EVENT_END_TRACE( EVENT ); PERF_EVENT_END_MEMORY( EVENT ); + #define PERF_MESSAGE_L1( EVENT ) PERF_MESSAGE_TRACE( EVENT ); PERF_MESSAGE_MEMORY( EVENT ); + #define PERF_ENGINE_STATE_CHANGE( STATE ) PERF_ENGINE_STATE_CHANGE_TRACE( STATE ); PERF_ENGINE_STATE_CHANGE_MEMORY( STATE ); + #define PERF_OPERATION_STATE_CHANGE( STATE ) PERF_OPERATION_STATE_CHANGE_TRACE( STATE ); PERF_OPERATION_STATE_CHANGE_MEMORY( STATE ); + + #elif defined (CAMERAAPP_PERF_LOG_TRACES) + // Log only to traces + #define PERF_EVENT_START_L1( EVENT ) PERF_EVENT_START_TRACE( EVENT ); + #define PERF_EVENT_END_L1( EVENT ) PERF_EVENT_END_TRACE( EVENT ); + #define PERF_MESSAGE_L1( EVENT) PERF_MESSAGE_TRACE( EVENT ); + #define PERF_ENGINE_STATE_CHANGE( STATE ) PERF_ENGINE_STATE_CHANGE_TRACE( STATE ); + #define PERF_OPERATION_STATE_CHANGE( STATE ) PERF_OPERATION_STATE_CHANGE_TRACE( STATE ); + + #elif defined (CAMERAAPP_PERF_LOG_MEMORY) + // Log only to memory + #define PERF_EVENT_START_L1( EVENT ) PERF_EVENT_START_MEMORY( EVENT ); + #define PERF_EVENT_END_L1( EVENT ) PERF_EVENT_END_MEMORY( EVENT ); + #define PERF_MESSAGE_L1( EVENT) PERF_MESSAGE_MEMORY( EVENT ); + #define PERF_ENGINE_STATE_CHANGE( STATE ) PERF_ENGINE_STATE_CHANGE_MEMORY( STATE ); + #define PERF_OPERATION_STATE_CHANGE( STATE ) PERF_OPERATION_STATE_CHANGE_MEMORY( STATE ); + + #else + // Logging enabled, but no logging way specified - empty macro implementations + #define PERF_EVENT_START_L1( A ) ; + #define PERF_EVENT_END_L1( A ) ; + #define PERF_MESSAGE_L1( A ) ; + #define PERF_ENGINE_STATE_CHANGE( A ) ; + #define PERF_OPERATION_STATE_CHANGE( A ) ; + #endif + +#else + // L1 logging not enabled - empty macro implementation + #define PERF_EVENT_START_L1( A ) ; + #define PERF_EVENT_END_L1( A ) ; + #define PERF_MESSAGE_L1( A ) ; + #define PERF_ENGINE_STATE_CHANGE( A ) ; + #define PERF_OPERATION_STATE_CHANGE( A ) ; +#endif // CAMERAAPP_PERF_L1 + +// Intermediate level (L2) logging macro definitions +#ifdef CAMERAAPP_PERF_L2 + + #if defined (CAMERAAPP_PERF_LOG_TRACES) && defined (CAMERAAPP_PERF_LOG_MEMORY) + // Log to traces and memory + #define PERF_EVENT_START_L2( EVENT ) PERF_EVENT_START_TRACE( EVENT ); PERF_EVENT_START_MEMORY( EVENT ); + #define PERF_EVENT_END_L2( EVENT) PERF_EVENT_END_TRACE( EVENT ); PERF_EVENT_END_MEMORY( EVENT ); + #define PERF_MESSAGE_L2( EVENT ) PERF_MESSAGE_TRACE( EVENT ); PERF_MESSAGE_MEMORY( EVENT ); + #ifndef PERF_ENGINE_STATE_CHANGE + #define PERF_ENGINE_STATE_CHANGE( STATE ) PERF_ENGINE_STATE_CHANGE_TRACE( STATE ); PERF_ENGINE_STATE_CHANGE_MEMORY( STATE ); + #define PERF_OPERATION_STATE_CHANGE( STATE ) PERF_OPERATION_STATE_CHANGE_TRACE( STATE ); PERF_OPERATION_STATE_CHANGE_MEMORY( STATE ); + #endif + + #elif defined (CAMERAAPP_PERF_LOG_TRACES) + // Log only to traces + #define PERF_EVENT_START_L2( EVENT ) PERF_EVENT_START_TRACE( EVENT ); + #define PERF_EVENT_END_L2( EVENT ) PERF_EVENT_END_TRACE( EVENT ); + #define PERF_MESSAGE_L2( EVENT) PERF_MESSAGE_TRACE( EVENT ); + #ifndef PERF_ENGINE_STATE_CHANGE + #define PERF_ENGINE_STATE_CHANGE( STATE ) PERF_ENGINE_STATE_CHANGE_TRACE( STATE ); + #define PERF_OPERATION_STATE_CHANGE( STATE ) PERF_OPERATION_STATE_CHANGE_TRACE( STATE ); + #endif + + #elif defined (CAMERAAPP_PERF_LOG_MEMORY) + // Log only to memory + #define PERF_EVENT_START_L2( EVENT ) PERF_EVENT_START_MEMORY( EVENT ); + #define PERF_EVENT_END_L2( EVENT ) PERF_EVENT_END_MEMORY( EVENT ); + #define PERF_MESSAGE_L2( EVENT) PERF_MESSAGE_MEMORY( EVENT ); + #ifndef PERF_ENGINE_STATE_CHANGE + #define PERF_ENGINE_STATE_CHANGE( STATE ) PERF_ENGINE_STATE_CHANGE_MEMORY( STATE ); + #define PERF_OPERATION_STATE_CHANGE( STATE ) PERF_OPERATION_STATE_CHANGE_MEMORY( STATE ); + #endif + + #else + // Logging enabled, but no logging way specified - empty macro implementations + #define PERF_EVENT_START_L2( A ) ; + #define PERF_EVENT_END_L2( A ) ; + #define PERF_MESSAGE_L2( A ) ; + #ifndef PERF_ENGINE_STATE_CHANGE + #define PERF_ENGINE_STATE_CHANGE( A ) ; + #define PERF_OPERATION_STATE_CHANGE( A ) ; + #endif + #endif + +#else + // L2 logging not enabled - empty macro implementation + #define PERF_EVENT_START_L2( A ) ; + #define PERF_EVENT_END_L2( A ) ; + #define PERF_MESSAGE_L2( A ) ; + #ifndef PERF_ENGINE_STATE_CHANGE + #define PERF_ENGINE_STATE_CHANGE( A ) ; + #define PERF_OPERATION_STATE_CHANGE( A ) ; + #endif +#endif // CAMERAAPP_PERF_L2 + +// Low level (L3) logging macro definitions +#ifdef CAMERAAPP_PERF_L3 + + #if defined (CAMERAAPP_PERF_LOG_TRACES) && defined (CAMERAAPP_PERF_LOG_MEMORY) + // Log to traces and memory + #define PERF_EVENT_START_L3( EVENT ) PERF_EVENT_START_TRACE( EVENT ); PERF_EVENT_START_MEMORY( EVENT ); + #define PERF_EVENT_END_L3( EVENT) PERF_EVENT_END_TRACE( EVENT ); PERF_EVENT_END_MEMORY( EVENT ); + #define PERF_MESSAGE_L3( EVENT ) PERF_MESSAGE_TRACE( EVENT ); PERF_MESSAGE_MEMORY( EVENT ); + #ifndef PERF_ENGINE_STATE_CHANGE + #define PERF_ENGINE_STATE_CHANGE( STATE ) PERF_ENGINE_STATE_CHANGE_TRACE( STATE ); PERF_ENGINE_STATE_CHANGE_MEMORY( STATE ); + #define PERF_OPERATION_STATE_CHANGE( STATE ) PERF_OPERATION_STATE_CHANGE_TRACE( STATE ); PERF_OPERATION_STATE_CHANGE_MEMORY( STATE ); + #endif + + #elif defined (CAMERAAPP_PERF_LOG_TRACES) + // Log only to traces + #define PERF_EVENT_START_L3( EVENT ) PERF_EVENT_START_TRACE( EVENT ); + #define PERF_EVENT_END_L3( EVENT ) PERF_EVENT_END_TRACE( EVENT ); + #define PERF_MESSAGE_L3( EVENT) PERF_MESSAGE_TRACE( EVENT ); + #ifndef PERF_ENGINE_STATE_CHANGE + #define PERF_ENGINE_STATE_CHANGE( STATE ) PERF_ENGINE_STATE_CHANGE_TRACE( STATE ); + #define PERF_OPERATION_STATE_CHANGE( STATE ) PERF_OPERATION_STATE_CHANGE_TRACE( STATE ); + #endif + + #elif defined (CAMERAAPP_PERF_LOG_MEMORY) + // Log only to memory + #define PERF_EVENT_START_L3( EVENT ) PERF_EVENT_START_MEMORY( EVENT ); + #define PERF_EVENT_END_L3( EVENT ) PERF_EVENT_END_MEMORY( EVENT ); + #define PERF_MESSAGE_L3( EVENT) PERF_MESSAGE_MEMORY( EVENT ); + #ifndef PERF_ENGINE_STATE_CHANGE + #define PERF_ENGINE_STATE_CHANGE( STATE ) PERF_ENGINE_STATE_CHANGE_MEMORY( STATE ); + #define PERF_OPERATION_STATE_CHANGE( STATE ) PERF_OPERATION_STATE_CHANGE_MEMORY( STATE ); + #endif + + #else + // Logging enabled, but no logging way specified - empty macro implementations + #define PERF_EVENT_START_L3( A ) ; + #define PERF_EVENT_END_L3( A ) ; + #define PERF_MESSAGE_L3( A ) ; + #ifndef PERF_ENGINE_STATE_CHANGE + #define PERF_ENGINE_STATE_CHANGE( A ) ; + #define PERF_OPERATION_STATE_CHANGE( A ) ; + #endif + + #endif + +#else + // L3 logging not enabled - empty macro implementation + #define PERF_EVENT_START_L3( A ) ; + #define PERF_EVENT_END_L3( A ) ; + #define PERF_MESSAGE_L3( A ) ; + #ifndef PERF_ENGINE_STATE_CHANGE + #define PERF_ENGINE_STATE_CHANGE( A ) ; + #define PERF_OPERATION_STATE_CHANGE( A ) ; + #endif +#endif // CAMERAAPP_PERF_L3 + +#ifdef CAMERAAPP_PERF_LOG_MEMORY + +/** +* Handles memory logging of events, messages and state changes, performing +* simple event analysis and writing the resulting log files to disk. +* +* @since 2.8 +*/ +class CCamPerformanceLogger: public CCoeStatic + { + public: + + /** + * Static function, which returns a pointer to the currently + * active CCamPerformanceLogger object or instantiates a new one + * @since 2.8 + * @return pointer to CCamPerformanceLogger object + */ + static CCamPerformanceLogger* Logger(); + + /** + * Static function, which saves the currently recorded log + * data and clears the log. + * @since 2.8 + */ + static void SaveAndReset(); + + /** + * Destructor. + * @since 2.8 + */ + ~CCamPerformanceLogger(); + + /** + * Appends an event start item to the memory log + * @since 2.8 + * @param aEvent Event type + */ + void EventStart( TCamEvent aEvent ); + + /** + * Appends an event end item to the memory log + * @since 2.8 + * @param aEvent Event type + */ + void EventEnd( TCamEvent aEvent ); + + /** + * Appends a message to the memory log + * @since 2.8 + * @param aMessage Message type + */ + void Message( TCamMessage aMessage ); + + /** + * Appends a state change to the memory log + * @since 2.8 + * @param aState New state + */ + void EngineState( TInt aState ); + + /** + * Appends a state change to the memory log + * @since 2.8 + * @param aState New state + */ + void OperationState( TInt aState ); + + /** + * Saves all data from memory log to file KPerfLogFilename + * @since 2.8 + */ + void SaveLogDataL() const; + + /** + * Performs simple analysis to event data from memory log and writes + * the result to file KPerfAnalysisFilename + * @since 2.8 + */ + void SaveAnalysisL() const; + + private: + /** + * Converts log item data into LogicAnalyzer compatible string, and stores the result in aDes + * @param aItem Log item + * @param aDes Descriptor + * @since 2.8 + */ + static void LogItemToDes( const TLogItem& aItem, TDes& aDes ); + + /** + * Appends time represented by aTime to aDes with format seconds.milliseconds + * @param aDes Destination descriptor + * @param aTime Time in system 64-bit format + * @param aSpace Reserve 6 characters for seconds field + * @since 2.8 + */ + static void AppendTime( TDes& aDes, TInt64 aTime, TBool aSpace=EFalse ); + + /** + * Writes the contents of descriptor aDes followed by '\n' to aStream + * @param aStream RFileWriteStream + * @param aDes Descriptor + * @since 2.8 + */ + static void WriteLineL( RFileWriteStream& aStream, TDes& aDes ); + + /** + * Returns system 64-bit representation of the current time + * @since 2.8 + * @return Time + */ + static TInt64 Time64(); + + private: + CCamPerformanceLogger(); + TInt64 iStartTime; + RArray iLogItems; + }; +#endif // CAMERAAPP_PERF_LOG_MEMORY + +// Log item formatting literals +_LIT( KPerfEventStart, "e_%d_1" ); +//_LIT( KPerfEventStartText, "e_%S_1" ); +_LIT( KPerfEventStartText, "e_%S 1" ); +_LIT( KPerfEventEnd, "e_%d_0" ); +//_LIT( KPerfEventEndText, "e_%S_0" ); +_LIT( KPerfEventEndText, "e_%S 0" ); +_LIT( KPerfMessage, "m_%d" ); +//_LIT( KPerfMessageText, "m_%S" ); +_LIT( KPerfMessageText, "m_%S;CamMsg;CamMsg" ); +//_LIT( KPerfEngineStateChange, "sm_CamEngine_%d" ); +_LIT( KPerfEngineStateChange, "sm_CamEngine;%d" ); +_LIT( KPerfEngineStateChangeText, "sm_CamEngine_%S" ); +//_LIT( KPerfOperationStateChange, "sm_CamOperation_%d" ); +_LIT( KPerfOperationStateChange, "sm_CamOperation;%d" ); +_LIT( KPerfOperationStateChangeText, "sm_CamOperation_%S" ); +_LIT( KPerfUnknown, "unknown_%d" ); + +#endif // CAM_PERFORMANCE_H \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamPostCaptureContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamPostCaptureContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,184 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for still Post capture view +* +*/ + + + +#ifndef CAMPOSTCAPTURECONTAINER_H +#define CAMPOSTCAPTURECONTAINER_H + +// INCLUDES +#include "CamContainerBase.h" +#include "CamControllerObservers.h" + +#include "cambatterypanecontroller.h" + +// FORWARD DECLARATIONS +class CCamAppController; +class CAknView; + +// CLASS DECLARATION + +/** +* Container for still image Post capture view +*/ +class CCamPostCaptureContainer : public CCamContainerBase, + public MCamControllerObserver, + public MCamBatteryPaneObserver + { + public: + + enum TCamPostCaptureSubControls + { + ECamPostCaptureSubControlNaviPane, + ECamPostCaptureActivePalette + }; + + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aController reference to CCamAppControllerBase instance + * @param aView reference to the view containing this container + * @param aRect Frame rectangle for container. + */ + static CCamPostCaptureContainer* NewL( CCamAppController& aController, + CAknView& aView, + const TRect& aRect ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamPostCaptureContainer(); + + private: + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppControllerBase instance + * @param aView reference to the view containing this container + */ + CCamPostCaptureContainer( CCamAppController& aController, + CAknView& aView ); + + public: // Functions from base classes + /** + * From CamContainerBase + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * Will show the zoom pane for a set time + * Only implemented by pre capture containers + * @since 2.8 + */ + void ShowZoomPaneWithTimer(); + + /** + * We check for the file name whenever we call the UMP + * or Properties view and come back. + */ + void CheckForFileName( TBool aDoCheck ); + + /** + * Requests that the camera application redraws the supplied area + * @since 3.0 + * @param aArea the area to redraw + */ + virtual void Redraw(const TRect& aArea); + + /** + * From CCamContainerBase / CCoeControl + * Locally takes actions needed due to resource changes, then + * calls the implementation in CCamContainerBase + * @since 2.8 + * @param aType resource change + */ + virtual void HandleResourceChange( TInt aType ); + + /** + * Handle application level event. + * For example focus gained and lost are notified through this method. + * @param aEvent Event type + */ + virtual void HandleAppEvent( const TCamAppEvent& aEvent ); + + /** + * From MCamBatteryPaneObserver + * Called when battery pane has changed and redraw is needed + * @since 3.1 + */ + void BatteryPaneUpdated(); + + protected: // Functions from base classes + /** + * From CoeControl + * @since 2.8 + * @return number of contained controls + */ + TInt CountComponentControls() const; + + /** + * From CoeControl + * @since 2.8 + * @return number of contained controls + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl + * @since 2.8 + * @param aRect area where to draw + */ + void Draw( const TRect& aRect ) const; + + + /** + * From MCamControllerObserver + * @since 2.8 + * @param aEvent The enumerated code for the event received + * @param aError The error code associated with the event + */ + void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + private: // Data + // The full screen dimensions + TSize iScreenSize; + + CCamBatteryPaneController* iBatteryPaneController; + TBool iCheckForFileNameChange; + + TBool iUpdatingBatteryPane; //Needed for drawing black background behind battery pane in Video mode + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamPostCaptureViewBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamPostCaptureViewBase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,267 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for Post capture views* +*/ + + +#ifndef CAMPOSTCAPTUREVIEWBASE_H +#define CAMPOSTCAPTUREVIEWBASE_H + +// INCLUDES + +#include "CamViewBase.h" +#include "MCamAddToAlbumObserver.h" +#include "CamControllerObservers.h" +#include "AiwServiceHandler.h" // for CAiwServiceHandler +#include +#include + + +// FORWARD DECLARATIONS +class CSendUi; +class CCamOneClickUploadUtility; + +#ifndef __WINS__ +class CSFIUtilsAppInterface; +#endif // !defined(__WINS__) +// CLASS DECLARATION + +class CCamCollectionManagerAO; +class MCamAddToAlbumObserver; + +/** +* Base class for post capture views +* +* @since 2.8 +*/ +class CCamPostCaptureViewBase : public CCamViewBase, + public MCamControllerObserver, + public MAknToolbarObserver + ,public MCamAddToAlbumObserver + { + public: // Constructors and destructor + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamPostCaptureViewBase(); + + public: // Functions from base classes + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * From MCamControllerObserver + * @since 2.8 + * @param aEvent The enumerated code for the event received + * @param aError The error code associated with the event + */ + void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + /** + * From CAknView Handles the foreground/background event + * @since 2.8 + * @param aForeground ETrue if this view is on foreground, else EFalse. + */ + void HandleForegroundEventL( TBool aForeground ); + + /** + * From CAknView. + * @since 2.8 + * @param aPrevViewId the ID for previous view we are switching from + * @param aCustomMessageId the Uid for message passed to this view + * @param aCustomMessage descriptor containing data content for view specific message + */ + void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * From CAknView. + * @since 2.8 + */ + void DoDeactivate(); + + /** + * From MEikMenuObserver Changes MenuPane dynamically + * @param aResourceId Resource Id + * @param aMenuPane Handle to menu pane + * @since 2.8 + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + + public: // From MCamAddToAlbumObserver + /* + * From MCamAddToAlbumObserver + * Notification once the aysnchronous operations using + * CollectionManager interface are done completly + * Status of the operation are returned using aStatus + * e.g. KErrNone + */ + void AddToAlbumIdOperationComplete(); + + /** + * From MCamAddToAlbumObserver + * Notification once the asynchronous operations using + * CollectionManager interface have completed. + * + * @param aAlbumExists ETrue if album exists + * @param aAlbumTitle Title of the album + */ + void CheckAlbumIdOperationCompleteL( + TBool /*aAlbumExists*/, const TDesC& /*aAlbumTitle*/ ) {} + + public: // From MCamFileHarvestingObserver + /** + * From MCamFileHarvestingObserver + * Notification once the aysnchronous operations using + * harverter client interface are done completly + * the file that is being harvested is sent as paramerter + */ + void HandleHarvestingComplete( const TDesC& aUri ); + + + public: // New functions + + /** + * Displays the delete image/video confirmation note + * @since 2.8 + * @return EFalse if the user cancels the deletion, otherwise ETrue + */ + virtual TBool DisplayDeleteNoteL() = 0; + + /** + * Update fixed toolbar icons according to current call state + * @since 5.0 + */ + void UpdateToolbarIconsL(); + + protected: // New functions + + /** + * C++ default constructor. + * @since 2.8 + * @param aController Reference to either the application controller + * base class or test base class + */ + CCamPostCaptureViewBase( CCamAppController& aController ); + + /** + * Symbian 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + + private: // Functions from base classes + + /** + * From CCamViewBase + * Create the container associated with this view. + * @since 2.8 + */ + void CreateContainerL(); + + private: + /* + * Create Active Palette once the image/video is saved. + */ + void UpdateActivePaletteItemsL(); + + protected: + /* + * Create message of specified by + * @param aCommand represents desired message type (eamil, MMS, BT ) + * @since 2.8 + */ + virtual void DoSendAsL() const; + +#ifndef __WINSCW__ + /** + * Send file to current caller using SFI functionality + * @since 2.8 + */ + virtual void DoInCallSendL() const; +#endif //!WINSCW + + /** + * Returns whether the view is a postcapture view or not + * @since 3.0 + * @returns ETrue + */ + virtual TBool IsPostCapture(); + + /** + * Hides or shows the 'Send' and 'SendAs' items in the active toolbar + * @since 3.0 + * @param aApHandler handler for the active toolbar + */ + void ResetSendAvailabilityL( CCamActivePaletteHandler* aApHandler ); + +// from base class MAknToolbarObserver + + void OfferToolbarEventL( TInt aCommand ); + + protected: + + CSendUi* iSendAppUi; + TSendingCapabilities iSendingCapabilities; + +#ifndef __WINS__ + CSFIUtilsAppInterface* iSFIUtils; +#endif + CArrayFixFlat* iSendMtmsToDim; + + // set to EFalse when still image save completes + TBool iWaitForImageSave; + + // AIW handler for dynamic menu options. + CAiwServiceHandler* iAiwServiceHandler; + + // Utility for handling one-click upload operations. + // Own. + CCamOneClickUploadUtility* iOneClickUploadUtility; + + private: // New Methods + /** + * Complete add to album request + * @since 3.1 + */ + void StartAddToAlbumOperationL(); + + /* + * Shows the radiobutton setting page to + * actually proceed with add to album operation + */ + TInt ShowAddToAlbumConfirmationQueryL(); + + private: + CCamCollectionManagerAO* iCollectionManagerCallBack; + TBool iAddToAlbumRequestOngoing; + TBool iPreviousViewStillPreCapture; + // suppress postcapture AP until camera ready + TBool iSuppressAPUntilCameraReady; + TBool iPartialBackground; + }; + +#endif // CAMPOSTCAPTUREVIEWBASE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamPreCaptureContainerBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamPreCaptureContainerBase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,716 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container base class pre capture views +* +*/ + + + +#ifndef CAMPRECAPTURECONTAINERBASE_H +#define CAMPRECAPTURECONTAINERBASE_H + +// =========================================================================== +// INCLUDES +#include "CamAppController.h" +#include "CamContainerBase.h" +#include "CamControllerObservers.h" +#include "CamBurstModeObserver.h" +#include "CamZoomPane.h" +#include "CamPSI.h" // Product Specific Information +#include "cambatterypanecontroller.h" +#include "mcamcameraobserver.h" // MCamCameraObserver + +#include "CamLocationIconController.h" + + +// =========================================================================== +// FORWARD DECLARATIONS +class CWindowGC; +class CAknView; + +class CCamViewBase; +class CCamSidePane; +class CCamZoomPane; +class CCamIndicator; +class CCamTimeLapseSlider; +class MCamVfGridDrawer; + + + +// =========================================================================== +// CLASS DECLARATION + +/** +* Container for still image pre capture view +*/ +class CCamPreCaptureContainerBase : public CCamContainerBase, + public MCamControllerObserver, + public MCamCameraObserver, + public MCamSettingsModelObserver, // +// public MCamViewFinderObserver, + + public MCamBurstModeObserver, + public MCamBatteryPaneObserver, + public MCamLocationIconObserver + + { + // ========================================================================= + // Typenames + public: + + // enum TVfState moved to CCamContainerBase. Used in multiple child classes. + + enum TCamPreCaptureSubControls + { + // ECamTimeLapseControl + ECamActivePalette + }; + + enum TFocusState + { + EFocusStateNormal, + EFocusStateFocusing, + EFocusStateFocusFailed, + EFocusStateFocusAchieved + }; + + // ========================================================================= + // Public constructors and destructor + public: + + /** + * Destructor. + */ + virtual ~CCamPreCaptureContainerBase(); + + // ------------------------------------------------------------------------- + // From CoeControl + public: + + /** + * @since 2.8 + * @return number of contained controls + */ + virtual TInt CountComponentControls() const; + + /** + * @since 2.8 + * @param aIndex The index of the control required + * @return The requested control + */ + virtual CCoeControl* ComponentControl(TInt aIndex) const; + + /** + * Locally takes actions needed due to resource changes, then + * calls the implementation in CCamContainerBase + * @since 2.8 + * @param aType resource change + */ + virtual void HandleResourceChange( TInt aType ); + + + /** + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + + /** + * Handle events sending app to foreground or background + * @since 2.8 + * @param aForeground whether the event brings the app to fore or background + */ + virtual void HandleForegroundEventL( TBool aForeground ); + + /** + * Handle application level event. + * For example focus gained and lost are notified through this method. + * @param aEvent Event type + */ + virtual void HandleAppEvent( const TCamAppEvent& aEvent ); + + /** + * @since 2.8 + * @param aVisible ETrue if the controls should be visible + */ + virtual void MakeVisible( TBool aVisible ); + + /** + * From CCoeControl + * Handle pointer events. + * @since S60 5.0 + * @param aPointerEvent information about the pointerevent + */ + void HandlePointerEventL(const TPointerEvent& aPointerEvent); + + protected: + + /** + * @since 2.8 + * @param aRect area where to draw + */ + virtual void Draw( const TRect& aRect ) const; + + // ------------------------------------------------------------------------- + // From MCamControllerObserver + public: + + /** + * @since 2.8 + * @param aEvent The specific event which occurred + * @param aError The error code associated with the event + */ + virtual void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + // + // ------------------------------------------------------------------------- + // From MCamCameraObserver + public: + + /** + * @since Camera 4.0 + * @see MCamCameraObserver + */ + virtual void HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData = NULL ); + + // ------------------------------------------------------------------------- + // From MCamSettingsModelObserver + public: + + /** + * Notification for change in integer setting item value. + * + */ + virtual void IntSettingChangedL( TCamSettingItemIds aSettingItem, + TInt aSettingValue ); + + /** + * Notification for change in text setting item value. + * + */ + virtual void TextSettingChangedL( TCamSettingItemIds aSettingItem, + const TDesC& aSettingValue ); + + + // + // ------------------------------------------------------------------------- + // From MCamBatteryPaneObserver + public: + /** + * Called when battery pane has changed and redraw is needed + * @since 3.1 + */ + void BatteryPaneUpdated(); + + + // ------------------------------------------------------------------------- + // From MCamLocationIconObserver + public: + /** + * Called when location icon status is changed + * @since 3.1 + */ + void LocationIconUpdated(); + + // ------------------------------------------------------------------------- + public: + + /** + * Requests that the camera application redraws the supplied area + * @since 3.0 + * @param aArea the area to redraw + */ + virtual void Redraw(const TRect& aArea); + + public: // New functions + + /** + * Handles CBA and Options menu keys + * @since 3.0 + * @param aCommand The command to handle + */ + void HandleCommand( TInt aCommand ); + + /** + * Will show the zoom pane for a set time + * @since 2.8 + */ + void ShowZoomPaneWithTimer(); + + /** + * Constructs Active Palette if not done yet. + * If Active Palette already exists, clears any existing items. + * Sets new items based on resource from GetAPResourceId. + * Registers the view for Active Palette. + */ + virtual void SetupActivePaletteL( CCamViewBase* aView ); + + protected: + + /** + * Callback for zoom timer when zoom pane needs to be hidden. + * @since 2.8 + * @param aObject - Pointer to instance of CCamPreCaptureContainerBase + * @return KErrNone + */ + static TInt ZoomTimerCallback( TAny* aObject ); + + /** + * Callback for reticule timer, + * @since 3.0 + * @param aObject - Pointer to instance of CCamPreCaptureContainerBase + * @return KErrNone + */ + static TInt ReticuleTimerCallback( TAny* aObject ); + + /** + * Member function called when zoom timer expires. + * @since 2.8 + */ + void ZoomTimerTick(); + + /** + * Allows derived classes to draw mode-specific icons + * @param aGc The context to draw with + * @since 3.0 + */ + virtual void DrawAdditionalIcons(CBitmapContext& aGc) const = 0; + + /** + * Returns the rect of the resolution indicator + * @return The rect of the resolution icon as a TRect + * @since 3.0 + */ + TRect ResolutionIndicatorRect() const; + + /** + * Returns the ID of the array containing the resolution indicator icons + * @return The array ID + * @since 3.0 + */ + virtual TCamPsiKey ResolutionIndicatorIconPsiKey() const = 0; + + protected: + + /** + * Draw viewfinder grid. + * Delegates call to iVfGridDrawer. + * Does not draw anything if grid has not been set visible. + * @param aGc The graphics context + */ + virtual void DrawVfGrid( CBitmapContext& aGc ) const; + + /** + * Redraw part of viewfinder grid. + * Delegates call to iVfGridDrawer. + * Does not draw anything if grid has not been set visible. + * @param aRect The area to redraw + * @param aGc The graphics context + */ + virtual void ReDrawVfGrid( const TRect& aRect, + CBitmapContext& aGc ) const; + + /** + * Init the viewfinder grid. + * Creates the grid drawer if not done yet. + * Set drawing rectangle and visibility. + */ + virtual void InitVfGridL( const TRect& aRect ) = 0; + + /** + * Get the current setting for viewfinder grid visibility. + */ + virtual TBool GetVFGridVisibilitySetting() const; + + /** + * Reset the viewfinder grid drawer visibility property with + * value asked from controller. + */ + virtual void ResetVFGridVisibility(); + + protected: + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + */ + void BaseConstructL( const TRect& aRect ); + + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppController instance + * @param aView reference to the view containing this container + */ + CCamPreCaptureContainerBase( CCamAppController& aController, + CAknView& aView ); + + private: // New Functions + + /** + * Performs the actual BitBlt of the viewfinder frame + * @since 2.8 + * @param aGc the graphics context + * @param aFrame pointer to the bitmap. + */ + void DrawFrameNow( CBitmapContext& aGc, const CFbsBitmap* aFrame ) const; + + protected: + /** + * Autofocus indication layout from LAF + * + * @since S60 S60 v5.0 + */ + void SizeChanged(); + + private: + /** + * Draws the reticule over the viewfinder + * @since 3.0 + * @param aGc the graphics context + */ + void DrawReticule( CBitmapContext& aGc ) const; + + /** + * Draw part of the reticule. + * Used to redraw areas left dirty by hiding AP tooltips. + * @param aRect The area to redraw + * @param aGc The graphics context + */ + void ReDrawReticule( const TRect& aRect, + CBitmapContext& aGc ) const; + + /** + * Force the side-pane or zoom-pane to redraw. Called when they + * are required to be overlaid on the viewfinder. + * @since 2.8 + */ + void ForceSideZoomPaneDraw() const; + + /** + * Return the id of the layout resource for the viewfinder frame + * @since 2.8 + * @param aViewFinderLayoutId on return this contains the resource id + * of the viewfinder layout + * @param aReticuleLayoutId on return this contains the resource id + * of the reticule layout if used, otherwise 0 + */ + virtual void ViewFinderLayoutResourceIds( TInt& aViewFinderLayoutId, + TInt& aReticuleLayoutId ) const = 0; + + /** + * Create the resolution indicator + * @since 2.8 + */ + void CreateResolutionIndicatorL(); + + /** + * Sets the resolution indicator to the required icon + * @since 2.8 + */ + virtual void SetResolutionIndicator() = 0; + + /** + * Sets the location indicator icon if the setting is enabled + */ + virtual void SetLocationIndicatorVisibility() = 0; + + /** + * Burst mode activation has changed + * @since 2.8 + * @param aActive whether or not burst mode is active + * @param aStillModeActive whether or not still capture is active + */ + void BurstModeActiveL( TBool aActive, TBool aStillModeActive ); + + /** + * Process a key event that should change the current capture state + * E.g. start/pause recording, start/stop capture + * @since 3.0 + * @param aKeyEvent the key press that initiates the capture + * @return whether or not the key was consumed + */ + virtual TKeyResponse HandleCaptureKeyEventL( const TKeyEvent& aKeyEvent ) = 0; + + /** + * Process a key event that could change the current capture state + * E.g. start autofocus, revert from post-capture to pre-capture views + * @since 3.0 + * @param aKeyEvent the key press that initiates the capture + * @param aType the event code type + * @return whether or not the key was consumed + */ + virtual TKeyResponse HandleShutterKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) = 0; + + /** + * Move up through the flash settings + * @since 3.0 + */ + virtual void IncreaseFlashSettingL(); + + /** + * Move down through the flash settings + * @since 3.0 + */ + virtual void DecreaseFlashSettingL(); + + /** + * Initiate behaviour in response to a navi key left/right arrow + * press + * @since 3.0 + * @param aKeyEvent the key that has been pressed + * @param aType the Key type + * @return whether or not the key was consumed + */ + TKeyResponse HandleLeftRightNaviKeyL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + /** + * Draw side or zoom pane, softkeys and reticule + * @since 3.0 + * @param aGc context to draw into + */ + void DrawScreenFurniture( CBitmapContext& aGc ) const; + + /** + * Draw navi pane items + * @since 3.0 + * @param aGc context to draw into + */ + void DrawNaviControls( CBitmapContext& aGc ) const; + + /** + * Draw active palette + * @since 3.1 + */ + void DrawActivePalette() const; + + /** + * Draw active pallette + * @since 3.1 + * @param aGc context to draw into + */ + void DrawActivePalette( CBitmapContext& aGc ) const; + + /** + * Sets the iTimeLapseVisible flag + * @param aActive What to set iTimeLapseVisible to + */ + void SetTimeLapseVisible(TBool aActive); + + void HandleOperationStateChangeEventL(); + + /** + * Gets the resource id of AP items. + * Needs to be implemented in inheriting classes. + */ + virtual TInt GetAPResourceId() const = 0; + + /** + * Draws Screen content to graphics context + * @param aGc The context to draw with + * @param aFrame View Finder Frame to be drawn + */ + void DrawToContext(CBitmapContext& aGc, const CFbsBitmap* aFrame); + + /** + * Creates a colored Autofocus indication icon + * + * @since S60 S60 v5.0 + * @param aColor indication color + * @return TInt Created icon's offset in icons array + */ + TInt CreateAfIconL( TRgb aColor ); + + /** + * Creates a colored autofocus indication icon corner + * + * @since S60 S60 v5.0 + * @param aColor indication color + * @param aFileBitmapId ID of the bitmap in the file + */ + void CreateAfCornerL( TRgb aColor, TInt aFileBitmapId ); + + /** + * Sets size of autofocus indication icon + * + * @since S60 S60 v5.0 + * @param aOffset Offset in colored corner icon array + */ + void SetAfIconSize( TInt aOffset ); + + /** + * Draws corners of autofocus indication icon + * + * @since S60 S60 v5.0 + * @param aGc Bitmap graphics context + * @param aOffset Offset in colored corner icon array + */ + void DrawAf( CBitmapContext& aGc, TInt aOffset ) const; + + /** + * Read nontouch layout + */ + void NonTouchLayout(); + + /** + * Read touch layout + */ + void TouchLayout(); + + + // ========================================================================= + // Data + protected: + + // Pointer to the instance of the side pane + CCamSidePane* iSidePane; + + // Pointer to the instance of the zoom pane + CCamZoomPane* iZoomPane; + + // Array of pointer to the resolution indicators + RPointerArray iResolutionIndicators; + + // The current indicator + TInt iCurrentIndicator; + + // The visibility of the location indicator + TBool iLocationIndicatorVisible; + CCamLocationIconController* iLocationIconController; + + // Is reticule to be displayed or not (for when flashing) + TBool iShowReticule; + + // Whether the current Photo Scene requires a reticule (some scenes do not focus) + TBool iPhotoSceneUsesReticule; + + TBool iNaviPaneActive; + + // If set, redraw calls are ignored. + TBool iDisableRedraws; + + // Viewfinder rect. + TRect iRect; + + // Timer used to remove zoom pane after a short delay + CPeriodic* iZoomTimer; + + // Keys to use for detecting zoom in and out key events + TInt iZoomInKey; + TInt iZoomOutKey; + + // whether we are left or right handed + TCamHandedness iHandedness; + + + // Reticule location and size + TRect iReticuleRect; + + /** + * Autofocus indication icons array. + */ + RPointerArray iAfIcons; + + /** + * Autofocus indication: White ready icon. + */ + TInt iAfReadyIcon; + + /** + * Autofocus indication: Green focused icon. + */ + TInt iAfFocusIcon; + + /** + * Autofocus indication: Yellow error icon. + */ + TInt iAfErrIcon; + + /** + * Autofocus indication icons layout + */ + RArray iLayouts; + + /** + * Autofocus layout + */ + TSize iAfIconCornerSize; + + // Timer used for the flashing of the reticule + CPeriodic* iReticuleTimer; + + // Whether the reticule is visible or not during 'flash' on/off + TBool iReticuleFlashOn; + + // Current state of focus (reflected by reticule) + TFocusState iFocusState; + + // Determines if a stored image should be used in Draw() functions + TBool iFreezeFrame; + + // Determine from PSI if side & zoom pane are overlaid on VF + TBool iOverlayViewFinder; + + // width of the zoom pane + TInt iZoomPaneWidth; + + // The Time Lapse control + CCamTimeLapseSlider* iTimeLapseSlider; + + // Whether the Time Lapse control is visible + TBool iTimeLapseVisible; + + // Layout rect for the Timelapse control + TAknLayoutRect iTimeLapseLayout; + + // Determines if the zoom pane background needs redrawing + TBool iRedrawPaneBackground; + + // Determines if the viewfinder should use an off screen bitmap + TBool iUseOffScreenBitmap; + + // Offscreen drawing members + CFbsBitmap* iOffScreenBitmap; + CFbsBitGc* iBitmapGc; + CFbsBitmapDevice* iBitmapDevice; + + // True if this container has received any viewfinder frames + TBool iReceivedVfFrame; + + // True if application is shutting down + TBool iShuttingDown; + + TRect iVFRect; + + TRect iVfGridRect; + MCamVfGridDrawer* iVfGridDrawer; + + CCamBatteryPaneController* iBatteryPaneController; + + CFbsBitmap* iViewFinderBackup; + // ========================================================================= + }; + +#endif // CAMPRECAPTURECONTAINERBASE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamPreCaptureViewBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamPreCaptureViewBase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,402 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for pre-capture views* +*/ + + +#ifndef CAMPRECAPTUREVIEWBASE_H +#define CAMPRECAPTUREVIEWBASE_H + +#include + +#include "CamCaptureSetupViewBase.h" + +#include "CamControllerObservers.h" +#include "CamAppController.h" + +// FORWARD DECLARATION +class CCamCaptureSetupMenu; +class CCamStandbyContainer; +class MAknsSkinInstance; +class TAknsItemID; +class CAknButton; + +// CLASS DECLARATION + +/** +* Base class for precapture views +* +* @since 2.8 +*/ +class CCamPreCaptureViewBase : public CCamCaptureSetupViewBase, + public MCamControllerObserver, + public MAknToolbarObserver + { + public: // Constructors and destructor + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamPreCaptureViewBase(); + + public: // Functions from base classes + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * From CAknView Handles the foreground/background event + * @since 2.8 + * @param aForeground ETrue if this view is on foreground, else EFalse. + */ + void HandleForegroundEventL( TBool aForeground ); + + /** + * From MCamControllerObserver + * @since 2.8 + * @param aEvent The enumerated code for the event received + * @param aError The error code associated with the event + */ + void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + /** + * From CAknView. + * @since 2.8 + * @param aPreViewId the ID for previous view we are switching from + * @param aCustomMessageId the Uid for message passed to this view + * @param aCustomMessage descriptor containing data content for view specific message + */ + void DoActivateL( const TVwsViewId& aPreViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + /** + * From CAknView. + * @since 2.8 + */ + void DoDeactivate(); + + /** + * From CCamViewBase + * Handle change of focus to another application + * This only handles another application coming to the foreground when + * the camera application is already in the background behind an eikon + * server window + * @since 2.8 + */ + void HandleFocusLossL(); + + /** + * From CCamCaptureSetupViewBase + * Revert to normal mode + * @since 2.8 + */ + virtual void ExitAllModesL(); + + public: // New functions + + /** + * From CCamCaptureSetupViewBase + * Return the active setting mode + * @since 2.8 + * @return the active setting mode + */ + TCamSettingMode ActiveSettingMode(); + + /** + * AppUi calls this to notify views of focusgained and focuslost + * events. + */ + void HandleAppEvent( const TCamAppEvent& aEvent ); + + /** + * Sets a flag to true to indicate that access point dialog is shown and + * viewfinder needs to be restarted. + */ + void SetLocationTrailConnecting(); + + /** + * AppUi calls this to indicate if postcapture view will be visible + * in near future. + */ + void SetPostCaptureViewAsumption( TBool aAssumePostCaptureView ); + + /** + * Try to start the capture with MSK command. + * @since 9.1 + * @return ETrue if started. + */ + virtual TBool StartMskCaptureL() = 0; + + protected: // Functions from base classes + + /** + * From CCamPreCaptureViewBase + * Set the menu bar resource. + */ + virtual void SetMenuBar() = 0; + + /** + * From CCamCaptureSetupViewBase + * Switches the current mode to capture setup and activates a + * specific control. + * @since 2.8 + * @param aSetupCommand that specifies which setup control type to activate. + */ + void SwitchToCaptureSetupModeL( TInt aSetupCommand ); + + /** + * From CCamCaptureSetupViewBase + * Switches the current mode to scene setting and activates a + * specific control. + * @since 2.8 + */ + void SwitchToSceneSettingModeL(); + + /** + * From CCamCaptureSetupViewBase + * Exits capture setup mode and activates the capture setup menu control. + * @since 2.8 + */ + void ExitCaptureSetupModeL(); + + /** + * From CCamCaptureSetupViewBase + * Exits scene setting mode and activates the capture setup menu control. + * @since 2.8 + */ + void ExitSceneSettingModeL(); + + /** + * From CCamCaptureSetupViewBase + * Exits scene setting mode and activates the capture setup menu control. + * @since 2.8 + */ + void ExitInfoListBoxL(); + + /** + * Returns whether the view is a precapture view or not + * @since 3.0 + * @returns ETrue + */ + virtual TBool IsPreCapture(); + + /** + * Update fixed toolbar icons according to current settings + * @since S60 5.0 + */ + virtual void UpdateToolbarIconsL() = 0; + /** + * Redraws the toolbar and toolbarextension if visible + * @since S60 5.1 + */ + virtual void RedrawToolBar(); + + /** + * Returns the toolbar button by id from either the toolbar or toolbar extension + * @param aCommandId CommandId correpsonding to the button + * @returns the button or NULL + * @since S60 5.1 + */ + CAknButton* ToolbarButtonById(const TCamCmd aCommandId) const; + +public: + + /** + * Hides a toolbar/extension icon + * @param aCommandId CommandId correpsonding to the button + * @returns void + * @since S60 5.1 + */ + virtual void HideButton(const TCamCmd aCommandId); + + protected: // New functions + + /** + * C++ default constructor. + * @param aController Reference to either the application controller + * base class or test base class + * @since 2.8 + */ + CCamPreCaptureViewBase( CCamAppController& aController ); + + /** + * Symbian 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + /** + * Enter Viewfinder mode + * @since 2.8 + */ + virtual void StartViewFinder() = 0; + + /** + * Exit Viewfinder mode + * @since 2.8 + */ + virtual void StopViewFinder() = 0; + + /** + * Switch from current mode to standby mode + * @since 2.8 + * @param aViewId the current view id + * @param aError associated error code + */ + void SwitchToStandbyModeL( TCamAppViewIds aViewId, TInt aError ); + + /** + * Exit standby mode and return to previous capture mode + * @since 2.8 + */ + void ExitStandbyModeL(); + +#if 0 + /** + * Check whether the ok options menu can be displayed + * @since 2.8 + * @return ETrue if the menu can be displayed, else EFalse + */ + TBool IsOkOptionsMenuAllowed(); +#endif // 0 + + /** + * Stop the viewfinder and inform the controller that the engine is + * no longer required by this view + * @since 2.8 + */ + void ReleaseResources(); + + /** + * Switches the current mode to capture setup menu and activates + * the capture setup menu control. + * @since 2.8 + */ + void SwitchToCaptureSetupMenuModeL(); + + /** + * Exits capture setup menu mode and activates the original precapture + * view container that was active before entering this mode. + * @since 2.8 + */ + void ExitCaptureSetupMenuModeL(); + + /** + * Creates a capture setup menu. Derived classes should create + * either a video or photo menu, depending on the class type. + * @since 2.8 + */ + virtual void CreateCaptureSetupMenuL() = 0; + + /** + * Removes the capture setup menu and original container from + * the container stack. + * @since 2.8 + */ + void RemoveCaptureSetupMenuContainers(); + + /** + * Set the icon of a toolbar button + * @since S60 5.0 + * @param aButton The button whose icon is to be changed. + * @param aIconFilename Full path to the MBM/MIF file + * @param aIconId Icon ID in MBM/MIF file + * @param aMaskId Mask ID in MBM/MIF file + * @param aSkinInstance Current skin instance + * @param aSkinItemId Skin ID for the button graphic + * + */ + void SetIconL( + CAknButton* aButton, + const TDesC& aIconFilename, + TInt aIconId, + TInt aMaskId, + MAknsSkinInstance* aSkinInstance, + const TAknsItemID& aSkinItemId ); + + /** + * Initialise the switch camera menu item, used from + * DynInitMenuPaneL() + * @since 3.0 + * @param aMenuPane The menu pane to initialise + */ + void DynInitSwitchCameraMenuItemL( CEikMenuPane* aMenuPane ); + +// from base class MAknToolbarObserver + + void OfferToolbarEventL( TInt aCommand ); + + private: // new functions + + /** + * Cleans up the capture setup menu if a leave occurs + * while switching to capture setup menu mode + * @param aAny pointer to the object to cleanup + * @since 2.8 + */ + static void CleanupCaptureSetupMenu( TAny* aAny ); + + /** + * Helper method to setup the Active Palette. + * If needed, the AP is created. + * For existing AP, the items are first cleared. + * New items are set with resource from GetAPResourceId. + */ + void SetupActivePaletteL(); + + protected: // data + + // An extra container that the view uses when in capture setup menu mode. + CCamCaptureSetupMenu* iCaptureSetupMenuContainer; + + // Used to determine when the view is in capture setup mode + TBool iCaptureSetupMenuModeActive; + + // Used to determine which capture setup menu item to select + // when a capture setup control is exited. + TInt iCaptureSetupMenuLastItemIndex; + + + // Indicates that the application has lost the foreground but has not + // released the resources + TBool iContinueInBackground; + + // Indicates if the view was told to initiate standby mode from + // activation + TBool iActivateToStandby; + + // Indicates if the view was told to exit to standby mode from + // the current mode + TBool iDeactivateToStandby; + + // Indicates if toolbar extension should be invisible when returning + // precapture view + TBool iToolbarExtensionInvisible; + + // Asumption that next view is postcaptureview. If true don't start + // viewfinder if coming to foreground from background. + TBool iAssumePostCaptureView; + + TBool iLocationTrailConnecting; + + }; + +#endif // CAMPRECAPTUREVIEWBASE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamPropertyObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamPropertyObserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Callback interface for CCamPropertyWatcher +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +* +* --------------------------------------------------------------------------- +* +*/ + +#ifndef CAMPROPERTYOBSERVER_H +#define CAMPROPERTYOBSERVER_H + +// CLASS DECLARATION + +/** +* Abstract API for property observer. +* Derived classes receive notification when the value of a watched property change +* +* @since 2.8 +*/ +class MPropertyObserver + { +public: + /** + * The value of a watched property has changed + * @since 2.8 + * @param aCategory the category of the property + * @param aKey the identifier of the property + */ + virtual void HandlePropertyChangedL( const TUid& aCategory, const TUint aKey ) = 0; + }; + +#endif // CAMPROPERTYOBSERVER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamPropertyWatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamPropertyWatcher.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Callback wrapper for Publish and Subscribe +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#ifndef CAMPROPERTYWATCHER_H +#define CAMPROPERTYWATCHER_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class MPropertyObserver; + +// CLASS DECLARATION + +/** +* Class to watch for value changes on a property +* +* @since 2.8 +*/ +class CCamPropertyWatcher : public CActive + { +public: // Constructors and destructor + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aPropertyObserver The observer, notified when the value changes + * @param aCategory the category of the property + * @param aKey the identifier of the property + */ + static CCamPropertyWatcher* NewL( MPropertyObserver& aPropertyObserver, + const TUid& aCategory, + const TUint aKey ); + + /** + * Destructor. + * @since 2.8 + */ + ~CCamPropertyWatcher(); + +public: // New methods + + /** + * Register a need for notification of value changes + * @since 2.8 + */ + void Subscribe(); + + /** + * Return the current value of the property + * @since 2.8 + * @param aValue Reference to an integer that will receive the current + * value of the property + * @return KErrNone if successful otherwise another of the system-wide error + * codes + */ + TInt Get( TInt& aValue ); + +private: // new methods + + /** + * C++ default constructor. + * @since 2.8 + * @param aPropertyObserver Reference to observer of change events + * @param aCategory category of the property + * @param aKey identifier of the property + */ + CCamPropertyWatcher( MPropertyObserver& aPropertyObserver, + const TUid& aCategory, + const TUint aKey ); + /** + * Symbian 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + +public: // methods from base classes + + /** + * From CActive + * @since 2.8 + */ + void RunL(); + +private: + + /** + * From CActive + * @since 2.8 + */ + void DoCancel(); + +private: + + MPropertyObserver& iPropertyObserver; // observer informed of change events + RProperty iProperty; // handle to the property + TUid iCategory; // category of the property + TUint iKey; // identifier of the property + }; + +#endif // CAMPROPERTYWATCHER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamRecordingIconDecoration.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamRecordingIconDecoration.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera UI recording icon decoration* +*/ + + + + +#ifndef CAMRECORDINGICONDECORATION_H +#define CAMRECORDINGICONDECORATION_H + +// INCLUDES +#include +#include "CamObservable.h" +#include "CamControllerObservers.h" + +// FORWARD DECLARATIONS +class MObserver; +class CCamObserverHandler; +class CBitmapContext; +class CFbsBitmap; +class CPeriodic; +class CCamAppController; + +// CLASS DECLARATION +class CCamRecordingIconDecoration : public CBase, + public MCamObservable, + public MCamControllerObserver + { + private: + // The internal recording states used + enum TCamRecordState + { + ECamNotRecording, + ECamRecording, + ECamRecordPaused + }; + + public: + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aPosition The postition of the icon + * @param aObserver Any interested observer + * @return New instance of class + */ + static CCamRecordingIconDecoration* NewL( const TRect& aPosition, + CCamAppController& aController ); + + /** + * Destructor + */ + ~CCamRecordingIconDecoration(); + + protected: + /** + * Constructor + */ + CCamRecordingIconDecoration( CCamAppController& aController ); + + /** + * Second-phase constructor + * @param aPosition The postition of the icon + * @param aController Reference to the controller + */ + void ConstructL( const TRect& aPosition ); + + public: // New methods + /** + * Draws the recording icon + * @param aGc The context to use while drawing + * @param aDrawRect Ignored + */ + void Draw(CBitmapContext& aGc, const TRect& aDrawRect); + + /** + * Callback for pause flash timer. + * @since 2.8 + * @param aVideoContainer- the CCamVideoPreCaptureContainer + * @return KErrNone + */ + static TInt PauseFlashCallBack( TAny* aRecordingIconDecorator ); + + /** + * Toggles the paused icon called from PauseFlashCallBack + * @since 2.8 + */ + void TogglePauseIconFlash(); + + private: // New methods + /** + * Changes iRecordState, tells observers to update + * @param aNewState The new state to change to + */ + void ChangeRecordState(TCamRecordState aNewState); + + public: // From MCamObservable + /** + * From MCamObservable + * @param aObserver Observer to register + * @since 3.0 + */ + void RegisterObserverL(MCamObserver* aObserver); + + /** + * From MCamObservable + * @param aObserver Observer to deregister + * @since 3.0 + */ + void DeregisterObserver(MCamObserver* aObserver); + + /** + * From MCamObservable + * @param aEvent Event code to broadcast + * @since 3.0 + */ + void BroadcastEvent(TCamObserverEvent aEvent); + + public: // From MCamControllerObserver + /** + * Handle an event from CCamAppControllerBase. + * @since 2.8 + * @param aEvent the controller event that has occurred + * @param aError any reported error + */ + virtual void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + private: // Data + // Handles requests to the MCamObservable interface + CCamObserverHandler* iObserverHandler; + + // Where to put the icon + TPoint iPosition; + TRect iSize; + + // Bitmap and mask for record icon + CFbsBitmap* iRecBitmap; + CFbsBitmap* iRecBitmapMask; + + // Bitmap amd mask for record paused icon + CFbsBitmap* iRecPauseBitmap; + CFbsBitmap* iRecPauseBitmapMask; + + // Current recording state + TCamRecordState iRecordState; + + // Whether to show paused icon (toggled via periodic timer) + TBool iShowPaused; + + // Periodic timer used to toggle paused icon + CPeriodic* iPauseFlashPeriodic; + + // Pointer to the controller + CCamAppController& iController; + }; + + +#endif // CAMRECORDINGICONDECORATION_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamResourceIDs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamResourceIDs.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,221 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource IDs for the Camera Application* +*/ + + +#ifndef CAM_RESOURCE_IDS_H +#define CAM_RESOURCE_IDS_H + +#define R_CAM_STILL_PRE_CAPTURE_VIEW_ID 0 +#define R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID 1 +#define R_CAM_STILL_PRE_CAPTURE_MENU_ID 2 +#define R_CAM_STILL_POST_CAPTURE_VIEW_ID 3 +#define R_CAM_STILL_POST_CAPTURE_MENUBAR_ID 4 +#define R_CAM_STILL_POST_CAPTURE_MENU_ID 5 +#define R_CAM_STILL_POST_CAPTURE_OK_MENUBAR_ID 6 +#define R_CAM_STILL_POST_CAPTURE_OK_MENU_ID 7 +#define R_CAM_VIDEO_PRE_CAPTURE_VIEW_ID 8 +#define R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_ID 9 +#define R_CAM_VIDEO_PRE_CAPTURE_MENU_ID 10 +#define R_CAM_VIDEO_POST_CAPTURE_VIEW_ID 11 +#define R_CAM_VIDEO_POST_CAPTURE_MENUBAR_ID 12 +#define R_CAM_VIDEO_POST_CAPTURE_MENU_ID 13 +#define R_CAM_VIDEO_POST_CAPTURE_OK_MENUBAR_ID 14 +#define R_CAM_VIDEO_POST_CAPTURE_OK_MENU_ID 15 +#define R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID 16 +#define R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_ID 17 +#define R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENU_ID 18 +#define R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENU_ID 19 +#define R_CAM_IMG_PRECAP_IMGCOUNTER_ID 20 +#define R_CAM_IMG_PRECAP_IMGCOUNTER_AH_ID 21 +#define R_CAM_VIDEO_PRECAP_REMAINING_TIME_ID 22 +#define R_CAM_VIDEO_PRECAP_REMAINING_TIME_AH_ID 23 +#define R_CAM_COUNTER_ICON_RECT_ID 24 +#define R_CAM_COUNTER_ICON_RECT_AH_ID 25 +#define R_CAM_VIDEO_CAP_LIMIT_MEMORY_LOCATION_ID 26 +#define R_CAM_RECPAUSE_INDICATOR_LAYOUT_VID_MAIN_RECT_ID 27 +#define R_CAM_VIDEO_CAP_LIMIT_MEMORY_LOCATION_AH_ID 28 +#define R_CAM_VIDEO_CAP_LIMITED_ELAPSED_TIME_ID 29 +#define R_CAM_VIDEO_CAP_LIMITED_ELAPSED_TIME_AH_ID 30 +#define R_CAM_VIDEO_CAP_LIMITED_REMAINING_TIME_ID 31 +#define R_CAM_VIDEO_CAP_LIMITED_REMAINING_TIME_AH_ID 32 +#define R_CAM_VIDEO_CAP_LIMIT_PROGRESS_BAR_ID 33 +#define R_CAM_VIDEO_CAP_LIMIT_PROGRESS_BAR_AH_ID 34 +#define R_CAM_SCENE_SETTING_MENUBAR_ID 35 +#define R_CAM_SCENE_SETTING_MENU_ID 36 +#define R_CAM_SIDEPANE_ID 37 +#define R_CAM_SCENE_MAX_ITEMS_TO_DISPLAY_ID 38 +#define R_CAM_SCENE_TITLE_NORMAL_ARRAY_ID 39 +#define R_CAM_SCENE_TITLE_NORMAL_ARRAY_AH_ID 40 +#define R_CAM_SCENE_TITLE_NORMAL_ARRAY_APAC_ID 41 +#define R_CAM_SCENE_TITLE_DISPLACED_ARRAY_ID 42 +#define R_CAM_SCENE_TITLE_DISPLACED_ARRAY_AH_ID 43 +#define R_CAM_SCENE_TITLE_DISPLACED_ARRAY_APAC_ID 44 +#define R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_ID 45 +#define R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_AH_ID 46 +#define R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_APAC_ID 47 +#define R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_ID 48 +#define R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_AH_ID 49 +#define R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_APAC_ID 50 +#define R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_ID 51 +#define R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_AH_ID 52 +#define R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_ID 53 +#define R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_AH_ID 54 +#define R_CAM_SCENE_ICON_NORMAL_ARRAY_ID 55 +#define R_CAM_SCENE_ICON_NORMAL_ARRAY_AH_ID 56 +#define R_CAM_SCENE_ICON_DISPLACED_ARRAY_ID 57 +#define R_CAM_SCENE_ICON_DISPLACED_ARRAY_AH_ID 58 +#define R_CAM_SCENE_SCROLLBAR_POSITION_ID 59 +#define R_CAM_SCENE_SCROLLBAR_POSITION_AH_ID 60 +#define R_CAM_CAPSETUP_LISTBOX_ICON_RECT_ID 61 +#define R_CAM_CAPSETUP_LISTBOX_ICON_RECT_AH_ID 62 +#define R_CAM_CAPSETUP_LISTBOX_RADIOBUT_RECT_ID 63 +#define R_CAM_CAPSETUP_LISTBOX_RADIOBUT_RECT_AH_ID 64 +#define R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_ID 65 +#define R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_APAC_ID 66 +#define R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_AH_ID 67 +#define R_CAM_CAPTURE_SETUP_LIST_STILL_WHITEBALANCE_ID 68 +#define R_CAM_CAPTURE_SETUP_LIST_STILL_COLOUREFFECT_ID 69 +#define R_CAM_CAPTURE_SETUP_LIST_STILL_FLASH_ID 70 +#define R_CAM_CAPTURE_SETUP_LIST_VIDEO_WHITEBALANCE_ID 71 +#define R_CAM_CAPTURE_SETUP_LIST_VIDEO_COLOUREFFECT_ID 72 +#define R_CAM_CAPTURE_SETUP_LIST_PHOTO_IMAGESHARPNESS_ID 73 +#define R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_ID 74 +#define R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_APAC_ID 75 +#define R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_AH_ID 76 +#define R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_ID 77 +#define R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_APAC_ID 78 +#define R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_AH_ID 79 +#define R_CAM_CAPTURE_SETUP_CONTROL_POSITION_ID 80 +#define R_CAM_CAPTURE_SETUP_CONTROL_POSITION_AH_ID 81 +#define R_CAM_CAPTURE_SETUP_LISTBOX_WIDTH_ID 82 +#define R_CAM_CAPTURE_SETUP_LISTBOX_ITEM_HEIGHT_ID 83 +#define R_CAM_CAPTURE_SETUP_CONTVF_RECT_ID 84 +#define R_CAM_CAPTURE_SETUP_CONTVF_RECT_AH_ID 85 +#define R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT_ID 86 +#define R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT_AH_ID 87 +#define R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_APAC_ID 88 +#define R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_AH_ID 89 +#define R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_ID 90 +#define R_CAM_USER_SCENE_SETUP_VIEW_ID 91 +#define R_CAM_USER_SCENE_SETUP_MENUBAR_ID 92 +#define R_CAM_USER_SCENE_SETUP_MENU_ID 93 +#define R_CAM_LAYOUT_ZOOM_PANE_ID 94 +#define R_CAM_LAYOUT_ZOOM_PANE_SHAFT_ID 95 +#define R_CAM_VIEWFINDER_RECT_STILL_ID 96 +#define R_CAM_STILL_DISPLAYED_RECT_SECONDARY_ID 97 +#define R_CAM_STILL_REQUESTED_RECT_SECONDARY_ID 98 +#define R_CAM_VIEWFINDER_RECT_CIF_ID 99 +#define R_CAM_VIEWFINDER_RECT_QCIF_ID 100 +#define R_CAM_VIEWFINDER_RECT_SQCIF_ID 101 +#define R_CAM_VIEWFINDER_RECT_SECONDARY_ID 102 +#define R_CAM_SNAPSHOT_RECT_STILL_ID 103 +#define R_CAM_SNAPSHOT_RECT_CIF_ID 104 +#define R_CAM_SNAPSHOT_RECT_NEAR_CIF_ID 105 +#define R_CAM_SNAPSHOT_RECT_SQCIF_ID 106 +#define R_CAM_ZOOM_PANE_WIDTH_ID 107 +#define R_CAM_RESOLUTION_PANE_ID 108 +#define R_CAM_CAPTURE_SETUP_SLIDER_BRIGHTNESS_ARRAY_ID 109 +#define R_CAM_CAPTURE_SETUP_SLIDER_BRIGHTNESS_ARRAY_AH_ID 110 +#define R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY_ID 111 +#define R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY_AH_ID 112 +#define R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY_ID 113 +#define R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY_AH_ID 114 +#define R_CAM_CAPTURE_SETUP_SLIDER_COLOURSATURATION_ARRAY_ID 115 +#define R_CAM_TIME_LAPSE_LEGEND_ARRAY_ID 116 // Resource deleted +#define R_CAM_TIME_LAPSE_LEGEND_ARRAY_AH_ID 117 // Resource deleted +#define R_CAM_TIMELAPSE_SETUP_SLIDER_SHAFT_ID 118 // Resource deleted +#define R_CAM_TIMELAPSE_SETUP_SLIDER_THUMB_ID 119 // Resource deleted +#define R_CAM_TIMELAPSE_SETUP_SLIDER_SHAFT_AH_ID 120 // Resource deleted +#define R_CAM_TIMELAPSE_SETUP_SLIDER_THUMB_AH_ID 121 // Resource deleted +#define R_CAM_TIMELAPSE_CONTROL_LAYOUT_ID 122 // Resource deleted +#define R_CAM_CAPTURE_SETUP_SLIDER_SHAFT_ID 123 +#define R_CAM_CAPTURE_SETUP_SLIDER_THUMB_ID 124 +#define R_CAM_CAPTURE_SETUP_SLIDER_SHAFT_AH_ID 125 +#define R_CAM_CAPTURE_SETUP_SLIDER_THUMB_AH_ID 126 +#define R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION_ID 127 +#define R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION_AH_ID 128 +#define R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_ID 129 +#define R_CAM_POST_CAPTURE_VIDEO_SIZE_LAYOUT_ID 130 +#define R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_AH_ID 131 +#define R_CAM_POST_CAPTURE_VIDEO_SIZE_LAYOUT_AH_ID 132 +#define R_CAM_QUALITY_SLIDER_SHAFT_ID 133 +#define R_CAM_QUALITY_SLIDER_SHAFT_AH_ID 134 +#define R_CAM_QUALITY_SLIDER_THUMB_ID 135 +#define R_CAM_QUALITY_SLIDER_THUMB_AH_ID 136 +#define R_CAM_SETTING_PHOTO_QUALITY_SLIDER_ID 137 +#define R_CAM_SETTING_VIDEO_QUALITY_SLIDER_ID 138 +#define R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_ID 139 +#define R_CAM_PHOTO_QUALITY_SLIDER_ARRAY_ID 140 +#define R_CAM_PHOTO_QUALITY_SLIDER_ARRAY_AH_ID 141 +#define R_CAM_VIDEO_QUALITY_SLIDER_ARRAY_ID 142 +#define R_CAM_VIDEO_QUALITY_SLIDER_ARRAY_AH_ID 143 +#define R_CAM_SIDEPANE_RECT_CAM1_ID 144 +#define R_CAM_SIDEPANE_RECT_CAM2_ID 145 +#define R_CAM_SETTING_LIST_VIEW_ID 146 +#define R_CAM_SETTINGS_LIST_MENUBAR_ID 147 +#define R_CAM_SETTINGS_LIST_MENU_ID 148 +#define R_CAM_VIDEO_SETTINGS_ITEM_LIST_ID 149 +#define R_CAM_EMBEDDED_VIDEO_SETTINGS_ITEM_LIST_ID 150 +#define R_CAM_SETTINGS_LIST_SETTINGS_PAGE_ID 151 +#define R_CAM_PHOTO_SETTINGS_ITEM_LIST_ID 152 +#define R_CAM_EMBEDDED_PHOTO_SETTINGS_ITEM_LIST_ID 153 +#define R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_ID 154 +#define R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_AH_ID 155 +#define R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_ID 156 +#define R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_AH_ID 157 +#define R_CAM_VIDEO_PRECAP_FILE_TYPE_ID 158 +#define R_CAM_VIDEO_PRECAP_FILE_TYPE_AH_ID 159 +#define R_CAM_IMG_PRECAP_MEMORY_LOCATION_ID 160 +#define R_CAM_IMG_PRECAP_MEMORY_LOCATION_AH_ID 161 +#define R_CAM_VIDEO_PRECAP_MEMORY_LOCATION_ID 162 +#define R_CAM_VIDEO_PRECAP_MEMORY_LOCATION_AH_ID 163 +#define R_CAM_SNAPSHOT_RECT_STILL_ROTATED_ID 164 +#define R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_AH_ID 165 +#define R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_APAC_ID 166 +#define R_CAM_CAPTURE_SETUP_SELF_TIMER_ID 167 +#define R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON_ID 168 +#define R_CAM_TIMELAPSE_POST_CAPTURE_MENUBAR_ID 169 +#define R_CAM_LAYOUT_ZOOM_PANE_HORIZ_ID 170 +#define R_CAM_LAYOUT_ZOOM_PANE_HORIZ_SHAFT_ID 171 +#define R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_ID 172 +#define R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_AH_ID 173 +#define R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_APAC_ID 174 +#define R_CAM_VIDEO_FILETYPE_PANE_ID 175 +#define R_CAM_VIDEO_CAP_LIMIT_FILE_TYPE_ID 176 +#define R_CAM_VIDEO_PRECAP_QUALITY_ICONS_ID 177 +#define R_CAM_VIDEO_CAP_LIMIT_QUALITY_ICONS_ID 178 +#define R_CAM_IMG_PRECAP_QUALITY_ICONS_ID 179 +#define R_CAM_VIDEO_CAP_UNLIMITED_REMAINING_TIME_ID 180 +#define R_CAM_VIDEO_CAP_UNLIMITED_REMAINING_TIME_AH_ID 181 +#define R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON_ID 182 +#define R_CAM_VIDEO_CAP_UNLIMIT_FILE_TYPE_ID 183 +#define R_CAM_VIDEO_CAP_UNLIMIT_QUALITY_ICONS_ID 184 +#define R_CAM_CAPTURE_SETUP_LISTBOX_WIDTH_NOVF_ID 185 +#define R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_ID 186 +#define R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_APAC_ID 187 +#define R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_AH_ID 188 +#define R_CAM_VIDEO_CAP_UNLIMITED_ELAPSED_TIME_ID 189 +#define R_CAM_VIDEO_CAP_UNLIMITED_ELAPSED_TIME_AH_ID 190 +#define R_CAM_CAPSETUP_MODE_LISTBOX_ICON_RECT_AH_ID 191 +#define R_CAM_VIDEO_CAP_UNLIMIT_MEMORY_LOCATION_ID 192 +#define R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON_AH_ID 193 +#define R_CAM_VIDEO_CAP_UNLIMIT_MEMORY_LOCATION_AH_ID 194 +#define R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON_AH_ID 195 +#define R_CAM_IMG_PRECAP_LOCATION_ID 196 + // Important! Keep this updated: +#define R_CAM_LAST_RESOURCE_ID 197 + +#endif // CAM_RESOURCE_IDS_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamResourceLoader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamResourceLoader.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines abstract interface for classes that load resource data* +*/ + + + +#ifndef CAMRESOURCELOADER_H +#define CAMRESOURCELOADER_H + +// INCLUDES + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Abstract API for MCamResourceLoader +* +* @since 3.0 +*/ +class MCamResourceLoader + { + public: + + /** + * Read in all resource-based data that the class needs + * @since 3.0 + */ + virtual void LoadResourceDataL() = 0; + + /** + * Free all resources created by LoadResourceData() + * @since 3.0 + */ + virtual void UnloadResourceData() = 0; + + /** + * Forces class to reread all resource information + * Should be equivalent of {UnloadResourceData(); LoadResourceData()} + * @since 3.0 + */ + virtual void ReloadResourceDataL() = 0; + }; + +#endif // CAMRESOURCELOADER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamResourceLookup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamResourceLookup.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,251 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource lookup functions for the Camera Application* +*/ + + + +#ifndef CAM_RESOURCE_LOOKUP_H +#define CAM_RESOURCE_LOOKUP_H + +#include "CamResourceIDs.h" +#include +#include +#include "CamAppUiBase.h" + +const TInt KRoidLookup[R_CAM_LAST_RESOURCE_ID+1][ECamOrientationTotal] = +{ +// Order of resources: Camcorder Right, Portrait, View, Camcorder Left + +// 0: + { R_CAM_STILL_PRE_CAPTURE_VIEW_CAMCORDER, R_CAM_STILL_PRE_CAPTURE_VIEW_PORTRAIT, R_CAM_STILL_PRE_CAPTURE_VIEW_PORTRAIT, R_CAM_STILL_PRE_CAPTURE_VIEW_CAMCORDER }, + { R_CAM_STILL_PRE_CAPTURE_MENUBAR_CAMCORDER, R_CAM_STILL_PRE_CAPTURE_MENUBAR_PORTRAIT, R_CAM_STILL_PRE_CAPTURE_MENUBAR_PORTRAIT, R_CAM_STILL_PRE_CAPTURE_MENUBAR_CAMCORDER }, + { R_CAM_STILL_PRE_CAPTURE_MENU_CAMCORDER, R_CAM_STILL_PRE_CAPTURE_MENU_PORTRAIT, R_CAM_STILL_PRE_CAPTURE_MENU_PORTRAIT, R_CAM_STILL_PRE_CAPTURE_MENU_CAMCORDER }, + { R_CAM_STILL_POST_CAPTURE_VIEW_CAMCORDER, R_CAM_STILL_POST_CAPTURE_VIEW_PORTRAIT, R_CAM_STILL_POST_CAPTURE_VIEW_PORTRAIT, R_CAM_STILL_POST_CAPTURE_VIEW_CAMCORDER }, + { R_CAM_STILL_POST_CAPTURE_MENUBAR_CAMCORDER , R_CAM_STILL_POST_CAPTURE_MENUBAR_PORTRAIT, R_CAM_STILL_POST_CAPTURE_MENUBAR_PORTRAIT, R_CAM_STILL_POST_CAPTURE_MENUBAR_CAMCORDER }, + { R_CAM_STILL_POST_CAPTURE_MENU_CAMCORDER, R_CAM_STILL_POST_CAPTURE_MENU_PORTRAIT, R_CAM_STILL_POST_CAPTURE_MENU_PORTRAIT, R_CAM_STILL_POST_CAPTURE_MENU_CAMCORDER }, + { R_CAM_STILL_POST_CAPTURE_OK_MENUBAR, R_CAM_STILL_POST_CAPTURE_OK_MENUBAR, R_CAM_STILL_POST_CAPTURE_OK_MENUBAR, R_CAM_STILL_POST_CAPTURE_OK_MENUBAR }, + { R_CAM_STILL_POST_CAPTURE_OK_MENU, R_CAM_STILL_POST_CAPTURE_OK_MENU, R_CAM_STILL_POST_CAPTURE_OK_MENU, R_CAM_STILL_POST_CAPTURE_OK_MENU }, + { R_CAM_VIDEO_PRE_CAPTURE_VIEW_CAMCORDER, R_CAM_VIDEO_PRE_CAPTURE_VIEW_PORTRAIT, R_CAM_VIDEO_PRE_CAPTURE_VIEW_PORTRAIT, R_CAM_VIDEO_PRE_CAPTURE_VIEW_CAMCORDER }, + { R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_CAMCORDER, R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_PORTRAIT, R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_PORTRAIT, R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_CAMCORDER }, +// 10: + { R_CAM_VIDEO_PRE_CAPTURE_MENU_CAMCORDER, R_CAM_VIDEO_PRE_CAPTURE_MENU_PORTRAIT, R_CAM_VIDEO_PRE_CAPTURE_MENU_PORTRAIT, R_CAM_VIDEO_PRE_CAPTURE_MENU_CAMCORDER }, + { R_CAM_VIDEO_POST_CAPTURE_VIEW_CAMCORDER, R_CAM_VIDEO_POST_CAPTURE_VIEW_PORTRAIT, R_CAM_VIDEO_POST_CAPTURE_VIEW_VIEWMODE, R_CAM_VIDEO_POST_CAPTURE_VIEW_CAMCORDER }, + { R_CAM_VIDEO_POST_CAPTURE_MENUBAR_CAMCORDER , R_CAM_VIDEO_POST_CAPTURE_MENUBAR_PORTRAIT, R_CAM_VIDEO_POST_CAPTURE_MENUBAR_VIEWMODE, R_CAM_VIDEO_POST_CAPTURE_MENUBAR_CAMCORDER }, + { R_CAM_VIDEO_POST_CAPTURE_MENU_CAMCORDER , R_CAM_VIDEO_POST_CAPTURE_MENU_PORTRAIT, R_CAM_VIDEO_POST_CAPTURE_MENU_VIEWMODE, R_CAM_VIDEO_POST_CAPTURE_MENU_CAMCORDER }, + { R_CAM_VIDEO_POST_CAPTURE_OK_MENUBAR, R_CAM_VIDEO_POST_CAPTURE_OK_MENUBAR, R_CAM_VIDEO_POST_CAPTURE_OK_MENUBAR, R_CAM_VIDEO_POST_CAPTURE_OK_MENUBAR }, + { R_CAM_VIDEO_POST_CAPTURE_OK_MENU, R_CAM_VIDEO_POST_CAPTURE_OK_MENU, R_CAM_VIDEO_POST_CAPTURE_OK_MENU, R_CAM_VIDEO_POST_CAPTURE_OK_MENU }, + { R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_CAMCORDER, R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_PORTRAIT, R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_PORTRAIT, R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_CAMCORDER }, + { R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_CAMCORDER, R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_PORTRAIT, R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_PORTRAIT, R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_CAMCORDER }, + { R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENU_CAMCORDER, R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENU_PORTRAIT, R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENU_PORTRAIT, R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENU_CAMCORDER }, + { R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENU_CAMCORDER, R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENU_PORTRAIT, R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENU_PORTRAIT, R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENU_CAMCORDER }, +// 20: + { R_CAM_IMG_PRECAP_IMGCOUNTER, R_CAM_IMG_PRECAP_IMGCOUNTER_PORTRAIT, R_CAM_IMG_PRECAP_IMGCOUNTER_VIEWMODE, R_CAM_IMG_PRECAP_IMGCOUNTER_LEFT }, + { R_CAM_IMG_PRECAP_IMGCOUNTER_AH, R_CAM_IMG_PRECAP_IMGCOUNTER_AH_PORTRAIT, R_CAM_IMG_PRECAP_IMGCOUNTER_AH_VIEWMODE, R_CAM_IMG_PRECAP_IMGCOUNTER_AH_LEFT }, + { R_CAM_VIDEO_PRECAP_REMAINING_TIME, R_CAM_VIDEO_PRECAP_REMAINING_TIME_PORTRAIT, R_CAM_VIDEO_PRECAP_REMAINING_TIME_VIEWMODE, R_CAM_VIDEO_PRECAP_REMAINING_TIME_LEFT }, + { R_CAM_VIDEO_PRECAP_REMAINING_TIME_AH, R_CAM_VIDEO_PRECAP_REMAINING_TIME_AH_PORTRAIT, R_CAM_VIDEO_PRECAP_REMAINING_TIME_AH_VIEWMODE, R_CAM_VIDEO_PRECAP_REMAINING_TIME_AH_LEFT }, + { R_CAM_COUNTER_ICON_RECT_CAMCORDER, R_CAM_COUNTER_ICON_RECT_PORTRAIT, R_CAM_COUNTER_ICON_RECT_VIEWMODE, R_CAM_COUNTER_ICON_RECT_CAMCORDER_LEFT }, + { R_CAM_COUNTER_ICON_RECT_AH_CAMCORDER, R_CAM_COUNTER_ICON_RECT_AH_PORTRAIT, R_CAM_COUNTER_ICON_RECT_AH_VIEWMODE, R_CAM_COUNTER_ICON_RECT_AH_CAMCORDER_LEFT }, + { R_CAM_VIDEO_CAP_LIMIT_MEMORY_LOCATION, R_CAM_VIDEO_CAP_LIMIT_MEMORY_LOCATION_PORTRAIT, R_CAM_VIDEO_CAP_LIMIT_MEMORY_LOCATION_VIEWMODE, R_CAM_VIDEO_CAP_LIMIT_MEMORY_LOCATION_LEFT }, + { R_CAM_RECPAUSE_INDICATOR_LAYOUT_VID_MAIN_RECT_CAMCORDER, R_CAM_RECPAUSE_INDICATOR_LAYOUT_VID_MAIN_RECT_PORTRAIT, R_CAM_RECPAUSE_INDICATOR_LAYOUT_VID_MAIN_RECT_VIEWMODE, R_CAM_RECPAUSE_INDICATOR_LAYOUT_VID_MAIN_RECT_CAMCORDER_LEFT }, + { R_CAM_VIDEO_CAP_LIMIT_MEMORY_LOCATION_AH, R_CAM_VIDEO_CAP_LIMIT_MEMORY_LOCATION_AH_PORTRAIT, R_CAM_VIDEO_CAP_LIMIT_MEMORY_LOCATION_AH_VIEWMODE, R_CAM_VIDEO_CAP_LIMIT_MEMORY_LOCATION_AH_LEFT }, + { R_CAM_VIDEO_CAP_LIMITED_ELAPSED_TIME, R_CAM_VIDEO_CAP_LIMITED_ELAPSED_TIME_PORTRAIT, R_CAM_VIDEO_CAP_LIMITED_ELAPSED_TIME_VIEWMODE, R_CAM_VIDEO_CAP_LIMITED_ELAPSED_TIME_LEFT }, +// 30: + { R_CAM_VIDEO_CAP_LIMITED_ELAPSED_TIME_AH, R_CAM_VIDEO_CAP_LIMITED_ELAPSED_TIME_AH_PORTRAIT, R_CAM_VIDEO_CAP_LIMITED_ELAPSED_TIME_AH_VIEWMODE, R_CAM_VIDEO_CAP_LIMITED_ELAPSED_TIME_AH_LEFT }, + { R_CAM_VIDEO_CAP_LIMITED_REMAINING_TIME, R_CAM_VIDEO_CAP_LIMITED_REMAINING_TIME_PORTRAIT, R_CAM_VIDEO_CAP_LIMITED_REMAINING_TIME_VIEWMODE, R_CAM_VIDEO_CAP_LIMITED_REMAINING_TIME_LEFT }, + { R_CAM_VIDEO_CAP_LIMITED_REMAINING_TIME_AH, R_CAM_VIDEO_CAP_LIMITED_REMAINING_TIME_AH_PORTRAIT, R_CAM_VIDEO_CAP_LIMITED_REMAINING_TIME_AH_VIEWMODE, R_CAM_VIDEO_CAP_LIMITED_REMAINING_TIME_AH_LEFT }, + { R_CAM_VIDEO_CAP_LIMIT_PROGRESS_BAR, R_CAM_VIDEO_CAP_LIMIT_PROGRESS_BAR_PORTRAIT, R_CAM_VIDEO_CAP_LIMIT_PROGRESS_BAR_VIEWMODE, R_CAM_VIDEO_CAP_LIMIT_PROGRESS_BAR_LEFT }, + { R_CAM_VIDEO_CAP_LIMIT_PROGRESS_BAR_AH, R_CAM_VIDEO_CAP_LIMIT_PROGRESS_BAR_AH_PORTRAIT, R_CAM_VIDEO_CAP_LIMIT_PROGRESS_BAR_AH_VIEWMODE, R_CAM_VIDEO_CAP_LIMIT_PROGRESS_BAR_AH_LEFT }, + { R_CAM_SCENE_SETTING_MENUBAR, R_CAM_SCENE_SETTING_MENUBAR, R_CAM_SCENE_SETTING_MENUBAR, R_CAM_SCENE_SETTING_MENUBAR }, + { R_CAM_SCENE_SETTING_MENU, R_CAM_SCENE_SETTING_MENU, R_CAM_SCENE_SETTING_MENU, R_CAM_SCENE_SETTING_MENU }, + { R_CAM_SIDEPANE_CAMCORDER, R_CAM_SIDEPANE_PORTRAIT, R_CAM_SIDEPANE_VIEWMODE, R_CAM_SIDEPANE_CAMCORDER }, + { R_CAM_SCENE_MAX_ITEMS_TO_DISPLAY, R_CAM_SCENE_MAX_ITEMS_TO_DISPLAY, R_CAM_SCENE_MAX_ITEMS_TO_DISPLAY, R_CAM_SCENE_MAX_ITEMS_TO_DISPLAY }, + { R_CAM_SCENE_TITLE_NORMAL_ARRAY_CAMCORDER, R_CAM_SCENE_TITLE_NORMAL_ARRAY_PORTRAIT, R_CAM_SCENE_TITLE_NORMAL_ARRAY_VIEWMODE, R_CAM_SCENE_TITLE_NORMAL_ARRAY_CAMCORDER }, +// 40: + { R_CAM_SCENE_TITLE_NORMAL_ARRAY_AH_CAMCORDER, R_CAM_SCENE_TITLE_NORMAL_ARRAY_AH_PORTRAIT, R_CAM_SCENE_TITLE_NORMAL_ARRAY_AH_VIEWMODE, R_CAM_SCENE_TITLE_NORMAL_ARRAY_AH_CAMCORDER }, + { R_CAM_SCENE_TITLE_NORMAL_ARRAY_APAC_CAMCORDER, R_CAM_SCENE_TITLE_NORMAL_ARRAY_APAC_PORTRAIT, R_CAM_SCENE_TITLE_NORMAL_ARRAY_APAC_VIEWMODE, R_CAM_SCENE_TITLE_NORMAL_ARRAY_APAC_CAMCORDER }, + { R_CAM_SCENE_TITLE_DISPLACED_ARRAY_CAMCORDER, R_CAM_SCENE_TITLE_DISPLACED_ARRAY_PORTRAIT, R_CAM_SCENE_TITLE_DISPLACED_ARRAY_VIEWMODE, R_CAM_SCENE_TITLE_DISPLACED_ARRAY_CAMCORDER }, + { R_CAM_SCENE_TITLE_DISPLACED_ARRAY_AH_CAMCORDER, R_CAM_SCENE_TITLE_DISPLACED_ARRAY_AH_PORTRAIT, R_CAM_SCENE_TITLE_DISPLACED_ARRAY_AH_VIEWMODE, R_CAM_SCENE_TITLE_DISPLACED_ARRAY_AH_CAMCORDER }, + { R_CAM_SCENE_TITLE_DISPLACED_ARRAY_APAC_CAMCORDER, R_CAM_SCENE_TITLE_DISPLACED_ARRAY_APAC_PORTRAIT,R_CAM_SCENE_TITLE_DISPLACED_ARRAY_APAC_VIEWMODE, R_CAM_SCENE_TITLE_DISPLACED_ARRAY_APAC_CAMCORDER }, + { R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_CAMCORDER, R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_PORTRAIT, R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_VIEWMODE, R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_CAMCORDER }, + { R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_AH_CAMCORDER, R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_AH_PORTRAIT, R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_AH_VIEWMODE, R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_AH_CAMCORDER }, + { R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_APAC_CAMCORDER, R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_APAC_PORTRAIT, R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_APAC_VIEWMODE, R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_APAC_CAMCORDER }, + { R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_CAMCORDER, R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_PORTRAIT, R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_VIEWMODE, R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_CAMCORDER }, + { R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_AH_CAMCORDER, R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_AH_PORTRAIT, R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_AH_VIEWMODE, R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_AH_CAMCORDER }, +// 50: + { R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_APAC_CAMCORDER, R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_APAC_PORTRAIT, R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_APAC_VIEWMODE, R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_APAC_CAMCORDER }, + { R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_CAMCORDER, R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_PORTRAIT, R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_VIEWMODE, R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_CAMCORDER }, + { R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_AH_CAMCORDER, R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_AH_PORTRAIT, R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_AH_VIEWMODE, R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_AH_CAMCORDER }, + { R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_CAMCORDER, R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_PORTRAIT, R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_VIEWMODE, R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_CAMCORDER }, + { R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_AH_CAMCORDER, R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_AH_PORTRAIT, R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_AH_VIEWMODE, R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_AH_CAMCORDER }, + { R_CAM_SCENE_ICON_NORMAL_ARRAY_CAMCORDER, R_CAM_SCENE_ICON_NORMAL_ARRAY_PORTRAIT, R_CAM_SCENE_ICON_NORMAL_ARRAY_VIEWMODE, R_CAM_SCENE_ICON_NORMAL_ARRAY_CAMCORDER }, + { R_CAM_SCENE_ICON_NORMAL_ARRAY_AH_CAMCORDER, R_CAM_SCENE_ICON_NORMAL_ARRAY_AH_PORTRAIT, R_CAM_SCENE_ICON_NORMAL_ARRAY_AH_VIEWMODE, R_CAM_SCENE_ICON_NORMAL_ARRAY_AH_CAMCORDER }, + { R_CAM_SCENE_ICON_DISPLACED_ARRAY_CAMCORDER, R_CAM_SCENE_ICON_DISPLACED_ARRAY_PORTRAIT, R_CAM_SCENE_ICON_DISPLACED_ARRAY_VIEWMODE, R_CAM_SCENE_ICON_DISPLACED_ARRAY_CAMCORDER }, + { R_CAM_SCENE_ICON_DISPLACED_ARRAY_AH_CAMCORDER, R_CAM_SCENE_ICON_DISPLACED_ARRAY_AH_PORTRAIT, R_CAM_SCENE_ICON_DISPLACED_ARRAY_AH_VIEWMODE, R_CAM_SCENE_ICON_DISPLACED_ARRAY_AH_CAMCORDER }, + { R_CAM_SCENE_SCROLLBAR_POSITION_CAMCORDER, R_CAM_SCENE_SCROLLBAR_POSITION_PORTRAIT, R_CAM_SCENE_SCROLLBAR_POSITION_VIEWMODE, R_CAM_SCENE_SCROLLBAR_POSITION_CAMCORDER }, +// 60: + { R_CAM_SCENE_SCROLLBAR_POSITION_AH_CAMCORDER, R_CAM_SCENE_SCROLLBAR_POSITION_AH_PORTRAIT, R_CAM_SCENE_SCROLLBAR_POSITION_AH_VIEWMODE, R_CAM_SCENE_SCROLLBAR_POSITION_AH_CAMCORDER }, + { R_CAM_CAPSETUP_LISTBOX_ICON_RECT, R_CAM_CAPSETUP_LISTBOX_ICON_RECT, R_CAM_CAPSETUP_LISTBOX_ICON_RECT, R_CAM_CAPSETUP_LISTBOX_ICON_RECT }, + { R_CAM_CAPSETUP_LISTBOX_ICON_RECT_AH, R_CAM_CAPSETUP_LISTBOX_ICON_RECT_AH, R_CAM_CAPSETUP_LISTBOX_ICON_RECT_AH, R_CAM_CAPSETUP_LISTBOX_ICON_RECT_AH }, + { R_CAM_CAPSETUP_LISTBOX_RADIOBUT_RECT, R_CAM_CAPSETUP_LISTBOX_RADIOBUT_RECT, R_CAM_CAPSETUP_LISTBOX_RADIOBUT_RECT, R_CAM_CAPSETUP_LISTBOX_RADIOBUT_RECT }, + { R_CAM_CAPSETUP_LISTBOX_RADIOBUT_RECT_AH, R_CAM_CAPSETUP_LISTBOX_RADIOBUT_RECT_AH, R_CAM_CAPSETUP_LISTBOX_RADIOBUT_RECT_AH, R_CAM_CAPSETUP_LISTBOX_RADIOBUT_RECT_AH }, + { R_CAM_CAPSETUP_LISTBOX_TEXT_RECT, R_CAM_CAPSETUP_LISTBOX_TEXT_RECT, R_CAM_CAPSETUP_LISTBOX_TEXT_RECT, R_CAM_CAPSETUP_LISTBOX_TEXT_RECT }, + { R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_APAC, R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_APAC, R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_APAC, R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_APAC }, + { R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_AH, R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_AH, R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_AH, R_CAM_CAPSETUP_LISTBOX_TEXT_RECT_AH }, + { R_CAM_CAPTURE_SETUP_LIST_STILL_WHITEBALANCE, R_CAM_CAPTURE_SETUP_LIST_STILL_WHITEBALANCE, R_CAM_CAPTURE_SETUP_LIST_STILL_WHITEBALANCE, R_CAM_CAPTURE_SETUP_LIST_STILL_WHITEBALANCE }, + { R_CAM_CAPTURE_SETUP_LIST_STILL_COLOUREFFECT, R_CAM_CAPTURE_SETUP_LIST_STILL_COLOUREFFECT, R_CAM_CAPTURE_SETUP_LIST_STILL_COLOUREFFECT, R_CAM_CAPTURE_SETUP_LIST_STILL_COLOUREFFECT }, +// 70: + { R_CAM_CAPTURE_SETUP_LIST_STILL_FLASH, R_CAM_CAPTURE_SETUP_LIST_STILL_FLASH, R_CAM_CAPTURE_SETUP_LIST_STILL_FLASH, R_CAM_CAPTURE_SETUP_LIST_STILL_FLASH }, + { R_CAM_CAPTURE_SETUP_LIST_VIDEO_WHITEBALANCE, R_CAM_CAPTURE_SETUP_LIST_VIDEO_WHITEBALANCE, R_CAM_CAPTURE_SETUP_LIST_VIDEO_WHITEBALANCE, R_CAM_CAPTURE_SETUP_LIST_VIDEO_WHITEBALANCE }, + { R_CAM_CAPTURE_SETUP_LIST_VIDEO_COLOUREFFECT, R_CAM_CAPTURE_SETUP_LIST_VIDEO_COLOUREFFECT, R_CAM_CAPTURE_SETUP_LIST_VIDEO_COLOUREFFECT, R_CAM_CAPTURE_SETUP_LIST_VIDEO_COLOUREFFECT }, + { R_CAM_CAPTURE_SETUP_LIST_PHOTO_IMAGESHARPNESS, R_CAM_CAPTURE_SETUP_LIST_PHOTO_IMAGESHARPNESS, R_CAM_CAPTURE_SETUP_LIST_PHOTO_IMAGESHARPNESS, R_CAM_CAPTURE_SETUP_LIST_PHOTO_IMAGESHARPNESS }, + { R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA, R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA, R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA, R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA }, + { R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_APAC, R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_APAC, R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_APAC, R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_APAC }, + { R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_AH, R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_AH, R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_AH, R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_AH }, + { R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA, R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA, R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA, R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA }, + { R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_APAC, R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_APAC, R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_APAC, R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_APAC }, + { R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_AH, R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_AH, R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_AH, R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_AH }, +// 80: + { R_CAM_CAPTURE_SETUP_CONTROL_POSITION, R_CAM_CAPTURE_SETUP_CONTROL_POSITION, R_CAM_CAPTURE_SETUP_CONTROL_POSITION, R_CAM_CAPTURE_SETUP_CONTROL_POSITION }, + { R_CAM_CAPTURE_SETUP_CONTROL_POSITION_AH, R_CAM_CAPTURE_SETUP_CONTROL_POSITION_AH, R_CAM_CAPTURE_SETUP_CONTROL_POSITION_AH, R_CAM_CAPTURE_SETUP_CONTROL_POSITION_AH }, + { R_CAM_CAPTURE_SETUP_LISTBOX_WIDTH, R_CAM_CAPTURE_SETUP_LISTBOX_WIDTH, R_CAM_CAPTURE_SETUP_LISTBOX_WIDTH, R_CAM_CAPTURE_SETUP_LISTBOX_WIDTH }, + { R_CAM_CAPTURE_SETUP_LISTBOX_ITEM_HEIGHT, R_CAM_CAPTURE_SETUP_LISTBOX_ITEM_HEIGHT, R_CAM_CAPTURE_SETUP_LISTBOX_ITEM_HEIGHT, R_CAM_CAPTURE_SETUP_LISTBOX_ITEM_HEIGHT }, + { R_CAM_CAPTURE_SETUP_CONTVF_RECT, R_CAM_CAPTURE_SETUP_CONTVF_RECT, R_CAM_CAPTURE_SETUP_CONTVF_RECT, R_CAM_CAPTURE_SETUP_CONTVF_RECT }, + { R_CAM_CAPTURE_SETUP_CONTVF_RECT_AH, R_CAM_CAPTURE_SETUP_CONTVF_RECT_AH, R_CAM_CAPTURE_SETUP_CONTVF_RECT_AH, R_CAM_CAPTURE_SETUP_CONTVF_RECT_AH }, + { R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT, R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT, R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT, R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT }, + { R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT_AH, R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT_AH, R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT_AH, R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT_AH }, + { R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_APAC, R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_APAC, R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_APAC, R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_APAC }, + { R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_AH, R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_AH, R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_AH, R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT_AH }, +// 90: + { R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT, R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT, R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT, R_CAM_CAPTURE_SETUP_CONT_TITLETEXT_LAYOUT }, + { R_CAM_USER_SCENE_SETUP_VIEW, R_CAM_USER_SCENE_SETUP_VIEW, R_CAM_USER_SCENE_SETUP_VIEW, R_CAM_USER_SCENE_SETUP_VIEW }, + { R_CAM_USER_SCENE_SETUP_MENUBAR, R_CAM_USER_SCENE_SETUP_MENUBAR, R_CAM_USER_SCENE_SETUP_MENUBAR, R_CAM_USER_SCENE_SETUP_MENUBAR }, + { R_CAM_USER_SCENE_SETUP_MENU, R_CAM_USER_SCENE_SETUP_MENU, R_CAM_USER_SCENE_SETUP_MENU, R_CAM_USER_SCENE_SETUP_MENU }, + { R_CAM_LAYOUT_ZOOM_PANE_CAMCORDER, R_CAM_LAYOUT_ZOOM_PANE_PORTRAIT, R_CAM_LAYOUT_ZOOM_PANE_VIEWMODE, R_CAM_LAYOUT_ZOOM_PANE_CAMCORDER_LEFT }, + { R_CAM_LAYOUT_ZOOM_PANE_SHAFT_CAMCORDER, R_CAM_LAYOUT_ZOOM_PANE_SHAFT_PORTRAIT, R_CAM_LAYOUT_ZOOM_PANE_SHAFT_VIEWMODE, R_CAM_LAYOUT_ZOOM_PANE_SHAFT_CAMCORDER_LEFT }, + { R_CAM_VIEWFINDER_RECT_STILL_CAMCORDER, R_CAM_VIEWFINDER_RECT_STILL_PORTRAIT, R_CAM_VIEWFINDER_RECT_STILL_VIEWMODE, R_CAM_VIEWFINDER_RECT_STILL_CAMCORDER }, + { R_CAM_STILL_DISPLAYED_RECT_SECONDARY_CAMCORDER, R_CAM_STILL_DISPLAYED_RECT_SECONDARY_PORTRAIT, R_CAM_STILL_DISPLAYED_RECT_SECONDARY_VIEWMODE, R_CAM_STILL_DISPLAYED_RECT_SECONDARY_CAMCORDER }, + { R_CAM_STILL_REQUESTED_RECT_SECONDARY_CAMCORDER, R_CAM_STILL_REQUESTED_RECT_SECONDARY_PORTRAIT, R_CAM_STILL_REQUESTED_RECT_SECONDARY_VIEWMODE, R_CAM_STILL_REQUESTED_RECT_SECONDARY_CAMCORDER }, + { R_CAM_VIEWFINDER_RECT_CIF_CAMCORDER, R_CAM_VIEWFINDER_RECT_CIF_PORTRAIT, R_CAM_VIEWFINDER_RECT_CIF_VIEWMODE, R_CAM_VIEWFINDER_RECT_CIF_CAMCORDER }, +// 100: + { R_CAM_VIEWFINDER_RECT_QCIF_CAMCORDER, R_CAM_VIEWFINDER_RECT_QCIF_PORTRAIT, R_CAM_VIEWFINDER_RECT_QCIF_VIEWMODE, R_CAM_VIEWFINDER_RECT_QCIF_CAMCORDER }, + { R_CAM_VIEWFINDER_RECT_SQCIF_CAMCORDER, R_CAM_VIEWFINDER_RECT_SQCIF_PORTRAIT, R_CAM_VIEWFINDER_RECT_SQCIF_VIEWMODE, R_CAM_VIEWFINDER_RECT_SQCIF_CAMCORDER }, + { R_CAM_VIEWFINDER_RECT_SECONDARY_CAMCORDER, R_CAM_VIEWFINDER_RECT_SECONDARY_PORTRAIT, R_CAM_VIEWFINDER_RECT_SECONDARY_VIEWMODE, R_CAM_VIEWFINDER_RECT_SECONDARY_CAMCORDER }, + { R_CAM_SNAPSHOT_RECT_STILL_CAMCORDER, R_CAM_SNAPSHOT_RECT_STILL_PORTRAIT, R_CAM_SNAPSHOT_RECT_STILL_VIEWMODE, R_CAM_SNAPSHOT_RECT_STILL_CAMCORDER }, + { R_CAM_SNAPSHOT_RECT_CIF_CAMCORDER, R_CAM_SNAPSHOT_RECT_CIF_PORTRAIT, R_CAM_SNAPSHOT_RECT_CIF_VIEWMODE, R_CAM_SNAPSHOT_RECT_CIF_CAMCORDER }, + { R_CAM_SNAPSHOT_RECT_NEAR_CIF_CAMCORDER, R_CAM_SNAPSHOT_RECT_NEAR_CIF_PORTRAIT, R_CAM_SNAPSHOT_RECT_NEAR_CIF_VIEWMODE, R_CAM_SNAPSHOT_RECT_NEAR_CIF_CAMCORDER }, + { R_CAM_SNAPSHOT_RECT_SQCIF_CAMCORDER, R_CAM_SNAPSHOT_RECT_SQCIF_PORTRAIT, R_CAM_SNAPSHOT_RECT_SQCIF_VIEWMODE, R_CAM_SNAPSHOT_RECT_SQCIF_CAMCORDER }, + { R_CAM_ZOOM_PANE_WIDTH_CAMCORDER, R_CAM_ZOOM_PANE_WIDTH_PORTRAIT, R_CAM_ZOOM_PANE_WIDTH_VIEWMODE, R_CAM_ZOOM_PANE_WIDTH_CAMCORDER }, + {0, 0, 0, 0}, // Resource deleted + { R_CAM_CAPTURE_SETUP_SLIDER_BRIGHTNESS_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_BRIGHTNESS_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_BRIGHTNESS_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_BRIGHTNESS_ARRAY }, +// 110: + { R_CAM_CAPTURE_SETUP_SLIDER_BRIGHTNESS_ARRAY_AH, R_CAM_CAPTURE_SETUP_SLIDER_BRIGHTNESS_ARRAY_AH, R_CAM_CAPTURE_SETUP_SLIDER_BRIGHTNESS_ARRAY_AH, R_CAM_CAPTURE_SETUP_SLIDER_BRIGHTNESS_ARRAY_AH }, + { R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY }, + { R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY_AH, R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY_AH, R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY_AH, R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY_AH }, + { R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY }, + { R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY_AH, R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY_AH, R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY_AH, R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY_AH }, + { R_CAM_CAPTURE_SETUP_SLIDER_COLOURSATURATION_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_COLOURSATURATION_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_COLOURSATURATION_ARRAY, R_CAM_CAPTURE_SETUP_SLIDER_COLOURSATURATION_ARRAY }, + {0, 0, 0, 0}, // Resource deleted + {0, 0, 0, 0}, // Resource deleted + {0, 0, 0, 0}, // Resource deleted + {0, 0, 0, 0}, // Resource deleted +// 120: + {0, 0, 0, 0}, // Resource deleted + {0, 0, 0, 0}, // Resource deleted + {0, 0, 0, 0}, // Resource deleted + { R_CAM_CAPTURE_SETUP_SLIDER_SHAFT, R_CAM_CAPTURE_SETUP_SLIDER_SHAFT, R_CAM_CAPTURE_SETUP_SLIDER_SHAFT, R_CAM_CAPTURE_SETUP_SLIDER_SHAFT }, + { R_CAM_CAPTURE_SETUP_SLIDER_THUMB, R_CAM_CAPTURE_SETUP_SLIDER_THUMB, R_CAM_CAPTURE_SETUP_SLIDER_THUMB, R_CAM_CAPTURE_SETUP_SLIDER_THUMB }, + { R_CAM_CAPTURE_SETUP_SLIDER_SHAFT_AH, R_CAM_CAPTURE_SETUP_SLIDER_SHAFT_AH, R_CAM_CAPTURE_SETUP_SLIDER_SHAFT_AH, R_CAM_CAPTURE_SETUP_SLIDER_SHAFT_AH }, + { R_CAM_CAPTURE_SETUP_SLIDER_THUMB_AH, R_CAM_CAPTURE_SETUP_SLIDER_THUMB_AH, R_CAM_CAPTURE_SETUP_SLIDER_THUMB_AH, R_CAM_CAPTURE_SETUP_SLIDER_THUMB_AH }, + { R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION, R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION, R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION, R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION }, + { R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION_AH, R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION_AH, R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION_AH, R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION_AH }, + { R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_CAMCORDER, R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_PORTRAIT, R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_VIEWMODE, R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_CAMCORDER }, +// 130: + { R_CAM_POST_CAPTURE_VIDEO_SIZE_LAYOUT_CAMCORDER, R_CAM_POST_CAPTURE_VIDEO_SIZE_LAYOUT_PORTRAIT, R_CAM_POST_CAPTURE_VIDEO_SIZE_LAYOUT_VIEWMODE, R_CAM_POST_CAPTURE_VIDEO_SIZE_LAYOUT_CAMCORDER }, + { R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_AH_CAMCORDER, R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_AH_PORTRAIT, R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_AH_VIEWMODE, R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_AH_CAMCORDER }, + { R_CAM_POST_CAPTURE_VIDEO_SIZE_LAYOUT_AH_CAMCORDER, R_CAM_POST_CAPTURE_VIDEO_SIZE_LAYOUT_AH_PORTRAIT, R_CAM_POST_CAPTURE_VIDEO_SIZE_LAYOUT_AH_VIEWMODE, R_CAM_POST_CAPTURE_VIDEO_SIZE_LAYOUT_AH_CAMCORDER }, + { R_CAM_QUALITY_SLIDER_SHAFT, R_CAM_QUALITY_SLIDER_SHAFT, R_CAM_QUALITY_SLIDER_SHAFT, R_CAM_QUALITY_SLIDER_SHAFT }, + { R_CAM_QUALITY_SLIDER_SHAFT_AH, R_CAM_QUALITY_SLIDER_SHAFT_AH, R_CAM_QUALITY_SLIDER_SHAFT_AH, R_CAM_QUALITY_SLIDER_SHAFT_AH }, + { R_CAM_QUALITY_SLIDER_THUMB, R_CAM_QUALITY_SLIDER_THUMB, R_CAM_QUALITY_SLIDER_THUMB, R_CAM_QUALITY_SLIDER_THUMB }, + { R_CAM_QUALITY_SLIDER_THUMB_AH, R_CAM_QUALITY_SLIDER_THUMB_AH, R_CAM_QUALITY_SLIDER_THUMB_AH, R_CAM_QUALITY_SLIDER_THUMB_AH }, + { R_CAM_SETTING_PHOTO_QUALITY_SLIDER, R_CAM_SETTING_PHOTO_QUALITY_SLIDER, R_CAM_SETTING_PHOTO_QUALITY_SLIDER, R_CAM_SETTING_PHOTO_QUALITY_SLIDER }, + { R_CAM_SETTING_VIDEO_QUALITY_SLIDER, R_CAM_SETTING_VIDEO_QUALITY_SLIDER, R_CAM_SETTING_VIDEO_QUALITY_SLIDER, R_CAM_SETTING_VIDEO_QUALITY_SLIDER }, + { R_CAM_SETTING_QUALITY_SLIDER_LAYOUT, R_CAM_SETTING_QUALITY_SLIDER_LAYOUT, R_CAM_SETTING_QUALITY_SLIDER_LAYOUT, R_CAM_SETTING_QUALITY_SLIDER_LAYOUT }, +// 140: + { R_CAM_PHOTO_QUALITY_SLIDER_ARRAY_CAMCORDER, R_CAM_PHOTO_QUALITY_SLIDER_ARRAY_CAMCORDER, R_CAM_PHOTO_QUALITY_SLIDER_ARRAY_CAMCORDER, R_CAM_PHOTO_QUALITY_SLIDER_ARRAY_CAMCORDER }, + { R_CAM_PHOTO_QUALITY_SLIDER_ARRAY_AH_CAMCORDER, R_CAM_PHOTO_QUALITY_SLIDER_ARRAY_AH_CAMCORDER, R_CAM_PHOTO_QUALITY_SLIDER_ARRAY_AH_CAMCORDER, R_CAM_PHOTO_QUALITY_SLIDER_ARRAY_AH_CAMCORDER }, + { R_CAM_VIDEO_QUALITY_SLIDER_ARRAY_CAMCORDER, R_CAM_VIDEO_QUALITY_SLIDER_ARRAY_PORTRAIT, R_CAM_VIDEO_QUALITY_SLIDER_ARRAY_VIEWMODE, R_CAM_VIDEO_QUALITY_SLIDER_ARRAY_CAMCORDER }, + { R_CAM_VIDEO_QUALITY_SLIDER_ARRAY_AH_CAMCORDER, R_CAM_VIDEO_QUALITY_SLIDER_ARRAY_AH_PORTRAIT, R_CAM_VIDEO_QUALITY_SLIDER_ARRAY_AH_VIEWMODE, R_CAM_VIDEO_QUALITY_SLIDER_ARRAY_AH_CAMCORDER }, + { R_CAM_SIDEPANE_RECT_CAM1_CAMCORDER, R_CAM_SIDEPANE_RECT_CAM1_PORTRAIT, R_CAM_SIDEPANE_RECT_CAM1_VIEWMODE, R_CAM_SIDEPANE_RECT_CAM1_CAMCORDER }, + { R_CAM_SIDEPANE_RECT_CAM2_CAMCORDER, R_CAM_SIDEPANE_RECT_CAM2_PORTRAIT, R_CAM_SIDEPANE_RECT_CAM2_VIEWMODE, R_CAM_SIDEPANE_RECT_CAM2_CAMCORDER }, + { R_CAM_SETTING_LIST_VIEW, R_CAM_SETTING_LIST_VIEW, R_CAM_SETTING_LIST_VIEW, R_CAM_SETTING_LIST_VIEW }, + { R_CAM_SETTINGS_LIST_MENUBAR, R_CAM_SETTINGS_LIST_MENUBAR, R_CAM_SETTINGS_LIST_MENUBAR, R_CAM_SETTINGS_LIST_MENUBAR }, + { R_CAM_SETTINGS_LIST_MENU, R_CAM_SETTINGS_LIST_MENU, R_CAM_SETTINGS_LIST_MENU, R_CAM_SETTINGS_LIST_MENUBAR }, + { R_CAM_VIDEO_SETTINGS_ITEM_LIST_CAMCORDER, R_CAM_VIDEO_SETTINGS_ITEM_LIST_PORTRAIT, R_CAM_VIDEO_SETTINGS_ITEM_LIST_CAMCORDER, R_CAM_VIDEO_SETTINGS_ITEM_LIST_CAMCORDER }, +// 150: + { R_CAM_EMBEDDED_VIDEO_SETTINGS_ITEM_LIST_CAMCORDER, R_CAM_EMBEDDED_VIDEO_SETTINGS_ITEM_LIST_PORTRAIT, R_CAM_EMBEDDED_VIDEO_SETTINGS_ITEM_LIST_CAMCORDER, R_CAM_EMBEDDED_VIDEO_SETTINGS_ITEM_LIST_CAMCORDER }, + { R_CAM_SETTINGS_LIST_SETTINGS_PAGE, R_CAM_SETTINGS_LIST_SETTINGS_PAGE, R_CAM_SETTINGS_LIST_SETTINGS_PAGE, R_CAM_SETTINGS_LIST_SETTINGS_PAGE }, + { R_CAM_PHOTO_SETTINGS_ITEM_LIST_CAMCORDER, R_CAM_PHOTO_SETTINGS_ITEM_LIST_PORTRAIT, R_CAM_PHOTO_SETTINGS_ITEM_LIST_CAMCORDER, R_CAM_PHOTO_SETTINGS_ITEM_LIST_CAMCORDER }, + { R_CAM_EMBEDDED_PHOTO_SETTINGS_ITEM_LIST_CAMCORDER, R_CAM_EMBEDDED_PHOTO_SETTINGS_ITEM_LIST_PORTRAIT, R_CAM_EMBEDDED_PHOTO_SETTINGS_ITEM_LIST_CAMCORDER, R_CAM_EMBEDDED_PHOTO_SETTINGS_ITEM_LIST_CAMCORDER }, + { R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_CAMCORDER, R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_PORTRAIT, R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_VIEWMODE, R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_CAMCORDER_LEFT }, + { R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_AH_CAMCORDER, R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_AH_PORTRAIT, R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_AH_VIEWMODE, R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_AH_CAMCORDER_LEFT }, + { R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_CAMCORDER, R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_PORTRAIT, R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_VIEWMODE, R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_CAMCORDER_LEFT }, + { R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_AH_CAMCORDER, R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_AH_PORTRAIT, R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_AH_VIEWMODE, R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_AH_CAMCORDER_LEFT }, + { R_CAM_VIDEO_PRECAP_FILE_TYPE, R_CAM_VIDEO_PRECAP_FILE_TYPE, R_CAM_VIDEO_PRECAP_FILE_TYPE, R_CAM_VIDEO_PRECAP_FILE_TYPE_LEFT }, + { R_CAM_VIDEO_PRECAP_FILE_TYPE_AH, R_CAM_VIDEO_PRECAP_FILE_TYPE_AH, R_CAM_VIDEO_PRECAP_FILE_TYPE_AH, R_CAM_VIDEO_PRECAP_FILE_TYPE_AH_LEFT }, +// 160: + { R_CAM_IMG_PRECAP_MEMORY_LOCATION, R_CAM_IMG_PRECAP_MEMORY_LOCATION_PORTRAIT, R_CAM_IMG_PRECAP_MEMORY_LOCATION_VIEWMODE, R_CAM_IMG_PRECAP_MEMORY_LOCATION_LEFT }, + { R_CAM_IMG_PRECAP_MEMORY_LOCATION_AH, R_CAM_IMG_PRECAP_MEMORY_LOCATION_AH_PORTRAIT, R_CAM_IMG_PRECAP_MEMORY_LOCATION_AH_PORTRAIT, R_CAM_IMG_PRECAP_MEMORY_LOCATION_AH_LEFT }, + { R_CAM_VIDEO_PRECAP_MEMORY_LOCATION, R_CAM_VIDEO_PRECAP_MEMORY_LOCATION_PORTRAIT, R_CAM_VIDEO_PRECAP_MEMORY_LOCATION_PORTRAIT, R_CAM_VIDEO_PRECAP_MEMORY_LOCATION_LEFT }, + { R_CAM_VIDEO_PRECAP_MEMORY_LOCATION_AH, R_CAM_VIDEO_PRECAP_MEMORY_LOCATION_AH_PORTRAIT, R_CAM_VIDEO_PRECAP_MEMORY_LOCATION_AH_PORTRAIT, R_CAM_VIDEO_PRECAP_MEMORY_LOCATION_AH_LEFT }, + { R_CAM_SNAPSHOT_RECT_STILL_ROTATED, R_CAM_SNAPSHOT_RECT_STILL_ROTATED, R_CAM_SNAPSHOT_RECT_STILL_ROTATED, R_CAM_SNAPSHOT_RECT_STILL_ROTATED }, + { R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_AH, R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_AH, R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_AH, R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_AH }, + { R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_APAC, R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_APAC, R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_APAC, R_CAM_SETTING_QUALITY_SLIDER_LAYOUT_APAC }, + { R_CAM_CAPTURE_SETUP_SELF_TIMER, R_CAM_CAPTURE_SETUP_SELF_TIMER, R_CAM_CAPTURE_SETUP_SELF_TIMER, R_CAM_CAPTURE_SETUP_SELF_TIMER }, + { R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON, R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON_PORTRAIT, R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON_VIEWMODE, R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON_LEFT }, + { R_CAM_TIMELAPSE_POST_CAPTURE_MENUBAR, R_CAM_TIMELAPSE_POST_CAPTURE_MENUBAR, R_CAM_TIMELAPSE_POST_CAPTURE_MENUBAR, R_CAM_TIMELAPSE_POST_CAPTURE_MENUBAR }, +// 170: + { R_CAM_LAYOUT_ZOOM_PANE_HORIZ_CAMCORDER, R_CAM_LAYOUT_ZOOM_PANE_HORIZ_CAMCORDER, R_CAM_LAYOUT_ZOOM_PANE_HORIZ_CAMCORDER, R_CAM_LAYOUT_ZOOM_PANE_HORIZ_CAMCORDER_LEFT }, + { R_CAM_LAYOUT_ZOOM_PANE_SHAFT_HORIZ_CAMCORDER, R_CAM_LAYOUT_ZOOM_PANE_SHAFT_HORIZ_CAMCORDER, R_CAM_LAYOUT_ZOOM_PANE_SHAFT_HORIZ_CAMCORDER, R_CAM_LAYOUT_ZOOM_PANE_SHAFT_HORIZ_CAMCORDER_LEFT }, + { R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT, R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_ID, R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT, R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT }, + { R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_AH, R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_AH_ID, R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_AH, R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_AH }, + { R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_APAC, R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_APAC_ID, R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_APAC, R_CAM_CAPTURE_SETUP_CONT_NOVF_TITLETEXT_LAYOUT_APAC }, + { R_CAM_VIDEO_FILETYPE_PANE_CAMCORDER, R_CAM_VIDEO_FILETYPE_PANE_PORTRAIT, R_CAM_VIDEO_FILETYPE_PANE_VIEWMODE, R_CAM_VIDEO_FILETYPE_PANE_CAMCORDER_LEFT }, + { R_CAM_VIDEO_CAP_LIMIT_FILE_TYPE, R_CAM_VIDEO_CAP_LIMIT_FILE_TYPE_PORTRAIT, R_CAM_VIDEO_CAP_LIMIT_FILE_TYPE_VIEWMODE, R_CAM_VIDEO_CAP_LIMIT_FILE_TYPE_LEFT }, + { R_CAM_VIDEO_PRECAP_QUALITY_ICONS, R_CAM_VIDEO_PRECAP_QUALITY_ICONS_PORTRAIT, R_CAM_VIDEO_PRECAP_QUALITY_ICONS_VIEWMODE, R_CAM_VIDEO_PRECAP_QUALITY_ICONS_LEFT }, + { R_CAM_VIDEO_CAP_LIMIT_QUALITY_ICONS, R_CAM_VIDEO_CAP_LIMIT_QUALITY_ICONS_PORTRAIT, R_CAM_VIDEO_CAP_LIMIT_QUALITY_ICONS_VIEWMODE, R_CAM_VIDEO_CAP_LIMIT_QUALITY_ICONS_LEFT }, + { R_CAM_IMG_PRECAP_QUALITY_ICONS, R_CAM_IMG_PRECAP_QUALITY_ICONS_PORTRAIT, R_CAM_IMG_PRECAP_QUALITY_ICONS_VIEWMODE, R_CAM_IMG_PRECAP_QUALITY_ICONS_LEFT }, +// 180: + { R_CAM_VIDEO_CAP_UNLIMITED_REMAINING_TIME, R_CAM_VIDEO_CAP_UNLIMITED_REMAINING_TIME_PORTRAIT, R_CAM_VIDEO_CAP_UNLIMITED_REMAINING_TIME_VIEWMODE, R_CAM_VIDEO_CAP_UNLIMITED_REMAINING_TIME_LEFT }, + { R_CAM_VIDEO_CAP_UNLIMITED_REMAINING_TIME_AH, R_CAM_VIDEO_CAP_UNLIMITED_REMAINING_TIME_AH_PORTRAIT, R_CAM_VIDEO_CAP_UNLIMITED_REMAINING_TIME_AH_VIEWMODE, R_CAM_VIDEO_CAP_UNLIMITED_REMAINING_TIME_AH_LEFT }, + { R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON, R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON_PORTRAIT, R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON_VIEWMODE, R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON_LEFT }, + { R_CAM_VIDEO_CAP_UNLIMIT_FILE_TYPE, R_CAM_VIDEO_CAP_UNLIMIT_FILE_TYPE_PORTRAIT, R_CAM_VIDEO_CAP_UNLIMIT_FILE_TYPE_VIEWMODE, R_CAM_VIDFILETYPE_CAPTURE_ICON_RECT_NOPROGBAR_CAMCORDER_LEFT }, + { R_CAM_VIDEO_CAP_UNLIMIT_QUALITY_ICONS, R_CAM_VIDEO_CAP_UNLIMIT_QUALITY_ICONS_PORTRAIT, R_CAM_VIDEO_CAP_UNLIMIT_QUALITY_ICONS_VIEWMODE, R_CAM_VIDEO_CAP_UNLIMIT_QUALITY_ICONS_LEFT }, + { R_CAM_CAPTURE_SETUP_LISTBOX_WIDTH_NOVF, R_CAM_CAPTURE_SETUP_LISTBOX_WIDTH_NOVF, R_CAM_CAPTURE_SETUP_LISTBOX_WIDTH_NOVF, R_CAM_CAPTURE_SETUP_LISTBOX_WIDTH_NOVF }, + { R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT, R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT, R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT, R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT }, + { R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_APAC, R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_APAC, R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_APAC, R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_APAC }, + { R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_AH, R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_AH, R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_AH, R_CAM_CAPSETUP_SCENE_LISTBOX_TEXT_RECT_AH }, + { R_CAM_VIDEO_CAP_UNLIMITED_ELAPSED_TIME, R_CAM_VIDEO_CAP_UNLIMITED_ELAPSED_TIME_PORTRAIT, R_CAM_VIDEO_CAP_UNLIMITED_ELAPSED_TIME_VIEWMODE, R_CAM_VIDEO_CAP_UNLIMITED_ELAPSED_TIME_LEFT }, +// 190: + { R_CAM_VIDEO_CAP_UNLIMITED_ELAPSED_TIME_AH, R_CAM_VIDEO_CAP_UNLIMITED_ELAPSED_TIME_AH_PORTRAIT, R_CAM_VIDEO_CAP_UNLIMITED_ELAPSED_TIME_AH_VIEWMODE, R_CAM_VIDEO_CAP_UNLIMITED_ELAPSED_TIME_AH_LEFT }, + { R_CAM_CAPSETUP_MODE_LISTBOX_ICON_RECT_AH, R_CAM_CAPSETUP_MODE_LISTBOX_ICON_RECT_AH, R_CAM_CAPSETUP_MODE_LISTBOX_ICON_RECT_AH, R_CAM_CAPSETUP_MODE_LISTBOX_ICON_RECT_AH }, + { R_CAM_VIDEO_CAP_UNLIMIT_MEMORY_LOCATION, R_CAM_VIDEO_CAP_UNLIMIT_MEMORY_LOCATION_PORTRAIT, R_CAM_VIDEO_CAP_UNLIMIT_MEMORY_LOCATION_VIEWMODE, R_CAM_VIDEO_CAP_UNLIMIT_MEMORY_LOCATION_LEFT }, + { R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON_AH, R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON_AH_PORTRAIT, R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON_AH_VIEWMODE, R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON_AH_LEFT }, + { R_CAM_VIDEO_CAP_UNLIMIT_MEMORY_LOCATION_AH, R_CAM_VIDEO_CAP_UNLIMIT_MEMORY_LOCATION_AH_PORTRAIT, R_CAM_VIDEO_CAP_UNLIMIT_MEMORY_LOCATION_AH_VIEWMODE, R_CAM_VIDEO_CAP_UNLIMIT_MEMORY_LOCATION_AH_LEFT }, + { R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON_AH, R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON_AH_PORTRAIT, R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON_AH_VIEWMODE, R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON_AH_LEFT }, + { R_CAM_IMG_PRECAP_LOCATION, R_CAM_IMG_PRECAP_LOCATION_PORTRAIT, R_CAM_IMG_PRECAP_LOCATION_VIEWMODE, R_CAM_IMG_PRECAP_LOCATION_LEFT } + +}; + +#endif // CAM_RESOURCE_LOOKUP_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSAEventActive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSAEventActive.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles system agent events* +*/ + + + +#ifndef CAMSAEVENTACTIVE_H +#define CAMSAEVENTACTIVE_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CCamAppController; + +// CLASS DECLARATION + +/** +* Active Object listening to events coming from System Agent +* @since 2.8 +*/ + +class CCamSAEventActive : public CActive + { + public: // Constructors and destructor + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppController instance + * @param aSystemAgent System agent handle + */ + CCamSAEventActive( CCamAppController& aController, + const RSystemAgent& aSystemAgent ); + + /** + * Destructor. + */ + virtual ~CCamSAEventActive(); + + public: + /** + * Issue a request to receive events from System Agent + * @since 2.8 + */ + void IssueRequest(); + + private: // Functions from base classes + /** + * From CActive, called when RunL() is trapped by Active Scheduler + * @since 2.8 + * @param aError the error code trapped from RunL() + * @return TInt KErrNone + */ + TInt RunError( TInt aError ); + + /** + * From CActive called when an event comes from System Agent + * Calls HandleSAEvent in Controller to handle the event + * @since 2.8 + */ + void RunL(); + + /** + * From CActive Cancel request + * @since 2.8 + */ + void DoCancel(); + + private: + CCamAppController& iController; + RSystemAgent iSystemAgent; + TSysAgentEvent iSAEvent; + TBool iRequestIssued; + }; + +#endif // CAMSAEVENTACTIVE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSceneListBox.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSceneListBox.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera scenes list-box* +*/ + + + +#ifndef CAMSCENELISTBOX_H +#define CAMSCENELISTBOX_H + +// INCLUDES +#include "CamCaptureSetupListBox.h" +#include "CamAppController.h" + + +// CLASS DECLARATION + +/** +* List box for camera scenes. +* @since 3.0 +*/ +class CCamSceneListBox : public CCamCaptureSetupListBox + { + public: // Constructors and destructor + + /** + * Destructor. + */ + virtual ~CCamSceneListBox(); + + /** + * C++ default constructor. + */ + CCamSceneListBox( TCamCameraMode aMode, MCamSettingValueObserver* aObserver, + CCamAppController& aController); + + /** + * By default Symbian 2nd phase constructor is private. + * @param aParent Parent control (i.e. Shooting mode container) + * @param aSummaryTitleTextArray - array of shooting mode (scene) titles + * @param aSummaryDescriptionTextArray - array of shooting mode (scene) descriptions + * @param aUserBaseScenes - Whether we wish to display the User Scene Base Scene List + */ + void ConstructL( CCamAppController& aController, + const CCoeControl* aParent, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray, + TBool aUserBaseScenes ); + + private: + + // Scenes supported by product + RArray iSupportedScenes; + + // capture mode (still/video) + TCamCameraMode iMode; + }; + +#endif // CAMSCENELISTBOX_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSceneListBoxModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSceneListBoxModel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Scenes list box model* +*/ + + +#ifndef CAMSCENELISTBOXMODEL_H +#define CAMSCENELISTBOXMODEL_H + +// INCLUDES +#include "CamCaptureSetupListBoxModel.h" +#include "CamAppController.h" + +// CLASS DECLARATION + +class CCamAppController; + +/** +* List box model for Camera scenes +* +* @since 3.0 +*/ +class CCamSceneListBoxModel : public CCamCaptureSetupListBoxModel + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamSceneListBoxModel* NewLC( CCamAppController& aController, + TCamCameraMode aMode, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray, + TBool aUserBaseScenes, + TRect aListBoxRect ); + + /** + * Destructor. + */ + virtual ~CCamSceneListBoxModel(); + + + private: + + /** + * C++ default constructor. + */ + CCamSceneListBoxModel( CCamAppController& aController, + TCamCameraMode aMode, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray, + TBool aUserBaseScenes ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( TRect aListBoxRect ); + + /** + * Select the resource to use and load listbox data + * from the selected resource. + */ + void GetDataFromResourceL(); + + /** + * Get settings for all supported scenes + * @since 3.0 + * @param aResourceId ID of resource definition for scenes + */ + void GetScenesDataL( TInt aResourceId ); + + /** + * Is specified scene suported for current product + * @since 3.0 + * @param aSceneValue Identifier for scene (i.e ECamSceneAuto) + * @return ETrue if scene is supported by current product + */ + TBool IsSupportedScene( TInt aSceneValue ); + + + private: // Data + + // capture mode (still/video) + TCamCameraMode iMode; + + // Array of title descriptions for the summary title lines + RPointerArray& iSummaryTitleTextArray; + // Array of descriptons for the summary description lines + RPointerArray& iSummaryDescriptionTextArray; + + // Whether we are displaying the user scene base scene list or not. + TBool iUserBaseScenes; + CCamAppController& iController; + }; + +#endif // CAMSCENELISTBOXMODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSceneSettingContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSceneSettingContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,476 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for scene setting view +* +*/ + + + +#ifndef CAMSCENESETTINGCONTAINER_H +#define CAMSCENESETTINGCONTAINER_H + +// INCLUDES +#include "CamContainerBase.h" +#include "CamAppController.h" +#include "CamSettings.hrh" +#include + +// DATA TYPES +// Container class holding data for animated scene icons +class TCamAnimationData + { +public: + /** + * Set up animation data for scene setting icon + * @since 2.8 + * @param aRect The initial highlighted rect + */ + void Initialise( const TRect& aRect ); + + // the current highlighted rect to fade in + TRect iCurrentRect; + // old rect to rub out + TRect iCurrentRectOld; + // the previous rect to fade out + TRect iPreviousRect; + // old rect to rub out + TRect iPreviousRectOld; + // the icon rect to fade out + TRect iIconRectFadeOut; + // old rect to rub out + TRect iIconRectFadeOutOld; + // the icon rect to fade in + TRect iIconRectFadeIn; + // old rect to rub out + TRect iIconRectFadeInOld; + // the title rect to fade out + TRect iTitleFadeOut; + // old rect to rub out + TRect iTitleFadeOutOld; + // the title rect to fade in + TRect iTitleFadeIn; + // old rect to rub out + TRect iTitleFadeInOld; + // the pen color to use fading out + TRgb iPenFadeOut; + // the pen color to use fading in + TRgb iPenFadeIn; + // icon to fade out + const CFbsBitmap* iIconFadeOut; + // icon to fade in + const CFbsBitmap* iIconFadeIn; + // moving down the list + TBool iMovingDown; + // amount of pixels to animate the fade in/out + TBool iDeltaY; + // amount of pixels to scroll the list by + TBool iScrollingY; + // current step in the animation + TInt iStep; + // amount to add to the left margin when fading icons in/out + TReal iIconLeftInc; + // left margin offset for drawing the icon when fading in/out + TReal iIconLeftOffset; + // off screen bitmap to assist with the scrolling of the list + CFbsBitmap* iOffScreenBitmap; + // is the list in scrolling mode + TBool iScrolling; + // the position of the off screen bitmap + TPoint iOffScreenPos; + }; + +// the size of the icons used during fading +enum TCamIconSize + { + ECamIconSizeLarge, + ECamIconSizeSmall, + ECamIconSizeOne, + ECamIconSizeTwo, + ECamIconSizeThree, + ECamIconSizeFour, + ECamIconSizeFive, + ECamIconSizeSix + }; + +// FORWARD DECLARATIONS +class CAknView; + +// CLASS DECLARATION + +class CCamSceneSettingItem : public CBase + { + public: + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aSceneId Id of scene to create + * @param aLargeBmpSize the size of the largest icon to use + * @param aSmallBmpSize the size of the smallest icon to use + */ + static CCamSceneSettingItem* NewL( TCamSceneId aSceneId, + const TSize& aLargeBmpSize, + const TSize& aSmallBmpSize ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamSceneSettingItem(); + + /** + * Returns the scene id + * @return the scene id for this item + * @since 2.8 + */ + TCamSceneId SceneId() const; + + /** + * returns the bitmap for the given size + * @param aSize The bitmap size to return + * @return The bitmap for the size given + * @since 2.8 + */ + const CFbsBitmap* Icon( TCamIconSize aSize ) const; + + /** + * returns the item title + * @return the item title + * @since 2.8 + */ + const HBufC* Title() const; + + /** + * returns the item description + * @return the item description + * @since 2.8 + */ + const HBufC* Description() const; + + + private: + + /** + * Symbian OS 2nd phase constructor. + * @param aLargeBmpSize the size of the largest icon to use + * @param aSmallBmpSize the size of the smallest icon to use + * @since 2.8 + */ + void ConstructL( const TSize& aLargeBmpSize, + const TSize& aSmallBmpSize ); + + /** + * C++ constructor + * @param aSceneId Id of scene to create + * @since 2.8 + */ + CCamSceneSettingItem( TCamSceneId aSceneId ); + + private: + // the bitmap for non-highlighted items + CFbsBitmap* iBitmapSmall; + // bitmap 1 in the fade in/out animation + CFbsBitmap* iBitmap1; + // bitmap 2 in the fade in/out animation + CFbsBitmap* iBitmap2; + // bitmap 3 in the fade in/out animation + CFbsBitmap* iBitmap3; + // bitmap 4 in the fade in/out animation + CFbsBitmap* iBitmap4; + // bitmap 5 in the fade in/out animation + CFbsBitmap* iBitmap5; + // bitmap 6 in the fade in/out animation + CFbsBitmap* iBitmap6; + // the bitmap to use for highlighted items + CFbsBitmap* iBitmapLarge; + // the title of the item + HBufC* iTitle; + // the description of the icon + HBufC* iDescription; + // the scene id of the item + TCamSceneId iSceneId; + + }; + + +/** +* Container for still image Post capture view +*/ +class CCamSceneSettingContainer : public CCamContainerBase, + public MEikScrollBarObserver + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aRect Frame rectangle for container. + * @param aView Reference to the view containing this container + * @param aMode Current capture mode + * @param aController reference to CCamAppControllerBase instance + * @param aUserBaseScenes Specifies whether this list should + * display the base scenes for the user scene. + */ + static CCamSceneSettingContainer* NewL( const TRect& aRect, + CAknView& aView, + TCamCameraMode aMode, + CCamAppController& aController, + TBool aUserBaseScenes = EFalse ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamSceneSettingContainer(); + + private: + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + */ + void ConstructL( const TRect& aRect ); + + /** + * Reads the layout info from the resource + * @since 2.8 + * @param aResourceId The resource containing the layout info + * @param aArray The array to add the layout info to. + */ + void ReadLayoutL( TInt aResourceId, RArray& aArray ) const; + void ReadLayoutL( TInt aResourceId, RArray& aArray ) const; + + /** + * C++ constructor + * @since 2.8 + * @param aMode Current capture mode + * @param aController reference to CCamAppControllerBase instance + * @param aView Reference to the view containing this container + * @param aUserBaseScenes Specifies whether this list should + * display the base scenes for the user scene. + */ + CCamSceneSettingContainer( TCamCameraMode aMode, + CCamAppController& aController, + CAknView& aView, + TBool aUserBaseScenes ); + + public: // New functions + /** + * Is the user scene currently selected + * @since 2.8 + * @return ETrue if user scene highlighted + */ + TBool UserSceneHighlighted(); + + /** + * Saves the selected scene in dynamic settings + * @since 2.8 + * @return ETrue if the scene setting was changed successfully. + */ + TBool SaveSceneSettingL(); + + protected: // Functions from base classes + /** + * From CoeControl + * @since 2.8 + * @return number of contained controls + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl + * @since 2.8 + * @param aIndex The index of the required control + * @return Returns the requested control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl + * @since 2.8 + * @param aRect area where to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * From CamContainerBase + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From MEikScrollBarObserver + * Called when a new thumbnail has been generated + * @since 2.8 + * @param aScrollBar + * @param aEventType + */ + void HandleScrollEventL( CEikScrollBar* aScrollBar, TEikScrollEvent aEventType ); + + private: + + /** + * Sets up the scroll bar, used on start up and when items are deleted + * to update the state + * @since 2.8 + */ + void SetupScrollbarL(); + + /** + * Populates iSettingItemArray with scenes + * and scene bitmaps from the MBM file + * @param aResourceId resource id for scene array. + * @since 2.8 + */ + void CreateSceneArrayL( TInt aResourceId ); + + /** + * Sets the current position of the scene array to the element + * associated with a particular scene id. + * @param aSceneId the id of the scene. + * @since 2.8 + */ + void SetCurrentPositionToScene( TCamSceneId aSceneId ); + + /** + * Called to start the amination + * @since 2.8 + */ + void StartAnimation(); + + /** + * Called when the animation timer expires + * @since 2.8 + * @param aPtr pointer to the object that called the timer + * @return Error code + */ + static TInt TimerExpired( TAny* aPtr ); + + /** + * Animates the list + * @since 2.8 + */ + void Animate(); + + /** + * Updates the highlight on each call of Animate + * @since 2.8 + * @returns ETrue if the highlight has finished updating + */ + TBool UpdateHighlight(); + + /** + * Updates the pen/icons on each call of Animate + * @since 2.8 + */ + void UpdateAnimationData(); + + /** + * Draws the text on each call of Animate + * @since 2.8 + * @param aText The text to draw + * @param aFont The font to use for drawing + * @param aBaseline The baseline of the text + * @param aFadeOut Whether text is fading in/out + */ + void DrawText( const TDesC& aText, const CAknLayoutFont* aFont, + TInt aBaseline, TBool aFadeOut ) const; + + /** + * Draws the icons on each call of Animate + * @since 2.8 + * @param aFadeOut whether the icon to draw is fading in/out + */ + void DrawIcon( TBool aFadeOut ); + + /** + * Draws the highlight on each call of Animate + * @since 2.8 + */ + void DrawHighlight() const; + + /** + * Draws the list onto an off screen bitmap for + * scrolling purposes + * @since 2.8 + */ + void DrawListL(); + + /** + * Animates the list when scrolling occurs + * @since 2.8 + * @return ETrue if the scrolling has completed + */ + TBool ScrollList(); + + /** + * Moves the highlight position ready for animating + * @since 2.8 + */ + void MoveHighlight(); + + private: // data + + // Array containing all pointers to all scene items + RPointerArray iSettingItemArray; + // Arrays to store the layout data for the list + // large icon positions + RArray iHighlightIcons; + // default icon positions + RArray iNormalIcons; + // displaced icon positions + RArray iDisplacedIcons; + // highlight positions + RArray iHighlightArray; + // highlighted title positions + RArray iHighlightTitles; + // highlighted decsription positions + RArray iHighlightDescriptions; + // default title positions + RArray iNormalTitles; + // displaced title positions + RArray iDisplacedTitles; + // current highlight position + TInt iCurrentArrayPosition; + // previous highlight position + TInt iPreviousArrayPosition; + // position in array of item at the top of screen + TInt iTopDisplayPosition; + // number of icons to display on screen at any time + TInt iNumberOfIconsToDisplay; + // the capture mode + TCamCameraMode iMode; + // Specifies whether or not the scene list is for + // the user base scenes + TBool iUserBaseScenes; + // An animation timer object + CPeriodic* iAnimTimer; + // Animation Data + TCamAnimationData iAnimData; + // the scrollbar frame + CEikScrollBarFrame* iScrollFrame; + // the model to use for the scrollbar + TAknDoubleSpanScrollBarModel ivModel; + // the position of the scrollbar + TAknLayoutRect iScrollLayout; + + }; + +#endif // CAMSCENESETTINGCONTAINER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSelfTimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSelfTimer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,242 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CCamSelfTimer class for Camera* +*/ + + + +#ifndef CAMSELFTIMER_H +#define CAMSELFTIMER_H + +#include "CamAppController.h" +#include "CamSelfTimerObserver.h" +#include "CamAppUiBase.h" // For TCamSelfTimerFunctions +#include "CamPSI.h" + +////////// + + + +// INCLUDES + +// MACROS + +// DATA TYPES + +// Represents the selftimer state. Allows up to 3 different active states, +// plus the standby (inactive) state. +enum TCamSelfTimer + { + ECamSelfTimerActive1, + ECamSelfTimerActive2, + ECamSelfTimerActive3, + ECamSelfTimerStandby + }; + + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Implements self-timer functionality +* +* @since 2.8 +*/ +class CCamSelfTimer : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamSelfTimer* NewL( CCamAppController& aController ); + + /** + * Destructor. + */ + virtual ~CCamSelfTimer(); + + public: // New functions + + /** + * Called by client to start the self timer functionatlity. + * Starts the timer counting down. + * @since 2.8 + */ + void StartSelfTimer(); + + /** + * Called by client to set the current capture mode. This is needed + * to ensure the Self-Timer operation, if started, would call the + * correct capture (for video or photo) on timer completion. + * @since 2.8 + * @param aMode The capture mode (video/image) + * @param aMode The image capture mode (single/burst/timelapse) + * @param aFunc The period data set to use + */ + void SetModeL( TCamCameraMode aMode, + TCamImageCaptureMode aImageMode, + TCamSelfTimerFunctions aFunc ); + + + /** + * Cancels any oustanding self-timer operation, and resets internal + * state to standby/idle state. + * @since 2.8 + */ + void Cancel(); + + /** + * Returns whether the self-timer is currently active (counting down) + * @since 2.8 + * @return TBool - ETrue if active, EFalse if in standby/idle. + */ + TBool IsActive(); + + /** + * Add a self timer observer + * @since 2.8 + * @param aObserver Pointer to object implementing MCamSelfTimerObserver + */ + void AddObserverL( const MCamSelfTimerObserver* aObserver ); + + /** + * Remove self timer observer + * @since 2.8 + * @param aObserver Pointer to object implementing MCamSelfTimerObserver + */ + void RemoveObserver( const MCamSelfTimerObserver* aObserver ); + + /** + * Send event to self timer observers + * @since 2.8 + * @param aEvent event to send to observers + */ + void NotifyObservers( const TCamSelfTimerEvent aEvent ); + + public: // Functions from base classes + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * C++ default constructor. + */ + CCamSelfTimer( CCamAppController& aController ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Allows the self-timer object to change it's internal state based upon + * the parameter passed in. + * @since 2.8 + * @param aState, The internal state to move to. + */ + void ChangeState( TCamSelfTimer aState); + + /** + * The timer callback used by the periodic timer. Will call the + * CCamSelfTimer's Tick() method. + * @since 2.8 + * @param aPtr A pointer to the instance of CCamSelfTimer + * @return KErrNone + */ + static TInt TimerCallback( TAny* aPtr ); + + /** + * Called by the timer callback function to progress the internal + * self-timer state accordingly. + * @since 2.8 + */ + void Tick(); + + /** + * Turns the indicators (LED/icon/tone) on or off depending on the + * parameter passed in. + * @since 2.8 + * @param aOn If ETrue, turns the indication(s) on, else turns them off + */ + void DoIndication( TBool aOn ); + + public: // Data + + protected: // Data + + private: // Data + + // Main timer + CPeriodic* iPeriodicTimer; + + // Callback used for timer + TCallBack iCallback; + + // Current state of the SelfTimer object + TCamSelfTimer iState; + + // Whether LED is currently on or off + TBool iIndication; + + // Specifies whether capturing video or still. + TCamCameraMode iMode; + // Image submode (single/burst/timelapse) + TCamImageCaptureMode iImageMode; + + + // Tracks the time remaining before capture when timer is active. + TTimeIntervalMicroSeconds32 iTimeRemaining; + + // Tracks the period between "ticks" when timer is active + TTimeIntervalMicroSeconds32 iTimerTickPeriod; + + // Camera Controller used to start autofocus/capture operations + CCamAppController& iController; + + // array of self timer observer objects + RPointerArray iObservers; + + // Holds the period details from the PSI + TSelfTimerSetting iSettings; + + // Tracks the time that has elapsed since last indicator state change + TInt iTimeElapsedSinceIndication; + + public: // Friend classes + protected: // Friend classes + private: // Friend classes + }; + +#endif // CAMSELFTIMER_H + +// End of File + + + + + + + + + + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSelfTimerObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSelfTimerObserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines abstract interface for CCamSelfTimer observers* +*/ + + + +#ifndef CAMSELFTIMEROBSERVER_H +#define CAMSELFTIMEROBSERVER_H + +// INCLUDES + +// CONSTANTS + +// MACROS + +// DATA TYPES +enum TCamSelfTimerEvent + { + ECamSelfTimerEventTimerOn, + ECamSelfTimerEventTimerOff + }; + + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Abstract API for self timer observer. +* Derived classes may register as observers to get related +* notifications about events from CCamSelfTimer. +* +* @since 2.8 +*/ +class MCamSelfTimerObserver + { + public: + /** + * Handle an event from CCamSelfTimer. + * @since 2.8 + * @param aEvent the self timer event + * @param aCountdown self timer countdown duration + */ + virtual void HandleSelfTimerEvent( TCamSelfTimerEvent aEvent, TInt aCountDown ) = 0; + }; + +#endif // CAMSELFTIMEROBSERVER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamServer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamServer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for new file service application* +*/ + + + +#ifndef CAMSERVER_H +#define CAMSERVER_H + +// INCLUDES + +#include +#include + +// CLASS DECLARATION + +/** +* Application server class. +* Provides factory to create concrete file server application object. +* @since 3.0 +*/ +class CCamAppServer : public CAknAppServer + { +public: // from AknAppServer + + IMPORT_C CApaAppServiceBase* CreateServiceL( TUid aServiceType) const; + +public: + /* + * Returns pointer to new file server application + * @since 3.0 + */ + MNewFileServiceObserver* NewFileServiceObserver() const; + +private: + mutable MNewFileServiceObserver* iNewFileServiceObserver; + }; + +#endif // CAMSERVER_H +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSettingsModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSettingsModel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,728 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Manages all settings data. +* +*/ + + + +#ifndef CAMSETTINGSMODEL_H +#define CAMSETTINGSMODEL_H + +// INCLUDES + + +#include + +#include "Cam.hrh" +#include "mcamsettingsmodel.h" +#include "CamBurstModeObserver.h" +#include "mcamsettingpreviewhandler.h" + +#include "camconfigurationconstants.h" + +// CONSTANTS + +// FORWARD DECLARATIONS +class MCamSettingsModelObserver; +class CCamVideoQualityLevel; +class CCamStaticSettingsModel; +class MCamStaticSettings; +class CCamConfiguration; +class CCameraUiConfigManager; + +// STRUCTS + +// CLASS DECLARATIONS + +/** +* Manages all static settings data. +* @since 2.8 +*/ +class CCamSettingsModel : public CBase, + public MCamSettingsModel, + public MCamSettingPreviewHandler, + /** to be removed*/public MCamBurstModeObserver + { + // ========================================================================= + public: // Constructors and destructor + + /** + * Symbian two-phased constructor. + * @param aConfiguration + * @since 2.8 + * engine changes. + */ + static CCamSettingsModel* NewLC( CCamConfiguration& aConfiguration ); + + /** + * Symbian two-phased constructor. + * @param aConfiguration + * @since 2.8 + * engine changes. + */ + static CCamSettingsModel* NewL( CCamConfiguration& aConfiguration ); + + + /** + * Destructor. + */ + ~CCamSettingsModel(); + + public: + /** + * Saves user defined FT setting + * @since S60 5.0 + * @param None + * @return None + */ + void StoreFaceTrackingValue(); + + // ------------------------------------------------------------------------- + // From base class MCamSettingsModel + public: + + /** + * Add a settings model observer. + * Observers will be notified of settings changes. + */ + virtual void AttachObserverL( const MCamSettingsModelObserver* aObserver ); + + /** + * Remove a settings model observer. + */ + virtual void DetachObserver( const MCamSettingsModelObserver* aObserver ); + + /** + * Resets all user scene settings to their defaults. + * @since 2.8 + */ + virtual void ResetUserSceneL(); + + /** + * Returns the current integer value for the specified setting + * @return the current integer setting value + * @param aSettingItem specifies which setting item that want the value of. + * @since 2.8 + */ + virtual TInt IntegerSettingValue( TInt aSettingItem ) const; + + /** + * Returns the setting value for a specific field of a scene + * @return the setting value + * @param aSceneId specifies which scene. + * @param aSceneId specifies which field of the scene. + * @since 2.8 + */ + virtual TInt SceneSettingValue( TInt aSceneId, TInt aSceneField ) const; + + /** + * Sets a new value for the specified integer setting + * @param aSettingItem specifies which setting item that want to set the value of. + * @param aSettingValue the new integer value for the specified setting item. + * @since 2.8 + */ + virtual void SetIntegerSettingValueL( TInt aSettingItem, TInt aSettingValue ); + + /** + * Sets a new text value for the specified setting + * @param aSettingItem specifies which setting item that want to set the text value of. + * @param aSettingValue the new text value for the specified setting item. + * @since 2.8 + */ + virtual void SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ); + + /** + * Returns the current text value for the specified setting + * @return the current text setting value + * @param aSettingItem specifies which setting item that want the text value of. + * @since 2.8 + */ + virtual TPtrC TextSettingValue( TInt aSettingItem ) const; + + /** + * Returns whether a particular setting value can be set or not. + * @return ETrue if can be set. Otherwise, EFalse. + * @param aSettingValue the value in question. + * @param aSettingItem the setting item in question. + * @since 2.8 + */ + virtual TBool SettingValueEnabled( TInt aSettingItem, + TInt aSettingValue ) const; + + /** + * Get the default value for a setting item. + * @param aSettingId The id of the setting. + * @return The default value for setting item or KErrNotFound if not found. + */ + virtual TInt DynamicSettingDefaultValue( TInt aSettingId ) const; + + /** + * Sets all dynamic settings to their defaults. + * @since 2.8 + */ + virtual void SetDynamicSettingsToDefaults(); + + /** + * Sets a single dynamic setting to its default. + * @since 2.8 + */ + virtual void SetDynamicSettingToDefault(TInt aSettingItem); + + /** + * Sets a single dynamic setting to scene default value. + * @param aSceneId Scene which the default value is taken from. + * @param aSceneField Id of the setting in scene data. + * @param aSettingId Id of the setting in dynamic settings. + * @param aVideoScene Is the scene a video scene. + * @return KErrNotFound, if setting could not be set. + */ + virtual TInt SetDynamicSettingToSceneDefaultL( TInt aSceneId, + TInt aSceneField, + TInt aSettingId, + TBool aVideoScene ); + + + /** + * Loads the static settings from shared data. Required to update + * the settings whenever get foreground event, in case of external + * changes to the settings. + * @since 2.8 + * @param aIsEmbedded Specifies whether the application is embedded + * or not. + */ + virtual void LoadStaticSettingsL( TBool aIsEmbedded ); + + /** + * Return handle to video quality level array + * @since 2.8 + * @return reference to array of video quality levels + */ + virtual const RPointerArray& VideoQualityArray(); + + /** + * Return handle to video resolution array + * @since 2.8 + * @param return reference to array of video resolutions + */ + virtual const RArray& VideoResolutions(); + + /** + * Returns the image resolution for a given resolution index. + * @since 2.8 + * @param aIndex The index to get the resolution for + * @returns The X and Y dimensions in pixels of the resolution. + */ + virtual TSize ImageResolutionFromIndex( TCamPhotoSizeId aIndex ); + + /** + * Returns the current photo quality. + * @return the quality. + * @since 2.8 + */ + virtual TInt CurrentPhotoCompression() const; + + /** + * Returns the current photo resolution from Settings + * @return the resolution. + * @since 2.8 + */ + virtual TCamPhotoSizeId CurrentPhotoResolution() const; + + /** + * Returns the photo resolution for a particular quality + * @return the resolution. + * @param aQualityIndex The index of the quality + * @since 3.0 + */ + virtual TCamPhotoSizeId PhotoResolution( TInt aQualityIndex ) const; + + /** + * Stores the primary camera settings when changing to secondary camera + * that they can be reapplied when changing back + * @since 2.8 + */ + virtual void StorePrimaryCameraSettingsL(); + + /** + * Restores the primary camera settings + * @since 2.8 + */ + virtual void RestorePrimaryCameraSettingsL(); + + /** + * Return variant info. + */ + virtual const TCamVariantInfo& VariantInfo(); + + /* + * Reset repository file + * @since3.0 + */ + virtual void ResetRepository(); + + // ------------------------------------------------------------------------- + // From base class MCamSettingPreviewHandler + public: + + /** + * Activates preview for one setting. + * Returns the preview value as setting value in ProvideCameraSettingL + * until Commit or Cancel is called. + * @param aSettingId The setting for which preview is set + * @param aSettingValue The setting value used for preview + * @leave Any system error code. + */ + virtual void ActivatePreviewL( const TCamSettingItemIds& aSettingId, + TInt aSettingValue ); + + /** + * Cancels the preview for one setting. + * After this call ProvideCameraSettingL returns the actual setting value. + * If the setting does not have active preview, such error is ignored. + * @param aSettingId Id of the setting for which the preview is cancelled. + */ + virtual void CancelPreview( const TCamSettingItemIds& aSettingId ); + + + /** + * Cancels the preview for a set of settings. + * If some of the settings do not have active preview, such error is ignored. + */ + virtual void CancelPreviews( const RArray aSettingIds ); + + /** + * Cancels all previews. + * No error reported, if no previews active. + */ + virtual void CancelAllPreviews(); + + /** + * Commits the preview value for the given set of settings. + * After this call completes, the preview is no more active for the setting. + * If the call completes successfully, the preview is stored as the + * actual setting value. If leave occurs, the preview is not stored. + * @param aSettingId Id of the setting for which the preview is committed. + * @leave KErrArgument There was no preview value for the given setting. + * @leave Any system error code. + */ + virtual void CommitPreviewL( const TCamSettingItemIds& aSettingId ); + + /** + * Commits the preview for a set of settings. + * If some of the settings do not have active preview, such error is ignored. + */ + virtual void CommitPreviewsL( const RArray& aSettingIds ); + + /** + * Commit previews for all settings with active preview. + * @leave Any system error code. + */ + virtual void CommitAllPreviewsL(); + + /** + * Get the set of settings with active preview. + * Preview is active if it has been set with ActivatePreviewL + * but not cancelled or committed after that. + * @param aSettingIds Return the ids of the active settings in this array. + */ + virtual void ActivePreviewsL( RArray& aSettingIds ) const; + + + // ------------------------------------------------------------------------- + // New methods + public: + + /* + * Gets the handle to the settings model, which is used inturn by the + * plugin to call the interfaces for performing needed actions. + */ + MCamStaticSettings& StaticSettingsModel() const; + + /** + * Loads the static settings from shared data, or if unable to from the resource file. + * @since 2.8 + */ + void LoadSettingsL(); + + /** + * Saves the static settings to shared data. + * @since 2.8 + */ + void SaveSettingsL() ; + + /* + * Is Scene supported + */ + TBool IsImageSceneSupported( const TInt aSceneId ) const; + + /* + * Is Scene supported + */ + TBool IsVideoSceneSupported( const TInt aSceneId ) const; + + /* + * Returns UiConfigManager Ptr from StaticSettingsModel + */ + CCameraUiConfigManager* UiConfigManagerPtr(); + private: + + /** + * Saves one static setting to Central Repository. + * @param aSettingId Id of the setting to be saved. + * @since Camera 4.0 + */ + void SaveStaticSettingL( TCamSettingItemIds aSettingId ); + + /** + * Get the associated settings list for given setting item. + * @param aSettingId Id of the setting for which the list is requested. + * @since Camera 4.0 + */ + RPointerArray* + MapSettingItem2SettingsList( TCamSettingItemIds aSettingId ); + + // ------------------------------------------------------------------------- + // Constructors + private: + + /** + * C++ constructor. + * @since 2.8 + */ + CCamSettingsModel( CCamConfiguration& aConfiguration ); + + /** + * C++ 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + // ------------------------------------------------------------------------- + // new functions + private: + + // Notify setting model observers, that a setting item value has changed. + void NotifyObservers( TCamSettingItemIds aSettingId, + TInt aSettingValue ); + + void NotifyObservers( TCamSettingItemIds aSettingId, + const TDesC& aSettingValue ); + + /** + * Read variant flags from Central Repository. + */ + void ReadVariantFlagsL(); + + /** + * Resets all user scene settings to their defaults without + * activating them. + * @since 2.8 + */ + void ResetUserSceneWithoutActivatingChangesL(); + + /** + * Copies a user scene setting across to the capture setup settings. + * @since 2.8 + * @param aSettingItem the user scene setting to copy. + */ + void CopyUserSceneSettingToCaptureSettingL( TInt aSettingItem ); + + /** + * Activates the current user scene settings. + * @since 2.8 + */ + void ActivateUserSceneSettingsL(); + + /** + * Returns whether a particular setting is an engine setting, or not. + * @since 2.8 + * @param aSettingItem The id of the setting item. + * @return ETrue if an engine setting. Otherwise EFalse. + */ + TBool SettingIsForEngine( TInt aSettingItem ); + + /** + * Searches in a settings list for a particular setting item.. + * @param aSettingsList the setting list to search in. + * @param aSettingItem the id of the setting item to look for. + * @return the index of the setting item if found. Otherwise returns KErrNotFound . + * @since 2.8 + */ + TInt SearchInSettingsListFor( + const RPointerArray& aSettingsList, + TInt aSettingItem ) const; + + + /** + * Finds a scene in a particular scene list. + * @param aSceneItemId the id of the scene to search for. + * @param aSceneList the scene list to search in. + * @return the index to the scene in the list. + * @since 2.8 + */ + TInt FindSceneInSceneList( + TInt aSceneItemId, + const RPointerArray& aSceneList ) const; + + /** + * Handles a change in the value for the user scene setting. + * @param aSettingValue The new scene value. + * @param aActivate Whether to activate the user scene changes + * @since 2.8 + */ + void UserSceneHasChangedL( TInt aSettingValue, TBool aActivate ); + + /** + * Handles a change in the value for the photo scene setting. + * That is, it updates the rest of the photo dynamic setings. + * @param the new scene value. + * @since 2.8 + */ + void PhotoSceneHasChangedL( TInt aSettingValue ); + /** + * Handles a change in the value for the video scene setting. + * That is, it updates the rest of the video dynamic setings. + * @since 2.8 + * @param aSettingValue The new scene value. + */ + void VideoSceneHasChangedL( TInt aSettingValue ); + + + /** + * Returns the maximum allowed quality for a photo scene. + * @param the scene id. + * @return the highest allowed quality. + * @since 2.8 + */ + TInt PhotoSceneMaximumQuality( TInt aSceneId ) const; + + /** + * Returns the current photo quality value. + * @return the quality. + * @since 2.8 + */ + TInt CurrentPhotoQualityValue() const; + + /** + * Returns the photo quality array index. + * @Param the photo quality id for the desired quality + * @return the array index for the specified quality. + * @since 2.8 + */ + TInt PhotoQualityArrayIndex(TInt aPhotoQualityId ) const; + + /** + * Returns the default value of a setting for a particular scene item. + * @param aSceneId the id of the scene item. + * @param aSetting the id of the setting item. + * @return the default value + * @since 2.8 + */ + TInt DefaultSettingValueForScene( TInt aSceneId, TInt aSetting ) const; + + /** + * Loads a list of dynamic settings from the resource file and + * their default values. + * @param aResourceId the id of the resource that contains the + * settings items id's and their default values. + * @param aSettingsList the list to populate with dynamic settings + * from the resource file. + * @param aDefaultsList the list to populate with default values + * for the dynamic settings from the resource file. + * @since 2.8 + */ + void LoadDynamicSettingsL( TInt aResourceId, + RPointerArray& aSettingsList, + RArray& aDefaultsList ); + + /** + * Loads a list of dynamic settings from the resource file + * @param aResourceId the id of the resource that contains the + * settings items id's and their default values. + * @param aSettingsList the list to populate with dynamic settings + * from the resource file. + * @since 2.8 + */ + void LoadDynamicSettingsL( TInt aResourceId, + RPointerArray& aSettingsList ); + + /** + * Loads a list of scene settings from the resource file. + * @param aResourceId the id of the resource in the resource file. + * @param aSceneDataArray the array to populate with the resource. + * @since 2.8 + */ + void LoadScenesDataL( TInt aResourceId, + RPointerArray& aSceneDataArray ); + + /** + * Loads a list of scene settings from product specific header file. + * @since 3.0 + */ + void LoadSceneDataL( TBool aPhotoSceneSettings = ETrue ); + + + /** + * Removes any previously loaded settings. + * @since 2.8 + */ + void UnloadSettings(); + + /** + * Removes any previously loaded static settings. + * @since 2.8 + */ + void UnloadStaticSettings(); + + /** + * Loads component resources + */ + void LoadResourcesL(); + + /** + * Frees component resources + */ + void UnLoadResources(); + + /** + * Backup and Restore Settings array + * @param aSrc The source settings array + * @param aDest The destination settings array + * @param aRestore ETrue to restore + * @since 5.1 + */ + void CopySettingsL(RPointerArray& aSrc, + RPointerArray& aDest, + TBool aRestore = EFalse); + + private: // Functions from base classes + + /** + * From MCamBurstModeObserver + * @since 2.8 + * @param aActive whether or not burst mode is active + * @param aStillModeActive whether or not still capture is active + */ + void BurstModeActiveL( TBool aActive, TBool aStillModeActive ); + + // ========================================================================= + private: // data + TCamSettingsOnOff iPreviousFaceTrack; // previous user defined FT setting + TCamSceneId iPreviousSceneMode; // previous camera scene mode + + + /** + * Stores information for front/back camera settings + * @since 2.8 + */ + class TCamCameraSettings + { + public: + TInt iPhotoQuality; + TInt iVideoQuality; + }; + + // Reference to observer of this settings model. + // MCamSettingsModelObserver& iObserver; + RPointerArray iObservers; + + // Setting previews + RPointerArray iSettingPreviews; + + // List of setting item id/value pairs for static photo settings. + RPointerArray iDynamicPhotoIntSettings; + + //Backup of iDynamicPhotoIntSettings + RPointerArray iDynamicPhotoIntSettingsBackup; + + + // Parallel array to "iDynamicPhotoIntSettings" containing + // default values. + RArray iDynamicPhotoIntDefaults; + + // List of setting item id/value pairs for dynamic photo settings. + RPointerArray iDynamicVideoIntSettings; + + //Backup of iDynamicVideoIntSettings + RPointerArray iDynamicVideoIntSettingsBackup; + + // Parallel array to "iDynamicVideoIntSettings" containing + // default values. + RArray iDynamicVideoIntDefaults; + + // List of setting item id/value pairs for user scene settings. + RPointerArray iUserSceneSettings; + + //Backup of iUserSceneSettings + RPointerArray iUserSceneSettingsBackup; + + // Lists of scene data. + RPointerArray iPhotoScenes; + RPointerArray iVideoScenes; + + // Specifies whether the engine should be updated with settings such as + // White Balance after being prepared. This is device dependent and so + // will be read from the resource file. + TBool iUpdateAfterPrepare; + + // Specifies whether this application is embedded or not. + TBool iEmbedded; + + // Specifies whether burst mode is enabled or not + TBool iBurstEnabled; + + // Reference to the CEikonEnv object, since it is used a lot. + CEikonEnv* iEnv; + + // array of video quality level items read in from resource file + RPointerArray < CCamVideoQualityLevel > iQualityLevels; + + // array of video resolutions read from resource + RArray< TSize > iVideoResolutions; + + // array of photo quality levels read from resource + RArray< TCamPhotoQualitySetting > iPhotoQualityLevels; + + // array of photo resolutions read from resource + RArray< TSize > iPhotoResolutions; + + // Specifies whether the engine is ready for receiving + // a video prepare event. + TBool iEngineReadyForVideoPrepare; + + // Specifies whether the settings model is waiting to + // prepare the engine with video. + TBool iWaitingToPrepareVideo; + + // The cached primary camera settings + TCamCameraSettings iPrimaryCameraSettings; + // The cached secondary camera settings + TCamCameraSettings iSecondaryCameraSettings; + + // Variant info + TCamVariantInfo iVariantInfo; + TInt iResourceFileOffset; + + // Number of image scene settings + + CCamConfiguration& iConfiguration; + CCamStaticSettingsModel* iStaticModel; + CCameraUiConfigManager* iUiConfigManager; // we dont own + }; + +#endif // CAMSETTINGSMODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSharedDataKeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSharedDataKeys.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + +#ifndef CAMSHAREDDATAKEYS_H +#define CAMSHAREDDATAKEYS_H + +// INCLUDES + +// CONSTANTS + +// Photo settings shared data keys. +_LIT( KIbuCameraSharedDataPhotoQuality, "PhotoQuality" ); +_LIT( KIbuCameraSharedDataPhotoFocusPoint, "PhotoFocusPoint" ); +_LIT( KIbuCameraSharedDataPhotoStoreInAlbum, "PhotoStoreAlbum" ); +_LIT( KIbuCameraSharedDataPhotoShowCaptured, "PhotoShowCaptured" ); +_LIT( KIbuCameraSharedDataPhotoCaptureTone, "PhotoCaptureTone" ); +_LIT( KIbuCameraSharedDataPhotoMemInUse, "PhotoMemInUse" ); +_LIT( KIbuCameraSharedDataPhotoName, "ImgBase" ); +_LIT( KIbuCameraSharedDataPhotoNameType, "ImgNamType" ); +_LIT( KIbuCameraSharedDataPhotoNumber , "ImgCount"); +_LIT( KIbuCameraSharedDataPhotoExtDigZoom , "PhotoExtDigZoom"); +_LIT( KIbuCameraSharedDataPhotoStoreLocation, "PhotoStoreLocation" ); + +// Video settings shared data keys. +_LIT( KIbuCameraSharedDataVideoAudRec, "VideoAudRec" ); +_LIT( KIbuCameraSharedDataVideoStoreAlbum, "VideoStoreAlbum" ); +_LIT( KIbuCameraSharedDataVideoShowCaptured, "VideoShowCaptured" ); +_LIT( KIbuCameraSharedDataVideoMemInUse, "VideoMemInUse" ); +_LIT( KIbuCameraSharedDataVideoName, "VidBase" ); +_LIT( KIbuCameraSharedDataVideoNameType, "VidNamType" ); +_LIT( KIbuCameraSharedDataVideoQuality, "VideoQuality" ); +_LIT( KIbuCameraSharedDataVideoNumber , "VidCount"); +_LIT( KIbuCameraSharedDataVideoExtDigZoom , "VidExtDigZoom"); + +// User scene shared data keys. +_LIT( KIbuCameraSharedDataUserSceneBaseScene, "UserSceneBaseScene" ); +_LIT( KIbuCameraSharedDataUserSceneWhiteBalance, "UserSceneWhiteBalance" ); +_LIT( KIbuCameraSharedDataUserSceneColourFilter, "UserSceneColourFilter" ); + +_LIT( KIbuCameraSharedDataUserSceneExposure, "UserSceneExposure" ); + +_LIT( KIbuCameraSharedDataUserSceneFlash, "UserSceneFlash" ); +_LIT( KIbuCameraSharedDataUserSceneBrightness, "UserSceneBrightness" ); +_LIT( KIbuCameraSharedDataUserSceneContrast, "UserSceneContrast" ); +_LIT( KIbuCameraSharedDataUserSceneLightSensitivity, "UserSceneLightSensitivity" ); + +#endif // CAMSHAREDDATAKEYS_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamShootingModeContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamShootingModeContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,304 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for Image/Video quality.* +*/ + + +#ifndef CAMSHOOTINGMODECONTAINER_H +#define CAMSHOOTINGMODECONTAINER_H + +// INCLUDES +#include "CamContainerBase.h" +#include "CamAppController.h" +#include "CamSettingValueObserver.h" +#include "CamSettings.hrh" +#include +#include +#include + + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class MAknQueryValue; +class CCamSceneListBox; +class CAknInfoPopupNoteController; +class MTouchFeedback; + +// CLASS DECLARATION + +/** +* Implements the Shooting Mode Setting control and descriptive texts +* +* @since 2.8 +*/ + + +class CCamShootingModeContainer : public CCamContainerBase, + public MCamSettingValueObserver, + public MEikListBoxObserver + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aRect Frame rectangle for container. + * @param aView Reference to the view containing this container + * @param aMode Current capture mode + * @param aController reference to CCamAppControllerBase instance + * @param aUserBaseScenes Specifies whether this list should + * display the base scenes for the user scene. + */ + static CCamShootingModeContainer* NewL( const TRect& aRect, + CAknView& aView, + TCamCameraMode aMode, + CCamAppController& aController, + TBool aUserBaseScenes = EFalse ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamShootingModeContainer(); + + private: + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ constructor + * @since 2.8 + * @param aMode Current capture mode + * @param aController reference to CCamAppControllerBase instance + * @param aView Reference to the view containing this container + * @param aUserBaseScenes Specifies whether this list should + * display the base scenes for the user scene. + */ + CCamShootingModeContainer( TCamCameraMode aMode, + CCamAppController& aController, + CAknView& aView, + TBool aUserBaseScenes ); + + public: // New functions + /** + * Is the user scene currently selected + * @since 2.8 + * @return ETrue if user scene highlighted + */ + TBool UserSceneHighlighted(); + + /** + * Saves the selected scene in dynamic settings + * @since 2.8 + * @return ETrue if the scene setting was changed successfully. + */ + TBool SaveSceneSettingL(); + + /** + * Saves the selected scene in dynamic settings if the scene + * mode has changed from current value. + * @since S60 v5.0 + * @return ETrue if the scene setting was changed successfully. + */ + TBool SaveSceneSettingIfChangedL(); + + /** + * Gets the settings item value ID of the current item + * @since 2.8 + * @return the settings item value of the currently highlighted item + */ + TInt CurrentSettingItemValue() const; + + /** + * Gets the index in the item array that has the specified settings + * item value ID of the current item + * @since 3.0 + * @return the index of the item with the specified value id + */ + TInt IndexForValueId( TInt aValueId ) const; + + /** + * Hilights the given item on scene listbox + * @return returns false if item cannot be selected + */ + TBool SelectItem( TInt aItemIndex ); + + public: //Functions from base classes + /** + * From MCamSettingValueObserver + * Handles a change in the slider value + * @since 2.8 + * @param aNewValue the new value of the setting + */ + void HandleSettingValueUpdateL( TInt aNewValue ); + + protected: // Functions from base classes + /** + * From CoeControl + * @since 2.8 + * @return number of contained controls + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl + * @since 2.8 + * @param aIndex The index of the required control + * @return Returns the requested control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl + * @since 2.8 + * @param aRect area where to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * From CamContainerBase + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + private: + + + /** + * Sets up the summary pane detail arrays + * @since 2.8 + * @param aResourceId The resource that defines the summary pane details + */ + void ConstructSummaryDetailsFromResourceL(TInt aResourceId); + + + /** + * Select the resource for summary texts. + * @return Resource id of the summaries. + */ + TInt SelectSummaryResourceL(); + + /** + * Get if the given scene is supported. + */ + TBool IsSupportedScene( TInt aSceneId ) const; + + /** + * Draws the summary title and description text + * @param aGc The graphics context to draw to + */ + void DrawSummaryTextL( CWindowGc& aGc ) const; + + /** + * Read touch layout + * @return TRect, listbox rectangle + */ + TRect TouchLayout(); + + /** + * Read non-touch layout + * @return TRect, listbox rectangle + */ + TRect NonTouchLayout(); + + public: + + /** + * From CCoeControl + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * From MEikListBoxObserver + */ + void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); + /** + * Displays tooltip for the selected listbox item + */ + void ShowTooltipL(); + + /** + * Hides tooltip for the selected listbox item, if one is visible + */ + void HideCurrentTooltipL(); + + /** + * Reads the title text from given resource + * @param aResourceId The resource that defines the summary pane details + */ + void ConstructContainerTitleFromResourceL( TInt aResourceId ); + + + private: // data + + // the shooting mode list box + CCamSceneListBox* iListBox; + + // the capture mode (video/still) + TCamCameraMode iMode; + // Specifies whether or not the scene list is for + // the user base scenes + TBool iUserBaseScenes; + // Array of bitmaps for the large summary icon + RPointerArray iSummaryBitmapArray; + // Array of all shooting mode titles + RPointerArray iTitleArray; + // Array of all shooting mode descriptions + RPointerArray iDescArray; + + + // Array of supported scenes + RArray iSupportedScenes; + + // The text shown as the title of the container + HBufC* iTitleText; + + // Layout rect for title text + TAknLayoutText iTitleTextRectLayout; + TAknLayoutRect iListboxLayoutRect; + + TRect iLayoutAreaRect; // Scene setting + TRect iExplanationRect; + TInt iExplLineCount; // Number of available layouts + TAknLayoutRect iExplIconLayout; + TAknLayoutText iExplTitleLayout; + RArray iExplTxtLinesLayout; + CArrayFixFlat* iCurrentDescLineArray; // own + + CAknInfoPopupNoteController* iTooltipController; + TBool iShowTooltip; + HBufC16* iListboxTitle; + TInt iTooltipIndex; + + TBool iActivateOnTouchRelease; + MTouchFeedback* iFeedback; // not own + + }; + +#endif //CAMSHOOTINGMODECONTAINER_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSidePane.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSidePane.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,272 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: SidePane Control* +*/ + + +#ifndef CAMSIDEPANE_H +#define CAMSIDEPANE_H + +// INCLUDES + +#include "CamSelfTimerObserver.h" +#include "CamBurstModeObserver.h" +#include "CamResourceLoader.h" + +// FORWARD DECLARATIONS +class CCamIndicator; +class CCamIndicatorData; +class CCamIndicatorResourceReader; + +// CLASS DECLARATION + +enum ECamSidePaneFlashState + { // Used to indicate whether to turn flashing indicators on or off + ECamSidePaneFlashOff, + ECamSidePaneFlashOn + }; + +/** +* Side Pane control +*/ +class CCamSidePane : public CBase, + public MCamControllerObserver, + public MCamResourceLoader +#ifndef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + ,public MCamBurstModeObserver +#endif // !PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + { + // ========================================================================= + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aController reference to CCamAppControllerBase instance + * @param aOverlayViewFnder - whether sidepane is drawn on top of the viewfinder + * @return created CCamSidePane object + */ + static CCamSidePane* NewL( CCamAppController& aController, + TBool aOverlayViewFinder ); + + /** + * Destructor. + */ + virtual ~CCamSidePane(); + + public: // From MCamResourceLoader + + /** + * From MCamResourceLoader + * @since 3.0 + */ + void LoadResourceDataL(); + + /** + * From MCamResourceLoader + * @since 3.0 + */ + void UnloadResourceData(); + + /** + * From MCamResourceLoader + * @since 3.0 + */ + void ReloadResourceDataL(); + + public: // New functions + + /** + * Is the zoom pane visible? + * @since 2.8 + * @return ETrue if the zoom pane is visible + */ + TBool IsVisible(); + + /** + * Tells the zoom pane whether it is on display + * @since 2.8 + * @param aVisible ETrue to make the zoom pane invisible + */ + void MakeVisible( TBool aVisible ); + + /** + * Draws all the indicators that are displayed in the side pane + * @since 2.8 + * @param aGc The graphics context to use for drawing + */ + void Draw( CBitmapContext& aGc ) const; + + /** + * Set draw rect + * @since 2.8 + * @param Rect to draw into + */ + void SetRect( TRect& aRect ); + + /** + * Set current capture mode + * @since 2.8 + * @param aMode Capture mode + */ + void SetCaptureMode( TCamCameraMode aMode ); + + /** + * Set up initial state of side pane + * @since 2.8 + */ + void SetInitialState(); + + /** + * Updates the layouts for each indicator in sidepane + * @since S60 5.0 + */ + void UpdateLayout(); + + protected: // Functions from base classes + + /** + * From MCamControllerObserver + * Handle an event from CCamAppControllerBase. + * @since 2.8 + * @param aEvent the type of event + * @param aError error code + */ + virtual void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + + private: + + /** + * Get the icon index of current flash setting in given mode. + * @param aMode Capture mode for which the flash icon index is needed. + */ + TInt GetFlashIconIndex( const TCamCameraMode& aMode ); + + + /** + * Register this object with observed classes. + * @since 2.8 + */ + void RegisterObserversL(); + + /** + * Deregister this object from observed classes + * @since 2.8 + */ + void RemoveObservers(); + +// Generic setup icon is displayed either in the navipane or sidepane +#ifdef PRODUCT_USES_GENERIC_SETUP_INDICATOR +#ifndef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + /** + * Sets the default setup indicator depending on the + * current setup settings. + * @since 2.8 + */ + void SetGenericSetupIndicator(); +#endif // !PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR +#endif // PRODUCT_USES_GENERIC_SETUP_INDICATOR + + /** + * Sets the image stabilisation indicator + * if the current capture mode is video + * @since 3.0 + */ + void SetVideoStabilisationIndicator(); + + /** + * Sets the facetracking indicator + * if the current capture mode is still image + * @since 3.0 + */ + void SetFaceTrackingIndicator(); + + /** + * Set the video scene indicator depending on current setting + * @since 2.8 + */ + void SetVideoSceneIndicator(); + + /** + * Set the photo scene indicator depending on current setting + * @since 2.8 + */ + void SetPhotoSceneIndicator(); + +// Burst mode icon is displayed in either the navipane or sidepane +#ifndef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + /** + * From MCamBurstModeObserver + * @since 2.8 + * @param aActive whether or not burst mode is active + * @param aStillModeActive whether or not still capture is active + */ + void BurstModeActiveL( TBool aActive, TBool aStillModeActive ); +#endif // !PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + + /** + * Checks if the secondary camera is enabled + * @since 2.8 + * @return ETrue if the second camera is enabled + */ + TBool IsSecondaryCameraEnabled() const; + + /** + * Read nontouch layout + */ + void NonTouchLayout() const; + + /** + * Read touch layout + */ + void TouchLayout() const; + + private: + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppControllerBase instance + * @param aOverlayViewFnder - whether sidepane is drawn on top of the viewfinder + */ + CCamSidePane( CCamAppController& aController, + TBool aOverlayViewFinder ); + + // ========================================================================= + // Data + private: + + CCamAppController& iController; + RPointerArray iIndicators; // contained indicators + + TCamCameraMode iMode; // capture state used to determine which settings to retrieve + + TBool iOverlayViewFinder; // whether sidepane is drawn over the viewfinder + TRect iRect; // the side pane rect + TBool iVisible; // whether the side pane is visible + + // ========================================================================= + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSoundPlayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSoundPlayer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,227 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles the playing of sounds and tones for the Camera App* +*/ + + + +#ifndef CAMSOUNDPLAYER_H +#define CAMSOUNDPLAYER_H + +// INCLUDES +#include +#include +#include "Cam.hrh" // For TCamSoundId + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CAknKeySoundSystem; + +// CLASS DECLARATION + + +/** +* Observer class for getting notified when sound playback completes. +*/ +class MCamSoundPlayerObserver + { + public: + /** + * CCamSoundPlayer has finished sound playback + * and callback was requested (aEnableCallback was true + * in CCamSoundPlayer::PlaySound()). + * @since 2.8 + */ + virtual void PlaySoundComplete() = 0; + }; + +/** +* This class is used to play sounds and tones for the Camera app +* +* @since 2.8 +*/ +class CCamSoundPlayer : public CBase, + public MMdaAudioPlayerCallback, + public MMdaAudioToneObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aObs Observer to be informed when sound playback is complete. + */ + static CCamSoundPlayer* NewL( MCamSoundPlayerObserver* aObs ); + + /** + * Destructor. + */ + virtual ~CCamSoundPlayer(); + + public: // New functions + + /** + * Initialises the sound player. + * @since 2.8 + */ + void InitialiseL(); + + /** + * Starts procedure to play the specified sound + * @since 2.8 + * @param aSound The sound to play + * @param aEnableCallback Whether to call back when play complete + */ + void PlaySound( TCamSoundId aSound, TBool aEnableCallback ); + + /** + * Initiates the playing of the specified tone + * @since 2.8 + * @param aToneHz The frequency of the tone to play in Hertz + * @param aLenMicSec The length of tone to play in microseconds + * @param aVolume The volume of the tone, range 0.0 to 1.0 + * @param aEnableCallback Whether to be called back when playback complete + */ + void PlayTone( TInt aToneHz, TInt aLenMicSec, TReal32 aVolume, TBool aEnableCallback ); + + /** + * Called to disable certain key press clicks + * @since 2.8 + */ + void DisableSelectionKeySoundL(); + + /** + * Called to enable certain key press clicks + * @since 2.8 + */ + void EnableSelectionKeySound(); + + /** + * Called to disable all key sounds, usually when video recording + * is active + * @since 2.8 + */ + void DisableAllKeySoundsL(); + + /** + * Called to enable all key sounds, usually when video recording + * is has stopped + * @since 2.8 + */ + void EnableAllKeySounds(); + + /** + * Cancels any outstanding tone player activity + * @since 3.0 + */ + void CancelTonePlayer(); + + public: // Functions from base classes + /** + * From MMdaAudioPlayerCallback. + * @since 2.8 + */ + void MapcInitComplete( TInt aError, + const TTimeIntervalMicroSeconds& aDuration ); + + /** + * From MMdaAudioPlayerCallback. + * @since 2.8 + */ + void MapcPlayComplete( TInt aError ); + + /** + * From MMdaAudioToneObserver. + * @since 2.8 + */ + void MatoPrepareComplete( TInt aError ); + + /** + * From MMdaAudioToneObserver. + * @since 2.8 + */ + void MatoPlayComplete( TInt aError ); + + private: + + /** + * C++ default constructor. + * @since 2.8 + * @param aObs Observer to be informed when sound playback is complete. + */ + CCamSoundPlayer( MCamSoundPlayerObserver* aObs ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Starts procedure to play audio (WAV) files. Internal function + * @since 2.8 + * @param aFile The file to open + * @param aEnableCallback Whether to call back when play complete + */ + void StartPlaySound( const TDesC& aFile, const TBool aEnableCallback ); + + /** + * Starts procedure to play audio Tone (and RNG) files. Internal function + * @since 2.8 + * @param aFile The file to open + * @param aEnableCallback Whether to call back when play complete + */ + void StartPlayTone( const TDesC& aFile, const TBool aEnableCallback ); + + public: // Data + + // Audio player utility for WAV sounds (eg Video Recording) + CMdaAudioPlayerUtility* iAudioPlayer; + + // Tone player for TONES (eg Video recording when in call) + CMdaAudioToneUtility* iTonePlayer; + + // Key sound system for Self-timer sound and camera shutter. + CAknKeySoundSystem* iKeySoundSystem; + + // Observer to notify when playback completes + MCamSoundPlayerObserver* iObserver; + + // Whether file open is still in progress + TBool iOpenFileInProgress; + + // Whether a callback for current sound has been requested + TBool iEnableCallback; + + // Whether this class has been initialised yet + TBool iInitialised; + + // Whether selection keys have been silenced + TBool iSelectionKeySilent; + + // Whether all keys have been silenced + TBool iAllKeysSilent; + + // Whether a tone is currently playing + TBool iTonePlayInProgress; + }; + +#endif // CAMSOUNDPLAYER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamStandbyContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamStandbyContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for standby mode* +*/ + + + +#ifndef CAMSTANDBYCONTAINER_H +#define CAMSTANDBYCONTAINER_H + +// INCLUDES +#include +#include "CamContainerBase.h" +#include "CamAppController.h" + +// FORWARD DECLARATIONS +class CAknView; +class CCamTimerBase; + +// CLASS DECLARATION + +/** +* Container for standby mode +*/ +class CCamStandbyContainer : public CCamContainerBase + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aRect Frame rectangle for container. + * @param aView Reference to the view containing this container + * @param aController reference to CCamAppControllerBase instance + * @param aError associated error code + */ + static CCamStandbyContainer* NewL( const TRect& aRect, + CAknView& aView, + CCamAppController& aController, + TInt aError ); + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamStandbyContainer(); + + public: // Functions from base classes + + /** + * From CamContainerBase + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From CCamContainerBase + * Handles the foreground/background event + * @since 2.8 + * @param aForeground ETrue if this coming to foreground, else EFalse. + */ + void HandleForegroundEventL( TBool aForeground ); + + /** + * From CCoeControl + * Handles pointer events + * @since S60 5.0 + * @param aPointerEvent containing pointer event information + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + public: // New functions + + /** + * Gets the current error + * @since 2.8 + */ + TInt GetStandbyError() const; + + private: + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + * @param aError associated error code + */ + void ConstructL( const TRect& aRect, TInt aError ); + + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppControllerBase instance + * @param aView Reference to the view containing this container + * @param aError associated error code + */ + CCamStandbyContainer( CCamAppController& aController, + CAknView& aView, TInt aError ); + + protected: // Functions from base classes + /** + * From CoeControl + * @since 2.8 + * @return number of contained controls + */ + TInt CountComponentControls() const; + + /** + * From CoeControl + * @since 2.8 + * @param aIndex The index of the control required + * @return The requested control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * From CCoeControl + * @since 2.8 + * @param aRect area where to draw + */ + void Draw( const TRect& aRect ) const; + + /** + * Static callback function for foreground timer timeout. + * @since 2.8 + * @param aPtr Pointer to an instance of the CCamStandbyContainer + * @return TInt to indicate if function should be called again + */ + static TInt ForegroundTimeout( TAny* aPtr ); + + /** + * Foreground timeout expiry - invoke exit from standby mode + * after foreground event has occurred + * @since 2.8 + * @return TInt to indicate if function should be called again + */ + TInt DoForegroundTimeout(); + + /** + * Create background context (iBgContext). + * @since S60 v5.0 + */ + void CreateBackgroundContextL(); + + private: // data + // text to display in container - loaded from resource + CEikLabel *iText; + + // associated error code + TInt iStandbyError; + + // timer used after gaining foreground + CCamTimerBase* iForegroundTimer; + + // label text, wrapped over two lines if required + HBufC* iWrappedLabelText; // owned + + }; + +#endif // CAMSTANDBYCONTAINER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamStillPostCaptureView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamStillPostCaptureView.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,184 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View class for still image Post capture view* +*/ + + +#ifndef CAMSTILLPOSTCAPTUREVIEW_H +#define CAMSTILLPOSTCAPTUREVIEW_H + +// INCLUDES +#include "CamPostCaptureViewBase.h" + +// FORWARD DECLARATIONS +class CCamAppController; +class CCamContainerBase; + + +// CLASS DECLARATION + +/** +* View class for still image capture +* +* @since 2.8 +*/ +class CCamStillPostCaptureView : public CCamPostCaptureViewBase, + public MAiwNotifyCallback + { + // ===================================================== + // Methods + + // ----------------------------------------------------- + // Constructors and destructor + public: + + /** + * Two-phased constructor. + * @since 2.8 + * @param aController Reference to either the application controller + * base class or test base class + * @return pointer to the created CCamStillPostCaptureView object + */ + static CCamStillPostCaptureView* NewLC( CCamAppController& aController ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamStillPostCaptureView(); + + private: + + /** + * C++ default constructor. + * @since 2.8 + * @param aController Reference to either the application + * controller base class or test base class + */ + CCamStillPostCaptureView( CCamAppController& aController ); + + /** + * By default Symbian 2nd phase constructor is private. + * @since 2.8 + */ + void ConstructL(); + + // ----------------------------------------------------- + // Functions from base classes + public: + + /** + * From CAknView. + * @since 2.8 + * @return UID of view + */ + TUid Id() const; + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void ProcessCommandL( TInt aCommand ); + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * Displays the delete image/video confirmation note + * @since 2.8 + * @return ETrue if file deleted, otherwise EFalse + */ + TBool DisplayDeleteNoteL(); + + /** + * Displays the delete image sequence confirmation note + * @since 3.0 + * @return ETrue if file deleted, otherwise EFalse + */ + TBool DisplayDeleteSequenceNoteL(); + + /** + * From CAknView. + * @since 2.8 + * @param aPrevViewId the ID for previous view we are switching from + * @param aCustomMessageId the Uid for message passed to this view + * @param aCustomMessage descriptor containing data content for view specific message + */ + void DoActivateL( const TVwsViewId& aPreViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + + /** + * From base class MAiwNotifyCallback. + * Handles any notification caused by asynchronous ExecuteCommandL + * or event. + * @param aCmdId Service command associated to the event. + * @param aEventId Occured event + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL + * @return error code for the callback + */ + TInt HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CAiwGenericParamList& aEventParamList, + const CAiwGenericParamList& aInParamList ); + + private: // New functions + + /** + * From CAknView. + * @since 2.8 + */ + void DoDeactivate(); + + /** + * From CCamViewBase + * Set the view's title text + * @since 2.8 + */ + void SetTitlePaneTextL(); + + // from base class MAknToolbarObserver + + void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); + + + /** + * From MEikMenuObserver Changes MenuPane dynamically + * @param Resource Id + * @param Handle to menu pane + * @since 2.8 + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + // ===================================================== + // Data + private: + + TBool iRockerKeyPress; + + // ===================================================== + }; + +#endif // CAMSTILLIMAGEPOSTCAPTUREVIEW_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamStillPreCaptureContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamStillPreCaptureContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,271 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for still pre capture view* +*/ + + + +#ifndef CAMSTILLPRECAPTURECONTAINER_H +#define CAMSTILLPRECAPTURECONTAINER_H + +// INCLUDES +#include "CamPreCaptureContainerBase.h" + +#include "camflashstatus.h" // MFlashStatusObserver + +class CFbsBitmap; + + + +// CLASS DECLARATION + +/** +* Container for still image pre capture view +*/ +class CCamStillPreCaptureContainer : public CCamPreCaptureContainerBase + ,public MFlashStatusObserver + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aController reference to CCamAppControllerBase instance + * @param aView reference to the view containing this container + * @param aSetupPaneHandler handle to horizontal setup pane (product specific) + * @param aRect Frame rectangle for container. + * @return Pointer to newly constructed CCamStillPreCaptureContainer object + */ + static CCamStillPreCaptureContainer* NewL( CCamAppController& aController, + CAknView& aView, + const TRect& aRect ); + + /** + * Destructor. + */ + virtual ~CCamStillPreCaptureContainer(); + + /** + * From MCamControllerObserver + * @since 2.8 + * @param aEvent The specific event which occurred + * @param aError The error code associated with the event + */ + void HandleControllerEventL( TCamControllerEvent aEvent, TInt aError ); + + public: // Functions from base classes + + /** + * From CCoeControl + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + + /** + * From CCoeControl + * @since 3.0 + */ + void SizeChanged(); + + + /** + * From CCamContainerBase + * Handle events sending app to foreground or background + * @since 2.8 + * @param aForeground whether the event brings the app to fore or background + */ + void HandleForegroundEventL( TBool aForeground ); + + + /** + * Gets notification of the container being enabled / disabled + * @param aVisible, true->enabled and visible and vice versa + */ + void MakeVisible( TBool aVisible ); + + + public: // From MFlashStatusObserver + /* + * Flash icon visibility has changed. + * @param aVisible new visibility status + */ + virtual void FlashIconVisible( TBool aVisible ); + + /** + * Called every time when camera driver reports error in + * flash recharging. + */ + virtual void FlashError(); + + // support for creating long running AO to create AP + static TInt BackgroundAPL( TAny *aparam ); + TBool SetupActivePaletteCallbackL(); + + private: + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + */ + void ConstructL( const TRect& aRect ); + + /** + * Symbian OS 2nd phase constructor. + * @param aRect Frame rectangle for container. + */ + void BaseConstructL( const TRect& aRect ); + + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppControllerBase instance + * @param aSetupPaneHandler handle to horizontal setup pane (product specific) + * @param aView reference to the view containing this container + */ + CCamStillPreCaptureContainer( CCamAppController& aController, + CAknView& aView ); + + private: // Methods from base classes + + /** + * From CCamPreCaptureContainerBase + * Return the id of the layout resource for the viewfinder frame + * @since 2.8 + * @param aViewFinderLayoutId on return this contains the resource id + * of the viewfinder layout + * @param aReticuleLayoutId on return this contains the resource id + * of the reticule layout if used, otherwise 0 + */ + void ViewFinderLayoutResourceIds( TInt& aViewFinderLayoutId, + TInt& aReticuleLayoutId ) const; + + /** + * From CCamPreCaptureContainerBase + * Sets the resolution indicator to the required icon + * @since 2.8 + */ + void SetResolutionIndicator(); + + /** + * Sets the location indicator icon if the setting is enabled + */ + void SetLocationIndicatorVisibility(); + + /** + * From CCamPreCaptureContainerBase + * Move up through the flash settings + * @since 3.0 + */ + void IncreaseFlashSettingL(); + + /** + * From CCamPreCaptureContainerBase + * Move down through the flash settings + * @since 3.0 + */ + void DecreaseFlashSettingL(); + + /** + * From CCamPreCaptureContainerBase + * Process a key event that should change the current capture state + * E.g. start/pause recording, start/stop capture + * @since 3.0 + * @param aKeyEvent the key press that initiates the capture + * @return whether or not the key was consumed + */ + TKeyResponse HandleCaptureKeyEventL( const TKeyEvent& aKeyEvent ); + + /** + * Process a key event that could change the current capture state + * E.g. start autofocus, revert from post-capture to pre-capture views + * @since 3.0 + * @param aKeyEvent the key press that initiates the capture + * @param aType the key type for the event + * @return whether or not the key was consumed + */ + TKeyResponse HandleShutterKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * Allows additional mode-specific icons to be drawn + * @param aGc The context to draw with + */ + virtual void DrawAdditionalIcons(CBitmapContext& aGc) const; + + /** + * Returns the ID of the array containing the resolution indicator icons + * @return The array ID + * @since 3.0 + */ + virtual TCamPsiKey ResolutionIndicatorIconPsiKey() const; + + /** + * Gets the resource id of AP items. + * Resource is selected based on embedded status and user mode. + */ + virtual TInt GetAPResourceId() const; + + /** + * Init the viewfinder grid. + * Creates the grid drawer if not done yet. + * Set drawing rectangle and visibility. + */ + virtual void InitVfGridL( const TRect& aRect ); + + private: // New functions + /** + * Loads the flash icon file and subscribes to blink events + */ + void InitFlashIconL(); + + /** + * Loads flash icon layout from resources, and sets icon size + */ + void LayoutFlashIcon(); + + /** + * Draws the flash icon to select + * @param aGc + */ + void DrawFlashIcon( CBitmapContext& aGc ) const; + + /** + * Utility function to subscribe / unsubscribe from flash related events + * @param aSubscribe, true->subscribe, else unsubscribe + */ + void SubscribeFlashEvents( TBool aSubscribe ); + + + private: // Data + TBool iFlashIconVisible; + TRect iFlashIconRect; + // Xenon flash bitmap + CFbsBitmap* iFlashBitmap; + CFbsBitmap* iFlashBitmapMask; + + TBool iXenonFlashSupported; + + CIdle* iAPCreateAO; + + }; + +#endif // CAMSTILLPRECAPTURECONTAINER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamStillPreCaptureView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamStillPreCaptureView.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,305 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View class for still image pre capture view* +*/ + + +#ifndef CAMSTILLPRECAPTUREVIEW_H +#define CAMSTILLPRECAPTUREVIEW_H + +// INCLUDES +#include "CamPreCaptureViewBase.h" + + +// FORWARD DECLARATIONS +class CAknButton; +class CAknToolbarExtension; + +// CLASS DECLARATION + +/** +* View class for still image capture +* +* @since 2.8 +*/ +class CCamStillPreCaptureView : public CCamPreCaptureViewBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aController Reference to either the application controller + * base class or test base class + * @since 2.8 + * @return pointer to the created CCamStillPreCaptureView object + */ + static CCamStillPreCaptureView* NewLC( CCamAppController& aController ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamStillPreCaptureView(); + + public: // Functions from base classes + + /** + * From CAknView. + * @since 2.8 + * @return UID of view + */ + TUid Id() const; + + /** + * From CAknView. + * @since 2.8 + */ + void DoDeactivate(); + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * From CAknView Handles the foreground/background event + * @since 2.8 + * @param aForeground ETrue if this view is on foreground, else EFalse. + */ + void HandleForegroundEventL( TBool aForeground ); + + /** + * From CCamViewBase + * Handle change of focus to another application + * This only handles another application coming to the foreground when + * the camera application is already in the background behind an eikon + * server window + * @since 2.8 + */ + void HandleFocusLossL(); + + /** + * From MCamControllerObserver + * @since 2.8 + * @param aEvent The enumerated code for the event received + * @param aError The error code associated with the event + */ + void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + /** + * From CAknView. + * @since 2.8 + * @param aPrevViewId the ID for previous view we are switching from + * @param aCustomMessageId the Uid for message passed to this view + * @param aCustomMessage descriptor containing data content for view specific message + */ + void DoActivateL( const TVwsViewId& aPreViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * From CCamViewBase. + * Called to identify the help context for this view + * @since 2.8 + * @param aContext Help context object to populate with control context + * information + */ + virtual void GetHelpContext( TCoeHelpContext& aContext ) const; + + /** + * From CCamViewBase + * Update the softkeys for the current situation. + * @since 2.8 + */ + void UpdateCbaL(); + + public: // New functions + + /** + * Update fixed toolbar icons according to current settings + * @since S60 5.0 + */ + void UpdateToolbarIconsL(); + + /** + * Try to start the capture with MSK command. + * @since 9.1 + * @return ETrue if started. + */ + TBool StartMskCaptureL(); + +// from base class MAknToolbarObserver + + void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); + + protected: // Functions from base classes + + /** + * From CCamPreCaptureViewBase + * Set the menu bar resource. + */ + virtual void SetMenuBar(); + + /** + * From CCamPreCaptureViewBase Handle commands + * Creates a photo capture setup menu + * @since 2.8 + */ + void CreateCaptureSetupMenuL(); + + + /** + * Enter scene setting mode. + * Creates a container to replace the normal container on the control stack. + * Updates the Cba, title pane and navi pane. + * @since 2.8 + */ + void SwitchToSceneSettingModeL(); + + /** + * Enter InfoListBox mode + * Creates a container to replace the normal container on the control stack. + * Updates the Cba, title pane and navi pane. + * @param aMode + * @since 3.0 + */ + void SwitchToInfoListBoxL( TCamInfoListBoxMode aMode ); + + private: // New functions + + /** + * C++ default constructor. + * @param aController Reference to either the application controller + * base class or test base class + * @since 2.8 + */ + CCamStillPreCaptureView( CCamAppController& aController ); + + /** + * By default Symbian 2nd phase constructor is private. + * @since 2.8 + */ + void ConstructL(); + + + /* + * Updating Light sensitivity icons if supported + */ + void UpdateFlashIconsL(); + + /* + * Updating Light sensitivity icons if supported + */ + void UpdateLightSensitivityIconsL(); + + /* + * Update color tone specific icons if supported. + */ + void UpdateColorToneIconsL(); + + /* + * Update white balance specific icons if supported. + */ + void UpdateWhiteBalanceIconsL(); + + /* + * Update sharpness specific icons if supported. + */ + void UpdateSharpnessIconsL(); + + /* + * Update exposure specific icons if supported. + */ + void UpdateExposureIconsL(); + + /* + * Update contrast specific icons if supported. + */ + void UpdateContrastIconsL(); + + /* + * Update self timer specific icons if supported. + */ + void UpdateSelfTimerIconsL(); + + /* + * Update scene mode specific icons if supported. + */ + void UpdateSceneModeIconsL(); + + /* + * Update scene mode specific icons if supported. + */ + void UpdateVFGridIconsL(); + + /* + * Update scene mode specific icons if supported. + */ + void UpdateBurstModeIconsL(); + /* + * Update Face Tracking specific icons if supported. + */ + void UpdateFaceTracKingIconsL(); + + private: // Functions from base classes + + /** + * From CCamViewBase + * Set the view's title text + * @since 2.8 + */ + void SetTitlePaneTextL(); + + /** + * From CCamPreCaptureViewBase + * Enter Viewfinder mode + * @since 2.8 + */ + void StartViewFinder(); + + /** + * From CCamPreCaptureViewBase + * Exit Viewfinder mode + * @since 2.8 + */ + void StopViewFinder(); + + /** + * From CCamViewBase + * Create the container associated with this view. + * @since 2.8 + */ + void CreateContainerL(); + + private: // From MEikMenuObserver + /** + * From MEikMenuObserver Changes MenuPane dynamically + * @param Resource Id + * @param Handle to menu pane + * @since 2.8 + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: + // Cache the previous controller operation state that we were informed about + TCamCaptureOperation iPreviousControllerOperation; + TBool iSoftkeyBlankIsNeeded; + + }; + +#endif // CAMSTILLIMAGEPRECAPTUREVIEW_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamStillUserSceneSetupView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamStillUserSceneSetupView.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Ensures that the container for the user scene setup is constructed* +*/ + + +#ifndef CAMSTILLUSERSCENESETUPVIEW_H +#define CAMSTILLUSERSCENESETUPVIEW_H + +// INCLUDES +#include "CamUserSceneSetupViewBase.h" + +// FORWARD DECLARATIONS + +// CLASS DECLARATION +class CCamAppController; + +/** +* Ensures that the container for the user scene setup is constructed +* using the photo user scene setup resource. +* +* @since 2.8 +*/ +class CCamStillUserSceneSetupView : public CCamUserSceneSetupViewBase + { + protected: // data types + + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param A reference to the controller. + * @return A pointer to the new CCamStillUserSceneSetupView object. + */ + static CCamStillUserSceneSetupView* NewLC( CCamAppController& aController ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamStillUserSceneSetupView(); + + public: // Functions from base classes + /** + * From CAknView. + * @since 2.8 + * @return UID of view + */ + TUid Id() const; + + protected: // Constructors etc. + + + protected: // From base class + + void CreateContainerL(); + /** + * Starts the view finder. + * @since 2.8 + */ + void StartViewFinder(); + + /** + * Stops the view finder. + * @since 2.8 + */ + void StopViewFinder(); + + /** + * Exit capture setup mode. + * @since 2.8 + */ + void ExitCaptureSetupModeL(); + + /** + * From CCamCaptureSetupViewBase + * Enter InfoListBox mode + * Creates a container to replace the normal container on the control stack. + * Updates the Cba, title pane and navi pane. + * @param aMode + * @since 3.0 + */ + void SwitchToInfoListBoxL( TCamInfoListBoxMode aMode ); + + /** + * From CCamCaptureSetupViewBase + * Handle InfoListBox item selection + * Updates the Cba, title pane and navi pane. + * @since 3.0 + */ + void HandleInfoListBoxSelectionL(); + + /** + * From MEikMenuObserver Changes MenuPane dynamically + * @param aResourceId Resource Id + * @param aMenuPane Handle to menu pane + * @since 2.8 + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: + /** + * C++ default constructor. + * @param aController Reference to either the application controller + * base class or test base class + * @since 2.8 + */ + CCamStillUserSceneSetupView( CCamAppController& aController ); + + /** + * 2nd phase constructor. + * @since 2.8 + */ + void ConstructL(); + + private: // From base class + /** + * Exits the user scene setup mode + * @since 2.8 + */ + void ExitUserSceneSetupModeL(); + + /** + * Switches to the user scene setup mode. + * @since 2.8 + */ + void SwitchToUserSceneSetupModeL(); + + + /** + * Switches the current mode to scene setting. + * @since 2.8 + */ + void SwitchToSceneSettingModeL(); + + /** + * Exit scene setting mode. + * @since 2.8 + */ + void ExitSceneSettingModeL(); + + + private: // data + }; + +#endif // CAMSTILLUSERSCENESETUPVIEW_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamSyncRotatorAo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamSyncRotatorAo.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility class to rotate bitmaps* +*/ + + + + + +#ifndef __CamSyncRotatorAo_H +#define __CamSyncRotatorAo_H + +// INCLUDES +#include + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +class MBitmapRotationObserver + { +public: + /** + * Mixin interface to be implemented by any object wishing to receive + * notification of rotation complete events. + * @since 3.0 + * @param aErr KErrNone if successful, on error other Epoc codes possible + */ + virtual void RotationCompleteL( TInt aErr ) = 0 ; + }; + + +/** +* Utility class to help in the rotating of bitmaps (for post-capture snapshot) +* +* @since 3.0 +*/ +class CCamSyncRotatorAo : public CActive + { + private: + // This structure stores the details of a rotation task. + // Used only internally, the bitmap is *not* owned by this + // class, and will be overwritten by the rotation operation. + class CRotateTask : public CBase + { + public: + // The source bitmap to be rotated (and overwritten) + CFbsBitmap* iBitmap; + + // The angle to rotate the bitmap by + CBitmapRotator::TRotationAngle iAngle; + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamSyncRotatorAo* NewL(MBitmapRotationObserver& aObserver); + + /** + * Destructor. + */ + virtual ~CCamSyncRotatorAo(); + + public: // New functions + /** + * Rotates the specified bitmap by the supplied angle. + * Note that the original bitmap will be overwritten + * @since 3.0 + * @param aBitmap The bitmap to rotate + * @param aRotation The angle to rotate the bitmap + */ + void RotateL( CFbsBitmap* aBitmap, CBitmapRotator::TRotationAngle aRotation ); + + public: // Functions from base classes + /** + * Called when a rotate operation has completed + * @since 3.0 + */ + void RunL(); + + + /** + * Called to cancel an outstanding operation (eg when class is being destroyed) + * @since 3.0 + */ + void DoCancel(); + + private: + + /** + * C++ default constructor. + * @since 3.0 + */ + CCamSyncRotatorAo(MBitmapRotationObserver& aObserver); + + /** + * By default Symbian 2nd phase constructor is private. + * @since 3.0 + */ + void ConstructL(); + + private: // Data + + // ICL utility class that actually does the bitmap rotation + CBitmapRotator* iRotator; + + MBitmapRotationObserver& iObserver; + }; + +#endif // __CamSyncRotatorAo_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamTimeLapseUtility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamTimeLapseUtility.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for Image/Video quality.* +*/ + + +#ifndef CAMTIMELAPSEUTILITY_H +#define CAMTIMELAPSEUTILITY_H + +// INCLUDES + +#include "CamSettingsInternal.hrh" // TCamTimeLapse + +// CLASS DECLARATION + +class CamTimeLapseUtility + { + + public: + /** + * Convert from enum to the capture mode to be used + * @since 3.0 + * @param aEnum enum value to translate + * @return + */ + static TInt EnumToCommand( TCamTimeLapse aEnum ); + + /** + * Convert from enum to the microsecond interval it represents + * @since 3.0 + * @param aEnum Enum value to translate + */ + static TTimeIntervalMicroSeconds EnumToInterval( TCamTimeLapse aEnum ); + + /** + * Convert from microsecond interval to the enum that represents it + * @since 3.0 + * @param aInterval Interval in microseconds to translate + * @param aBurst + */ + static TCamTimeLapse IntervalToEnum( TTimeIntervalMicroSeconds aInterval, TBool aBurst ); + + }; + +#endif // CAMTIMELAPSEUTILITY_H + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamTimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamTimer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object for implementing viewfinder timeout and* +*/ + + +#ifndef CAMTIMER_H +#define CAMTIMER_H + +// INCLUDES +#include "CamTimerBase.h" + +// CONSTANTS + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Active object for implementing viewfinder and post capture timeout +*/ +class CCamTimer : public CCamTimerBase + { + public: // Constructors and destructor + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aTimeout timer period + * @param aCallBack Method to call into when timer completes + * @return pointer to the created CCamTimer + */ + static CCamTimer* NewL( TInt aTimeout, TCallBack aCallBack ); + + /** + * Symbian two-phased constructor. + * @since 2.8 + * @param aTimeout timer period + * @param aCallBack Method to call into when timer completes + */ + static CCamTimer* NewLC( TInt aTimeout, TCallBack aCallBack ); + + /** + * Destructor. + */ + virtual ~CCamTimer(); + + public: // From CCamTimerBase + /** + * Start timer. + */ + void StartTimer(); + + /** + * Set the timeout period + * @since 3.0 + * @param aTimeout new timer period + */ + void SetTimeout( TInt aTimeout ); + + private: // Functions from base classes + /** + * From CActive, handle timeout expiration + */ + void RunL(); + + private: // New functions + /** + * C++ constructor + * @since 2.8 + * @param aTimeout timer period + * @param aCallBack Method to call into when timer completes + */ + CCamTimer( TInt aTimeout, TCallBack aCallBack ); + + /** + * Symbian 2nd phase constructor + * @since 2.8 + */ + void ConstructL(); + + private: + TUint iTimeout; + TCallBack iCallBack; + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamTimerBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamTimerBase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mixin class for implementing viewfinder timeout and* +*/ + + +#ifndef CAMTIMERBASE_H +#define CAMTIMERBASE_H + +// INCLUDES +#include + +// CONSTANTS + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Active object for implementing viewfinder and post capture timeout +*/ +class CCamTimerBase : public CTimer + { + public: // New functions + /** + * Start timer. + */ + virtual void StartTimer() = 0; + + /** + * Set the timeout period + * @since 3.0 + * @param aTimeout new timer period + */ + virtual void SetTimeout( TInt aTimeout ) = 0; + + protected: + + inline CCamTimerBase( TInt aPriority ); + }; + +#include "CamTimerBase.inl" + +#endif // CAMTIMERBASE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamTimerBase.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamTimerBase.inl Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of CCamTimerBase* +*/ + + + +// INCLUDE FILES + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CamTimerBase::CamTimerBase +// C++ default constructor +// ----------------------------------------------------------------------------- +// +inline CCamTimerBase::CCamTimerBase( TInt aPriority ) + : CTimer( aPriority ) + { + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamTitlePane.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamTitlePane.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for displaying the title in the Status Pane +* +*/ + + + +#ifndef CAMTITLE_H +#define CAMTITLE_H + +// INCLUDES +#include +#include "CamAppUiBase.h" // For TCamAppViewIds + + +// FORWARD DECLARATIONS +class MAknsControlContext; + +// CLASS DECLARATION + +/** +* Title control to show in small status pane layout +*/ +class CCamTitlePane : public CCoeControl + { + public: // Constructors and destructor + + /** + * Destructor. + * @since 3.0 + */ + virtual ~CCamTitlePane(); + + /** + * Factory construction function + * @since 3.0 + */ + static CCamTitlePane* NewL(); + + public: // New functions + /** + * Sets the title with the specified resource string + * @since 3.0 + * @param aResource The resource to get the string from + */ + void SetFromResourceL( TInt aResource ); + + /** + * Sets the title with the specified string + * @since 3.0 + * @param aText The string to set the text + */ + void SetTextL( const TDesC& aText ); + + public: // Functions from base classes + /** + * From CCoeControl + * @since 3.0 + * @param aRect Rect indicating the specific area to draw + */ + void Draw( const TRect& /*aRect*/ ) const; + + /** + * From CCoeControl + * @since 3.0 + */ + void SizeChanged(); + + protected: // Constructors + + /** + * C++ constructor + * @since 3.0 + */ + CCamTitlePane(); + + /** + * Second phase constructor + * @since 3.0 + */ + void ConstructL(); + + protected: // Data + HBufC16* iTextHbuf; + + TAknLayoutText iTitleTextLayout; + + // Layout for the Title Pane rectangle + TAknLayoutRect iTitlePaneLayoutRect; + }; + +#endif // CAMCONTAINERBASE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamUserSceneSetupContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamUserSceneSetupContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,214 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements container for the user scene setup list.* +*/ + + +#ifndef CAMUSERSCENESETUPCONTAINER_H +#define CAMUSERSCENESETUPCONTAINER_H + +// INCLUDES +#include "CamContainerBase.h" +#include +#include + +// FORWARD DECLARATIONS +class CAknSettingStyleListBox; +class CCamUserSceneSetupItemArray; +class CEikFormattedCellListBox; + +// CLASS DECLARATION + +/** +* CCamUserSceneSetupContainer container control class. +* +*/ +class CCamUserSceneSetupContainer : public CCamContainerBase, + public MEikListBoxObserver + //, public MCoeControlObserver + { + /* enum TVfState moved to CCamContainerBase. + */ + + // ======================================================= + // Constructors and destructor + public: + + /** + * Symbian two-phased constructor. + * @param aRect reference to the rectangular area for the container. + * @param aSettingsModel reference to the settings model. + * @return pointer to the created CCamUserSceneSetupContainer object. + * @since 2.8 + */ + static CCamUserSceneSetupContainer* NewLC( const TRect& aRect, + TInt aResourceId, + CCamAppController& aController, + CAknView& aView ); + /** + * Symbian two-phased constructor. + * @param aRect reference to the rectangular area for the container. + * @param aSettingsModel reference to the settings model. + * @return pointer to the created CCamUserSceneSetupContainer object. + * @since 2.8 + */ + static CCamUserSceneSetupContainer* NewL( const TRect& aRect, + TInt aResourceId, + CCamAppController& aController, + CAknView& aView ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamUserSceneSetupContainer(); + + // ------------------------------------------------------- + // From CCoeControl + private: + + /** + * @since 2.8 + */ + TInt CountComponentControls() const; + + /** + * @since 2.8 + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * @since 2.8 + * @param aKeyEvent the key event + * @param aType the type of the event + * @return TKeyResponse key event was used by this control or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + // ------------------------------------------------------- + // From MEikListBoxObserver + public: + + /** + * Handles a list box event. + * @param aListBox a reference to the list box. + * @param aEventType the type of event. + * @since 2.8 + */ + void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); + + /** + * Handles the user selection of a list item. + * @since 2.8 + */ + void HandleSelectionL(); + + // ------------------------------------------------------- + // New functions + public: + + /** + * Handles a change in the item list visibility. + * @since 2.8 + */ + void UpdateDisplayL(); + + /** + * Returns the resource Id of the title for this container. + * @return the resource Id + * @since 2.8 + */ + TInt TitlePaneTextResourceId(); + + /** + * Updates the list items with the settings model values. + * @since 2.8 + */ + void UpdateListItems(); + + /** + * Updates the current list item with it's associated + * settings model value. + * @since 2.8 + */ + void UpdateCurrentListItem(); + + /** + * Returns wheather user scene restore is highlighted + */ + TBool IsUserSceneResetHighlighted(); + + private: + + /** + * Updates a list item with its corresponding settings model value. + * @param aIndex the index of the list item. + * @since 2.8 + */ + void UpdateListItem( TInt aIndex ); + + /** + * Returns the command id for activating the UI control that is + * associated with the currently selected list item. + * @return the command id. + * @since 2.8 + */ + TInt CommandIdForActivatingCurrentItemControl(); + + /** + * Returns a pointer to the list box. + * @return the list box pointer. + * @since 2.8 + */ + CEikFormattedCellListBox* ListBox(); + + // ------------------------------------------------------- + // Constructors + private: + + /** + * C++ Constructor + * @param aController a reference to the controller. + * @param aView a reference to the view that contains this container. + * @since 2.8 + */ + CCamUserSceneSetupContainer( CCamAppController& aController, CAknView& aView ); + + /** + * 2nd phase constructor. + * @since 2.8 + * @param aRect reference to the rectangular area for the container. + * @param aSettingsModel reference to the settings model. + */ + void ConstructL( const TRect& aRect, TInt aResourceId ); + + // ======================================================= + // Data + private: + + // User scene setup list owned by this container. + CAknSettingStyleListBox* iUserSceneSetupList; + + // Array of user scene setup list items owned by this container. + CCamUserSceneSetupItemArray* iUserSceneSetupItemArray; + + // The resource if for the title of the scene setup list. + TInt iTitleResourceId; + + // ======================================================= + }; + +#endif + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamUserSceneSetupItemArray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamUserSceneSetupItemArray.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Array of user scene setup items.* +*/ + + +#ifndef CAMUSERSCENESETUPITEMARRAY_H +#define CAMUSERSCENESETUPITEMARRAY_H + +// INCLUDES +#include +#include "CamUserSceneSetupListItem.h" + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* CCamUserSceneSetupItemArray container control class. +* +*/ +class CCamUserSceneSetupItemArray : public CArrayPtrFlat, + public MDesCArray //, public MEikListBoxObserver, public MCoeControlObserver + { + public: // Constructors and destructor + + /** + * C++ Constructor + * @param Number of items to initialise array size with. + * @since 2.8 + */ + CCamUserSceneSetupItemArray( TInt aGranularity ); + + /** + * 2nd phase Constructor + * @since 2.8 + */ + void ConstructL(); + /** + * Destructor. + * @since 2.8 + */ + ~CCamUserSceneSetupItemArray(); + + public: // New functions + + public: // Functions from base class MDesC16Array + /** + * Method by which the CAknSetStyleListBox accesses the number of items in the array + * @return number of items in the array + * @since 2.8 + */ + TInt MdcaCount() const; + + /** + * Method by which the setting item list accesses the text for the aIndex-th item in the + * array. + * + * @param aIndex index at which to access the listbox text + * @return Descriptor for this item to be used by the listbox. + * @since 2.8 + */ + TPtrC16 MdcaPoint( TInt aIndex ) const; + + private: // Constructors + + + private: //data + }; + +#endif // CAMUSERSCENESETUPITEMARRAY_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamUserSceneSetupListItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamUserSceneSetupListItem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A user scene setup list item.* +*/ + + +#ifndef CAMUSERSCENESETUPLISTITEM_H +#define CAMUSERSCENESETUPLISTITEM_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS + +// CLASS DECLARATION +class TResourceReader; + +// CONSTANTS +const TInt KListItemMaximumSubTextLength = 50; +const TInt KListItemMaximumFullTextLength = 120; + + +/** +* A user scene setup list item. +* +*/ +class CCamUserSceneSetupListItem: public CBase + { + public: // Constructors and destructor + + /** + * Symbian two-phased constructor. + * @param resource Id for current item + * @return pointer to the created CCamUserSceneSetupListItem object. + * @since 2.8 + */ + static CCamUserSceneSetupListItem* NewLC( TInt aResId ); + /** + * Symbian two-phased constructor. + * @param resource Id for current item + * @return pointer to the created CCamUserSceneSetupListItem object. + * @since 2.8 + */ + static CCamUserSceneSetupListItem* NewL( TInt aResId ); + + /** + * Destructor. + * @since 2.8 + */ + ~CCamUserSceneSetupListItem(); + + public: // New functions + /** + * Returns the formatted text of this item to be used in the list box + * @since 2.8 + * @return pointer to the formatted text + */ + TPtrC16 ListBoxText(); + /** + * Returns the settings model item id that is associated with this + * list item. + * @since 2.8 + * @return the settings model item id. + */ + TInt SettingsModelTypeId(); + /** + * Sets the current value of this list item + * @since 2.8 + * @param the new value. + */ + void SetCurrentValue( TInt aNewValue ); + + + private: // Constructors + /** + * C++ Constructor + * @since 2.8 + */ + CCamUserSceneSetupListItem(); + /** + * 2nd phase Constructor + * @param resource Id for current item. + * @since 2.8 + */ + void ConstructL( TInt aResId ); + + private: // New functions + /** + * Returns the name of the setting type represented by this + * list item. + * @return the name text. + * @since 2.8 + */ + TPtrC SettingName() const; + /** + * Returns the text for the current setting value of this item + * @return the setting text. + * @since 2.8 + */ + TPtrC SettingText(); + + + private: //data + // type that couples a value id with a textual description. + class CValueTextPair: public CBase + { + public: // Data. + // The settings model id of the value. + TInt iSettingsModelId; + // The textual description of the value. + TBuf iText; + }; + + // A list of all possible values for this list item, and + // their associated text. + RPointerArray iValues; + // The pair index that is associated with the current settings + // model value for this list item. + TInt iCurrentPairIndex; + + // The setting model id for this list item type. + TInt iSettingsModelItemId; + // The name of this list item type, e.g. "White balance" + TBuf iName; + // The text for the current value of this item. + TBuf iValueText; + // The full formatted text for this list item. + TBufC iListBoxText; + }; + +#endif // CAMUSERSCENESETUPLISTITEM_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamUserSceneSetupViewBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamUserSceneSetupViewBase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,226 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Controls the switching between different control modes* +*/ + + +#ifndef CAMUSERSCENESETUPVIEWBASE_H +#define CAMUSERSCENESETUPVIEWBASE_H + + +// INCLUDES + +#include "CamCaptureSetupViewBase.h" +#include "CamControllerObservers.h" // MCamControllerObserver + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Controls the switching between different control modes +* for the user scene setup. +* +* @since 2.8 +*/ + +class CCamUserSceneSetupViewBase : public CCamCaptureSetupViewBase, + public MCamControllerObserver + { + protected: // data types + + + public: // Constructors and destructor + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamUserSceneSetupViewBase() = 0; + + public: // Functions from base classes + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * From CAknView Handles the foreground/background event + * @since 2.8 + * @param aForeground ETrue if this view is on foreground, else EFalse. + */ + void HandleForegroundEventL( TBool aForeground ); + + /** + * From CAknView activate the view + * @param aPrevViewId the id of the previously active view. + * @param aCustomMessageId the id of the custom message + * @param aCustomMessage the custom message + * @return void + * @since 2.8 + */ + void DoActivateL( const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ); + + /** + * From CAknView deactivate the view (free resources) + * @return void + * @since 2.8 + */ + void DoDeactivate(); + + /** + * From MCamControllerObserver + * @since 2.8 + * @param aEvent The enumerated code for the event received + * @param aError The error code associated with the event + */ + void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + /** + * From CCamCaptureSetupViewBase + * Revert to normal mode + * @since 2.8 + */ + virtual void ExitAllModesL(); + + protected: // Constructors etc. + + /** + * C++ default constructor. + * @param aController Reference to either the application controller + * base class or test base class + * @since 2.8 + */ + CCamUserSceneSetupViewBase( CCamAppController& aController ); + + protected: // New functions to be implemented by derived classes. + + /** + * Exits the user scene setup mode + * @since 2.8 + */ + virtual void ExitUserSceneSetupModeL(); + + /** + * Switches to the user scene setup mode. + * @since 2.8 + */ + virtual void SwitchToUserSceneSetupModeL(); + + /** + * Starts the viewfinder. + * @since 2.8 + */ + virtual void StartViewFinder() = 0; + /** + * Stops the viewfinder. + * @since 2.8 + */ + virtual void StopViewFinder() = 0; + + protected: // From base class + + /** + * From CCamViewBase + * Update the softkeys for the current situation. + * @since 2.8 + */ + void UpdateCbaL(); + + /** + * From CCamViewBase + * Set the view's title text + * @since 2.8 + */ + void SetTitlePaneTextL(); + + /** + * Exit capture setup mode. + * Replaces the normal container on the control stack. + * Reverts the Cba and title pane. + * Derived classes should override this method to add any additional + * functionality they require e.g exiting the viewfinder and + * reverting the navi pane if necessary when switching back to the view's + * normal mode. + * @since 2.8 + */ + virtual void ExitCaptureSetupModeL(); + + /** + * Exit scene setting mode. + * Replaces the normal container on the control stack. + * Reverts the Cba and title pane. + * @since 2.8 + */ + void ExitSceneSettingModeL(); + + /** + * From CCamCaptureSetupViewBase + * Exit InfoListBox + * Updates the Cba, title pane and navi pane. + * @since 3.0 + */ + virtual void ExitInfoListBoxL(); + + private: // New functions + /** + * Switches to the capture setup mode. + * @param command that specifies which capture setup control to use + * in the new mode. + * @since 2.8 + */ + void SwitchToCaptureSetupModeL( TInt aSetupCommand ); + + /** + * Returns true if only the user scene setup mode is active. + * @since 2.8 + */ + TBool IsOnlyUserSceneSetupModeActive(); + + + /** + * Displays reset user scene settings cofirmation note + * @since 3.0 + */ + void DisplayResetUserSceneDlgL(); + + protected: + + private: // data + + // Specifies whether the user scene setup mode is active + TBool iUserSceneSetupModeActive; + + // Specifies whether the user scene page mode is active. + TBool iUserScenePageModeActive; + + // Indicates that user has pressed cancel to close this view. + TBool iCancelRequest; + + // Indicates that user has pressed OK to close this view. + TBool iOkRequest; + + // Indicates that Viewfinder start has been requested. View switch + // should not occur until viewfinder start has completed. + TBool iVFRequested; + }; + +#endif // CAMUSERSCENESETUPVIEWBASE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamVideoPostCaptureView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamVideoPostCaptureView.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View class for video post capture view* +*/ + + +#ifndef CAMVIDEOPOSTCAPTUREVIEW_H +#define CAMVIDEOPOSTCAPTUREVIEW_H + +// INCLUDES +#include "CamPostCaptureViewBase.h" + +// FORWARD DECLARATIONS +class CCamAppController; +class CCamContainerBase; + + +// CLASS DECLARATION + +/** +* View class for video capture +* +* @since 2.8 +*/ +class CCamVideoPostCaptureView : public CCamPostCaptureViewBase, public MAiwNotifyCallback + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @since 2.8 + * @param aController Reference to either the application controller + * base class or test base class + * @return pointer to the created CCamVideoPostCaptureView object + */ + static CCamVideoPostCaptureView* NewLC( CCamAppController& aController ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamVideoPostCaptureView(); + + public: // Functions from base classes + + /** + * From CAknView. + * @since 2.8 + * @return UID of view + */ + TUid Id() const; + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void ProcessCommandL( TInt aCommand ); + + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * Displays the delete image/video confirmation note + * @since 2.8 + * @return ETrue if file deleted, otherwise EFalse + */ + TBool DisplayDeleteNoteL(); + + /** + * From CAknView. + * @since 2.8 + * @param aPrevViewId the ID for previous view we are switching from + * @param aCustomMessageId the Uid for message passed to this view + * @param aCustomMessage descriptor containing data content for view specific message + */ + void DoActivateL( const TVwsViewId& aPreViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + + /** + * From base class MAiwNotifyCallback. + * Handles any notification caused by asynchronous ExecuteCommandL + * or event. + * @param aCmdId Service command associated to the event. + * @param aEventId Occured event + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL + * @return error code for the callback + */ + TInt HandleNotifyL( + TInt aCmdId, + TInt aEventId, + CAiwGenericParamList& aEventParamList, + const CAiwGenericParamList& aInParamList ); + + private: // New functions + + /** + * C++ default constructor. + * @since 2.8 + * @param aController Reference to either the application controller + * base class or test base class + */ + CCamVideoPostCaptureView( CCamAppController& aController ); + + /** + * By default Symbian 2nd phase constructor is private. + * @since 2.8 + */ + void ConstructL(); + + private: // Functions from base classes + + /** + * From CAknView. + * @since 2.8 + */ + void DoDeactivate(); + + /** + * From CCamViewBase + * Set the view's title text + * @since 2.8 + */ + void SetTitlePaneTextL(); + + private: // From MEikMenuObserver + /** + * From MEikMenuObserver Changes MenuPane dynamically + * @param Resource Id + * @param Handle to menu pane + * @since 2.8 + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + // from base class MAknToolbarObserver + + void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); + + + + private: // Data + + TBool iRockerKeyPress; + }; + +#endif // CAMVIDEOPOSTCAPTUREVIEW_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamVideoPreCaptureContainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamVideoPreCaptureContainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,275 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for video pre capture view* +*/ + + + +#ifndef CAMVIDEOPRECAPTURECONTAINER_H +#define CAMVIDEOPRECAPTURECONTAINER_H + +// INCLUDES +#include "CamPreCaptureContainerBase.h" + +// CLASS DECLARATION + +/** +* Container for video image pre capture view +*/ +class CCamVideoPreCaptureContainer : public CCamPreCaptureContainerBase + { + public: // Constructors and destructor + + /** + * Symbian OS two-phased constructor + * @since 2.8 + * @param aController reference to CCamAppControllerBase instance + * @param aView reference to the view containing this container + * @param aSetupPaneHandler handle to horizontal setup pane (product specific) + * @param aRect Frame rectangle for container. + * @return Pointer to newly constructed CCamVideoPreCaptureContainer object + */ + static CCamVideoPreCaptureContainer* NewL( + CCamAppController& aController, + CAknView& aView, + const TRect& aRect ); + + /** + * Destructor. + */ + virtual ~CCamVideoPreCaptureContainer(); + + // ------------------------------------------------------- + // From MCamControllerObserver + public: + + /** + * @since 2.8 + * @param aEvent The specific event which occurred + * @param aError The error code associated with the event + */ + void HandleControllerEventL( TCamControllerEvent aEvent, TInt aError ); + + // + // ------------------------------------------------------- + // From MCamCameraObserver + public: + + /** + * @since Camera 4.0 + * @see MCamCameraObserver + */ + // Base class implementation fits this class, too. + // virtual void HandleCameraEventL( TInt aStatus, + // TCamCameraEventId aEventId, + // TAny* aEventData = NULL ); + + /** + * From MCamViewFinderObserver + * New viewfinder frame is available + * @since 2.8 + * @param aFrame pointer to the bitmap. This pointer is valid until + * the call returns. Ownership not transferred. + * @param aFrozen whether or not the viewfinder has been frozen + */ + // void ShowViewFinderFrame( const CFbsBitmap* aFrame, TBool aFrozen ); + + // + // ------------------------------------------------------- + // From CCamPreCaptureContainerBase + public: + + /** + * Handle events sending app to foreground or background + * @since 2.8 + * @param aForeground whether the event brings the app to fore or background + */ + virtual void HandleForegroundEventL( TBool aForeground ); + + protected: + + /** + * Init the viewfinder grid. + * Overriden from base class to always disable vf grid. + */ + virtual void InitVfGridL( const TRect& aRect ); + + private: + + /** + * From CCamPreCaptureContainerBase + * Return the id of the layout resource for the viewfinder frame + * @since 2.8 + * @param aViewFinderLayoutId on return this contains the resource id + * of the viewfinder layout + * @param aReticuleLayoutId on return this contains the resource id + * of the reticule layout if used, otherwise 0 + */ + virtual void ViewFinderLayoutResourceIds( TInt& aViewFinderLayoutId, + TInt& aReticuleLayoutId ) const; + + /** + * From CCamPreCaptureContainerBase + * Sets the resolution indicator to the required icon + * @since 2.8 + */ + virtual void SetResolutionIndicator(); + + /** + * Sets the location indicator icon if the setting is enabled + */ + virtual void SetLocationIndicatorVisibility(); + + /** + * Returns the rect of the location indicator + * @return The rect of the location icon as a TRect + * @since 3.0 + */ + virtual TRect LocationIndicatorRect(); + + /** + * From CCamPreCaptureContainerBase + * Move up through the flash settings + * @since 3.0 + */ + virtual void IncreaseFlashSettingL(); + + /** + * From CCamPreCaptureContainerBase + * Move down through the flash settings + * @since 3.0 + */ + virtual void DecreaseFlashSettingL(); + + /** + * From CCamPreCaptureContainerBase + * Process a key event that should change the current capture state + * E.g. start/pause recording, start/stop capture + * @since 3.0 + * @param aKeyEvent the key press that initiates the capture + * @return whether or not the key was consumed + */ + virtual TKeyResponse HandleCaptureKeyEventL( const TKeyEvent& aKeyEvent ); + + /** + * Allows additional mode-specific icons to be drawn + * @param aGc The context to draw with + */ + virtual void DrawAdditionalIcons(CBitmapContext& aGc) const; + + /** + * Returns the ID of the array containing the resolution indicator icons + * @return The array ID + * @since 3.0 + */ + virtual TCamPsiKey ResolutionIndicatorIconPsiKey() const; + + /** + * Process a key event that could change the current capture state + * E.g. start autofocus, revert from post-capture to pre-capture views + * @since 3.0 + * @param aKeyEvent the key press that initiates the capture + * @param aType the key type for the event + * @return whether or not the key was consumed + */ + virtual TKeyResponse HandleShutterKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * Gets the resource id of AP items. + * Resource is selected based on embedded status and user mode. + */ + virtual TInt GetAPResourceId() const; + + + // ------------------------------------------------------- + // New methods + private: + + /** + * Draws blank softkeys + * @since 3.0 + */ + void BlankSoftkeysL(); + + /** + * Creates the icons used to indicate video file type + * @since 3.0 + */ + void CreateFiletypeIndicatorL(); + + /** + * Sets the video file type icon depending on current setting + * @since 3.0 + */ + void SetFileTypeIndicator(); + + + // ------------------------------------------------------- + // Constructors + private: + + /** + * Symbian OS 2nd phase constructor. + * @since 2.8 + * @param aRect Frame rectangle for container. + */ + void ConstructL( const TRect& aRect ); + + /** + * C++ constructor + * @since 2.8 + * @param aController reference to CCamAppControllerBase instance + * @param aSetupPaneHandler handle to horizontal setup pane (product specific) + * @param aView reference to the view containing this container + */ + CCamVideoPreCaptureContainer( + CCamAppController& aController, + CAknView& aView ); + + // ======================================================= + // Data + private: + // Values representing current recording state + enum TCamRecordState + { + ECamNotRecording, + ECamRecording, + ECamRecordPaused + }; + + // Current recording states + TCamRecordState iRecordState; + + // resource for viewfinder layout + TInt iVFRes; + + // Video file type indicator + CCamIndicator* iFileTypeIndicator; + + // Location of video file type indicator during video capture + TRect iFileTypeIndicatorVidcapPosition; + + // Normal location of video file type indicator + TRect iFileTypeIndicatorPosition; + + // Position to move the resolution icon to during video capture + TRect iResolutionIndicatorVidcapPosition; + + // ======================================================= + }; + +#endif // CAMVIDEOPRECAPTURECONTAINER_H + +// End of File CAMVIDEOPRECAPTURECONTAINER_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamVideoPreCaptureView.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamVideoPreCaptureView.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,266 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View class for video pre capture view* +*/ + + +#ifndef CAMVIDEOPRECAPTUREVIEW_H +#define CAMVIDEOPRECAPTUREVIEW_H + +// INCLUDES +#include "CamPreCaptureViewBase.h" + + +// FORWARD DECLARATIONS +class CAknButton; +class MAknsSkinInstance; +class TAknsItemID; + +// CLASS DECLARATION + +/** +* View class for video capture +* +* @since 2.8 +*/ +class CCamVideoPreCaptureView : public CCamPreCaptureViewBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aController Reference to either the application controller + * base class or test base class + * @since 2.8 + * @return pointer to the created CCamVideoPreCaptureView object + */ + static CCamVideoPreCaptureView* NewLC( CCamAppController& aController ); + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamVideoPreCaptureView(); + + public: // Functions from base classes + + /** + * From CAknView. + * @since 2.8 + * @return UID of view + */ + TUid Id() const; + + /** + * From CAknView. + * @since 2.8 + */ + void DoDeactivate(); + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * From CAknView Handles the foreground/background event + * @since 2.8 + * @param aForeground ETrue if this view is on foreground, else EFalse. + */ + void HandleForegroundEventL( TBool aForeground ); + + /** + * From CCamViewBase + * Handle change of focus to another application + * This only handles another application coming to the foreground when + * the camera application is already in the background behind an eikon + * server window + * @since 2.8 + */ + void HandleFocusLossL(); + + /** + * From MCamControllerObserver + * @since 2.8 + * @param aEvent The enumerated code for the event received + * @param aError The error code associated with the event + */ + void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + /** + * From CAknView. + * @since 2.8 + * @param aPrevViewId the ID for previous view we are switching from + * @param aCustomMessageId the Uid for message passed to this view + * @param aCustomMessage descriptor containing data content for view specific message + */ + void DoActivateL( const TVwsViewId& aPreViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * From CCamViewBase. + * Called to identify the help context for this view + * @since 2.8 + * @param aContext Help context object to populate with control context + * information + */ + virtual void GetHelpContext( TCoeHelpContext& aContext ) const; + + /** + * From CCamViewBase + * Update the softkeys for the current situation. + * @since 2.8 + */ + void UpdateCbaL(); + + protected: // Functions from base classes + + /** + * From CCamPreCaptureViewBase + * Set the menu bar resource. + */ + virtual void SetMenuBar(); + + /** + * From CCamPreCaptureViewBase Handle commands + * Creates a video capture setup menu + * @since 2.8 + */ + void CreateCaptureSetupMenuL( ); + + /** + * Enter scene setting mode. + * Creates a container to replace the normal container on the control stack. + * Updates the Cba, title pane and navi pane. + * @since 2.8 + */ + void SwitchToSceneSettingModeL(); + + + /* + * Updates Video flash icon if supported + */ + void UpdateVideoFlashIconsL(); + + /* + * Updates Video flash icon if supported + */ + void UpdateVideoSceneModeIconsL(); + + /* + * Updates Video flash icon if supported + */ + void UpdateVideoColorToneIconsL(); + + /* + * Updates Video flash icon if supported + */ + void UpdateVideoWhitebalanceIconsL(); + + public: // New functions + + /** + * Update fixed toolbar icons according to current settings + * @since S60 5.0 + */ + void UpdateToolbarIconsL(); + + /** + * Try to start the capture with MSK command. + * @since 9.1 + * @return ETrue if started. + */ + TBool StartMskCaptureL(); + + private: // New functions + + /** + * C++ default constructor. + * @param aController Reference to either the application controller + * base class or test base class + * @since 2.8 + */ + CCamVideoPreCaptureView( CCamAppController& aController ); + + /** + * By default Symbian 2nd phase constructor is private. + * @since 2.8 + */ + void ConstructL(); + + private: // Functions from base classes + + /** + * From CCamViewBase + * Set the view's title text + * @since 2.8 + */ + void SetTitlePaneTextL(); + + /** + * From CCamPreCaptureViewBase + * Enter Viewfinder mode + * @since 2.8 + */ + void StartViewFinder(); + + /** + * From CCamPreCaptureViewBase + * Exit Viewfinder mode + * @since 2.8 + */ + void StopViewFinder(); + + /** + * From CCamViewBase + * Create the container associated with this view. + * @since 2.8 + */ + void CreateContainerL(); + + /** + * Mute or unmute audio in embedded video + * @since 2.8 + * @param aMuteAudio true or false + */ + void MuteEmbeddedAudioL( TBool aMuteAudio ); + +// from base class MAknToolbarObserver + + void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); + + void OfferToolbarEventL( TInt aCommand ); + + private: // From MEikMenuObserver + /** + * From MEikMenuObserver Changes menu pane dynamically + * @param Resource Id + * @param Handle to menu pane + * @since 2.8 + */ + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + private: + // Whether audio is enabled for video + // Have mute/unmute option in embedded video menu + TInt iAudioEnabled; + + }; + +#endif // CAMVIDEOPRECAPTUREVIEW_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamViewBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamViewBase.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,378 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for all camera views* +*/ + + +#ifndef CAMVIEWBASE_H +#define CAMVIEWBASE_H + +// =========================================================================== +// INCLUDES + +#include "CamAppUiBase.h" +#include "CamCommandHandlerAo.h" +#include + +// =========================================================================== +// FORWARD DECLARATIONS +class CCamAppController; +class CCamContainerBase; +class CCamStandbyContainer; +class CCamWaitDialog; + + +// =========================================================================== +// CLASS DECLARATION + +/** +* Base class for all camera views +* +* @since 2.8 +*/ +class CCamViewBase : public CAknView + { + public: // Constructors and destructor + + /** + * Destructor. + * @since 2.8 + */ + virtual ~CCamViewBase(); + + public: // New functions + + virtual void HandleAppEvent( const TCamAppEvent& aEvent ); + + /** + * Update the softkeys for the current situation. + * @since 2.8 + */ + virtual void UpdateCbaL(); + + /** + * Blank the softkeys on the cba + * @since 3.0 + */ + virtual void BlankSoftkeysL(); + + /** + * Switch from current mode to standby mode + * @since 2.8 + * @param aViewId the current view id + * @param aError associated error code + */ + virtual void SwitchToStandbyModeL( TCamAppViewIds aViewId, TInt aError ); + + /** + * Exit standby mode + * @since 2.8 + */ + void ExitStandbyModeL(); + + /** + * Exit all modes. + * Has empty default implementation which can be overriden + * if needed in inherited classes. Atleast user scene setup view does this. + * Called e.g. when entering standby mode to be able to enter normal + * VF mode again when exiting standby. + */ + virtual void ExitAllModesL(); + + /** + * Handle change of focus to another application + * This only handles another application coming to the foreground when + * the camera application is already in the background behind an eikon + * server window + * @since 2.8 + */ + virtual void HandleFocusLossL(); + + /** + * Handle change of mode + * @since 3.0 + */ + virtual void PrepareForModeChange(); + + /** + * Called to identify the help context for this view + * @since 2.8 + * @param aContext Help context object to populate with control context + * information + */ + virtual void GetHelpContext(TCoeHelpContext& aContext) const; + + /** + * Returns the currently used container for this view + * @since 2.8 + * @return The currently used container + * information + */ + CCamContainerBase* Container(); + + /** + * Sets the softkeys to the specified Resource ID + * @since 3.0 + * @param aResource ID of the softkey resource to use + */ + virtual void SetSoftKeysL(TInt aResource); + + /** + * Blanks the softkeys for the Courtesy UI Off state. + * @since 3.0 + */ + void SetCourtesySoftKeysL(); + + /** + * Returns the softkeys to their previous state after UI has been turned back on + * @since 3.0 + */ + void UnsetCourtesySoftKeysL(); + + /** + * Returns whether the view is in standby mode + * @return Whether the view is in standby mode + */ + TBool IsInStandbyMode(); + + /** + * Requests that the camera application redraws the supplied active palette area + * @since 3.0 + * @param aArea the area to redraw + */ + void RedrawAPArea(const TRect& aArea); + + + /** + * Return a pointer to view specific CBA (or applications CBA if + * there is no view specific CBA defined). + * @since S60 v5.0 + * @return Pointer to CEikButtonGroupContainer. Ownership not + * transferred + */ + CEikButtonGroupContainer* ViewCba(); + + /** + * Updates toolbar icons. + * + */ + virtual void UpdateToolbarIconsL(); + + public: // Functions from base classes + + /** + * From CAknView Handle commands + * @since 2.8 + * @param aCommand command to be handled + */ + void HandleCommandL( TInt aCommand ); + + /** + * From CAknView Handles the foreground/background event + * @since 2.8 + * @param aForeground ETrue if this view is on foreground, else EFalse. + */ + void HandleForegroundEventL( TBool aForeground ); + + /** + * Active object for handling toolbar commands + * @since S60 v.5.0 + */ + void HandleCommandAoL( TInt aCommand ); + + protected: // Functions from base classes + + /** + * From CAknView. + * @since 2.8 + * @param aPostvViewId the ID for previous view we are switching from + * @param aCustomMessageId the Uid for message passed to this view + * @param aCustomMessage descriptor containing data content for view specific message + */ + void DoActivateL( const TVwsViewId& aPostvViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + + /** + * From CAknView. + * @since 2.8 + */ + void DoDeactivate(); + + protected: // New functions + + /** + * C++ default constructor. + * @since 2.8 + * @param aController Reference to either the application controller base class or test base class + */ + CCamViewBase( CCamAppController& aController ); + + /** + * Create the container associated with this view. + * @since 2.8 + */ + virtual void CreateContainerL() = 0; + + /** + * Set the view's title text + * @since 2.8 + */ + virtual void SetTitlePaneTextL() = 0; + + /** + * Show rename query and rename file. + * Switch orientation if required. Calls DoQueryRenameL() + * @since 2.8 + * @param aMode The current mode. + */ + void QueryRenameL( TCamCameraMode aMode ); + + /** + * Show rename query and rename file. + * @since 2.8 + * @param aMode The current mode. + */ + void DoQueryRenameL( TCamCameraMode aMode ); + + /** + * Show an overwrite confirmation query. This is used + * when trying to overwrite a file using rename. + * @since 2.8 + * @param aFilename The name of the file that trying to overwrite. + * @return ETrue if the user has confirmed the overwrite. + */ + TBool ShowOverwriteConfirmationQueryL( + const TDesC& aFilename ); + + /** + * Show rename query. + * @since 2.8 + * @param aFilename The current name of the file that renaming. + * @param aMode The current capture mode. + * @return ETrue if the user has entered a name. Or EFalse, if + * user has cancelled the rename. + */ + TBool ShowRenameQueryL( TDes& aFilename, TCamCameraMode aMode ); + + /** + * Check if renaming to the given name is valid. + * @since 2.8 + * @param aFilename The new name to check. + * @return ETrue if the name is valid. + */ + virtual TBool IsNewNameValidL( const TDesC& aFilename ); + + /** + * Renames the current capture array file. + * @since 2.8 + * @param aNewName The new name for the current file. + * @param aMode The current capture mode. + * @return ETrue if the name has been renamed succesfully. + */ + TBool RenameCurrentFileL( const TDesC& aNewName, TCamCameraMode aMode ); + + /** + * Returns whether the view is a precapture view or not + * @since 3.0 + * @returns ETrue if view is precapture + */ + virtual TBool IsPreCapture(); + + /** + * Increment the camera user count. + * This method ensures that view only increments the counter by one. + */ + void IncrementCameraUsers(); + + /** + * Decrement the camera user count. + * If count goes to zero, camera is released. + * This method ensures, that decrement call is only forwarded to + * controller, if this view has earlier incremented the count. + */ + void DecrementCameraUsers(); + + /** + * Is this view using camera, i.e. has IncrementCameraUsers been called, + * but DecrementCameraUsers not. + */ + TBool IsCameraUser() const; + +public: + /** + * Returns whether the view is a postcapture view or not + * @since 3.0 + * @returns ETrue if view is postcapture + */ + virtual TBool IsPostCapture(); +private: + + /** + * Returns whether the view is a burst capture postcapture view or not + * @since 3.0 + * @returns ETrue if view is burst post capture postcapture + */ + virtual TBool IsBurstPostCapture(); + + /** + * Sets the iStandbyModeActive flag + * @param aActive What to set iStandbyModeActive to + */ + void SetStandbyModeActive(TBool aActive); + + protected: // Data + + // Base class for Camera application controller + CCamAppController& iController; + + // The container for the view's controls + CCamContainerBase* iContainer; // owned + + // Specifies whether the application is embedded or not. + TBool iEmbedded; + + // Resource Id for the view menu bar + TInt iPreviousMenuResourceId; + + // set to ETrue when in standby mode + TBool iStandbyModeActive; + + // error code associated with standby mode + //TInt iStandbyError; + + // standby mode container + CCamStandbyContainer* iStandbyContainer; + + private: // data + + // whether or not the view registered an interest in resources + // when it came to the foreground + TBool iIncEngineCount; + + + // Stores the current and previous resources used for setting the CBA + // Allows one level of "undo", currently used by the courtesy UI. + TInt iCurrentCbaResource; + TInt iPreviousCbaResource; + TBool iCourtesySoftkeys; + + // own. + CCamCommandHandlerAo* iCommandHandlerAo; + + }; + +#endif // CAMVIEWBASE_H + +// =========================================================================== +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamVolumeKeyObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamVolumeKeyObserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Observes Remote Controller Framework for volume key presses* +*/ + + +#ifndef CAMVOLKEYOBSERVER_H +#define CAMVOLKEYOBSERVER_H + +// INCLUDES +#include +#include "CamZoomPane.h" + +// FORWARD DECLARATIONS +class CRemConInterfaceSelector; +class CRemConCoreApiTarget; +class CCamRemConKeyResponse; +class CCamZoomPane; + +/** +* Observer interface for volume key events +* +* since @3.1 +* +*/ +class MCamVolumeKeyObserver + { +public: + /** + * Report volume keys events to observer + * @since 3.1 + * @param aOperationId Volume key up Volume key down event + * @param aButtonAct button action (press, release, click) + */ + virtual void HandleVolumeKeyEvent( TRemConCoreApiOperationId aOperationId, + TRemConCoreApiButtonAction aButtonAct ) = 0; + }; + +// CLASS DECLARATION + +/** +* Observes Remote Controller Framework +* +* @since 3.1 +*/ +class CCamRemConObserver + : public CBase, public MRemConCoreApiTargetObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aZoomPane zoom pane instance + * @return new instance. + */ + static CCamRemConObserver* NewL( MCamVolumeKeyObserver& aObserver ); + + /** + * Destructor. + */ + ~CCamRemConObserver(); + + public: // New functions + + protected: + + /** + * from MRemConCoreApiTargetObserver interface class. + * A command has been received. + * @param aOperationId The operation ID of the command. + * @param aButtonAct The button action associated with the command. + */ + void MrccatoCommand( TRemConCoreApiOperationId aOperationId, + TRemConCoreApiButtonAction aButtonAct ); + + /** + * from MRemConCoreApiTargetObserver interface class. + * not used + */ + void MrccatoPlay(TRemConCoreApiPlaybackSpeed aSpeed, + TRemConCoreApiButtonAction aButtonAct); + + /** + * from MRemConCoreApiTargetObserver interface class. + * not used + */ + void MrccatoTuneFunction(TBool aTwoPart, + TUint aMajorChannel, + TUint aMinorChannel, + TRemConCoreApiButtonAction aButtonAct); + + /** + * from MRemConCoreApiTargetObserver interface class. + * not used + */ + void MrccatoSelectDiskFunction(TUint aDisk, + TRemConCoreApiButtonAction aButtonAct); + + /** + * from MRemConCoreApiTargetObserver interface class. + * not used + */ + void MrccatoSelectAvInputFunction(TUint8 aAvInputSignalNumber, + TRemConCoreApiButtonAction aButtonAct); + + /** + * from MRemConCoreApiTargetObserver interface class. + * not used + */ + void MrccatoSelectAudioInputFunction(TUint8 aAudioInputSignalNumber, + TRemConCoreApiButtonAction aButtonAct); + + private: + + /** + * C++ default constructor. + * @since 3.1 + * @param aZoomPane instance of zoom pane + */ + CCamRemConObserver( MCamVolumeKeyObserver& aObserver ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: // Data + + // Remote Controller + CRemConInterfaceSelector* iInterfaceSelector; + + // Remote Controller + CRemConCoreApiTarget* iCoreTarget; + + // Key response + CCamRemConKeyResponse* iActiveRemCon; + + // zoom pane + MCamVolumeKeyObserver& iObserver; + }; + +#endif // CAMVOLKEYOBSERVER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamZoomModel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamZoomModel.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,431 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Controls the state of the zoom* +*/ + + + +#ifndef CAMZOOMMODEL_H +#define CAMZOOMMODEL_H + +// INCLUDES +#include +#include "CamPSI.h" +#include "CamAppController.h" +#include "CamControllerObservers.h" // MCamControllerObserver +#include "CamZoomUpdateManager.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CCamZoomPane; + +// CLASS DECLARATION + +/** +* This class contains the logic for handling zoom operations +* with support for Optical, Digital and Extended Digital zoom +* +* @since 3.0 +*/ +class CCamZoomModel : public CBase, + public MCamControllerObserver + { + // ========================================================================= + // Types + public: + + enum TCamZoomModelState + { + ECamZoomModelStateZoomNone, + ECamZoomModelStateZoomIn, + ECamZoomModelStateZoomOut, + ECamZoomModelStateZoomTo + }; + + /* Moved to CamSettingsInternal.hrh + // Used to represent the current zoom mode used with the Engine + enum TCamZoomMode + { + ECamZoomModeUndefined, + ECamZoomModeOptical, + ECamZoomModeDigital, + ECamZoomModeExtended + }; */ + + // Used to describe the current zoom mode boundary. + enum TCamZoomBoundary + { + ECamZoomBoundaryUndefined, // Not checked yet for current zoom step + ECamZoomBoundaryNone, // Checked, but not at a boundary + ECamZoomBoundaryOptDig, // Checked, and at Optical/Digital boundary + ECamZoomBoundaryDigExt // Checked, and at Digital/Extended boundary + }; + + // PauseState represents handling of pausing zooming in at + // zoom mode boundarys (between optical/digital and digital/extended) + enum TPauseState + { + EPauseStateNone, // Not at a boundary + EPauseStatePaused, // Just hit a boundary, all zoom-in events ignored until released + EPauseStateReleased // Just released zoom key, allow next zoom + }; + + // ========================================================================= + // Methods + + // ------------------------------------------------------------------------- + // Constructors and destructor + public: + + /** + * Two-phased constructor. + */ + static CCamZoomModel* NewL( CCamAppController& aController, CCamZoomPane* aZoomPane ); + + /** + * Destructor. + */ + virtual ~CCamZoomModel(); + + // ------------------------------------------------------------------------- + // From CCamAppControllerBase + public: + + /** + * Handle controller event. + * @since 3.0 + * @param aEvent the controller event that has occurred + * @param aError any reported error + */ + virtual void HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ); + + + + + // ------------------------------------------------------------------------- + // New functions + public: + + /** + * Attempts to zoom in one step, if possible. + * Zooming will continue until StopZoom() is called. + * @since 3.0 + */ + void ZoomIn( TBool aOneClick = EFalse ); + + /** + * Attempts to zoom out one step, if possible. + * Zooming will continue until StopZoom() is called. + * @since 3.0 + */ + void ZoomOut( TBool aOneClick = EFalse ); + + /** + * Attempts to zoom to a specific point, if possible. + * + * @since 5.0 + */ + void ZoomTo( TInt aValue ); + + /** + * Stops an ongoing zoom in/out operation + * @since 3.0 + */ + void StopZoom(); + + /** + * Checks the current state of the Camera application, and adjusts the + * min/max range of the zoom pane accordingly. + * @since 3.0 + */ + void RefreshSettings(); + + /** + * Timer callback, used during a zoom in/out to trigger repeat + * zoom steps while the key is held down. + * @param aObject Pointer to a CCamZoomModel object + * @return TInt KErrNone if ok + * @since 3.0 + */ + static TInt ZoomTimerCallback( TAny* aObject ); + + /** + * Returns whether the zoom model is currently zooming in or out + * @since 3.0 + * @return ETrue if zooming, else EFalse + */ + TBool IsCurrentlyZooming() const; + + /** + * Returns zoom model state + * @since S60 v5.0 + * @return TCamZoomModelState + */ + TCamZoomModelState ZoomingState(); + + /** + * Indicates that the zoom level should be reset to default + * when the engine is next prepared + * @since 2.8 + * @param aReset ETrue if the zoom pane should be reset, else EFalse + */ + void ResetToDefaultAfterPrepare( TBool aReset ); + + /** + * Indicates whether or not the zoom level is waiting to be reset to default + * @since 3.0 + * @return TBool ETrue if a reset is pending, othewise EFalse + */ + TBool IsResetPending() const; + + /*** + * Resets the zoom (digital, and, if available, optical) to 1x + * @since 3.0 + */ + void ResetZoomTo1x(); + + private: + + /** + * Called by the timer callback function to perform + * the operation of one timer "tick". Will zoom in or out + * one step to continue the ongoing zoom operation. + * @since 3.0 + */ + void ZoomTimerTick(); + + /** + * Starts the zoom timer if not already running. + * @since 3.0 + */ + void StartZoomTimer(); + + /** + * Returns the maximum zoom step from the supplied step array. + * The returned step takes into account the currently active + * camera and capture mode. + * @param aStepArray The step array from the PSI + * @since 3.0 + * @return The maximum step from the array. + */ + TInt MaxZoomStep( const TCamMaxZoomSteps& aStepArray ) const; + + /*** + * Checks the zoom mode is that expected. If not, will be set. + * @param aMode The zoom mode to check for + * @since 3.0 + */ + void CheckZoomMode( TCamZoomMode aMode ); + + /*** + * Reads the digital zoom setting and updates internal state + * @since 3.0 + */ + void ReadDigitalZoomSetting(); + + /*** + * Reads the optical zoom setting and updates internal state + * @since 3.0 + */ + void ReadOpticalZoomSetting(); + + /*** + * Checks that the current zoom levels for optical/digital zoom + * do not exceed current limits. If they do, the level is set + * to the available limit. + * @since 3.0 + */ + void CheckZoomLimit(); + + /*** + * Returns whether EXTENDED zoom is allowed based on + * settings for the current resolution, and user options. + * @since 3.0 + * @returns ETrue if allowed, else EFalse + */ + TBool AllowExtZoom() const; + + /*** + * Returns whether OPTICAL zoom is allowed based on + * settings for the current resolution, and user options. + * @since 3.0 + * @returns ETrue if allowed, else EFalse + */ + TBool AllowOptZoom() const; + + /*** + * Returns whether DIGITAL zoom is allowed based on + * settings for the current resolution, and user options. + * @since 3.0 + * @returns ETrue if allowed, else EFalse + */ + TBool AllowDigZoom() const; + + /*** + * Returns whether zooming should be paused at the + * specified zoom boundary. + * @since 3.0 + * @param aBoundary + * @returns ETrue if pause required, else EFalse + */ + TBool PauseAtBoundary( TCamZoomBoundary aBoundary ) const; + + /*** + * Checks whether doing the next zoom operation will move + * from one type of zoom to another. + * + * Will return any of: + * - ECamZoomBoundaryNone (not on a boundary) + * - ECamZoomBoundaryOptDig (on optical/digital boundary) + * - ECamZoomBoundaryDigExt (on digital/extended boundary) + * + * @since 3.0 + * @returns The current zoom boundary state + */ + TCamZoomBoundary CheckBoundary() const; + + /*** + * Returns the current zoom type (Optical/Digital/Extended), based + * on the current zoom level. Optionally takes a parameter, to + * see what zoom type would be used if zoom level adjusted by + * the stepmodifier (positive or negative) + * @since 3.0 + * @param aStepModifier Value to add to current zoom + * @returns The zoom mode of current zoom value + step modifier + */ + TCamZoomMode CurrentZoomType( TInt aStepModifier = 0 ) const; + + /*** + * Returns the number of zoom steps that the next zoom will jump. + * @since 3.0 + * @returns The number of zoom steps to jump. + */ + TInt ZoomStepsToJump() const; + + /*** + * Returns (via references) how the zoom steps should be split up + * between the optical, digital and extended zoom modes. + * @since 3.0 + * @param aOpt The optical steps to move. + * @param aDig The digital steps to move. + * @param aExt The extended steps to move. + */ + void ZoomStepsToJump( TInt& aOpt, TInt& aDig, TInt& aExt ) const; + + /** + * Returns the current combined (optical + digital) zoom + * for the current zoom model state. + * @since 3.0 + * @returns The current combined zoom + */ + TInt CurrentZoom() const; + + /** + * Read the current resolution id. + * + */ + void ReadCurrentResolution(); + + // ------------------------------------------------------------------------- + // Private constructors + private: + + /** + * C++ default constructor. + */ + CCamZoomModel( CCamAppController& aController, CCamZoomPane* aPane ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // ========================================================================= + // Data + private: + + // Arrays from the PSI, describing maximum zoom steps for + // different zoom modes and different resolutions and media + TCamMaxZoomSteps iOptZoomSteps; // Optical zoom steps + TCamMaxZoomSteps iDigZoomSteps; // Standard digital zoom steps + TCamMaxZoomSteps iExtZoomSteps; // Extended digital zoom steps + + // These values are the maximum zoom steps for different zoom modes. + // Will be updated when RefreshSettings() is called. + TInt iMaxZoomStepOpt; // Max Optical step + TInt iMaxZoomStepDig; // Max Digital step + TInt iMaxZoomStepExt; // Max Extended step + + // Zoom setting: Allow digital and/or extended, where to pause. + TCamSettingsDigitalZoom iZoomSetting; + + // Whether to allow Optical zoom during video + TBool iAllowOptZoom; + + // The current optical and digital zoom steps + TInt iCurZoomStepOptical; + TInt iCurZoomStepDigital; + + // Max allowed zoom step (taking into account optical, digital and extended) + TInt iMaxZoomStep; + + // Stores the current state of the model, and the last-notified + // engine state. + TCamZoomModelState iState; + // TCamEngineState iEngineState; + TUint iCameraState; + + // Stores the latest video or image resolution id. + TInt iCurrentResolution; + + // Reference to the controller used for setting the zoom step and mode. + CCamAppController& iController; + + // Update manager is used to minimize amount of updates sent to driver. + CCamZoomUpdateManager* iCamZoomUpdateManager; + + // Timer for zooming smoothly + CPeriodic* iZoomTimer; + CCamZoomPane* iPane; + + // Keeps track of the current zoom mode + TCamZoomMode iZoomMode; + + // Stores a look-and-feel structure for the zoom bar. + TCamZoomLAF iZoomLAF; + + // The current pause state (none/paused/released) + TPauseState iPauseState; + + // Whether the camera app is currently recording video + // Used to identify when we *stop* recording + TBool iRecordingVideo; + + // Whether or not the zoompane should reset to default value on next prepare + TBool iResetPending; + + // ========================================================================= + }; + +#endif // CAMZOOMMODEL_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamZoomPane.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamZoomPane.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,474 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for Camera Zoom Pane* +*/ + + + +#ifndef CAMZOOMPANE_H +#define CAMZOOMPANE_H + +// INCLUDES +#include +#include +#include // for TAknLayout +#include "CamPSI.h" // For Product Specific Information +#include "CamAppController.h" // For controller definition +#include "CamSettings.hrh" // For TCamPhotoSizeId +#include "CamSettingsInternal.hrh" +#include "CamResourceLoader.h" +#include "CamZoomModel.h" +#include "CamBmpRotatorAo.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CCamRemConObserver; +class MTouchFeedback; + +// CLASS DECLARATION + +/** +* Class for showing the current zoom level in a side pane. +* +* @since 2.8 +*/ +class CCamZoomPane : public CBase, + public MCamControllerObserver, + public MCamResourceLoader + { + // Private data type used internally by the zoom pane + // to store the orientation it should be drawn + enum TZPOrientation + { + EZPOrientationVertical = 0, + EZPOrientationHorizontal = 1 + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor. + * @param aController handle to camera application controller + * @param aOverlayViewFinder whether zoom pane is drawn over view finder + */ + static CCamZoomPane* NewL( CCamAppController& aController, + TBool aOverlayViewFinder ); + + /** + * Destructor. + */ + virtual ~CCamZoomPane(); + + public: // From MCamResourceLoader + /** + * From MCamResourceLoader + * @since 3.0 + */ + void LoadResourceDataL(); + + /** + * From MCamResourceLoader + * @since 3.0 + */ + void UnloadResourceData(); + + /** + * From MCamResourceLoader + * @since 3.0 + */ + void ReloadResourceDataL(); + + public: // New functions + /** + * Sets the range of values to be represented on the Zoom Pane "shaft". + * These values should be retrieved from the CCaeEngine + * @since 2.8 + * @param aMin The minimum supported value (typically zero) + * @param aMax The maximum supported value (one or more) + * @return KErrNone if parameters are valid, else KErrArgument + */ + TInt SetZoomRange( TInt aMin, TInt aMax ); + + /** + * Sets the current zoom level. Must be within (inclusive) range passed + * to the SetZoomRange function. + * @since 2.8 + * @param aZoom New zoom value to use. + * @return KErrNone if parameter valid, else KErrArgument + */ + TInt SetZoomValue( TInt aZoom ); + + /** + * Sets the keys to be intepreted as zoom keys + * @since 3.0 + * @param aZoomIn Zoom in key scancode + * @param aZoomOut Zoom out key scancode + */ + void SetZoomKeys( const RArray& aZoomIn, + const RArray& aZoomOut ); + + /** + * Gets the current zoom step + * @since 2.8 + * @returns The current zoom step + */ + TInt ZoomValue() const; + + /** + * Returns whether or not the Zoom Pane can currently be shown. + * @since 2.8 + * @return ETrue if the Zoom Pane is allowed to be shown, else EFalse + */ + TBool OkToShowPane() const; + + /** + * Is the zoom pane is visible + * @since 2.8 + * @return ETrue if the zoom pane is visible + */ + TBool IsVisible() const; + + /** + * Tells the zoom pane whether it is on display + * @since 2.8 + * @param aVisible ETrue to make the zoom pane invisible + * @param aRedraw Whether to force a redraw event + */ + void MakeVisible( TBool aVisible, TBool aRedraw ); + + /** + * Draws the zoom pane + * @since 2.8 + * @param aGc The graphics context to use for drawing + */ + void Draw( CBitmapContext& aGc ) const; + + /** + * Set draw rect + * @since 2.8 + * @param aRect Rect zoom pane draws into + */ + void SetRect( TRect aRect ); + + /** + * Handles zoom-key operation, passed in from the container. + * @since 2.8 + * @param aKeyEvent The key event + * @param aType the key type + * @return Whether this key event was consumed or not + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + + /** + * Returns the zoom pane rect + * @since 3.0 + * @return the zoom pane rect + */ + TRect Rect() const; + + /** + * Called when the parent gains or loses foreground + * @param aForeground ETrue if gained foreground, else EFalse + * @since 3.0 + */ + void HandleForegroundEvent( TBool aForeground ); + + /** + * Sets the number of zoom steps for each type of zoom to be + * reflected in the zoom pane shaft + * @param aOptSteps The number of optical zoom steps + * @param aStdSteps The number of digital zoom steps + * @param aExtSteps The number of extended digital zoom steps + * @since 3.0 + */ + void SetZoomSteps( TInt aOptSteps, TInt aStdSteps, TInt aExtSteps ); + + /** + * Returns whether there is currently an ongoing zoom operation. + * @since 3.0 + * @return ETrue if zooming, else EFalse + */ + TBool IsCurrentlyZooming() const; + + /** + * Indicates that the zoom level should be reset to default + * when the engine is next prepared + * @since 2.8 + * @param aReset ETrue if the zoom pane should be reset, else EFalse + */ + void ResetToDefaultAfterPrepare( TBool aReset ); + + /** + * Indicates whether or not the zoom level is waiting to be reset to default + * @since 3.0 + * @return TBool ETrue if a reset is pending, othewise EFalse + */ + TBool IsResetPending() const; + + /** + * Sets a point position to be based on another point plus an optional offset. + * Used for moving along the slider. Whether the X or Y part of the point + * changes is dependent on the current orientation + * @since 3.0 + * @param aPoint This point will be overwritten with the new X/Y values + * @param aOffset This is the basis for the new value for 'aPoint' + * @param aAddditional This is an additional modification to 'aOffset' value + */ + void SetPoint( TPoint& aPoint, const TPoint& aOffset, TInt aAdditional = 0) const; + + /** + * Returns whether the current zoom value is the minimum zoom + * @since 3.1 + * @return Whether the current zoom value is the minimum zoom + */ + TBool IsZoomAtMinimum() const; + + /** + * Stops all zooming activity + */ + void StopZoom(); + + /*** + * Resets the zoom (digital, and, if available, optical) to 1x + * @since 3.0 + */ + void ResetZoomTo1x(); + + /*** + * Handle pointer events + * @since S60 v5.0 + * @param TPointerEvent, pointer event + * @return TBool, ETrue if the pointer event was used + */ + TBool HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /*** + * Handle pointer events + * @since S60 v5.0 + * @param TInt, Pointer's Y-position + * @return TBool, ETrue if the pointer event was used + */ + TBool StartTouchZoomL( TInt aPointer ); + + + + public: // Functions from base classes + protected: // New functions + protected: // Functions from CCoeControl + + /** + * Handles events from the controller + * @since 2.8 + * @param aEvent The controller event that has occurred + * @param aError An associated error code + */ + void HandleControllerEventL( TCamControllerEvent aEvent, TInt aError ); + + protected: // Functions from base classes + private: + + /** + * C++ default constructor. + * since 2.8 + * @param aRect parent rect + * @param aController handle to camera application controller + * @param aOverlayViewFinder whether zoom pane is drawn over view finder + */ + CCamZoomPane( CCamAppController& aController, + TBool aOverlayViewFinder ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Reads layout information from a resource + * @since 2.8 + */ + void ReadLayoutL(); + + /** + * Updates Layout and size of control + * @since S60 5.0 + */ + void SizeChanged(); + + /** + * Draws the thumb on the zoom pane + * @since 3.0 + * @param aGc The graphics context to draw to + */ + void DrawThumb( CBitmapContext& aGc ) const; + + /** + * Draws the shaft of the zoom pane + * @since 3.0 + * @param aGc The graphics context to draw to + */ + void DrawShaft( CBitmapContext& aGc ) const; + + /** + * Draws the plus/minus icons for the zoom pane + * @since 3.0 + * @param aGc The graphics context to draw to + */ + void DrawPlusMinus( CBitmapContext& aGc ) const; + + /** + * Returns the current Zoom Pane orientation based on stored + * settings and whether the current camera supports horizontal zoom bar + * @since 3.0 + * @return The orientation (veritcal or horizontal) + */ + TZPOrientation PaneOrientation() const; + + /** + * Read nontouch layout + */ + void TouchLayout(); + + /** + * Read touch layout + */ + void NonTouchLayout(); + + /* + * Reads zoom keys from the appropriate array + */ + void ReadZoomKeys( const RArray& aSource, + RArray& aTarget ); + /* + * Checks for the zoom key with the mapped key's scan code + */ + TBool CheckForZoomKey( const TKeyEvent& aKeyEvent, + const RArray& aKeys ); + + /** + * Touchfeedback + * @since S60 v5.0 + */ + void Touchfeedback(); + + public: // Data + + protected: // Data + + private: // Data + + // The bitmaps for the graphical components. + CFbsBitmap* iIconZoomTop[2]; + CFbsBitmap* iIconZoomMiddle[2]; + CFbsBitmap* iIconZoomBottom[2]; + CFbsBitmap* iIconZoomMarker[2]; + CFbsBitmap* iIconZoomMarkerGray[2]; + CFbsBitmap* iIconZoomMin[2]; + CFbsBitmap* iIconZoomMax[2]; + CFbsBitmap* iIconZoomMarkerCurrent; + + TRect iZoomPaneRect; + TRect iSliderParentRect; + TPoint iPlusPoint; + TPoint iMinusPoint; + TPoint iTopPoint; + TPoint iMiddlePoint; + TPoint iBottomPoint; + + //Holds the maximum 'travel' of the thumb along the slider + TInt iMaxOffset; + + // Minimum supported zoom level + TInt iMinZoom; + + // Maximum supported zoom level + TInt iMaxZoom; + + // Actual zoom level + TInt iCurZoom; + + // Targeted zoom level to be indicated by the thumb + TInt iTrgZoom; + + // Previous pointer Y-position + TInt iPointerPrevi; + + // Whether we are currently recording video or not. + TBool iRecordingVideo; + + // Reference to the Controller + CCamAppController& iController; + + // Represents a bitmask of TCamVideoZoom for video zoom features + TInt iZoomSupport; + + // Determine from PSI if zoom pane are overlaid on VF + TBool iOverlayViewFinder; + + // is the zoom pane visible + TBool iVisible; + + // Determine whether or not touch is active + TBool iTouchActive; + + // The current engine state, updated if it changes + TCamCameraState iCameraState; + + // The zoom model, owned by this control + CCamZoomModel* iModel; + + // The number of key repeats received in a row. + TInt iRepeatCounter; + + // The optical, digital and extended zoom steps to be shown on the zoom bar + TInt iOptSteps; + TInt iStdSteps; + TInt iExtSteps; + + // Stores the look and feel info of the zoom bar + TCamZoomLAF iZoomLAF; + + // Stores the orientation of the zoom pane (vertical or horizontal) + // as read from the Central Repository + TZPOrientation iOrientation; + + // Whether or not product uses volume keys for zoom + TBool iZoomUsingVolumeKeys; + + // Whether or not product uses navi-key left and right for zoom + TBool iZoomUsingNaviKeys; + + // Performs zoom frame/thumb bitmap rotation when needed + CCamBmpRotatorAo* iRotatorAo; + + // Timer used to remove zoom pane after a short delay + CCamTimer* iZoomTimer; + MTouchFeedback* iFeedback; // Not own + + // observer to receive volume key presses + CCamRemConObserver* iVolumeKeyObserver; + + RArray iZoomInKeys; + RArray iZoomOutKeys; + }; + +#endif // CAMZOOMPANE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CamZoomUpdateManager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CamZoomUpdateManager.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 CCAMZOOMUPDATEMANAGER_H +#define CCAMZOOMUPDATEMANAGER_H + +// INCLUDES +#include +#include "CamAppController.h" // for controller definition + +// FORWARD DECLARATIONS + +//CLASS DECLARATIONS + +/** +* Camera Zoom Update Class +* +* Implements a cooldown period to avoid overtaxing the camera driver with touchscreen zoom updates. +* +* @since 5.0 +*/ +class CCamZoomUpdateManager : public CActive + { + public: // constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamZoomUpdateManager* NewL( CCamAppController& aController ); + + /** + * Destructor. + */ + ~CCamZoomUpdateManager(); + + /** + * From CActive Does the required action (calls the observer) + */ + void SetZoomValue( TInt aValue ); + + protected: // from base classes + + /** + * From CActive Does the required action (calls the observer) + */ + void RunL(); + + /** + * From CActive Cancels pending actions + */ + void DoCancel(); + + private: // constructor + + /** + * C++ default constructor. + */ + CCamZoomUpdateManager( CCamAppController& aController ); + + /** + * Symbian 2nd phase constructor + */ + void ConstructL(); + + /** + * Notify the controller and SetActive + */ + void UpdateAndStartWait(); + + /** + * Get delay values from cenrep + */ + void ReadDelayValuesL(); + + private: // data + + // timer used to facilitate cooldown period + RTimer iTimer; + + // time used to force update if active object gets starved + TTime iCooldownStart; + + // the value to give to the controller + TInt iValue; + + // handle outstanding update requests + TBool iDelayedUpdate; + + // reference to the controller used for setting the zoom + CCamAppController& iController; + + // Variated values for cooldown period inbetween + // camera driver updates + TInt iCamZoomCooldown; + TInt iCamMaxZoomCooldown; + + }; + +#endif + +// End of File + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/Camdefaultnamesettingpage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/Camdefaultnamesettingpage.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for name base type (date/text)* +*/ + + + + +#ifndef CAMDEFAULTNAMESETTINGPAGE_H +#define CAMDEFAULTNAMESETTINGPAGE_H + +// INCLUDES +#include +#include "CamAppController.h" + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Setting page for name base type (date/text) +* @since 2.8 +*/ +class CCamDefaultNameSettingPage : public CAknPopupSettingPage + { + public: // Constructors and destructor + /** + * C++ constructor. + * Parameters are passed directly to CAknPopupSettingPage. + * See CAknPopupSettingPage constructor for parameter details. + * @since 2.8 + * @param aNameBase current name base (in/out) + * @param aMode current mode (video or still image) + * @param aSettingTitleText title to display in page + * @param aSettingNumber the setting number + * @param aControlType the type of control + * @param aEditorResourceId the id of the editor resource + * @param aSettingPageResourceId the id of the page resource + * @param aQueryValue reference to the query value + */ + CCamDefaultNameSettingPage( + TDes& aNameBase, + TCamCameraMode aMode, + const TDesC* aSettingTitleText, + TInt aSettingNumber, + TInt aControlType, + TInt aEditorResourceId, + TInt aSettingPageResourceId, + MAknQueryValue& aQueryValue ); + + /** + * Destructor + * @since 2.8 + */ + virtual ~CCamDefaultNameSettingPage(); + + protected: // Functions from base classes + /* + * From CAknSettingPage. + * @since 2.8 + * Check if the name base value is ok, so the user can + * exit the setting page. + * + * @param aAccept ETrue if the user has indicated to accept the + * setting page; EFalse otherwise + * @return TBool a value indicating whether the setting page + * should be dismissed + */ + TBool OkToExitL( TBool aAccept ); + + private: // New methods + + /* + * Display the editor dialog + * @since 3.0 + * + * @return TBool a value indicating whether the setting page + * should be dismissed + */ + TBool ShowEditorDialogL(); + + private: // Data + // Reference to the cuurent name base. + TDes& iNameBase; + // Used to store new name base so that it can be validated + // before overwriting old value. + TBuf iTempNameBase; + // The current mode of capture. + TCamCameraMode iMode; + }; + +#endif // CAMDEFAULTNAMESETTINGPAGE_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CameraVariant.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CameraVariant.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The file contains bitmask values for shared data keys specifying* +*/ + + +#ifndef CAMERAVARIANT_HRH +#define CAMERAVARIANT_HRH + +// DATA TYPES + +/* +* If this flag is set then the video sharing resolution will be set to SubQCIF. +* If this flag is clear then the sharing resolution will be set to QCIF - +* this is the default setting and is read from the resource file. +*/ +#define KCamCrQualityVideoSharingIsSubQCIF 0x01 + +/* +* If this flag is set then the application will go to the background when +* exited but will remove the application icon from the task switcher and +* will reset all settings to default values to simulate a true exit +*/ +#define KCamCrAppAlwaysRunningIsOn 0x01 + +/* +* If this flag is set the application will use time lapse functionality +* otherwise only burst mode functionality will be available +*/ +#define KCamCrTimeLapseIsSupported 0x01 + +/* +* If this flag is set the application the courtesy UI will always be displayed, +* i.e. "show icons" is on. Else the UI will only be shown for 5 seconds. +*/ +#define KCamCrAlwaysDrawCourtesyUiIsOn 0x01 + +#endif +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CameraappDummyCallbackActive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CameraappDummyCallbackActive.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dummy callback active object class for Cameraapp Unit Tests* +*/ + + + + +#ifndef CAMERAAPPDUMMYCALLBACKACTIVE_H +#define CAMERAAPPDUMMYCALLBACKACTIVE_H + +// INCLUDES +#include +// CONSTANTS + +// MACROS +//#define ?macro ?macro_def + +// DATA TYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION +class CCameraappTestBitmapManager; +class MCamAppEngineObserver; +class MCaeStillBurstObserver; + +/** +* Handle intercommunication between camcorder UI and engine. +* +* @since 2.8 +*/ +class CCameraappDummyCallbackActive : public CActive + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCameraappDummyCallbackActive* NewL( MCamAppEngineObserver& aController ); + + /** + * Destructor. + */ + virtual ~CCameraappDummyCallbackActive(); + + public: // Functions from CActive + + void Cancel(); + + public: + + void SetBurstObserver( MCaeStillBurstObserver* aBurstObserver ); + + /** + * Prepare CCamAppControllerBase and CamAppEngine for current mode + */ + void InitComplete(); + + /** + * Prepare for Still capture + */ + void StillPrepareComplete(); + + /** + * Prepare for video capture + */ + void VideoPrepareComplete(); + + /** + * Initiate Still Image Capture + */ + void SendViewFinderFrames(); + + void StopViewFinderFrames(); + + void CaptureStill(); + + void CaptureBurst( TInt aImageCount ); + + void StopBurst(); + + void VideoRecordingStopped(); + + void VideoRecordingPaused(); + + void VideoRecordingResumed(); + + private: + + CCameraappDummyCallbackActive( MCamAppEngineObserver& aController ); + + void ConstructL( ); + + void SetActiveAndCompleteRequest(); + + void DoInitComplete(); + + void DoStillPrepareComplete(); + + void DoVideoPrepareComplete(); + + void DoViewFinderFrame(); + + void DoCaptureStillL(); + + void DoCaptureBurstL(); + + void DoVideoPaused(); + + void DoVideoResumed(); + + void DoVideoStopped(); + + /** + * Cancels the active object + */ + void DoCancel(); + + void RunL(); + + private: + MCamAppEngineObserver& iController; + MCaeStillBurstObserver* iBurstObserver; + CCameraappTestBitmapManager* iBitmapManager; + TBool iInitComplete; + TBool iStillPrepareComplete; + TBool iVideoPrepareComplete; + TBool iViewFinderFrame; + TBool iCaptureStill; + TBool iCaptureBurst; + TBool iVideoPaused; + TBool iVideoResumed; + TBool iVideoStopped; + TInt iBurstCount; + TBool iInitFail; + TBool iStopBurst; + TInt iBurstCaptureImage; + TInt iBurstSnapImage; + TInt iCompletedBurst; + }; + +#endif // CAMERAAPPDUMMYCALLBACKACTIVE_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CameraappDummyEngine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CameraappDummyEngine.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,991 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dummy Camera Application Engine* +*/ + + + +#ifndef CAMERAAPPDUMMYENGINE_H +#define CAMERAAPPDUMMYENGINE_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CCameraappDummyCallbackActive; + +// CLASS DECLARATION + +/** +* Dummy Camera Application Engine interface +* +*/ +class CCameraappDummyEngine : public CCaeEngine + { + public: // Creation + + /** + * A static (factory) function to create the class instance. + * @since 2.1 + * @return Pointer to a fully constructed CCaeEngine object. + * Ownership is passed to the caller. + */ + static CCaeEngine* NewL(); + }; + + +class CCameraappDummyEngineImp : public CCameraappDummyEngine + { + public: // Creation + static CCameraappDummyEngineImp* NewL(); + + /** + * Sets the Camera Application Engine observer. + * @since 2.1 + * @param aObserver Reference to Camera Application Engine observer. + * @return void + */ + void SetCamAppEngineObserver( + MCamAppEngineObserver& aObserver ); + + ~CCameraappDummyEngineImp(); + + public: // General methods + + /** + * Gets information about the supported Camera Application Engine and + * Camera features. + * @since 2.1 + * @param aInfo Info about supported features. + * @return void + */ + void GetInfo( TCamAppEngineInfo& /*aInfo*/ ) const; + + /** + * Initializes Camera Application Engine for still image capturing. + * Reserves the camera and switches the camera power on. + * Intialization must be done before all other operations, except + * SetCamAppEngineObserver and GetInfo. + * Calls observer method McaeoInitComplete(). + * @since 2.1 + * @param aCreateSnapImage Boolean indicating if "snap-images" + * should be created, leading to calls of McaeoSnapImageReady. + * @return void + */ + void InitL( TBool aCreateSnapImage = ETrue ); + + /** + * Initialize the engine for still image capturing. + * Switches also camera power on. + * Intialization must be done before all other operations, except + * SetCamAppEngineObserver and GetInfo. + * Calls observer method McaeoInitComplete(). + * @since 2.1 + * @param aSdUidStillQltyLevels Still capturing quality levels Shared Data initialization file UID. + * @param aCreateSnapImage Boolean indicating if "snap-images" should be created + * leading to calls of McaeoSnapImageReady. + * @return void + */ + void InitL( TUid /*aSdUidStillQltyLevels*/, + TBool /*aCreateSnapImage = ETrue*/ ){}; + + /** + * Initializes video recording. + * The initialization must be done before video recording operations. + * @since 2.1 + * @return void + */ + void InitVideoRecorderL(){}; + + /** + * Initializes video recording. + * The initialization must be done before video recording operations. + * @since 2.1 + * @param aSdUidVideoQltyLevels Video recording quality levels Shared Data initialization file UID. + * @return void + */ + void InitVideoRecorderL( TUid /*aSdUidVideoQltyLevels*/ ){}; + + /** + * Reserves the camera into use and switches the camera power on. + * Calls observer method McaeoInitComplete(). + * @since 2.1 + * @return void + */ + void Reserve(); + + /** + * Switches the camera power off and releases the camera. + * @since 2.1 + * @return void + */ + void Release(){}; + + /** + * Switches the camera power on. + * Calls observer method McaeoInitComplete(). + * @since 2.1 + * @return void + */ + void PowerOn(){}; + + /** + * Switches the camera power off. + * @since 2.1 + * @return void + */ + void PowerOff(){}; + + public: // Camera settings + + /** + * Sets the zoom mode. + * @since 2.1 + * @param aZoomMode Zoom mode to set. + * @return void + */ + void SetZoomModeL( TZoomMode /*aZoomMode = EZoomModeDigital*/ ); + + /** + * Gets the current zoom mode. + * @since 2.1 + * @return The current zoom mode. + */ + TZoomMode ZoomMode() const{ return EZoomModeDigital; }; + + /** + * Sets the zoom value. + * @since 2.1 + * @param aZoomValue Index of the zoom factor to set. + * @return void + */ + void SetZoomValueL( TInt /*aZoomValue = 0*/ ); + + /** + * Gets the current zoom value. + * @since 2.1 + * @return Index of the current zoom factor. + */ + TInt ZoomValue() const; + + /** + * Sets the brightness. + * @since 2.1 + * @param aBrightness Brightness value in the range ECam.h SetBrightnessL allows. + * @return void + */ + void SetBrightnessL( TInt /*aBrightness = 0*/ ){}; + + /** + * Gets the current brightness setting. + * @since 2.1 + * @return Brightness value. + */ + TInt Brightness() const{ return 0; }; + + /** + * Sets the contrast. + * @since 2.1 + * @param aContrast Contrast value in the range ECam.h SetContrastL allows. + * @return void + */ + void SetContrastL( TInt/* aContrast= 0*/ ){}; + + /** + * Gets the current contrast setting. + * @since 2.1 + * @return Contrast value. + */ + TInt Contrast() const{ return 0; }; + + /** + * Sets the exposure mode. + * @since 2.1 + * @param aExposureMode Exposure mode in the range ECam.h SetExposureL allows. + * @return void + */ + void SetExposureModeL( + CCamera::TExposure /*aExposureMode = CCamera::EExposureAuto*/ ){}; + + /** + * Gets the current exposure mode. + * @since 2.1 + * @return Exposure mode. + */ + CCamera::TExposure ExposureMode() const{ return CCamera::EExposureAuto; }; + + /** + * Sets the white balance mode. + * @since 2.1 + * @param aWhiteBalanceMode White balance mode in the range ECam.h SetWhiteBalanceL allows. + * @return void + */ + void SetWhiteBalanceModeL( + CCamera::TWhiteBalance /*aWhiteBalanceMode = CCamera::EWBAuto*/ ){}; + + /** + * Gets the current white balance mode. + * @since 2.1 + * @return White balance mode. + */ + CCamera::TWhiteBalance WhiteBalanceMode() const{ return CCamera::EWBAuto; }; + + /** + * Sets the flash mode. + * @since 2.1 + * @param aFlashMode Flash mode in the range ECam.h SetFlashL allows. + * @return void + */ + void SetFlashModeL( + CCamera::TFlash /*aFlashMode = CCamera::EFlashNone*/ ){}; + + /** + * Gets the current flash mode. + * @since 2.1 + * @return Flash mode. + */ + CCamera::TFlash FlashMode() const{ return CCamera::EFlashNone; }; + + /** + * Resets to the default setting values. + * Resets the following settings: exposure mode, white balance mode, + * zoom mode, zoom value, flash mode, brightness, and contrast. + * @since 2.1 + * @return void + */ + void ResetToDefaultsL(){}; + + public: // View finder + + /** + * Sets/resets view finder image mirroring. + * @since 2.1 + * @param aMirror Boolean indicating whether view finder image should be mirrored or not. + * @return void + */ + void SetViewFinderMirrorL( TBool /*aMirror = EFalse*/ ){}; + + /** + * Queries if view finder image mirroring is on. + * @since 2.1 + * @return Boolean indicating whether view finder image is currently mirrored or not. + */ + TBool ViewFinderMirror() const{ return EFalse; }; + + /** + * Starts the bitmap-based view finder. + * The engine starts to call observer method McaeoViewFinderFrameReady() repeatedly. + * @since 2.1 + * @param aSize Desired view finder size. + * @return void + */ + void StartViewFinderBitmapsL( TSize& aSize ); + + /** + * Starts the bitmap-based view finder. + * The engine starts to call observer method McaeoViewFinderFrameReady() repeatedly. + * @since 2.1 + * @param aSize Desired view finder size. + * @param aCropRect Desired cropping/clipping rectangle. + * @return void + */ + void StartViewFinderBitmapsL( + TSize& /*aSize*/, + TRect& /*aCropRect*/ ){}; + + /** + * Starts the direct screen access view finder. + * @since 2.1 + * @param aWs Window server session. + * @param aScreenDevice Software device screen. + * @param aWindow Client-side handle to a server-side window. + * @param aScreenRect Portion of screen in screen co-ordinates. + * @return void + */ + void StartViewFinderDirectL( + RWsSession& /*aWs*/, + CWsScreenDevice& /*aScreenDevice*/, + RWindowBase& /*aWindow*/, + TRect& /*aScreenRect*/ ){}; + + /** + * Starts the direct screen access view finder. + * @since 2.1 + * @param aWs Window server session. + * @param aScreenDevice Software device screen. + * @param aWindow Client-side handle to a server-side window. + * @param aScreenRect Portion of screen in screen co-ordinates. + * @param aCropRect Desired cropping/clipping rectangle. + * @return void + */ + void StartViewFinderDirectL( + RWsSession& /*aWs*/, + CWsScreenDevice& /*aScreenDevice*/, + RWindowBase& /*aWindow*/, + TRect& /*aScreenRect*/, + TRect& /*aCropRect*/ ){}; + + /** + * Stops the view finder. + * @since 2.1 + * @return void + */ + void StopViewFinder(); + + /** + * Queries if view finder is running. + * @since 2.1 + * @return Boolean indicating whether view finder is running or not. + */ + TBool IsViewFinding() const; + + /** + * Gets the current view finder size. + * @since 2.1 + * @param aSize View finder size. + * @return void + */ + void GetViewFinderSize( TSize& /*aSize*/ ){}; + + public: // Still image capturing + + /** + * Prepares Camera Application Engine for still image capture on + * specified quality level. + * Calls observer method McaeoStillPrepareComplete(). + * @since 2.1 + * @param aStillQualityIndex Still image quality level index. + * Imaging parameters linked to quality levels are defined by Shared Data ini-file. + * @return void + */ + void PrepareStillCaptureL( TInt /*aStillQualityIndex*/ ){}; + + /** + * Prepares Camera Application Engine for still image capture on + * specified quality level. + * Calls observer method McaeoStillPrepareComplete(). + * @since 2.1 + * @param aStillQualityIndex Still image quality level index. + * Can have values 0 ... TCamAppEngineInfo::iNumStillQualityLevelsSupported - 1 + * @param aCropRect Desired cropping/clipping rectangle. + * @return void + */ + void PrepareStillCaptureL( + TInt /*aStillQualityIndex*/, + const TRect& /*aCropRect*/ ){}; + + /** + * Prepares Camera Application Engine for still image capture with + * specified image size and format. + * Calls observer method McaeoStillPrepareComplete(). + * @since 2.1 + * @param aSize Still image size. + * @param aFormat Still image format. + * @param aCompressionQuality Still image compression quality [0...100]. + * @return void + */ + void PrepareStillCaptureL( + const TSize& /*aSize*/, + CCamera::TFormat /*aFormat*/, + TInt /*aCompressionQuality*/ ){}; + + /** + * Prepares Camera Application Engine for still image capture with specified image size and format. + * Calls observer method McaeoStillPrepareComplete(). + * @since 2.1 + * @param aSize Still image size. + * @param aFormat Still image format. + * @param aCompressionQuality Still image compression quality [0...100]. + * @param aCropRect Desired cropping/clipping rectangle. + * @return void + */ + void PrepareStillCaptureL( + const TSize& /*aSize*/, + CCamera::TFormat /*aFormat*/, + TInt /*aCompressionQuality*/, + const TRect& /*aCropRect*/ ){}; + + /** + * Gets the current prepared still quality level index. + * @since 2.1 + * @return Still quality level index. + */ + TInt StillQualityIndex() const{ return 0; }; + + /** + * Gets the still image frame size for the specified quality level. + * @since 2.1 + * @return void + */ + void GetStillFrameSize( + TInt /*aStillQualityIndex*/, + TSize& /*aSize*/ ) const{}; + + /** + * Gets the estimated still image size in bytes for the + * specified quality level. + * @since 2.1 + * @return Estimated still capturing image size in bytes. + */ + TInt EstimatedStillSizeInBytes( + TInt /*aStillQualityIndex*/ ) const{ return 0; }; + + /** + * Captures a still image or a still image burst. + * Calls first observer method McaeoSnapImageReady() and then + * McaeoStillImageReady(). + * McaeoSnapImageReady() is not called if engine initialization + * has been done + * with parameter aCreateSnapImage == EFalse. + * @since 2.1 + * @return void + */ + void CaptureStill(); + + /** + * Cancels the on-going still image (single/burst) capture request. + * @since 2.1 + * @return void + */ + void CancelCaptureStill(){}; + + /** + * Sets the size of the snap image bitmap. + * @since 3.0 + * @param aSize The size of the snap bitmap. Corrected size is returned. + * @return void + */ + void SetSnapImageSizeL( + TSize& ){}; + /** + * Sets the color mode of the snap image bitmap + * @since 3.0 + * @param aMode The color mode of the snap bitmap. + * @return void + */ + void SetSnapImageColorMode( + TDisplayMode ){}; + + public: // Video recording + + /** + * Sets the file name for the video clip to be recorded. + * @since 2.1 + * @param aVideoClipFileName File name. + * @return void + */ + void SetVideoRecordingFileNameL( + const TDesC& aVideoClipFileName ); + + /** + * Prepares Camera Application Engine for video recording on + * specified quality level. + * Calls observer method McaeoVideoPrepareComplete(). + * @since 2.1 + * Can have values 0 ... TCamAppEngineInfo::iNumVideoQualityLevelsSupported - 1 + * @return void + */ + void PrepareVideoRecordingL( TInt /*aVideoQualityIndex*/ ){}; + + /** + * Prepares Camera Application Engine for video recording with + * specified recording parameters. + * Calls observer method McaeoVideoPrepareComplete(). + * @since 2.1 + * @return void + */ + void PrepareVideoRecordingL( + const TSize& /*aFrameSize*/, + TReal32 /*aFrameRate*/, + TInt /*aBitRate*/, + TBool /*aAudioEnabled*/, + const TDesC8& /*aMimeType*/, + const TDesC& /*aPreferredSupplier*/, + const TDesC8& /*aVideoType = KNullDesC8*/, + const TDesC8& /*aAudioType = KNullDesC8*/ ){}; + + /** + * Closes (prepared) video recording to free resources. + * @since 2.1 + * @return void + */ + void CloseVideoRecording(){}; + + /** + * Gets the current prepared video quality level index. + * @since 2.1 + * @return Video quality level index. + */ + TInt VideoQualityIndex() const{ return 0; }; + + /** + * Gets the video frame size for the specified video quality level. + * @since 2.1 + * @return Video frame size. + */ + void GetVideoFrameSize( + TInt /*aVideoQualityIndex*/, + TSize& /*aSize*/ ) const{}; + + /** + * Gets the video frame rate for the specified video quality level. + * @since 2.1 + * @return Video frame rate. + */ + TReal32 VideoFrameRate( TInt /*aVideoQualityIndex*/ ) const{ return 0; }; + + /** + * Gets the estimated video recording bit rate including audio bit rate + * for the specified video quality level. + * @since 2.1 + * @return Video recording bit rate rate including audio bit rate. + */ + TInt EstimatedVideoRecordingBitRateL( + TInt /*aVideoQualityIndex*/ ) const{ return 0; }; + + /** + * Sets the maximum size in bytes for a video clip. + * @since 2.1 + * If set to 0, then no limit but the available storage space. + * @return void + */ + void SetVideoClipMaxSizeL( TInt /*aMaxClipSizeInBytes = 0*/ ){}; + + /** + * Gets the current maximum size in bytes for a video clip. + * @since 2.1 + * @return Video clip maximum size. + */ + TInt VideoClipMaxSize() const{ return 0; }; + + /** + * Sets audio enabled or disabled for video recording. + * @since 2.1 + * @return void + */ + void SetVideoAudioL( TBool /*aAudioEnabled*/ ){}; + + /** + * Queries if audio is enabled or disabled for video recording. + * @since 2.1 + * @return Boolean indicating whether audio is enabled or disabled for video recording. + */ + TBool VideoAudio() const{ return EFalse; }; + + /** + * Sets the time interval for video recording time info. + * @since 2.1 + * @return void + */ + void SetVideoTimesIntervalL( + TTimeIntervalMicroSeconds /*aInterval*/ ){}; + + /** + * Gets the current time interval for video recording time info. + * @since 2.1 + * @return Time interval in microseconds for video recording time info. + */ + TTimeIntervalMicroSeconds VideoTimesInterval() const{ return TTimeIntervalMicroSeconds( 0 ); }; + + /** + * Starts video recording. + * Calls observer method McaeoVideoRecordingOn(). + * @since 2.1 + * @return void + */ + void StartVideoRecording(); + + /** + * Stops video recording. + * Calls observer method McaeoVideoRecordingComplete(). + * @since 2.1 + * @return void + */ + void StopVideoRecording(); + + /** + * Pauses video recording. + * Calls observer method McaeoVideoRecordingPaused(). + * @since 2.1 + * @return void + */ + void PauseVideoRecording(); + + /** + * Resumes video recording after pause. + * Calls observer method McaeoVideoRecordingOn(). + * @since 2.1 + * @return void + */ + void ResumeVideoRecording(); + + /** + * Gets the remaining video recording time before recording has started. + * @since 2.1 + * @return Remaining video recording time. + */ + TTimeIntervalMicroSeconds RemainingVideoRecordingTime() + const{ return TTimeIntervalMicroSeconds( 99999999 ); }; + + /** + * Queries if video recording is running. + * @since 2.1 + * @return Boolean indicating whether video recording is running or not. + */ + TBool IsVideoRecording() const{ return EFalse; }; + + public: // New overloading method for preparing video recording + + /** + * Prepares Camera Application Engine for video recording with specified recording parameters. + * Calls observer method McaeoVideoPrepareComplete(). + * @since 2.1 + * @return void + */ + void PrepareVideoRecordingL( + const TSize& /*aFrameSize*/, + TReal32 /*aFrameRate*/, + TInt /*aBitRate*/, + TBool /*aAudioEnabled*/, + TInt /*aAudioBitRate*/, + const TDesC8& /*aMimeType*/, + const TDesC& /*aPreferredSupplier*/, + const TDesC8& /*aVideoType*/, + const TDesC8& /*aAudioType*/ ); + + public: // Still image burst capturing + + /** + * Sets the Camera Application Engine still image burst capturing + * observer. + * @since 2.1 + * @param aObserver Camera Application Engine still burst observer. + * @return void + */ + void SetCaeStillBurstObserver( MCaeStillBurstObserver& aObserver ); + + /** + * Sets the image count for still image (burst) capturing. + * Note: Inputting value 1 switches back to normal still capturing. + * @since 2.1 + * @param aImageCount The desired count of images to capture (in a burst). + * @return The count of images to be captured (in a burst). + */ + TInt SetStillCaptureImageCountL( TInt aImageCount ); + + /** + * Gets the image count for still image (burst) capturing. + * @since 2.1 + * @return Count of images to capture (in a burst). + */ + TInt StillCaptureImageCount() const{ return 0; }; + + /** + * Sets the time interval between single captures in still burst. + * @since 2.1 + * @return void + */ + void SetStillBurstCaptureIntervalL( + TTimeIntervalMicroSeconds /*aInterval*/ ){}; + + /** + * Gets the time interval between single captures in still burst. + * @since 2.1 + * @return Time interval in microseconds. + */ + TTimeIntervalMicroSeconds StillBurstCaptureInterval() const{ return TTimeIntervalMicroSeconds( 0 ); }; + + /** + * Stops still image burst capturing. + * Delivers the burst images captured before call. + * This is different from CancelCaptureStill that cancels the operation and + * prevents delivering the captured image. + * @since 2.1 + * @return void + */ + void StopStillBurstCapture(); + + public: + + /** + * Prepare Camera Application Engine for still image capture on + * specified quality level with desired snap image size. + * The returned snap image size is always equal or bigger in both + * dimensions than the given size. The returned size is stepwise + * downscaled from the captured image size. The parameter aSnapSize + * is ignored if the image format does not support it in the engine. + * Calls observer method McaeoStillPrepareComplete(). + * @since 2.1 + * @return void + */ + void PrepareStillCaptureL( + TInt /*aStillQualityIndex*/, + TSize& /*aSnapSize*/ ){}; + + /** + * Prepare Camera Application Engine for still image capture with + * specified image size, format, and desired snap image size. + * The returned snap image size is always equal or bigger in both + * dimensions than the given size. The returned size is stepwise + * downscaled from the captured image size. The parameter aSnapSize + * is ignored if the image format does not support it in the engine. + * Calls observer method McaeoStillPrepareComplete(). + * @since 2.1 + * @param aSize Still image size. + * @param aFormat Still image format. + * @param aCompressionQuality Still image compression quality [0...100]. + * @param aCropRect Desired cropping/clipping rectangle. The size (0,0) means that this parameter is ignored. + * @param aSnapSize Desired snap image size. Returns the real snap image size. + * @return void + */ + void PrepareStillCaptureL( + const TSize& aSize, + CCamera::TFormat aFormat, + TInt aCompressionQuality, + const TRect& aCropRect, + TSize& aSnapSize ); + + /** + * Sets the exposure value (EV) compensation index. + * @since 2.1 + * @return void + */ + void SetEvCompensationL( TInt /*aEvIndex = 0*/ ){}; + + /** + * Gets the current exposure value (EV) compensation index. + * @since 2.1 + * @return Exposure value compensation index. + */ + TInt EvCompensation() const{ return 0; }; + + /** + * Sets snap image creation on/off. + * @since 2.1 + * @return void + */ + void SetSnapImageCreation( + TBool /*aCreateSnapImage = ETrue*/ ){}; + + /** + * A static (factory) function to create the class instance. + * @since 2.6 + * @return Pointer to a fully constructed CCaeEngine object. + * Ownership is passed to the caller. + */ + IMPORT_C static CCaeEngine* NewL( + TInt /*aCameraIndex*/ ); + + /** + * Gets the number of cameras on the device. + * @since 2.6 + * @return Count of cameras present on the device. + */ + IMPORT_C static TInt CamerasAvailable(); + + /** + * Enumerates through the available image capture sizes. + * Returns the image size based on the specified size index and format. + * The largest image resolution is returned for index 0, the smallest + * for index TCamAppEngineInfo::iNumImageSizesSupported-1. + * The size index must be in the range 0 to + * TCamAppEngineInfo::iNumImageSizesSupported-1 inclusive. + * @since 2.6 + * @return void + */ + void EnumerateStillCaptureSizes( + TSize& /*aSize*/, + TInt /*aSizeIndex*/, + CCamera::TFormat /*aFormat*/ ) const{}; + + /** + * Sets the quality value to use with JPEG and Exif image formats. + * @since 2.6 + * @return void + */ + void SetJpegQuality( + TInt /*aQuality*/ ){}; + + /** + * Gets the currently set JPEG quality value. + * Returns 0 if not previously prepared or set. + * @since 2.6 + * @return The currently set JPEG quality value. + */ + TInt JpegQuality() const{ return 0; }; + + public: // New method to allow extension mechanism. + TAny* CustomInterface(TUid /*aId*/) { return NULL; }; + + /** + * Gets array of features per interfaces. Each feature is ordered in + * the current calling order e.g. when certain image prosessing + * operation is applied to the captured image. If SetOrder() has not yet + * been called, the returned order is the default order. + * @since 2.8 + * @param aOrderedFeatureArray Feature array sorted by the current calling order in an interface. + * @return void + */ + void GetOrderL( RCaeOrderedFeatureList& aOrderedFeatureList ); + + /** + * Sets array of features per interfaces. Each feature should be ordered + * according to the wanted calling order e.g. to define when certain image + * prosessing operation is applied to the captured image. If this method + * leaves, the internal array has not been changed. + * @since 2.8 + * @param aOrderedFeatureArray Feature array sorted by the wanted calling order in an interface. + * @return void. + */ + void SetOrderL( const RCaeOrderedFeatureList& aOrderedFeatureList ); + + /** + * Sets the source of the snap image bitmap. + * @since 2.8 + * @param aSnapImageSource The source of the snap image bitmap. + * @return void + */ + void SetSnapImageSourceL( TSnapImageSource aSnapImageSource ); + + /** + * Sets the specific image codec implementation to be used in decoding and encoding. + * @since 3.0 + * @param aDecoderUid The UID of the specific image decoder to be used. KNullUid means the default decoder. + * @param aEncoderUid The UID of the specific image encoder to be used. KNullUid means the default encoder. + * @return void + */ + void SetImageCodecsL( TUid aDecoderUid, TUid aEncoderUid ); + + /** + * Enumerate Video Frame Size + * @since 3.2 + * @see CCaeEngine + */ + TInt EnumerateVideoFrameSizeL( const TSize& /*aSize*/ ); + + /** + * Gets the device-unique handle of camera object owned by the CCaeEngine. + * @since 3.2 + * @see CCaeEngine + */ + TInt CCameraHandle() const; + + /** + * Set CamAppEngine internal camera state to reserved and power state on. + * @since 3.2 + * @see CCaeEngine + */ + void EnableVideoRecording(); + + /** + * Set CamAppEngine internal camera state to released and power state off. + * @since 3.2 + * @see CCaeEngine + */ + void DisableVideoRecording(); + + /** + * Sets CAE to Extension processing mode. + * @since 3.2 + * @param aExtModeActive Boolean indicating if extension mode is enabled or disabled. + * @param aCreateSnapImage Boolean indicating if "snap-images" should be created by CAE. + * @return void + */ + void SetCaeExtensionModeL( TBool aExtModeActive, TBool aCreateSnapImage ); + + /** + * Process extension for view finder. + * @since 3.2 + * @param aFrame The view finder frame bitmap that is processed. + * @return void + */ + void ProcessExtViewFinderFrameReadyL( CFbsBitmap& aFrame ); + + /** + * Process extension for snap image. + * @since 3.2 + * @param aSnapImage The bitmap of snap image. Does not transfer ownership. + * @return void + */ + void ProcessExtSnapImageL( CFbsBitmap& aSnapImage ); + + /** + * Process extension for captured image. + * @since 3.2 + * @param aBitmap The captured bitmap image. Does not transfer ownership. + * @param aLastImage Set when last image of the burst is completed. + * @return void + */ + void ProcessExtCapturedImageL( CFbsBitmap& aBitmap, TBool aLastImage ); + + /** + * Process extension for captured image. + * @since 3.2 + * @param aImageData The captured image, if it is a formatted image and type of HBufC8. Ownership is transferred. + * @param aLastImage Set when last image of the burst is completed. + * @return void + */ + void ProcessExtCapturedImageL( HBufC8* aImageData, TBool aLastImage ); + + /** + * Process extension for captured image. + * @since 3.2 + * @param aImageDataDes The captured image, if it is a formatted image and type of TDesC8. Does not transfer ownership. + * @param aLastImage Set when last image of the burst is completed. + * @return void + */ + void ProcessExtCapturedImageL( TDesC8& aImageDataDes, TBool aLastImage ); + + /** + * Cancels extensions processing + * @since 3.2 + * @return void + */ + void ProcessExtCancel(); + + /** + * Get list of skipped extensions. Application may define which extensions are skipped during image processing. + * @since 3.2 + * @param aSkippedExtensions The list of skipped extensions TUid. + * @return void + */ + void SkippedExtensionListL( RCaeOrderedFeatureList& aSkippedExtensions ); + + /** + * Set list of skipped extensions. Application may define which extensions are skipped during image processing. + * The GetOrderL() returns the list of all installed extensions. + * @since 3.2 + * @param aSkippedExtensions The list of installed and skipped extensions TUid. + * @return void + */ + void SetSkippedExtensionList( RCaeOrderedFeatureList& aSkippedExtensions ); + + TInt SetAsyncVideoStopMode( TBool aAsyncVideoStopEnabled ); + + private: + CCameraappDummyEngineImp(); + void ConstructL(); + + protected: // data + MCamAppEngineObserver* iObserver; + CCameraappDummyCallbackActive* iCallBackActive; + TBool iIsViewFinding; + TInt iZoomValue; + TInt iImageCount; + TBool iVideoPrepared; + CCaeEngine::TZoomMode iZoomMode; + }; + + +#endif // CAMERAAPPDUMMYENGINE_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/CameraappTestBitmapManager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/CameraappTestBitmapManager.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dummy controller class for Cameraapp Unit Tests* +*/ + + + + +#ifndef CAMERAAPPTESTBITMAPMANAGER_H +#define CAMERAAPPTESTBITMAPMANAGER_H + +// INCLUDES +#include + +// CONSTANTS +_LIT( KTestData, "This is the test data" ); + +// MACROS +//#define ?macro ?macro_def + +// DATA TYPES + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* Handle intercommunication between camcorder UI and engine. +* +* @since 2.8 +*/ +class CCameraappTestBitmapManager : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCameraappTestBitmapManager* NewL(); + + /** + * Destructor. + */ + virtual ~CCameraappTestBitmapManager(); + + public: // New functions + + CFbsBitmap& Bitmap( TInt aBitmapIndex ) const; + CFbsBitmap& NextBitmap(); + + protected: // New functions + + private: + + /** + * C++ default constructor. + */ + CCameraappTestBitmapManager(); + + /** + * Symbian OS 2nd phase constructor. + * @since 2.1 + */ + void ConstructL(); + + void IncrementBitmapIndex(); + + public: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + protected: // Data + // ?one_line_short_description_of_data + //?data_declaration; + + private: // Data + // Test bitmaps + RPointerArray iBitmaps; + // Index into test bitmap array + TInt iBitmapIndex; + }; + +#endif // CAMERAAPPTESTBITMAPMANAGER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/audioplayer/camaudioplayercontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/audioplayer/camaudioplayercontroller.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Audio Player Controller +* +*/ + + +#ifndef CAM_AUDIOPLAYERCONTROLLER_H +#define CAM_AUDIOPLAYERCONTROLLER_H + +// =========================================================================== +// Includes +#include +#include "CamControllerObservers.h" +#include "mcamsettingsmodelobserver.h" + +// =========================================================================== +// Forward declarations +class CAknKeySoundSystem; +class CCamAppController; +class MCamAudioPlayerObserver; +class CCamPlayerWrapperBase; +class CCamTonePlayerWrapper; + +// =========================================================================== +// Class definitions + +/** +* Audio Player Controller class +* +* Controls tone and audio players and caches needed +* players based on Camera capture mode to enable +* fast playing of needed sounds/tones. +* +*/ +class CCamAudioPlayerController : public CBase, + public MCamControllerObserver, + public MCamSettingsModelObserver + { + // ======================================================= + // Methods + + // ------------------------------------------------------- + // constructors and destructor + public: + + static CCamAudioPlayerController* NewL( CCamAppController& aController, + MCamPlayerObserver& aObserver ); + virtual ~CCamAudioPlayerController(); + + // ------------------------------------------------------- + // from MCamControllerObserver + public: + + virtual void HandleControllerEventL( TCamControllerEvent aEvent, TInt aStatus ); + + // ------------------------------------------------------- + // from MCamSettingsModelObserver + public: + + virtual void IntSettingChangedL ( TCamSettingItemIds aSettingItem, TInt aSettingValue ); + virtual void TextSettingChangedL( TCamSettingItemIds aSettingItem, const TDesC& aSettingValue ); + + // ------------------------------------------------------- + // new public + public: + + /** + * @param aCallback If set ETrue, calling method this results in one + * callback to MCamAudioPlayerObserver::PlayComplete + */ + void PlaySound( TInt aSoundId, + TBool aCallback ); + + /** + * @param aCallback If set ETrue, calling method this results in one + * callback to MCamAudioPlayerObserver::PlayComplete + */ + void PlayTone( TInt aToneInHz, + TInt aLengthInUs, + TReal32 aVolumeInPercent, + TBool aCallback ); + + /** + * Cancel all ongoing playing activity. + */ + void CancelAllPlaying(); + + /** + * Cancel given sound playing, if ongoing. + * @aSoundId Id of the sound to be cancelled. + */ + void CancelPlaying( TInt aSoundId ); + + void InitKeySoundSystem(); + void EnableAllKeySounds(); + void DisableAllKeySoundsL(); + + + // ------------------------------------------------------- + // new private + private: + + TInt FindPlayerIndex( TInt aSoundId ) const; + CCamPlayerWrapperBase* GetPlayerL ( TInt aSoundId ); + void RemovePlayer ( TInt aSoundId ); + + void Setup( TCamCameraMode aCameraMode ); + void SetupForVideoL(); + void SetupForImageL(); + void SetupCaptureSoundPlayerL( TInt aNewSoundId ); + void Reset(); + + // ------------------------------------------------------- + // private constructors + private: + + void ConstructL(); + + CCamAudioPlayerController( CCamAppController& aController, + MCamPlayerObserver& aObserver ); + + // ======================================================= + // Data + private: + + CCamAppController& iController; + MCamPlayerObserver& iObserver; + + RPointerArray iPlayers; + CCamTonePlayerWrapper* iTonePlayer; + + TInt iCameraMode; // TCamCameraMode value + TInt iCaptureSoundId; // Sound id or -1 if not set + + CAknKeySoundSystem* iKeySoundSystem; // not own + TBool iKeySoundsDisabled; + + // ======================================================= + }; + +#endif // CAM_AUDIOPLAYERCONTROLLER_H + +// =========================================================================== +// end of file + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/audioplayer/camaudioplayerwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/audioplayer/camaudioplayerwrapper.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wrapper for Audio Player Utility +* +*/ + + +#ifndef CAM_AUDIOPLAYERWRAPPER_H +#define CAM_AUDIOPLAYERWRAPPER_H + +// =========================================================================== +// Includes +#include // for MMdaAudioPlayerCallback +#include "mcamplayerwrapper.h" // CCamPlayerWrapperBase + +// =========================================================================== +// Forward declarations +class MCamPlayerObserver; + +// =========================================================================== +// Class definitions + +/** +* Audio Player Wrapper class +* +*/ +class CCamAudioPlayerWrapper : public CCamPlayerWrapperBase, + public MMdaAudioPlayerCallback + { + // ======================================================= + // methods + + public: // constructors and destructor + + static CCamAudioPlayerWrapper* NewL( MCamPlayerObserver& aObserver, + TInt aSoundId ); + virtual ~CCamAudioPlayerWrapper(); + + public: // from CCamPlayerWrapperBase + + virtual TInt Id ( ) const; + virtual TBool IsEqualSound( TInt aSoundId ) const; + virtual void Play ( TBool aCallback ); + virtual void CancelPlay ( ); + + public: // from MMdaAudioPlayerCallback + + virtual void MapcInitComplete( TInt aStatus, const TTimeIntervalMicroSeconds &aDuration ); + virtual void MapcPlayComplete( TInt aStatus ); + + public: // new static public + + static TPtrC MapSoundId2FilenameL( TInt aSoundId ); + + private: // new private + + void InitL(); + void NotifyPlayComplete( TInt aStatus ); + + private: // private constructors + + void ConstructL(); + + CCamAudioPlayerWrapper( MCamPlayerObserver& aObserver, + TInt aSoundId ); + + // ======================================================= + // data + private: + + enum TCamAudioPlayerWrapperState + { + EIdle = 0, + EInitializing = 1, + EReady = 2, + EPlaying = 3, + ECorrupt = 4 + }; + + MCamPlayerObserver& iObserver; + TInt iSoundId; + CMdaAudioPlayerUtility* iPlayer; + TCamAudioPlayerWrapperState iState; + + TBool iPlayRequested; + TBool iCallback; + + // ======================================================= + }; + +#ifdef _DEBUG + static const TUint16* KCamAudioPlayerWrapperStateNames[] = + { + (const TUint16*)_S16("EIdle"), + (const TUint16*)_S16("EInitializing"), + (const TUint16*)_S16("EReady"), + (const TUint16*)_S16("EPlaying"), + (const TUint16*)_S16("ECorrupt") + }; +#endif // _DEBUG + +#endif // CAM_AUDIOPLAYERWRAPPER_H + +// =========================================================================== +// end of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/audioplayer/camtoneplayerwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/audioplayer/camtoneplayerwrapper.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wrapper for Tone Player Utility +* +*/ + + +#ifndef CAM_TONEPLAYERWRAPPER_H +#define CAM_TONEPLAYERWRAPPER_H + +// =========================================================================== +// Includes +#include // for MMdaAudioToneObserver + + +// =========================================================================== +// Forward declarations +class MCamPlayerObserver; + +// =========================================================================== +// Class definitions + +/** +* Tone Player Wrapper class +* +*/ +class CCamTonePlayerWrapper : public CBase, + public MMdaAudioToneObserver + { + // ======================================================= + // methods + + // ------------------------------------------------------- + // constructors and destructor + public: + + static CCamTonePlayerWrapper* NewL( MCamPlayerObserver& aObserver ); + virtual ~CCamTonePlayerWrapper(); + + // ------------------------------------------------------- + // from MMdaAudioToneObserver + public: + + virtual void MatoPrepareComplete( TInt aStatus ); + virtual void MatoPlayComplete ( TInt aStatus ); + + // ------------------------------------------------------- + // new public + public: + + void PlayTone( TInt aToneInHz, + TInt aLengthInUs, + TReal32 aVolumeInPercent, + TBool aCallback ); + + void CancelPlay(); + + // ------------------------------------------------------- + // new private + private: + + void InitL(); + void NotifyPlayComplete( TInt aStatus ); + + // ------------------------------------------------------- + // private constructors + private: + + void ConstructL(); + CCamTonePlayerWrapper( MCamPlayerObserver& aObserver ); + + // ======================================================= + // data + private: + + enum TCamTonePlayerWrapperState + { + EIdle = 0, + EInitializing = 1, + EPlaying = 2 + }; + + MCamPlayerObserver& iObserver; + CMdaAudioToneUtility* iTone; + TCamTonePlayerWrapperState iState; + + TBool iCallback; + + // ======================================================= + }; + +#ifdef _DEBUG + static const TUint16* KCamTonePlayerWrapperStateNames[] = + { + (const TUint16*)_S16("EIdle"), + (const TUint16*)_S16("EInitializing"), + (const TUint16*)_S16("EPlaying") + }; +#endif // _DEBUG + + +#endif // CAM_TONEPLAYERWRAPPER_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/audioplayer/mcamplayerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/audioplayer/mcamplayerobserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Player Observer interface +* +*/ + + +#ifndef MCAM_PLAYEROBSERVER_H +#define MCAM_PLAYEROBSERVER_H + +// =========================================================================== +// Includes + + +// =========================================================================== +// Forward declarations + + +// =========================================================================== +// Class definitions + +/** +* Player Observer interface +* +*/ +class MCamPlayerObserver + { + public: + virtual void PlayComplete( TInt aStatus, TInt aSoundId ) = 0; + }; + +#endif MCAM_PLAYEROBSERVER_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/audioplayer/mcamplayerwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/audioplayer/mcamplayerwrapper.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Player Wrapper interface and base class +* +*/ + + + +#ifndef MCAM_PLAYERWRAPPER_H +#define MCAM_PLAYERWRAPPER_H + +// =========================================================================== +// Includes +#include + +// =========================================================================== +// Forward declarations + + +// =========================================================================== +// Class definitions + +/** +* Mixin class for Player Wrappers. +* +*/ +class MCamPlayerWrapper + { + public: + + /** + * Player id + */ + virtual TInt Id() const = 0; + + /** + * Play the sound of this player + */ + virtual void Play( TBool aCallback ) = 0; + + /** + * Cancel any pending or ongoing playing. + */ + virtual void CancelPlay() = 0; + }; + +// =========================================================================== + +/** +* Base class for Player Wrappers. +* +*/ +class CCamPlayerWrapperBase : public CBase, + public MCamPlayerWrapper + { + public: + + /** + * Destructor. + * Needed to be able to use this base class pointer for delete. + */ + virtual ~CCamPlayerWrapperBase() {}; + + public: // from MCamPlayerWrapper + + virtual TInt Id() const = 0; + + /** + * Comparison function to tell if this player's sound + * is equal to the sound which id is given. There might + * be a situation where the sound ids are as such different, + * but still the sound is the same. In that case, the + * same player could be used for both sounds. + */ + virtual TBool IsEqualSound( TInt aSoundId ) const = 0; + + virtual void Play( TBool aCallback ) = 0; + virtual void CancelPlay() = 0; + }; + + +#endif // MCAM_PLAYERWRAPPER_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/camactivepalettehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/camactivepalettehandler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,403 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handler for Active Palette in Camera application +* +*/ + + +#ifndef CAMACTIVEPALETTEHANDLER_H +#define CAMACTIVEPALETTEHANDLER_H + +// INCLUDES +#include +#include + +#include + + +// FORWARD DECLARATIONS +class CCamAppController; +class CCamViewBase; +class TActivePalette2EventData; +class MActivePalette2UI; + +// CLASS DECLARATION + +class TCamActivePaletteItem + { +public: + TInt iItemId; + TInt iCmdId; + TInt iPosition; + TInt iIsVisible; + TInt iType; + }; + +class TCamAPPreCaptureItem + { +public: + TInt iSettingValue; + TInt iBitMapId; + }; + +// struct holding setting item and value +class TCamAPSettingsItem + { +public: + TInt iSettingItem; + TInt iSettingVal; + }; + +/** + * Handler for Active Palette in Camera application + * + * @since 3.0 + */ +class CCamActivePaletteHandler : public CBase, public MActivePalette2Observer + { +public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamActivePaletteHandler* NewL( CCamAppController& aController, TBool aCreatePalette ); + + /** + * Destructor. + */ + virtual ~CCamActivePaletteHandler(); + +public: // New functions + + /** + * Return handle to Active Palette + * @since 3.0 + * @return Reference to Active Palette + */ + MActivePalette2UI* ActivePalette() const; + + /** + * Install Active Palette items from resource + * @since 3.0 + * @param aResId resource id for Active Palette items + */ + void InstallAPItemsL( TInt aResId ); + + /** + * Inform active palette handler that returned from pretend exit + * so that it can deal with it. + * @since 3.0 + */ + void ReturnedFromPretendExitL(); + + /** + * Resets highlight to the first AP item + * @since 3.1 + */ + void ResetToFirstItem(); + + /** + * Resets highlight to the default AP item + * @since 3.1 + */ + void ResetToDefaultItem(); + + + /** + * Force Active Palette update + * @since 3.0 + */ + void UpdateActivePaletteL(); + + /** + * Set current view for Active Palette + * @since 3.0 + * @param aView - pointer to current view + */ + void SetView( CCamViewBase* aView ); + + /** + * Set visibility of Active Palette + * @since 3.0 + * @param aVisibility - ETrue to set visible, EFalse to set invisible + */ + void SetVisibility( TBool aVisibility ); + + /** + * Visibility of Active Palette + * @since 3.0 + * @return ETrue if AP is visible + */ + TBool IsVisible() const; + + /** + * Whether current item was accessed via Active Palette + * @since 3.0 + * @return ETrue if AP launched current item + */ + TBool AccessedViaAP() const; + + /** + * Inform AP handler AP launched item has completed + * @since 3.0 + */ + void APOperationComplete(); + + /** + * Pass keys events to Active Palette + * @since 3.0 + * @param aKeyEvent - key event + * @param aType - key type + */ + void HandleAPKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType); + + /** + * Create the Active Palette + * @since 3.0 + */ + void CreateActivePaletteL(const CCoeControl &aContainerWindow, + MObjectProvider *aMopParent); + + /** + * Destroys the Active Palette + * @since 3.0 + */ + void DestroyActivePalette(); + + /** + * Load post-capture view resources + * @since 3.0 + * @param aItem id of resource to load + */ + void LoadPostCaptureResourcesL( TInt aItem ); + + /** + * Get the resource id for the current setting + * @since 3.0 + * @param aSettingItem Setting we need resource for + * @return Id of array resource containing icons for this setting + */ + TInt PreCaptureArrayId( TInt aSettingItem ); + + /** + * Get bitmap for specfic value of settings item and sets its tooltip + * @since 3.0 + * @param aItem the setting value to map to a bitmap id + * @return bitmap id for specified settings val + */ + TInt GetBitmapIdFromValueL( TCamAPSettingsItem& aItem ); + + /** + * Get resource for for specific post-capture item + * @since 3.0 + * @param aCommandId the command ID value to map to an item ID + * @return resource ID for post capture item + */ + TInt PostCaptureItemId( TInt aCommandId ); + + /** + * Sets an icons visability + * @since 3.0 + * @param aCommandId the command ID for the icon + * @param aIsVisible the visability of the icon + */ + TInt SetItemVisible( const TInt aCommandId, const TBool aIsVisible ); + + /** + * Disables/enables active palette updates. + * This can be used to avoid redrawing and re-initalizing active object + * contents multiple times, when several settings are updated to the engine + * at once. + * @since 3.0 + * @param aUpdatesDisabled + */ + void DisableUpdates( TBool aUpdatesDisabled ); + + /** + * Update tooltip text for one-click upload item. This method needs to be + * called before InstallAPItemsL is called. + * + * @since S60 v5.1 + * @param aToolTip Tooltip text for one-click upload item + */ + void SetOneClickUploadTooltipL( const TDesC& aToolTip ); + +public: // Functions from base classes + + /** + * Notification of AP item focus change + * @since 3.0 + * @param aPrevItem index of item we are moving from + * @param aFocusedItem index of item we are moving to + */ + void NotifyItemFocused(TInt aPrevItem, TInt aFocusedItem); + + /** + * Notification of AP item selection + * @since 3.0 + * @param aEvent Event data from active palette + */ + void NotifyItemSelected(const TActivePalette2EventData& aEvent); + + /** + * Notification of active palette item completion + * @since 3.0 + * @param aEvent Event data from active palette + * @param aDataDes - descriptor containing packaged data + * @param aDataInt - data from AP event + */ + void NotifyItemComplete(const TActivePalette2EventData& aEvent, + const TDesC8& aDataDes, TInt aDataInt); + + /** + * Notification message received from Active Palette + * @since 3.0 + * @param aMessageID - id of message received from Active Palette + * @param aEvent Event data from active palette + * @param aDataDes - descriptor containing packaged data + * @param aDataInt - data from AP event + */ + void NotifyMessage(const TActivePalette2EventData& aEvent, + TInt aMessageID, const TDesC8& aDataDes, TInt aDataInt); + + /** + * Requests that the camera application redraws the supplied area + * @since 3.0 + * @param aArea the area to redraw + */ + void Redraw(const TRect& aArea); + + /** + * Informs us that the Active Palette has been updated + * @since 3.0 + */ + void ActivePaletteUpdated(void); + + +private: + + /** + * C++ default constructor. + */ + CCamActivePaletteHandler( CCamAppController& aController ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL( TBool aCreatePalette ); + + /** + * Determine Non-Setting State of a Pre-Capture Non-Setting item + * @since 3.0 + * @param aItem - The activepalette item to initialise + * @return the current "setting value" of the item + */ + TInt DetermineNonSettingState(const TCamActivePaletteItem& aItem) const; + + /** + * Set the tooltip of a pre-capture non-setting item + * @since 3.0 + * @param aItem - The activepalette item to initialise + */ + void SetNonSettingItemTooltipL(const TCamActivePaletteItem& aItem); + + /** + * Clears items from the Active Palette Control + * @since 3.0 + */ + void ClearActivePalette(); + + + void InstallOneAPItemL( const TCamActivePaletteItem& aItem, + const TUid& aPluginUid, + const TDesC& aToolTipText, + const TDesC& aIconFileName, + TInt aIconId, + TInt aMaskId ); + + void CheckFlashItemVisibilityL(); + + /** + * Read toolbar items resource content to aItems + * @param aResId Toolbar item resource id + * @param aItems Item array + */ + void ReadToolbarItemsFromResourceL( TInt aResId, + RArray& aItems ); + + + /** + * Calculate the active palette dimension according to resolution + * param aLength the length to be converted + */ + TPoint APScreenLocation( TPoint aQvgaPoint ); + + /* + * To check if a specific feature is supported, to append or show in AP + */ + TBool IsAPItemFeatureSupportedL( const TInt aItemId ) const; + +private: + CEikonEnv* iEnv; + + MActivePalette2UI* iActivePalette; + + CCamAppController& iController; + + CCamViewBase* iView; + + // array of items for active palette + RArray iItemArray; + + // AP visibility flag + TBool iVisible; + +public: + // flag indicating whether AP has launched an item + TBool iItemAccessedViaAP; + +private: + // array of pre-capture items + RArray iPreCaptureItems; + + // The current tooltip text + HBufC* iToolTipText; + + // Icon file name. + HBufC* iIconFileName; + + // Current icon id. + TInt iIconId; + + // store resoure id for EV cmp + TInt iEvCompRes; + + TBool iUpdatesDisabled; + + TBool iStarted; + + // Set to true, if items for the toolbar were initialised dynamically + TBool iDynamicToolbar; + + // Tooltip text for one-click upload item. + // Own. + HBufC* iOneClickUploadTooltip; + + RArray iCurrentValSettingsItem; + }; + +#endif // CAMACTIVEPALETTEHANDLER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cambackupcontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cambackupcontainer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for all camera application containers +* +* Copyright © 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + + + +#ifndef CAMBACKUPCONTAINER_H_ +#define CAMBACKUPCONTAINER_H_ + +#include "CamContainerBase.h" + +class CCamBackupContainer : public CCamContainerBase + { +private: + CCamBackupContainer(); + +protected: + + /** + * C++ constructor + * @since 5.1 + * @param aController reference to CCamAppController instance + * @param aView reference to the view containing this container + */ + CCamBackupContainer( CCamAppController& aController, + CAknView& aView ); + + /** + * Perform the second phase construction of a CCamBackupContainer object. + * @since 5.1 + * @param aContainer Parent container + */ + void ConstructL(const CCoeControl& aContainer); + +public: + /** + * Destructor. + */ + virtual ~CCamBackupContainer(); + + /** + * Two-phased factory constructor + * @since 5.1 + * @param aController reference to CCamAppController instance + * @param aView reference to the view containing this container + * @param aContainer Parent container + * @return pointer to the created CCamBackupContainer object already pushed on the Cleanupstack + */ + static CCamBackupContainer* NewLC(CCamAppController& aController, + CAknView& aView, + const CCoeControl& aContainer); + + /** + * Two-phased factory constructor. + * @since 5.1 + * @param aController reference to CCamAppController instance + * @param aView reference to the view containing this container + * @param aContainer Parent container + * @return pointer to the created CCamBackupContainer object + */ + static CCamBackupContainer* NewL(CCamAppController& aController, + CAknView& aView, + const CCoeControl& aContainer); + +public: + /** + * Performs the actual draw on the container + * @since 5.1 + * @param aRect area where to draw + */ + virtual void Draw( const TRect& aRect ) const; + + }; + +#endif /* CAMBACKUPCONTAINER_H_ */ diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cambatterypanecontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cambatterypanecontroller.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,236 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for CCamBatteryPaneController class. +* +* Copyright © 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#ifndef CAMBATTERYPANECONTROLLER_H +#define CAMBATTERYPANECONTROLLER_H + +// INCLUDES + +#include +#include "CamPropertyObserver.h" // MPropertyObserver + +// CONSTANTS + +// Battery strength and animation timer constants. +const TInt KMinBatteryStrength = 0; +const TInt KMaxBatteryStrength = 7; +const TInt KBatteryRechargeTick = 500000; + +// FORWARD DECLARATIONS + +class CCamBatteryPaneDrawer; +class CCamPropertyWatcher; +class CWindowGc; +class CBitmapContext; + +// CLASS DECLARATION + +/** +* Abstract API for battery pane observer. +* Derived classes, which have subscribed to CCamBatteryPaneController +* receive notification when the battery pane contents change +*/ +class MCamBatteryPaneObserver + { + public: + /** + * The battery pane contents have changed + */ + virtual void BatteryPaneUpdated() = 0; + }; + +/** +* Watches changes in battery strength and charge properties and provides +* animation of recharging. Notifies observer of changes in the battery pane. +* Handles drawing requests by passing them to owned CCamBatteryPaneDrawer +* object. +*/ +class CCamBatteryPaneController: public CBase, public MPropertyObserver + { + + public: // Construction and destruction + /** + * Descructor + */ + ~CCamBatteryPaneController(); + /** + * Two-phased constructor + * @param aObserver Battery pane observer + * @param aCallbackActive Callback to the observer active + * @return Pointer to the created + */ + static CCamBatteryPaneController* NewL( + MCamBatteryPaneObserver& aObserver, + TBool aCallbackActive ); + + + public: // From MPropertyObserver + /** + * The value of a watched property has changed + * @param aCategory The category of the property + * @param aKey the Identifier of the property + */ + void HandlePropertyChangedL( const TUid& aCategory, const TUint aKey ); + + + public: // New functions + /** + * Pause battery pane controller. With value ETrue, stops listening + * to battery pane events, with EFalse reinitializes and starts + * listening to the events again. + */ + void Pause( TBool aPause ); + + /** + * Activate or deactivate callbacks to observer when there + * are changes in the battery pane. + * @param aActive Callback to observer active + */ + void SetCallbackActive( TBool aActive ); + + /** + * Set location in the screen, where the battery pane is + * to be drawn. + * @param aLocation Drawing location + */ + void SetLocation( TPoint aLocation ); + + /** + * Set battery strength. + * @param aStrength Battery strength + */ + void SetBatteryStrength( TInt aStrength ); + + /** + * Start the recharging animation + */ + void StartRecharging(); + + /** + * Stop the recharging animation + */ + void StopRecharging(); + + /** + * Get battery pane's rectangle + * @return rectangle + */ + TRect Rect() const; + + /** + * Get rectangle of the animated part of battery pane + * @return rectangle + */ + TRect AnimationRect() const; + + /** + * Draw the battery pane + * @param aGc Graphics context + */ + void Draw( CBitmapContext& aGc ) const; + //void Draw( CWindowGc& aGc ) const; + + /** + * Handle resource change event + * @param aType Type of the resource change + */ + void HandleResourceChange( TInt aType ); + + protected: + /** + * Second phase constructor + */ + void ConstructL(); + + private: + /** + * Constructor. + * @param aObserver Battery pane observer + * @param aCallbackActive Callback to the observer active + */ + CCamBatteryPaneController( + MCamBatteryPaneObserver& aObserver, + TBool aCallbackActive ); + + /** + * + * @param aThis Pointer to the object owning the ticker + */ + static TInt TickerCallback( TAny* aThis ); + + /** + * Changes the (charging) battery strenght value as needed to show the next + * frame of the animation. + */ + void UpdateRechargeBatteryStrength(); + + /** + * Notifies observer of changes in the battery pane, + * if iCallbackActive is set + */ + void NotifyObserver(); + + /** + * Read current status of the properties. Set battery level + * and start/stop battery recharging animation accordingly. + */ + void ReadCurrentState(); + + /** + * Start/stop the charging animation, depending on aStatus value + * @param aStatus Value of the charging status property + */ + void HandleChargingStatusChange( TInt aStatus ); + + private: + // Current battery strength + TInt iBatteryStrength; + + // Recharging animation status + TBool iRecharging; + TInt iRechargeBatteryStrength; + + // Object that handles the actual drawing + CCamBatteryPaneDrawer* iDrawer; + + // Recharge animation timer + CPeriodic* iTicker; + + // Observer of the battery pane changes + MCamBatteryPaneObserver& iObserver; + TBool iCallbackActive; + + // Property watchers for battery charging and strength + CCamPropertyWatcher* iBatteryStrengthWatcher; + CCamPropertyWatcher* iBatteryChargingWatcher; + + TBool iPaused; + }; + +#endif diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cambatterypanedrawer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cambatterypanedrawer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for CCamBatteryPaneDrawer class. +* +* Copyright © 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#ifndef CAMBATTERYPANEDRAWER_H +#define CAMBATTERYPANEDRAWER_H + +// INCLUDES + +#include +#include "cambatterypanecontroller.h" // Battery level constants + +// FORWARD DECLARATIONS + +class CFbsBitmap; +class CBitmapContext; +class CWindowGc; +class CCamBitmapItem; + +// CLASS DECLARATION + +class CCamBatteryPaneDrawer: public CBase + { + public: // Construction and destruction + /** + * Destructor + */ + virtual ~CCamBatteryPaneDrawer(); + + /** + * Two-phased constructor + */ + static CCamBatteryPaneDrawer* NewL(); + + public: // New functions + + /** + * Set battery strength level used in drawing + * @param aBatteryStrength Battery Strength ) + */ + void SetBatteryStrength( TInt aBatteryStrength ); + + /** + * Set battery pane location used in drawing + * @param aLocation + */ + void SetLocation( const TPoint &aLocation ); + + /** + * Get battery pane's rectangle + * @return rectangle + */ + TRect Rect() const; + + /** + * Draw the battery pane + * @param aGc Graphics context + */ + // void Draw( CWindowGc& aGc ) const; + void Draw( CBitmapContext& aGc ) const; + + /** + * Clear the battery pane indicator + * @param aGc Graphics context + */ + void ClearBattery( CBitmapContext& aGc ) const; + + /** + * Handle resource change event + * @param aType Type of the resource change + */ + void HandleResourceChange( TInt aType ); + + protected: + /** + * Second phase constructor + */ + void ConstructL(); + + private: + /** + * Constructor + */ + CCamBatteryPaneDrawer(); + + /** + * Load layouts for elements in the battery pane + */ + void LoadLayoutsL(); + + /** + * Calculate height of + * @param aLevel Battery level + * @return height + */ + TInt BatteryStrengthIconHeight( TInt aLevel ) const; + + /** + * Load icons needed for drawing the battery pane + */ + void LoadIconsL(); + + /** + * Delete loaded icons + */ + void DeleteIcons(); + + /** + * Read nontouch layout + */ + void NonTouchLayoutL(); + + /** + * Read touch layout + */ + void TouchLayoutL(); + + + private: // Data + // Battery strength + TInt iBatteryStrength; + + // Battery strength and battery icon + CCamBitmapItem* iBatteryIcon; // own + CCamBitmapItem* iBatteryStrengthIcon; // own + + // Rectangle of the battery pane + TRect iRect; + + }; + +#endif // CAMBATTERYPANEDRAWER_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cambitmapitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cambitmapitem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for rendering bitmap based indicators +* +*/ + + +#ifndef CAMBITMAPITEM_H +#define CAMBITMAPITEM_H + +#include +#include +#include + +class CFbsBitmap; +class TAknTextComponentLayout; +class CBitmapContext; + +/** + * Class for rendering bitmap based indicators on top of viewfinder. + * + * CCamBitmapItem can be used to draw bitmaps on the screen in a way + * that is compatible with S60 Posting based overlays. The mask + * is also written in the alpha channel of the screen buffer to allow + * it to be overlaid on top of the viewfinder. + * + * @since S60 v5.0 + */ +class CCamBitmapItem : public CBase + { +public: + /** + * Two-phased constructor for non-skinned bitmaps. + */ + static CCamBitmapItem* NewL( + TInt aBitmapId, + TInt aMaskId ); + + /** + * Two-phased constructor for skinnable bitmaps. + */ + static CCamBitmapItem* NewL( + TInt aBitmapId, + TInt aMaskId, + const TAknsItemID& aID ); + + /** + * Destructor. + */ + virtual ~CCamBitmapItem(); + +public: + /** + * Set the layout for the item. + * + * @since S60 v5.0 + * @param aParentRect Rectangle for the parent layout item + * @param aLayout A TAknWindowComponentLayout containing the layout + * details for this item. Usually this can be retrieved + * using the AknLayout2 API. + */ + void SetLayoutL( + const TRect& aParentRect, + const TAknWindowComponentLayout& aLayout ); + + /** + * Set the layout for the item. + * + * @since S60 v5.0 + */ + void SetLayoutL( + const TRect& aRect ); + + /** + * Render this item in a bitmap based graphics context. + * + * @since S60 v5.0 + * @param aBitmapContext Graphics context to draw into. + */ + void Draw( CBitmapContext& aBitmapContext ) const; + + /** + * Render a part of this item in a bitmap based graphics context. + * + * @since S60 v5.0 + * @param aBitmapContext Graphics context to draw into. + * @param aDestRect Destination rect on the context + * @param aCropRect Crop rectangle specifying which part of the + * bitmap should be drawn. + */ + void DrawPartial( + CBitmapContext& aBitmapContext, + const TRect& aDestRect, + const TRect& aCropRect ) const; + + /** + * Get the size of the bitmap in pixels. + * + * @return Bitmap size in pixels (or size from layout if bitmap not + * available). + */ + TSize BitmapSize() const; + + /** + * Get the layout rect of the bitmap in pixels. + * + * @return Layout Ret in pixels + */ + TRect LayoutRect() const; + +private: + + CCamBitmapItem(); + + void ConstructL( + TInt aBitmapId, + TInt aMaskId ); + + void ConstructL( + TInt aBitmapId, + TInt aMaskId, + const TAknsItemID& aID ); + +private: // data + + // own + CFbsBitmap* iBitmap; + + // own + CFbsBitmap* iMask; + + TRect iRect; + + TBool iScalableIcon; + }; + +#endif // CAMTEXTITEM_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/CamCamera.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/CamCamera.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,424 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef CAM_CAMERA_H +#define CAM_CAMERA_H + +#include +#include + +#include "CamCameraCallback.h" +class MCameraObserver; +class MCameraObserver2; +class CCamCameraCallback; //CCamCameraCallBack + +class CCamCamera : public CCameraPlugin + { + public: + + /* + * NewL method; creating an instance based on MCameraObserver2 + */ + static CCamCamera* NewL( MCameraObserver2& aObserver, + TInt aCameraIndex, + TInt aPriority ); + + /** + * New2L method + */ + static CCamCamera* New2L( MCameraObserver2& aObserver, + TInt aCameraIndex, + TInt aPriority ); + + /* + * NewL method returns CCamera object; created based on + * MCameraObserver's observer + */ + static CCamCamera* NewL( MCameraObserver& aObserver, + TInt aCameraIndex ); + + /** + * New2L method + */ + static CCamCamera* New2L( MCameraObserver& aObserver, + TInt aCameraIndex ); + + /* + * NewDuplicateL + */ + static CCamCamera* NewDuplicateL( MCameraObserver2& aObserver, + TInt aCameraHandle ); + + /* + * NewDuplicate2L + */ + static CCamCamera* NewDuplicate2L( MCameraObserver2& aObserver, + TInt aCameraHandle ); + + /* + * NewDuplicateL + */ + static CCamCamera* NewDuplicateL( MCameraObserver& aObserver, + TInt aCameraHandle ); + + /* + * NewDuplicate2L + */ + static CCamCamera* NewDuplicate2L( MCameraObserver& aObserver, + TInt aCameraHandle ); + + /* + * Destructor + */ + ~CCamCamera(); + + + // Needed for compatibility with Symbian CCameraPlugin. Not implemented. + void Construct2L(MCameraObserver& aObserver, TInt aCameraIndex); + void Construct2DupL(MCameraObserver& aObserver, TInt aCameraHandle); + void Construct2L(MCameraObserver2& aObserver, TInt aCameraIndex,TInt aPriority); + void Construct2DupL(MCameraObserver2& aObserver, TInt aCameraHandle); + + public: // From CCamera documentation found from symbian + + /* + * Returns the number of camera's available + * For now, its 2 + */ + static TInt CamerasAvailable(); + + /* + * All the default information is set using this method for the camera + * Refer to TCameraInfo for further details + */ + virtual void CameraInfo(TCameraInfo& aInfo) const; + + /* + * Interface to reserve the camera, before actually using it + */ + virtual void Reserve(); + + /* + * Release the camera, if not needed + */ + virtual void Release(); + + /* + * Interface to switch to PowerOn state of the camera + */ + virtual void PowerOn(); + + /* + * Interface to switch to PowerOff state + */ + virtual void PowerOff(); + + /* + * Interface to return the Handle ID for the camera + */ + virtual TInt Handle(); + + /* + * Interface to set the zoom factor for the camera; by default its 0 + */ + virtual void SetZoomFactorL(TInt aZoomFactor = 0); + + /* + * Interface to get the zoom factor + */ + virtual TInt ZoomFactor() const; + + /* + * Interface to set the digital zoom factor for the camera; by default its 0 + */ + virtual void SetDigitalZoomFactorL(TInt aDigitalZoomFactor = 0); + + /* + * Interface to get the digital zoom factor for the camera; by default its 0 + */ + virtual TInt DigitalZoomFactor() const; + + /* + * Interface to set the contrast for the camera + */ + virtual void SetContrastL(TInt aContrast); + + /* + * Interface to get the contrast for the camera + */ + virtual TInt Contrast() const; + + /* + * Interface to set the brightness + */ + virtual void SetBrightnessL(TInt aBrightness); + + /* + * Interface to get the brightness of camera + */ + virtual TInt Brightness() const; + + /* + * Interface to start the direct view finder + */ + virtual void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect); + + /* + * Interface to start the direct view finder + */ + virtual void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect,TRect& aClipRect); + + /* + * Interface to start the view finder bitmaps + */ + virtual void StartViewFinderBitmapsL(TSize& aSize); + + /* + * Interface to start the view finder bitmaps + */ + virtual void StartViewFinderBitmapsL(TSize& aSize,TRect& aClipRect); + + /* + * Interface to start the View finder frame + */ + virtual void StartViewFinderL(TFormat aImageFormat,TSize& aSize); + + /* + * Interface to start the view finder + */ + virtual void StartViewFinderL(TFormat aImageFormat,TSize& aSize,TRect& aClipRect); + + /* + * Interface to check if the view finder is active + */ + virtual TBool ViewFinderActive() const; + + /* + * + */ + virtual void SetViewFinderMirrorL(TBool aMirror); + + /* + * + */ + virtual TBool ViewFinderMirror() const; + + /* + * Interface to stop the view finder + */ + virtual void StopViewFinder(); + + /* + * Interface to start Prepare Image Capture + */ + virtual void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex); + + /* + * Interface to start Prepare Image Capture + */ + virtual void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex,const TRect& aClipRect); + + /* + * Interface to Capture Image + */ + virtual void CaptureImage(); + + /* + * Interface to Cancel Capture Image + */ + virtual void CancelCaptureImage(); + + /* + * + */ + virtual void EnumerateCaptureSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const; + + /* + * Interfaces to start prepare video capture + */ + virtual void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer); + + /* + * Interfaces to start prepare video capture + */ + virtual void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer,const TRect& aClipRect); + + /* + * Interface to start the video capture + */ + virtual void StartVideoCapture(); + + /* + * Interface to stop the video capture + */ + virtual void StopVideoCapture(); + + /* + * Interface to check if the video capture is active + */ + virtual TBool VideoCaptureActive() const; + + /* + * + */ + virtual void EnumerateVideoFrameSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const; + + /* + * + */ + virtual void EnumerateVideoFrameRates(TReal32& aRate,TInt aRateIndex,TFormat aFormat,TInt aSizeIndex,TExposure aExposure = EExposureAuto) const; + + /* + * Interface to fetch the frame size + */ + virtual void GetFrameSize(TSize& aSize) const; + + /* + * Interface to get the Frame Rate + */ + virtual TReal32 FrameRate() const; + + /* + * Interface to get the number of buffers in use + */ + virtual TInt BuffersInUse() const; + + /* + * Interface to get the number of frames in a buffer + */ + virtual TInt FramesPerBuffer() const; + + /* + * Interface to set the JPEG quality + */ + virtual void SetJpegQuality(TInt aQuality); + + /* + * Return the JPEG quality + */ + virtual TInt JpegQuality() const; + + /* + * + */ + virtual TAny* CustomInterface(TUid aInterface); + /* + * + */ + virtual void SetFlashL(TFlash aFlash = EFlashNone); + /* + * + */ + virtual TFlash Flash() const; + /* + * + */ + virtual void SetExposureL(TExposure aExposure = EExposureAuto); + /* + * + */ + virtual TExposure Exposure() const; + /* + * + */ + virtual void SetWhiteBalanceL(TWhiteBalance aWhiteBalance = EWBAuto); + /* + * + */ + virtual TWhiteBalance WhiteBalance() const; + /* + * + */ + + + // Private methods + private: + + /* + * + */ + void InitPhotoResolutionsL(); + + /* + * + */ + static TInt ViewfinderCallBack( TAny* aSelf ); + + + // Constructors + private: + + /* + * ConstructL + */ + void ConstructL(); + + /* + * Constructor + */ + CCamCamera( MCameraObserver& aObserver, TInt aCameraIndex ); + + /* + * Constructor + */ + CCamCamera( MCameraObserver2& aObserver, TInt aCameraIndex, TInt aPriority ); + + + private: + // Observers defined from CamCameraController + MCameraObserver* iObserver; + MCameraObserver2* iObserver2; + + // Call Back Related members + CCamCameraCallBack* iCallBackActive; + + // Keeping track of the camera states (TCamCameraStateFlags ORed). + // @see TCamCameraStateFlags + TUint iState; + + TInt iCameraIndex; + TInt iPriority; + + TCameraInfo iInfo; + + TInt iBrightness; + TInt iContrast; + + TWhiteBalance iWhiteBalance; + TExposure iExposure; + TFlash iFlash; + + TInt iDigitalZoom; + TInt iZoomFactor; + + TSize iViewfinderSize; + TBool iViewFinderMirror; + + TFormat iFormat; + TInt iSizeIndex; + TInt iQuality; + + RArray iPhotoResolutions; + CCameraappTestBitmapManager* iBitmapManager; + CPeriodic *iVfPeriodic; + }; + +#endif // CAM_CAMERA_H + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/CamCamera.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/CamCamera.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +/* +*This file contains needed UID's and reference paramenter for CCamCamera class +* @Refer CamCamera.h +*/ + +#ifndef CAMCAMERA_HRH +#define CAMCAMERA_HRH + +#include "CamCamera.h" +#include +const TInt KCameraHandle = 2007; + +const TUint32 KFlashModeSupport = ( CCamCamera::EFlashNone + | CCamCamera::EFlashAuto + | CCamCamera::EFlashForced + | CCamCamera::EFlashFillIn + | CCamCamera::EFlashRedEyeReduce + | CCamCamera::EFlashSlowFrontSync // Flash at the moment when shutter opens. + | CCamCamera::EFlashSlowRearSync // Flash at the moment when shutter closes. + | CCamCamera::EFlashManual + ); + +const TUint32 KExposureSupport = ( CCamCamera::EExposureAuto // Set exposure automatically. Default, always supported. + | CCamCamera::EExposureNight // Night-time setting for long exposures. + | CCamCamera::EExposureBacklight // Backlight setting for bright backgrounds. + | CCamCamera::EExposureCenter // Centered mode for ignoring surroundings. + | CCamCamera::EExposureSport // Sport setting for very short exposures. + | CCamCamera::EExposureVeryLong // Generalised setting for very long exposures. + | CCamCamera::EExposureSnow // Snow setting for daylight exposure. + | CCamCamera::EExposureBeach // Beach setting for daylight exposure with reflective glare. + | CCamCamera::EExposureProgram // Programmed exposure setting. + | CCamCamera::EExposureAperturePriority // Aperture setting is given priority. + | CCamCamera::EExposureShutterPriority // Shutter speed setting is given priority. + | CCamCamera::EExposureManual // User selectable exposure value setting. + | CCamCamera::EExposureSuperNight // Exposure night setting with colour removed to get rid of colour noise. + | CCamCamera::EExposureInfra //Exposure for infra-red sensor on the camera + ); + +const TUint32 KOptionsSupport = ( ~TCameraInfo::EViewFinderDirectSupported + | TCameraInfo::EViewFinderBitmapsSupported + | TCameraInfo::EImageCaptureSupported + | TCameraInfo::EVideoCaptureSupported + | TCameraInfo::EViewFinderMirrorSupported + | TCameraInfo::EContrastSupported + | TCameraInfo::EBrightnessSupported + | TCameraInfo::EViewFinderClippingSupported + | TCameraInfo::EImageClippingSupported + | ~TCameraInfo::EVideoClippingSupported + ); + +const TUint32 KWBSupport = ( CCamCamera::EWBAuto // Set white balance automatically. Default, always supported. + | CCamCamera::EWBDaylight // Normal daylight. + | CCamCamera::EWBCloudy // Overcast daylight. + | CCamCamera::EWBTungsten // Tungsten filament lighting. + | CCamCamera::EWBFluorescent // Fluorescent tube lighting + | CCamCamera::EWBFlash // Flash lighting. + | CCamCamera::EWBSnow // High contrast daylight primarily snowy + | CCamCamera::EWBBeach // High contrast daylight primarily near the sea + | CCamCamera::EWBManual // User configurable mode + | CCamCamera::EWBShade // Shade + ); + +const TUint32 KImageFormatSupportCAM1 = + ( 0 +// | EFormatMonochrome // 8 bit greyscale values, 0=black, 255=white. +// | EFormat16bitRGB444 // Packed RGB triplets, 4 bits per pixel with red in the least significant bits and the 4 most significant bits unused. +// | EFormat16BitRGB565 // Packed RGB triplets, 5 bits per pixel for red and blue and 6 bits for green, with red in the least significant bits. +// | EFormat32BitRGB888 // Packed RGB triplets, 8 bits per pixel with red in the least significant bits and the 8 most significant bits unused. + | CCamCamera::EFormatJpeg // JFIF JPEG. + | CCamCamera::EFormatExif // EXIF JPEG +// | EFormatFbsBitmapColor4K // CFbsBitmap object with display mode EColor4K. +// | EFormatFbsBitmapColor64K // CFbsBitmap object with display mode EColor64K. +// | EFormatFbsBitmapColor16M // CFbsBitmap object with display mode EColor16M. +// | EFormatUserDefined // Implementation dependent. +// | EFormatYUV420Interleaved // 4:2:0 format, 8 bits per sample, Y00Y01Y10Y11UV. +// | EFormatYUV420Planar // 4:2:0 format, 8 bits per sample, Y00Y01Y02Y03...U0...V0... +// | EFormatYUV422 // 4:2:2 format, 8 bits per sample, UY0VY1. +// | EFormatYUV422Reversed // 4:2:2 format, 8 bits per sample, Y1VY0U. +// | EFormatYUV444 // 4:4:4 format, 8 bits per sample, Y00U00V00 Y01U01V01... +// | EFormatYUV420SemiPlanar // 4:2:0 format, 8 bits per sample, Y00Y01Y02Y03...U0V0... +// | EFormatFbsBitmapColor16MU // CFbsBitmap object with display mode EColor16MU. + ); + +const TUint32 KImageFormatSupportCAM2 = + ( 0 + | CCamCamera::EFormatJpeg + ); + +const TUint32 KVideoFormatSupportCAM1 = + ( 0 + | CCamCamera::EFormatFbsBitmapColor4K + | CCamCamera::EFormatFbsBitmapColor64K + | CCamCamera::EFormatFbsBitmapColor16M + | CCamCamera::EFormatFbsBitmapColor16MU + ); + +const TUint32 KVideoFormatSupportCAM2 = + ( 0 + | CCamCamera::EFormatFbsBitmapColor4K + | CCamCamera::EFormatFbsBitmapColor64K + | CCamCamera::EFormatFbsBitmapColor16M + | CCamCamera::EFormatFbsBitmapColor16MU + ); + +// const TSize KImageSizeJpegCam1 = TSize( 2592, 1944 ); // 5Mpix +const TSize KImageSizeJpegCam1 = TSize( 1600, 1200 ); // 5Mpix +// const TSize KImageSizeExifCam1 = TSize( 2592, 1944 ); // 5Mpix +const TSize KImageSizeExifCam1 = TSize( 1600, 1200 ); + +const TSize KVideoFrameSizeCam1 = TSize( 640, 480 ); // VGA + +const TSize KImageSizeJpegCam2 = TSize( 2048, 1536 ); // +const TSize KImageSizeExifCam2 = TSize( 2048, 1536 ); // +const TSize KVideoFrameSizeCam2 = TSize( 320, 240 ); // VGA + + + +const TTimeIntervalMicroSeconds32 KDelayReserve = 500 * 1000; // async +const TTimeIntervalMicroSeconds32 KDelayPowerOn = 500 * 1000; // async +const TTimeIntervalMicroSeconds32 KDelayPowerOff = 500 * 1000; // synch +const TTimeIntervalMicroSeconds32 KDelayRelease = 500 * 1000; // synch + +const TTimeIntervalMicroSeconds32 KDelayImageCapture = 500 * 1000; // synch +const TTimeIntervalMicroSeconds32 KDelayImageCaptureComplete = 500 * 1000; // async from capture start +const TTimeIntervalMicroSeconds32 KVfFrameInterval = 1000*1000 / 5; // 5 fps +// =========================================================================== + +#endif //CAMCAMERA_H \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/CamCameraCallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/CamCameraCallback.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Emulator version of CCamera* +*/ + + + +#ifndef CAMCAMERACALLBACK_H +#define CAMCAMERACALLBACK_H + +// INCLUDES +#include +#include + +class CCameraappTestBitmapManager; +class MCameraObserver; + + +class CCamCameraCallBack : public CActive + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCamCameraCallBack* NewL( MCameraObserver& aController ); + + /** + * Destructor. + */ + virtual ~CCamCameraCallBack(); + + public: // Functions from CActive + + // void Cancel(); + + public: // New Methods + + /** + * Complete reserve request. + */ + void ReserveCompleteRequest( const TInt aError ); + + /** + * Complete power-on request. + */ + void PowerOnCompleteRequest( const TInt aError ); + + /** + * Prepare for Still capture + */ + void StillPrepareComplete(); + + /** + * Initiate Still Image Capture + */ + void SendViewFinderFrames(); + + /** + * Stop Sending View Finder Frames + */ + void StopViewFinderFrames(); + + /** + * Capture Image and Call MCameraObserver::ImageReady . + */ + void RequestCaptureImage(); + + private: // New Methods + + /* + * Constructor + */ + CCamCameraCallBack( MCameraObserver& aController ); + + // 2nd phase constructor + void ConstructL( ); + + // We call SetActive and check the handling of all requests + void SetActiveAndCompleteRequest(); + + // Complete Reserve request by calling MCameraObserver::ReserveComplete + void DoReserveComplete(); + + // Complete Reserve request by calling MCameraObserver::PowerOnComplete + void DoPowerOnComplete(); + + void DoStillPrepareComplete(); + + // Transfer view finder frames request by calling MCameraObserver::ViewFinderFrameReady + void DoViewFinderFrame(); + + // Complete Reserve request by calling MCameraObserver::ImageReady + void DoCaptureImageL(); + + void Reset(); + + + /** + * Cancels the active object + */ + void DoCancel(); + + /* + * All requests are handled one by one in this method + */ + void RunL(); + + private: + MCameraObserver& iController; + + CCameraappTestBitmapManager* iBitmapManager; + // Request complete status flags + TBool iStillPrepareComplete; + TBool iReserveComplete; + TBool iPowerOnComplete; + TBool iCaptureImage; + TBool iViewFinderFrame; + + // Errors caused during request + TInt iReserveError; + TInt iPowerOnError; + }; + +#endif // CAMCAMERACALLBACKACTIVE_H + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/cambitmapscaler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/cambitmapscaler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera Bitmap Scaler class and observer interface. +* +*/ + + +#ifndef CAM_BITMAPSCALER_H +#define CAM_BITMAPSCALER_H + +// =========================================================================== +// Included headers +#include +#include + +// =========================================================================== +// Forward declarations +class CFbsBitmap; +class CBitmapScaler; + +// =========================================================================== +// Classes + +/** +* Interface for Camera Bitmap Scaler Observers +*/ +class MCamBitmapScalerObserver + { + public: + + /** + * Notify observer that the bitmap scaling has finished. + * @param aStatus Status code describing the success of the operation. + * KErrNone if all went as planned. + * @param aBitmap Scaled bitmap. NULL if errors in scaling. + */ + virtual void BitmapScaled( TInt aStatus, const CFbsBitmap* aBitmap ) = 0; + + }; + + +/** +* Image Decoder class +*/ +class CCamBitmapScaler : public CActive + { + // ======================================================= + public: + + /** + * 2-phase constructor. + */ + static CCamBitmapScaler* NewL( MCamBitmapScalerObserver& aObserver ); + + /** + * Destructor. + */ + virtual ~CCamBitmapScaler(); + + // ------------------------------------------------------- + // From CActive + protected: + + /** + * Called when Cancel is requested and this AO is active. + * @see CActive + */ + virtual void DoCancel(); + + /** + * We get notified of the scaling success by a call to RunL + * when scaling finishes. + * @see CActive + */ + virtual void RunL(); + + /** + * If a leave occurs in RunL, RunError gets called by the + * Active Scheduler. + * @param aError Leave code from RunL. + * @see CActive + */ + virtual TInt RunError( TInt aError ); + + // ------------------------------------------------------- + public: + + void InitScalingL( const TSize& aTargetSize, + const TDisplayMode& aTargetDisplayMode, + TBool aMaintainAspect ); + + void StartScaling( CFbsBitmap& aSourceBitmap ); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * 1st phase constructor. + * Cannot leave. + */ + CCamBitmapScaler( MCamBitmapScalerObserver& aObserver ); + + // ======================================================= + // Data + private: + + MCamBitmapScalerObserver& iObserver; + CBitmapScaler* iScaler; + CFbsBitmap* iScaledBitmap; + TBool iMaintainAspect; + + // ======================================================= + }; + +// =========================================================================== +#endif // CAM_BITMAPSCALER_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/cambuffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/cambuffer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of CCamBuffer class. +* Temporary own implementation of MCameraBuffer. +* +* +*/ + + + + +#ifndef C_CAM_BUFFER_H +#define C_CAM_BUFFER_H + + +#include // CBase +#include // MCameraBuffer + + +class CFbsBitmap; + + +class CCamBuffer : public CBase, + public MCameraBuffer + { + // ======================================================= + public: + + static CCamBuffer* NewL( const CFbsBitmap& aBitmap, + HBufC8* aData ); + static CCamBuffer* NewLC( const CFbsBitmap& aBitmap, + HBufC8* aData ); + + static CCamBuffer* NewL( CFbsBitmap* aBitmap, + HBufC8* aData ); + static CCamBuffer* NewLC( CFbsBitmap* aBitmap, + HBufC8* aData ); + + + // from MCameraBuffer + public: + + virtual TInt NumFrames(); + virtual TDesC8* DataL( TInt aFrameIndex ); + virtual CFbsBitmap& BitmapL( TInt aFrameIndex ); + virtual RChunk& ChunkL(); + virtual TInt ChunkOffsetL( TInt aFrameIndex ); + virtual TInt FrameSize( TInt aFrameIndex ); + virtual void Release(); + + // new methods + public: + protected: + private: + + void ConstructL( const CFbsBitmap& aBitmap, + HBufC8* aData ); + + void ConstructL( CFbsBitmap* aBitmap, + HBufC8* aData ); + + CCamBuffer(); + + ~CCamBuffer(); /** private to force use of Release() */ + + // ======================================================= + // Data + public: + // Defined in MCameraBuffer + // TInt iIndexOfFirstFrameInBuffer; + // TTimeIntervalMicroSeconds iElapsedTime; + protected: + private: + + CFbsBitmap* iBitmap; + HBufC8* iImageData; + RChunk iChunk; // Needed to reference + + TBool iOwnBitmap; + TBool iOwnData; + // ======================================================= + }; + + +#endif // C_CAM_BUFFER_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/cambuffercleanup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/cambuffercleanup.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CAM_CAMERABUFFERCLEANUP_H +#define CAM_CAMERABUFFERCLEANUP_H + +#include // MCameraBuffer + +void +CameraBufferCleanup( TAny* aCameraBuffer ) + { + MCameraBuffer* buffer = static_cast( aCameraBuffer ); + buffer->Release(); + } + +#endif diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/cambuffershare.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/cambuffershare.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Reference counting wrapper for MCameraBuffer. +* +*/ + + +#ifndef CAM_BUFFERSHARE_H +#define CAM_BUFFERSHARE_H + +#include + + +class MCameraBuffer; + +class CCamBufferShare : public CBase + { + // ======================================================= + // Methods + + // ------------------------------------------------------- + // Constructor and destructor + public: + + /** + * This is just a wrapper class => c++ constructor + */ + CCamBufferShare( MCameraBuffer* aSharedBuffer ); + + private: + + /** + * Reference counting used, so destructor is private. + */ + ~CCamBufferShare(); + + // ------------------------------------------------------- + // Other methods + public: + + /** + * Get the shared buffer. Ownership not given to caller. + */ + MCameraBuffer* SharedBuffer(); + + /** + * Reserve a reference to this share. + */ + void Reserve(); + + /** + * Release a reference to this share. + */ + void Release(); + +#ifdef _DEBUG + /** + * Get the amount of used buffers in total. + */ + static TInt TotalBufferShareCount(); +#endif + + // ======================================================= + // Data + protected: + +#ifdef _DEBUG + static TInt isTotalBufferCount; +#endif + + private: + + MCameraBuffer* iSharedBuffer; + TInt iReferenceCount; + + // ======================================================= + }; + +#endif + +// end of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/cambuffersharecleanup.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/cambuffersharecleanup.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Cleanup method for CCamBufferShare instances. +* +*/ + + +#ifndef CAM_BUFFERSHARECLEANUP_H +#define CAM_BUFFERSHARECLEANUP_H + +#include "cambuffershare.h" + +namespace NCamCameraController + { + inline void + CamBufferShareCleanup( TAny* aCamBufferShare ) + { + CCamBufferShare* bufferShare = static_cast( aCamBufferShare ); + bufferShare->Release(); + }; + } + +#endif diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camcameracontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camcameracontroller.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,690 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 CAM_CAMERACONTROLLER_H +#define CAM_CAMERACONTROLLER_H + + +// =========================================================================== +// Included headers +#include "camcameracontrollerflags.hrh" + +#include +#include +#ifdef CAMERAAPP_CAE_FOR_VIDEO + #include +#endif + +#include "camimageencoder.h" +#include "camcameraevents.h" +#include "camcamerarequests.h" +#include "camcameracontrollertypes.h" +#include "camcameracontrollersettings.h" +#include "mcamcameraobserver.h" // MCamCameraObservable, MCamCameraObserver + +// =========================================================================== +// Forward declarations + +class MCameraBuffer; +class MCamSettingProvider; +class CIdle; +class CFbsBitmap; + +class CCamSnapshotProvider; +class CCamCameraControllerActive; +class CCamAppController; + +#ifdef CAMERAAPP_CAPI_EMULATOR + class CCamCamera; + #define CAMERA CCamCamera +#else + #define CAMERA CCamera +#endif // CAMERAAPP_CAPI_EMULATOR + +#ifdef FORCE_DUMMY_ENGINE + class CCameraappDummyEngine; +#endif // FORCE_DUMMY_ENGINE + +class MCameraOrientation; +class MCameraFaceTracking; + class MCameraUIOrientationOverride; + +#ifdef CAMERAAPP_PERFORMANCE_CONTROLLER + class CCamPerformanceLogger; +#endif +#ifdef CAMERAAPP_FLASH_SIMULATOR + class CCamFlashSimulator; +#endif + +#ifdef CAMERAAPP_CAE_ERR_SIMULATION + class CCamTimer; +#endif // CAMERAAPP_CAE_ERR_SIMULATION + +// =========================================================================== +// Class declarations + + +/** + * Camera controller class. + * + * If using MCameraObserver to receive callbacks from (old) Camera API, + * still use (new) MCameraObserver2 to receive thumbnails events. + */ +class CCamCameraController : public CBase, + public MCamCameraObservable, +#ifdef CAMERAAPP_CAE_FOR_VIDEO + public MCamAppEngineObserver, +#endif +#if !defined( CAMERAAPP_CAPI_V2 ) + public MCameraObserver, +#endif + public MCameraObserver2, + public MCamImageEncoderObserver + { + // ======================================================= + // Friends + private: + + friend class CCamCameraControllerActive; + + // ======================================================= + // Methods + + // ------------------------------------------------------- + // Public constructors and destructor + public: + + static CCamCameraController* NewL( MCamSettingProvider& aProvider, + CCamAppController& aAppController, + TInt aCameraIndex = 0 ); + virtual ~CCamCameraController(); + + // ------------------------------------------------------- + // From MCamCameraObservable + public: + virtual void AttachObserverL( const MCamCameraObserver* aObserver, + const TUint& aInterest ); + virtual void DetachObserver ( const MCamCameraObserver* aObserver ); + + // ------------------------------------------------------- + // From MCameraObserver2 + public: + virtual void HandleEvent( const TECAMEvent& aEvent ); + virtual void ViewFinderReady( MCameraBuffer& aCameraBuffer, TInt aError ); + virtual void ImageBufferReady( MCameraBuffer& aCameraBuffer, TInt aError ); + virtual void VideoBufferReady( MCameraBuffer& aCameraBuffer, TInt aError ); + +#ifndef CAMERAAPP_CAPI_V2 + // ------------------------------------------------------- + // From MCameraObserver + public: + virtual void ReserveComplete( TInt aError ); + virtual void PowerOnComplete( TInt aError ); + virtual void ViewFinderFrameReady( CFbsBitmap& aFrame ); + virtual void ImageReady( CFbsBitmap* aBitmap, HBufC8* aData, TInt aError ); + virtual void FrameBufferReady( MFrameBuffer* aFrameBuffer, TInt aError ); +#endif // CAMERAAPP_CAPI_V2 + +#ifdef CAMERAAPP_CAE_FOR_VIDEO + // ------------------------------------------------------- + // From MCamAppEngineObserver + public: + virtual void McaeoInitComplete( TInt aError ); + virtual void McaeoStillPrepareComplete( TInt aError ); + virtual void McaeoVideoPrepareComplete( TInt aError ); + virtual void McaeoViewFinderFrameReady( CFbsBitmap& aFrame, TInt aError ); + virtual void McaeoSnapImageReady( const CFbsBitmap& aBitmap, TInt aError ); + virtual void McaeoStillImageReady( CFbsBitmap* aBitmap, HBufC8* aData, TInt aError ); + virtual void McaeoVideoRecordingOn( TInt aError ); + virtual void McaeoVideoRecordingPaused( TInt aError ); + virtual void McaeoVideoRecordingComplete( TInt aError ); + virtual void McaeoVideoRecordingTimes( + TTimeIntervalMicroSeconds aTimeElapsed, + TTimeIntervalMicroSeconds aTimeRemaining, + TInt aError ); + virtual void McaeoVideoRecordingStopped(); +#endif // CAMERAAPP_CAE_FOR_VIDEO + + // ------------------------------------------------------- + // From MCamImageEncoderObserver + public: + + virtual void ImageEncoded( TInt aStatus, HBufC8* aData ); + + // ------------------------------------------------------- + // New methods + public: + + /** + * Issue a request for one operation. + * Operation will be started synchronously. + * Observers will receive notification when the operation is ready. + */ + void RequestL( const TCamCameraRequestId& aRequestId ); + + /** + * + */ + void DirectRequestL( const TCamCameraRequestId& aRequestId ); + + /** + * Issue a sequence of operation requests. + * This method will return immediately and the requests will be + * processed in the background by callbacks. + */ + void RequestSequenceL( const RCamRequestArray& aSequence ); + + /** + * Request one or more settings to be set to camera. + * The settings to be processed are queried from Setting Provider. + * Also the values are queried from there. + * Settings are processed asynchronously and ECamCameraEventSettingsDone + * event is sent when the process is complete. + */ + void RequestSettingsChangeL(); + + /** + * Request one setting to be set synchronously to camera. + * @param aSettingId Id of the setting to change. Value to set + * is asked from Setting Provider. + * @see TCamCameraSettingId + */ + void DirectSettingsChangeL( + const NCamCameraController::TCamCameraSettingId& aSettingId ); + + /** + * Cancel outstanding request sequence. + * Operations that have been already performed will not be rolled back. + * Observers have received notifications of such operations. + * If the sequence is not completed already (observers have not received + * ECamEngineEventSequenceEnd notification), once the sequence is cancelled, + * observers will receive ECamEngineEventSequenceEnd notification with + * status KErrCancel. + */ + void CancelSequence(); + + void SwitchCameraL( TInt aCameraIndex ); + + void CompleteSwitchCameraL(); + + void SetOrientationModeL( TInt aOrientation ); + + /** + * Set viewfinder window for direct screen viewfinder. The handle must remain + * valid as long as viewfinder is running. + * @since S60 v5.0 + * @param aWindow Handle to viewfinder window. Must remain valid while + * viewfinder is running. Ownership not transferred. + */ + void SetViewfinderWindowHandle( RWindowBase* aWindow ); + + /** + * Notify that the viewfinder window is about to be deleted. Viewfinder + * will be stopped if this window handle is currently used for the + * viewfinder. + * @since S60 v5.0 + * @param aWindow Handle to viewfinder window. Ownership not transferred. + */ + void ViewfinderWindowDeleted( RWindowBase* aWindow ); + + // ------------------------------------------------------- + // Info getters + public: + + static TInt CamerasAvailable(); + + TInt CameraHandle(); // Calls CCamera::Handle which is not const + + const TCameraInfo& CameraInfo() const; + const TCamControllerInfo& ControllerInfo() const; + + TUint State() const; + TCamViewfinderMode ViewfinderMode() const; + TCamCameraTriState ViewfinderState() const; + TCamCameraTriState SnapshotState() const; + TCamCameraReadyState FlashState() const; + + /** + * Method to retrieve the Remaining recording time from + * CCaeEngine, this information is used in AppUi and + * AppController to handle or continue with Video Rec operation + */ + TTimeIntervalMicroSeconds RemainingVideoRecordingTime(); + + void GetCameraSettingValueL( + const NCamCameraController::TCamCameraSettingId& aSettingId, + TAny* aSettingData ); + + /** + * Checks whether setting value given by setting provider matches + * the value currently set for iCamera. + * @param aSettingId Setting id + * @return upToDate + */ + TBool SettingValueUpToDateL( + const NCamCameraController::TCamCameraSettingId& aSettingId ); + + // ------------------------------------------------------- + // Private methods + private: + + TInt ProcessNextRequestL(); + + TInt ProcessOneRequestL( const TCamCameraRequestId& aRequestId ); + + TInt ProcessSettingL( + const NCamCameraController::TCamCameraSettingId& aSettingId ); + + // Helper methods used to divide ProcessOneRequestL to smaller portions. + TInt ProcessControlStartupRequestL( const TCamCameraRequestId& aRequestId ); + TInt ProcessControlShutdownRequest( const TCamCameraRequestId& aRequestId ); // non-leaving + + TInt ProcessVfRequestL( const TCamCameraRequestId& aRequestId ); + void InitViewfinderL( const TCamViewfinderMode& aMode ); + void ProcessVfStartRequestL(); + void ProcessVfStopRequestL(); + void ProcessVfStopEcamRequest(); + void ProcessVfRelaseRequest(); // non-leaving + + TInt ProcessSnapshotRequestL( const TCamCameraRequestId& aRequestId ); + void ProcessSsStopRequest(); // non-leaving + void ProcessSsReleaseRequest(); // non-leaving + void InitSnapshotL(); + + TInt ProcessImageRequestL( const TCamCameraRequestId& aRequestId ); + TInt ProcessImageShutdownRequest( const TCamCameraRequestId& aRequestId ); + + TInt ProcessVideoRequestL( const TCamCameraRequestId& aRequestId ); + + void ProcessAutofocusRequestL( const TCamCameraRequestId& aRequestId ); + + void ProcessCaptureLimitSettingL(); + + void EndSequence( TInt aStatus ); + void ClearRequestQueue(); + void ClearSettingQueue(); + + // ------------------------------------------------------- + // Event handlers + + void HandlePowerOnEvent( TInt aStatus ); + void HandleReserveGainEvent( TInt aStatus ); + void HandleReserveLostEvent( TInt aStatus ); + void HandleViewfinderEvent( MCameraBuffer* aBitmap, TInt aStatus ); + void HandleImageCaptureEvent( MCameraBuffer* aBitmap, TInt aStatus ); + void HandleImageCaptureEventL( MCameraBuffer*& aCameraBuffer ); + void HandleSnapshotEvent( TInt aStatus ); + void HandleSnapshotEventL( TBool aIgnore = EFalse ); + + void HandleVideoEvent( const TCamCameraEventId& aEventId, + TInt aStatus ); + + void HandleVideoTimeEvent( TInt aStatus, + TTimeIntervalMicroSeconds aTimeElapsed, + TTimeIntervalMicroSeconds aTimeRemaining ); + + void HandleAutoFocusEvent( TInt aStatus, + const TUid& aEventUid ); + + void HandleFlashStatusEvent( TInt aStatus, + const TCamCameraEventId& aEventId ); + + void HandleCallbackEvent( + TInt aStatus, + const TCamCameraEventId& aEventId, + const TCamCameraEventClassId& aEventClass, + TAny* aEventData = NULL ); + + // ------------------------------------------------------- + // Helper methods + + void ReleaseCurrentCamera(); + void ReleaseCustomInterfaces(); + + TBool HasCallback( const TCamCameraRequestId& aType ); + + TBool CurrentSettingHasCallback(); + + /** + * Sets viewfinder window ordinal position so that the window is visible. + * Window needs to visible when viewfinder is started. In addition, + * ordinal position can be set as a parameter, if original position needs to + * be returned back. + * @since S60 5.0 + * @param aOrdinalPosition,viewfinder window ordinal position to set + * @return TInt, DSA viewfinder window ordinal position or KErrUnknown + */ + TInt SetVfWindowOrdinal( TInt aOrdinalPosition = KErrUnknown ); + + + // ------------------------------------------------------- + // Notification of observers + + void NotifyObservers( TInt aStatus, + TCamCameraEventId aEventId, + TCamCameraEventClassId aEventClass, + TAny* aEventData = NULL ); + + + + // ------------------------------------------------------- + // Getters for info on current camera + + TInt GetResolutionIndexL( CCamera::TFormat& aFormat, + const TSize& aSize ); +#ifdef CAMERAAPP_CAPI_V2_ADV + /** + * Get info related to advanced settings. + */ + void GetAdvancedSettingsInfoL(); + + /** + * Get closest supported EV compensation step to the given value. + * @aEvProposedStep The step for which the closest supported one + * is asked. + * @return Closest supported step to the given proposed step. + * Always 0 if no supported EV steps available. + */ + TInt ResolveEvStep( TInt aEvProposedStep ) const; + + /** + * Helper method to check whether the given value is supported, + * based on the value array and value info. + * Depending on aValueInfo content, the aValueList may represent + * the supported values in completely different ways. This + * method is used to help determining if single value is supported + * or not. + * @param aValue The value to be checked if it's supported. + * @param aValueList Array describing the supported values. Actual meaning + * depends on aValueInfo value. + * @param aValueInfo Enumeration value describing the meaning of values in + * aValueList array. + * @see TValueInfo + */ + static TBool IsSupportedValue( const TInt& aValue, + const RArray& aValueList, + const TValueInfo& aValueInfo ); + +#endif // CAMERAAPP_CAPI_V2_ADV + + /** + * Resolve the snapshot format to be used based on supported formats + * and the given preferred format. + * + * @aPreferredFormat Format to be preferably used, if available. + * @leave KErrNotSupported No acceptable formats are supported. + * @leave KErrNotReady Snapshot provider not available. + * @return Best supported snapshot format. + */ + CCamera::TFormat ResolveSnapshotFormatL( CCamera::TFormat aPreferredFormat ) const; + + + // ------------------------------------------------------- + // Conversion methods between requests, events and event classes + + static TCamCameraEventId Request2Event( const TCamCameraRequestId& aType ); + + static TCamCameraEventClassId EventClass( const TCamCameraEventId& aEventId ); + + // Comparison function for searching for a matching resolution in + // an RArray + static TBool CompareSize( const TSize& aA, const TSize& aB ); + + // ------------------------------------------------------- + // Camera / engine construction + + CCaeEngine* NewCaeEngineL( TInt aCameraIndex ); + + CAMERA* NewCameraL( TInt aCameraIndex ); + + CAMERA* NewDuplicateCameraL( TInt aCameraHandle ); + + // ------------------------------------------------------- + // Private constructors + private: + + void ConstructL( TInt aCameraIndex ); + + CCamCameraController( MCamSettingProvider& aProvider, + CCamAppController& aAppController ); + + // ------------------------------------------------------- + // Prints for debug builds +#ifdef _DEBUG + private: + + void PrintCameraInfo() const; + + #ifdef CAMERAAPP_CAPI_V2_ADV + void PrintAdvancedSettingInfo() const; + #endif // CAMERAAPP_CAPI_V2_ADV + + void PrintSnapshotInfo() const; + +#endif // _DEBUG + + + void SetFaceTrackingL(); + + + // ======================================================= + // Data + private: + + // ------------------------------------------------------- + // Request queue and related + TInt iSequenceIndex; + RCamRequestArray iSequenceArray; + + TInt iReserveTryAgainCount; + + // ------------------------------------------------------- + // Settings queue and related + TInt iSettingIndex; + RArray iSettingArray; + + MCamSettingProvider& iSettingProvider; /** Entity providing settings. */ + + // ------------------------------------------------------- + // Active object thriving our asynchronous processes. + + CCamCameraControllerActive* iActive; /** Own. */ + + // ------------------------------------------------------- + // Observers and their interests + + RPointerArray iObservers; /** Array of observers. Observers not own. */ + RArray iObserverInterests; /** Array of observer interests */ + + + // ------------------------------------------------------- + // Info containers + TCameraInfo iCameraInfo; /** Camera details */ + TCamControllerInfo iInfo; /** Our own details */ + + TCamCameraResolutionSupport iResolutionSupport; /** Supported resolutions info */ +#ifdef CAMERAAPP_CAPI_V2_ADV + TCamAdvancedSettingInfo iAdvancedSettingInfo; /** Info related to advanced settings */ +#endif + + TBool iAlternateFormatInUse; /** Encode jpeg from bitmap internally */ + + // ------------------------------------------------------- + // ECam + CAMERA* iCamera; /** Onboard camera instance. Own. */ + TBool iReleasedByUi; /** Flag to distinguish own and external */ + /** camera release. */ + +#ifdef CAMERAAPP_CAPI_V2 + #ifdef CAMERAAPP_CAPI_V2_DVF + CCamera::CCameraDirectViewFinder* iDirectViewfinder; /** Direct viewfinder. Own. */ + #endif + #ifdef CAMERAAPP_CAPI_V2_OL + CCamera::CCameraOverlay* iOverlayProvider; /** Overlay provider. Own. */ + #endif + #ifdef CAMERAAPP_CAPI_V2_ADV + CCamera::CCameraAdvancedSettings* iAdvancedSettings; /** Advanced settings instance. Own. */ + #endif + #ifdef CAMERAAPP_CAPI_V2_HG + CCamera::CCameraHistogram* iHistogramProvider; /** Histogram provider. Own. */ + #endif + #ifdef CAMERAAPP_CAPI_V2_IP + CCamera::CCameraImageProcessing* iImageProcessor; /** Image processor. Own. */ + #endif +#endif + + CCamSnapshotProvider* iSnapshotProvider; + + CCamImageEncoder* iEncoder; + + MCameraOrientation* iCustomInterfaceOrientation; /** Not own. */ + + MCameraFaceTracking* iCustomInterfaceFaceTracking; /** Not own. */ + + MCameraUIOrientationOverride* iCustomInterfaceUIOrientationOverride; /** Not own. */ + + // ------------------------------------------------------- + // CAE +#ifdef CAMERAAPP_CAE_FOR_VIDEO + + CCaeEngine* iCaeEngine; /** Camera app engine for video. Own. */ + TCamVideoRecordingTimes iVideoTimes; + TBool iAsyncVideoStopModeSupported; + + #ifdef CAMERAAPP_CAE_FIX + /** + * Workaround for changing between video (CCaeEngine) and image (CCamera) modes + * Without the support for camera handle sharing in CAE. + */ + + TBool iCaeInUse; + + TInt ProceedModeSwitch(); + TInt DoProceedModeSwitchL(); + + enum TCamModeChange + { + ECamModeChangeInactive, + ECamModeChangeVideo2Image, + ECamModeChangeImage2Video + }; + enum TCamModeChangePhase + { + ECamModeChangePhaseIdle, + ECamModeChangePhase0, + ECamModeChangePhase1, + ECamModeChangePhase2, + ECamModeChangePhase3, + ECamModeChangePhase4 + }; + + TCamModeChange iModeChange; + TInt iModeChangePhase; // TCamModeChangePhase + TInt iModeChangeStatus; + #endif // CAMERAAPP_CAE_FIX +#endif + + // This bool is used to determine whether current event is the first or second one. + TBool iFirstAfEventReceived; + + // This bool is used to determine whether AF operation is started + TBool iAfInProgress; + + // This bool is used to determine whether HyperFocal needs to be set + TBool iAfHyperfocalPending; + + // ------------------------------------------------------- + // Flash simulation +#ifdef CAMERAAPP_FLASH_SIMULATOR + CCamFlashSimulator* iFlashSimulator; +#endif + + // ------------------------------------------------------- + // CAE error simulation +#ifdef CAMERAAPP_CAE_ERR_SIMULATION + // Timer for delaying callbacks to simulate difficult/erroneous situations + CCamTimer* iCallbackTimer; + + TCamCameraEventId iSimEventId; + TInt iSimStatus; + + static TInt DelayedCaeCallback( TAny* aController ); + + void CallAppropriateCallback( const TCamCameraEventId aEventId = ECamCameraEventNone, + TInt aStatus = 0 ); + +#endif // CAMERAAPP_CAE_ERR_SIMULATION + + // ------------------------------------------------------- + + // ------------------------------------------------------- + // Performance logging related +#ifdef CAMERAAPP_PERFORMANCE_CONTROLLER + public: + const CCamPerformanceLogger* PerformanceLogger() const; + + private: + CCamPerformanceLogger* iPerformanceLogger; + TBool iFirstVfFrameReceived; +#endif // CAMERAAPP_PERFORMANCE_CONTROLLER + // ------------------------------------------------------- + + public: + void SetBurstImagesRemaining( TInt aBurstImagesRemaining ); + TBool AsyncVideoStopModeSupported(); + + + /** + * Used to recover lost resources. + * + * @param aSelf pointer to CCamCameraController object + * @return N/A + */ + static TInt IdleCallback( TAny* aSelf ); + + /** + * Helper method for IdleCallback + */ + void DoIveRecovery(); + + /** + * Indicates resource recovery state. + * @return TBool, ETrue if resource recovering is initated + */ + TBool IsWaitingIveResources(); + + private: + TInt iBurstImagesRemaining; + + // not own + RWindowBase* iViewfinderWindow; + CIdle* iIdle; + + // Counts how many times lost resources are tried to recover + // (KIveRecoveryCountMax). + TInt iIveRecoveryCount; + TBool iIveRecoveryOngoing; + + CCamAppController& iAppController; + TInt iCurrentCameraIndex; + + }; + +#endif // CAM_CAMERACONTROLLER_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camcameracontroller.pan --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camcameracontroller.pan Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera controller panics +* +*/ + + +#ifndef CAM_CAMERACONTROLLER_PAN +#define CAM_CAMERACONTROLLER_PAN + +namespace NCamCameraController + { + _LIT( KCamControllerName, "Camera controller" ); + + /** Camera controller panic codes */ + enum TCamCameraControllerPanics + { + ECamNullPointer = 100, + ECamCameraControllerBusy, + ECamCameraControllerCorrupt, + ECamCameraControllerUnknownRequest, + ECamCameraControllerUnknownEvent, + ECamCameraControllerUnsupported, + ECamCameraControllerCaeUnsupported, + + ECamCameraControllerUnrecovableError, + + ECamCameraControllerPanicCount + }; + + /** Helper method to raise panic */ + inline void Panic( TCamCameraControllerPanics aReason ) + { + User::Panic( KCamControllerName, aReason ); + } + } + +#endif CAM_CAMERACONTROLLER_PAN + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camcameracontrolleractive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camcameracontrolleractive.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CCamCameraControllerActive class declaration. +* This class presents an active object used to call back +* CCamCameraController methods. This is done to keep clients +* not blocked when issuing a request or sequence of requests. +* +* +*/ + + +#ifndef CAM_CAMERACONTROLLERACTIVE_H +#define CAM_CAMERACONTROLLERACTIVE_H + +// =========================================================================== +// Included headers + +#include + + +// =========================================================================== +// Forward declarations + +class CCamCameraController; + + +// =========================================================================== +// Classes + +/** +* Camera controller active object. +* +* Used to assist on asynchronising CCamCameraController requests. +* +*/ +class CCamCameraControllerActive : public CActive + { + // ========================================================================= + // Methods + + // ------------------------------------------------------------------------- + // Constructor(s) and destructor + public: + + /** + * Static 2 phase constructor. + * @param aController Camera controller, which callbacks will be called. + * @param aPriority This active object's priority. + */ + static CCamCameraControllerActive* NewL( CCamCameraController& aController, TInt aPriority ); + + /** + * Destructor. + */ + virtual ~CCamCameraControllerActive(); + + private: + + /** + * Standard Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * Standard C++ constructor. + */ + CCamCameraControllerActive( CCamCameraController& aController, + TInt aPriority ); + + // ------------------------------------------------------------------------- + // from CActive + protected: + + /** + * Reacts to CActive::Cancel, if this AO was active. + * @see See CActive for more info. + */ + virtual void DoCancel(); + + /** + * Calls CCamCameraController::ProcessNextRequestL. If leave occurs there, + * RunError will be called by CActiveScheduler. Checks the return value of + * CCamCameraController::ProcessNextRequestL and if it is not zero, sets this + * AO ready for new iteration. + * @see See CActive for more info. + */ + virtual void RunL(); + + /** + * Called if a leave occurs in RunL. + * @param aError Leave code from RunL. + * @return Always KErrNone. + * @see See CActive for more info. + */ + virtual TInt RunError( TInt aError ); + + // ------------------------------------------------------------------------- + // New methods. + public: + + /** + * Sets this Active Object to ActiveScheduler's queue. + * RunL calls back CCamCameraController::ProcessNextRequestL. + * If the return value is not zero, this AO will be scheduled to run again. + * Otherwise new call to IssueRequest is needed. + * If leave occurs in RunL, RunError calls CCameraController::EndSequence. + */ + void IssueRequest(); + + private: + + /** + * Stop the sequence handling on error. + * Calls CCameraController::EndSequence. + */ + void HandleError( TInt aStatus ); + + // ========================================================================= + // Data + private: + + /** + * Camera controller, which callbacks will be called. + */ + CCamCameraController& iController; + + // ========================================================================= + }; + +#endif // CAM_CAMERACONTROLLERACTIVE_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camcameracontrollerflags.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camcameracontrollerflags.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build flags concerning Camera Controller +* +*/ + + +#ifndef CAM_CAMERACONTROLLERFLAGS_H +#define CAM_CAMERACONTROLLERFLAGS_H + +// =========================================================================== + +#if ( defined(__WINSCW__) || defined(__WINS__) || defined(WINSCW) || defined(WINS) ) + #define CAMERAAPP_EMULATOR_BUILD +#endif + + +// --------------------------------------------------------- +// In emulator build need to emulate CCamera +#ifdef CAMERAAPP_EMULATOR_BUILD + #define CAMERAAPP_CAPI_EMULATOR +#endif + +// --------------------------------------------------------- +// Camera API details +// +// CAMERAAPP_CAPI_V2 : ECam Camera API v2 support. +// Use MCameraObserver2 interface, +// New2L and New2DuplicateL +// +// CAMERAAPP_CAPI_V2_SS : ECam snapshot support +// (CCameraSnapshot). +// +// CAMERAAPP_CAPI_V2_ADV : ECam advanced settings support +// (CCameraAdvancedSettings). +// +// CAMERAAPP_CAPI_V2_DVF : ECam direct viewfinding support +// (CCameraDirectViewFinder). +// +// CAMERAAPP_CAPI_V2_OL : ECam overlays support (CCameraOverlay). +// Should be defined if direct vf enabled. +// +// CAMERAAPP_CAPI_V2_IP : ECam image processing support +// (CCameraImageProcessing). +// + + +// Camera API v2 +#if! defined( CAMERAAPP_CAPI_EMULATOR ) + // Emulator does not have implementation for new ECam classes. + // Only define CAPI v2 for hw. + + #define CAMERAAPP_CAPI_V2 + +#endif + +// These should only be enabled if Camera API v2 is in use. +#ifdef CAMERAAPP_CAPI_V2 + + // Snapshot -------------------------- + #define CAMERAAPP_CAPI_V2_SS + + // Advanced settings ----------------- + #define CAMERAAPP_CAPI_V2_ADV + + // Image processing ------------------ + #ifdef CAMERAAPP_CAPI_V2_ADV + #define CAMERAAPP_CAPI_V2_IP + #endif + + // Direct viewfinder ----------------- + #define CAMERAAPP_CAPI_V2_DVF + + // Overlays -------------------------- + #ifdef CAMERAAPP_CAPI_V2_DVF + #define CAMERAAPP_CAPI_V2_OL + #endif + + // Histogram ------------------------- + #undef CAMERAAPP_CAPI_V2_HG + +#endif + +// Flash simulation +// - need Advanced settings +#ifdef CAMERAAPP_CAPI_V2_ADV + #undef CAMERAAPP_FLASH_SIMULATOR +#endif + +// --------------------------------------------------------- +// CAE flags: +// +// CAMERAAPP_CAE_FOR_VIDEO : CCaeEngine is used for video recording +// CAMERAAPP_CAE_FIX : Release CCamera before using CCaeEngine +// and vice versa. +#define CAMERAAPP_CAE_FOR_VIDEO +#ifdef CAMERAAPP_CAE_FOR_VIDEO + +#ifdef CAMERAAPP_EMULATOR_BUILD + #define CAMERAAPP_CAE_FIX +#else + #undef CAMERAAPP_CAE_FIX +#endif + +#endif // CAMERAAPP_CAE_FOR_VIDEO +// --------------------------------------------------------- + + + +// --------------------------------------------------------- +// Performance tests flags +// +// CAMERAAPP_PERFORMANCE_CONTROLLER : Enable measuring time for +// Camera Controller operations. +#ifdef _DEBUG + #define CAMERAAPP_PERFORMANCE_CONTROLLER +#endif +// --------------------------------------------------------- + + +// moved from camproductvariant.h to here. +// For simulating errors & delays in CAE callbacks +#undef CAMERAAPP_CAE_ERR_SIMULATION + +// =========================================================================== +#endif + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camcameracontrollersettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camcameracontrollersettings.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,331 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera controller setting ids and associated data types. +* +*/ + + +#ifndef CAM_CAMERACONTROLLERSETTINGS_H +#define CAM_CAMERACONTROLLERSETTINGS_H + +#include // Data types (CCamera::TFormat etc) +#include // Data types + +// =========================================================================== +// Definitions + +namespace NCamCameraController + { + // ======================================================= + // Settings and parameters needed by Camera Controller from Setting Provider. + // These are the keys by which Camera Controller requests the value. + // + // The comments list + // [meaning of setting][expected setting data type] + // + + // ------------------------------------------------------- + // Camera parameter ids and related data types + enum TCamCameraParamId + { + ECameraParamNone, + + ECameraParamImage, // [ Image init parameters ] [ TPckgBuf ] + + ECameraParamVfMode, // [ Viewfinder mode ] [ TPckgBuf ] + ECameraParamVfBitmap, // [ Bitmap vf parameters ] [ TPckgBuf ] + ECameraParamVfDirect, // [ Direct vf parameters ] [ TPckgBuf ] + + ECameraParamSnapshot, // [ Snapshot parameters ] [ TPckgBuf ] + + ECameraParamVideoCae, // [ CCaeEngine video parameters ] [ TPckgBuf ] + + // NOTE: As the name of the enum below suggests, + // ADD ALL NEW PARAMETER IDS ABOVE THIS COMMENT! + // Remember also to add the name of the item to + // the KCameraParamNames array of debug strings. + ECameraParamCount + }; + + + /** + * Camera image parameters + */ + class TCamParamsImage + { + public: + TCamParamsImage() + : iFormat( CCamera::EFormatExif ), + iSize ( ), + iQualityFactor( 100 ) {}; + + public: + + CCamera::TFormat iFormat; + TSize iSize; + TInt iQualityFactor; + }; + + /** + * Camera bitmap viewfinder setting data + */ + class TCamParamsVfBitmap + { + public: + TCamParamsVfBitmap() + : iFormat( CCamera::EFormatFbsBitmapColor16M ), + iRect(), + iMirrorImage (EFalse) + { + } + + public: + CCamera::TFormat iFormat; + TRect iRect; + + TBool iMirrorImage; + }; + + /** + * Camera direct viewfinder setting data + */ + class TCamParamsVfDirect + { + public: + TCamParamsVfDirect() + : iWindowServer ( NULL ), + iScreenDevice ( NULL ), + iWindow ( NULL ), + iScreenRect ( NULL ) {}; + + public: + RWsSession* iWindowServer; + CWsScreenDevice* iScreenDevice; + RWindowBase* iWindow; + TRect* iScreenRect; + }; + + /** + * Camera snapshot setting data + */ + class TCamParamsSnapshot + { + public: + TCamParamsSnapshot() + : iSize(), + iFormat( CCamera::EFormatFbsBitmapColor16M ), + iMaintainAspect( EFalse ) {}; + + public: + TSize iSize; + CCamera::TFormat iFormat; + TBool iMaintainAspect; + }; + + + /** + * Camera video quality setting data + */ + class TCamParamsVideoCae + { + public: + TCamParamsVideoCae() + : iFrameSize ( /*empty*/ ), + iFrameRate ( 0 ), + iVideoBitRate( 0 ), + iAudioBitRate( 0 ), + iAudioOn ( ETrue ), + iMimeType ( KNullDesC8 ), + iSupplier ( KNullDesC ), + iVideoType ( KNullDesC8 ), + iAudioType ( KNullDesC8 ) {}; + + public: + TSize iFrameSize; + TReal32 iFrameRate; + TInt iVideoBitRate; + TInt iAudioBitRate; + TBool iAudioOn; + TPtrC8 iMimeType; + TPtrC iSupplier; + TPtrC8 iVideoType; + TPtrC8 iAudioType; + }; + + // ------------------------------------------------------- + // Camera setting ids and related data types + + enum TCamCameraSettingId + { + ECameraSettingNone, + + ECameraSettingQualityFactor, // [ (image) quality factor ] [ TInt {0..100} ] + + ECameraSettingFlash, // [ flash ] [ CCamera::TFlash ] + ECameraSettingExposure, // [ Exposure ] [ TPckgBuf ] + ECameraSettingLightSensitivity, // [ ISO ] [ TInt (ISO value) ] + ECameraSettingWhiteBalance, // [ WB ] [ TPckgBuf ] + ECameraSettingColourEffect, // [ colour effect ] [ CCamera::CCameraImageProcessing::TEffect ] + ECameraSettingBrightness, // [ brightness ] [ CCamera::TBrightness ] + ECameraSettingContrast, // [ contrast ] [ CCamera::TContrast ] + ECameraSettingSharpness, // [ sharpness ] [ TInt (contrast adjustment value) ] + + ECameraUserSceneSettingFlash, // [ flash ] [ CCamera::TFlash ] + ECameraUserSceneSettingExposure, // [ Exposure ] [ TPckgBuf ] + ECameraUserSceneSettingLightSensitivity, // [ ISO ] [ TInt (ISO value) ] + ECameraUserSceneSettingWhiteBalance, // [ WB ] [ TPckgBuf ] + ECameraUserSceneSettingColourEffect, // [ colour effect ] [ CCamera::CCameraImageProcessing::TEffect ] + ECameraUserSceneSettingBrightness, // [ brightness ] [ CCamera::TBrightness ] + ECameraUserSceneSettingContrast, // [ contrast ] [ CCamera::TContrast ] + ECameraUserSceneSettingSharpness, // [ sharpness ] [ TInt (contrast adjustment value) ] + + ECameraSettingDigitalZoom, // [ digital zoom ] [ TInt (zoom step) ] + ECameraSettingOpticalZoom, // [ optical zoom ] [ TInt (zoom step) ] + + ECameraSettingFocusRange, // [ focus range ] [ CCamera::CCameraAdvancedSettings::TFocusRange ] + + ECameraSettingStabilization, // [ stabilization mode ] [ TPckgBuf ] + ECameraSettingFlickerCancel, // [ flicker cancellation ] [ MCameraFlickerCancellation::TFlickerCancellation ] + ECameraSettingOrientation, // [ device orientation ] [ MCameraOrientation::TOrientation ] + + ECameraSettingAudioMute, // [ (video) audio muting ] [ TBool (ETrue => muted) ] + ECameraSettingContAF, // [ (video) continuous AF ] [ TBool (ETrue => on) ] + ECameraSettingFileMaxSize, // [ (video) max file size ] [ TInt (bytes) ] + ECameraSettingFileName, // [ (video) file name ] [ TPtr ] + + ECameraSettingCaptureLimit, // [ (image) capture limit ] [ TInt (amount of images requested) ] + + ECameraSettingFacetracking, // [ (still) facetracking ] [ TBool (ETrue => facetracking on) ] + + // NOTE: As the name of the enum below suggests, + // ADD ALL NEW SETTING IDS ABOVE THIS COMMENT! + // Remember also to add the name of the item to + // the KCameraSettingNames array of debug strings. + ECameraSettingCount + }; + + + /** + * Exposure compensation setting data + */ + class TCamSettingDataExposure + { + public: + TCamSettingDataExposure() + : iExposureMode( CCamera::EExposureAuto ), + iExposureStep( 0 ) {}; + + public: + CCamera::TExposure iExposureMode; + // EV compensation step times KECamFineResolutionFactor. + // For example EV = 0.7, KECamFineResolutionFactor = 100 + // => this value should be 70 + TInt iExposureStep; + }; + + /** + * White balance setting data + */ + class TCamSettingDataWhiteBalance + { + public: + TCamSettingDataWhiteBalance() + : iWhiteBalanceMode( CCamera::EWBAuto ) {}; + + public: + CCamera::TWhiteBalance iWhiteBalanceMode; + }; + + /** + * Stabilization setting data + */ + class TCamSettingDataStabilization + { + protected: + typedef CCamera::CCameraAdvancedSettings CAS; + + public: + + TCamSettingDataStabilization() + : iMode ( CAS::EStabilizationModeOff ), + iEffect ( CAS::EStabilizationOff ), + iComplexity( CAS::EStabilizationComplexityAuto ) {}; + + public: + + CAS::TStabilizationMode iMode; + CAS::TStabilizationEffect iEffect; + CAS::TStabilizationAlgorithmComplexity iComplexity; + }; + + + + + // ------------------------------------------------------- +#ifdef _DEBUG +const TUint16* const KCameraParamNames[] = + { + (const TUint16* const)_S16("ECameraParamNone"), + (const TUint16* const)_S16("ECameraParamImage"), + (const TUint16* const)_S16("ECameraParamVfMode"), + (const TUint16* const)_S16("ECameraParamVfBitmap"), + (const TUint16* const)_S16("ECameraParamVfDirect"), + (const TUint16* const)_S16("ECameraParamSnapshot"), + (const TUint16* const)_S16("ECameraParamVideoCae") + }; +__ASSERT_COMPILE( (sizeof(KCameraParamNames)/sizeof(TUint16*)) == ECameraParamCount ); + +const TUint16* const KCameraSettingNames[] = + { + (const TUint16* const)_S16("ECameraSettingNone"), + (const TUint16* const)_S16("ECameraSettingQualityFactor"), + (const TUint16* const)_S16("ECameraSettingFlash"), + (const TUint16* const)_S16("ECameraSettingExposure"), + (const TUint16* const)_S16("ECameraSettingLightSensitivity"), + (const TUint16* const)_S16("ECameraSettingWhiteBalance"), + (const TUint16* const)_S16("ECameraSettingColourEffect"), + (const TUint16* const)_S16("ECameraSettingBrightness"), + (const TUint16* const)_S16("ECameraSettingContrast"), + (const TUint16* const)_S16("ECameraSettingSharpness"), + (const TUint16* const)_S16("ECameraUserSceneSettingFlash"), + (const TUint16* const)_S16("ECameraUserSceneSettingExposure"), + (const TUint16* const)_S16("ECameraUserSceneSettingLightSensitivity"), + (const TUint16* const)_S16("ECameraUserSceneSettingWhiteBalance"), + (const TUint16* const)_S16("ECameraUserSceneSettingColourEffect"), + (const TUint16* const)_S16("ECameraUserSceneSettingBrightness"), + (const TUint16* const)_S16("ECameraUserSceneSettingContrast"), + (const TUint16* const)_S16("ECameraUserSceneSettingSharpness"), + (const TUint16* const)_S16("ECameraSettingDigitalZoom"), + (const TUint16* const)_S16("ECameraSettingOpticalZoom"), + (const TUint16* const)_S16("ECameraSettingFocusRange"), + (const TUint16* const)_S16("ECameraSettingStabilization"), + (const TUint16* const)_S16("ECameraSettingFlickerCancel"), + (const TUint16* const)_S16("ECameraSettingOrientation"), + (const TUint16* const)_S16("ECameraSettingAudioMute"), + (const TUint16* const)_S16("ECameraSettingContAF"), + (const TUint16* const)_S16("ECameraSettingFileMaxSize"), + (const TUint16* const)_S16("ECameraSettingFileName"), + (const TUint16* const)_S16("ECameraSettingCaptureLimit"), + (const TUint16* const)_S16("ECameraSettingFacetracking") + }; +__ASSERT_COMPILE( (sizeof(KCameraSettingNames)/sizeof(TUint16*)) == ECameraSettingCount ); + +#endif + // ------------------------------------------------------- + } // namespace + +// =========================================================================== +#endif // CAM_CAMERACONTROLLERSETTINGS_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camcameracontrollertypes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camcameracontrollertypes.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,281 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Data type definitions for Camera Controller. +* +*/ + + +#ifndef CAM_CONTROLLERTYPES_H +#define CAM_CONTROLLERTYPES_H + +#include "camcameracontrollerflags.hrh" +#include "camcamerarequests.h" +#ifdef CAMERAAPP_CAPI_V2_ADV + #include +#endif + +// Max video recording time is 1:29:59 +// To be moved to a separate constants header. +const TInt64 KMaxRecordingLength = MAKE_TINT64( 1, 0x41CE33C0 ); + +typedef RArray RCamRequestArray; + + +enum TCamCameraStateFlags + { + ECamIdle = 0, + ECamReserved = 1<<0, + ECamPowerOn = 1<<1, + ECamVFOn = 1<<2, + ECamImageOn = 1<<3, + ECamVideoOn = 1<<4 +// ECamCaptureOn = 1<<5 + }; + +enum TCamCameraCaptureState + { + ECamCaptureOff, + ECamCaptureOn, + ECamCapturePaused + }; + +enum TCamCameraTriState + { + ECamTriIdle, + ECamTriInactive, + ECamTriActive + }; + +enum TCamCameraReadyState + { + ECamUnknown, + ECamNotReady, + ECamReady + }; + +enum TCamViewfinderMode + { + ECamViewfinderNone, + ECamViewfinderBitmap, + ECamViewfinderDirect + }; + +enum TCamCameraControllerBusyFlags + { + ECamBusyOff = 0, + ECamBusySequence = 1, + ECamBusySingle = 2, + ECamBusySetting = 4 + }; + +class TCamVideoRecordingTimes + { + public: + TTimeIntervalMicroSeconds iTimeElapsed; + TTimeIntervalMicroSeconds iTimeRemaining; + }; + + +/** +* Camera controller information +*/ +class TCamControllerInfo + { + // =================================== + public: + + TCamControllerInfo(); + + void Reset( TBool aPreserveBusyFlag = EFalse, + TBool aPreserveCameraIndex = EFalse ); + + void PrintInfo() const; + + // =================================== + // Data + public: + + /** + * Current camera index + */ + TInt iCurrentCamera; + + /** + * Controller overall state. + * TCamCameraStateFlags ORed. + */ + TUint iState; + + /** + * Current state of capturing image or video. + */ + TCamCameraCaptureState iCaptureState; //< Is capture on, off or paused + TInt iCaptureLimit; //< Amount of captures (images) requested + TInt iCaptureCount; //< Amount of captures (images) received + TInt iSnapshotCount; //< Amount of snapshots (images) received + + /** + * Viewfinder details + */ + TCamViewfinderMode iVfMode; + TCamCameraTriState iVfState; + TSize iViewfinderSize; + CCamera::TFormat iViewfinderFormat; + + /** + * Snapshot details + */ + TCamCameraTriState iSsState; + TSize iSnapshotSize; + CCamera::TFormat iSnapshotFormat; + TBool iSnapshotAspectMaintain; + +#ifdef CAMERAAPP_CAPI_V2_ADV + /** + * Autofocus range + */ + CCamera::CCameraAdvancedSettings::TFocusRange iCurrentFocusRange; +#endif // CAMERAAPP_CAPI_V2_ADV + + + /** + * Is controller busy handling requests? + * New requests can not be issued if this is not EBusyOff. + * CancelSequence and CancelRequest can still be used. + */ + TUint iBusy; + + // =================================== + }; + + +#ifdef CAMERAAPP_CAPI_V2_ADV +/** +* Information on advanced settings. +* (These use CCameraAdvancedSettings.) +* +*/ +class TCamAdvancedSettingInfo + { + // =================================== + public: + + TCamAdvancedSettingInfo(); + ~TCamAdvancedSettingInfo(); + + void Reset(); + void PrintInfo() const; + + // =================================== + // Data + // + // NOTE: Remember to modify Reset() if members are added. + public: + + // Camera index which this info matches + TInt iForCameraIndex; + + // Exposure compenstion support + TInt iEvModesSupport; + RArray iEvStepsSupport; + TValueInfo iEvStepsValueInfo; + + // ISO rate support + RArray iIsoRatesSupport; + + // Digital zoom steps support + RArray iDigitalZoomSupport; + TValueInfo iDigitalZoomValueInfo; + +#ifdef CAMERAAPP_CAPI_V2_IP + // Colour fx support + RArray iColourEffectSupport; + TValueInfo iColourEffectValueInfo; + + // Sharpness support + RArray iSharpnessSupport; + TValueInfo iSharpnessValueInfo; +#endif + + // Stabilization support + TInt iStabilizationModeSupport; + TInt iStabilizationEffectSupport; + TInt iStabilizationComplexitySupport; + + // =================================== + }; +#endif // CAMERAAPP_CAPI_V2_ADV + +/** +* Container for CCamera supported resolutions +* for certain camera index and format. +*/ +class TCamCameraResolutionSupport + { + // =================================== + public: + + TCamCameraResolutionSupport(); + ~TCamCameraResolutionSupport(); + + void Reset(); + + // =================================== + // Data + public: + + TInt iForCameraIndex; + TInt iForCameraFormat; + RArray iResolutions; + + // =================================== + }; + + + +// =========================================================================== +// Debug strings +#ifdef _DEBUG +const TUint16* const KCamCameraCaptureStateNames[] = + { + (const TUint16* const)_S16("ECamCaptureOff"), + (const TUint16* const)_S16("ECamCaptureOn"), + (const TUint16* const)_S16("ECamCapturePaused") + }; + +const TUint16* const KCamCameraTriStateNames[] = + { + (const TUint16* const)_S16("ECamTriIdle"), + (const TUint16* const)_S16("ECamTriInactive"), + (const TUint16* const)_S16("ECamTriActive") + }; + +const TUint16* const KCamCameraReadyStateNames[] = + { + (const TUint16* const)_S16("ECamUnknown"), + (const TUint16* const)_S16("ECamNotReady"), + (const TUint16* const)_S16("ECamReady") + }; + +const TUint16* const KCamViewfinderModeNames[] = + { + (const TUint16* const)_S16("ECamViewfinderNone"), + (const TUint16* const)_S16("ECamViewfinderBitmap"), + (const TUint16* const)_S16("ECamViewfinderDirect") + }; +#endif // _DEBUG + +#endif // CAM_CONTROLLERTYPES_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camcameraevents.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camcameraevents.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,208 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera engine controller event ids. +* Used in MCamEngineObserver::HandleCameraEventL callbacks. +* +*/ + + + +#ifndef CAM_CAMERAEVENTS_H +#define CAM_CAMERAEVENTS_H + + +/** +* Event ids +*/ +enum TCamCameraEventId + { + ECamCameraEventNone, // Not an event id, but a marker. + + // ------------------------------------------------------- + // Events of class ECamCameraEventClassBasicControl + + // If controller is given a sequence of requests, + // this event notifies that the full sequence is completed, + // and client may issue more requests. + ECamCameraEventSequenceEnd, + + ECamCameraEventReserveGain, + ECamCameraEventReserveLose, + + ECamCameraEventPowerOn, + ECamCameraEventPowerOff, + ECamCameraEventIveRecover, + ECamCameraEventPowerOnRequested, + + // ------------------------------------------------------- + // Events of class ECamCameraEventClassViewfinder + ECamCameraEventVfStart, + ECamCameraEventVfStop, + ECamCameraEventVfRelease, + // ------------------------------------------------------- + // Event of class ECamCameraEventClassVfData + // Associated event data for ECamCameraEventViewfinderFrameReady is the VF frame in CFbsBitmap. + ECamCameraEventVfFrameReady, + // ------------------------------------------------------- + // Events of class ECamCameraEventClassSnapshot + ECamCameraEventSsStart, + ECamCameraEventSsStop, + ECamCameraEventSsRelease, + // ------------------------------------------------------- + // Event of class ECamCameraEventClassSsData + // Associated event data for ECamCameraEventSnapshotReady is the snapshot in CFbsBitmap. + ECamCameraEventSsReady, + // ------------------------------------------------------- + // Events of class ECamCameraEventClassStillCapture + ECamCameraEventImageInit, + ECamCameraEventImageStart, // Capture started + ECamCameraEventImageStop, // Capture stopped (normally or by cancel request) + ECamCameraEventImageRelease, + + // Associated event data for ECamCameraEventImageData is CCamBufferShare pointer. + // May be null, if errors occurred. + ECamCameraEventImageData, + + // ------------------------------------------------------- + // Events of class ECamCameraEventClassVideo + ECamCameraEventVideoInit, + ECamCameraEventVideoStart, + ECamCameraEventVideoPause, + ECamCameraEventVideoAsyncStop, + ECamCameraEventVideoStop, + ECamCameraEventVideoRelease, + // ------------------------------------------------------- + // Events of class ECamCameraEventClassVideoTimes + ECamCameraEventVideoTimes, + + // ------------------------------------------------------- + // Events of class ECamCameraEventClassSettings + + // Associated event data is TCamCameraSettingId of the + // setting that was processed. + ECamCameraEventSettingsSingle, + // Associated event data is TCamCameraSettingId of the + // last setting that was processed. + ECamCameraEventSettingsDone, + + // ------------------------------------------------------- + // Events of class ECamCameraEventClassAutofocus + ECamCameraEventStartAutofocus, + ECamCameraEventCancelAutofocus, + ECamCameraEventAutofocusSuccessful, + ECamCameraEventAutofocusFailed, + ECamCameraEventSetAfRange, + + // ------------------------------------------------------- + // Events of class ECamCameraEventClassOther + ECamCameraEventFlashReady, + ECamCameraEventFlashNotReady, + + // ------------------------------------------------------- + // Not an event id, but a marker. + ECamCameraEventCount + }; + + +/** +* Camera event classes. +*/ +enum TCamCameraEventClassId + { + ECamCameraEventClassNone = 0, + + ECamCameraEventClassBasicControl = 1<<0, + + ECamCameraEventClassImage = 1<<1, + + ECamCameraEventClassVideo = 1<<2, + ECamCameraEventClassVideoTimes = 1<<3, + + ECamCameraEventClassVfControl = 1<<7, + ECamCameraEventClassVfData = 1<<8, + + ECamCameraEventClassSsControl = 1<<10, + ECamCameraEventClassSsData = 1<<11, + + ECamCameraEventClassSettings = 1<<12, + + ECamCameraEventClassAutofocus = 1<<13, + + ECamCameraEventClassFlashStatus = 1<<14, + + ECamCameraEventClassOther = 1<<30, + + ECamCameraEventClassAll = ~ECamCameraEventClassNone + }; + +#ifdef _DEBUG + +static const TUint16* KCamCameraEventNames[] = + { + (const TUint16*)_S16("ECamCameraEventNone"), + + (const TUint16*)_S16("ECamCameraEventSequenceEnd"), + + (const TUint16*)_S16("ECamCameraEventReserveGain"), + (const TUint16*)_S16("ECamCameraEventReserveLose"), + (const TUint16*)_S16("ECamCameraEventPowerOn"), + (const TUint16*)_S16("ECamCameraEventPowerOff"), + (const TUint16*)_S16("ECamCameraEventIveRecover"), + (const TUint16*)_S16("ECamCameraEventPowerOnRequested"), + + (const TUint16*)_S16("ECamCameraEventVfStart"), + (const TUint16*)_S16("ECamCameraEventVfStop"), + (const TUint16*)_S16("ECamCameraEventVfRelease"), + (const TUint16*)_S16("ECamCameraEventVfFrameReady"), + + (const TUint16*)_S16("ECamCameraEventSsStart"), + (const TUint16*)_S16("ECamCameraEventSsStop"), + (const TUint16*)_S16("ECamCameraEventSsRelease"), + (const TUint16*)_S16("ECamCameraEventSsReady"), + + (const TUint16*)_S16("ECamCameraEventImageInit"), + (const TUint16*)_S16("ECamCameraEventImageStart"), + (const TUint16*)_S16("ECamCameraEventImageStop"), + (const TUint16*)_S16("ECamCameraEventImageRelease"), + (const TUint16*)_S16("ECamCameraEventImageData"), + + (const TUint16*)_S16("ECamCameraEventVideoInit"), + (const TUint16*)_S16("ECamCameraEventVideoStart"), + (const TUint16*)_S16("ECamCameraEventVideoPause"), + (const TUint16*)_S16("ECamCameraEventVideoAsyncStop"), + (const TUint16*)_S16("ECamCameraEventVideoStop"), + (const TUint16*)_S16("ECamCameraEventVideoRelease"), + (const TUint16*)_S16("ECamCameraEventVideoTimes"), + + (const TUint16*)_S16("ECamCameraEventSettingsSingle"), + (const TUint16*)_S16("ECamCameraEventSettingsDone"), + + (const TUint16*)_S16("ECamCameraEventStartAutofocus"), + (const TUint16*)_S16("ECamCameraEventCancelAutofocus"), + (const TUint16*)_S16("ECamCameraEventAutofocusSuccessful"), + (const TUint16*)_S16("ECamCameraEventAutofocusFailed"), + (const TUint16*)_S16("ECamCameraEventSetAfRange"), + + (const TUint16*)_S16("ECamCameraEventFlashReady"), + (const TUint16*)_S16("ECamCameraEventFlashNotReady") + }; + +__ASSERT_COMPILE( (sizeof(KCamCameraEventNames) / sizeof(TUint16*)) == ECamCameraEventCount ); +#endif + + + +#endif // CAM_CAMERAEVENTS_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camcamerarequests.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camcamerarequests.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + +#ifndef CAM_CAMERAREQUESTS_H +#define CAM_CAMERAREQUESTS_H + +// =========================================================================== + + +/** +* Request identification codes +*/ +enum TCamCameraRequestId + { + ECamRequestNone = 0, + + // If client has issued a sequence of requests to be processed + // by the controller, client must request cancelling the sequence, + // if it wishes to issue other requests before ECamEngineEventSequenceEnd + // has been notified by controller. + ECamRequestCancelSequence, + + ECamRequestReserve, + ECamRequestRelease, + + ECamRequestPowerOn, + ECamRequestPowerOff, + + ECamRequestVfStart, + ECamRequestVfStop, + ECamRequestVfStopEcam, + ECamRequestVfRelease, + + ECamRequestSsStart, + ECamRequestSsStop, + ECamRequestSsRelease, + + ECamRequestImageInit, + ECamRequestImageCapture, + ECamRequestImageCancel, // Cancel capturing image. + ECamRequestImageRelease, + + ECamRequestVideoInit, + ECamRequestVideoStart, + ECamRequestVideoPause, + ECamRequestVideoStop, + ECamRequestVideoRelease, + ECamRequestSetAsyncVideoStopMode, + + ECamRequestStartAutofocus, + ECamRequestCancelAutofocus, + ECamRequestSetAfRange, + +// ECamRequestSettingChange, + + ECamRequestLast // Just marker, keep last. + }; + + +#ifdef _DEBUG +static const TUint16* KCamRequestNames[] = + { + // ECamRequestNone used in performance measurements to mark sequence start and end. + (const TUint16*)_S16("Sequence"), + + (const TUint16*)_S16("Cancel sequence"), + + (const TUint16*)_S16("Reserve"), + (const TUint16*)_S16("Release"), + (const TUint16*)_S16("Power on"), + (const TUint16*)_S16("Power off"), + + (const TUint16*)_S16("Start vf"), + (const TUint16*)_S16("Stop vf"), + (const TUint16*)_S16("Stop vf ecam"), + (const TUint16*)_S16("Release vf"), + + (const TUint16*)_S16("Start snapshot"), + (const TUint16*)_S16("Stop snapshot"), + (const TUint16*)_S16("Release snapshot"), + + (const TUint16*)_S16("Init image"), + (const TUint16*)_S16("Capture image"), + (const TUint16*)_S16("Cancel image"), + (const TUint16*)_S16("Release image"), + + (const TUint16*)_S16("Init video"), + (const TUint16*)_S16("Start video"), + (const TUint16*)_S16("Pause video"), + (const TUint16*)_S16("Stop video"), + (const TUint16*)_S16("Release video"), + (const TUint16*)_S16("Async stop video"), + + (const TUint16*)_S16("Start autofocus"), + (const TUint16*)_S16("Cancel autofocus"), + (const TUint16*)_S16("Set Af range") + + +// , (const TUint16*)_S16("Setting change") + }; + +// Verifying there is a description for all the request ids +__ASSERT_COMPILE( (sizeof(KCamRequestNames) / sizeof(TUint16*)) == ECamRequestLast ); + +#endif // _DEBUG + + +// =========================================================================== +#endif // CAM_CAMERAREQUESTS_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camconstantsettingprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camconstantsettingprovider.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera setting provider, which gives constant settings. +* Used as test version before real setting are queried from +* settings model. +* +*/ + + +#ifndef CAM_CONSTANTSETTINGPROVIDER_H +#define CAM_CONSTANTSETTINGPROVIDER_H + +#include +#include "mcamsettingprovider.h" +#include "mcamsettingsmodelobserver.h" + + +class CCamAppController; + + +class CCamConstantSettingProvider : public CBase, +// public MCamSettingsModelObserver, + public MCamSettingProvider + { + // ========================================================================= + // Constructors and destructor + public: + static CCamConstantSettingProvider* NewL ( CCamAppController& aController ); + static CCamConstantSettingProvider* NewLC( CCamAppController& aController ); + virtual ~CCamConstantSettingProvider(); + + // ------------------------------------------------------------------------- + // From MCamSettingProvider + public: + + virtual void + ProvideCameraParamL( + const NCamCameraController::TCamCameraParamId& aParamId, + TAny* aParamData ); + + virtual void + ProvideCameraSettingL( + const NCamCameraController::TCamCameraSettingId& aSettingId, + TAny* aSettingData ); + + virtual void + ProvidePendingSettingChangesL( + RArray& aSettingIds ); + + virtual TInt PendingSettingChangeCount() const; + + /** + * Set the supported ISO rates. + */ + virtual void SetSupportedISORatesL( const RArray& aSupportedIsoRates ); + + + // ------------------------------------------------------------------------- + // From MCamSettingsModelObserver + public: +/* + virtual void IntegerSettingChangedL( TCamSettingItemIds aSettingItem, + TInt aSettingValue ); + + virtual void TextSettingChangedL( TCamSettingItemIds aSettingItem, + const TDesC& aSettingValue ); +*/ + // ------------------------------------------------------------------------- + // New methods + public: + + /** + * Clear all pending setting changes. + */ + void Reset(); + + /** + * Add an array of pending setting changes. + */ + void AddPendingSettingChangesL( + const RArray& aUiSettingIds ); + + /** + * Add one pending setting change. + */ + void AddPendingSettingChangeL( TCamSettingItemIds aUiSettingId ); + // ------------------------------------------------------------------------- + // Private constructors + private: + + void ConstructL(); + + CCamConstantSettingProvider( CCamAppController& aController ); + + // ========================================================================= + // Data + private: + + CCamAppController& iController; + RArray iPendingSettingChanges; + + RArray iSupportedISORates; + TBool iValidISORates; + + // ========================================================================= + }; + +#endif // CAM_CONSTANTSETTINGPROVIDER_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camdebugutilities.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camdebugutilities.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef CAM_DEBUG_UTILITIES_H +#define CAM_DEBUG_UTILITIES_H + +#include +#include "camtest.rsg" + + +class TCamDebugUtilities + { + public: + + static void ShowMessageDialogL( const TDesC& aTitle, const TDesC& aMessage ) + { + TBuf<1> tmp; // CAknMessageQueryDialog needs some initial value + CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( tmp ); + dlg->PrepareLC( R_CAM_DEBUG_MESSAGE_DLG ); + dlg->QueryHeading()->SetTextL( aTitle ); + dlg->SetMessageText( aMessage ); + dlg->RunLD(); + }; + }; + +#endif \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camfilesaveutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camfilesaveutility.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Help saving buffer of data (e.g. image content) to a file +* with one function call. Used for testing purposes. +* +*/ + + +#ifndef CAM_FILESAVEUTILITY_H +#define CAM_FILESAVEUTILITY_H + + +#include +#include + +#include "camlogging.h" + +namespace NCamCameraController + { + inline void SaveImageDataToFileL( const TDesC8& aData, const TDesC& aFilename ) + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + + RFile file; + CleanupClosePushL( file ); + + TFileName filename; + filename.Append( PathInfo::PhoneMemoryRootPath() ); + filename.Append( PathInfo::ImagesPath() ); + filename.Append( aFilename ); + + PRINT1( _L("CamTest: SaveImageDataToFileL file(%S)"), &filename ); + + User::LeaveIfError( file.Replace( fs, filename, EFileShareExclusive|EFileWrite ) ); + User::LeaveIfError( file.Write( aData ) ); + + CleanupStack::PopAndDestroy( 2 ); // file, fs: Close() + }; + } +#endif // CAM_FILESAVEUTILITY_H + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camflagutility.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camflagutility.inl Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Inline utility methods for flag variables +* +*/ + + +#ifndef CAM_FLAGUTILITY_INL +#define CAM_FLAGUTILITY_INL + + +// =========================================================================== +namespace NCamCameraController + { + inline TBool IsFlagOn( TUint aState, TUint aFlag ) + { + return (aState & aFlag); + }; + + inline TBool IsFlagOff( TUint aState, TUint aFlag ) + { + return !IsFlagOn( aState, aFlag ); + }; + + inline void CheckFlagOnL( TUint aState, TUint aFlag, TInt aLeave ) + { + if( IsFlagOff( aState, aFlag ) ) + { + User::Leave( aLeave ); + } + } + inline void CheckFlagOffL( TUint aState, TUint aFlag, TInt aLeave ) + { + if( IsFlagOn( aState , aFlag ) ) + { + User::Leave( aLeave ); + } + } + + inline void CheckEqualsL( TUint aState, TUint aCheck, TInt aLeave ) + { + if( aState != aCheck ) + { + User::Leave( aLeave ); + } + } + + // SetFlags and ClearFlags defined to aid readability. + // "ClearFlags( flags, someflags )" should be more readable than "flags &= ~someFlags". + // Also using these methods is less error prone. + // Consider "flags &= ~someFlags" changed to "flags &= someFlags" by mistake.. + inline void SetFlags( TUint& aOldFlags, TUint aSetFlags ) + { + aOldFlags |= aSetFlags; + } + + inline void ClearFlags( TUint& aOldFlags, TUint aClearFlags ) + { + aOldFlags &= ~aClearFlags; + } + } + +// =========================================================================== +#endif // CAM_FLAGUTILITY_INL + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camflashsimulator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camflashsimulator.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of CCamFlashSimulator class. +* Simulates flash charging when real implementation +* cannot be used. +* +*/ + +#ifndef CAMFLASHSIMULATOR_H +#define CAMFLASHSIMULATOR_H + +// =========================================================================== +// Includes +#include +#include "mcamcameraobserver.h" + + +// =========================================================================== +// Constants + +// Duration of simulated flash charging delay +// Value: 10 seconds +const TInt KSimulatedChargingTime = 10*1000*1000; // [us] + + +// =========================================================================== +// Forward declarations +class CCamCameraController; + +// =========================================================================== +// Class declarations + +/** +* Flash simulator class +*/ +class CCamFlashSimulator: public CBase, + public MCamCameraObserver + { + public: + + /** + * Two-phased constructor + */ + static CCamFlashSimulator* NewL( CCamCameraController& aController ); + + /** + * Destructor + */ + ~CCamFlashSimulator(); + + public: // From MCamCameraObserver + + virtual void HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData = NULL ); + + public: // Other + + /** + * Set flash requirement status + */ + void SetFlashRequired( TBool aFlashRequired ); + + /** + * Set flash error state + */ + void SetFlashError( TBool aFlashError ); + + /** + * Start recharging of the flash. In case aError is true, + * error flag shall be + * @param aError + */ + void StartRecharging( TBool aError = EFalse ); + + /** + * Is the flash currently being recharged + */ + TBool Recharging(); + + private: + + /** + * Notify Camera Controller of flash status + */ + void NotifyController(); + + /** + * Callback function for recharging timer + * @param aSelf + */ + static TInt RechargeTimerCallback( TAny* aSelf ); + + private: // Constructors + + /** + * C++ default constructor + */ + CCamFlashSimulator( CCamCameraController& aController ); + + /** + * Second phase constructor + */ + void ConstructL(); + + private: + + CCamCameraController& iController; + CPeriodic* iRechargeTimer; + TBool iError; + TBool iFlashRequired; + TBool iFlashReady; + }; + +#endif // CAMFLASHSIMULATOR_H + + \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camimagedecoder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camimagedecoder.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image Decoder class and observer interface. +* +*/ + + +#ifndef CAM_IMAGEDECODER_H +#define CAM_IMAGEDECODER_H + +// =========================================================================== +// Included headers +#include +#include + +// =========================================================================== +// Forward declarations +class CFbsBitmap; +class CImageDecoder; +class MCameraBuffer; +class CCamBufferShare; + + +// =========================================================================== +// Classes + +/** +* Interface for Image Decoder Observers +*/ +class MCamImageDecoderObserver + { + public: + + /** + * Notify observer that the image decoding has finished. + * @param aStatus Status code describing the success of the operation. + * KErrNone if all went as planned. + * @param aBitmap Decoded bitmap. NULL if errors in decoding. + */ + virtual void ImageDecoded( TInt aStatus, const CFbsBitmap* aBitmap ) = 0; + + }; + + +/** +* Image Decoder class +*/ +class CCamImageDecoder : public CActive + { + // ======================================================= + public: + + /** + * 2-phase constructor. + */ + static CCamImageDecoder* NewL( MCamImageDecoderObserver& aObserver ); + + /** + * Destructor. + */ + virtual ~CCamImageDecoder(); + + // ------------------------------------------------------- + // From CActive + protected: + + /** + * Called when Cancel is requested and this AO is active. + * @see CActive + */ + virtual void DoCancel(); + + /** + * We get notified of the decoding success by a call to RunL + * when decoding finishes. + * @see CActive + */ + virtual void RunL(); + + /** + * If a leave occurs in RunL, RunError gets called by the + * Active Scheduler. + * @param aError Leave code from RunL. + * @see CActive + */ + virtual TInt RunError( TInt aError ); + + // ------------------------------------------------------- + public: + + void StartConversionL( CCamBufferShare* aBuffer ); + + private: + + /** + * Store the buffer and release any previous buffer. + * Can be called with NULL to release current buffer. + */ + void SetImageData( CCamBufferShare* aBuffer ); + + /** + * Get the image data in descriptor form. + * No new memory is allocated to the returned buffer, + * so ownership not transferred. + * @return Pointer to image data that is to be used for image conversion. + * If EXIF thumbnail is available, it is used, otherwise the + * full image data is used instead. If the image data cannot be + * read from the buffer, or the buffer has not been set, + * leave will occur. + * @leave KErrNotFound, if image buffer is not set or contains no image data. + * Any other system error, e.g. KErrNoMemory. + */ + TDesC8* GetImageDataL(); + + /** + * Read the EXIF thumbnail and return it in descriptor. + * If any errors, return NULL. + * @param aExifData The full image data containing EXIF part. + * @return The EXIF thumbnail in a heap descriptor. NULL if + * error occurs in reading (OOM, no data given, + * no EXIF thumbnail found..). + */ + HBufC8* ReadExifThumbNail( const TDesC8& aExifData ); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * 1st phase constructor. + * Cannot leave. + */ + CCamImageDecoder( MCamImageDecoderObserver& aObserver ); + + // ======================================================= + // Data + private: + + RFs iFs; + MCamImageDecoderObserver& iObserver; + + + CCamBufferShare* iSharedImageData; + HBufC8* iThumbnailData; + + CFbsBitmap* iDecodedBitmap; + CImageDecoder* iDecoder; + + TInt iRetryCounter; + + // ======================================================= + }; + +// =========================================================================== +#endif + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camimageencoder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camimageencoder.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image Encoder class. +* +*/ + + +#ifndef CAM_IMAGEENCODER_H +#define CAM_IMAGEENCODER_H + +// =========================================================================== +// Included headers +#include +#include + +// =========================================================================== +// Forward declarations +class CImageEncoder; +class CCamBufferShare; + + +// =========================================================================== +// Classes + +/** +* Interface for Image Encoder Observers +*/ +class MCamImageEncoderObserver + { + public: + + /** + * Notify observer that the image has been encoded. + * @param aStatus Status code describing the success of the operation. + * KErrNone if all went as planned. + * @param aData Encoded image data. NULL if errors in decoding. + * Ownership transferred to observer. + */ + virtual void ImageEncoded( TInt aStatus, HBufC8* aData ) = 0; + }; + + +/** +* Image Encoder class +*/ +class CCamImageEncoder : public CActive + { + // ======================================================= + public: + + /** + * 2-phase constructor. + */ + static CCamImageEncoder* NewL( MCamImageEncoderObserver& aObserver ); + + /** + * Destructor. + */ + virtual ~CCamImageEncoder(); + + // ------------------------------------------------------- + // From CActive + protected: + + /** + * Called when Cancel is requested and this AO is active. + * @see CActive + */ + virtual void DoCancel(); + + /** + * We get notified of the decoding success by a call to RunL + * when decoding finishes. + * @see CActive + */ + virtual void RunL(); + + /** + * If a leave occurs in RunL, RunError gets called by the + * Active Scheduler. + * @param aError Leave code from RunL. + * @see CActive + */ + virtual TInt RunError( TInt aError ); + + // ------------------------------------------------------- + public: + + void StartConversionL( CCamBufferShare* aBuffer ); + + private: + + /** + * Store the buffer and release any previous buffer. + * Can be called with NULL to release current buffer. + */ + void SetInputBuffer( CCamBufferShare* aBuffer ); + + /** + * Free all encoding related resources. + */ + void ReleaseEncoder(); + + /** + * Notify observer. + * Transfers the encoding data ownership to the observer. + */ + void NotifyObserver( TInt aStatus ); + + private: + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * 1st phase constructor. + * Cannot leave. + */ + CCamImageEncoder( MCamImageEncoderObserver& aObserver ); + + // ======================================================= + // Data + private: + + MCamImageEncoderObserver& iObserver; + + CCamBufferShare* iSharedInput; + HBufC8* iEncodedData; + + CImageEncoder* iEncoder; + + // ======================================================= + }; + +// =========================================================================== +#endif // CAM_IMAGEENCODER_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camperformancelogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camperformancelogger.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef CAM_PERFORMANCELOGGER_H +#define CAM_PERFORMANCELOGGER_H + + +#include "camcameracontrollerflags.hrh" + + +#ifdef CAMERAAPP_PERFORMANCE_CONTROLLER +// =========================================================================== +_LIT( KCamPerformanceItemFormat, "%s duration: %d \n"); + +class TCamPerformanceItem + { + public: + TCamPerformanceItem( TCamCameraRequestId aId ) + : iId( aId ), iStart( Time64() ), iStop( iStart ) {}; + + TCamPerformanceItem( const TCamPerformanceItem& aOther ) + : iId( aOther.iId ), iStart( aOther.iStart ), iStop( aOther.iStop ) {}; + + void Start() { iStart = Time64(); iStop = iStart; }; + void Stop() { iStop = Time64(); }; + + TInt64 Time64() const + { + TTime time; + time.HomeTime(); + return time.Int64(); + }; + + TInt Duration() const + { + return (TInt)(iStop - iStart); + }; + + const TCamCameraRequestId iId; + TInt64 iStart; + TInt64 iStop; + }; + + + + +class CCamPerformanceLogger : public CBase + { + public: + CCamPerformanceLogger() {}; + ~CCamPerformanceLogger() + { + iData.Reset(); + iData.Close(); + }; + + void Requested( const TCamCameraRequestId& aRequest ) + { + TInt error = iData.Append( TCamPerformanceItem( aRequest ) ); + + if( KErrNone != error ) + { + // Ignored + } + }; + + void Completed( const TCamCameraRequestId& aRequest ) + { + // Set the end time for last performance item + // found with this id. + for( TInt i = iData.Count() - 1; i >= 0; i-- ) + { + if( aRequest == iData[i].iId ) + { + iData[i].Stop(); + return; + } + } + /// Ignore error if not found + }; + + TInt InfoSizeEstimate() const + { + return 50 * iData.Count(); + } + + void InfoText( TDes& aDes ) const + { + TInt count = iData.Count(); + for( TInt i = 0; i < count; i++ ) + { + const TCamPerformanceItem& item = iData[i]; + // ECamRequestNone used to mark sequence start and end. + if( item.iId >= ECamRequestNone && item.iId < ECamRequestLast ) + { + aDes.AppendFormat( KCamPerformanceItemFormat, KCamRequestNames[item.iId], item.Duration() ); + } + } + } + + private: + RArray iData; + }; +// =========================================================================== +#endif // CAMERAAPP_PERFORMANCE_CONTROLLER + +#endif // CAM_PERFORMANCELOGGER_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/campointerutility.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/campointerutility.inl Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Inline utility methods for pointer handling +* +*/ + + +#ifndef CAM_POINTERUTILITY_INL +#define CAM_POINTERUTILITY_INL + +// =========================================================================== +namespace NCamCameraController + { + inline void CheckNonNullL( const TAny* aPtr, TInt aLeave ) + { + if( !aPtr ) User::Leave( aLeave ); + }; + } +// =========================================================================== +#endif // CAM_POINTERUTILITY_INL + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camsettingconversion.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camsettingconversion.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting conversion utility class declaration +* +*/ + + +#ifndef CAM_SETTINGCONVERSION_H +#define CAM_SETTINGCONVERSION_H + +#include "camcameracontrollerflags.hrh" // Keep first + +#include +#include + +#include +#include +#include + +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "camcameracontrollersettings.h" + + +// =========================================================================== + +/** +* CCamSettingConversion utility class +* +* Convert the value used in UI side settings to values suitable for CCamera +* or Camera Controller +*/ +class CCamSettingConversion : public CBase + { + public: + static CCamera::TWhiteBalance + Map2CameraWb( const TCamWhiteBalanceId& aWbId ); + + static CCamera::TFlash + Map2CameraFlash( const TCamFlashId& aFlashId ); + + static TCamFlashId + Map2FlashId( const CCamera::TFlash& aCameraFlash ); + + static CCamera::TFormat + Map2CameraFormat( const TDisplayMode& aDisplayMode ); + + static CCamera::TExposure + Map2CameraExposureMode( const TCamSceneAEMode& aExpModeId ); + +#ifdef CAMERAAPP_CAPI_V2_IP + /** + * Map2CameraEffect + * Map colour effect id from UI to Image Processing effect id. + */ + static CCamera::CCameraImageProcessing::TEffect + Map2CameraEffect( const TCamColourFilterId& aColourFilterId ); +#endif + + /** + * Map UI Setting Model setting id to Camera Controller setting id. + */ + static NCamCameraController::TCamCameraSettingId + Map2CameraControllerSettingId( const TCamSettingItemIds& aUiSettingId ); + +#if defined( CAMERAAPP_CAPI_V2_ADV ) || defined( CAMERAAPP_CAPI_V2_IP ) + /** + * Map Camera Controller setting id to ECAM event UID value. + * @see Map2CameraSetting + */ + static TInt + Map2EventUidValue( + const NCamCameraController::TCamCameraSettingId& aSettingId ); + + /** + * Map ECAM event UID value to Camera Controller setting id. + * @see Map2EventUidValue + */ + static NCamCameraController::TCamCameraSettingId + Map2CameraSetting( TInt aUidValue ); + + /** + * Converts autofocus range from camera ui TCamSceneAFMode type + * to CCamera TFocusRange type + * @param aAfMode Autofocus mode in camera ui type + * @return Autofocus range in TFocusRange type + */ + static CCamera::CCameraAdvancedSettings::TFocusRange + Map2CameraAutofocus( const TCamSceneAFMode& aAfMode ); + +#endif // defined( CAMERAAPP_CAPI_V2_ADV ) || defined( CAMERAAPP_CAPI_V2_IP ) + + /** + * Convert UI orienation setting value of type TCamImageOrientation + * to MCameraOrientation TOrientation value. + */ + static MCameraOrientation::TOrientation + Map2CameraOrientation( const TCamImageOrientation& aSettingOrientation ); + }; + + +#endif // CAM_SETTINGCONVERSION_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camsettingprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camsettingprovider.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera setting provider, which queries the settings from settingmodel. +* +*/ + + +#ifndef CAM_SETTINGPROVIDER_H +#define CAM_SETTINGPROVIDER_H + +#include +#include "mcamsettingprovider.h" +#include "mcamsettingsmodelobserver.h" + + +class MCamSettingsModel; +class CCamAppController; + +class CCamSettingProvider : public CBase, + //public MCamSettingsModelObserver, + public MCamSettingProvider + { + // ========================================================================= + // Constructors and destructor + public: + static CCamSettingProvider* NewL ( CCamAppController& aController, MCamSettingsModel* aSettingsModel ); + static CCamSettingProvider* NewLC( CCamAppController& aController, MCamSettingsModel* aSettingsModel ); + virtual ~CCamSettingProvider(); + + // ------------------------------------------------------------------------- + // From MCamSettingProvider + public: + virtual void + ProvideCameraParamL( + const NCamCameraController::TCamCameraParamId& aParamId, + TAny* aParamData ); + + virtual void + ProvideCameraSettingL( + const NCamCameraController::TCamCameraSettingId& aSettingId, + TAny* aSettingData ); + + virtual void + ProvidePendingSettingChangesL( + RArray& aSettingIds ); + + virtual TInt PendingSettingChangeCount() const; + + /** + * Set the supported ISO rates. + */ + virtual void SetSupportedISORatesL( const RArray& aSupportedIsoRates ); + + // ------------------------------------------------------------------------- + // New methods + public: + + /** + * Clear all pending setting changes. + */ + void Reset(); + + /** + * Add an array of pending setting changes. + */ + void AddPendingSettingChangesL( + const RArray& aUiSettingIds ); + + /** + * Add one pending setting change. + */ + void AddPendingSettingChangeL( TCamSettingItemIds aUiSettingId ); + + // ------------------------------------------------------------------------- + // Private constructors + private: + + void ConstructL(); + + CCamSettingProvider( CCamAppController& aController, MCamSettingsModel* aSettingsModel ); + + // ========================================================================= + // Data + private: + + MCamSettingsModel* iSettingsModel; + CCamAppController& iController; + RArray iPendingSettingChanges; + + TInt iEvStepAsUiValue; + + RArray iSupportedISORates; + TBool iValidISORates; + + // ========================================================================= + }; + +#endif // CAM_CONSTANTSETTINGPROVIDER_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camsnapshot.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camsnapshot.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CCamSnapshot class definition +* +*/ + + +#ifndef CAM_SNAPSHOT_H +#define CAM_SNAPSHOT_H + +#include +#include +#include "mcamcameraobserver.h" // MCamCameraObserver, MCamCameraObservable +#include "camimagedecoder.h" // MCamImageDecoderObserver +#include "cambitmapscaler.h" // MCamBitmapScalerObserver + + +class CCamBufferShare; + +/** +* @class CCamSnapshot +* +*/ +class CCamSnapshot : public CBase, +// public MCameraSnapshot, + public MCamCameraObserver, + public MCamImageDecoderObserver, + public MCamBitmapScalerObserver + { + // ------------------------------------------------------- + // Constructors and destructor + public: + + static CCamSnapshot* NewL( CCamera& aCamera, + MCameraObserver2& aObserver, + MCamCameraObservable& aObservable ); + + ~CCamSnapshot(); + + // ------------------------------------------------------- + // from MCameraSnapshot + public: + + TUint32 SupportedFormats(); + + void PrepareSnapshotL( CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio); + void PrepareSnapshotL( CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio ); + + void SetBgColorL( const TRgb& aBgColor ); + void SetPositionL( const TPoint& aPosition ); + + TBool IsSnapshotActive() const; + void StartSnapshot(); + void StopSnapshot(); + + MCameraBuffer& SnapshotDataL( RArray& aFrameIndexOrder ); + + // ------------------------------------------------------- + // From MCamCameraObserver + public: + + /** + * @see MCamCameraObserver + */ + virtual void HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData = NULL ); + + // ------------------------------------------------------- + // from MCamImageDecoderObserver + public: + + /** + * @see MCamImageDecoderObserver + */ + virtual void ImageDecoded( TInt aStatus, const CFbsBitmap* aBitmap ); + + // ------------------------------------------------------- + // from MCamBitmapScalerObserver + public: + + /** + * @see MCamBitmapScalerObserver + */ + virtual void BitmapScaled( TInt aStatus, const CFbsBitmap* aBitmap ); + + // ------------------------------------------------------- + // New methods + public: + + void StartSnapshotProcessing( CCamBufferShare* aBuffer, + TInt aError ); + + static TInt SnapshotReadyCallback( TAny* aSelf ); + + private: + + void DoStartSnapshotProcessingL( CCamBufferShare* aBuffer, + TInt aError ); + + TDisplayMode Format2DisplayMode( CCamera::TFormat aFormat ) const; + + void SetImageData( CCamBufferShare* aImageData ); + + private: + + void ConstructL(); + CCamSnapshot( CCamera& aCamera, + MCameraObserver2& aObserver, + MCamCameraObservable& aObservable ); + + // ======================================================= + // data + private: + + MCameraObserver2& iObserver; + MCamCameraObservable& iObservable; + + TInt iCameraHandle; + + CCamImageDecoder* iDecoder; + CCamBitmapScaler* iScaler; + + CCamBufferShare* iImageData; + CFbsBitmap* iSnapshotBitmap; + + TBool iSnapshotOn; + TInt iStatus; + + // Video snapshot is taken from VF frames. + // Flags to control the process. + TBool iUseNextVfFrame; + TBool iVideoMode; + + CCamera::TFormat iFormat; + TPoint iPosition; + TSize iSize; + TRgb iBackgroundColor; + TBool iMaintainAspectRatio; + + CIdle* iIdle; + + // ======================================================= + }; + +#endif + +// end of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camsnapshotprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camsnapshotprovider.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CCamSnapshotProvider class definition +* +*/ + + +#ifndef CAM_SNAPSHOTPROVIDER_H +#define CAM_SNAPSHOTPROVIDER_H + + +#include "camcameracontrollerflags.hrh" // build flags, keep first +#include + + +class CCamera; +class MCameraObserver2; +class MCamCameraObservable; +class CPeriodic; +class CCamSnapshot; + + +#ifdef CAMERAAPP_CAPI_V2_SS + #define CAMERASNAPSHOT CCamera::CCameraSnapshot +#else + // To be able to link without additional build time variation + // in source files. + #define CAMERASNAPSHOT CCamSnapshot +#endif + + +// =========================================================================== +// +class CCamSnapshotProvider : public CBase, + public MCameraSnapshot + { + // ------------------------------------------------------- + // Constructors and destructor + public: + + static CCamSnapshotProvider* NewL( CCamera& aCamera, + MCameraObserver2& aObserver, + MCamCameraObservable& aObservable ); + + virtual ~CCamSnapshotProvider(); + + private: + + /** + * 2nd phase constructor + */ + void ConstructL( CCamera& aCamera, + MCameraObserver2& aObserver, + MCamCameraObservable& aObservable ); + + /** + * 1st phase constructor + */ + CCamSnapshotProvider(); + + // ------------------------------------------------------- + // From MCameraSnapshot + // + // All inlines as just relayed to the currently used + // snapshot producer. + public: + + inline virtual TUint32 SupportedFormats(); + inline virtual void PrepareSnapshotL( CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio ); + inline virtual void PrepareSnapshotL( CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio ); + inline virtual void SetBgColorL( const TRgb& aBgColor); + inline virtual void SetPositionL( const TPoint& aPosition); + inline virtual TBool IsSnapshotActive() const; + inline virtual void StartSnapshot(); + inline virtual void StopSnapshot(); + inline virtual MCameraBuffer& SnapshotDataL( RArray& aFrameIndexOrder ); + inline virtual void Release(); + + // ======================================================= + // Data + private: + + CAMERASNAPSHOT* iSs1; + CCamSnapshot* iSs2; + + // ======================================================= + }; + +#include "camsnapshotprovider.inl" + +// =========================================================================== +#endif // CAM_SNAPSHOTPROVIDER_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camsnapshotprovider.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camsnapshotprovider.inl Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Inline implementations of CCamSnapshotProvider class +* +*/ + + +#include "camsnapshot.h" + +// =========================================================================== +// Methods + +// =========================================================================== +// From MCameraSnapshot + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint32 +CCamSnapshotProvider::SupportedFormats() + { + return ( iSs1 + ? iSs1->SupportedFormats() + : iSs2->SupportedFormats() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSnapshotProvider::PrepareSnapshotL( CCamera::TFormat aFormat, + const TPoint& aPosition, + const TSize& aSize, + const TRgb& aBgColor, + TBool aMaintainAspectRatio ) + { + ( iSs1 ? iSs1->PrepareSnapshotL( aFormat, aPosition, aSize, aBgColor, aMaintainAspectRatio ) + : iSs2->PrepareSnapshotL( aFormat, aPosition, aSize, aBgColor, aMaintainAspectRatio ) ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSnapshotProvider::PrepareSnapshotL( CCamera::TFormat aFormat, + const TSize& aSize, + TBool aMaintainAspectRatio ) + { + ( iSs1 ? iSs1->PrepareSnapshotL( aFormat, aSize, aMaintainAspectRatio ) + : iSs2->PrepareSnapshotL( aFormat, aSize, aMaintainAspectRatio ) ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSnapshotProvider::SetBgColorL( const TRgb& aBgColor ) + { + ( iSs1 ? iSs1->SetBgColorL( aBgColor ) + : iSs2->SetBgColorL( aBgColor ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSnapshotProvider::SetPositionL( const TPoint& aPosition ) + { + ( iSs1 ? iSs1->SetPositionL( aPosition ) + : iSs2->SetPositionL( aPosition ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool +CCamSnapshotProvider::IsSnapshotActive() const + { + return ( iSs1 + ? iSs1->IsSnapshotActive() + : iSs2->IsSnapshotActive() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSnapshotProvider::StartSnapshot() + { + ( iSs1 ? iSs1->StartSnapshot() + : iSs2->StartSnapshot() ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSnapshotProvider::StopSnapshot() + { + ( iSs1 ? iSs1->StopSnapshot() + : iSs2->StopSnapshot() ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +MCameraBuffer& +CCamSnapshotProvider::SnapshotDataL( RArray& aFrameIndexOrder ) + { + return ( iSs1 + ? iSs1->SnapshotDataL( aFrameIndexOrder ) + : iSs2->SnapshotDataL( aFrameIndexOrder ) ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSnapshotProvider::Release() + { + // empty + } + +// =========================================================================== +// end of file .inl \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/camtestrequests.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/camtestrequests.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef CAM_TEST_REQUESTS_H +#define CAM_TEST_REQUESTS_H + +#include +#include "camcamerarequests.h" + + +static const TCamCameraRequestId KCamCameraStartupSequencePreVf[] = + { + ECamRequestReserve, + ECamRequestPowerOn, + + ECamRequestImageInit, + + ECamRequestVfInitBitmap, + ECamRequestVfStart, + + ECamRequestSsInit, + ECamRequestSsStart + }; + +static const TCamCameraRequestId KCamCameraStartupSequenceVfPre[] = + { + ECamRequestReserve, + ECamRequestPowerOn, + + ECamRequestVfInitBitmap, + ECamRequestVfStart, + + ECamRequestImageInit, + + ECamRequestSsInit, + ECamRequestSsStart + }; + + +#endif \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/mcamcameraobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/mcamcameraobserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera observer interface. +* +*/ + + +#ifndef CAM_CAMERAOBSERVER_H +#define CAM_CAMERAOBSERVER_H + + +#include "camcameraevents.h" + + +/** + * MCamCameraObserver mixin. + * + */ +class MCamCameraObserver + { + public: + + /** + * Handle camera event. + * + * @param aStatus Status code describing the event status. + * @param aEventId Identifier for the event. + * @param aEventData Event associated data. If such data is provided with the event, + * it is mentioned in the documentation of particular event id. + * Ownership not transferred to observer. + */ + virtual void HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData = NULL ) = 0; + }; + + +/** +* MCamCameraObservable mixin. +*/ +class MCamCameraObservable + { + public: + + /** + * Attach a new observer. + * @param aObserver Observer to attach. If given observer is already attached, + * duplicate is not added and no error is reported. + * @param aInterest Observer event interest info. + * TCamCameraEventClassId values ORed. + * If observer needs to change the interest info, it should + * first detach itself and then attach with new info. + */ + virtual void AttachObserverL( const MCamCameraObserver* aObserver, + const TUint& aInterest ) = 0; + + + /** + * Detach an observer. + * @param aObserver Observer to detach. If given observer is not found + * among attached observers, such an is simply ignored. + */ + virtual void DetachObserver( const MCamCameraObserver* aObserver ) = 0; + }; + + +#endif // M_CAM_ENGINEOBSERVER_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/mcamsettingpreviewhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/mcamsettingpreviewhandler.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera setting preview handler interface. +* +*/ + + +#ifndef CAM_MCAMSETTINGPREVIEWHANDLER_H +#define CAM_MCAMSETTINGPREVIEWHANDLER_H + +#include "CamSettingsInternal.hrh" + +/** + * MCamSettingPreviewHandler mixin. + */ +class MCamSettingPreviewHandler + { + public: + + /** + * Activates preview for one setting. + * Returns the preview value as setting value in ProvideCameraSettingL + * until Commit or Cancel is called. + * @param aSettingId The setting for which preview is set + * @param aSettingValue The setting value used for preview + * @leave Any system error code. + */ + virtual void ActivatePreviewL( const TCamSettingItemIds& aSettingId, + TInt aSettingValue ) = 0; + + /** + * Cancels the preview for one setting. + * After this call ProvideCameraSettingL returns the actual setting value. + * If the setting does not have active preview, such error is ignored. + * @param aSettingId Id of the setting for which the preview is cancelled. + */ + virtual void CancelPreview( const TCamSettingItemIds& aSettingId ) = 0; + + + /** + * Cancels the preview for a set of settings. + * If some of the settings do not have active preview, such error is ignored. + */ + virtual void CancelPreviews( const RArray aSettingIds ) = 0; + + /** + * Cancels all previews. + * No error reported, if no previews active. + */ + virtual void CancelAllPreviews() = 0; + + /** + * Commits the preview value for the given set of settings. + * After this call completes, the preview is no more active for the setting. + * If the call completes successfully, the preview is stored as the + * actual setting value. If leave occurs, the preview is not stored. + * @param aSettingId Id of the setting for which the preview is committed. + * @leave KErrArgument There was no preview value for the given setting. + * @leave Any system error code. + */ + virtual void CommitPreviewL( const TCamSettingItemIds& aSettingId ) = 0; + + /** + * Commits the preview for a set of settings. + * If some of the settings do not have active preview, such error is ignored. + */ + virtual void CommitPreviewsL( const RArray& aSettingIds ) = 0; + + /** + * Commit previews for all settings with active preview. + * @leave Any system error code. + */ + virtual void CommitAllPreviewsL() = 0; + + /** + * Get the set of settings with active preview. + * Preview is active if it has been set with ActivatePreviewL + * but not cancelled or committed after that. + * @param aSettingIds Return the ids of the active settings in this array. + */ + virtual void ActivePreviewsL( RArray& aSettingIds ) const = 0; + + /** + * Virtual destructor. + * Need to be defined in order to be able to gracefully delete + * inherited class entities through MCamCameraPreviewHandler pointer. + * If not declared here, User-42 panic occurs on delete. + */ + virtual ~MCamSettingPreviewHandler() {}; + }; + +#endif // CAM_MCAMSETTINGPREVIEWHANDLER_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/cameracontroller/mcamsettingprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/cameracontroller/mcamsettingprovider.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera setting provider interface. +* +*/ + + +#ifndef CAM_MCAMSETTINGPROVIDER_H +#define CAM_MCAMSETTINGPROVIDER_H + +#include "camcameracontrollersettings.h" + +/** + * MCamSettingProvider mixin. + */ +class MCamSettingProvider + { + public: + + /** + * Get given camera parameters. + * The associated data is returned in the TAny pointer. + * Actual data type depends on the parameter id and is documented in + * TCamCameraParamId documentation. + * + * These parameters represent overall settings of camera, e.g. + * image quality and format, viewfinder size etc. The setting version + * (ProvideCameraSettingL) is used to get more exact settings like + * flash mode, exposure compensation setting etc. + * + * @param aParamId Id of the parameter which the user is interested in. + * @param aParamData Pointer to the parameter data structure. The actual + * data type depends on parameter id. + * @see TCamCameraParamId + */ + virtual void + ProvideCameraParamL( + const NCamCameraController::TCamCameraParamId& aParamId, + TAny* aParamData ) = 0; + + /** + * Get given camera setting. + * The associated data is returned in the TAny pointer. + * Actual data type depends on the setting id and is documented in + * TCamCameraSettingId documentation. + * + * This method is used to get specific settings for camera, e.g. + * exposure compensation, white balance etc. Some of these settings + * still combine mode and value, so TAny pointer is used to be able + * to return setting data of variable size and type. + * + * @see TCamCameraSettingId + */ + virtual void + ProvideCameraSettingL( + const NCamCameraController::TCamCameraSettingId& aSettingId, + TAny* aSettingData ) = 0; + + /** + * Provide the currently pending setting changes. + * + */ + virtual void + ProvidePendingSettingChangesL( + RArray& aSettingIds ) = 0; + + /** + * Number of currently pending setting changes. + */ + virtual TInt PendingSettingChangeCount() const = 0; + + /** + * Set the supported ISO rates. + */ + virtual void SetSupportedISORatesL( const RArray& aSupportedIsoRates ) = 0; + + /** + * Virtual destructor. + * Need to be defined in order to be able to gracefully delete + * inherited class entities through MCamSettingProvider pointer. + * If not declared here, User-42 panic occurs on delete. + */ + virtual ~MCamSettingProvider() {}; + }; + +#endif // CAM_MCAMSETTINGPROVIDER_H + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/camflashstatus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/camflashstatus.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,280 @@ + +#ifndef CAMFLASHSTATUS_H +#define CAMFLASHSTATUS_H/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for CCamFlashStatus class. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* +* +*/ + + + +// =========================================================================== +// INCLUDES + +#include +#include "mcamcameraobserver.h" + + +// =========================================================================== +// CONSTANTS + +// Flash icon blinking delay (duration of icon on/off state) +const TInt KFlashIconBlinkDelay = 300*1000; // [microseconds] + +// Enumerated flash charging states. Should probably be +// defined in the driver's headers and included from there. +enum TFlashChargeStatus + { + EFlashCharged = 0x1, + EFlashRequired = 0x2, + EFlashChargeTimeout = 0x4 + }; + +/* +// Flash P&S UID & key +#ifndef CAMERAAPP_SIMULATE_XENON_FLASH +const TInt KFlashPSUid = 0xA0002371; +#else +// Use application UID to simulate the flash charging publish +// and subscribe property. This way, no extra capabilities are needed +// for creating the property. +const TInt KFlashPSUid = 0x101FFA86; +#endif // CAMERAAPP_SIMULATE_XENON_FLASH +const TInt KFlashPSKey = 0; +*/ + + +// =========================================================================== +// FORWARD DECLARATIONS + +// +//class CCamPropertyWatcher; +class CCamAppController; + + +// =========================================================================== +// CLASS DECLARATION + +/** +* Interface to notify observer of flash icon visibility. +* This is used to create icon blinking effect when the flash +* is being recharged. +*/ +class MFlashStatusObserver + { + public: + /* + * Flash icon visibility has changed. + * @param aVisible new visibility status + */ + virtual void FlashIconVisible( TBool aVisible ) = 0; + + /** + * Called every time when camera driver reports error in + * flash recharging. + */ + virtual void FlashError() = 0; + + }; + +/** +* Class to handle flash status and flash error status. +* +* - Keeps track of the flash recharge and flash error status +* - Creates events for visibility of the battery icon and uses +* this to create blinking effect when the flash is being +* charged +* - Gives an event when a charging error is received from +* the camera driver. In this case, the UI can display +* an error message. +* +*/ +class CCamFlashStatus: public CBase, + public MCamCameraObserver + //public MPropertyObserver + { + public: // Construction and destruction + + /** + * Two-phased constructor + */ + static CCamFlashStatus* NewL( CCamAppController& aController ); + + /** + * Destructor + */ + ~CCamFlashStatus(); + + public: // New functions + + /** + * Subscribes to flash icon blink events. At one time, only one + * observer can be listening for the events. An observer can + * unregister itself by giving NULL as aObserver parameter + * value. + * + * @param aObserver pointer to observer or NULL + */ + void Subscribe( MFlashStatusObserver* aObserver ); + + /** + * Returns true, if flash is fully charged, otherwise false + */ + TBool FlashReady() const; + + /** + * Returns true if there has been an error recharging the flash + */ + TBool FlashError() const; + + /** + * Set the value returned by FlashError. This may be needed + * before application pretended exit. + * @param aFlashError + */ + void SetFlashError( TBool aFlashError ); + + /** + * Returns true, if flash recharge error has already been + * reported to user. This eliminates the error displayed + * multiple times (for example, when switching between + * image and video modes) + */ + TBool ErrorCallbacksEnabled() const; + + /** + * Enable/disable flash error callbacks. Should be set to ETrue + * when error message is displayed to user, and to EFalse + * during pretended application exit. + * @param aErrorReported + */ + void EnableErrorCallbacks( TBool aCallbacksEnabled ); + + /** + * Returns true, if flash icon should be displayed, false + * otherwise. This cannot be used to determine the charging + * status of the flash. + */ + TBool FlashIconVisible() const; + + //public: // From MPropertyObserver + /** + * The value of a watched property has changed + * @param aCategory The category of the property + * @param aKey the Identifier of the property + */ + //void HandlePropertyChangedL( const TUid& aCategory, const TUint aKey ); + + public: // From MCamCameraObserver + + /** + * Handle camera event + */ + virtual void HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData = NULL ); + + private: + + /** + * C++ default constructor + */ + CCamFlashStatus( CCamAppController& aController ); + + /** + * Second phase constructor + */ + void ConstructL(); + + /** + * Check if blinking needs to be stopped or started. + */ + void CheckBlinkingStatus(); + + /** + * Start flash icon blinking timer + */ + void StartBlinking(); + + /** + * Stop flash icon blinking timer, return + * the icon to invisible state. + */ + void StopBlinking(); + + /** + * Check if flash setting is off. + * Flash not ready events are ignored if flash setting is off. + */ + TBool IsFlashOff() const; + + /** + * Notifies observer about error, if necessary + */ + void NotifyObserverAboutFlashError(); + + /** + * Updates blink status of the flash icon. + * @param aThis + */ + static TInt BlinkTimerCallback( TAny* aSelf ); + + private: + + // Flash readiness to take a picture + TBool iFlashReady; + + // Flash is required to take a photo under current + // lighting conditions. + TBool iFlashRequired; + + // Flash recharging error status. + // If set to true, there has been an error in recharging + // the flash, and flash functionality is no more functional. + TBool iFlashError; + + // Determines whether cllabacks + TBool iErrorCallbacksEnabled; + + // Flash status observer. Typically the container where + // the flash icon resides. + MFlashStatusObserver* iObserver; + + // Timer used to create blinking effect of the flash icon + CPeriodic* iBlinkTimer; + + TBool iBlinking; + + // Icon visibility + // true - visible, EFalse - not visible + TBool iBlinkStatus; + + // Used for watching the flash P&S key + //CCamPropertyWatcher* iFlashPropertyWatcher; + + // Register for Camera events through controller. + CCamAppController& iController; + }; + +#endif // CAMFLASHSTATUS_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/camfolderutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/camfolderutility.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +* +*/ + + + + +#ifndef CAM_FOLDERUTILITY_H +#define CAM_FOLDERUTILITY_H + +// =========================================================================== +// Included headers +#include + +#include "CamSettingsInternal.hrh" +#include "CamSettings.hrh" + +// =========================================================================== + +/** +* Utility class for folder naming +*/ +class CCamFolderUtility : public CBase + { + // ======================================================= + // Types and constants + public: + + static const TInt KMaxGuaranteedBurstGroup = 20; + static const TInt KMaxFilesPerFolder = 100; + + enum TCamFolderType + { + ECamFolderTypeImageMMC, + ECamFolderTypeImagePhone, + ECamFolderTypeVideoMMC, + ECamFolderTypeVideoPhone, + ECamFolderTypeLast + }; + + // ======================================================= + public: + + /** + * Get the base path to be used for greating the next filename + * @since 2.8 + * @param aMonthCounters Array with counter for every storage type folders. + * Must have ECamFolderTypeLast number of items (or more). + * @param aStorage Whether storing to Phone or MMC + * @param aPath On return will contain the new path, if the final destination + * (month counter) folder does not exist then this will contain the parent + * folder (month folder) + * @param aCaptureMode image or video mode (used to determine folder path/name) + * @param aCreateAll whether or not the destination folder should be created + * if it does not already exist. The folders at higher levels than this are + * always ensured to exist (unless the function returns an error, when existence is + * undetermined). If aCreateAll is ETrue the remaining space (max 100 files) in the + * destination folder is checked, + * @param aRequiredFileCount Folders will contain a maximum of 100 files. If there is + * not enough space for the specified count then a new folder will be created. + * @param aTime provides the month and year used to determine the folder name (ensures + * that all images in a sequence are placed in the same month parent folder). If aTime + * is 0 GetBasePathL uses the current system time. + */ + static void GetBasePathL( TInt* aMonthCounters, + TInt aStorage, // TCamMediaStorage + TDes& aPath, + TCamCameraMode aCaptureMode, + TBool aCreateAll, + TInt aRequiredFileCount = 1, + TTime aTime = TInt64( 0 ) ); + + /** + * Reset certain month folder counters. + * @param The array containing month folder counters for every storage type. + * Must have ECamFolderTypeLast number of items (or more). + * @param aFrom The index of first counter which is resetted. + * @param aTo The index of last counter which is resetted. + */ + static void ResetCounters( TInt* aMonthCounters, + TInt aFrom = ECamFolderTypeImageMMC, + TInt aTo = ECamFolderTypeLast - 1 ); + + private: + + /** + * Set up the counters used to create mulitple month folders + * @since 3.0 + * @param aMonthCounters Array with counter for every storage type folders. + * Must have ECamFolderTypeLast number of items (or more). + * @param aPath the current path. + * @param aMonthFolder the name of the month folder parent directory + * @param aFs file server session + * @param aFolderType Index into the array of folder counters (image/video, mmc/phone) + * @return KErrNone or another system wide error code + */ + static TInt InitialiseMonthCounter( TInt* aMonthCounters, + TDes& aPath, + TDesC& aMonthFolder, + RFs& aFs, + TInt aFolderType ); + + /** + * Create the destination folder for the next image or video. + * @since 3.0 + * @param aMonthCounters Array with counter for every storage type folders. + * Must have ECamFolderTypeLast number of items (or more). + * @param aPath If returning without error this will contain the new path. + * @param aFs file server session + * @param aFolderType Index into the array of folder counters (image/video, mmc/phone) + * @param aRequiredFileCount Folders will contain a maximum of 100 files. If there is + * not enough space for the specified count then a new folder will be created. When the + * highest possible folder number is reached (Z9) the 100 file limit is ignored + * @return KErrNone or another system wide error code + */ + static TInt CreateDestinationFolder( TInt* aMonthCounters, + TDes& aPath, + RFs& aFs, + TInt aFolderType, // TCamMediaStorage + TInt aRequiredFileCount ); + + + // ======================================================= + }; + + +#endif // CAM_FOLDERUTILITY_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/camlinevfgriddrawer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/camlinevfgriddrawer.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for CCamLineVfGridDrawer class. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + + +#ifndef CAMLINEDRAWVFGRID_H +#define CAMLINEDRAWVFGRID_H + +#include // TRgb +#include "camvfgridinterface.h" + +const TInt KCamLineDrawVfGridUid = 0x07700770; + + +class CBitmapContext; +/** +* +* CCamLineVfGridDrawer class. +* +*/ +class CCamLineVfGridDrawer : public CBase, + public MCamVfGridDrawer + { + // ------------------------------------------------------------------------ + // Public part + public: + + typedef RArray RLineArray; + + public: // Construction / destruction -------------------- + + static CCamLineVfGridDrawer* NewL(); + + virtual ~CCamLineVfGridDrawer(); + + public: // From MCamVFGridDrawer ------------------------- + + /** + * Init the drawer. + * @param aParam Not used. + */ + virtual void InitL( TAny* aParam ); + + /** + * Draw the full grid. + */ + virtual void Draw( CBitmapContext& aGc ) const; + + /** + * Draw part of the grid. + * Only pure horizontal and pure vertical lines are + * supported if partial redraw is used. + */ + virtual void Draw( const TRect& aRect, + CBitmapContext& aGc ) const; + + /** + * Set the grid visibility. + * If visibility is set to false, drawing is not done. + * @param aVisible Is the grid visible. + */ + virtual void SetVisible( TBool aVisible ); + /** + * Get the grid visibility setting. + * @return Is grid visible. + */ + virtual TBool IsVisible() const; + + public: // New methods + + /** + * SetLines + * @param aLineArray Pointer to array containing the new lines + * to be used when drawing VF grid. + * TRect::iTL and TRect::iTL define the end + * points of a line. + * @param aLineCount Line count is array. Ignored if aLineArray is NULL. + * @param aTakeOwnerShip Is ownership of aLineArray transferred. + * + */ + void SetLinesL( const RLineArray& aLineArray ); + + void SetLinesL( const TRect& aDrawingRect, + TInt aHorizontalLines, + TInt aVerticalLines, + TBool aBorderedGrid = EFalse ); + + void SetPenStyle( const CGraphicsContext::TPenStyle& aPenStyle ); + void SetPenSize ( const TSize& aPenSize ); + void SetPenColor( const TRgb aPenColor ); + + // ------------------------------------------------------------------------ + // Protected part + protected: + + void ConstructL(); + + // ------------------------------------------------------------------------ + // Private part + private: + + CCamLineVfGridDrawer(); + + private: // Data + + // Line properties + RLineArray iLineArray; // Line end locations + TBool iVisible; // Visibility of lines + + // Drawing parameters + CGraphicsContext::TPenStyle iPenStyle; + TSize iPenSize; + TRgb iPenColor; + + }; + +#endif \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/camoneclickuploadutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/camoneclickuploadutility.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper class for implementing one-click upload support +* +*/ + + +#ifndef CAMONECLICKUPLOADUTILITY_H +#define CAMONECLICKUPLOADUTILITY_H + + +#include + +class CAiwServiceHandler; + + +/** + * Helper class for implementing one-click upload support + * + * @since S60 v5.0 + */ +class CCamOneClickUploadUtility : public CBase + { +public: + /** + * Two-phased constructor. + */ + static CCamOneClickUploadUtility* NewL(); + + /** + * Destructor. + */ + virtual ~CCamOneClickUploadUtility(); + +public: + + /** + * Check if one-click upload is supported. + * @since S60 v5.0 + * @return A boolean value indicating if one-click upload support is present. + */ + TBool OneClickUploadSupported() const; + + /** + * Upload a file. + * @since S60 v5.0 + * @param aFilename Full path to the file to be uploaded. + */ + void UploadL( const TDesC& aFilename ); + + /** + * Upload multiple files. + * @since S60 v5.0 + * @param aFilenames Full paths to the files to be uploaded. + */ + void UploadL( const MDesC16Array& aFilenames ); + + /** + * Get the tooltip text for one-click upload button. + * @since S60 v5.0 + * @return Tooltip text + */ + const TDesC& ButtonTooltipL(); + +private: + void ConstructL(); + void CheckVersionL(); + void InitializeAiwL(); + CCamOneClickUploadUtility(); + +private: // Data + + TBool iUploadSupported; + + // Own + CAiwServiceHandler* iAiwServiceHandler; + + // Own + HBufC* iTooltip; + }; + + +#endif // CAMONECLICKUPLOADUTILITY_H + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/camrarray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/camrarray.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef CAM_RARRAY_H +#define CAM_RARRAY_H + +class CCamRArray : public CBase + { + public: + + CCamRArray( TUint32* aArray, TInt aSize ) + : iReferenced ( NULL ), + iReferenceCount( 0 ), + iArray( aArray ), + iSize ( aSize ) + {}; + + CCamRArray( CCamRArray& aOther ) + { + CCamRArray::MakeCopy( aOther, *this ); + }; + + public: + + void Attach() + { + ++iReferenceCount; + }; + + void Detach() + { + if( --iReferenceCount <= 0 ) + delete this; + } + + inline TUint32& operator[]( TInt aIndex ) + { + return iArray[aIndex]; + }; + + inline const TUint32& operator[]( TInt aIndex ) const + { + return iArray[aIndex]; + }; + + inline TInt Size() const + { + return iSize; + }; + + private: + + static void MakeCopy( CCamRArray& aFrom, CCamRArray& aTo ) + { + aTo.iArray = aFrom.iArray; + aTo.iSize = aFrom.iSize; + + for( TInt i = 1; i < aTo.Size(); i++) + { + TInt tempp = aTo[i]; + TInt tempp2 = aFrom[i]; + } + + aFrom.Attach(); // aTo is one reference more. + aTo.iReferenced = &aFrom; // Used to detach aTo from aFrom + } + + ~CCamRArray() + { + if( iReferenced ) + iReferenced->Detach(); + else + delete [] iArray; + + iArray = NULL; + iSize = 0; + }; + + private: + + TInt iReferenceCount; + CCamRArray* iReferenced; + + TUint32* iArray; + TInt iSize; + }; + +#endif diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/camtextitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/camtextitem.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for rendering text based indicators on top of viewfinder +* +*/ + + +#ifndef CAMTEXTITEM_H +#define CAMTEXTITEM_H + +#include +#include +#include + +class CFbsBitmap; +class TAknTextComponentLayout; +class CBitmapContext; + +/** + * Class for rendering text based indicators on top of viewfinder. + * + * CCamTextItem can be used to render text on the screen in a way + * that is compatible with S60 Posting based overlays. The text mask + * is also written in the alpha channel of the screen buffer to allow + * it to be overlaid on top of the viewfinder. + * + * @since S60 v5.0 + */ +class CCamTextItem : public CBase + { +public: + /** + * Two-phased constructor. + */ + static CCamTextItem* NewL(); + + /** + * Destructor. + */ + virtual ~CCamTextItem(); + +public: + /** + * Set the layout for the text item. + * + * @since S60 v5.0 + * @param aParentRect Rectangle for the parent layout item + * @param aLayout A TAknTextComponentLayout containing the layout + * details for this item. Usually this can be retrieved + * using the AknLayout2 API. + */ + void SetLayoutL( const TRect& aParentRect, const TAknTextComponentLayout& aLayout ); + + /** + * Set the text content for the text item. + * + * @since S60 v5.0 + * @param aText New text for this item. There are no size limitations. A + * local copy if the text is created + */ + void SetTextL( const TDesC& aText ); + + /** + * Render this text in a bitmap based graphics context. + * + * @since S60 v5.0 + * @param aBitmapContext Graphics context to draw into. + */ + void Draw( CBitmapContext& aBitmapContext ) const; + +private: + + CCamTextItem(); + + void ConstructL(); + +private: // data + + TAknLayoutText iLayout; + + // own + HBufC* iText; + + }; + +#endif // CAMTEXTITEM_H diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/camvfgridinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/camvfgridinterface.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CAMVIEWFINDERGRID_H +#define CAMVIEWFINDERGRID_H + +#include + +class CBitmapContext; +/** +* Interface for viewfinder grid usage. +*/ +class MCamVfGridDrawer + { + public: + virtual void InitL( TAny* aParam ) = 0; + + virtual void Draw( CBitmapContext& aGc ) const = 0; + + virtual void Draw( const TRect& aRect, + CBitmapContext& aGc ) const = 0; + + virtual void SetVisible( TBool aVisible ) = 0; + + virtual TBool IsVisible() const = 0; + + // Essential to be able to destroy via mixin pointer. + // Otherwise delete causes USER 42 panic. + virtual ~MCamVfGridDrawer() + {}; + }; + + + +/** +* Factory class to instantiate viewfinder grid. +*/ +class CCamVfGridFactory : public CBase + { + public: + /** + * CreateVfGridDrawer + * @param aUid The implementation id of grid drawer. + * @return Pointer to object of the implementing class + * or NULL if uid not supported. + */ + static MCamVfGridDrawer* CreateVfGridDrawerL( TUid aUid ); + }; + + +#endif diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/camvideotime.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/camvideotime.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for calculating remaining video time +* +* Copyright © 2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* +* +*/ + + +#ifndef CAMVIDEOTIME_H +#define CAMVIDEOTIME_H + +#include + +class TCamVideoTime + { + public: + + /** + * Constructor + * @param aDiskSpace Remaining disk space + * @param aCriticalLimit Diskspace critical limit + * @param aVideoBitrate Video bitrate + * @param aAudioBitrate Audio bitrate + * @param aSizeLimit File size limit (MMS message size) + * @param aMuteAudio Is audio muted + * @param aBitrateScaler Video bitrate scaler + */ + TCamVideoTime( TInt64 aDiskSpace, + TInt64 aCriticalLimit, + TInt aVideoBitRate, + TInt aAudioBitRate, + TUint aSizeLimit, + TBool aMuteAudio, + TReal aBitrateScaler); + + public: + + /** + * Return the estimated remaining time for the recording in microseconds. + * @param None + * @return Remaining time + */ + TTimeIntervalMicroSeconds GetRemainingTimeL(); + + private: + // Average bitrate of video + TInt iVideoAverageBitRate; + + // Average bitrate of audio + TInt iAudioAverageBitRate; + + // Available space on disk at start of recording + TInt64 iAvailableSpaceAtStart; + + // Size limit of the file in bytes + TUint iSizeLimit; + }; + +#endif // CAMVIDEOTIME_H + +// End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/mcaminfolistboxdatasource.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/mcaminfolistboxdatasource.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of Data Source Interface for Info Listboxes. +* Provides a standard interface for getting all the +* data Info Listbox needs to show. +* +*/ + + +#ifndef M_CAM_INFOLISTBOXDATASOURCE +#define M_CAM_INFOLISTBOXDATASOURCE + +// =========================================================================== +// Class declarations +class MCamInfoListboxDataSource + { + public: + virtual TInt ItemIdCount( TInt aType ) const = 0; + /** + * Get item id array of type set earlier by SetItemIdArrayType. + */ + virtual void ItemIdsL( RArray& aItems ) = 0; + + /** + * Get item id array of given type. + */ + virtual void ItemIdsL( RArray& aItems, + TInt aType ) = 0; + + virtual void SetItemIdArrayType( TInt aType ) = 0; + virtual TInt ItemIdArrayType() const = 0; + + virtual TInt ListboxResourceId( TInt aItemId ) = 0; + virtual TInt InfoResourceId ( TInt aItemId ) = 0; + + virtual TPtrC ListboxTitle ( TInt aItemId ) = 0; + virtual TInt ListboxIconId ( TInt aItemId ) = 0; + + virtual TPtrC InfoTitle ( TInt aItemId ) = 0; + virtual TPtrC InfoDescription ( TInt aItemId ) = 0; + virtual TInt InfoIconId ( TInt aItemId ) = 0; + + }; + +#endif // M_CAM_INFOLISTBOXDATASOURCE + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/mcaminfolistboxitemsorter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/mcaminfolistboxitemsorter.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of Item Sorter Interface for Info Listboxes. +* Provides a standard interface for externalising the +* sorting of Info Listbox items. +* +*/ + + +#ifndef M_CAM_INFOLISTBOXITEMSORTER_H +#define M_CAM_INFOLISTBOXITEMSORTER_H + +// =========================================================================== +// Forward declarations +class CCamInfoListboxItemBase; + +// =========================================================================== +// Class declarations +class MCamInfoListboxItemSorter + { + public: + virtual void SortItems( RPointerArray& aItems ) const = 0; + }; + +#endif // M_CAM_INFOLISTBOXITEMSORTER_H + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/inc/mcamsettingsmodelobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/inc/mcamsettingsmodelobserver.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Defines abstract interface for CCamSettingsModel observers* +*/ + + + +#ifndef CAMSETTINGSMODELOBSERVER_H +#define CAMSETTINGSMODELOBSERVER_H + + +// INCLUDES + +// #include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" + + +// CONSTANTS + +// MACROS + +// DATA TYPES + +// FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS +class CCamVideoQualityLevel; +// CLASS DECLARATION + +/** +* Abstract API for settings model observer. +* Derived classes may register as observers to get related +* notifications about events from CCamSettingsModel. +* +* @since 2.8 +*/ +class MCamSettingsModelObserver + { + public: + + /** + * Notification for change in integer setting item value. + * + */ + virtual void IntSettingChangedL( TCamSettingItemIds aSettingItem, TInt aSettingValue ) = 0; + + /** + * Notification for change in text setting item value. + * + */ + virtual void TextSettingChangedL( TCamSettingItemIds aSettingItem, const TDesC& aSettingValue ) = 0; + + }; + +#endif // CAMSETTINGSMODELOBSERVER_H + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamApp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamApp.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Application class for CameraApp +* +*/ + + + +// INCLUDE FILES +#include "CamDocument.h" +#include "CamAppUid.h" +#include "CamApp.h" +#include "CamLogger.h" +#include "CamServer.h" + +#include "CamUtility.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamAppTraces.h" +#endif + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamApp::AppDllUid +// Return the UID for the application +// ----------------------------------------------------------------------------- +// +TUid CCamApp::AppDllUid() const + { + return TUid::Uid( KCameraappUID ); + } + +// ----------------------------------------------------------------------------- +// CCamApp::CreateDocumentL +// Create a CCamApp document, and return a pointer to it +// ----------------------------------------------------------------------------- +// +CApaDocument* CCamApp::CreateDocumentL() + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPP_CREATEDOCUMENTL, "e_CAM_APP_INIT 1" ); //CCORAPP_APP_INIT_START + return CCamDocument::NewL( *this ); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + + +#ifdef RD_APPS_TO_EXES + +#include + + +// ----------------------------------------------------------------------------- +// NewApplication() implements... +// Create an application, and return a pointer to it +// ----------------------------------------------------------------------------- +// +LOCAL_C CApaApplication* NewApplication() + { + return new CCamApp; + } + +// ----------------------------------------------------------------------------- +// E32Main() +// Start the application +// ----------------------------------------------------------------------------- +// +GLDEF_C TInt E32Main() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, _E32MAIN, "e_E32Main 1" ); + TInt ret = EikStart::RunApplication(NewApplication); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1__E32MAIN, "e_E32Main 0" ); + return ret; + } + + +// ----------------------------------------------------------------------------- +// CCamApp::NewAppServerL +// Creates new file service application server. +// ----------------------------------------------------------------------------- +// +void CCamApp::NewAppServerL( CApaAppServer*& aAppServer ) + { +#ifdef RD_PF_SEC_APPARC + PRINT( _L( "Camcorder: NewAppServerL()" ) ); + aAppServer = new (ELeave) CCamAppServer; +#else + aAppServer = 0; +#endif + } + + +#else // !RD_APPS_TO_EXES + + +// ----------------------------------------------------------------------------- +// NewApplication() implements... +// Create an application, and return a pointer to it +// ----------------------------------------------------------------------------- +// +EXPORT_C CApaApplication* NewApplication() + { + return new CCamApp; + } + +#endif // RD_APPS_TO_EXES + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamAppController.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamAppController.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,10904 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for managing intercommunication between Camera UI* +*/ + + + +// =========================================================================== +// INCLUDE FILES + +#include // for feature definitions + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +#include +#include +#include "CamSettingsInternal.hrh" +#include "CamProductSpecificSettings.hrh" +#include "CameraappPrivateCRKeys.h" +#include "CamAppController.h" +#include "CamUtility.h" +#include "CamLogger.h" +#include "CamSettings.hrh" +#include "CamSettingsModel.h" +#include "CamPanic.h" +#include "CamBurstCaptureArray.h" +#include "CamTimer.h" +#include "CamImageSaveActive.h" +#include "CamAppUi.h" +#include "CamObserverHandler.h" +#include "CamSelfTimer.h" +#include "camflashstatus.h" + +#include "CamPerformance.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamAppControllerTraces.h" +#endif + +#include "CamVideoQualityLevel.h" +#include "CamCallStateAo.h" +#include "CamPropertyWatcher.h" +#include + +#ifndef __WINSCW__ + #include "rlocationtrail.h" + #include "locationtrailpskeys.h" +#endif +//#include "camconstantsettingprovider.h" +#include "camsettingprovider.h" +#include "camsettingconversion.h" +#include "camcamerarequests.h" +#include "camcameraevents.h" +#include "camcameracontrollertypes.h" +#include "camcameracontroller.h" +#include "cambuffershare.h" +#include "cambuffersharecleanup.h" +#include "camaudioplayercontroller.h" +#include "camuidconstants.h" +#include "camconfiguration.h" +#include "CamPreCaptureViewBase.h" + +#include +#include +#include + +#include "camvideotime.h" +#include "CamGSInterface.h" +#include "CameraUiConfigManager.h" +#include + +#ifdef _DEBUG +#ifdef _AO_TRACKING +struct CFakeActiveScheduler : public CActiveScheduler { + virtual TInt Extension_( TUint, TAny *&, TAny* ) { return 0; } +}; +#endif // _AO_TRACKING +#endif // _DEBUG + +// =========================================================================== +// Local constants + +// Sequence mode related constants that define the amount of pictures taken +// with sequence mode. +const TInt KShortBurstCount = 18; // number of images captured during burst +const TInt KMinBurstCount = 2; // minimum of images captured +const TInt KBurstEstimate = 10; // Correction of underestimated file size + +const TUint32 KCamLatestFilePath = 0x00000001; + + +// temporary constants until image naming is implemented +_LIT( KImageExtension, ".jpg" ); +_LIT( KVideo3GPExtension, ".3gp" ); +#ifndef __WINS__ +_LIT( KVideoMP4Extension, ".mp4" ); +#endif + +const TInt KMaxExtension = 4; +//const TInt64 KBurstInterval = 0; + +const TInt KIdleTimeout = 1000000 * 60; // 60 seconds +const TInt KDeepSleepTimeout = KIdleTimeout*2; // Measuring time is two minutes +const TInt KVideoArrayUsers = 1; +const TInt KImageArrayUsers = 2; + +const TInt KVideoNameRetryCount = 1; // Maximum number of video naming retries + +// UID for central repository file +const TInt KCRCamShutterSound = 0x7; // key for shutter sound + +const TInt KMicroSecsInMilliSec = 1000; +const TInt KSecondInMicSec = 1000000; +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) +const TInt KLocTrailCloseRetryTime = 5 * KSecondInMicSec; +#endif // defined(RD_MDS_2_5) && !defined(__WINSCW__) + +// Estimated time needed to complete autofocus +const TInt KFocusingDurationSeconds = 2; + +const TInt KCCorFocused = 0x00000002; + +const TInt KCamMaxDateLen = 8; + +static const TInt KTimelapseArrayGranularity = 6; + +// Backlight / Inactivity timer related +// Callback interval is set to 4s. +// Smallest value that the user can select from Phone Settings is 5s. +static const TInt KBacklighTimerPriority = CActive::EPriorityHigh; +static const TInt KBacklighTimerInterval = 4*1000*1000; + +// Camera Controller events interest. +// Want to receive all events. +// Vf frames needed for correct zoom handling (should be left out otherwise). +static const TUint KCamEventInterest = ( ECamCameraEventClassAll ); + +static const TInt KLensCoverDelay = 500*1000; + +_LIT( KCamContextSource, "Application" ); +_LIT( KCamContextType, "Camera.Zoom" ); +_LIT( KCamContextValueEnable, "Enabled" ); +_LIT( KCamContextValueDisable, "Disabled" ); +_LIT_SECURITY_POLICY_PASS( KCamContextSecurity ); + +static const TInt KCriticalMemoryLevel = 5*1000*1000; +// =========================================================================== +// Local namespace +namespace NCamAppController + { + // ------------------------------------------------------- + // Request sequences +// static const TCamCameraRequestId KCamSequencePowerOffOn[] = +// { +// ECamRequestPowerOff, +// ECamRequestPowerOn +// }; + + // ------------------------------------------------------- + // Local methods + + inline TInt ResetBitmap( CFbsBitmap*& aBitmap ) + { + if( aBitmap ) + { + aBitmap->Reset(); + return KErrNone; + } + else + { + TRAPD( create, aBitmap = new (ELeave) CFbsBitmap() ); + return create; + } + }; + + inline void ClearSequenceBusyFlag( TAny* aBusyFlags ) + { + TUint* flags = static_cast( aBusyFlags ); + if( flags ) + { + *flags &= ~EBusySequence; + } + }; + + inline void ClearRequestBusyFlag( TAny* aBusyFlags ) + { + TUint* flags = static_cast( aBusyFlags ); + if( flags ) + { + *flags &= ~EBusyRequest; + } + }; + } + +#include "camflagutility.inl" +#include "campointerutility.inl" + +using namespace NCamAppController; +using namespace NCamCameraController; +// =========================================================================== + + +// =========================================================================== +// Member functions + +// --------------------------------------------------------------------------- +// CCamAppController::NewL +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +CCamAppController* CCamAppController::NewL() + { + CCamAppController* self = new( ELeave ) CCamAppController(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::CompleteConstructionL +// The camera engine cannot be instantiated until the application orientation has +// been set by the CCamAppUi. This does not exist when the CCamAppController is +// constructed. CompleteConstructionL must be called in CCamAppUi::ConstructL() +// --------------------------------------------------------------------------- +// +void CCamAppController::CompleteConstructionL() + { + PRINT( _L("Camera => CCamAppController::CompleteConstructionL" )) + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + // Memory critical levels reading moved to the point when + // those values are actually needed for the first time. + + TInt index = 0; + iInfo.iActiveCamera = ECamActiveCameraPrimary; + PRINT1( _L("Camera <> Cameras available: %d"), CamerasAvailable() ) + + PRINT( _L("Camera <> Store primary camera settings")) + iSettingsModel->StorePrimaryCameraSettingsL(); + + + PRINT1( _L("Camera <> CCamAppController::CompleteConstructionL iSlideState initial value = %d" ), iSlideState) + if ( iConfigManager->IsLensCoverSupported() ) + { + // Request notification of slide state changes + iSlideStateWatcher->Subscribe(); + + // Read the current slider status - use the front camera (if there is one) as default if + // there are any errors. + TInt slideErr = iSlideStateWatcher->Get( iSlideState ); + PRINT1( _L("Camera <> CCamAppController::CompleteConstructionL setting iSlideState to %d" ), iSlideState) + TInt requiredOrientation; + if ( ( appUi->CamOrientation() == ECamOrientationCamcorderLeft && iSlideState == CameraPlatPSKeys::EClosed ) || + ( appUi->CamOrientation() == ECamOrientationCamcorder && iSlideState == CameraPlatPSKeys::EClosed ) ) + { + if ( appUi->IsQwerty2ndCamera() ) + { + PRINT( _L("Camera <> Do not exit. Reload landscape 2nd camera settings") ) + index = 1; + iInfo.iActiveCamera = ECamActiveCameraSecondary; + CCamAppUi* appUi = static_cast( + CEikonEnv::Static()->AppUi() ); + // We may have primary camera settings loaded + LoadStaticSettingsL( appUi->IsEmbedded() ); + CamUtility::GetPsiInt( ECamPsiSecondaryCameraOrientation, + requiredOrientation ); + } + else + { + PRINT( _L("Camera <> Lens cover has been closed during camera construction. Exit camera.") ) + appUi->HandleCommandL( EEikCmdExit); + } + } + else + { + // if the slide is closed or there is an error, then use the front camera + // check that there is more than 1 camera and that the current orientation is correct + if ( ( iSlideState == CameraPlatPSKeys::EClosed + || slideErr != KErrNone ) + && CamerasAvailable() > 1 ) + { + PRINT( _L("Camera <> CCamAppController::CompleteConstructionL slider is not open" )) + index = 1; + iInfo.iActiveCamera = ECamActiveCameraSecondary; + CamUtility::GetPsiInt( ECamPsiSecondaryCameraOrientation, requiredOrientation ); + } + else // slide is open or using primary camera as default + { + PRINT( _L("Camera <> CCamAppController::CompleteConstructionL slider is open- primary camera in use" )) + index = 0; + iInfo.iActiveCamera = ECamActiveCameraPrimary; + + //when active camera is primary camera,orientation must be landscape, + //so need to fix orientation + if ( ECamOrientationPortrait == appUi->CamOrientation() ) + { + TInt primaryOrientation; + CamUtility::GetPsiInt( ECamPsiPrimaryCameraOrientation, + primaryOrientation ); + appUi->SetOrientationL( ( CAknAppUiBase::TAppUiOrientation ) primaryOrientation ); + appUi->SetCamOrientationToLandscape(); + } + } + } + } + + ConstructCameraControllerL( index ); + + // Send startup sequence ? + + /** + * Removed all custom interfaces requested from engine + */ + iAccSensorListening = EFalse; + + iCallStateAo = CCamCallStateAo::NewL( this ); + + // Use backlight timer instead of every Nth vf frame event + // to reset inactivity timer. This is to avoid adding load + // when higher VF frame rates are used (and overall load is + // already higher). + iBacklightTimer = CPeriodic::NewL( KBacklighTimerPriority ); + +#ifdef _DEBUG +#ifdef _AO_TRACKING + TAny *iAoBacklightTimer = (TAny *)iBacklightTimer; + PRINT2( _L("Camera <> CCamAppController: BacklightTimer=%x, %d"),iBacklightTimer, iAoBacklightTimer ); + CActiveScheduler *pAS = CActiveScheduler::Current(); + CFakeActiveScheduler *pFAS = static_cast(pAS); + pFAS->Extension_( 0, iAoBacklightTimer, (TAny *)("iBacklightTimer") ); +#endif // _AO_TRACKING +#endif // _DEBUG + +#ifdef _DEBUG +#ifdef _AO_TRACKING + TAny *iAoDeepSleepTimer = (TAny *)iDeepSleepTimer; + PRINT2( _L("Camera <> CCamAppController: DeepSleepTimer=%x, %d"),iDeepSleepTimer, iAoDeepSleepTimer ); + CActiveScheduler *pAS2 = CActiveScheduler::Current(); + CFakeActiveScheduler *pFAS2 = static_cast(pAS2); + pFAS2->Extension_( 0, iAoDeepSleepTimer, (TAny *)("iDeepSleepTimer") ); +#endif // _AO_TRACKING +#endif // _DEBUG + + + if ( UiConfigManagerPtr()->IsXenonFlashSupported() ) + { + PRINT( _L("Camera <> CCamAppController: Create flash status observer..") ); + iFlashStatus = CCamFlashStatus::NewL( *this ); + } + + PRINT( _L("Camera <= CCamAppController::CompleteConstructionL" )) + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::GetCriticalMemoryLevelL( const TCamMediaStorage& aStorage ) + { + PRINT( _L("Camera => CCamAppController::GetCriticalMemoryLevelL" ) ) + + // If this is the first call here, get the critical levels from + // Central repository. Later the cached values will be used. + if( KErrNotFound == iRamDiskCriticalLevel + || KErrNotFound == iDiskCriticalLevel ) + { + CRepository* repository = CRepository::NewLC( KCRUidDiskLevel ); + TInt err; + err = repository->Get( KDiskCriticalThreshold , iDiskCriticalLevel ); + if ( KErrNone != err ) + { + CamPanic( ECamPanicDefaultNotFoundInIniFile ); + } + err = repository->Get( KRamDiskCriticalLevel , iRamDiskCriticalLevel ); + if ( KErrNone != err ) + { + CamPanic( ECamPanicDefaultNotFoundInIniFile ); + } + CleanupStack::PopAndDestroy( repository ); + } + + TInt level = ( aStorage == ECamMediaStoragePhone ) + ? iRamDiskCriticalLevel + : iDiskCriticalLevel; + + PRINT1( _L("Camera <= CCamAppController::GetCriticalMemoryLevelL, level:%d" ), level ) + return level; + } + +// --------------------------------------------------------------------------- +// CCamAppController::~CCamAppController +// Destructor +// --------------------------------------------------------------------------- +// +CCamAppController::~CCamAppController() + { + PRINT( _L("Camera => ~CCamAppController") ); + // As a precaution, make sure the screen saver is never left in a disabled state + EnableScreenSaver( ETrue ); + + RProperty::Set( KPSUidCamcorderNotifier, KCCorFocused, 0 ); + + if ( iFlashStatus ) + { + delete iFlashStatus; + } + + delete iSoundPlayer; + + PRINT( _L("Camera <> close observers array..") ); + __ASSERT_DEBUG( iControllerObservers.Count() == 0, CamPanic( ECamPanicResourceLeak ) ); + iControllerObservers.Close(); + + delete iCallStateAo; + + delete iBurstTimer; + +// Using timer also on bitmap mode. + if( iBacklightTimer ) + { + iBacklightTimer->Cancel(); + delete iBacklightTimer; + } + + if( iConfigManager && iConfigManager->IsOrientationSensorSupported() && + iAccSensorListening ) + { + iAccSensorChannel->StopDataListening(); + iAccSensorChannel->CloseChannel(); + } + delete iAccSensorChannel; + + if ( iSlideStateWatcher ) + { + iSlideStateWatcher->Cancel(); + delete iSlideStateWatcher; + } + + if ( iSliderCallBack ) + { + iSliderCallBack->Cancel(); + delete iSliderCallBack; + iSliderCallBack = NULL; + } + + if ( iKeyLockStatusWatcher && iConfigManager && iConfigManager->IsKeyLockWatcherSupported() ) + { + iKeyLockStatusWatcher->Cancel(); + delete iKeyLockStatusWatcher; + } + + if ( iConfigManager && iConfigManager->IsPublishZoomStateSupported() ) + { + TRAP_IGNORE ( PublishZoomStateL( EFalse ) ); + delete iContextFwClient; + } + + if ( iConfigManager && iConfigManager->IsLocationSupported() ) + { + if( iLocationTrailTimer ) + { + iLocationTrailTimer->Cancel(); + delete iLocationTrailTimer; + iLocationTrailTimer = NULL; + } + } + + if ( iConfigManager && iConfigManager->IsLocationSupported() ) + { + // stop trail and close session + StopLocationTrail( ETrue ); + } + + if ( iImageSaveActive ) + { + iImageSaveActive->ForceCancel(); + delete iImageSaveActive; + } + + PRINT( _L("Camera <> delete settingsmodel..") ); + delete iSettingsModel; // Must be before iEngine deleted + iSettingsPreviewHandler = NULL; // Currently the Settings Model object. + iPreviewRollbacks.Close(); + + + delete iCaptureArray; + delete iRotationArray; + if ( iSequenceFilenameArray ) + { + iSequenceFilenameArray->Reset(); + delete iSequenceFilenameArray; + } + + if( iDeepSleepTimer ) + { + iDeepSleepTimer->Cancel(); + delete iDeepSleepTimer; + } + + if( iIdleTimer ) + { + iIdleTimer->Cancel(); + delete iIdleTimer; + } + + if ( iTimeLapseTimer ) + { + iTimeLapseTimer->Cancel(); + delete iTimeLapseTimer; + } + + if( iCaptureToneDelayTimer ) + { + iCaptureToneDelayTimer->Cancel(); + delete iCaptureToneDelayTimer; + } + + delete iCaptureCompletionObserverHandler; + delete iSnapShotCopy; + + iJpegDataSizes.Close(); + iSequencePostProcessDataSizes.Close(); + + // Close the arrays + iPendingObserversArray.Close(); + iCameraEventInterested.Close(); + + // Controller handles releasing CCamera if needed. + PRINT( _L("Camera <> delete camera controller..") ); + delete iCameraController; + PRINT( _L("Camera <> delete setting provider..") ); + delete iSettingProvider; + PRINT( _L("Camera <= ~CCamAppController") ); + + PRINT( _L("Camera <> delete Configuration Manager..") ); + delete iConfiguration; + iConfiguration = NULL; + + RProperty::Delete( KPSUidCamcorderNotifier, KCCorFocused ); + if( iPlugin ) + { + // Destroy Ecom plugin + iPlugin->DestroyPlugin(); + } + iPlugin = NULL; + delete iDriveChangeNotifier; + iFs.Close(); + + if( iRotatorAo ) + { + delete iRotatorAo; + } + PRINT( _L("Camera <= ~CCamAppController") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::SavedCurrentImage +// Returns whether the last requested captured image has been saved or not. +// --------------------------------------------------------------------------- +// +TBool CCamAppController::SavedCurrentImage() const + { + PRINT( _L("Camera => CCamAppController::SavedCurrentImage") ); + TBool saved( ETrue ); + + // If we are waiting for a save request then image has not been saved. + if( iImageSaveRequestPending ) + { + PRINT( _L("Camera <> CCamAppController::SavedCurrentImage: iImageSaveRequestPending") ) + saved = EFalse; + } + else if( CurrentFullFileName() == KNullDesC ) + { + saved = EFalse; + PRINT( _L("Camera <> CCamAppController::SavedCurrentImage: filename not yet reserved") ) + } + else if( !iCaptureArray->AlreadySavedFile( CurrentFullFileName() ) || + iCaptureArray->CurrentlySavingFile( CurrentFullFileName() ) ) + { + PRINT( _L("Camera <> CCamAppController::SavedCurrentImage: capture array not saved file or currently saving file") ) + saved = EFalse; + } + else if ( iInfo.iOperation == ECamCapturing || iInfo.iOperation == ECamCompleting ) + { + PRINT(_L("Camera CCamAppController::SavedCurrentImage returning false, capturing/completing") ) + saved = EFalse; + } + else + { + // empty + } + + PRINT1( _L("Camera <= CCamAppController::SavedCurrentImage, return %d"), saved ); + return saved; + } + +// --------------------------------------------------------------------------- +// CCamAppController::RenameCurrentFileL +// Rename image/video. +// --------------------------------------------------------------------------- +// +TBool +CCamAppController::RenameCurrentFileL( const TDesC& aNewName, + const TCamCameraMode& /*aMode*/ ) + { + TBool status = EFalse; + + // If file to rename has already been saved then remove from album, + // rename the file and add the renamed file to the album. + if ( BurstCaptureArray()->AlreadySavedFile( CurrentFullFileName() ) ) + { + // Rename the file. + TFileName filePath = CurrentFullFileName(); + CamUtility::RenameStillImageL( filePath, aNewName, filePath ); + + // Update capture array with new name and path. + BurstCaptureArray()->SetNameL( filePath, aNewName, iCurrentImageIndex ); + + status = ETrue; + } + // Otherwise, if the file is not currently being saved, modify the names + // in the capture array before it is saved. + else if ( !BurstCaptureArray()->CurrentlySavingFile( CurrentFullFileName() ) ) + { + // Update capture array with new name and path. + // ...determine new path. + TParsePtrC parse( CurrentFullFileName() ); + TFileName fullNewPath; + fullNewPath = parse.DriveAndPath(); + fullNewPath.Append( aNewName ); + fullNewPath.Append( parse.Ext() ); + + BurstCaptureArray()->SetNameL( fullNewPath, aNewName, iCurrentImageIndex ); + + status = ETrue; + } + // Otherwise, the file is in the process of being saved, and + // so that renaming must wait until completed. + else + { + // Leave status to EFalse + } + + return status; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::AddControllerObserverL +// Add a controller observer. +// --------------------------------------------------------------------------- +// +void CCamAppController::AddControllerObserverL( const MCamControllerObserver* aObserver ) + { + if( aObserver && + KErrNotFound == iControllerObservers.Find( aObserver ) ) + { + User::LeaveIfError( iControllerObservers.Append( aObserver ) ); + } + } + +// --------------------------------------------------------------------------- +// CCamAppController::RemoveControllerObserver +// Remove a controller observer. +// --------------------------------------------------------------------------- +// +void CCamAppController::RemoveControllerObserver( const MCamControllerObserver* aObserver ) + { + // Errors ignored + if( aObserver ) + { + TInt index = iControllerObservers.Find( aObserver ); + if( KErrNotFound != index ) + { + iControllerObservers.Remove( index ); + } + } + } + +// --------------------------------------------------------------------------- +// AddCameraObserverL +// --------------------------------------------------------------------------- +// +void +CCamAppController +::AddCameraObserverL( const MCamCameraObserver* aObserver, + const TUint& aEventInterest ) + { + PRINT1( _L("Camera => CCamAppController::AddCameraObserverL aObserver=%d"), aObserver ); + + // First check that observer is not in array already + if( KErrNotFound == iPendingObserversArray.Find( aObserver ) ) + { + PRINT(_L("Camera <> CCamAppController::AddCameraObserverL add Observer") ); + + iPendingObserversArray.AppendL( aObserver ); + iCameraEventInterested.AppendL( aEventInterest ); + } + + if( iCameraController ) + { + PRINT(_L("Camera <> CCamAppController::AddCameraObserverL camera controller available") ); + while ( iPendingObserversArray.Count() > 0 && + iCameraEventInterested.Count() > 0 ) + { + const MCamCameraObserver* camEventObserver = iPendingObserversArray[0]; + TUint eventInterest = iCameraEventInterested[0]; + iCameraController->AttachObserverL( camEventObserver, eventInterest ); + iPendingObserversArray.Remove( 0 ); + iCameraEventInterested.Remove( 0 ); + } + } + PRINT(_L("Camera <= CCamAppController::AddCameraObserverL") ); + } + +// --------------------------------------------------------------------------- +// RemoveCameraObserver +// --------------------------------------------------------------------------- +// +void +CCamAppController +::RemoveCameraObserver( const MCamCameraObserver* aObserver ) + { + if( iCameraController ) + iCameraController->DetachObserver( aObserver ); + } + +// --------------------------------------------------------------------------- +// AddSettingsObserverL +// --------------------------------------------------------------------------- +// +void +CCamAppController +::AddSettingsObserverL( const MCamSettingsModelObserver* aObserver ) + { + if( iSettingsModel ) + iSettingsModel->AttachObserverL( aObserver ); + else + User::Leave( KErrNotReady ); + } + +// --------------------------------------------------------------------------- +// RemoveCameraObserver +// --------------------------------------------------------------------------- +// +void +CCamAppController +::RemoveSettingsObserver( const MCamSettingsModelObserver* aObserver ) + { + if( iSettingsModel ) + iSettingsModel->DetachObserver( aObserver ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::ConstructCameraControllerL( TInt aCameraIndex ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPCONTROLLER_CONSTRUCTCAMERACONTROLLERL, "e_CCamAppController_ConstructCameraControllerL 1" ); + PRINT( _L("Camera => CCamAppController::ConstructCameraControllerL") ) + PERF_EVENT_START_L2( EPerfEventCAEConstruction ); + + if( !iCameraController ) + { + iCameraController = CCamCameraController::NewL( *iSettingProvider, *this, + aCameraIndex ); + //If uiorientationoverride feature is not supported, the camera switch has + // to be finished here + if( !( iConfigManager && iConfigManager->IsUIOrientationOverrideSupported() ) ) + { + iCameraController->CompleteSwitchCameraL(); + } + } + + // Attach as Camera Controller observer to get events + PRINT1( _L("Camera <> Attaching as camera observer with interest:%032b"), KCamEventInterest ); + iCameraController->AttachObserverL( this, KCamEventInterest ); + + + PERF_EVENT_END_L2( EPerfEventCAEConstruction ); + PRINT( _L("Camera <= CCamAppController::ConstructCameraControllerL") ) + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPCONTROLLER_CONSTRUCTCAMERACONTROLLERL, "e_CCamAppController_ConstructCameraControllerL 0" ); + } + +// ################################################################################################# + +// --------------------------------------------------------------------------- +// Returns the current camera controller state +// (Bitfield of type TCamCameraStateFlags ) +// --------------------------------------------------------------------------- +// +TUint +CCamAppController::CameraControllerState() const + { + TUint state( ECamIdle ); + if( iCameraController ) + { + state = iCameraController->State(); + } + PRINT1( _L("Camera =><= CCamAppController::CameraControllerState(): %032b"), state ); + return state; + } + +// --------------------------------------------------------------------------- +// Returns the current camera state +// (TCamCameraState) +// --------------------------------------------------------------------------- +// +TCamCameraState +CCamAppController::CameraState() const + { + TCamCameraState state( ECamCameraIdle ); + + TUint controllerState = CameraControllerState(); + + // Convert controller state to TCamCameraState + // Use the state represented by the "most significant" + // bit in the bitfield. Ignore VF state. + if( IsFlagOn( controllerState, ECamImageOn ) ) + { + state = ECamCameraPreparedImage; + } + else if( IsFlagOn( controllerState, ECamVideoOn ) ) + { + state = ECamCameraPreparedVideo; + } + else if( IsFlagOn( controllerState, ECamPowerOn ) ) + { + state = ECamCameraPowerOn; + } + else if( IsFlagOn( controllerState, ECamReserved ) ) + { + state = ECamCameraReserved; + } + + PRINT1( _L("Camera =><= CCamAppController::CameraState(): %d"), state ); + return state; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamCameraMode +CCamAppController::CurrentMode() const + { + return iInfo.iMode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamCameraMode +CCamAppController::TargetMode() const + { + return iInfo.iTargetMode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +// CCamAppController::CurrentCaptureModeSetup() +TCamImageCaptureMode +CCamAppController::CurrentImageModeSetup() const + { + TCamImageCaptureMode captureMode = ECamImageCaptureSingle; + if( IsAppUiAvailable() ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi->IsBurstEnabled() ) + { + captureMode = appUi->CurrentBurstMode(); + } + } + return captureMode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamCaptureOperation +CCamAppController::CurrentOperation() const + { + return iInfo.iOperation; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamCaptureOperation +CCamAppController::CurrentImageOperation() const + { + if( ECamControllerImage == iInfo.iMode ) + return iInfo.iOperation; + else + return ECamNoOperation; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamCaptureOperation +CCamAppController::CurrentVideoOperation() const + { + if( ECamControllerVideo == iInfo.iMode ) + return iInfo.iOperation; + else + return ECamNoOperation; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamImageCaptureMode CCamAppController::CurrentImageMode() const + { + return iInfo.iImageMode; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamCameraTriState CCamAppController::ViewfinderTargetState() const + { + return iInfo.iTargetVfState; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetMode( const TCamCameraMode& aNewMode ) + { + PRINT3( _L("Camera => CCamAppController::SetMode old[%s] new[%s] target[%s]"), + KCamModeNames[iInfo.iMode], + KCamModeNames[aNewMode], + KCamModeNames[iInfo.iTargetMode] ); + + if( aNewMode != iInfo.iMode ) + { + // In shutdown mode will not accept leaving ECamControllerShutdown state. + TBool newModeNotAccepted = ( IsInShutdownMode() + && ECamControllerShutdown == iInfo.iMode + && ECamControllerShutdown != aNewMode ); + if( !newModeNotAccepted ) + { + iInfo.iMode = aNewMode; + NotifyControllerObservers( ECamEventEngineStateChanged ); + } + else + { + PRINT( _L("Camera <> this mode change not acceptable in shutdown mode!") ); + } + } + PRINT( _L("Camera <= CCamAppController::SetMode") ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetTargetMode( const TCamCameraMode& aNewMode ) + { + PRINT2( _L("Camera =><= CCamAppController::SetTargetMode [%s] -> [%s]"), + KCamModeNames[iInfo.iTargetMode], + KCamModeNames[aNewMode ] ); + + iInfo.iTargetMode = aNewMode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetImageMode( const TCamImageCaptureMode& aNewMode ) + { + PRINT2( _L("Camera =><= CCamAppController::SetImageMode [%s] -> [%s]"), + KCamImageModeNames[iInfo.iImageMode], + KCamImageModeNames[aNewMode ] ); + + iInfo.iImageMode = aNewMode; + // Notify ?? + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetTargetImageMode( const TCamImageCaptureMode& aNewMode ) + { + PRINT2( _L("Camera =><= CCamAppController::SetTargetImageMode [%s] -> [%s]"), + KCamImageModeNames[iInfo.iTargetImageMode], + KCamImageModeNames[aNewMode ] ); + + iInfo.iTargetImageMode = aNewMode; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamAppController::SetOperation( TCamCaptureOperation aNewOperation, + TInt aError /*= KErrNone*/ ) + { + PRINT2( _L("Camera => CCamAppController::SetOperation: [%s] -> [%s]"), + KCamCaptureOperationNames[iInfo.iOperation], + KCamCaptureOperationNames[aNewOperation ] ); + PERF_OPERATION_STATE_CHANGE( aNewOperation ); + + if( iInfo.iOperation != aNewOperation + || aError != KErrNone ) + { + iInfo.iOperation = aNewOperation; + NotifyControllerObservers( ECamEventOperationStateChanged, aError ); + } + + PRINT( _L("Camera <= CCamAppController::SetOperation") ); + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::ImagesRemaining +// Return the number of images that can still be saved +// --------------------------------------------------------------------------- +// +TInt CCamAppController::ImagesRemaining( TCamMediaStorage aStorage, + TBool aBurstActive ) + { + TCamPhotoSizeId size = static_cast + ( iSettingsModel->IntegerSettingValue( ECamSettingItemPhotoSize ) ); + + return ImagesRemaining( aStorage, aBurstActive, size ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::ImagesRemaining +// Return the number of images that can still be saved +// --------------------------------------------------------------------------- +// +TInt CCamAppController::ImagesRemaining( TCamMediaStorage aStorage, + TBool aBurstActive, + TInt aQualityIndex ) + { + TCamPhotoSizeId size = static_cast + ( iSettingsModel->PhotoResolution( aQualityIndex ) ); + + return ImagesRemaining( aStorage, aBurstActive, size ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::ImagesRemaining +// Return the number of images that can still be saved +// --------------------------------------------------------------------------- +// +TInt CCamAppController::ImagesRemaining( TCamMediaStorage aStorage, + TBool aBurstActive, + TCamPhotoSizeId aSize ) + { + PRINT( _L("Camera => CCamAppController::ImagesRemaining" )) + if ( ECamMediaStorageCurrent == aStorage ) + { + TCamMediaStorage store_unfiltered = static_cast + ( IntegerSettingValueUnfiltered( ECamSettingItemPhotoMediaStorage ) ); + + // check to see if the MMC has been removed and we are waiting on a storage switch note + // before we start returning the values for phone memory + if( ECamMediaStorageCard == store_unfiltered + && static_cast( CEikonEnv::Static()->AppUi() )->IsMMCRemovedNotePending() + ) + { + PRINT( _L("Camera <= CCamAppController::ImagesRemaining mmc removed - returning 0" )) + return 0;// UI Behaves as if MMC is still memory in use, thus we return zero images remaining as MMC is removed + } + + // use current storage location + aStorage = static_cast + ( IntegerSettingValue( ECamSettingItemPhotoMediaStorage ) ); + } + else + { + // use specified location + } + + + TInt remaining = 0; + TInt criticalLevel = 0; + + PRINT( _L("Camera <> Get critical memory level.." )) + TRAPD( err, criticalLevel = GetCriticalMemoryLevelL( aStorage ) ); + if( !err ) + remaining = iConfiguration->ImagesRemaining( aStorage, aSize, criticalLevel, aBurstActive ); + + // There is a factor in cenrep that defined a correction factor in percent. + // This feature makes possible to define separate file size estimates in + // burst capture mode. 100 = 100%, 50 = half of single capture size etc. + if ( aBurstActive ) + { + TInt corrFactor = iConfigManager->BurstFileSizeEstimateFactor(); + PRINT1( _L("Camera <> CCamAppController::ImagesRemaining, factor: %d"), corrFactor ) + remaining = TInt( remaining * corrFactor / 100 ); + } + + PRINT1( _L("Camera <= CCamAppController::ImagesRemaining, return:%d"), remaining ) + return remaining; + } + +// --------------------------------------------------------------------------- +// CCamAppController::RecordTimeElapsed +// Return the length of video that has been recorded +// --------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds CCamAppController::RecordTimeElapsed() const + { + return iVideoTimeElapsed; + } + +// --------------------------------------------------------------------------- +// CCamAppController::RecordTimeElapsed +// Return the length of video that has been recorded +// --------------------------------------------------------------------------- +// +void CCamAppController::RecordTimeElapsed(TTimeIntervalMicroSeconds aElapsed ) + { + iVideoTimeElapsed=aElapsed; + } + +// --------------------------------------------------------------------------- +// CCamAppController::RecordTimeRemaining +// Return the length of video that can still be saved +// --------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds +CCamAppController::RecordTimeRemaining() + { + PRINT( _L("Camera => CCamAppController::RecordTimeRemaining" )); + TTimeIntervalMicroSeconds remain( 0 ); + + // All the time we get this information from the CaeEngine which is thru camera controller. + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( appUi->SettingsLaunchedFromCamera() || iDismountPending ) + { + // In case settings plugin is being run or mmc dismount is pending + // due to usb activation, we calculate the remaining time here, + // instead of repreparing the engine and getting it from there + TRAPD( err, iVideoTimeRemaining = CalculateVideoTimeRemainingL() ); + if( KErrNone != err ) + { + iVideoTimeRemaining = 0; + } + } + else + { + if( iInfo.iOperation == ECamCapturing || + iInfo.iOperation == ECamPausing || + iInfo.iOperation == ECamPaused || + iInfo.iOperation == ECamResuming || + iInfo.iOperation == ECamCompleting ) + { + iVideoTimeRemaining = iCameraController->RemainingVideoRecordingTime(); + } + else + { + PRINT( _L("Camera <> CCamAppController::RecordTimeRemaining - video mode not yet initialized" )); + TRAPD( err, iVideoTimeRemaining = CalculateVideoTimeRemainingL() ); + if( KErrNone != err ) + { + iVideoTimeRemaining = 0; + } + } + } + if ( ECamControllerVideo == CurrentMode() && + ECamMediaStorageCard == IntegerSettingValue( ECamSettingItemVideoMediaStorage ) && + appUi->IsMemoryFullOrUnavailable( ECamMediaStorageCard ) ) + { + iVideoTimeRemaining = 0; + } + + // if the storage location is MMC but the MMC is not accessible then + // return 0 time remaining + if ( appUi->IsMMCRemovedNotePending() ) + { + // Return remaining time of zero, it will be reset when + // a card is reinserted or storage location is changed + PRINT( _L("Camera <> MMC note pending, return 0") ); + } + else + { + // If the time we have is greater than the maximum allowed, return the + // maximum + TTimeIntervalMicroSeconds maxRecordingLength( static_cast(KMaxRecordingLength) ); + + if ( iVideoTimeRemaining > maxRecordingLength ) + { + remain = maxRecordingLength; + } + else + { + remain = iVideoTimeRemaining; + } + } + + PRINT1( _L("Camera <= CCamAppController::RecordTimeRemaining, %Ld" ), remain.Int64() ); + return remain; + } + +// --------------------------------------------------------------------------- +// SetNoBurstCancel +// +//Set iNoBurstCancel flag which is used to prevent stopping burst +// when actual burst capture has started after focusing. Flag is +// used in CancelFocusAndCapture method. +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetNoBurstCancel(TBool aValue ) + { + PRINT1 ( _L("Camera =><= CCamAppController::SetNoBurstCancel, aValue=%d"),aValue ); + iNoBurstCancel=aValue; + } + + +// --------------------------------------------------------------------------- +// SoftStopBurstL +// +// Stop burst as soon as possible given the following constrains: +// - if quick burst is ongoing, it's continued to the end, unless +// aFastStop is true. Then the minimum of 2 images is allowed. +// For "immediate" stop, StopSequenceCapture should be used. +// - if press and hold burst is ongoing, stop after next image. +// --------------------------------------------------------------------------- +// +void +CCamAppController::SoftStopBurstL( TBool aFastStop /*=EFalse*/ ) + { + PRINT ( _L("Camera => CCamAppController::SoftStopBurstL") ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + // Still in short burst mode, if + // a) no burst timer at all (long burst not supported) + // b) burst timer still ticking + // c) in self-timer initiated burst, which is always short burst. + TBool shortBurst = ( !iBurstTimer + || iBurstTimer->IsActive() + || appUi->SelfTimerEnabled() ); + + PRINT1( _L("Camera <> CCamAppController::SoftStopBurstL .. is short burst: %d"), shortBurst ); + + StopBurstTimer(); + + if( iSequenceCaptureInProgress ) + { + PRINT ( _L("Camera <> CCamAppController::SoftStopBurstL .. burst ongoing") ); + if( aFastStop || !shortBurst ) + { + // Camera controller takes care of setting "high enough" limit. + // SetCaptureLimitL takes care of setting right count to + // stop as early as possible. + SetCaptureLimitL( 0 ); + } + } + else if( ECamFocusing != iInfo.iOperation && + !iAutoFocusRequested ) + { + PRINT ( _L("Camera <> CCamAppController::SoftStopBurstL .. burst NOT ongoing, just cancel pending..") ); + iCaptureRequested = EFalse; + } + PRINT ( _L("Camera <= CCamAppController::SoftStopBurstL") ); + } + +// --------------------------------------------------------------------------- +// StartBurstTimerL +// --------------------------------------------------------------------------- +// +void +CCamAppController::StartBurstTimerL() + { + PRINT ( _L("Camera => CCamAppController::StartBurstTimerL") ); + if( iBurstTimer ) + { + StopBurstTimer(); + } + else + { + TInt timeout( 0 ); + User::LeaveIfError( CamUtility::GetPsiInt( ECamPsiLongCaptureKeyPressInterval, timeout ) ); + + PRINT1( _L("Camera <> CCamAppController::StartBurstTimerL .. Creating timer with timeout value of [%d ms]"), timeout ); + + // Multiply timeout by 1000 to get microseconds + TCallBack cb( CCamAppController::ShortBurstTimeout, this ); + iBurstTimer = CCamTimer::NewL( timeout*1000, cb ); + } + + PRINT ( _L("Camera <> CCamAppController::StartBurstTimerL .. Starting timer..") ); + iBurstTimer->StartTimer(); + + PRINT ( _L("Camera <= CCamAppController::StartBurstTimerL") ); + } + +// --------------------------------------------------------------------------- +// StopBurstTimer +// --------------------------------------------------------------------------- +// +void +CCamAppController::StopBurstTimer() + { + PRINT( _L("Camera => CCamAppController::StopBurstTimer") ); + if( iBurstTimer ) + { + iBurstTimer->Cancel(); + } + PRINT( _L("Camera <= CCamAppController::StopBurstTimer") ); + } + +// --------------------------------------------------------------------------- +// ShortBurstTimeout +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::ShortBurstTimeout( TAny* aController ) + { + PRINT( _L("Camera => CCamAppController::ShortBurstTimeout") ); + + CCamAppController* self = static_cast( aController ); + TRAP_IGNORE( self->DoShortBurstTimeoutL() ); + + PRINT( _L("Camera <= CCamAppController::ShortBurstTimeout") ); + return KErrNone; // no more callbacks + } + + +// --------------------------------------------------------------------------- +// DoShortBurstTimeoutL +// --------------------------------------------------------------------------- +// +void +CCamAppController::DoShortBurstTimeoutL() + { + PRINT( _L("Camera => CCamAppController::DoShortBurstTimeoutL") ); + PRINT2( _L("Camera <> CCamAppController::DoShortBurstTimeoutL iInfo.iImageMode: %d, iSequenceCaptureInProgress: %d"), iInfo.iImageMode, iSequenceCaptureInProgress ); + if( ECamImageCaptureBurst == iInfo.iImageMode + && iSequenceCaptureInProgress ) + { + TInt longBurstLimit( 0 ); + CamUtility::GetPsiInt( ECamPsiMaxBurstCapture, longBurstLimit ); + + PRINT1( _L("Camera <> CCamAppController::DoShortBurstTimeoutL .. product long burst limit: %d"), longBurstLimit ); + + SetCaptureLimitL( longBurstLimit ); + } + + PRINT( _L("Camera <= CCamAppController::DoShortBurstTimeoutL") ); + } + +// --------------------------------------------------------------------------- +// Actual capture limit value. +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::CaptureLimit() const + { + TInt limit( 1 ); + + if( iCameraController && ECamImageCaptureBurst == iInfo.iImageMode ) + { + limit = iCameraController->ControllerInfo().iCaptureLimit; + } + + return limit; + } + +// --------------------------------------------------------------------------- +// CaptureLimitSetting +// +// Stored for Setting Provider to give to Camera Controller. +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::CaptureLimitSetting() const + { + TInt limit( 1 ); + + if( ECamImageCaptureBurst == iInfo.iTargetImageMode ) + { + limit = iRequestedCaptureCount; + } + + return limit; + } + +// --------------------------------------------------------------------------- +// SetCaptureLimitL +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetCaptureLimitL( TInt aLimit ) + { + PRINT1( _L("Camera => CCamAppController::SetCaptureLimitL .. requested limit: %d"), aLimit ); + + if( ECamImageCaptureBurst == iInfo.iTargetImageMode ) + { + PRINT ( _L("Camera <> CCamAppController::SetCaptureLimitL .. burst mode active") ); + // We give the total amount of images during burst, not the remaining ones. + // Need to subtract captures that have already been taken, + // before comparing to the disk limit. + if( iSequenceCaptureInProgress ) + { + //TInt captured = iCameraController->ControllerInfo().iCaptureCount; + TInt captured = iCameraController->ControllerInfo().iSnapshotCount; + PRINT1( _L("Camera <> CCamAppController::SetCaptureLimitL .. captured already: %d"), captured ); + + if( aLimit > captured ) + { + PRINT ( _L("Camera <> CCamAppController::SetCaptureLimitL .. some more captures requested..") ); + + // Check which is more restrictive - disk space or given limit. + TInt diskLimit = ImagesRemaining( ECamMediaStorageCurrent, ETrue ); + TInt remaining = Min( aLimit - captured, diskLimit ); + + PRINT1( _L("Camera <> CCamAppController::SetCaptureLimitL .. disk limit: %d"), diskLimit ); + + iRequestedCaptureCount = Max( KMinBurstCount, captured + remaining ); + if ( diskLimit - KMinBurstCount < iRequestedCaptureCount ) + { + // Estimated file size is not worst case estimate and long burst + // sequence accumulates error, thus critical disk space limit may + // be reached. Requested capture count is decreased here if needed. + iRequestedCaptureCount -= + (iRequestedCaptureCount+KMinBurstCount)/KBurstEstimate; + PRINT( _L("Camera <> CCamAppController::SetCaptureLimitL .. Near to critical level, adjust iRequestedCaptureCount")); + } + } + else + { + PRINT ( _L("Camera <> CCamAppController::SetCaptureLimitL .. capturing should be stopped as soon as possible..") ); + // Stop as fast as possible requested. + // Still need to request minimum of 2. + iRequestedCaptureCount = Max( KMinBurstCount, captured + 1 ); + } + } + // Not capturing - adjust freely + else + { + TInt diskLimit = ImagesRemaining( ECamMediaStorageCurrent, ETrue ); + PRINT1( _L("Camera <> CCamAppController::SetCaptureLimitL .. disk limit: %d"), diskLimit ); + + iRequestedCaptureCount = Max( KMinBurstCount, Min( aLimit, diskLimit ) ); + } + + PRINT1( _L("Camera <> CCamAppController::SetCaptureLimitL .. setting the request limit to: %d"), iRequestedCaptureCount ); + + // In burst mode camera needs to be updated with the limit. + iCameraController->DirectSettingsChangeL( ECameraSettingCaptureLimit ); + } + else + { + PRINT ( _L("Camera <> CCamAppController::SetCaptureLimitL .. single / timelapse mode active") ); + TInt diskLimit = ImagesRemaining( ECamMediaStorageCurrent, EFalse ); + PRINT1( _L("Camera <> CCamAppController::SetCaptureLimitL .. disk limit: %d"), diskLimit ); + + iRequestedCaptureCount = Min( aLimit, diskLimit ); + + PRINT1( _L("Camera <> CCamAppController::SetCaptureLimitL .. setting the request limit to: %d"), iRequestedCaptureCount ); + } + PRINT ( _L("Camera <= CCamAppController::SetCaptureLimitL") ); + } +// --------------------------------------------------------------------------- +// CCamAppController::SetTimeLapseInterval +// Updates the interval used in next TimeLapse capture +// --------------------------------------------------------------------------- +// +void CCamAppController::SetTimeLapseInterval( TTimeIntervalMicroSeconds aInterval ) + { + iTimeLapseInterval = aInterval; + } + +// --------------------------------------------------------------------------- +// CCamAppController::TimeLapseInterval +// Returns the interval used in next TimeLapse capture +// --------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds CCamAppController::TimeLapseInterval() + { + return iTimeLapseInterval; + } + +// --------------------------------------------------------------------------- +// CCamAppController::TimeLapseCountdown +// Returns the remaining time lapse interval until the next capture +// --------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds CCamAppController::TimeLapseCountdown() + { + TInt64 remainingTime( 0 ); // Assume uninitialised start time + + // If the start time is uninitialised then the first capture is about to be initiated + if ( iTimeLapseStartTime == remainingTime ) + { + return remainingTime; + } + // Otherwise, work out how much time is left before the next capture + TTime now; + now.HomeTime(); + TTimeIntervalMicroSeconds elapsedTime = now.MicroSecondsFrom( iTimeLapseStartTime ); + remainingTime = Max ( remainingTime, iTimeLapseInterval.Int64() - elapsedTime.Int64() ); + return remainingTime; + } + +// --------------------------------------------------------------------------- +// CCamAppController::StartAutoFocus +// Start the autofocus procedure +// --------------------------------------------------------------------------- +// +void CCamAppController::StartAutoFocus() + { + PRINT (_L("Camera => CCamAppController::StartAutoFocus")); + PRINT1(_L("Camera <> CCamAppController::StartAutoFocus - CurrentOperation() = [%s]"), KCamCaptureOperationNames[iInfo.iOperation] ); + PRINT1(_L("Camera <> CCamAppController::StartAutoFocus - IsViewFinding() = [%d]"), IsViewFinding() ); + + if( iConfigManager + && iConfigManager->IsAutoFocusSupported() + && IsViewFinding() + && !iAFCancelInProgress + && ECamNoOperation == iInfo.iOperation ) + { + + PRINT(_L("Camera <> Calling TryAutoFocus" ) ); + TryAutoFocus(); + } + PRINT(_L("Camera <= CCamAppController::StartAutoFocus")); + } + +// --------------------------------------------------------------------------- +// CCamAppController::Capture +// Begin the capture procedure +// --------------------------------------------------------------------------- +// +void CCamAppController::Capture() + { + PRINT2( _L("Camera => CCamAppController::Capture(), operation[%s], iSaving:%d"), + KCamCaptureOperationNames[iInfo.iOperation], + iSaving ); + + // If the camera orientation changed during capture and not in burst mode, + // set the new orientation + if ( iConfigManager && iConfigManager->IsOrientationSensorSupported() + && iOrientationChangeOccured + && iInfo.iImageMode != ECamImageCaptureBurst ) + { + iOrientationChangeOccured = EFalse; + TRAP_IGNORE( SetImageOrientationL() ); + } + if( iConfigManager && iConfigManager->IsOrientationSensorSupported() && !iAccSensorListening ) + { + // Delayed sensor initialization has not yet happened, but shutter key has been pressed. + // Force initialization now, causing an addition to shutter lag - this is a very + // rare case, as there should always be enough idle time to run the delayed + // initialization. + TRAP_IGNORE( UpdateSensorApiL( ETrue ) ); + } + + PERF_EVENT_END_L1( EPerfEventKeyToCapture ); + + // Set to EFalse for burst + iAllSnapshotsReceived = EFalse; + + if ( ECamFocusing == iInfo.iOperation || + iAFCancelInProgress || + iAutoFocusRequested || IsAfNeeded() ) + { + PRINT( _L("Camera <> Focusing going on, cannot start capture - setting iCaptureRequested" ) ); + if( !IsAfNeeded() ) + { + CancelAFNow(); + } + iCaptureRequested = ETrue; + } + // ------------------------------------------------------- + //Quick pressed capture key after backing to precapture from postcapture in burst mode + //Quick pressed capture key during cancelling autofocus(eg. backing to precapture from setting view ) + else if ( ECamNoOperation == iInfo.iOperation + && ( ( ECamImageCaptureTimeLapse == iInfo.iImageMode ) + || ( ECamImageCaptureBurst == iInfo.iImageMode ) + || ( ECamImageCaptureSingle == iInfo.iImageMode ) ) + && iAFCancelInProgress ) + { + PRINT(_L("Camera <> Cancelling auto focus going on, cannot start capture - setting iCaptureRequested")); + // delay the start of capture until cancelling autofocus has finished + iCaptureRequested = ETrue; + } + // ------------------------------------------------------- + // Quick pressed after capture, during image processing + else if ( ECamCompleting == iInfo.iOperation + && ECamImageCaptureSingle == iInfo.iImageMode ) + { + PRINT(_L("Camera <> operation state is capture completing setting iCaptureRequested")); + // delay the start of capture until current capture has finished + iCaptureRequested = ETrue; + } + // ------------------------------------------------------- + // Ready for new shot + else if( ECamNoOperation == iInfo.iOperation + || ECamFocused == iInfo.iOperation + || ECamFocusFailed == iInfo.iOperation ) + { + PRINT(_L("Camera <> operation state is no operation")); + + // Update current capture mode +// iInfo.iImageMode = CurrentImageModeSetup(); + + if ( iConfigManager && iConfigManager->IsAutoFocusSupported() ) + { + // If AF sound hasn't finished playing yet, stop it now + // to make sure it does not block capture sound playing. + iSoundPlayer->CancelPlaying( ECamAutoFocusComplete ); + } + +#ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT + if( ECamImageCaptureBurst != iInfo.iImageMode ) + { + // Do not log the single image start events in burst mode, as the end + // events would arrive for all images at once after all images have been taken + PERF_EVENT_START_L1( EPerfEventShotToSnapshot ); + PERF_EVENT_START_L1( EPerfEventShotToStillImageReady ); + PERF_EVENT_START_L1( EPerfEventShotToSave ); + } + else + { + PERF_EVENT_START_L1( EPerfEventSequenceCapture ); + } +#endif // CAMERAAPP_PERFORMANCE_MEASUREMENT + + if( ECamImageCaptureTimeLapse == iInfo.iImageMode && + !iSequenceCaptureInProgress ) + { + // First image of timelapse, reset capture count + iTimeLapseCaptureCount = 0; + } + + if( iInfo.iImageMode == ECamImageCaptureNone ) + { + PRINT(_L("Camera <= CCamAppController::Capture() - request ignored")); + return; + } + + // iCaptureRequested is reset in DoCaptureL + TBool capture = EFalse; + TInt err = KErrNone; + iFilenameReserved = EFalse; + TRAP( err, capture = DoCaptureL() ); + if ( KErrNone != err ) + { + // Sequence capture is not in progress as capture failed + iSequenceCaptureInProgress = EFalse; + } + + PRINT1( _L("Camera <> Tried to start capture, status:%d"), capture ); + if ( capture ) + { + if( ECamActiveCameraPrimary == iInfo.iActiveCamera + && iConfigManager && iConfigManager->IsCaptureToneDelaySupported() ) + { + // first cancel to make sure + iCaptureToneDelayTimer->Cancel(); + // delay playing of capture tone + iCaptureToneDelayTimer->StartTimer(); + } + else + { + // Play capture sound + PlaySound( CaptureToneId(), EFalse ); + } + } + } + // ------------------------------------------------------- + // Not ready for a capture + else + { + // request ignored + } + // ------------------------------------------------------- + PRINT(_L("Camera <= CCamAppController::Capture()")); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::StopSequenceCaptureL +// Stop and complete the burst capture operation +// --------------------------------------------------------------------------- +// +void CCamAppController::StopSequenceCaptureL() + { + PRINT( _L("Camera => CCamAppController::StopSequenceCaptureL()") ); + + iSequenceCaptureInProgress = EFalse; + iNoBurstCancel = EFalse; + + // Re-enable screen saver + EnableScreenSaver( ETrue ); + + TCamImageCaptureMode captureModeSetup = CurrentImageModeSetup(); + // Test that this method was not called in single capture mode + __ASSERT_DEBUG( captureModeSetup != ECamImageCaptureSingle, CamPanic( ECamPanicInvalidState ) ); + + // If a burst sequence is currently active or has been requested + if ( iInfo.iImageMode == ECamImageCaptureBurst + || ( captureModeSetup == ECamImageCaptureBurst && iCaptureRequested ) ) + { + IssueDirectRequestL( ECamRequestImageCancel ); + if ( iInfo.iOperation != ECamCapturing ) + { + CompleteBurstOperation(); + } + + } + // If a timelapse sequence is currently active or has been requested + else if ( iInfo.iImageMode == ECamImageCaptureTimeLapse || + ( captureModeSetup == ECamImageCaptureTimeLapse && + iCaptureRequested ) ) + { + if ( TimeLapseSupported() ) + { + if ( iTimeLapseTimer ) + { + iTimeLapseTimer->Cancel(); + delete iTimeLapseTimer; + iTimeLapseTimer = NULL; + } + + // The current state is in between captures the next one has now been cancelled + // so just ensure that the view switch occurs + // if ( iInfo.iOperation != ECamCapturing && !iCaptureRequested ) + if ( iInfo.iOperation != ECamCapturing ) + { + CompleteTimeLapseOperation(); + } + // Either the first capture is queued or a capture is still in stages of + // completion. Any future capture has been cancelled so all that remains is to ensure the + // completion code is run when the capture finally completes + else + { + iCompleteTimeLapsePending = ETrue; + } + } + } + else // Otherwise there is no active or pending burst + { + // Do nothing + } + + PRINT( _L("Camera <= CCamAppController::StopSequenceCaptureL()") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::CapturePending +// Whether or not a capture is pending +// --------------------------------------------------------------------------- +// +TBool CCamAppController::CapturePending() const + { + // iOperation can be ECamFocusing but a + // request to start still capture has been made and is waiting for the + // focus operation to complete + return iCaptureRequested; + } + +// --------------------------------------------------------------------------- +// CCamAppController::VideoRecordPending +// Whether or not video recording is pending +// --------------------------------------------------------------------------- +// +TBool CCamAppController::VideoRecordPending() const + { + // iOperation can be ECamFocusing but a + // request to start video has been made and is waiting for the + // focus operation to complete + return iVideoRequested; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SequenceCaptureInProgress +// Whether or not sequence capture is active +// --------------------------------------------------------------------------- +// +TBool CCamAppController::SequenceCaptureInProgress() const + { + return iSequenceCaptureInProgress; + } + +// ----------------------------------------------------------------------------- +// CCamAppController::StartVideoRecordingL +// Begin the video recording procedure +// ----------------------------------------------------------------------------- +// +void CCamAppController::StartVideoRecordingL() + { + PRINT( _L("Camera => CCamAppController::StartVideoRecordingL") ); + __ASSERT_DEBUG( iCameraController, CamPanic( ECamPanicInvalidState ) ); + if( ECamControllerVideo == iInfo.iMode ) + { + if( !iVideoRequested + && ECamNoOperation == iInfo.iOperation ) + { + iVideoRequested = ETrue; + if( !iSilentProfile || iShutterSndAlwaysOn ) + { + // Load (and play) the start video sound + PlaySound( ECamVideoStartSoundId , ETrue ); + } + + // initialise the array accessing values + iArrayUsageCount = KVideoArrayUsers; + iCurrentImageIndex = 0; + + if( ECamMediaStorageCard == + IntegerSettingValue( ECamSettingItemVideoMediaStorage ) ) + { + TRAPD( err, ReserveFileNamesL( iInfo.iMode, ECamImageCaptureNone ) ); + if ( err ) + { + PRINT( _L("Camera <> invalid MMC") ); + NotifyControllerObservers( ECamEventInvalidMemoryCard ); + + // If we have got here, we can't access MMC. Switch to phone memory + TRAP_IGNORE( ForceUsePhoneMemoryL() ); //with multiple drive support, + //this actually uses the internal mass memory + // Ignore for now, let fail when recording. + TRAP_IGNORE( ReserveFileNamesL( iInfo.iMode, ECamImageCaptureNone, ETrue ) ); + } + } + else + { + // Ignore for now, let fail when recording. + TRAP_IGNORE( ReserveFileNamesL( iInfo.iMode, ECamImageCaptureNone ) ); + } + + if( iSilentProfile && !iShutterSndAlwaysOn ) + { + PlaySoundComplete(); + } + // Remember where are we recording + iInitialVideoStorageLocation = static_cast( + IntegerSettingValue( ECamSettingItemVideoMediaStorage ) ); + } + else + { + // Video already requested or other operation busy. + // Request ignored. + } + } + // Note: The code to actually START video recording has been moved + // to the PlaySoundComplete function so as to only start when + // sound playback has completed. + } + +// --------------------------------------------------------------------------- +// CCamAppController::StopVideoRecording +// End the video recording procedure +// --------------------------------------------------------------------------- +// +void +CCamAppController::StopVideoRecording() + { + PRINT( _L("Camera => CCamAppController::StopVideoRecording") ); + // if a video capture operation is pending + if ( iVideoRequested ) + { + iVideoRequested = EFalse; + } + // otherwise, if a video recording operation is in progress or is paused + /* else */ + if ( ECamCapturing == CurrentVideoOperation() + || ECamPaused == CurrentVideoOperation() ) + { + // TRAPD( err, iAutoFocus->StopContinuousFocusL() ); + // iFocusLocked = EFalse; + // Keep track of the fact we are now in "saving" state + iSaving = ETrue; + TRAP_IGNORE( + { + // IssueDirectRequestL( ECamRequestVfStop ); + StopViewFinder(); + IssueRequestL( ECamRequestVideoStop ); // Rest handled when event comes. + }); + + StartIdleTimer(); + } + else + { + // otherwise there is no current recording operation + } + PRINT( _L("Camera <= CCamAppController::StopVideoRecording") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::StopVideoRecordingAsync +// End the video recording procedure asynchronously +// --------------------------------------------------------------------------- +// +void +CCamAppController::StopVideoRecordingAsync() + { + PRINT( _L("Camera => CCamAppController::StopVideoRecordingAsync") ); + + // Change CAE and MMF mode to async + TRAP_IGNORE( IssueRequestL( ECamRequestSetAsyncVideoStopMode ) ); + StopVideoRecording(); // Call normal stop, mode is set to sync in call-backs + + PRINT( _L("Camera <= CCamAppController::StopVideoRecordingAsync") ); + } + +// --------------------------------------------------------------------------- +// HandleVideoAsyncStopEvent +// --------------------------------------------------------------------------- +// +void +CCamAppController::HandleVideoAsyncStopEvent( TInt aStatus ) + { + PRINT1( _L( "Camera => CCamAppController::HandleVideoAsyncStopEvent, status:%d" ), aStatus ); + (void)aStatus; // remove compiler warning + + // We DO NOT play the stop sound when recording stopped due to + // an incoming call. UI Spec 1.0, 4.4.1. + if ( !iInCallOrRinging + && !iVideoStoppedForPhoneApp ) + { + PlaySound( ECamVideoStopSoundId, EFalse ); // No callback + } + + // Recording completed, so we can re-enable key sounds + iSoundPlayer->EnableAllKeySounds(); + + PRINT( _L( "Camera <= CCamAppController::HandleVideoAsyncStopEvent" ) ); + } + +// --------------------------------------------------------------------------- +// HandleVideoStopEvent +// --------------------------------------------------------------------------- +// +void +CCamAppController::HandleVideoStopEvent( TInt aStatus ) + { + PRINT1( _L( "Camera => CCamAppController::HandleVideoStopEvent, status:%d" ), aStatus ); + + PERF_EVENT_END_L1( EPerfEventVideoStopToSave ); + + if ( KErrDiskFull == aStatus + || KErrCompletion == aStatus) + { + // if recording ends due to disk full condition or end of + // specified recording period do not propogate the error + aStatus = KErrNone; + } + // Play sound here if async mode is not supported + // If it is then next playing is copyed to HandleVideoAsyncStopEvent + if ( iCameraController && !iCameraController->AsyncVideoStopModeSupported() ) + { + // We DO NOT play the stop sound when recording stopped due to + // an incoming call. UI Spec 1.0, 4.4.1. + if ( !iInCallOrRinging + && !iVideoStoppedForPhoneApp ) + { + PlaySound( ECamVideoStopSoundId, EFalse ); // No callback + } + + // Recording completed, so we can re-enable key sounds + iSoundPlayer->EnableAllKeySounds(); + } + // Keep track of the fact we are now leaving saving state + iSaving = EFalse; + + // try closing video record to free up resources + // Test - commented out, no such direct request supported + // TRAP_IGNORE( IssueDirectRequestL( ECamRequestVideoRelease ) ); + + // if video post capture is off then force re-prepare so + // that remaining record time is updated + // REMOVED + + // if using direct viewfinding pause viewfinder + // REMOVED + + // report to LifeBlog + RProperty::Set( KPSUidCamcorderNotifier, KCamLatestFilePath, iSuggestedVideoPath ); + // Add to album if this is enabled for videos + TUint32 defaultAlbumId = static_cast( + IntegerSettingValue( ECamSettingItemDefaultAlbumId )); + if ( iSettingsModel->IntegerSettingValue + ( ECamSettingItemVideoStoreInAlbum ) == ECamSettYes ) + { + iImageSaveActive->AddToAlbum( iSuggestedVideoPath, ETrue, defaultAlbumId ); + } + else // Harvest the file but dont add to the default album + { + iImageSaveActive->AddToAlbum( iSuggestedVideoPath, EFalse, defaultAlbumId ); + } + + //create thumbnail + if( iConfigManager && iConfigManager->IsThumbnailManagerAPISupported() ) + { + TRAP_IGNORE( iImageSaveActive->CreateThumbnailsL( *BurstCaptureArray() ) ); + } + NotifyControllerObservers( ECamEventRecordComplete, aStatus ); + SetOperation( ECamNoOperation ); + PRINT( _L( "Camera <> calling HandleCaptureCompletion.." ) ) + HandleCaptureCompletion(); + NotifyControllerObservers( ECamEventMediaFileChanged, aStatus ); + PRINT( _L( "Camera <= CCamAppController::HandleVideoStopEvent" ) ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::SetVideoStoppedForPhoneApp +// Store the cause of the video stopping +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetVideoStoppedForPhoneApp( TBool aIsPhoneApp ) + { + iVideoStoppedForPhoneApp = aIsPhoneApp; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::PauseVideoRecording +// Pause the video recording procedure +// --------------------------------------------------------------------------- +// +void CCamAppController::PauseVideoRecording() + { + PRINT( _L("Camera => CCamAppController::PauseVideoRecording") ); + if( ECamCapturing == CurrentVideoOperation() ) + { + TRAPD( error, IssueRequestL( ECamRequestVideoPause ) ); + if( KErrNone != error ) + { + PRINT( _L("Camera <> PAUSING FAILED!!") ); + } + else + { + // start video pause timeout + StartIdleTimer(); + } + } + PRINT( _L("Camera <= CCamAppController::PauseVideoRecording") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::ContinueVideoRecording +// Continue the video recording procedure +// --------------------------------------------------------------------------- +// +void CCamAppController::ContinueVideoRecording() + { + PRINT( _L("Camera => CCamAppController::ContinueVideoRecording") ); + if ( ECamPaused == CurrentVideoOperation() ) + { + SetOperation( ECamResuming ); + // Restart video when sound played + PlaySound( ECamVideoResumeSoundId, ETrue ); + } + PRINT( _L("Camera <= CCamAppController::ContinueVideoRecording") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::TryAFRequest +// issue AF request if there are no pending AF requests currently +// --------------------------------------------------------------------------- +// +TBool CCamAppController::TryAFRequest( TInt aAFRequest ) + { + PRINT( _L( "Camera => TryAFRequest") ); + PRINT3( _L( "iPendingAFRequest=%d aAFRequest=%d ,iCurrentAFRequest=%d"), iPendingAFRequest, + aAFRequest, iCurrentAFRequest ); + switch( aAFRequest ) + { + case ECamRequestCancelAutofocus: + case ECamRequestStartAutofocus: + { + if(iPendingAFRequest==0) + { + if ( !( UiConfigManagerPtr()->IsContinuosAutofocusSupported()&& ECamControllerVideo == CurrentMode() ) ) + { + iPendingAFRequest=aAFRequest; + TRAPD( err, IssueDirectRequestL( TCamCameraRequestId(aAFRequest) ) ); + //TRAPD( err, iCameraController->DirectRequestL( aAFRequest ) ); + if ( err != KErrNone ) + { + // There is an error, we leave without focusing + iPendingAFRequest=0; + return EFalse; // Not doing any autofocus request. + //This is only case where AFrequest cause EFalse to be returned. + } + } + } + else + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi->AlwaysDrawPreCaptureCourtesyUI() + && !CurrentSceneHasForcedFocus() ) + { + appUi->SetActivePaletteVisibility( EFalse ); + } + iPendingAFRequest=aAFRequest; + } + } + break; + default: + { + //Not type of autofocus request. Ignoring. + } + break; + } + PRINT( _L( "Camera <= TryAFRequest") ); + return ETrue; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CancelAFNow +// Cancel AutoFocus +// --------------------------------------------------------------------------- +// +void CCamAppController::CancelAFNow() + { + PRINT( _L("Camera => CCamAppController::CancelAfNow()") ); + + if( !iAFCancelInProgress && ECamFocusing == CurrentOperation() ) + { + TRAPD( err, IssueDirectRequestL( ECamRequestCancelAutofocus ) ); + if( KErrNone == err ) + { + iAFCancelInProgress = ETrue; + iCurrentAFRequest = ECamRequestCancelAutofocus; + iPendingAFRequest = ECamRequestCancelAutofocus; + } + } + else + { + PRINT( _L("AF Cancel already in progress or not focusing") ); + } + + PRINT( _L("Camera <= CCamAppController::CancelAfNow()") ); + } +// CCamAppController::CancelFocusAndCapture +// Cancel the focus and capture procedures +// --------------------------------------------------------------------------- +// +void CCamAppController::CancelFocusAndCapture() + { + PRINT( _L( "Camera => CCamAppController::CancelFocusAndCapture") ); + PRINT1( _L("Camera <> CCamAppController::CancelFocusAndCapture - CurrentOperation() = [%s]"), KCamCaptureOperationNames[iInfo.iOperation] ); + PRINT1( _L("Camera <> CCamAppController::CancelFocusAndCapture - IsViewFinding() = [%d]"), IsViewFinding() ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + // Only cancels autofocus if needed, burst capture is no longer + // stopped if capture key pressed during burst + + if( !iNoBurstCancel + && ECamNoOperation != CurrentOperation() + && ECamCompleting != CurrentOperation() ) + { + // If we are currently focused, cancel autofocus + if ( IsViewFinding() && CurrentOperation() != ECamCapturing ) // Cannot do AF operations if VF not on. AF is anyway cancelled on VF start event. + { + if( ECamFocusing == CurrentOperation() ) + { + CancelAFNow(); + if ( IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( ETrue ); + } + } + } + else + { + TryAFRequest( ECamRequestCancelAutofocus ); + } + } + iCaptureRequested = EFalse; + } + PRINT( _L( "Camera <= CCamAppController::CancelFocusAndCapture") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::SnapshotImage +// Get post-exposure snapshot bitmap, if available. +// +// Returns: pointer to post-exposure snapshot bitmap. Does not transfer ownership. +// May be NULL if no image available. +// +// --------------------------------------------------------------------------- +// +const CFbsBitmap* +CCamAppController::SnapshotImage() const + { + PRINT ( _L("Camera => CCamAppController::SnapshotImage") ); + PRINT1( _L("Camera <> CCamAppController::SnapshotImage .. current image index: %d"), iCurrentImageIndex ); + PRINT1( _L("Camera => CCamAppController::SnapshotImage .. saved current image: %d"), SavedCurrentImage() ); + + //Sometime burst capture array includes more than one image in single capture mode, + //so just display the latest image here. + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( BurstCaptureArray()->Count() > 1 && !appUi->IsBurstEnabled() ) + { + TInt currentImageIndex = BurstCaptureArray()->Count() - 1; + const CFbsBitmap* ss = BurstCaptureArray()->Snapshot( currentImageIndex ); + PRINT( _L("Camera <= CCamAppController::SnapshotImage") ); + return ss; + } + + const CFbsBitmap* ss = BurstCaptureArray()->Snapshot( iCurrentImageIndex ); + PRINT( _L("Camera <= CCamAppController::SnapshotImage") ); + return ss; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::SetAsCurrentImage +// Sets the specified index as the "current image", as will be used by the +// post capture view +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetAsCurrentImage( TInt aIndex ) + { + iCurrentImageIndex = aIndex; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CurrentImageName +// Get the user-visible name for the current image +// used in post-capture views. +// --------------------------------------------------------------------------- +// +const TDesC& +CCamAppController::CurrentImageName() const + { + return BurstCaptureArray()->ImageName( iCurrentImageIndex ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::BurstCaptureArray +// Return a pointer to the array representing a burst capture +// --------------------------------------------------------------------------- +// +CCamBurstCaptureArray* +CCamAppController::BurstCaptureArray() const + { + return iCaptureArray; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CurrentItemCount +// Return the count of non-deleted items in the burst array +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::CurrentItemCount() + { + if ( !BurstCaptureArray() ) + { + return 0; + } + return BurstCaptureArray()->ImagesRemaining(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::CurrentCapturedCount +// Return the count of burst capture moments that have taken +// place in a current burst +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::CurrentCapturedCount() + { + //return iActualBurstCount; + TInt count( 0 ); + if( iCameraController ) + { + // Using snapshot as count, because UI updates counter + // on snapshot events. + count = iCameraController->ControllerInfo().iSnapshotCount; + } + return count; + } + +// --------------------------------------------------------------------------- +// CCamAppController::TimeLapseImageCount +// Return the count of items in the timelapse sequence array +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::TimeLapseImageCount() + { + return iTimeLapseCaptureCount; + } + +// --------------------------------------------------------------------------- +// CCamAppController::ResetTimelapseArray +// Resets the timelapse sequence array +// --------------------------------------------------------------------------- +// +void CCamAppController::ResetTimelapseArray() + { + iSequenceFilenameArray->Reset(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::PlaySound +// Play a sound with given id. +// --------------------------------------------------------------------------- +// +void CCamAppController::PlaySound( TCamSoundId aSoundId, TBool aEnableCallback ) + { + PRINT1( _L("Camera => CCamAppController::PlaySound %d"), aSoundId ); + if ( ToneShouldBeSilent( aSoundId ) && + !iShutterSndAlwaysOn && + iSilentProfile ) + { + PRINT( _L("Camera <> Profile silent, do not play sound") ); + // Don't play shutter sound if we are following + // current profile setting and profile is silent. + // Notify the observer right away. E.g. video start + // depends on the notification + if( aEnableCallback ) + { + PlayComplete( aSoundId, KErrNone ); + } + /* OLD + if ( aSoundId == ECamVideoStartSoundId || + aSoundId == ECamVideoPauseSoundId || + aSoundId == ECamVideoResumeSoundId ) + { + // Force the callback to start recording without sound. + PlaySoundComplete(); + } + */ + } + else + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_PLAYSOUND, "e_CAM_APP_CAPTURE_SOUND_PLAY 1" ); //CCORAPP_CAPTURE_SOUND_PLAY_START + iSoundPlayer->CancelAllPlaying(); + iSoundPlayer->PlaySound( aSoundId, aEnableCallback ); + + } + + // If in timelapse mode the remaining time counter should be updated + // as soon as the capture tone has played, but as there is no callback + // this is the closest we can get + if ( ECamImageCaptureTimeLapse == iInfo.iImageMode ) + { + NotifyControllerObservers( ECamEventCounterUpdated ); + } + + PRINT( _L("Camera <= CCamAppController::PlaySound") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::PlayTone +// Play a tone with specified frequency, period and volume +// --------------------------------------------------------------------------- +// +void CCamAppController::PlayTone( TInt aToneHz, + TInt aLenMicSec, + TReal32 aVolume, + TBool aEnableCallback ) + { + if ( !iShutterSndAlwaysOn && + iSilentProfile ) + { + // don't play shutter sound if we are following + // current profile setting and profile is silent + } + else + { + iSoundPlayer->PlayTone( aToneHz, aLenMicSec, aVolume, aEnableCallback ); + } + } + +// --------------------------------------------------------------------------- +// CCamAppController::AllOptionsVisibleForSettingItem +// Returns true if all the settings list options for a particular setting +// item are visible. +// --------------------------------------------------------------------------- +// +TBool CCamAppController::AllOptionsVisibleForSettingItem( TInt aSettingItem, + TInt& aRevisedResourceId ) + { + if ( ( aSettingItem == ECamSettingItemVideoQuality ) && + ( iInfo.iActiveCamera == ECamActiveCameraSecondary ) ) + { + aRevisedResourceId = ROID(R_CAM_FRONT_CAMERA_VIDEO_QUALITY_TEXT_ARRAY); + return EFalse; + } + // Otherwise, all options are visible for the setting item + return ETrue; + } + +// ---------------------------------------------------- +// CCamAppController::SwitchCameraL +// Switch the camera +// ---------------------------------------------------- +// +void CCamAppController::SwitchCameraL() + { + PRINT( _L("Camera => CCamAppController::SwitchCameraL") ); + + TCamAppControllerInfo oldInfo = iInfo; + TCamActiveCamera targetCamera = ECamActiveCameraNone; + // If something goes wrong when changing from 2nd to 1st camera, + // we need to make sure, that 2nd cam settings are not stored + // to CR by accident. + iInfo = TCamAppControllerInfo(); // reset + + // reset zoom waiting flag. this flag is only used with bitmap viewfinder + // and it might cause problems if one camera uses bitmap viewfinder and the + // other one uses direct viewfinder + iZoomWaitingForCamera = EFalse; + + CancelPreviewChangesL(); + + if( ECamActiveCameraPrimary == oldInfo.iActiveCamera ) + { + // Currently using primary camera, switch to secondary + PRINT( _L("Camera <> switch to 2nd cam") ); + +#ifdef _DEBUG + PRINT ( _L("Camera <> ======================================") ); + PRINT ( _L("Camera <> Photo quality index: ") ); + PRINT1( _L("Camera <> Before loading 2nd cam settings: %d "), IntegerSettingValue( ECamSettingItemPhotoQuality ) ); +#endif + + LoadSecondaryCameraSettingsL(); + +#ifdef _DEBUG + PRINT1( _L("Camera <> After loading 2nd cam settings: %d "), IntegerSettingValue( ECamSettingItemPhotoQuality ) ); + PRINT ( _L("Camera <> ======================================") ); +#endif + + targetCamera = ECamActiveCameraSecondary; + } + else + { + // Currently using secondary camera, switch to primary + // or landscape secondary camera + PRINT( _L("Camera <> switch to 1st camera or change 2nd camera mode") ) + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( appUi->IsEmbedded() ) + { + LoadStaticSettingsL( appUi->IsEmbedded() ); + } + else if ( CameraSwitchQueued() != ESwitchSecondaryOrientation ) + { + iSettingsModel->RestorePrimaryCameraSettingsL(); + } + + if ( CameraSwitchQueued() != ESwitchSecondaryOrientation ) + { + PRINT( _L("Camera <> switch to 1st cam") ) + targetCamera = ECamActiveCameraPrimary; + } + else + { + PRINT( _L("Camera <> change 2nd camera mode") ) + targetCamera = ECamActiveCameraSecondary; + } + } + SetCameraSwitchRequired( ESwitchDone ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + iCameraController->SwitchCameraL( (ECamActiveCameraPrimary == targetCamera) ? 0 : 1 ); + iCameraController->CompleteSwitchCameraL(); + + // Camera switched. + // a) Set current camera index to the new one. + // b) Set target mode (video/image) to the one before mode switch. + // c) Image mode is single shot after camera switch + // d) Ensure vf start + iInfo.iActiveCamera = targetCamera; // a) + iInfo.iTargetMode = appUi->TargetMode(); // b) + iInfo.iTargetImageMode = ( ECamControllerVideo==iInfo.iTargetMode ) + ? ECamImageCaptureNone : ECamImageCaptureSingle; // c) + iInfo.iTargetVfState = ECamTriActive; // d) + if( oldInfo.iMode != ECamControllerShutdown ) + { + IssueModeChangeSequenceL(); + } + + appUi->SetDrawPreCaptureCourtesyUI( ETrue ); + + NotifyControllerObservers( ECamEventCameraChanged ); + + PRINT( _L("Camera <= CCamAppController::SwitchCameraL") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::ActiveCamera +// Returns the active camera +// --------------------------------------------------------------------------- +// +TCamActiveCamera +CCamAppController::ActiveCamera() const + { + return iInfo.iActiveCamera; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CameraSwitchQueued +// Returns whether a camera switch is pending +// --------------------------------------------------------------------------- +// +TCameraSwitchRequired +CCamAppController::CameraSwitchQueued() const + { + PRINT1( _L("Camera =><= CCamAppController::CameraSwitchQueued %d"), iCameraSwitchRequired ) + return iCameraSwitchRequired; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CheckExitStatus +// Check whether exit is required +// --------------------------------------------------------------------------- +// +TBool +CCamAppController::CheckExitStatus() + { + PRINT( _L("Camera => CCamAppController::CheckExitStatus" ) ) + TBool exit = EFalse; + if ( iEndKeyWaiting ) + { + exit = ETrue; + } + else if ( iConfigManager && iConfigManager->IsLensCoverSupported() ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + if ( iSliderCloseEvent && !appUi->IsEmbedded() && !appUi->Embedding() ) + { + PRINT( _L("Camera <> CCamAppController::CheckExitStatus - slider closed, not embedded/embedding" ) ) + exit = ETrue; + } + else + { + PRINT( _L("Camera <> CCamAppController::CheckExitStatus - embedded/embedding, not exiting" ) ) + exit = EFalse; + } + } + else + { + exit = EFalse; + } + + PRINT1( _L("Camera <= CCamAppController::CheckExitStatus - return %d" ), exit ) + return exit; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetEndKeyExitWaiting +// Update whether exit is required +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetEndKeyExitWaiting( TBool aEndKeyWaiting ) + { + iEndKeyWaiting = aEndKeyWaiting; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CameraSlideState +// Returns the status of the camera slide +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::CameraSlideState() const + { + return iSlideState; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SliderCloseEventActioned +// Update whether exit is required +// --------------------------------------------------------------------------- +// +void +CCamAppController::SliderCloseEventActioned() + { + iSliderCloseEvent = EFalse; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetCameraSwitchRequired +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetCameraSwitchRequired( TCameraSwitchRequired aSwitchRequired ) + { + iCameraSwitchRequired = aSwitchRequired; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::CheckSlideStatus +// Check the slide state and schedule a camera switch if needed +// --------------------------------------------------------------------------- +// +void CCamAppController::CheckSlideStatus() + { + PRINT( _L("Camera => CCamAppController::CheckSlideStatus") ); + // if only 1 camera available then can't switch camera + if ( CamerasAvailable() <= 1 ) + { + PRINT( _L("Camera <> Only one camera, no action") ); + } + else + { + RefreshSlideStatus(); + // if the slide is closed then schedule a camera switch + // if the back camera is active + if ( CameraSlideState() == CameraPlatPSKeys::EClosed || + CameraSlideState() == KErrNone ) + { + if ( iInfo.iActiveCamera == ECamActiveCameraPrimary ) + { + PRINT( _L("Camera <> slide closed or uninitialized -> switch to secondary") ); + iCameraSwitchRequired = ESwitchPrimaryToSecondary; + } + else + { + PRINT( _L("Camera <> no camera switch needed") ); + iCameraSwitchRequired = ESwitchDone; + } + } + // if the slide is open then schedule a camera switch + // if the front camera is active + else if ( CameraSlideState() == CameraPlatPSKeys::EOpen ) + { + if ( iInfo.iActiveCamera == ECamActiveCameraSecondary ) + { + PRINT( _L("Camera <> slide open -> switch to primary") ); + iCameraSwitchRequired = ESwitchSecondaryToPrimary; + } + else + { + PRINT( _L("Camera <> no camera switch needed") ); + iCameraSwitchRequired = ESwitchDone; + } + } + else + { + // do nothing + PRINT( _L("Camera <> not recognized slider state -> no action") ); + } + } + PRINT( _L("Camera <= CCamAppController::CheckSlideStatus") ); + } + + +// ---------------------------------------------------- +// CCamAppController::EvRange +// Range of EV value supported by current product +// ---------------------------------------------------- +// +TCamEvCompRange CCamAppController::EvRange() const + { + PRINT( _L("Camera =><= CCamAppController::EvRange") ); + return iEvRange; + } + + +// ---------------------------------------------------- +// CCamAppController::CallStateChanged +// Callback for when the current phone call state changes +// ---------------------------------------------------- +// +void +CCamAppController::CallStateChanged( TPSCTsyCallState aState, + TInt /* aError */ ) + { + PRINT1( _L("Camera => CCamAppController::CallStateChanged aState: %d"), aState); + + TBool oldState = iInCallOrRinging; + + if ( aState == EPSCTsyCallStateAlerting || + aState == EPSCTsyCallStateRinging || + aState == EPSCTsyCallStateDialling || + aState == EPSCTsyCallStateAnswering || + aState == EPSCTsyCallStateDisconnecting || + aState == EPSCTsyCallStateConnected || + aState == EPSCTsyCallStateHold ) + { + // If not already in a call/ringing state, and the new state + // indicates this, stop recording + if ( !iInCallOrRinging ) + { + // Set the flag before handle call, as this may need to + // know the call state for stopping video. + iInCallOrRinging = ETrue; + PRINT( _L("Camera <> CCamAppController::CallStateChanged: calling handleincomingcallL") ); + HandleIncomingCall(); + } + } + else + { + iInCallOrRinging = EFalse; + } + // If the state has changed from in a call to not, notify the + // observers + // Also notify again if the state has reached connected so that + // the observer can reconsider its actions now that connection is complete + if ( iInCallOrRinging != oldState || + EPSCTsyCallStateConnected == aState ) + { + PRINT( _L("Camera <> CCamAppController::CallStateChanged: telling call observers") ); + NotifyControllerObservers( ECamEventCallStateChanged, KErrNone ); + } + + PRINT1( _L("Camera <= CCamAppController::CallStateChanged(%d, %d)"), aState ); + } + + + + + + +// --------------------------------------------------------------------------- +// ReleaseCamera +// +// Releases the camera hardware for other apps to use +// --------------------------------------------------------------------------- +// +void CCamAppController::ReleaseCamera() + { + PRINT( _L("Camera => CCamAppController::ReleaseCamera") ); + + if ( IsAppUiAvailable()) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi ) + { + appUi->SetAssumePostCaptureView( EFalse ); + } + } + + if ( Busy() ) + { + PRINT( _L("Camera <> CCamAppController::ReleaseCamera: set release pending") ); + iPendingRelease = ETrue; + } + else if ( iCameraController && ECamCameraIdle != CameraState() ) + { + // No leaving code here. Clear the flag before any operation + // to prevent calling this from the event callbacks caused + // by the following requests. + iPendingRelease = EFalse; + + if( iInfo.iImageMode == ECamImageCaptureBurst && + SequenceCaptureInProgress() ) + { + // Cancel ongoing burst capture + // Burst capture is normally cancelled by setting iRequestedBurstCount, + // and actual cancelling is done when next imagedata arrives. + // However, in this case camera is going to be released, and there won't + // be next image data, so give ECamRequestImageCancel and capture + // completion event here to avoid problems + PRINT( _L("Camera <> CCamAppController::ReleaseCamera: Going to bacgkround in the middle of a burst capture") ); + TRAP_IGNORE ( IssueDirectRequestL( ECamRequestImageCancel ) ); + NotifyControllerObservers( ECamEventCaptureComplete, KErrCancel ); + } + + //iInfo.iMode = ECamControllerShutdown; + //iInfo.iTargetMode = ECamControllerIdle; + iInfo.iTargetMode = ECamControllerIdle; + iInfo.iImageMode = ECamImageCaptureNone; + iInfo.iTargetImageMode = ECamImageCaptureNone; + iInfo.iOperation = ECamNoOperation; + + iCaptureModeTransitionInProgress = EFalse; + + // Last change to stop view finder if we were "busy" previously in + // ExitViewfinderMode method. View finder must be stopped in case where + // orientation is changed, so Posting API display control doesn't try to + // draw outside existing area. Otherwise KErrTooBig error is encountered. + StopViewFinder(); + + PRINT( _L("Camera <> CCamAppController::ReleaseCamera: requesting release directly..") ); + // iInfo.iMode set when complete + TRAP_IGNORE( IssueDirectRequestL( ECamRequestRelease ) ); + //iPendingRelease = EFalse; + //shutdown the orientation channel + if( iConfigManager && iConfigManager->IsOrientationSensorSupported() && + iAccSensorListening ) + { + TRAP_IGNORE( UpdateSensorApiL( EFalse ) ); + } + } + else + { + // No action needed. + PRINT( _L("Camera <> CCamAppController::ReleaseCamera: camera already idle!!") ); + if(ECamControllerIdle != iInfo.iMode ) + { + PRINT( _L("Camera <> CCamAppController::ReleaseCamera: camera already idle correcting state!!") ); + iInfo.iMode = ECamControllerIdle; + } + } + PRINT( _L("Camera <= CCamAppController::ReleaseCamera") ); + } + + +// --------------------------------------------------------------------------- +// IncCameraUsers +// +// Increments the camera usage count +// --------------------------------------------------------------------------- +// +void CCamAppController::IncCameraUsers() + { + PRINT ( _L("Camera => CCamAppController::IncCameraUsers") ); + iCameraReferences++; + PRINT1( _L("Camera <= CCamAppController::IncCameraUsers, count now %d"), iCameraReferences ); + } + + +// --------------------------------------------------------------------------- +// DecCameraUsers +// +// Decrements the camera usage count +// --------------------------------------------------------------------------- +// +void CCamAppController::DecCameraUsers() + { + PRINT ( _L("Camera => CCamAppController::DecCameraUsers") ); + + __ASSERT_DEBUG( iCameraReferences > 0, CamPanic( ECamPanicInvalidState ) ); + iCameraReferences--; + + PRINT1( _L("Camera <> CCamAppController::DecCameraUsers: count now %d"), iCameraReferences ); + // If the engine is no longer required then release it. + if ( iCameraReferences <= 0 ) + { + ReleaseCamera(); + } + PRINT ( _L("Camera <= CCamAppController::DecCameraUsers") ); + } + + + + +// ---------------------------------------------------- +// CCamAppController::InCallOrRinging +// Whether we are in call or ringing +// ---------------------------------------------------- +// +TBool +CCamAppController::InCallOrRinging() const + { + return iInCallOrRinging; + } + +// ---------------------------------------------------- +// CCamAppController::InVideocallOrRinging +// Whether we are in videocall or ringing +// ---------------------------------------------------- +// +TBool +CCamAppController::InVideocallOrRinging() + { + if ( InCallOrRinging() ) + { + TInt callType( EPSCTsyCallTypeUninitialized ); + TInt err = RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType ); + if ( err == KErrNone && callType == EPSCTsyCallTypeH324Multimedia ) + { + return ETrue; + } + else + { + return EFalse; + } + } + else + { + return EFalse; + } + + } + +// ---------------------------------------------------- +// CCamAppController::CurrentlySavingVideo +// Whether we are currently saving a video clip or not +// ---------------------------------------------------- +// +TBool +CCamAppController::CurrentlySavingVideo() const + { + return iSaving; + } + + + +// --------------------------------------------------------------------------- +// IssueModeChangeSequenceL +// --------------------------------------------------------------------------- +// +void +CCamAppController::IssueModeChangeSequenceL( TBool aStartup ) + { + PRINT( _L( "Camera => CCamAppController::IssueModeChangeSequenceL" ) ); + // Generate the request sequence and issue to Camera Controller. + RCamRequestArray sequence; + CleanupClosePushL( sequence ); + + if( !aStartup ) + { + GenerateModeChangeSequenceL( sequence ); + + if( iCameraReferences ) + { + SetFlags( iBusyFlags, EBusySequence ); + TCleanupItem clearBusy( ClearSequenceBusyFlag, &iBusyFlags ); + CleanupStack::PushL( clearBusy ); + iCameraController->RequestSequenceL( sequence ); + CleanupStack::Pop(); + + iCaptureModeTransitionInProgress = ETrue; + + } + else + { + PRINT( _L("Camera <> No camera users, not requesting sequence.") ); + } + } + else + { + GenerateStartupSequenceL( sequence ); + + SetFlags( iBusyFlags, EBusySequence ); + TCleanupItem clearBusy( ClearSequenceBusyFlag, &iBusyFlags ); + CleanupStack::PushL( clearBusy ); + iCameraController->RequestSequenceL( sequence ); + CleanupStack::Pop(); + } + + CleanupStack::PopAndDestroy(); // sequence.Close() + PRINT( _L( "Camera <= CCamAppController::IssueModeChangeSequenceL" ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::GenerateModeChangeSequenceL( RCamRequestArray& aSequence ) + { + PRINT( _L( "Camera => CCamAppController::GenerateModeChangeSequenceL" ) ); + TBool vfStartDone = EFalse; + //Have to empty autofocusrequest values here because modechange could override + //currently processed autofocus request. + iPendingAFRequest=0; + iCurrentAFRequest=0; + iNoBurstCancel = EFalse; + iKeyUP = EFalse; + iAFCancelInProgress = EFalse; + + // ------------------------------------------------------- + if( ECamTriIdle != iCameraController->ViewfinderState() ) + { + // If VF is not stopped, frames might come when we are not + // in either image or video mode. + if( ECamControllerIdle != iInfo.iMode + && iInfo.iTargetMode != iInfo.iMode ) + { + aSequence.Append( ECamRequestVfRelease ); + } + else + + if( ECamTriIdle == iInfo.iTargetVfState ) + { + aSequence.Append( ECamRequestVfRelease ); + } + else if( ECamTriInactive == iInfo.iTargetVfState ) + { + aSequence.Append( ECamRequestVfStop ); + } + else + { + // Nothing needed here + } + + } + + switch( iInfo.iMode ) + { + // --------------------------------- + case ECamControllerImage: + { + if( ECamControllerImage != iInfo.iTargetMode ) + { + aSequence.Append( ECamRequestImageRelease ); + } + break; + } + // --------------------------------- + case ECamControllerVideo: + { + if( ECamControllerVideo != iInfo.iTargetMode ) + { + aSequence.Append( ECamRequestVideoRelease ); + } + break; + } + // --------------------------------- + default: + { + // If we need to get to video or image mode + // make sure camera has power on before further requests. + if( ECamControllerImage == iInfo.iTargetMode + || ECamControllerVideo == iInfo.iTargetMode ) + { + TUint cameraState( iCameraController->State() ); + + if( !(ECamPowerOn&cameraState) ) + { + if( !(ECamReserved&cameraState) ) + { + aSequence.Append( ECamRequestReserve ); + } + aSequence.Append( ECamRequestPowerOn ); + } + } + break; + } + // --------------------------------- + } + + // ------------------------------------------------------- + // Append prepare operations to achieve target camera mode + switch( iInfo.iTargetMode ) + { + // --------------------------------- + case ECamControllerImage: + { + if( ECamImageCaptureNone != iInfo.iTargetImageMode ) + { + aSequence.Append( ECamRequestImageInit ); + + // Snapshot may have to be released and restarted because the + // snapshot size may change. + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( appUi ) + { + if( appUi->ShowPostCaptureView() || iInfo.iTargetImageMode == ECamImageCaptureBurst ) + { + // If vf needs to be (re)started. + // Camera Controller checks from Setting Provider if + // viewfinder mode (direct/bitmap) has changed, and + // releases old type first if needed. + if( ECamTriActive == iInfo.iTargetVfState ) + { + PRINT( _L( "Camera <> CCamAppController::GenerateModeChangeSequenceL: VF start needed" ) ); + aSequence.Append( ECamRequestVfStart ); + vfStartDone = ETrue; + } + PRINT( _L( "Camera <> CCamAppController::GenerateModeChangeSequenceL: Snapshot on" ) ); + aSequence.Append( ECamRequestSsRelease ); + aSequence.Append( ECamRequestSsStart ); + } + else + { + PRINT( _L( "Camera <> CCamAppController::GenerateModeChangeSequenceL: Snapshot off" ) ); + aSequence.Append( ECamRequestSsRelease ); + aSequence.Append( ECamRequestSsStop ); + } + } + } + + break; + } + // --------------------------------- + case ECamControllerVideo: + { + // Video recorder needs to be initialized and prepared + // if we are not already in video mode. + if ( iInfo.iMode != ECamControllerVideo ) + { + iVideoInitNeeded = ETrue; + } + aSequence.Append( ECamRequestVideoInit ); + + // Snapshot has to be released and restarted because the + // snapshot size may change. + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( appUi ) + { + if( appUi->ShowPostCaptureView() || iInfo.iTargetImageMode == ECamImageCaptureBurst ) + { + // If vf needs to be (re)started. + // Camera Controller checks from Setting Provider if + // viewfinder mode (direct/bitmap) has changed, and + // releases old type first if needed. + if( ECamTriActive == iInfo.iTargetVfState ) + { + PRINT( _L( "Camera <> CCamAppController::GenerateModeChangeSequenceL: VF start needed" ) ); + aSequence.Append( ECamRequestVfStart ); + vfStartDone = ETrue; + } + PRINT( _L( "Camera <> CCamAppController::GenerateModeChangeSequenceL: Snapshot on" ) ); + aSequence.Append( ECamRequestSsRelease ); + aSequence.Append( ECamRequestSsStart ); + } + else + { + PRINT( _L( "Camera <> CCamAppController::GenerateModeChangeSequenceL: Snapshot off" ) ); + aSequence.Append( ECamRequestSsRelease ); + aSequence.Append( ECamRequestSsStop ); + } + } + break; + } + // --------------------------------- + default: + break; + // --------------------------------- + } + + // If vf needs to be (re)started. + // Camera Controller checks from Setting Provider if + // viewfinder mode (direct/bitmap) has changed, and + // releases old type first if needed. + if( !vfStartDone && ECamTriActive == iInfo.iTargetVfState ) + { + PRINT( _L( "Camera <> CCamAppController::GenerateModeChangeSequenceL: VF start needed" ) ); + aSequence.Append( ECamRequestVfStart ); + } + + + // ------------------------------------------------------- +#ifdef _DEBUG + PRINT( _L( "Camera <> Generated sequence: " ) ); + for( TInt i = 0; i < aSequence.Count(); i++ ) + { + PRINT2( _L( "Camera <> %d) %s" ), i, KCamRequestNames[aSequence[i]] ); + } +#endif + PRINT( _L( "Camera <= CCamAppController::GenerateModeChangeSequenceL" ) ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::SettingsPhotoResolution +// Returns the photo resolution stored by the Settings Model +// --------------------------------------------------------------------------- +// +TCamPhotoSizeId CCamAppController::SettingsPhotoResolution() const + { + return iSettingsModel->CurrentPhotoResolution(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::GetCurrentImageDimensions +// --------------------------------------------------------------------------- +// +TSize +CCamAppController::GetCurrentImageDimensions() const + { + TCamPhotoSizeId index = iSettingsModel->CurrentPhotoResolution(); + TSize size = iSettingsModel->ImageResolutionFromIndex( index ); + return size; + } + +// --------------------------------------------------------------------------- +// CCamAppController::GetCurrentImageResolution +// Gets the current image resolution used. May not be the same at that stored in Settings +// if Zoom state is not 1x +// --------------------------------------------------------------------------- +// +TCamPhotoSizeId CCamAppController::GetCurrentImageResolution() const + { + TCamPhotoSizeId size = iSettingsModel->CurrentPhotoResolution(); + return size; + } + +// --------------------------------------------------------------------------- +// CCamAppController::GetCurrentImageCompression +// Returns the photo compression level from the Settings Model +// --------------------------------------------------------------------------- +// +TInt CCamAppController::GetCurrentImageCompression() const + { + return iSettingsModel->CurrentPhotoCompression(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::GetCurrentVideoResolution +// Gets the current video resolution used. +// --------------------------------------------------------------------------- +// +TCamVideoResolution CCamAppController::GetCurrentVideoResolution() const + { + TInt videoQuality = iSettingsModel->IntegerSettingValue( ECamSettingItemVideoQuality ); + CCamVideoQualityLevel& level = *( iSettingsModel->VideoQualityArray() )[videoQuality]; + return static_cast( level.VideoResolution() ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::UsePhoneMemoryL +// Force use of phone memory storage. +// --------------------------------------------------------------------------- +// +void CCamAppController::UsePhoneMemoryL() const + { +#ifdef PRODUCT_SUPPORTS_FORCE_MEDIA_STORAGE_VALUE + // This function is used to directly force the value of media storage + // Bypasses any updates the controller does for change to these values + + if( ExistMassStorage() ) + { + iSettingsModel->SetIntegerSettingValueL( ECamSettingItemPhotoMediaStorage, + ECamMediaStorageMassStorage ); + + iSettingsModel->SetIntegerSettingValueL( ECamSettingItemVideoMediaStorage, + ECamMediaStorageMassStorage ); + } + else + { + iSettingsModel->SetIntegerSettingValueL( ECamSettingItemPhotoMediaStorage, + ECamMediaStoragePhone ); + + iSettingsModel->SetIntegerSettingValueL( ECamSettingItemVideoMediaStorage, + ECamMediaStoragePhone ); + } + +#endif // PRODUCT_SUPPORTS_FORCE_MEDIA_STORAGE_VALUE + } + + +// =========================================================================== +// From MCamSettingsModelObserver + +// --------------------------------------------------------------------------- +// CCamAppController::IntSettingChangedL +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::IntSettingChangedL( TCamSettingItemIds aSettingItem, + TInt aSettingValue ) + { + switch( aSettingItem ) + { + case ECamSettingItemDynamicSelfTimer: + { + TCamSelfTimerFunctions function( ECamSelfTimerDisabled ); + switch( aSettingValue ) + { + case ECamSelfTimer2: function = ECamSelfTimerMode1; break; + case ECamSelfTimer10: function = ECamSelfTimerMode2; break; + case ECamSelfTimer20: function = ECamSelfTimerMode3; break; + default: break; + } + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( appUi ) + { + appUi->SelfTimerEnableL( function ); + } + break; + } + case ECamSettingItemPhotoQuality: + { + HandleImageQualitySettingChangeL(); + break; + } + case ECamSettingItemVideoQuality: + NotifyControllerObservers( ECamEventVideoQualityChanged, KErrNone ); + break; + case ECamSettingItemVideoAudioRec: + { + NotifyControllerObservers( ECamEventAudioMuteStateChanged ); + break; + } + case ECamSettingItemContinuousAutofocus: + { + NotifyControllerObservers( ECamEventContAFStateChanged ); + break; + } + + case ECamSettingItemFaceTracking: + { + PRINT( _L("Camera => ECamSettingItemFaceTracking") ); + TCamCameraSettingId cameraId( + CCamSettingConversion::Map2CameraControllerSettingId( aSettingItem ) ); + iCameraController->DirectSettingsChangeL( cameraId ); + NotifyControllerObservers( ECamEventFaceTrackingStateChanged ); + break; + } + case ECamSettingItemDynamicVideoFlash: + { + PRINT( _L("Camera => ECamSettingItemDynamicVideoFlash") ); + TCamCameraSettingId cameraId( + CCamSettingConversion::Map2CameraControllerSettingId( aSettingItem ) ); + iCameraController->DirectSettingsChangeL( cameraId ); + break; + } + default: + { + break; + } + } + } + +// --------------------------------------------------------------------------- +// CCamAppController::TextSettingChangedL +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::TextSettingChangedL( TCamSettingItemIds /*aSettingItem*/, + const TDesC& /*aSettingValue*/ ) + { + } + +// --------------------------------------------------------------------------- +// HandleImageQualitySettingChangeL +// --------------------------------------------------------------------------- +// +void +CCamAppController::HandleImageQualitySettingChangeL() + { + PRINT( _L("Camera => CCamAppController::HandleImageQualitySettingChangeL") ); + if( IsViewFinding() ) + { + PRINT( _L("Camera <> CCamAppController - viewfinder on, stop vf / re-prepare / start vf..") ); + TRAPD( status, + { + IssueDirectRequestL( ECamRequestVfStop ); + IssueDirectRequestL( ECamRequestSsRelease ); + IssueDirectRequestL( ECamRequestImageInit ); + IssueDirectRequestL( ECamRequestSsStart ); + IssueDirectRequestL( ECamRequestVfStart ); + }); + + if( KErrNone != status ) + { + SetOperation( ECamStandby, status ); + } + } + + NotifyControllerObservers( ECamEventImageQualityChanged, KErrNone ); + PRINT( _L("Camera <= CCamAppController::HandleImageQualitySettingChangeL") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::BurstModeActive +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::BurstModeActiveL( TBool aActive, TBool /*aStillModeActive*/ ) + { + PRINT1( _L("Camera => CCamAppController::BurstModeActiveL %d"), aActive ); + if( ECamControllerImage == iInfo.iMode ) + { + //TCamImageCaptureMode oldImageMode = iInfo.iImageMode; + // We are in still capture mode + if( aActive ) + { + PRINT( _L("Camera <> CCamAppController .. iInfo.iImageMode = appUi->CurrentBurstMode() ") ); + // Burst mode active. Query current mode from AppUi + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + // iInfo.iImageMode = appUi->CurrentBurstMode(); + SetImageMode( appUi->CurrentBurstMode() ); + // reset image orientation + iImageOrientation = ECamOrientation0; + TRAP_IGNORE( SetImageOrientationL() ); + + } + else + { + // Burst mode not active + PRINT( _L("Camera <> CCamAppController .. iInfo.iImageMode = ECamImageCaptureSingle ") ); + // iInfo.iImageMode = ECamImageCaptureSingle; + SetImageMode( ECamImageCaptureSingle ); + } + iRequestedCaptureCount = ( ECamImageCaptureBurst == iInfo.iImageMode ) + ? KShortBurstCount + : 1; + iCameraController->DirectSettingsChangeL( ECameraSettingCaptureLimit ); + // set image orientation in case it was changed during burst mode + if( iOrientationChangeOccured ) + { + iOrientationChangeOccured = EFalse; + TRAP_IGNORE( SetImageOrientationL() ); + } + + } + else + { + PRINT( _L("Camera <> CCamAppController .. [WARNING] Not in image mode, set iInfo.iImageMode = ECamImageCaptureNone") ); + // iInfo.iImageMode = ECamImageCaptureNone; + SetImageMode( ECamImageCaptureNone ); + } + PRINT( _L("Camera <= CCamAppController::BurstModeActiveL %d") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::SetVideoLengthL +// Set video length (max or short) +// --------------------------------------------------------------------------- +// +void CCamAppController::SetVideoLengthL( TInt /*aLength*/ ) + { + PRINT( _L( "Camera => CCamAppController::SetVideoLengthL" ) ); + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::CurrentPhotoStorageLocation +// Returns the current photo storage location filtered by MMC presence +// --------------------------------------------------------------------------- +TInt CCamAppController::CurrentPhotoStorageLocation() const + { + TInt storageLocation = iSettingsModel->IntegerSettingValue( ECamSettingItemPhotoMediaStorage ); + + // added iForceUseOfPhoneMemory part to treat current location + // as Mass Storage / Phone, also if it is forced. + if ( iForceUseOfPhoneMemory || + ( ( storageLocation == ECamMediaStorageCard ) && + ( CamUtility::MemoryCardStatus() != ECamMemoryCardInserted ) ) ) + { + if ( ExistMassStorage() ) + { + storageLocation = ECamMediaStorageMassStorage; + } + else + { + storageLocation = ECamMediaStoragePhone; + } + } + return storageLocation; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CurrentVideoStorageLocation +// Returns the current video storage location filtered by MMC presence +// --------------------------------------------------------------------------- +TInt CCamAppController::CurrentVideoStorageLocation() const + { + TInt storageLocation = iSettingsModel->IntegerSettingValue( ECamSettingItemVideoMediaStorage ); + + // added iForceUseOfPhoneMemory part to treat current location + // as Mass Storage / Phone, also if it is forced. + + if ( iForceUseOfPhoneMemory ) + { + storageLocation = iForcedStorageLocation; + } + return storageLocation; + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::ReleaseArray +// Record that the view has finished with the array +// --------------------------------------------------------------------------- +// +void CCamAppController::ReleaseArray( TBool aForcedRelease ) + { + PRINT( _L("Camera => CCamAppController::ReleaseArray") ); + // Otherwise we were using the real capture array, so reset it + if( iArrayUsageCount > 0 ) + { + iArrayUsageCount--; + } + + if ( iArrayUsageCount == 0 || aForcedRelease ) + { + PRINT( _L("Camere <> CCamAppController::ReleaseArray .. usage to 0") ); + iCaptureArray->Reset(); + iCurrentImageIndex = 0; + // May have released a large amount of memory, so compress the heap + User::Heap().Compress(); + } + + PRINT( _L("Camera <= CCamAppController::ReleaseArray") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::RestoreFactorySettingsL +// Delete +// --------------------------------------------------------------------------- +// +void CCamAppController::RestoreFactorySettingsL( TBool aIsEmbedded ) + { + PRINT( _L("Camera => CCamAppController::RestoreFactorySettingsL") ); + iSettingsModel->ResetRepository(); + + // reload static settings + LoadStaticSettingsL( aIsEmbedded ); + + // reload dynamic settings + SetDynamicSettingsToDefaults(); + + // Restoring camera settings didn't set the capture mode to single capture, + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + appUi->SwitchStillCaptureModeL( ECamImageCaptureSingle, EFalse, EFalse ); + // + SetMode( ECamControllerIdle ); + + if( iLocationTrailStarted && + ECamLocationOn != IntegerSettingValue( ECamSettingItemRecLocation ) ) + { + PRINT( _L("Camera <> CCamAppController::RestoreFactorySettingsL - Stop location trail") ); + // Location trail has been started, but setting off after restore -> stop trail + // Starting (if needed after restore) happens when still precap view is activated + StopLocationTrail(); + } + + // + NotifyControllerObservers( ECamEventRestoreCameraSettings ); + PRINT( _L("Camera <= CCamAppController::RestoreFactorySettingsL") ); + } + + + + +// --------------------------------------------------------------------------- +// PlayComplete +// +// Called from when sound playing completes. +// --------------------------------------------------------------------------- +// +void +CCamAppController::PlayComplete( TInt /*aStatus*/, TInt /*aSoundId*/ ) + { + PlaySoundComplete(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::PlaySoundComplete +// Called when playback of a sound has completed. Typically used in conjunction +// with Video recording (must only start recording AFTER sound has finished +// to avoid recording the sound in the recorded clip). +// --------------------------------------------------------------------------- +// +void CCamAppController::PlaySoundComplete() + { + PRINT( _L("Camera => CCamAppController::PlaySoundComplete") ); + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_PLAYSOUNDCOMPLETE, "e_CAM_APP_CAPTURE_SOUND_PLAY 0" ); //CCORAPP_CAPTURE_SOUND_PLAY_END + + __ASSERT_DEBUG( iCameraController, CamPanic( ECamPanicInvalidState ) ); + if( ECamControllerVideo == iInfo.iMode && !IsKeyLockOn() ) + { + switch( CurrentVideoOperation() ) + { + case ECamResuming: + { + // Restarting video + DoRecord(); + break; + } + case ECamPausing: + { + // Notifies observers, so paused icon and softkeys can be updated. + SetOperation( ECamPaused ); + break; + } + case ECamNoOperation: + { + // Starting the video capture + // If the next file path has not changed, start capturing + if ( BurstCaptureArray()->FileName( 0 ).Compare( iSuggestedVideoPath ) == 0 ) + { + PRINT( _L("Camera <> starting to record..") ); + DoRecord(); + } + // File path changed. Prepare the engine with the new video file path. + // Start video recording when filename changed (event) + else + { + iVideoRequested = ETrue; + iSuggestedVideoPath.Copy( BurstCaptureArray()->FileName( 0 ) ); + PRINT1( _L("Camera <> Requesting Camera controller to set the video name, iSuggestedVideoPath = [%S] "), &iSuggestedVideoPath ); + TRAP_IGNORE( + { + // Set video name change pending and request setting it to camera controller. + iSettingProvider->AddPendingSettingChangeL( ECamSettingItemVideoNameBase ); + IssueSettingsChangeRequestL(); + }); + iVideoNameRetries = KVideoNameRetryCount; + } + } + default: + { + // No operation. + // Should be stopping video + } + } + } + else + { + // Image mode or keylock on, no action + } + PRINT( _L("Camera <= CCamAppController::PlaySoundComplete") ); + } +// --------------------------------------------------------------------------- +// CCamAppController::MediaFileChangedNotification +//Helper function for making notification about deleted files +// --------------------------------------------------------------------------- +// +void +CCamAppController::MediaFileChangedNotification() + { + PRINT( _L("Camera => CCamAppController::MediaFileChangedNotification") ); + NotifyControllerObservers( ECamEventMediaFileChanged ); + PRINT( _L("Camera <= CCamAppController::MediaFileChangedNotification") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::DeleteCurrentFile +// Delete the current image/video file +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::DeleteCurrentFile( TBool aNotify /*=ETrue*/ ) + { + PRINT( _L("Camera => CCamAppController::DeleteCurrentFile") ); + iImageSaveRequestPending = EFalse; + + TInt err( KErrNone ); + if( BurstCaptureArray()->Count() > 0 ) + { + err = BurstCaptureArray()->SetDeleted( iCurrentImageIndex, ETrue ); + if ( aNotify && err == KErrNone ) + { + NotifyControllerObservers( ECamEventMediaFileChanged ); + } + } + + PRINT( _L("Camera <= CCamAppController::DeleteCurrentFile") ); + return err; + } + +// --------------------------------------------------------------------------- +// CCamAppController::DeleteTimeLapseFiles +// Delete the current timelapse sequence +// --------------------------------------------------------------------------- +// +void +CCamAppController::DeleteTimeLapseFiles() + { + // Count() is inline + for ( TInt i = 0; i < iSequenceFilenameArray->Count(); i++ ) + { + TPtrC filename( iSequenceFilenameArray->MdcaPoint( i ) ); + // Error ignored + (void)iImageSaveActive->DeleteFile( filename, ETrue ); + } + iSequenceFilenameArray->Reset(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::IsProcessingCapture +// Indicate whether or not the controller is actively engaged in still +// or video capture +// --------------------------------------------------------------------------- +// + +TBool CCamAppController::IsProcessingCapture() + { + return ( iCaptureRequested // if a still capture is pending + || iVideoRequested // if a video capture is pending + || EngineProcessingCapture() // if recording or capture is active + || ECamImageCaptureTimeLapse == iInfo.iImageMode // if capturing time lapse + || CurrentlySavingVideo() ); // if a video save is in progress + } + +// --------------------------------------------------------------------------- +// CCamAppController::CompleteCaptureAndNotifyL +// Request that any current processes complete, then notify observers +// --------------------------------------------------------------------------- +// +void +CCamAppController::CompleteCaptureAndNotifyL( MCamObserver* aObserver, + TBool aSafeCompletion ) + { + PRINT( _L( "Camera => CCamAppController::CompleteCaptureAndNotifyL" ) ) + + RProperty::Set( KPSUidCamcorderNotifier, KCCorFocused, 0 ); + + // Add the observer to the observer handler for capture completion. + if ( !iCaptureCompletionObserverHandler ) + { + iCaptureCompletionObserverHandler = CCamObserverHandler::NewL(); + } + iCaptureCompletionObserverHandler->RegisterObserverL( aObserver ); + + // if the capture has not yet begun, all that is required is to switch off + // the pending capture + iCaptureRequested = EFalse; + iVideoRequested = EFalse; + + // if no capture is actively in progress + if ( !IsProcessingCapture() ) + { + PRINT( _L( "Camera <> not capturing calling HandleCaptureCompletion" ) ) + HandleCaptureCompletion(); + } + + // if recording is active + else if ( ECamControllerVideo == iInfo.iMode ) + { + if( ECamCapturing == iInfo.iOperation + || ECamPausing == iInfo.iOperation + || ECamPaused == iInfo.iOperation + || ECamResuming == iInfo.iOperation ) + { + PRINT( _L( "Camera <> currently recording calling StopVideoRecording()" ) ) + StopVideoRecording(); + // iCaptureCompletionObserverHandler will be notified when the record completes + // in McaeoVideoRecordingComplete + } + } + else if ( ECamImageCaptureTimeLapse == iInfo.iImageMode ) + { + PRINT( _L( "Camera <> Calling StopSequenceCapture" ) ) + StopSequenceCaptureL(); + // iCaptureCompletionObserverHandler will be notified when the + // next image saving completes + } + + // if a burst capture is in early stages + else if ( ECamImageCaptureBurst == iInfo.iImageMode ) + { + if( ECamCapturing == iInfo.iOperation ) + { + if ( !aSafeCompletion ) + { + //iEngine->CancelCaptureStill(); + PRINT( _L( "Camera <> Safe completion requested, currently capturing burst, issue ECamRequestImageCancel" ) ) + IssueDirectRequestL( ECamRequestImageCancel ); + CompleteBurstOperation(); + } + else + { + //iEngine->StopStillBurstCapture(); + PRINT( _L( "Camera <> Not safe completion requested, currently capturing burst, issue ECamRequestImageCancel" ) ) + IssueDirectRequestL( ECamRequestImageCancel ); + // iCaptureCompletionObserverHandler will be notified when the + // image saving completes + } + } + } + else // do nothing + { + PRINT( _L( "Camera <> currently waiting for capture completion" ) ) + // e.g. iOperation == ECamCaptureCompleting + // iCaptureCompletionObserverHandler will be notified when the + // image saving completes + + // e.g. CurrentlySavingVideo() + // iCaptureCompletionObserverHandler will be notified when the + // video saving completes in McaeoVideoRecordingComplete + + // e.g. iOperation == ECamCaptureInProgress (single capture) + // iCaptureCompletionObserverHandler will be notified when the + // image saving completes + } + PRINT( _L( "Camera <= CCamAppController::CompleteCaptureAndNotifyL" ) ) + } + +// --------------------------------------------------------------------------- +// CCamAppController::EnterShutdownMode +// Enter shutdown mode as the application is closing +// --------------------------------------------------------------------------- +// +void +CCamAppController::EnterShutdownMode( TBool aImmediateShutdown ) + { + PRINT1( _L( "Camera => CCamAppController::EnterShutdownMode( aImmediateShutdown=%d )"), aImmediateShutdown ); + + DeRegisterHarverterClientEvents(); + + if ( !IsInShutdownMode() ) + { + PRINT ( _L( "Camera <> CCamAppController::EnterShutdownMode: set target mode to ECamControllerShutdown..") ); + SetTargetMode( ECamControllerShutdown ); + } + + // if not close down straightaway (i.e. for embedded ) + if ( !aImmediateShutdown ) + { + // cancel any outstanding sound requests + // iSoundPlayer->CancelTonePlayer(); + iSoundPlayer->CancelAllPlaying(); + + TRAPD( err, CompleteCaptureAndNotifyL( this, EFalse ) ) + if ( err ) + { + NotifyControllerObservers( ECamEventExitRequested, KErrNone ); + } + } + else + { + // This checks for any ongoing operation. + ReleaseCamera(); + } + + PRINT ( _L( "Camera <= CCamAppController::EnterShutdownMode") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::IsInShutdownMode +// Whether or not the controller is in shutdown mode +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsInShutdownMode() const + { + return ( ECamControllerShutdown == iInfo.iTargetMode ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::IsAppUiAvailable +// Returns true if AppUi has been constructed, and not yet destructed +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsAppUiAvailable() const + { + return iAppUiAvailable; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetAppUiAvailable +// Sets AppUi availablility (see IsAppUiAvailable) +// --------------------------------------------------------------------------- +// +void CCamAppController::SetAppUiAvailable( TBool aAvailable ) + { + iAppUiAvailable = aAvailable; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::GetZoomRange +// Returns the minimum and maximum supported zoom values +// --------------------------------------------------------------------------- +// +void +CCamAppController::GetZoomRange( TInt& aMinZoom, TInt& aMaxZoom ) const + { + __ASSERT_ALWAYS( iCameraController, CamPanic( ECamPanicNullPointer ) ); + aMinZoom = 0; + aMaxZoom = iCameraController->CameraInfo().iMaxDigitalZoom; + } + +// --------------------------------------------------------------------------- +// CCamAppController::ZoomValue +// Returns the current zoom value +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::ZoomValue() const + { + return iDesiredZoomVal; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetZoomValue +// Sets a new zoom value +// --------------------------------------------------------------------------- +// +void CCamAppController::SetZoomValue( TInt aValue ) + { + PRINT1( _L("Camera => CCamAppController::SetZoomValue( %d )"), aValue ); + __ASSERT_ALWAYS( iCameraController, CamPanic( ECamPanicNullPointer ) ); + + // Check the requested value for validity + __ASSERT_DEBUG( Rng( 0, aValue, iCameraController->CameraInfo().iMaxDigitalZoom ), + CamPanic( ECamPanicInvalidZoomValue ) ); + + if ( ECamControllerImage == iInfo.iMode + || ECamControllerVideo == iInfo.iMode ) + { + // Setting provider asks for the zoom value from us + iDesiredZoomVal = aValue; + + if ( !iZoomWaitingForCamera ) + { + PRINT( _L("Camera <> CCamAppController: calling Camera Controller..") ); + + TRAPD( error, + { + iCameraController->DirectSettingsChangeL( ECameraSettingDigitalZoom ); + }); + + // If no leave occurred, notification is done in HandleSettingEventL + if( KErrNone != error ) + { + NotifyControllerObservers( ECamEventZoomStateChanged, error ); + } + + // iZoomWaitingForCamera is set to EFalse when vf frame arrives. + // With direct vf, this never happens, so do not set to ETrue. + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi && !appUi->IsDirectViewfinderActive() ) + { + iZoomWaitingForCamera = ETrue; + } + iNewZoomPending = EFalse; + } + else + { + PRINT( _L("Camera <> CCamAppController: zoom is waiting for VF update") ); + iNewZoomPending = ETrue; + } + } + PRINT( _L("Camera <= CCamAppController::SetZoomValue") ); + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::ResetUserSceneL +// Resets all the user scene settings to their defaults. +// --------------------------------------------------------------------------- +// +void CCamAppController::ResetUserSceneL() + { + iSettingsModel->ResetUserSceneL(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::PreviewSettingChangeL +// +// Previews a new value for the specified integer setting. +// If method leaves, preview is not activated. +// --------------------------------------------------------------------------- +// +void +CCamAppController::PreviewSettingChangeL( TInt aSettingItem, + TInt aSettingValue ) + { + PRINT( _L("Camera => CCamAppController::PreviewSettingChangeL") ); + __ASSERT_DEBUG( iSettingsPreviewHandler, CamPanic( ECamPanicNullPointer ) ); + + TCamSettingItemIds settingId( + static_cast(aSettingItem) ); + + PRINT1( _L("Camera <> Setting to be previewed [%s]"), KCamSettingItemNames[settingId] ); + + if ( settingId == ECamSettingItemDynamicSelfTimer ) + { + SetSlideInSelfTimerPreview(ETrue); + } + + // Activate the preview as a first thing. + // If requests are issued to Camera Controller, + // it asks for the setting value through Setting Provider and + // the setting needs to be already in preview at that point. + // If this fails, there's nothing we need to roll back. + iSettingsPreviewHandler->ActivatePreviewL( settingId, aSettingValue ); + + + // Check which setting is previewed. + // Some need special attention, or should/need not be set to Camera at this point. + TInt status( KErrNone ); + switch( settingId ) + { + // --------------------------------- + // Image quality + case ECamSettingItemPhotoQuality: + // Still image quality does not require re-prepare, + // as even the remining images counting is done + // based on local size esimates. + // Need to do notification to update counters. + NotifyControllerObservers( ECamEventImageQualityChanged ); + break; + // --------------------------------- + // Video quality + case ECamSettingItemVideoQuality: + // Video needs to be re-prepared to be able to update + // remaining time counters. + NotifyControllerObservers( ECamEventVideoQualityChanged ); + break; + // --------------------------------- + // Self timer + case ECamSettingItemDynamicSelfTimer: + // Just set the preview. Once committed, set via AppUi. + break; + // --------------------------------- + // Others - set to Camera to see the effect. + default: + { + TCamCameraSettingId cameraId( + CCamSettingConversion::Map2CameraControllerSettingId( settingId ) ); + + //PRINT1( _L("Camera <> CCamAppController: Setting the preview to Camera, id[%s]"), KCameraSettingNames[settingId] ); + + // Assertation to notice if some setting is not properly handled. + __ASSERT_DEBUG( ECameraSettingNone != cameraId, CamPanic( ECamPanicNotSupported ) ); + + if( ECameraSettingNone != cameraId ) + { + // Preview is active. + // Camera controller will ask the value during DirectSettingsChangeL. + // Need trap to be able to cancel on failure. + TRAP( status, iCameraController->DirectSettingsChangeL( cameraId ) ); + } + break; + } + // --------------------------------- + } + + if( KErrNone != status ) + { + PRINT( _L("Camera <> CCamAppController: Problem in preview, cancelling!!!") ); + + // Invalid id does not cause problem here. + iSettingsPreviewHandler->CancelPreview( settingId ); + User::Leave( status ); + } + PRINT( _L("Camera <= CCamAppController::PreviewSettingChangeL") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::CancelPreviewChangesL +// Cancels all preview changes, since last commit/cancel. +// --------------------------------------------------------------------------- +// +void +CCamAppController::CancelPreviewChangesL() + { + PRINT( _L("Camera => CCamAppController::CancelPreviewChangesL") ); + + // Just check non-null, but no panic. + if ( iSettingsPreviewHandler ) + { + RArray previews; + CleanupClosePushL( previews ); + + // Get all active previews + iSettingsPreviewHandler->ActivePreviewsL( previews ); + // Reset all previews so the Setting Provider does + // not get those values anymore. + iSettingsPreviewHandler->CancelAllPreviews(); + + // Reset the original setting values to Camera + TInt errorOne( KErrNone ); + TInt errorAll( KErrNone ); + TCamCameraSettingId cameraId( ECameraSettingNone ); + for( TInt i = previews.Count() - 1; i >= 0; i-- ) + { + if( ECamSettingItemVideoQuality == previews[i] ) + { + TRAP( errorOne, RePrepareVideoL() ); + } + else + { + cameraId = + CCamSettingConversion::Map2CameraControllerSettingId( previews[i] ); + + if( ECameraSettingNone != cameraId ) + { + TRAP( errorOne, iCameraController->DirectSettingsChangeL( cameraId ) ); + } + /* All previews are not set to Camera. + else + { + errorOne = KErrNotSupported; + } + */ + } + + if( KErrNone == errorAll + && KErrNone != errorOne ) + { + errorAll = errorOne; + } + } + User::LeaveIfError( errorAll ); + + CleanupStack::PopAndDestroy(); // previews + } + PRINT( _L("Camera <= CCamAppController::CancelPreviewChangesL") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::CommitPreviewChanges +// Commits last preview change. +// --------------------------------------------------------------------------- +// +void +CCamAppController::CommitPreviewChanges() + { + PRINT( _L("Camera => CCamAppController::CommitPreviewChanges") ); + __ASSERT_DEBUG( iSettingsPreviewHandler, CamPanic( ECamPanicNullPointer ) ); + + // All previews have been set to Camera already. + // Only need to request the model to store new values. + // Currently ignore error, if settings model cannot save the preview. + TRAPD( error, iSettingsPreviewHandler->CommitAllPreviewsL() ); + if( KErrNone != error ) + { + // Ignored. + PRINT( _L("Camera <> Settings model could not save the preview!!!") ); + } + PRINT( _L("Camera <= CCamAppController::CommitPreviewChanges") ); + } + + +// --------------------------------------------------------------------------- +// RePrepareVideoL +// +// Helper method for re-preparing video if e.g. a setting change +// requires it. If Camera Controller is currently processing +// some request, set the flag to issue the request later. +// +// Used atleast in PreviewSettingChangeL and CancelPreviewChangesL. +// --------------------------------------------------------------------------- +// +void +CCamAppController::RePrepareVideoL() + { + PRINT( _L("Camera => CCamAppController::RePrepareVideoL") ); + + GenerateNextValidVideoPathL(); + if( !Busy() ) + { + iVideoPrepareNeeded = EFalse; + IssueRequestL( ECamRequestVideoInit ); + } + else + { + iVideoPrepareNeeded = ETrue; + } + PRINT( _L("Camera <= CCamAppController::RePrepareVideoL") ); + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::IntegerSettingValue +// Returns the current integer value for the specified setting +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::IntegerSettingValue( TInt aSettingItem ) const + { + // If the requested item is the photo storage location, this must be filtered + // based on the availability of the MMC. + if ( aSettingItem == ECamSettingItemPhotoMediaStorage ) + { + return CurrentPhotoStorageLocation(); + } + + // If the requested item is the video storage location, this must be filtered + // based on the availability of the MMC. + if ( aSettingItem == ECamSettingItemVideoMediaStorage ) + { + return CurrentVideoStorageLocation(); + } + + // Not a setting we sometimes need to filter + return IntegerSettingValueUnfiltered( aSettingItem ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::IntegerSettingValueUnfiltered +// Returns the current integer value for the specified setting +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::IntegerSettingValueUnfiltered( TInt aSettingItem ) const + { + if( aSettingItem == ECamSettingItemVideoFileType ) + { + TInt videoQuality = iSettingsModel->IntegerSettingValue( ECamSettingItemVideoQuality ); + + CCamVideoQualityLevel& level = *( iSettingsModel->VideoQualityArray() )[videoQuality]; + + return level.VideoType(); + } + // Query the relevant settings model. + return iSettingsModel->IntegerSettingValue( aSettingItem ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetIntegerSettingValueL +// Sets a new value for the specified integer setting +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetIntegerSettingValueL( TInt aSettingItem, + TInt aSettingValue ) + { + PRINT( _L("Camera => CCamAppController::SetIntegerSettingValueL")) + // Update the settings model. + iSettingsModel->SetIntegerSettingValueL( aSettingItem, aSettingValue ); + + // Update observers with any changes that do not directly affect the + // engine. That is, they need to be updated now because the settings model + // will not pass these to this observer. + switch( aSettingItem ) + { + case ECamSettingItemPhotoMediaStorage: + case ECamSettingItemVideoMediaStorage: + { + PRINT(_L("Camera SetIntegerSettingValueL calling SetPathnamesToNewStorageL" )) + // reset iForceUseOfPhoneMemory flag when user chooses + // from settings. + iForceUseOfPhoneMemory = EFalse; + SetPathnamesToNewStorageL(static_cast < TCamMediaStorage > ( aSettingValue ) ); + InitCaptureLimitL(); + break; + } + case ECamSettingItemDynamicVideoScene: + { + iVideoInitNeeded = ETrue; + NotifyControllerObservers( ECamEventSceneStateChanged ); + break; + } + case ECamSettingItemDynamicPhotoScene: + case ECamSettingItemUserSceneBasedOnScene: + { + if( iConfigManager && iConfigManager->IsAutoFocusSupported() ) + { + // Check for macro or landscape scene/based on scene and + // set up AF accordingly. For other scenes, the AF mode + // is setup at capture + CheckAfModeForScene(); + } + NotifyControllerObservers( ECamEventSceneStateChanged ); + break; + } + case ECamSettingItemVideoAudioRec: + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi->IsEmbedded() ) + { + iCameraController->DirectSettingsChangeL( ECameraSettingAudioMute ); + } + NotifyControllerObservers( ECamEventAudioMuteStateChanged ); + break; + } + case ECamSettingItemContinuousAutofocus: + { + iSettingProvider->AddPendingSettingChangeL( ECamSettingItemContinuousAutofocus ); + IssueSettingsChangeRequestL(); + break; + } + case ECamSettingItemPhotoStoreInAlbum: + case ECamSettingItemVideoStoreInAlbum: + { + TUint32 defaultAlbumId = static_cast( + IntegerSettingValue( ECamSettingItemDefaultAlbumId )); + + iImageSaveActive->SetAddImageToAlbum( aSettingValue == ECamSettYes, + defaultAlbumId ); + break; + } + case ECamSettingItemRecLocation: + { + // Set the location utility active object + if ( ECamLocationOff == aSettingValue ) + { + StopLocationTrail(); + } + else if ( ECamLocationOn == aSettingValue ) + { + StartLocationTrailL(); + } + + // Notify observers + NotifyControllerObservers( ECamEventLocationSettingChanged ); + break; + } + // Need to support more zoom settings. + // Digital/extended setting combined to + // ECamSettingItemPhotoDigitalZoom and ECamSettingItemVideoDigitalZoom + case ECamSettingItemPhotoDigitalZoom: + case ECamSettingItemVideoDigitalZoom: + { + // Notify observers + NotifyControllerObservers( ECamEventZoomSetupChanged ); + break; + } + + default: + { + // no action for others here + break; + } + } + + PRINT( _L("Camera <= CCamAppController::SetIntegerSettingValueL")) + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::SetPathnamesToNewStorageL +// Sets pathnames for video and image files to point to new storage +// --------------------------------------------------------------------------- +void CCamAppController::SetPathnamesToNewStorageL( TCamMediaStorage aMediaStorage ) + { + PRINT(_L("Camera => CCamAppController::SetPathnamesToNewStorageL" )) + + iSetNewPathnamesPending = ECamMediaStorageNone; + TFileName path; + + // If the engine is prepared for image capture then check that the required + // image folder exists + if ( IsFlagOn( CameraControllerState(), ECamImageOn ) ) + { + CCamFolderUtility::GetBasePathL( iMonthFolderCounters, + aMediaStorage, + path, + ECamControllerImage, + EFalse ); + iCurrentStorage = aMediaStorage; + } + + // If the engine is prepared for video capture then check that the required + // month folder exists and set up the engine with the new video path, this + // will be adjusted with the appropriate month counter folder when video + // capture begins + else if ( IsFlagOn( CameraControllerState(), ECamVideoOn ) ) + { + CCamFolderUtility::GetBasePathL( iMonthFolderCounters, + aMediaStorage, + path, + ECamControllerVideo, + EFalse ); + if( iInfo.iOperation != ECamCapturing && + iInfo.iOperation != ECamPausing && + iInfo.iOperation != ECamPaused && + iInfo.iOperation != ECamResuming && + iInfo.iOperation != ECamCompleting ) + { + GenerateNextValidVideoPathL(); + } + iCurrentStorage = aMediaStorage; + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + if( !appUi->SettingsLaunchedFromCamera() ) + { + // Set video name change pending and request setting it to camera controller. + if( iInfo.iOperation != ECamCapturing && + iInfo.iOperation != ECamPausing && + iInfo.iOperation != ECamPaused && + iInfo.iOperation != ECamResuming && + iInfo.iOperation != ECamCompleting ) + { + iSettingProvider->AddPendingSettingChangeL( ECamSettingItemVideoNameBase ); + // Can't set the new pathname, if camera controller is busy. + if ( CameraControllerBusy() ) + { + PRINT( _L("Camera <> Camera controller busy. New pathname not set. Set iSetNewPathnamesPending.") ) + iSetNewPathnamesPending = aMediaStorage; + } + else + { + IssueSettingsChangeRequestL(); + } + } + + iVideoNameRetries = KVideoNameRetryCount; + //iVideoTimeRemaining = KMaxRecordingLength; + if( iInfo.iOperation == ECamCapturing || + iInfo.iOperation == ECamPausing || + iInfo.iOperation == ECamPaused || + iInfo.iOperation == ECamResuming || + iInfo.iOperation == ECamCompleting ) + { + iVideoTimeRemaining = iCameraController->RemainingVideoRecordingTime(); + } + else + { + PRINT( _L("Camera <> CCamAppController::SetPathnamesToNewStorageL - video mode not yet initialized" )); + TRAPD( err, iVideoTimeRemaining = CalculateVideoTimeRemainingL() ); + if( KErrNone != err ) + { + iVideoTimeRemaining = 0; + } + } + } + } + + // The engine is not yet prepared, the folder will be checked when the engine preparation + // takes place. The controller also checks the state of iSetNewPathnamesPending when + // preparation completes, just in case preparation is currently in progress. + else + { + iSetNewPathnamesPending = aMediaStorage; + } + + NotifyControllerObservers( ECamEventSaveLocationChanged ); + PRINT(_L("Camera <= CCamAppController::SetPathnamesToNewStorageL" )) + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetTextSettingValueL +// Sets a new text value for the specified setting +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ) + { + // Update the relevant settings model. + iSettingsModel->SetTextSettingValueL( aSettingItem, aSettingValue ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::TextSettingValue +// Returns the current text value for the specified setting +// --------------------------------------------------------------------------- +// +TPtrC +CCamAppController::TextSettingValue( TInt aSettingItem ) const + { + // Query the relevant settings model. + return iSettingsModel->TextSettingValue( aSettingItem ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::SettingValueEnabled +// Returns whether a particular setting value can be set or not. +// --------------------------------------------------------------------------- +// +TBool +CCamAppController::SettingValueEnabled( TInt aSettingItem, + TInt aSettingValue ) const + { + return iSettingsModel->SettingValueEnabled( aSettingItem, aSettingValue ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::LoadStaticSettingsL +// Loads the static settings from shared data +// --------------------------------------------------------------------------- +// +void +CCamAppController::LoadStaticSettingsL( TBool aIsEmbedded ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPCONTROLLER_LOADSTATICSETTINGSL, "e_CCamAppController_LoadStaticSettingsL 1" ); + PRINT(_L("Camera => CCamAppController::LoadStaticSettingsL" )) + iSettingsModel->LoadStaticSettingsL( aIsEmbedded ); + + // Cache the image 'add to album' setting in the saving active object + // it will change infrequently + TInt value = iSettingsModel->IntegerSettingValue( ECamSettingItemPhotoStoreInAlbum ); + + TUint32 defaultAlbumId = static_cast( + IntegerSettingValue( ECamSettingItemDefaultAlbumId )); + iImageSaveActive->SetAddImageToAlbum( value == ECamSettYes, + defaultAlbumId ); + + // Ensure that the navipane is upto date with the current save location. + if ( !aIsEmbedded ) + { + NotifyControllerObservers( ECamEventAudioMuteStateChanged ); + NotifyControllerObservers( ECamEventVideoQualityChanged ); + } + NotifyControllerObservers( ECamEventSaveLocationChanged ); + NotifyControllerObservers( ECamEventVideoStabChanged ); + if ( iConfigManager && iConfigManager->IsLocationSupported() ) + { + NotifyControllerObservers( ECamEventLocationSettingChanged ); + } + NotifyControllerObservers( ECamEventVideoFileTypeChanged ); + NotifyControllerObservers( ECamEventImageQualityChanged ); + NotifyControllerObservers( ECamEventContAFStateChanged ); + PRINT(_L("Camera <= CCamAppController::LoadStaticSettingsL" )) + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPCONTROLLER_LOADSTATICSETTINGSL, "e_CCamAppController_LoadStaticSettingsL 0" ); + } + + +// --------------------------------------------------------------------------- +// DynamicSettingDefaultValue +// Get the setting default value. +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::DynamicSettingDefaultValue( TInt aSettingId ) const + { + return iSettingsModel->DynamicSettingDefaultValue( aSettingId ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetDynamicSettingsToDefaults +// Sets all dynamic settings to their defaults. +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetDynamicSettingsToDefaults() + { + iSettingsModel->SetDynamicSettingsToDefaults(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetDynamicSettingsToDefaults +// Sets a dynamic setting to its default. +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetDynamicSettingToDefault(TInt aSettingItem) + { + iSettingsModel->SetDynamicSettingToDefault(aSettingItem); + } + +// --------------------------------------------------------------------------- +// SetDynamicSettingToSceneDefaultL +// +// Set the dynamic setting identified by aSettingId to scene default. +// Because video and photo scenes can have sama identifiers, aVideoScene +// is needed to decide which ones to look for. +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::SetDynamicSettingToSceneDefaultL( TInt aSceneId, + TInt aSceneField, + TInt aSettingId, + TBool aVideoScene ) + { + return iSettingsModel->SetDynamicSettingToSceneDefaultL( aSceneId, + aSceneField, + aSettingId, + aVideoScene ); + } + + + + +#ifdef PRODUCT_USES_GENERIC_SETUP_INDICATOR +// --------------------------------------------------------------------------- +// CCamAppController::VideoSceneDefaultsAreSet +// Returns whether the video setup settings are set to the defaults +// for its current scene. +// --------------------------------------------------------------------------- +// +TBool +CCamAppController::VideoSceneDefaultsAreSet() + { + return iSettingsModel->VideoSceneDefaultsAreSet(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::PhotoSceneDefaultsAreSet +// Returns whether the photo setup settings are set to the defaults +// for its current scene. +// --------------------------------------------------------------------------- +// +TBool +CCamAppController::PhotoSceneDefaultsAreSet() + { + return iSettingsModel->PhotoSceneDefaultsAreSet(); + } + +#endif // PRODUCT_USES_GENERIC_SETUP_INDICATOR + + +// --------------------------------------------------------------------------- +// CCamAppController::CurrentFullFileName +// --------------------------------------------------------------------------- +// +const TDesC& +CCamAppController::CurrentFullFileName() const + { + PRINT1( _L("Camera => CCamAppController::CurrentFullFileName, index:%d"), iCurrentImageIndex ); + const TDesC& name( BurstCaptureArray()->FileName( iCurrentImageIndex ) ); + + if( name != KNullDesC ) + { + PRINT1( _L("Camera <= CCamAppController::CurrentFullFileName, return:[%S]"), &name ); + } + else + { + PRINT( _L("Camera <= CCamAppController::CurrentFullFileName, name not set.") ); + } + return name; + } + +const TDesC& +CCamAppController::CurrentVideoFileName() const + { + return iSuggestedVideoPath; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CCamAppController +// C++ default constructor can NOT contain any code, that +// might leave. +// --------------------------------------------------------------------------- +// +CCamAppController::CCamAppController() + : iBusyFlags( EBusyNone ) + , iDiskCriticalLevel ( KErrNotFound ) + , iRamDiskCriticalLevel( KErrNotFound ) + , iImageOrientation( ECamOrientation0 ) + , iLastImageOrientation( ECamOrientation0 ) + { + } + +// --------------------------------------------------------------------------- +// CCamAppController::ConstructL +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +// +void CCamAppController::ConstructL() + { + PRINT( _L("Camera => CCamAppController::ConstructL")); + iPendingAFRequest=0; + iCurrentAFRequest=0; + iNoBurstCancel=EFalse; + + PRINT( _L("Camera <> CCamAppController::ConstructL - constructing Configuration Manager")); + iConfiguration = CCamConfiguration::NewL(); + + + CCamFolderUtility::ResetCounters( iMonthFolderCounters ); + iCaptureKeyPressedWhileImageSaving = EFalse; + + iCaptureModeTransitionInProgress = ETrue; + + iSettingsModel = CCamSettingsModel::NewL( *iConfiguration ); + iSettingsModel->AttachObserverL( this ); + + // Get the config pointer from settings model + iConfigManager = static_cast(iSettingsModel)->UiConfigManagerPtr(); + + RArray supportedValues; + CleanupClosePushL( supportedValues ); + + // Get the EV slider info + // these values should be read before camsettingsprovided is constructd + // as the EV step value is needed during the construction of camsettingsprovider. + iConfigManager->SupportedEVSettingsL( supportedValues ); + + if ( supportedValues.Count() > 0 ) + { + iEvRange.iMinValue = supportedValues[0]; + iEvRange.iMaxValue = supportedValues[1]; + iEvRange.iStepsPerUnit = supportedValues[2]; + } + + CleanupStack::PopAndDestroy( &supportedValues ); + + // The Settings Model handles the previews at the moment + iSettingsPreviewHandler = static_cast( iSettingsModel ); + + //iSettingProvider = CCamConstantSettingProvider::NewL( *this ); + iSettingProvider = CCamSettingProvider::NewL( *this, iSettingsModel ); + + iDeepSleepTimer = CCamTimer::NewL( KDeepSleepTimeout, + TCallBack( CCamAppController::DeepSleepTimeout, this ) ); + + iIdleTimer = CCamTimer::NewL( KIdleTimeout, + TCallBack( CCamAppController::IdleTimeoutL, this ) ); + iImageSaveActive = CCamImageSaveActive::NewL( *this , *this ); + iCaptureArray = CCamBurstCaptureArray::NewL( *iImageSaveActive ); + iRotationArray = CCamBurstCaptureArray::NewL( *iImageSaveActive ); + iSequenceFilenameArray = new( ELeave ) CDesCArraySeg( KTimelapseArrayGranularity ); + iSoundPlayer = CCamAudioPlayerController::NewL( *this, *this ); + + if ( iConfigManager && iConfigManager->IsLensCoverSupported() ) + { + // create property watcher for slide state + PRINT( _L("Camera <> CCamAppController: Define Camera slider P&S key..") ); + + // Whole slider position reading could be removed after PCFW has implemented + // creation for KLensCoverStatus key + TInt sliderPosition; + TInt err = RProperty::Get( + CameraPlatPSKeys::KPSCameraPlatUid, + CameraPlatPSKeys::KLensCoverStatus, + sliderPosition ); + + + if( err != KErrNone ) + { + iSlideStateWatcher = CCamPropertyWatcher::NewL( *this, + NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraAvailability ); + } + else + { + iSlideStateWatcher = CCamPropertyWatcher::NewL( *this, + CameraPlatPSKeys::KPSCameraPlatUid, + CameraPlatPSKeys::KLensCoverStatus ); + } + } + + if ( iConfigManager && iConfigManager->IsKeyLockWatcherSupported() ) + { + iKeyLockStatusWatcher = CCamPropertyWatcher::NewL( *this, + KPSUidAvkonDomain, + KAknKeyguardStatus ); + } + // read central repository value indicating whether camera shutter sound + // should be played always or depending on the current profile setting + CRepository* cr = CRepository::NewLC( KCRUidCamcorderFeatures ); + TInt value; + TInt err; + User::LeaveIfError( cr->Get( KCRCamShutterSound, value ) ); + CleanupStack::PopAndDestroy( cr ); + iShutterSndAlwaysOn = value; + + // get data for monitoring free RAM during sequence capture + CamUtility::GetPsiInt( ECamPsiSnapshotSize, iSnapshotDataSize ); + + iConfiguration->GetPsiIntArrayL( ECamPsiJpegDataSizes, iJpegDataSizes ); + iConfiguration->GetPsiIntArrayL( ECamPsiSequencePostProcessDataSizes, + iSequencePostProcessDataSizes ); + + if ( iConfigManager && iConfigManager->IsCaptureToneDelaySupported() ) + { + TInt captureToneDelay = iConfigManager->CaptureToneDelay(); + TCallBack captureToneCb( CCamAppController::CaptureToneDelayTimeout, this ); + iCaptureToneDelayTimer = + CCamTimer::NewL( captureToneDelay * KMicroSecsInMilliSec, + captureToneCb ); + } + + PRINT( _L("Camera <> CCamAppController: Define Camera focused P&S key..") ); + err = RProperty::Define( KPSUidCamcorderNotifier, + KCCorFocused, + RProperty::EInt ); + if ( KErrNone != err ) + { + // Error handling. Remove warning. + } + + if ( iConfigManager && iConfigManager->IsPublishZoomStateSupported() ) + { // Publish zoom state + iContextFwClient = CCFClient::NewL( *this ); + + // Defining the context using the Context Framework. + err = iContextFwClient->DefineContext( + KCamContextSource, + KCamContextType, + KCamContextSecurity ); + if( KErrNone == err ) + { + iDefineContextSuccessful = ETrue; + PublishZoomStateL( EFalse ); + } + else + { + // We make sure that we dont proceed with publishing the zoom state + // if the context definition fails. + iDefineContextSuccessful = EFalse; + } + } // Publish zoom state + + iLocationTrailStarted = EFalse; + + CamUtility::GetPsiInt( ECamPsiMaxBurstCapture, iLongSequenceLimit ); + + User::LeaveIfError( iFs.Connect() ); + iDriveChangeNotifier = CCamDriveChangeNotifier::NewL( iFs, *this ); + + PRINT( _L("Camera <= CCamAppController::ConstructL")); + } + + + +/* +* CCamAppController::PublishZoomStateL +*/ +void CCamAppController::PublishZoomStateL( const TBool aEnabled ) + { + // We publish the zoom state only when context definition is + // successful. the value of the zoom state is controlled by the + // boolean flag "aEnabled". + if ( iConfigManager && iConfigManager->IsPublishZoomStateSupported() ) + { + if ( iDefineContextSuccessful ) + { + CCFContextQuery* query = CCFContextQuery::NewLC(); + query->SetSourceL( KCamContextSource ); + query->SetTypeL( KCamContextType ); + RContextObjectArray result; + TInt err = iContextFwClient->RequestContext( *query, result ); + if( err == KErrNone && result.Count() > 0 ) + { + if ( aEnabled ) + { + result[0]->SetValueL( KCamContextValueEnable ); + } + else + { + result[0]->SetValueL( KCamContextValueDisable ); + } + TInt err = iContextFwClient->PublishContext( *result[0] ); + if ( err != KErrNone ) + { + // Define how to handle the error case. + } + } + else + { + // ignoring the error case. + } + result.ResetAndDestroy(); + CleanupStack::PopAndDestroy( query ); + } + } + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::IsViewFinding +// Check if viewfinder is active +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsViewFinding() const + { + __ASSERT_DEBUG( iCameraController, CamPanic( ECamPanicInvalidState ) ); + return ( iCameraController + && iCameraController->ViewfinderState() == ECamTriActive ); + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::NotifyControllerObservers +// Notify the controller observers that a new controller event has occurred +// --------------------------------------------------------------------------- +// +void +CCamAppController +::NotifyControllerObservers( TCamControllerEvent aEvent, + TInt aError ) const + { + PRINT( _L("Camera => CCamAppController::NotifyControllerObservers")); + // We might need to stop notification for some time. + if( !iMuteNotifications ) + { + for ( TInt i = 0; i < iControllerObservers.Count(); i++ ) + { + // NON-NULL checked when adding observers. + // If the notification leaves, continue for the other observers + TRAP_IGNORE( iControllerObservers[i]->HandleControllerEventL( aEvent, aError ) ) + } + } + PRINT( _L("Camera <= CCamAppController::NotifyControllerObservers")); + } + + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void +CCamAppController +::EnterViewfinderMode( const TCamCameraMode& aMode ) + { + PRINT( _L("Camera => CCamAppController::EnterViewfinderMode")); + + TInt error( KErrNone ); + iPendingRelease = EFalse; + + // start monitoring mmc dismount notifications + StartDismountMonitoring(); + + if ( iConfigManager && iConfigManager->IsPublishZoomStateSupported() ) + { + TRAP_IGNORE ( PublishZoomStateL( ETrue ) ); + } + + // Clear these just in case some video prepare is pending. + iVideoPrepareNeeded = EFalse; + + + if( ECamControllerVideo == aMode ) + { + // Filename generation needs to be done in all case, not only + // when the current path is null. + // if( KNullDesC() == iSuggestedVideoPath ) + { + TRAP_IGNORE( GenerateNextValidVideoPathL() ); + } + + // Clear this to be sure it doesn't block recording + iVideoRequested = EFalse; + SetTargetMode ( ECamControllerVideo ); + SetTargetImageMode( ECamImageCaptureNone ); + // shutdown the orientation channel when going to videomode + if ( iConfigManager && iConfigManager->IsOrientationSensorSupported() ) + { + TRAP_IGNORE( UpdateSensorApiL( EFalse ) ); + } + } + else if( ECamControllerImage == aMode ) + { + SetTargetMode ( ECamControllerImage ); +// SetTargetImageMode( ECamImageCaptureSingle ); + SetTargetImageMode( CurrentImageModeSetup() ); + } + else + { + SetOperation( ECamStandby, KErrGeneral ); + return; + } + + iInfo.iTargetVfState = ECamTriActive; + if( !Busy() ) + { + TRAP( error, IssueModeChangeSequenceL() ); + if ( KErrNone != error + && ECamStandby != iInfo.iOperation ) + { + SetOperation( ECamStandby, error ); + } + } + else + { + // operation will continue when busy sequence or request completes + } + PRINT( _L("Camera <= CCamAppController::EnterViewfinderMode")); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void +CCamAppController::ExitViewfinderMode( const TCamCameraMode& aMode ) + { + PRINT( _L("Camera => CCamAppController::ExitViewfinderMode")); + // The check here is to ensure that the viewfinder isn't stopped by the still precapture + // view when it has just lost the foreground to the video precapture view and vice versa. + // In that case the mode in parameter would not match the target mode. + if( iInfo.iOperation != ECamStandby ) + { + if ( aMode == iInfo.iTargetMode ) + { + iInfo.iTargetVfState = ECamTriIdle; + SetTargetImageMode( ECamImageCaptureNone ); + + if( !Busy() ) + { + if ( iConfigManager && iConfigManager->IsPublishZoomStateSupported() ) + { + TRAP_IGNORE ( PublishZoomStateL( EFalse ) ); + } + TRAPD( error, IssueDirectRequestL( ECamRequestVfRelease ) ); + if ( KErrNone != error + && ECamStandby != iInfo.iOperation ) + { + SetOperation( ECamStandby, error ); + } + } + else + { + // operation will continue when busy sequence or request completes + } + } + } + PRINT( _L("Camera <= CCamAppController::ExitViewfinderMode")); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::StartViewFinder(); +// Non-leaving version of StartViewFinderL() +// --------------------------------------------------------------------------- +// +void +CCamAppController::StartViewFinder() + { + PRINT( _L("Camera => CCamAppController::StartViewFinder" )) + iInfo.iTargetVfState = ECamTriActive; + + if( !Busy() ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_STARTVIEWFINDER, "e_CAM_APP_VF_INIT 0" ); //CCORAPP_APP_VF_INIT_END + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMAPPCONTROLLER_STARTVIEWFINDER, "e_CAM_APP_OVERLAY_INIT 0" ); //CCORAPP_APP_OVERLAY_INIT_END + + TRAPD( error, IssueDirectRequestL( ECamRequestVfStart ) ); + if ( KErrNone != error + && ECamStandby != iInfo.iOperation ) + { + PRINT( _L("Camera <> CCamAppController::StartViewFinder - [ERROR] VF start failed, go to standby" )) + SetOperation( ECamStandby, error ); + } + } + else + { + // Vf started at earliest convenient time when ongoing requests finish. + } + PRINT(_L("Camera <= CCamAppController::StartViewFinder") ); + } + +// --------------------------------------------------------------------------- +// StopViewFinder +// Stop the viewfinder immediately +// --------------------------------------------------------------------------- +// +void +CCamAppController::StopViewFinder() + { + PRINT( _L("Camera => CCamAppController::StopViewFinderNow" ) ) + __ASSERT_DEBUG( iCameraController, CamPanic( ECamPanicInvalidState ) ); + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_STOPVIEWFINDER, "e_CAM_APP_STOP_VF 1" ); //CCORAPP_STOP_VF_START + + if ( iBacklightTimer && iBacklightTimer->IsActive() ) + { + iBacklightTimer->Cancel(); + } + + // Only stop if active. + // Idle and inactive need no action at this point. + if( ECamTriActive == iCameraController->ViewfinderState() ) + { + iInfo.iTargetVfState = ECamTriInactive; + + // Can only fail to OOM when state is checked. + TRAPD( error, iCameraController->DirectRequestL( ECamRequestVfStop ) ); + if( KErrNone != error + && ECamStandby != iInfo.iOperation ) + { + SetOperation( ECamStandby, error ); + } + } + + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMAPPCONTROLLER_STOPVIEWFINDER, "e_CAM_APP_STOP_VF 0" ); //CCORAPP_STOP_VF_END + + PRINT( _L("Camera <= CCamAppController::StopViewFinderNow" ) ) + } + +// --------------------------------------------------------------------------- +// StopViewFinderEcam +// Stop the viewfinder immediately without changing states +// --------------------------------------------------------------------------- +// +void +CCamAppController::StopViewFinderEcam() + { + PRINT( _L("Camera => CCamAppController::StopViewFinderEcam" ) ) + __ASSERT_DEBUG( iCameraController, CamPanic( ECamPanicInvalidState ) ); + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_STOPVIEWFINDERECAM, "e_CAM_APP_STOP_VF 1" ); //CCORAPP_STOP_VF_START + + // Trap and ignore error + TRAP_IGNORE( iCameraController->DirectRequestL( ECamRequestVfStopEcam ) ); + + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMAPPCONTROLLER_STOPVIEWFINDERECAM, "e_CAM_APP_STOP_VF 0" ); //CCORAPP_STOP_VF_END + + PRINT( _L("Camera <= CCamAppController::StopViewFinderEcam" ) ) + } + +// --------------------------------------------------------------------------- +// CCamAppController::FreezeViewFinder +// Copy the next viewfinder frame then stop the viewfinder +// --------------------------------------------------------------------------- +// +void CCamAppController::FreezeViewFinder( TBool aFreeze ) + { + // If the viewfinder needs to freeze + if ( aFreeze ) + { + PERF_MESSAGE_L2( EPerfMessagePausingViewFinder ); + iFreezeViewFinder = ETrue; + iUpdateFrozenFrame = ETrue; + } + // Restarting the viewfinder + else + { + iFreezeViewFinder = EFalse; + iUpdateFrozenFrame = EFalse; + if ( ECamTriActive != iCameraController->ControllerInfo().iVfState ) + { + StartViewFinder(); + } + } + } + + +// --------------------------------------------------------------------------- +// CCamAppController::SetKeyUp +// Set iKeyUP value which is used to determine if burst +// timer should be activated or not +// --------------------------------------------------------------------------- +// +void CCamAppController::SetKeyUp( TBool aValue /*= EFalse*/ ) + { + PRINT1(_L("Camera => CCamAppController::SetKeyUp, iKeyUP=%d"), aValue ); + iKeyUP=aValue; + } + +// --------------------------------------------------------------------------- +// CCamAppController::DoCaptureL +// Initiate image capture +// --------------------------------------------------------------------------- +// +TBool CCamAppController::DoCaptureL() + { + PRINT( _L("Camera => CCamAppController::DoCaptureL()")); + PRINT2(_L("Camera <> mode[%s] imagemode[%s]"), KCamModeNames[iInfo.iMode], KCamImageModeNames[iInfo.iImageMode] ); + + // ReleaseArray(); + if( iImageSaveActive->Count() <= 0 ) + { + ReleaseArray( ETrue ); + } + iCurrentImageIndex = 0; + iArrayUsageCount = KImageArrayUsers; + + iCameraWoken = EFalse; + + TBool continueWithCapture = ETrue; + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + // Capture needed as fast as possible. + // Use direct stopping of viewfinder + // unless there are settings pending, + // otherwise cancel capture + if ( !IsFlagOn( iBusyFlags, EBusySetting ) ) + { + // Stop VF for burst mode or for secondary or + // embedded camera before capturing. + // VF stopping will increase capture lag. + if ( iInfo.iImageMode == ECamImageCaptureBurst || + iInfo.iActiveCamera == ECamActiveCameraSecondary || + appUi->IsEmbedded() ) + { + StopViewFinder(); + } + } + else + { + continueWithCapture = EFalse; + } + + + switch( iInfo.iImageMode ) + { + // ----------------------------------------------------- + // Burst capture + case ECamImageCaptureBurst: + { + PRINT( _L("Camera <> CCamAppController::DoCaptureL .. case ECamImageCaptureBurst") ); + /* + TCamPhotoSizeId sizeId( GetCurrentImageResolution() ); + + TInt memoryNeed( iJpegDataSizes[sizeId] + + iSequencePostProcessDataSizes[sizeId] + + iSnapshotDataSize ); + TInt memoryFree( 0 ); + HAL::Get( HALData::EMemoryRAMFree, memoryFree ); // error ignored + + if( memoryFree < memoryNeed ) + { + PRINT( _L( "Camera <> Not enough memory for more burst captures - complete capture" ) ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + // Force re-prepare of engine + appUi->HandleCommandL( ECamCmdSequence ); + + // Display out of memory note + NotifyControllerObservers( ECamEventSnapshotReady, KErrNoMemory ); + + // Return app to burst precapture state from burst in-capture + SetOperation( ECamNoOperation ); + NotifyControllerObservers( ECamEventCaptureComplete ); + + // Force update of UI furniture + NotifyControllerObservers( ECamEventCounterUpdated ); + appUi->UpdateCba(); + + iCaptureRequested = EFalse; + HandleCaptureCompletion(); + continueWithCapture = EFalse; + } + else + { + iSequenceCaptureInProgress = ETrue; + iActualBurstCount = 0; + FreezeViewFinder( ETrue ); + // Stop the screensaver from coming on when burst mode is active + EnableScreenSaver( EFalse ); + // Make navi counter update itself + NotifyControllerObservers( ECamEventCounterUpdated ); + } + */ + + if( !appUi->SelfTimerEnabled() ) + { + // Start timer to change burst mode to press and hold + // if not determined to be short burst before that. + + //One such case is if capturekeyup event has occured before + //DocaptureL method + if( !iKeyUP && !iNoBurstCancel ) + { + StartBurstTimerL(); + } + } + iSequenceCaptureInProgress = ETrue; + iValueIsStored = EFalse; + FreezeViewFinder( ETrue ); + EnableScreenSaver( EFalse ); + if( iBacklightTimer + && !iBacklightTimer->IsActive() ) + { + iBacklightTimer->Start( 0, + KBacklighTimerInterval, + TCallBack( ResetInactivityTimer, this ) ); + } + NotifyControllerObservers( ECamEventCounterUpdated ); + + break; + } + // ----------------------------------------------------- + // Timelapse capture + case ECamImageCaptureTimeLapse: + { + PRINT( _L("Camera <> CCamAppController::DoCaptureL .. case ECamImageCaptureTimeLapse") ); + iSequenceCaptureInProgress = ETrue; + // Stop the screensaver from coming on when burst mode is active + EnableScreenSaver( EFalse ); + + // Get the remaining image count and only start the timer for the next capture if there is enough + // space, taking into account that the current capture will also use up one image + TCamMediaStorage storage( (TCamMediaStorage)IntegerSettingValue( ECamSettingItemPhotoMediaStorage ) ); + TCamPhotoSizeId sizeId ( GetCurrentImageResolution() ); + + TInt remainingCount = ImagesRemaining( storage, ETrue, sizeId ); + + // Check if the advanced sequence is limited (by starting from selftimer) + if( remainingCount >= 1 + && iRequestedCaptureCount <= TimeLapseImageCount()+1 ) + { + iCompleteTimeLapsePending = ETrue; + } + + // if there isn't space for this capture (e.g. some memory has been used since the timer was initiated + // or there isn't enough space to initiate a further capture + else if ( remainingCount <= 1 ) + { + PRINT( _L("Camera <> CCamAppController::DoCaptureL .. only space for one capture, stop timer") ); + + // The timer is no longer needed + if ( iTimeLapseTimer ) + { + iTimeLapseTimer->Cancel(); + delete iTimeLapseTimer; + iTimeLapseTimer = NULL; + } + // if there isn't even enough space for this capture + if ( remainingCount < 1 ) + { + // complete the timelapse capture now (prevent the current capture from starting) + continueWithCapture = EFalse; + iArrayUsageCount = 0; + CompleteTimeLapseOperation(); + } + else // if there isn't enough space to initiate a further capture + { + // ensure that the time lapse capture completes after the current capture + iCompleteTimeLapsePending = ETrue; + } + } + + else // there is space to initiate a further capture + { + PRINT( _L("Camera <> CCamAppController::DoCaptureL .. space for more than this capture, timer set on..") ); + if ( !iTimeLapseTimer ) + { + RestartTimeLapseTimerL(); + + //Products which support autofocus needs to reduce time for second picture + //about the time needed by autofocus. + if( iConfigManager && iConfigManager->IsAutoFocusSupported() + && !CurrentSceneHasForcedFocus() ) + { + iTimeLapseStartTime = iTimeLapseStartTime - TTimeIntervalSeconds( KFocusingDurationSeconds ); + } + } + } + break; + } + // ----------------------------------------------------- + // Single capture + case ECamImageCaptureSingle: + PRINT( _L("Camera <> CCamAppController::DoCaptureL .. case ECamImageCaptureSingle") ); + // Should not take so long to get the image captured and saved, + // but + EnableScreenSaver( EFalse ); + SetCaptureKeyPressedWhileImageSaving(EFalse); + break; + // ----------------------------------------------------- + default: + PRINT(_L("Camera <> Not in any image capture mode, LEAVE!!")); + User::Leave( KErrGeneral ); + break; + // ----------------------------------------------------- + } + + if ( continueWithCapture ) + { + IssueRequestL( ECamRequestImageCapture ); + // Operation in progress is updated in HandleCameraEventL + // store the orientation at capture time, needed in thumbnail creation + iCaptureOrientation = iLastImageOrientation; + } + + iCaptureStoppedForUsb = EFalse; + PRINT( _L("Camera <= CCamAppController::DoCaptureL()")); + return continueWithCapture; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::DoRecord +// Initiate video recording +// --------------------------------------------------------------------------- +// +void CCamAppController::DoRecord() + { + PRINT( _L("Camera => CCamAppController::DoRecord") ); + __ASSERT_DEBUG( iCameraController, CamPanic( ECamPanicInvalidState ) ); + + StopIdleTimer(); + + // No key sounds when recording + TRAP_IGNORE( iSoundPlayer->DisableAllKeySoundsL() ); + + PRINT( _L("Camera <> Requesting video capture start..") ); + TRAPD( error, IssueRequestL( ECamRequestVideoStart ) ); + PRINT1( _L("Camera <> ..request issued, status:%d"), error ); + + if( KErrNone != error ) SetOperation( ECamStandby, error ); + else SetOperation( ECamCapturing ); + + // Request is handled + iVideoRequested = EFalse; + + iCaptureStoppedForUsb = EFalse; + PRINT( _L("Camera <= CCamAppController::DoRecord") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::ReserveFileNamesL +// Reserve a set of filenames for a burst capture +// --------------------------------------------------------------------------- +// +void +CCamAppController::ReserveFileNamesL( + const TCamCameraMode& aCaptureMode, + const TCamImageCaptureMode& aImageMode, + TBool aForcePhoneMem /*= EFalse*/ ) + { + PRINT( _L("Camera => CCamAppController::ReserveFileNamesL") ) + TInt captureCount = 1; + TInt store = ECamMediaStorageNone; + TBuf extension; + + // If the next file will be a photo + if ( ECamControllerImage == aCaptureMode ) + { + extension = KImageExtension; + } + // Otherwise the next file will be a video + else + { +#ifndef __WINS__ + TCamVideoFileType fileType = static_cast + ( IntegerSettingValue( ECamSettingItemVideoFileType ) ); + + extension = ( ECamVideoMpeg4 == fileType ) + ? KVideoMP4Extension + : KVideo3GPExtension; +#else + extension = KVideo3GPExtension; +#endif + } + + store = ( ECamControllerImage == aCaptureMode ) ? + CurrentPhotoStorageLocation() : CurrentVideoStorageLocation(); + + TPath basePath; + + // Take a snapshot of the date - to ensure a sequence on a date boundary isn't split into + // different months + TTime now; + now.HomeTime(); + // Need to check that there is enough space for the files. If this is a sequence of 20 images or + // less then ensure there is enough space in the current folder, otherwise only one space is needed + TInt guaranteedGroup = 1; + if ( captureCount < CCamFolderUtility::KMaxGuaranteedBurstGroup ) + { + guaranteedGroup = captureCount; + } + + // Leaves if errors generating the path + CCamFolderUtility::GetBasePathL( iMonthFolderCounters, + store, + basePath, + aCaptureMode, + ETrue, + guaranteedGroup, + now ); + + iCurrentStorage = static_cast( store ); +// TInt numberSettingId( KErrNotFound ); + TInt typeSettingId( KErrNotFound ); + TInt baseSettingId( KErrNotFound ); + TInt counter( 0 ); + + if( ECamControllerVideo == aCaptureMode ) + { +// numberSettingId = ECamSettingItemVideoNumber; + counter = IntegerSettingValue( ECamSettingItemVideoNumber ); + typeSettingId = ECamSettingItemVideoNameBaseType; + baseSettingId = ECamSettingItemVideoNameBase; + } + else + { +// numberSettingId = ECamSettingItemPhotoNumber; + counter = iImageNumberCache; + typeSettingId = ECamSettingItemPhotoNameBaseType; + baseSettingId = ECamSettingItemPhotoNameBase; + } + +// TInt counter( IntegerSettingValue( numberSettingId ) ); + TBuf dateNameBase; + TPtrC nameBase; + if ( ECamNameBaseDate == iSettingsModel->IntegerSettingValue( typeSettingId ) ) + { + CamUtility::FormatDateFileNameL( dateNameBase ); + nameBase.Set( dateNameBase ); + } + else + { + nameBase.Set( TextSettingValue( baseSettingId ) ); + } + + RFs rfs; + User::LeaveIfError( rfs.Connect() ); + CleanupClosePushL( rfs ); + + TEntry entry; + + TInt namedImages = 0; + while ( namedImages < captureCount ) + { + // Generate new name + TFileName newFileName; + + CamUtility::FormatFileName( counter, nameBase, newFileName ); + + TFileName newPath( basePath ); + newPath.Append( newFileName ); + newPath.Append( extension ); + + // if there is no file in the current location with this name + TEntry entry; // Prevent LINT error + TInt ferr = rfs.Entry( newPath, entry ); + if ( KErrNotFound == ferr ) + { + // A file with that name was not found, so the filename is okay. + PRINT( _L("Camera <> Filename OK.") ) + namedImages++; + StoreNextFileNameL( newPath ); + + // If this is time lapse capture then the full set of file names + // will be needed for the 'delete sequence' option. The burst capture array + // in timelapse only holds data for one item at a time so a separate array + // is used to keep track of all the images file names. The redundancy in filename + // storage is limited to a single file name. + if ( ECamImageCaptureTimeLapse == aImageMode ) + { + TRAP_IGNORE( iSequenceFilenameArray->AppendL( newPath ) ); + // Update the images captured count + NotifyControllerObservers( ECamEventCounterUpdated ); + } + counter++; + } + else if ( KErrNone == ferr ) + { + // A file with that name exists already. Increment the counter and try again. + PRINT( _L("Camera <> Filename already in use!") ) + counter++; // Try the next index number + } + else + { + // There was some other error. Can not save file -> Leave. + PRINT1( _L("Camera <> File server returned error: %d"), ferr ); + User::Leave( ferr ); + } + + } + CleanupStack::PopAndDestroy( &rfs ); + + // SetIntegerSettingValueL( numberSettingId, counter ); + if( ECamControllerVideo == aCaptureMode ) + { + SetIntegerSettingValueL( ECamSettingItemVideoNumber, counter ); + } + else + { + // SetIntegerSettingValueL called when capture ends. + iImageNumberCache = counter; + } + + PRINT( _L("Camera <= CCamAppController::ReserveFileNamesL") ) + } + + +// --------------------------------------------------------------------------- +// CCamAppController::CreateDummyFileL +// Create dummy file ready for image storage +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::CreateDummyFileL( RFs& aFs, const TDesC& aFullPath ) + { + PRINT1( _L("Camera => CCamAppController::CreateDummyFileL [%S]"), &aFullPath ); + RFile file; + CleanupClosePushL( file ); + + TInt err = file.Create( aFs, aFullPath, EFileWrite ); + if ( err == KErrNone ) + { + // Still image files are made writable and non-hidden + // just before the save operation + // file is set to hidden so that media gallery does not detect it + file.SetAtt( KEntryAttReadOnly|KEntryAttHidden, 0 ); + } + + CleanupStack::PopAndDestroy( &file ); + + PRINT1( _L("Camera <= CCamAppController::CreateDummyFileL, status:%d"), err ); + return err; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::StoreNextFileNameL +// Add newly generated filename to array of names +// --------------------------------------------------------------------------- +// +void CCamAppController::StoreNextFileNameL( const TDesC& aFullPath ) + { + PRINT( _L("Camera => CCamAppController::StoreNextFileNameL") ); + TParse parse; + parse.Set( aFullPath, NULL, NULL ); + + // Store the path + filename and plain filename for future reference + if( ECamControllerVideo == iInfo.iMode && BurstCaptureArray()->Count() > 0 ) + { + BurstCaptureArray()->SetNameL( aFullPath, parse.Name(), 0 ); + } + else + { + BurstCaptureArray()->SetNextNameL( aFullPath, parse.Name() ); + } + + PRINT( _L("Camera <= CCamAppController::StoreNextFileNameL") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::GenerateNextVideoFilePathL +// Generate a new file name and full path to save the next +// video +// --------------------------------------------------------------------------- +// +void CCamAppController::GenerateNextVideoFilePathL( TBool aForcePhoneMem ) + { + PRINT1( _L( "Camera => CCamAppController::GenerateNextVideoFilePathL, force phone mem:%d" ), aForcePhoneMem ) + TInt store = IntegerSettingValue( ECamSettingItemVideoMediaStorage ); + + TBuf extension; + +#ifdef __WINS__ + extension = KVideo3GPExtension; +#else + // If the video file type is MP3, then display this icon. + TCamVideoFileType fileType = + static_cast( + IntegerSettingValue( ECamSettingItemVideoFileType ) ); + + extension = (fileType == ECamVideoMpeg4) + ? KVideoMP4Extension + : KVideo3GPExtension; +#endif + + TBuf dateNameBase; + TPtrC baseVideoName; + + if ( iSettingsModel->IntegerSettingValue( + ECamSettingItemVideoNameBaseType ) == ECamNameBaseDate ) + { + CamUtility::FormatDateFileNameL( dateNameBase ); + baseVideoName.Set( dateNameBase ); + } + else + { + baseVideoName.Set( TextSettingValue( ECamSettingItemVideoNameBase ) ); + } + + TFileName nextFileName( baseVideoName ); + + store = ( ECamControllerImage == iInfo.iMode ) ? + CurrentPhotoStorageLocation() : CurrentVideoStorageLocation(); + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + if ( IsAppUiAvailable() && + appUi && + appUi->IsMemoryFullOrUnavailable( ECamMediaStorageCard ) && + ECamMediaStorageCard == store ) + { + if ( ExistMassStorage() ) + { + // with multiple drives, the mass memory is the default + PRINT( _L("Camera <> Force ECamMediaStorageMassStorage") ); + store = ECamMediaStorageMassStorage; + } + else + { + PRINT( _L("Camera <> Force ECamMediaStoragePhone") ); + store = ECamMediaStoragePhone; + } + } + + TInt fileNameCounter = IntegerSettingValue( ECamSettingItemVideoNumber ); + + // Update contents of iSuggestedVideoPath (drive and folders only) + CCamFolderUtility::GetBasePathL( iMonthFolderCounters, + store, + iSuggestedVideoPath, + ECamControllerVideo, + ETrue ); + + iCurrentStorage = static_cast( store ); + // Update contents of iSuggestedVideoPath (appending filename and extension) + CamUtility::GetUniqueNameL( iSuggestedVideoPath, nextFileName, fileNameCounter, extension ); + PRINT( _L( "Camera <= CamAppController::GenerateNextVideoFilePathL" ) ) + } + +// --------------------------------------------------------------------------- +// CCamAppController::GenerateNextValidVideoPathL +// Generate a new file name and full path to save the next video. +// If the generated file (using settings to suggest the drive) can not be opened +// try again, forcing the file to be on C: instead. +// --------------------------------------------------------------------------- +// +void CCamAppController::GenerateNextValidVideoPathL() + { + PRINT( _L("Camera => CCamAppController::GenerateNextValidVideoPathL()")); + + // If USB is active, use phone memory + if( CamUtility::IsUsbActive() ) + { + GenerateNextVideoFilePathL( ETrue ); + } + else + { + // Generate a file path using the settings + TRAPD( err, GenerateNextVideoFilePathL() ); + + // If left (possibly due to corrupt MMC), try again with phone memory + if ( err ) + { + // If we have got here, we can't access MMC. + // Don't switch to phone memory, but prepare the engine with a video + // name in phone memory. This will be reset if needed when the user actually + // starts recording + PRINT( _L( "Could not generate next file path! Corrupt MMC?" ) ); + GenerateNextVideoFilePathL( ETrue ); + } + } + + PRINT( _L("Camera <= CCamAppController::GenerateNextValidVideoPathL()")); + } + +// --------------------------------------------------------------------------- +// CCamAppController::GenerateNextValidImagesPathL +// Generate a new path to save the next image. +// --------------------------------------------------------------------------- +// +void CCamAppController::GenerateNextValidImagesPathL() + { + PRINT( _L("Camera => CCamAppController::GenerateNextValidImagesPathL()")); + // Generate a file path using the settings + // Ensure the image folder exists + TFileName path; + TInt storage = IntegerSettingValue( ECamSettingItemPhotoMediaStorage ); + CCamFolderUtility::GetBasePathL( iMonthFolderCounters, + storage, + path, + ECamControllerImage, + EFalse ); + + iCurrentStorage = static_cast( storage ); + PRINT( _L("Camera <= CCamAppController::GenerateNextValidImagesPathL()")); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::CaptureModeTranstionInProgress +// Report whather a capture mode is currently being prepared +// --------------------------------------------------------------------------- +// +TBool CCamAppController::CaptureModeTransitionInProgress() + { + PRINT1( _L("Camera => CCamAppController::CaptureModeTransitionInProgress (%d)"), iCaptureModeTransitionInProgress ) + return iCaptureModeTransitionInProgress; + } + +// --------------------------------------------------------------------------- +// CCamAppController::HandleSaveEvent +// From MCamImageSaveObserver. +// Handle completion of image saving +// --------------------------------------------------------------------------- +// +void +CCamAppController::HandleSaveEvent( TCamSaveEvent aEvent ) + { + PRINT3( _L( "Camera => CCamAppController::HandleSaveEvent .. event[%s] imagemode[%s] operation[%s]" ), + KCamSaveEventNames [aEvent ], + KCamImageModeNames [iInfo.iImageMode], + KCamCaptureOperationNames[iInfo.iOperation] ) + + TBool mediaFileChanged = EFalse; + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( ( iCaptureArray->ImagesRemaining() <= 0 ) + && appUi + && appUi->IsInPretendExit() ) + { + ReleaseArray( ETrue ); + } + + if( ECamSaveEventCriticalError == aEvent ) + { + PRINT( _L( "Camera <> CCamAppController::HandleSaveEvent: critical error, going to standby.." ) ) + SetOperation( ECamStandby, KErrGeneral ); + PRINT( _L( "Camera <= CCamAppController::HandleSaveEvent" ) ) + return; + } + + if( aEvent == ECamSaveEventSaveError ) + { + PRINT( _L("Camera <> CCamAppController::HandleSaveEvent - ECamSaveEventSaveError!") ); + if( iInfo.iImageMode == ECamImageCaptureBurst && + SequenceCaptureInProgress() ) + { + // Cancel ongoing burst capture + // Burst capture is normally cancelled by setting iRequestedBurstCount, + // and actual cancelling is done when next imagedata arrives. + // However, in this case camera is going to be released, and there won't + // be next image data, so give ECamRequestImageCancel and capture + // completion event here to avoid problems + PRINT( _L("Camera <> CCamAppController::HandleSaveEvent .. Cancel burst due to error") ); + TRAP_IGNORE ( IssueDirectRequestL( ECamRequestImageCancel ) ); + NotifyControllerObservers( ECamEventCaptureComplete, KErrCancel ); + } + else + { + PRINT( _L( "Camera <> CCamAppController::HandleSaveEvent: critical error, going to standby.." ) ) + SetOperation( ECamStandby, KErrGeneral ); + } + PRINT( _L("Camera <= CCamAppController::HandleSaveEvent - ECamSaveEventSaveError!") ); + return; + } + + // if a save completes + if ( aEvent == ECamSaveEventComplete ) + { + PRINT( _L("Camera <> CCamAppController::HandleSaveEvent .. ECamSaveEventComplete") ); + +#ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT + if( ECamImageCaptureBurst != iInfo.iImageMode ) + { + // Do not log in burst mode + PERF_EVENT_END_L1( EPerfEventShotToSave ); + } +#endif + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_HANDLESAVEEVENT, "e_CAM_PRI_SHOT_TO_SAVE 0" ); //CCORAPP_PRI_SHOT_TO_SAVE_END + + // Check that this is the completion of the last pending + // single image save. + // Note burst capture completion is handled separately + TBool savedAll = ( iImageSaveActive->Count()== 0 ); + TBool completing = ( ECamCompleting == iInfo.iOperation ); + + switch( iInfo.iImageMode ) + { + case ECamImageCaptureNone: // In postcapture, waiting for saving + case ECamImageCaptureSingle: + PRINT( _L("Camera <> CCamAppController::HandleSaveEvent .. case ECamImageCaptureSingle/None") ); + if( savedAll ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMAPPCONTROLLER_HANDLESAVEEVENT, "e_CAM_PRI_SERIAL_SHOOTING 0" ); //CCORAPP_PRI_SERIAL_SHOOTING_END + + PRINT( _L("Camera <> CCamAppController::HandleSaveEvent .. calling HandleCaptureCompletion()") ); + if( !iSaveStarted ) + { + HandleCaptureCompletion(); + NotifyControllerObservers( ECamEventCaptureComplete, KErrNone ); + } + else + { + iSaveStarted = EFalse; + } + + // If we have returned from postcapture to precapture before + // the filename has been sent to the gallery (i.e. pressing back + // key during image processing), iArrayUsageCount will be reduced + // to zero and capture array will be released. In that case, we must + // send the filename to gallery before it happens. + if ( iArrayUsageCount == 1 ) + { + NotifyControllerObservers( ECamEventMediaFileChanged ); + mediaFileChanged = ETrue; + } + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( iImageSaveActive && IsAppUiAvailable() ) + { + if( iImageSaveActive->Count() <= 0 && ECamViewStatePostCapture != appUi->CurrentViewState() ) + { + ReleaseArray(); + } + } + } + break; + case ECamImageCaptureTimeLapse: + PRINT( _L("Camera <> CCamAppController::HandleSaveEvent .. case ECamImageCaptureTimeLapse") ); + // If image capture has finished, but waiting for file to be saved. + if( ECamNoOperation == iInfo.iOperation || ECamCompleting == iInfo.iOperation ) + { + PRINT( _L("Camera <> CCamAppController .. current file saved, complete this capture") ); + SetOperation( ECamNoOperation ); + ReleaseArray(); + } + break; + case ECamImageCaptureBurst: + PRINT( _L("Camera <> CCamAppController::HandleSaveEvent .. case ECamImageCaptureBurst") ); + // After the whole burst has stopped, we get Image Stop event from Camera Controller, + // and enter completing state. + if( completing && savedAll ) + { + // Modify this event to "burst complete" one. + aEvent = ECamSaveEventBurstComplete; + } + break; + default: + break; + } + + NotifyControllerObservers( ECamEventSaveComplete ); + } + + if ( aEvent == ECamSaveEventStarted ) + { + if( iInfo.iImageMode == ECamImageCaptureSingle ) + { + PRINT( _L("Camera <> CCamAppController::HandleSaveEvent .. Saving started") ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMAPPCONTROLLER_HANDLESAVEEVENT, "e_CAM_APP_PREP_FOR_NEXT_SHOT 1" ); //CCORAPP_PREP_FOR_NEXT_SHOT_START + HandleCaptureCompletion(); + NotifyControllerObservers( ECamEventCaptureComplete, KErrNone ); + NotifyControllerObservers( ECamEventSaveComplete ); + iCaptureRequested = EFalse; + iSaveStarted = ETrue; + OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMAPPCONTROLLER_HANDLESAVEEVENT, "e_CAM_APP_PREP_FOR_NEXT_SHOT 0" ); //CCORAPP_PREP_FOR_NEXT_SHOT_END + OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMAPPCONTROLLER_HANDLESAVEEVENT, "e_CAM_PRI_SHOT_TO_SHOT 0" ); //CCORAPP_PRI_SHOT_TO_SHOT_END + } + } + + // If the user cancelled a save + if ( aEvent == ECamSaveEventUserCancelled ) + { + PRINT( _L( "Camera <> CCamAppController::HandleSaveEvent .. ECamSaveEventUserCancelled" ) ) + //iInfo.iImageMode = ECamImageModeNone; + // Make sure that any further engine callbacks are ignored until next capture + SetOperation( ECamNoOperation ); + + // Delete dummy files for unsaved images + TInt nextSavingImage = BurstCaptureArray()->NextFileIndex(); + TInt lastImage = BurstCaptureArray()->Count(); + TInt i; + // delete the next and following files + for ( i = nextSavingImage; i < lastImage; i++ ) + { + SetAsCurrentImage( i ); + DeleteCurrentFile(); + } + SetAsCurrentImage( 0 ); + // Empty out the array - this ensures the thumbnail view doesn't open + BurstCaptureArray()->Reset(); + + NotifyControllerObservers( ECamEventSaveCancelled ); + } + + // if a burst capture has completed + if ( aEvent == ECamSaveEventBurstComplete ) + { + CompleteBurstOperation(); + + if( ECamCompleting == iInfo.iOperation ) + { + PRINT( _L( "Camera <> CCamAppController::HandleSaveEvent .. completing burst capture" ) ) + SetOperation( ECamNoOperation ); + NotifyControllerObservers( ECamEventCaptureComplete, KErrNone ); + ReleaseArray(); + } + + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMAPPCONTROLLER_HANDLESAVEEVENT, "e_CAM_PRI_SERIAL_SHOOTING 0" ); //CCORAPP_PRI_SERIAL_SHOOTING_END + } + else + { + if ( iImageSaveActive->Count() == 0 || aEvent == ECamSaveEventStarted ) + { + iSaving = EFalse; + } + } + if ( !mediaFileChanged ) + { + NotifyControllerObservers( ECamEventMediaFileChanged ); + } + + PRINT( _L( "Camera <= CCamAppController::HandleSaveEvent" ) ) + } + + +// --------------------------------------------------------------------------- +// HandleViewfinderFrame +// --------------------------------------------------------------------------- +// +void +CCamAppController::HandleViewfinderFrame( TInt /*aStatus*/, + CFbsBitmap* /*aFrame*/ ) + { + PRINT_FRQ( _L( "Camera => CCamAppController::HandleViewfinderFrame" ) ); + +#ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT + // This function is called when a viewfinder bitmap arrives + if( EPerfWaitingForStartup == iPerformanceState ) + { + iPerformanceState = EPerfIdle; + PERF_EVENT_END_L1( EPerfEventApplicationStartup ); + } + else if( EPerfWaitingForStillMode == iPerformanceState ) + { + iPerformanceState = EPerfIdle; + PERF_EVENT_END_L1( EPerfEventSwitchToStillMode ); + } + else if( EPerfWaitingForVideoMode == iPerformanceState ) + { + iPerformanceState = EPerfIdle; + PERF_EVENT_END_L1( EPerfEventSwitchToVideoMode ); + } + else if( EPerfWaitingForBurstFrame == iPerformanceState ) + { + iPerformanceState = EPerfIdle; + PERF_EVENT_END_L1( EPerfEventBurstCaptureMomentToViewfinderFrame ); + } +#endif + + if( ECamControllerVideo == iInfo.iMode ) + { + // removed first vf frame usage as snapshot. + // snapshot received now from Camera + } + else if( ECamControllerImage == iInfo.iMode ) + { + // No need to duplicate here. + } + else + { + // Not valid state for vf frame. + __ASSERT_DEBUG( EFalse, CamPanic( ECamPanicInvalidState ) ); + } + + if ( iZoomWaitingForCamera ) + { + iZoomWaitingForCamera = EFalse; + if ( iNewZoomPending ) + { + SetZoomValue( iDesiredZoomVal ); + } + } + PRINT_FRQ( _L( "Camera <= CCamAppController::HandleViewfinderFrame" ) ); + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CCamAppController::HandleSnapshotEvent( TInt aStatus, + CFbsBitmap* aBitmap ) + { + PRINT1( _L( "Camera => CCamAppController::HandleSnapshotEvent, status:%d" ), aStatus ); + +#ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT + if( ECamImageCaptureBurst != iInfo.iImageMode ) + { + // Do not log in burst mode + PERF_EVENT_END_L1( EPerfEventShotToSnapshot ); + } + else + { + // In burst mode + PERF_MESSAGE_L2( EPerfMessageBurstSnapshotReady ); + } +#endif + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_HANDLESNAPSHOTEVENT, "e_CAM_APP_SHOT_TO_SNAPSHOT 0" ); //CCORAPP_SHOT_TO_SNAPSHOT_END + +// --------------------------------------------------------------------------- +// Video snapshot handling + if( ECamControllerVideo == iInfo.iMode ) + { + PRINT( _L("Camera <> Snapshot in video mode") ); + if( KErrNone == aStatus ) + { + // Make a copy of the snapshot and set it as current video ss. + CopySnapshotIfNeeded( *aBitmap, aStatus ); + if( iSnapShotCopy ) + { + if (BurstCaptureArray()->Count() > 0 ) + { + const CFbsBitmap* tempSnapShotCopy = iSnapShotCopy; + TRAP_IGNORE( BurstCaptureArray()->ReplaceSnapshot( tempSnapShotCopy, 0 ) ); + } + else + { + TRAP_IGNORE( BurstCaptureArray()->SetNextSnapshotL( *iSnapShotCopy ) ); + } + } + } + + // If video recording has already stopped, give snapshot event, + // which causes snapshot to be updated in postcapture view. + // + // If recording is still in progress, the event would cause + // too early switch to pastcapture. + if( ECamNoOperation == iInfo.iOperation || + ECamCompleting == iInfo.iOperation ) + { + NotifyControllerObservers( ECamEventSnapshotReady, aStatus ); + } + + return; + } + +// --------------------------------------------------------------------------- +// Still snapshot handling + + PRINT( _L("Camera <> Snapshot in still mode") ); + + if( ECamImageCaptureTimeLapse == iInfo.iImageMode ) + { + // Update time lapse count during snapshot, so the update counter value + // appears at the same time as snapshot. + iTimeLapseCaptureCount++; + NotifyControllerObservers( ECamEventCounterUpdated ); + } + else if ( ECamImageCaptureBurst == iInfo.iImageMode ) + { + // Re-enable the screen saver if burst capture is completing. + // This has to be done when all captures complete for timelapse. + // EnableScreenSaver( ETrue ); + + NotifyControllerObservers( ECamEventCounterUpdated ); + iUpdateFrozenFrame = ETrue; + + } + + // ------------------------------------------------------- + // if there is an error with the still capture operation + if ( KErrNone != aStatus ) + { + PRINT( _L("Camera <> CCamAppController: error in, cancel saving etc..") ); + // Store this now, as it's cleared by TidyCaptureArray + // but needed a little later + TBool wasCapturingBurst = (ECamImageCaptureBurst == iInfo.iImageMode); + + iImageSaveActive->Cancel(); + + TidyCaptureArray( BurstCaptureArray()->NextFileIndex(), aStatus ); + PRINT( _L("Camera <> cancel further capturing") ); + TRAP_IGNORE( iCameraController->DirectRequestL( ECamRequestImageCancel ) ); + + NotifyControllerObservers( ECamEventSnapshotReady, aStatus ); + + if ( wasCapturingBurst ) + { + // Need this here to allow the AppUi to update the state correctly + // following the error condition. This needs to be *after* the + // change to OperationNone (called in TidyCaptureArray) so when the + // AppUi forces CBA update we're not still in burst capture state. + NotifyControllerObservers( ECamEventCaptureComplete, aStatus ); + } + + PRINT( _L( "Camera <> calling HandleCaptureCompletion()" ) ) + HandleCaptureCompletion(); + } + // ------------------------------------------------------- + // No error reported + else + { + PRINT( _L("Camera <> CCamAppController: status in KErrNone..") ); + __ASSERT_ALWAYS( aBitmap, CamPanic( ECamPanicNullPointer ) ); + + + CopySnapshotIfNeeded( *aBitmap, aStatus ); + + // Removed filename reservation when snapshot arrives. + // From now on, it's always done in HandleImageCaptureEvent, + // even if snapshot comes first. + + // This is being ignored, but there is nothing to display in the app + TRAP_IGNORE( BurstCaptureArray()->SetNextSnapshotL( *aBitmap ) ) + + NotifyControllerObservers( ECamEventSnapshotReady ); + + // If this is not a burst capture and snapshot came before image + // data, then the operation is now entering the completion phase. + // In case iFilenameReserved is set, imagedata has already + // arrived and we don't need to change state here. + if ( ECamCompleting != iInfo.iOperation && + ECamImageCaptureBurst != iInfo.iImageMode && + !iFilenameReserved ) + { + SetOperation( ECamCompleting ); + } + + if( CurrentCapturedCount() < CaptureLimit() ) + { + // Play capture sound for the next burst image + PlaySound( CaptureToneId(), EFalse ); + } + + } + // ------------------------------------------------------- + + PRINT( _L( "Camera <= CCamAppController::HandleSnapshotEvent" ) ); + } + + +// --------------------------------------------------------------------------- +// HandleImageCaptureEventL +// --------------------------------------------------------------------------- +// +void +CCamAppController::HandleImageCaptureEventL( TInt aStatus, + CCamBufferShare* aShare ) + { + PRINT1( _L("Camera => CCamAppController::HandleImageCaptureEventL, status:%d"), aStatus ); + +#ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT + if( ECamImageCaptureBurst != iInfo.iImageMode ) + { + // Do not log in burst mode + PERF_EVENT_END_L1( EPerfEventShotToStillImageReady ); + } + else + { + PERF_MESSAGE_L2( EPerfMessageBurstStillimageReady ); + } +#endif // CAMERAAPP_PERFORMANCE_MEASUREMENT + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_HANDLEIMAGECAPTUREEVENTL, "e_CAM_APP_SHOT_TO_STILL 0" ); //CCORAPP_SHOT_TO_STILL_END +/* + // Check if we need to stop the burst capture. + if ( ECamImageCaptureBurst == iInfo.iImageMode ) + { + if( CurrentCapturedCount() < CaptureLimit() ) + { + // Play capture sound for the next burst image + PlaySound( CaptureToneId(), EFalse ); + } + } +*/ + // If we have all the needed snapshots set the flag + // so the processing image text is shown. + // Do it here instead of handlesnapshotevent so that + // the counter has time to show the last image as well + if( CurrentCapturedCount() == CaptureLimit() ) + { + iAllSnapshotsReceived = ETrue; + } + + if( KErrNone == aStatus ) + { + PRINT( _L("Camera <> CCamAppController: image capture status KErrNone") ); + aShare->Reserve(); + CleanupStack::PushL( TCleanupItem( CamBufferShareCleanup, aShare ) ); + + // Reserve filename for saving the image. In case there's problem + // with current media, switch to internal memory + TRAPD(err, ReserveFileNamesL( iInfo.iMode, iInfo.iImageMode ) ); + if( KErrNone != err ) + { + if( ECamMediaStorageCard == IntegerSettingValue( ECamSettingItemPhotoMediaStorage ) ) + { + PRINT( _L("Camera <> Memory card access failed.") ) + NotifyControllerObservers( ECamEventInvalidMemoryCard ); + } + // If we have got here, we can't access MMC. Switch to phone memory + + TRAP_IGNORE( ForceUsePhoneMemoryL() ); //with multiple drive support, + //this actually uses the internal mass memory + TRAPD(err, ReserveFileNamesL( iInfo.iMode, iInfo.iImageMode ) ); + if( KErrNone != err ) + { + PRINT( _L("Camera <> Mass memory or phone memory access also failed.") ) + TRAP_IGNORE( ForceUsePhoneMemoryL() ); + TRAP_IGNORE( ReserveFileNamesL( iInfo.iMode, iInfo.iImageMode, ETrue ) ); + } + } + + TBool markedForDelete = BurstCaptureArray()->IsNextImageDeleted(); + PRINT1( _L("Camera <> Next image delete mark:%d"), markedForDelete ); + if ( !markedForDelete ) + { + PRINT( _L("Camera <> setting iImageSaveRequestPending to false")) + iImageSaveRequestPending = EFalse; + const TDesC& nextName( BurstCaptureArray()->NextFileName() ); + PRINT( _L("Camera <> BurstCaptureArray()->NextFileName() returned") ); + PRINT1( _L("Camera <> Set image to be saved, name:[%S]"), &nextName ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( ( iInfo.iImageMode == ECamImageCaptureSingle ) + && ECamSettOff == IntegerSettingValue( ECamSettingItemShowCapturedPhoto ) + && iInfo.iActiveCamera == ECamActiveCameraPrimary + && !appUi->IsEmbedded() ) + { + HandleSaveEvent( ECamSaveEventStarted ); + } + TBool added = iImageSaveActive->AddToSave( nextName, aShare ); + + if ( !added ) + { + PRINT( _L("Camera <> Image saving start unsuccessful!") ); + // The system state is consistent if this fails so ignore the error + } + else + { + PRINT( _L("Camera <> Image saving started ok.") ); + // Ownership of the data has now been passed to CCamImageSaveActive + if ( ECamImageCaptureBurst == iInfo.iImageMode ) + { + NotifyControllerObservers( ECamEventImageData ); + } + PRINT1( _L("Camera <> CCamAppController::HandleImageCaptureEventL array count:%d"), BurstCaptureArray()->Count() ); + // check if snapshot bitmap needs to be rotated before creating a thumbnail from it + TBool rotate( ECamSettOn == iSettingsModel->IntegerSettingValue( ECamSettingItemImageRotation ) && + ECamSettOn == IntegerSettingValue( ECamSettingItemShowCapturedPhoto ) && + iCaptureOrientation != ECamOrientation0 && + iInfo.iActiveCamera == ECamActiveCameraPrimary ); + if ( ECamImageCaptureBurst != iInfo.iImageMode ) + { + //create thumbnail or rotate first if needed + if ( iConfigManager && iConfigManager->IsThumbnailManagerAPISupported() ) + { + if ( rotate ) + { + RotateSnapshotL(); + } + else + { + TRAP_IGNORE( iImageSaveActive->CreateThumbnailsL( *BurstCaptureArray() ) ); + } + } + } + } + } + CleanupStack::PopAndDestroy(); // aShare->Release() + aShare = NULL; + } + else + { + PRINT( _L("Camera <> CCamAppController: capture status *not* KErrNone, mark current file for delete") ); + DeleteCurrentFile(); + } + + + iFilenameReserved = ETrue; + + PRINT( _L( "Camera <= CCamAppController::HandleImageCaptureEventL" ) ); + } + + + +// --------------------------------------------------------------------------- +// HandleImageStopEventL +// --------------------------------------------------------------------------- +// +void +CCamAppController::HandleImageStopEventL( TInt aStatus, TInt aFullCaptureCount ) + { + PRINT2( _L("Camera => CCamAppController::HandleImageStopEventL, status:%d, full captures:%d"), aStatus, aFullCaptureCount ); + + TBool saved = ( iImageSaveActive->Count()== 0 ); + + switch( iInfo.iImageMode ) + { + // ----------------------------------------------------- + case ECamImageCaptureBurst: + { + PRINT( _L( "Camera <> CCamAppController .. case ECamImageCaptureBurst" ) ); + // CompleteBurstOperation(); + + // Re-enable screen saver + EnableScreenSaver( ETrue ); + if( iBacklightTimer ) + { + iBacklightTimer->Cancel(); + } + + TInt started( iCameraController->ControllerInfo().iSnapshotCount ); + if ( aFullCaptureCount < started ) + { + PRINT ( _L("Camera <> CCamAppController .. [WARNING] Incomplete captures detected, cleaning up.." ) ); + PRINT1( _L("Camera <> CCamAppController .. [WARNING] snapshot count: %d"), started ); + PRINT1( _L("Camera <> CCamAppController .. [WARNING] full capture count: %d"), aFullCaptureCount ); + PRINT1( _L("Camera <> CCamAppController .. [WARNING] burst array count: %d"), BurstCaptureArray()->Count() ); + TInt stopAt = Min( started, BurstCaptureArray()->Count() ); + for ( TInt index = aFullCaptureCount; index < stopAt; index++ ) + { + PRINT1( _L("Camera <> CCamAppController .. [WARNING] deleting temp file from index %d.."), index ); + SetAsCurrentImage( index ); + // Parameter: notify about file system change only on last delete. + DeleteCurrentFile( stopAt-1 == index ); + } + PRINT1( _L("Camera <> CCamAppController .. [WARNING] setting as current image %d.."), aFullCaptureCount ); + SetAsCurrentImage( aFullCaptureCount ); + PRINT ( _L("Camera <> CCamAppController .. [WARNING] resetting burst array to required count..") ); + BurstCaptureArray()->Reset( aFullCaptureCount ); + } + + SetOperation( ECamCompleting ); + + // We may have deleted all the images, so check the status here. + if( iImageSaveActive->Count()== 0 ) + { + PRINT( _L( "Camera <> CCamAppController .. images already saved, completing burst capture" ) ) + SetOperation( ECamNoOperation ); + NotifyControllerObservers( ECamEventCaptureComplete, aStatus ); + ReleaseArray(); + } + // if no images were taken, clear AssumePostCaptureView flag + if ( started == 0 ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi ) + { + appUi->SetAssumePostCaptureView( EFalse ); + } + } + break; + } + // ----------------------------------------------------- + case ECamImageCaptureSingle: + { + PRINT( _L( "Camera <> CCamAppController .. case ECamImageCaptureSingle" ) ); + + // In secondary camera we can get snapshot as last event + // so we might still be in capturing state. + if( ECamCapturing == iInfo.iOperation ) + { + PRINT( _L( "Camera <> CCamAppController .. still in capturing phase, set to completing first.." ) ); + SetOperation( ECamCompleting ); + } + + // In case of secondary camera, image may be saved before Stop event is received. + // Notify capture complete event to the observers and other completion handling here. + if( saved && ECamCompleting == iInfo.iOperation ) + { + PRINT( _L( "Camera <> CCamAppController .. file saved, complete capture" ) ); + + // Operation mode is also set in HandleCaptureCompletion + HandleCaptureCompletion(); + NotifyControllerObservers( ECamEventCaptureComplete, aStatus ); + ReleaseArray(); + } + + break; + } + // ----------------------------------------------------- + case ECamImageCaptureTimeLapse: + { + PRINT( _L( "Camera <> CCamAppController .. case ECamImageCaptureTimeLapse" ) ); + if( saved ) + { + PRINT( _L( "Camera <> CCamAppController .. current file saved, complete this capture" ) ); + SetOperation( ECamNoOperation ); + ReleaseArray(); + } + + if ( iCompleteTimeLapsePending ) + { + CompleteTimeLapseOperation(); + } + else + { + // If the camera orientation changed during capture, set the new orientation in the engine + // ready for the next timelapse capture + if ( iConfigManager && iConfigManager->IsOrientationSensorSupported() + && iOrientationChangeOccured ) + { + iOrientationChangeOccured = EFalse; + TRAP_IGNORE( SetImageOrientationL() ); + } + } + break; + } + // ----------------------------------------------------- + default: + break; + // ----------------------------------------------------- + } + PRINT( _L( "Camera <= CCamAppController::HandleImageStopEventL" ) ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::IdleTimeoutL +// --------------------------------------------------------------------------- +// +TInt CCamAppController::IdleTimeoutL( TAny* aPtr ) + { + return static_cast( aPtr )->DoIdleTimeoutL(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::DoIdleTimeoutL +// --------------------------------------------------------------------------- +// +TInt CCamAppController::DoIdleTimeoutL() + { + // if a video recording has been paused for 60 seconds without key presses + if ( ECamPaused == CurrentVideoOperation() ) + { + NotifyControllerObservers( ECamEventVideoPauseTimeout, KErrNone ); + } + + // notify switch to standby mode and stop timer + else if( ECamStandby != iInfo.iOperation && ECamTriActive == iCameraController->ViewfinderState()) + { + SetOperation( ECamStandby ); + } + else + { + // For Lint + } + + iIdleTimer->Cancel(); + +// Use backlight timer also with bitmap vf + if( iBacklightTimer ) + { + if( ECamTriActive == iCameraController->ViewfinderState() ) + { + User::ResetInactivityTime(); + } + iBacklightTimer->Cancel(); + } + + return EFalse; + } + +// --------------------------------------------------------------------------- +// CCamAppController::StartIdleTimer +// --------------------------------------------------------------------------- +// +void CCamAppController::StartIdleTimer() + { + PRINT( _L( "Camera => CCamAppController::StartIdleTimer" ) ); + // if in standby mode notify of switch back to pre-capture + if ( ECamStandby == iInfo.iOperation ) + { + PRINT( _L( "Camera <> CCamAppController::StartIdleTimer ECamStandby" ) ); + SetOperation( ECamNoOperation ); + } + // if recording is in progress don't go to standby + else if ( ECamCapturing == CurrentVideoOperation() ) + { + PRINT( _L( "Camera <> CCamAppController::StartIdleTimer no restart" ) ); + // don't restart if recording operation in progress + return; + } + // if recording is paused, use the idle timer to stop recording after 60 secs + else + { + PRINT( _L( "Camera <> CCamAppController::StartIdleTimer else part" ) ); + // empty else statement to remove LINT error + } + + // restart timer + iIdleTimer->Cancel(); + + // don't restart if capturing burst, setting time lapse or in a pretend exit state + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( !SequenceCaptureInProgress() && appUi && !appUi->IsInPretendExit() + && !appUi->TimeLapseSliderShown()) + { + // restart timer + PRINT( _L( "Camera <> CCamAppController::StartIdleTimer starting timer" ) ); + iIdleTimer->StartTimer(); + } + + if ( iDeepSleepTimer ) + { + if ( iDeepSleepTimer->IsActive() ) + { + PRINT( _L( "Camera <> CCamAppController::StartIdleTimer - restart deep sleep timer" ) ); + DeepSleepTimerCancel(); + DeepSleepTimerStart(); + } + else if ( iDeepSleepTimerExpired ) + { + iDeepSleepTimerExpired = EFalse; // clear flag + TVwsViewId activeView; + CCamAppUi* appUi = + static_cast( CEikonEnv::Static()->AppUi() ); + (void) appUi->GetActiveViewId( activeView ); // ignore error + + if ( !IsViewFinding() && !InVideocallOrRinging() && + activeView.iViewUid.iUid != ECamViewIdVideoPostCapture && + activeView.iViewUid.iUid != ECamViewIdStillPostCapture && + activeView.iViewUid.iUid != ECamViewIdBurstThumbnail ) + { + PRINT( _L( "Camera <> CCamAppController::StartIdleTimer - Deep sleep timer expired. Restart VF" ) ); + TCamCameraMode mode = CurrentMode() == ECamControllerVideo? + ECamControllerVideo : ECamControllerImage; + EnterViewfinderMode( mode ); + DeepSleepTimerStart(); + } + } + } + + PRINT( _L( "Camera <= CCamAppController::StartIdleTimer" ) ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::StopIdleTimer +// --------------------------------------------------------------------------- +// +void CCamAppController::StopIdleTimer() + { + PRINT( _L( "Camera => CCamAppController::StopIdleTimer" ) ); + if( iIdleTimer ) + { + iIdleTimer->Cancel(); + } + PRINT( _L( "Camera <= CCamAppController::StopIdleTimer" ) ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::TimeLapseTimeoutL +// --------------------------------------------------------------------------- +// +TInt CCamAppController::TimeLapseTimeoutL( TAny* aPtr ) + { + return static_cast( aPtr )->DoTimeLapseTimeoutL(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::DoTimeLapseTimeoutL +// --------------------------------------------------------------------------- +// +TInt CCamAppController::DoTimeLapseTimeoutL() + { + PRINT( _L("Camera => CCamAppController::DoTimeLapseTimeoutL" )) + // Work out how much time is left before the next capture + TTime now; + now.HomeTime(); + TTimeIntervalMicroSeconds elapsedTime = now.MicroSecondsFrom( iTimeLapseStartTime ); + TInt64 remainingTime = iTimeLapseInterval.Int64() - elapsedTime.Int64(); + // update the remaining time countdown + NotifyControllerObservers( ECamEventCounterUpdated ); + + //if the total timelapse period has now completed + if ( remainingTime <= 0 ) + { + // Workaround for DoTimeLapseTimeoutL firing while in inappropriate state + // cause capture to be delayed by 1 sec + if( ECamNoOperation != iInfo.iOperation ) + { + PRINT( _L("Camera <> CCamAppController::DoTimeLapseTimeoutL workaround" )) + //remainingTime = TInt64( KSecondInMicSec ); + iTimeLapseTimer->StartTimer(); + } + else + { + TInt remainingCount = ImagesRemaining( static_cast( IntegerSettingValue( ECamSettingItemPhotoMediaStorage ) ), ETrue ); + if ( remainingCount > 0 ) + { + PRINT( _L("Camera => CCamAppController::DoTimeLapseTimeoutL about to do next capture" )) + // About to do the next capture so decrement the view's usage count on the array + ReleaseArray(); + if ( iConfigManager && iConfigManager->IsAutoFocusSupported() ) + { + if( !CurrentSceneHasForcedFocus() ) + { + if( !IsViewFinding() ) + { + StartViewFinder(); + } + StartAutoFocus(); + iCaptureRequested = ETrue; //Has to be set before focused/not focused event. + } + else + { + PRINT( _L("Camera <> CCamAppController::DoTimeLapseTimeoutL capture with forcedfocus scene" )) + Capture(); + } + } + else + { + Capture(); + } + RestartTimeLapseTimerL(); + } + else + { + PRINT( _L("Camera => CCamAppController::DoTimeLapseTimeoutL capture is complete" )) + CompleteTimeLapseOperation(); + } + } + return EFalse; + } + // Otherwise restart the timer for the next period + else + { + if ( remainingTime < TInt64( KSecondInMicSec ) ) + { + PRINT( _L("Camera => CCamAppController::DoTimeLapseTimeoutL shortening timer" )) + iTimeLapseTimer->SetTimeout( (TInt)remainingTime ); + } + else if( ( remainingTime < TInt64( 5 *KSecondInMicSec )) && !iCameraWoken ) + { + iCameraWoken = ETrue; + if( !IsViewFinding() ) + { + StartViewFinder(); + } + User::ResetInactivityTime(); + } + + PRINT( _L("Camera => CCamAppController::DoTimeLapseTimeoutL restarting timer" )) + iTimeLapseTimer->StartTimer(); + } + return EFalse; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SupportedFlashModes +// Return flash modes supported engine +// --------------------------------------------------------------------------- +// +TUint32 CCamAppController::SupportedFlashModes() + { + if( iCameraController ) + return iCameraController->CameraInfo().iFlashModesSupported; + else + return 0; + //iSupportedFlashModes; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SupportedWBModes +// Return white balance modes supported engine +// --------------------------------------------------------------------------- +// +TUint32 CCamAppController::SupportedWBModes() + { + if( iCameraController ) + return iCameraController->CameraInfo().iWhiteBalanceModesSupported; + else + return 0; + //iSupportedWBModes; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SupportedEVModes +// Return EV modes supported engine +// --------------------------------------------------------------------------- +// +TUint32 CCamAppController::SupportedEVModes() + { + if( iCameraController ) + return iCameraController->CameraInfo().iExposureModesSupported; + else + return 0; + //iSupportedEVModes; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CaptureState +// --------------------------------------------------------------------------- +// +TInt CCamAppController::CaptureState() + { + if( iCameraController ) + { + return iCameraController->ControllerInfo().iCaptureState; + } + else + { + return KErrNotFound; + } + } + + + +// ----------------------------------------------------------------------------- +// CCamAppController::FlashStatus() +// Returns pointer to FlashStatus object +// ----------------------------------------------------------------------------- +// +CCamFlashStatus* +CCamAppController::FlashStatus() const + { + return iFlashStatus; + } + + +// ----------------------------------------------------------------------------- +// CCamAppController::FlashRequired() +// +// ----------------------------------------------------------------------------- +// +TBool +CCamAppController::FlashRequired() const + { + if( ECamSceneSports == IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) ) + { + // Flash is not required in sport scene, even if the flash mode + // is forced or redeye. + return EFalse; + } + + // Make decision based on current flash mode + TInt flashMode = IntegerSettingValue( ECamSettingItemDynamicPhotoFlash ); + switch( flashMode ) + { + case ECamFlashOff: + { + return EFalse; + } + case ECamFlashAntiRedEye: // Flowthrough + case ECamFlashForced: + { + return ETrue; + } + default: + { + // Just return true in the default case. + // Automatic mode will decide if flash is used or not. + return ETrue; + } + } + } + +// ----------------------------------------------------------------------------- +// CCamAppController::CheckFlash() +// +// ----------------------------------------------------------------------------- +// +TBool +CCamAppController::CheckFlash() const + { + PRINT ( _L("Camera => CCamAppController::CheckFlash") ); + PRINT1( _L("Camera <> CCamAppController: flash required :%d "), FlashRequired() ); + PRINT1( _L("Camera <> CCamAppController: FlashStatus: flash ready :%d "), iFlashStatus->FlashReady() ); + PRINT1( _L("Camera <> CCamAppController: CameraCtrl: flash status :[%s]"), + KCamCameraReadyStateNames[iCameraController->FlashState()] ); + + TBool ok( !FlashRequired() || iFlashStatus->FlashReady() ); + + PRINT1( _L("Camera <= CCamAppController::CheckFlash, return:%d"), ok ); +#ifdef __WINSCW__ + return ETrue; +#else + return ok; +#endif + } + + +// ----------------------------------------------------------------------------- +// CCamAppController::SaveFlashMode() +// +// ----------------------------------------------------------------------------- +// +void CCamAppController::SaveFlashMode() + { + iFlashModeSaved = ETrue; + iSavedFlashMode = static_cast( IntegerSettingValue( ECamSettingItemDynamicPhotoFlash ) ); + iSavedFlashScene = static_cast( IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) ); + } + +// ----------------------------------------------------------------------------- +// CCamAppController::RestoreFlashMode +// +// ----------------------------------------------------------------------------- +// +void CCamAppController::RestoreFlashMode() + { + if( iFlashModeSaved ) + { + if( iSavedFlashScene == IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) ) + { + // Set saved flash mode + TRAP_IGNORE( SetIntegerSettingValueL( ECamSettingItemDynamicPhotoFlash, iSavedFlashMode ) ); + } + else + { + // Set default flash mode for this scene + // SetDynamicSettingToDefault( ECamSettingItemDynamicPhotoFlash ); + TInt scene = IntegerSettingValue( ECamSettingItemDynamicPhotoScene ); + TInt sceneFlashMode = iSettingsModel->SceneSettingValue( scene, ECamSettingItemSceneFlashMode ); + TRAP_IGNORE( SetIntegerSettingValueL( ECamSettingItemDynamicPhotoFlash, sceneFlashMode ) ); + + } + } + iFlashModeSaved = EFalse; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::ForceUsePhoneMemoryL +// --------------------------------------------------------------------------- +// +void CCamAppController::ForceUsePhoneMemoryL( TBool aEnable ) + { + PRINT( _L("Camera => CCamAppController::ForceUsePhoneMemoryL") ); + + if( aEnable ) + { + iForceUseOfPhoneMemory = ETrue; + if( ExistMassStorage() ) + { + // with multiple drives, the mass memory is the default + PRINT( _L("Camera <> Force ECamMediaStorageMassStorage") ); + iForcedStorageLocation = ECamMediaStorageMassStorage; + SetPathnamesToNewStorageL( ECamMediaStorageMassStorage ); + } + else + { + PRINT( _L("Camera <> Force ECamMediaStoragePhone") ); + iForcedStorageLocation = ECamMediaStoragePhone; + SetPathnamesToNewStorageL( ECamMediaStoragePhone ); + } + } + // Revert back to memory card, if aEnable is EFalse + else + { + iForceUseOfPhoneMemory = EFalse; + iForcedStorageLocation = ECamMediaStorageNone; + SetPathnamesToNewStorageL( iPreferredStorageLocation ); + } + + NotifyControllerObservers( ECamEventSaveLocationChanged ); + PRINT( _L("Camera <= CCamAppController::ForceUsePhoneMemoryL") ); + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::IsPhoneMemoryForced +// Check whether the use of phone memory is forced, because of unavailibility +// or problems encountered in using MMC. +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsPhoneMemoryForced() + { + return iForceUseOfPhoneMemory; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CheckMemoryToUseL +// Set the appropriate memory to use. Use Phone memory if MMC not available. +// --------------------------------------------------------------------------- +// +TBool CCamAppController::CheckMemoryToUseL() + { + TInt key = ( ECamControllerImage == CurrentMode() ) + ? ECamSettingItemPhotoMediaStorage + : ECamSettingItemVideoMediaStorage; + + TCamMediaStorage storageLocation = static_cast ( IntegerSettingValueUnfiltered(key) ); + TBool mmcAvailable = IsMemoryAvailable ( ECamMediaStorageCard ); + + PRINT1( _L("Camera :: CCamAppController::CheckMemoryToUse preferred storage:%d"), + storageLocation ); + + // If MMC is preferred storage location but is not available + if ( storageLocation == ECamMediaStorageCard && !mmcAvailable ) + { + PRINT( _L("Camera :: CCamAppController::CheckMemoryToUse - use phone memory / mass storage") ) + ForceUsePhoneMemoryL( ETrue ); + return ETrue; + } + // Preferred location is MMC and its available now -> stop forcing phone memory + else if( storageLocation == ECamMediaStorageCard && mmcAvailable && + iForceUseOfPhoneMemory ) + { + PRINT( _L("Camera :: CCamAppController::CheckMemoryToUse - use MMC") ) + ForceUsePhoneMemoryL( EFalse ); + return ETrue; + } + if ( storageLocation == ECamMediaStorageMassStorage && !ExistMassStorage() ) + { + PRINT( _L("Camera :: CCamAppController::CheckMemoryToUse - no mass storage, use phone memory") ) + ForceUsePhoneMemoryL( ETrue ); + return ETrue; + } + // Mass storage is available now -> stop forcing phone memory + else if( storageLocation == ECamMediaStorageMassStorage && ExistMassStorage() && iForceUseOfPhoneMemory ) + { + PRINT( _L("Camera :: CCamAppController::CheckMemoryToUse - use mass memory") ) + ForceUsePhoneMemoryL( EFalse ); + return ETrue; + } + else + { + SetPathnamesToNewStorageL( storageLocation ); + } + + return EFalse; + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::CompleteBurstOperation +// Complete the burst operation +// --------------------------------------------------------------------------- +// +void CCamAppController::CompleteBurstOperation() + { + PRINT( _L( "Camera => CCamAppController::CompleteBurstOperation" ) ); + iSequenceCaptureInProgress = EFalse; + iNoBurstCancel=EFalse; + + if( ECamImageCaptureBurst == iInfo.iImageMode ) + { + PRINT1( _L("Camera <> CCamAppController::CompleteBurstOperation array count:%d"), BurstCaptureArray()->Count() ); + // Create thumbnails + if( iConfigManager && iConfigManager->IsThumbnailManagerAPISupported() ) + { + TRAP_IGNORE( iImageSaveActive->CreateThumbnailsL( *BurstCaptureArray() ) ); + } + + // Re-enable screen saver + EnableScreenSaver( ETrue ); + if( iBacklightTimer ) + { + iBacklightTimer->Cancel(); + } + SetOperation( ECamNoOperation ); + + NotifyControllerObservers( ECamEventCaptureComplete, KErrNone ); + HandleCaptureCompletion(); + } + PRINT( _L( "Camera <= CCamAppController::CompleteBurstOperation" ) ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::CompleteTimeLapseOperation +// Complete the time lapse operation +// --------------------------------------------------------------------------- +// +void CCamAppController::CompleteTimeLapseOperation() + { + PRINT( _L( "Camera => CCamAppController::CompleteTimeLapseOperation" ) ); + + iSequenceCaptureInProgress = EFalse; + + if ( iTimeLapseTimer ) + { + iTimeLapseTimer->Cancel(); + delete iTimeLapseTimer; + iTimeLapseTimer = NULL; + } + + if( ECamImageCaptureTimeLapse == iInfo.iImageMode ) + { + // Re-enable screen saver + EnableScreenSaver( ETrue ); + iCompleteTimeLapsePending = EFalse; + +// SetImageMode( ECamImageCaptureNone ); + SetOperation( ECamNoOperation ); + + NotifyControllerObservers( ECamEventCaptureComplete, KErrNone ); + HandleCaptureCompletion(); + iTimeLapseStartTime = TInt64( 0 ); + } + + PRINT( _L( "Camera <= CCamAppController::CompleteTimeLapseOperation" ) ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::EngineProcessingCapture +// Return whether or not the engine is carrying out a capture operation +// --------------------------------------------------------------------------- +// +TBool +CCamAppController::EngineProcessingCapture() const + { + TBool engineIsProcessing = EFalse; + + if ( ECamCapturing == iInfo.iOperation + || ECamPausing == iInfo.iOperation + || ECamPaused == iInfo.iOperation + || ECamResuming == iInfo.iOperation + || ECamCompleting == iInfo.iOperation + ) + { + engineIsProcessing = ETrue; + } + + return engineIsProcessing; + } + +// --------------------------------------------------------------------------- +// CCamAppController::HandleIncomingCall +// Stop video recording (or burst capture in early stages) +// --------------------------------------------------------------------------- +// +void CCamAppController::HandleIncomingCall() + { + PRINT2( _L("Camera => CCamAppController::HandleIncomingCallL .. mode[%s] operation[%s]"), + KCamModeNames[iInfo.iMode], + KCamCaptureOperationNames[iInfo.iOperation] + ); + + if( ECamControllerVideo == iInfo.iMode ) + { + // if video is recording or paused + if ( !iSaving + && ( ECamCapturing == iInfo.iOperation + || ECamPaused == iInfo.iOperation ) ) + { + StopVideoRecording(); + } + } + else if( ECamControllerImage == iInfo.iMode ) + { + iCaptureRequested = EFalse; + switch( iInfo.iImageMode ) + { + // if a timelapse operation is in progress + case ECamImageCaptureTimeLapse: + { + TRAP_IGNORE( StopSequenceCaptureL() ); + break; + } + case ECamImageCaptureBurst: + { + TRAP_IGNORE( SoftStopBurstL( ETrue ) ); + /* + if ( ECamCompleting == iInfo.iOperation ) + { + // if some of the image captures failed + // release the reserved filenames and tidy the array + TInt captured( iCameraController->ControllerInfo().iCaptureCount ); + if ( BurstCaptureArray()->NextFileIndex() < captured ) + { + TInt index; + TInt stopAt = Min( captured, BurstCaptureArray()->Count() ); + for ( index = BurstCaptureArray()->NextFileIndex(); index < stopAt; index++ ) + { + SetAsCurrentImage( index ); + DeleteCurrentFile(); + } + SetAsCurrentImage( 0 ); + + BurstCaptureArray()->Reset( BurstCaptureArray()->NextFileIndex() ); + // Finished with this now + } +// SetImageMode( ECamImageCaptureNone ); + if( iImageSaveActive ) + iImageSaveActive->DismissProgressNote(); + StartIdleTimer(); + } + */ + break; + } + default: + break; + } + } + else + { + // no action needed + } + PRINT( _L( "Camera <= CCamAppController::HandleIncomingCallL" ) ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::FileSize +// Returns the file size of the specified captured item, or KErrNotFound if doesn't exist +// --------------------------------------------------------------------------- +// +TInt CCamAppController::FileSize( TDesC& aFilename ) const + { + return iImageSaveActive->FileSize( aFilename ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::CancelStillCaptureNow +// Immediately cancels an ongoing still capture +// --------------------------------------------------------------------------- +// +void CCamAppController::CancelStillCaptureNow() + { + PRINT( _L( "Camera => CCamAppController::CancelStillCaptureNow" ) ) + // Re-enable screen saver + EnableScreenSaver( ETrue ); +// iEngine->CancelCaptureStill(); + TRAP_IGNORE( iCameraController->DirectRequestL( ECamRequestImageCancel ) ); + + // ensure that any outstanding images are discarded + SetOperation( ECamCompleting ); + SetOperation( ECamNoOperation ); + + // If sequence mode, remove items from the array + // this prevents the post capture view from showing + if ( ECamImageCaptureBurst == iInfo.iImageMode ) + { + BurstCaptureArray()->Reset( 0 ); + } + else // single capture, the array is no longer needed + { + PRINT( _L( "Camera <> single capture so releasing array and starting vf" ) ) + ReleaseArray(); + FreezeViewFinder( EFalse ); + } + // Cancel any pending saves, this will call CompleteBurstOperation for sequence + PRINT( _L( "Camera <> calling iImageSaveArray->Cancel" ) ) + iImageSaveActive->Cancel(); + PRINT( _L( "Camera <= CCamAppController::CancelStillCaptureNow" ) ) + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::TidyCaptureArray +// Tidy up capture array in event of burst capture failure +// --------------------------------------------------------------------------- +// +void +CCamAppController::TidyCaptureArray( TInt aImageCountDelivered, + TInt /*aError*/ ) + { + PRINT1( _L("Camera => CCamAppController::TidyCaptureArray img count %d"), aImageCountDelivered ) + iSoundPlayer->EnableAllKeySounds(); + + // if some of the image captures failed + // release the reserved filenames and tidy the array + + TInt captured( iCameraController->ControllerInfo().iSnapshotCount ); + if ( aImageCountDelivered < captured ) + { + TInt index; + TInt stopAt = Min( captured, BurstCaptureArray()->Count() ); + for ( index = aImageCountDelivered; index < stopAt; index++ ) + { + PRINT1( _L("Camera <> TidyCaptureArray delete current %d"),index ) + SetAsCurrentImage( index ); + DeleteCurrentFile(); + } + SetAsCurrentImage( 0 ); + iCaptureArray->Reset( aImageCountDelivered ); + // Finished with this now + } + + SetImageMode( ECamImageCaptureNone ); + StartIdleTimer(); + + // Need to release the array + ReleaseArray(); + + + // Unfreeze the viewfinder + FreezeViewFinder( EFalse ); + + // Change op state to none + SetOperation( ECamNoOperation ); + + PRINT( _L("Camera <= CCamAppController::TidyCaptureArray") ) + } + + +// --------------------------------------------------------------------------- +// CCamAppController::CaptureToneId +// Returns the current capture tone +// +// --------------------------------------------------------------------------- +// +TCamSoundId CCamAppController::CaptureToneId( ) + { + TCamSoundId toneId = ECamStillCaptureSoundId1; + + switch(iSettingsModel->IntegerSettingValue( ECamSettingItemPhotoCaptureTone ) ) + { + case ECamSettTone1: + if ( ECamImageCaptureBurst == iInfo.iImageMode ) + { + toneId = ECamBurstCaptureSoundId1; + } + else + { + toneId = ECamStillCaptureSoundId1; + } + break; + case ECamSettTone2: + if ( ECamImageCaptureBurst == iInfo.iImageMode ) + { + toneId = ECamBurstCaptureSoundId2; + } + else + { + toneId = ECamStillCaptureSoundId2; + } + break; + case ECamSettTone3: + if ( ECamImageCaptureBurst == iInfo.iImageMode ) + { + toneId = ECamBurstCaptureSoundId3; + } + else + { + toneId = ECamStillCaptureSoundId3; + } + break; + case ECamSettTone4: + if ( ECamImageCaptureBurst == iInfo.iImageMode ) + { + toneId = ECamBurstCaptureSoundId4; + } + else + { + toneId = ECamStillCaptureSoundId4; + } + break; + default: + break; + } + + return toneId; + } + +// --------------------------------------------------------------------------- +// CCamAppController::LoadSecondaryCameraSettingsL() +// Update settings for secondary camera +// --------------------------------------------------------------------------- +// +void CCamAppController::LoadSecondaryCameraSettingsL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPCONTROLLER_LOADSECONDARYCAMERASETTINGSL, "e_CCamAppController_LoadSecondaryCameraSettingsL 1" ); + PRINT( _L("Camera => CCamAppController::LoadSecondaryCameraSettingsL" )) + iSettingsModel->StorePrimaryCameraSettingsL(); + + PRINT( _L("Camera <> CCamAppController::LoadSecondaryCameraSettingsL B" )) + + SetIntegerSettingValueL( ECamSettingItemPhotoQuality, + iConfiguration->SecondaryCameraImageQuality() ); + PRINT( _L("Camera <> CCamAppController::LoadSecondaryCameraSettingsL C" )) + SetIntegerSettingValueL( ECamSettingItemVideoQuality, + iConfiguration->SecondaryCameraVideoQuality() ); + + + + PRINT( _L("Camera <> CCamAppController::LoadSecondaryCameraSettingsL E" )) + SetIntegerSettingValueL( ECamSettingItemDynamicPhotoScene, ECamSceneAuto ); + SetIntegerSettingValueL( ECamSettingItemDynamicVideoScene, ECamSceneNormal ); + PRINT( _L("Camera <> CCamAppController::LoadSecondaryCameraSettingsL F" )) + + PRINT( _L("Camera <= CCamAppController::LoadSecondaryCameraSettingsL" )) + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPCONTROLLER_LOADSECONDARYCAMERASETTINGSL, "e_CCamAppController_LoadSecondaryCameraSettingsL 0" ); + } + +// --------------------------------------------------------------------------- +// ImageOrientation <> +// +// Return the current image orientation based on data from orientation sensor. +// If "image rotation" setting is OFF, the value has been overriden with +// "no rotation" value (ECamOrientation0). +// +// Provided (primarily) for Camera Controller even if orientation +// sensor is not supported. In that case the returned +// value is always ECamOrientation0. +// --------------------------------------------------------------------------- +// +TCamImageOrientation +CCamAppController::ImageOrientation() const + { + return iImageOrientation; + } + + +// --------------------------------------------------------------------------- +// Indicates data is available in the receiving buffer. A client can read +// the data through GetData()-function in the related channel object. Data +// is valid until the data received notification occurs again. +// +// @param[in] aChannel Reference to the related channel object +// @param[in] aCount Data object count in receiving buffer. Not used in this implementation. +// @param[in] aDataLost Number of lost data items. Not used in this implementation. It does not +// matter if some data event is lost. +// --------------------------------------------------------------------------- +// +void CCamAppController::DataReceived( CSensrvChannel& aChannel, + TInt aCount, + TInt aDataLost ) + { + PRINT3( _L("Camera => CCamAppController::DataReceived aChannel %d aCount %d aDataLost %d"), + aChannel.GetChannelInfo().iChannelType, aCount, aDataLost ); + + if ( KSensrvChannelTypeIdOrientationData == aChannel.GetChannelInfo().iChannelType ) + { + TBool rotate( ECamSettOn == iSettingsModel->IntegerSettingValue( ECamSettingItemImageRotation ) ); + + if( rotate ) + { + TSensrvOrientationData orientationData; + TPckg orientationPackage( orientationData ); + aChannel.GetData( orientationPackage ); + + iImageOrientation = + MapSensorOrientatio2CamOrientation( orientationData.iDeviceOrientation, iLastImageOrientation ); + } + else + { + // If "rotate images" setting is OFF, set "no rotation" value + iImageOrientation = ECamOrientation0; + } + + // rotate image if we are in still capture mode but not currently + // capturing image, no rotation in burst mode or if orientation has stayed the same + if( IsFlagOn( CameraControllerState(), ECamImageOn ) && + rotate && + iLastImageOrientation != iImageOrientation && + iImageOrientation != ECamOrientationIgnore) + { + if( ECamCapturing != CurrentOperation() && + ECamFocusing != CurrentOperation() && + ECamFocused != CurrentOperation() && + ECamFocusFailed != CurrentOperation() && + ECamCompleting != CurrentOperation() && + ECamImageCaptureBurst != iInfo.iImageMode && + ECamImageCaptureBurst != iInfo.iTargetImageMode ) + { + PRINT( _L("Camera <> CCamAppController:DataReceived calling SetImageOrientationL()") ); + TRAP_IGNORE( SetImageOrientationL() ); + } + else + { + // queue a request to re-prepare still capture + PRINT( _L("Camera <> CCamAppController: Queueing an orientation change event") ); + iOrientationChangeOccured = ETrue; + } + } + else + { + iOrientationChangeOccured = EFalse; + } + + if( iImageOrientation != ECamOrientationIgnore ) + { + iLastImageOrientation = iImageOrientation; + } + } + + PRINT ( _L("Camera <= CCamAppController::DataReceived") ); + } + +// --------------------------------------------------------------------------- +// Data listening failed. +// If error was fatal, channel has also been closed and sensor server session +// terminated. If error was minor, some data has potentially been lost. +// iAccSensorChannel needs to be closed in fatal error case. A new channel will +// be created the next time we call UpdateSensorApiL(). +// +// @param[in] aChannel Reference to the related channel object +// @param[in] aError Error code. +// --------------------------------------------------------------------------- +// +void CCamAppController::DataError( CSensrvChannel& aChannel, + TSensrvErrorSeverity aError ) + { + PRINT2( _L("Camera => CCamAppController::DataError aChannel %d aError %d"), aChannel.GetChannelInfo().iChannelType, aError ); + if ( ESensrvErrorSeverityFatal == aError ) + { + // Delete sensor api object + delete iAccSensorChannel; + iAccSensorChannel = NULL; + iAccSensorListening = EFalse; + + // Set orientation back to default if not already there. + iImageOrientation = ECamOrientation0; + } + } + +// --------------------------------------------------------------------------- +// Returns a pointer to a specified interface +// +// @since S60 5.0 +// @param aInterfaceUid Identifier of the interface to be retrieved +// @param aInterface A reference to a pointer that retrieves the specified interface. +// --------------------------------------------------------------------------- +// +void CCamAppController::GetDataListenerInterfaceL( TUid aInterfaceUid, + TAny*& aInterface ) + { + aInterface = NULL; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetImageOrientationL() +// Setup image rotation parameters +// +// --------------------------------------------------------------------------- +// +void CCamAppController::SetImageOrientationL() + { + PRINT( _L("Camera => CCamAppController::SetImageOrientationL") ); + if( iConfigManager && iConfigManager->IsOrientationSensorSupported() + && iCameraController ) + { + if ( ECamActiveCameraPrimary == iInfo.iActiveCamera ) + { + // Camera controller asks for the current orientation through + // our ImageOrientation(). Value for that was updated in + // DataReceived() callback. + iCameraController->DirectSettingsChangeL( ECameraSettingOrientation ); + } + else + { + // No action in secondary camera. + } + } + PRINT( _L("Camera <= CCamAppController::SetImageOrientationL")) + } + + +// --------------------------------------------------------------------------- +// MapSensorOrientatio2CamOrientation +// --------------------------------------------------------------------------- +// +TCamImageOrientation +CCamAppController::MapSensorOrientatio2CamOrientation( + const TSensrvOrientationData::TSensrvDeviceOrientation& aSensorOrientation, TCamImageOrientation aLastImageOrientation ) + { + PRINT1 ( _L("Camera => CCamAppController::MapSensorOrientatio2CamOrientation aSensorOrientation: %d"), aSensorOrientation ); + + TCamImageOrientation cameraOrientation( ECamOrientation0 ); + + switch( aSensorOrientation ) + { + case TSensrvOrientationData::EOrientationDisplayUpwards: + // If coming from upside down portrait... + if ( ECamOrientation270 == aLastImageOrientation ) + { + // Switch from upside down portrait to normal portrait.") ) + cameraOrientation = ECamOrientation90; // Set normal portrait + } + // If coming from upside down landscape... + else if ( ECamOrientation180 == aLastImageOrientation ) + { + // Switch from upside down landscape to normal landscape...") ) + cameraOrientation = ECamOrientation0; // Set normal lanscape + } + // If neither one, keep the current image orientation. + else + { + cameraOrientation = ECamOrientationIgnore; + } + break; + + case TSensrvOrientationData::EOrientationDisplayDownwards: + // Camera is pointing up now. Check if it was upside down previously. + // If coming from upside down portrait... + if ( ECamOrientation270 == aLastImageOrientation ) + { + // Switch from upside down portrait to normal portrait...") ) + cameraOrientation = ECamOrientation90; // Set normal portrait + } + // If coming from upside down landscape... + else if ( ECamOrientation180 == aLastImageOrientation ) + { + // Switch from upside down landscape to normal landscape...") ) + cameraOrientation = ECamOrientation0; // Set normal lanscape + } + // If neither one, keep the current image orientation. + else + { + cameraOrientation = ECamOrientationIgnore; + } + break; + case TSensrvOrientationData::EOrientationDisplayRightUp: + case TSensrvOrientationData::EOrientationUndefined: + cameraOrientation = ECamOrientation0; + break; + case TSensrvOrientationData::EOrientationDisplayUp: + cameraOrientation = ECamOrientation90; + break; + case TSensrvOrientationData::EOrientationDisplayLeftUp: + cameraOrientation = ECamOrientation180; + break; + case TSensrvOrientationData::EOrientationDisplayDown: + cameraOrientation = ECamOrientation270; + break; + default: + PRINT( _L("Camera <> Unexpected orientation value") ); + break; + } + PRINT1( _L("Camera <= CCamAppController::MapSensorOrientatio2CamOrientation, return [%s]"), + KCamOrientationNames[cameraOrientation] ); + + return cameraOrientation; + } + +// --------------------------------------------------------------------------- +// MapSensorOrientatio2CamOrientation +// --------------------------------------------------------------------------- +// +CBitmapRotator::TRotationAngle +CCamAppController::MapCamOrientation2RotationAngle( + const TCamImageOrientation aOrientation ) + { + PRINT1 ( _L("Camera => CCamAppController::MapCamOrientation2RotationAngle aOrientation: %d"), aOrientation ); + + CBitmapRotator::TRotationAngle angle; + + switch( aOrientation ) + { + case ECamOrientation90: + angle = CBitmapRotator::ERotation90DegreesClockwise; + break; + case ECamOrientation180: + angle = CBitmapRotator::ERotation180DegreesClockwise; + break; + case ECamOrientation270: + angle = CBitmapRotator::ERotation270DegreesClockwise; + break; + default: + PRINT( _L("Camera <> Unexpected orientation value") ); + // using a value to avoid compiler warning + angle = CBitmapRotator::ERotation90DegreesClockwise; + break; + } + PRINT1( _L("Camera <= CCamAppController::MapCamOrientation2RotationAngle, return %d"), angle ); + return angle; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::UpdateSensorApiL() <> +// Updates the sensorApi object when the app focus changes +// +// --------------------------------------------------------------------------- +// + +void CCamAppController::UpdateSensorApiL(TBool aStartupApi) + { + PRINT(_L("Camera => CCamAppController::UpdateSensorApiL")); + if( iConfigManager && iConfigManager->IsOrientationSensorSupported() ) + { + if(aStartupApi) + { + // only activate the orientation channel for image mode + if( ECamControllerImage == CurrentMode() ) + { + // This if-statement intentionally not a condition of the first if. + // If the iAccSensorChannel is already active, we don't want to recreate it + // and leak memory, but at the same time, we don't want to destroy it either. + + if( !iAccSensorChannel ) + { + PRINT(_L("Camera <=> CCamAppController::UpdateSensorApiL - Starting new sensor channel api - info not yet initialized")); + //Construct a channel finder. + CSensrvChannelFinder* channelFinder; + PRINT(_L("Camera <=> CCamAppController::UpdateSensorApiL - calling CSensrvChannelFinder::NewL()")); + //CSensorChannelFinder* channelFinder; + channelFinder = CSensrvChannelFinder::NewL(); + //channelFinder = CSensorChannelFinder::NewL(); + PRINT(_L("Camera <=> CCamAppController::UpdateSensorApiL - CSensrvChannelFinder::NewL() returned without a leave")); + CleanupStack::PushL( channelFinder ); + + //List of found channels. + RSensrvChannelInfoList channelInfoList; + CleanupClosePushL( channelInfoList ); + + //Create and fill channel search criteria. + TSensrvChannelInfo channelInfo; + channelInfo.iChannelType = KSensrvChannelTypeIdOrientationData; + + PRINT(_L("Camera <=> CCamAppController::UpdateSensorApiL - calling channelFinder->FindChannelsL")); + //Find the orientation channel + channelFinder->FindChannelsL( channelInfoList, channelInfo ); + + if( channelInfoList.Count() != 1 ) + { + //The device doesn’t support orientation data channel or + //there are several orientation channels. + PRINT1(_L("Camera <=> CCamAppController::UpdateSensorApiL - The device doesn’t support orientation data channel or there are several orientation channels: %d channels found"),channelInfoList.Count()); + User::Leave( KErrNotSupported ); + } + else + { + //orientation channel found + PRINT(_L("Camera <=> CCamAppController::UpdateSensorApiL - orientation channel found")); + } + //Open the orientation channel. + //When the channel object is created the channel info object + //must be an object returned by CSensrvChannelFinder::FindChannelsL(). + PRINT(_L("Camera <=> CCamAppController::UpdateSensorApiL - calling CSensrvChannel::NewL")); + iAccSensorChannel = CSensrvChannel::NewL( channelInfoList[ 0 ] ); + //iAccSensorChannel = CSensorChannel::NewL( channelInfoList[ 0 ] ); + //CleanupStack::PushL( iAccSensorChannel ); + CleanupStack::PopAndDestroy( &channelInfoList ); //Close() is being called on "channelInfoList" + CleanupStack::PopAndDestroy( channelFinder ); + } + + if( !iAccSensorListening ) + { + PRINT(_L("Camera <=> CCamAppController::UpdateSensorApiL - calling iAccSensorChannel->OpenChannelL()")); + TRAPD(channelerror, iAccSensorChannel->OpenChannelL() ); + if (channelerror!=KErrNone) + { + PRINT1(_L("CCamAppController::UpdateSensorApiL - iAccSensorChannel->OpenChannelL() failed. Error code: %d"),channelerror); + User::Leave( channelerror ); + } + //iAccSensorChannel->OpenChannelL(); + //orientation channel is now open. + + // start listening + PRINT(_L("Camera <=> CCamAppController::UpdateSensorApiL - calling iAccSensorChannel->StartDataListeningL")); + iAccSensorChannel->StartDataListeningL( this, //this object is data listener for this channel + 1, //aDesiredCount is one, i.e. each orientation change is notified separately + 1, //aMaximumCount is one, i.e. object count in receiving data buffer is one + 0 );//buffering period is not used + iAccSensorListening = ETrue; + iLastImageOrientation = ECamOrientation0; + } + } + } + else // shut down the sensorApi object + { + PRINT(_L("Camera <=> UpdateSensorApiL shutting down iAccSensor")) + if(iAccSensorListening) + { + // Stop listening to the events + iAccSensorChannel->StopDataListening(); + iAccSensorListening = EFalse; + } + + // Delete sensor api object + delete iAccSensorChannel; + iAccSensorChannel = NULL; + } + } + PRINT(_L("Camera <= CCamAppController::UpdateSensorApiL")); + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::HandlePropertyChangedL() +// Handle changes in specified property +// +// --------------------------------------------------------------------------- +// +void CCamAppController::HandlePropertyChangedL( const TUid& aCategory, const TUint aKey ) + { + PRINT( _L("Camera => CCamAppController::HandlePropertyChangedL")) +#if !( defined(__WINS__) || defined(__WINSCW__) ) + + if ( iConfigManager && iConfigManager->IsLensCoverSupported() ) + { + // First if condition could be removed after PCFW has released + // creation for KLensCoverStatus key + if ( ( aCategory == NMusResourceApi::KCategoryUid && + aKey == NMusResourceApi::KCameraAvailability ) || + ( aCategory == CameraPlatPSKeys::KPSCameraPlatUid && + aKey == CameraPlatPSKeys::KLensCoverStatus ) ) + { + + TInt err = iSlideStateWatcher->Get( iNewSlideState ); + + PRINT2( _L( "Camera HandlePropertyChangedL getting slider state = %d, err = %d" ), iNewSlideState, err ) + + if ( iNewSlideState != iSlideState ) + { + delete iSliderCallBack; + iSliderCallBack = NULL; + iSliderCallBack = CPeriodic::NewL( CActive::EPriorityIdle ); + iSliderCallBack->Start( KLensCoverDelay, KLensCoverDelay, TCallBack( LensCoverUpdateL, this ) ); + } + } + else + { + (void)aCategory; + (void)aKey; + } + + } +#endif // !( defined(__WINS__) || defined(__WINSCW__ + + PRINT( _L("Camera <= CCamAppController::HandlePropertyChangedL")) + + } + +// --------------------------------------------------------------------------- +// CCamAppController::LensCoverUpdate() +// Callback function that is called when lens cover state changes. +// Used to implement delayed handling of lens cover events. +// --------------------------------------------------------------------------- +// +TInt CCamAppController::LensCoverUpdateL( TAny* aPtr ) + { + PRINT( _L( "Camera => CCamAppController::LensCoverUpdateL()" ) ) + CCamAppController* self = static_cast( aPtr ); + if ( self->iNewSlideState != self->iSlideState || + self->iNewSlideState == CameraPlatPSKeys::EClosed // always handle closing + ) + { + + self->iSlideState = self->iNewSlideState; + + if ( self->iSlideState == CameraPlatPSKeys::EClosed ) + { + PRINT( _L( "Camera => CCamAppController::LensCoverUpdateL() SLIDE CLOSED" ) ) + self->HandleSlideClosedL(); + } + else if ( self->iSlideState == CameraPlatPSKeys::EOpen ) + { + PRINT( _L( "Camera => CCamAppController::LensCoverUpdateL() SLIDE OPENED" ) ) + self->HandleSlideOpenedL(); + } + } + self->iSliderCallBack->Cancel(); + delete self->iSliderCallBack; + self->iSliderCallBack = 0; + + PRINT( _L( "Camera <= CCamAppController::LensCoverUpdateL()" ) ) + return KErrNone; + + } +// --------------------------------------------------------------------------- +// CCamAppController::RefreshSlideState +// Force a refresh of the slide status +// --------------------------------------------------------------------------- +// +void CCamAppController::RefreshSlideStatus() + { + PRINT( _L("Camera => CCamAppController::RefreshSlideStatus") ); + // read the slider status from P & S key + if ( iSlideStateWatcher->Get( iSlideState ) != KErrNone ) + { + iSlideState = KErrNone; + } + } + +// --------------------------------------------------------------------------- +// CCamAppController::HandleSlideClosedL +// Handle the slide closed event +// --------------------------------------------------------------------------- +// +void CCamAppController::HandleSlideClosedL() + { + PRINT( _L("Camera => CCamAppController::HandleSlideClosedL") ); + + NotifyControllerObservers( ECamEventSliderClosed ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + if ( appUi->IsInPretendExit() ) + { + PRINT( _L("Camera <= CCamAppController::HandleSlideClosedL already in pretend exit") ); + return; + } + SetCameraSwitchRequired( ESwitchDone ); + // shutdown the camera on slide closing if EDGE variant/standalone app + // don't close app if embedded or embedding + TInt camerasAvailable = CamerasAvailable(); + TVwsViewId activeView; + TInt viewErr = appUi->GetActiveViewId( activeView ); + + TBool embedded = appUi->IsEmbedded(); + TBool embedding = appUi->Embedding(); + if ( camerasAvailable == 1 ) // EDGE variant + { + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - camerasAvailable == 1") ); + // if embedding another app then don't exit just yet + if ( embedding ) + { + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - Embedding mode") ); + // remember that the slider has been closed + iSliderCloseEvent = ETrue; + } + // Embedded post capture view + else if ( embedded && viewErr == KErrNone && + ( activeView.iViewUid.iUid == ECamViewIdStillPostCapture || + activeView.iViewUid.iUid == ECamViewIdVideoPostCapture ) ) + { + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - Embedded post capture") ); + // remember that the slider has been closed + iSliderCloseEvent = ETrue; + } + // if standalone app performing a burst capture, + // don't exit till complete + else if ( ECamImageCaptureBurst == iInfo.iImageMode || + ECamImageCaptureTimeLapse == iInfo.iImageMode ) + { + // remember that the slider has been closed + iSliderCloseEvent = ETrue; + StopSequenceCaptureL(); + } + else // standalone or embedded pre capture view + { + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - emit ECamCmdSlideClosedExit") ); + appUi->HandleCommandL( ECamCmdSlideClosedExit ); + } + } + else // variants with > 1 camera + { + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - camerasAvailable > 1") ); + if ( !embedding && !embedded ) + { + // if standalone app performing a burst capture, + // don't exit till complete + if ( ECamImageCaptureBurst == iInfo.iImageMode || + ECamImageCaptureTimeLapse == iInfo.iImageMode ) + { + // remember that the slider has been closed + iSliderCloseEvent = ETrue; + StopSequenceCaptureL(); + } + else + { + PRINT( _L("Camera Normal mode-handle ECamCmdSlideClosedExit") ); + appUi->SetLensCoverExit( ETrue ); + if ( ECamViewIdVideoPreCapture == activeView.iViewUid.iUid ) + { + // stop recording and save the video + StopVideoRecording(); + } + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - emit ECamCmdSlideClosedExit") ); + appUi->HandleCommandL( ECamCmdSlideClosedExit ); + + // 2ndary camera, slider closed -> application to be closed, + // not in embedded mode + if ( iInfo.iActiveCamera == ECamActiveCameraSecondary ) + { + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - 2ndary camera slider closed, app closing...") ); + appUi->CloseAppL(); + } + } + } + else // we are embedded in an app or embedding another app + { + // remember that the slider has been closed + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - Embedded/Embedding mode") ); + + if ( viewErr == KErrNone ) + { + iSliderCloseEvent = ETrue; + + PRINT1( _L("Camera <> CCamAppController::HandleSlideClosedL - active view %d"), activeView.iViewUid.iUid ); + PRINT1( _L("Camera <> CCamAppController::HandleSlideClosedL - iInfo.iOperation %d"), iInfo.iOperation ); + + // switch the camera if slide is closed and primary camera + // is active in embedded mode + switch ( activeView.iViewUid.iUid ) + { + case ECamViewIdStillPreCapture: + case ECamViewIdVideoPreCapture: + { + // if in pre capture view and slide is closed + if ( iInfo.iActiveCamera == ECamActiveCameraPrimary ) + { + if ( iInfo.iOperation != ECamPaused && + iInfo.iOperation != ECamCapturing && + iInfo.iOperation != ECamCompleting && + iInfo.iOperation != ECamPausing && + iInfo.iOperation != ECamResuming && + !iVideoRequested ) + { + appUi->HandleCommandL( ECamCmdSwitchCamera ); + } + else if ( iInfo.iOperation == ECamCapturing || + iInfo.iOperation == ECamPaused ) + { + StopVideoRecording(); + } + else if ( iVideoRequested ) + { + StopVideoRecording(); + // cancel any outstanding sound requests + iSoundPlayer->CancelAllPlaying(); + + appUi->HandleCommandL( ECamCmdSwitchCamera ); + } + else // lint + { + } + } + else + { + // Embedded camera not closed even if lens cover is closed. + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - 2ndary camera, no action..") ); + } + } + break; + case ECamViewIdStillPostCapture: + case ECamViewIdVideoPostCapture: + { + // Embedded camera not closed even if lens cover is closed. + } + break; + default: + break; + } + } + else if ( viewErr == KErrNotFound ) + { + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - view not found") ); + if ( ECamActiveCameraPrimary == iInfo.iActiveCamera ) + { + PRINT( _L("Camera <> CCamAppController::HandleSlideClosedL - need switch to 2ndary") ); + SetCameraSwitchRequired( ESwitchPrimaryToSecondary ); + if ( !appUi->AppInBackground( ETrue ) ) + { + appUi->HandleCommandL( ECamCmdSwitchCamera ); + } + } + } + } + } + + PRINT( _L("Camera <= CCamAppController::HandleSlideClosedL") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::HandleSlideOpenedL +// Handles the slide opened event +// --------------------------------------------------------------------------- +// +void CCamAppController::HandleSlideOpenedL() + { + PRINT( _L("Camera => CCamAppController::HandleSlideOpenedL") ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + // reset slider event flag + if ( iSliderCloseEvent ) + { + iSliderCloseEvent = EFalse; + } + + TVwsViewId activeView; + TInt viewErr = appUi->GetActiveViewId( activeView ); + if ( viewErr == KErrNone ) + { + PRINT1( _L("Camera HandleSlideOpenedL => active view %d"), + activeView.iViewUid.iUid ); + + // For EDGE variant + TInt camerasAvailable = CamerasAvailable(); + if ( camerasAvailable == 1 ) + { + // if in standby view and the slide is opened then exit standby view + if ( iInfo.iOperation == ECamStandby ) + { + PRINT( _L("Camera HandleSlideOpenedL => Exit Standby view") ); + appUi->View( activeView.iViewUid )->HandleCommandL( + ECamCmdExitStandby ); + } + } + else // variants with > 1 camera + { + PRINT1( _L("Camera HandleSlideOpenedL => iInfo.iOperation %d"), + iInfo.iOperation ); + PRINT1( _L("Camera HandleSlideOpenedL => CameraState() %d"), + CameraState()); + switch ( activeView.iViewUid.iUid ) + { + // if we are in the photo/video capture view and the + // second camera is enabled then switch to the main camera + // so long as video/photo capture is not in progress + case ECamViewIdStillPreCapture: + case ECamViewIdVideoPreCapture: + { + if ( iInfo.iActiveCamera == ECamActiveCameraSecondary && + iInfo.iOperation != ECamCapturing && + iInfo.iOperation != ECamPaused && + iInfo.iOperation != ECamPausing && + iInfo.iOperation != ECamResuming && + iInfo.iOperation != ECamCompleting && + (CameraState() == ECamCameraPreparedImage || + CameraState() == ECamCameraPreparedVideo + || + CameraState() == ECamCameraReserved || + CameraState() == ECamCameraPowerOn + ) && + !VideoRecordPending() ) + { + PRINT( _L("Camera precapture 2nd camera - switching now") ); + SetCameraSwitchRequired( ESwitchSecondaryToPrimary ); + if ( !appUi->AppInBackground( ETrue ) ) + { + appUi->HandleCommandL( ECamCmdSwitchCamera ); + } + } + else + { + PRINT( _L("Camera capturing, paused etc. in precapview") ); + + if ( ECamViewIdVideoPreCapture == activeView.iViewUid.iUid && + ( ECamCapturing == iInfo.iOperation || + ECamPaused == iInfo.iOperation ) ) + { + StopVideoRecording(); // stop recording and save the video + } + if ( ECamActiveCameraSecondary == iInfo.iActiveCamera ) + { + PRINT( _L("Camera HandleSlideOpenedL, switchCamera") ); + SetCameraSwitchRequired( ESwitchSecondaryToPrimary ); + if ( !appUi->AppInBackground( ETrue ) ) + { + appUi->HandleCommandL( ECamCmdSwitchCamera ); + } + } + } + } + break; + case ECamViewIdStillPostCapture: + case ECamViewIdVideoPostCapture: + { + if ( ECamActiveCameraSecondary == iInfo.iActiveCamera ) + { + SetCameraSwitchRequired( ESwitchSecondaryToPrimary ); + if ( !appUi->AppInBackground( ETrue ) ) + { + appUi->HandleCommandL( ECamCmdSwitchCamera ); + } + } + } + break; + default: + break; + } + } + } + + else if ( viewErr == KErrNotFound && + iInfo.iActiveCamera == ECamActiveCameraSecondary ) + { + // If no view is found it means that camera is in background. + // We don't want to do camera switch in embdedded/embedding mode + // post-capture when in background + if ( ( !appUi->IsEmbedded() && + !appUi->Embedding() ) || + appUi->CurrentViewState() != ECamViewStatePostCapture ) + { + PRINT( _L("Camera HandleSlideOpenedL => view not found, 2nd active") ); + iCameraSwitchRequired = ESwitchToUnknown; + } + } + else + { + } + NotifyControllerObservers( ECamEventSliderOpen ); + PRINT( _L("Camera <= CamAppController::HandleSlideOpenedL") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::VideoViewFinderResourceId() +// Resource Id for video viewfinder layout +// +// --------------------------------------------------------------------------- +// +TInt CCamAppController::VideoViewFinderResourceId( TCamVideoResolution aResolution ) + { + PRINT( _L( "Camera => CCamAppController::VideoViewFinderResourceIdL")) + TInt vidVFRes; + + TCamOrientation orient = static_cast( CEikonEnv::Static()->AppUi() )->CamOrientation(); + if( orient == ECamOrientationCamcorder || orient == ECamOrientationCamcorderLeft ) + { + vidVFRes = CamUtility::MapVideoQualityToViewFinderRes( aResolution ); + } + else + { + TInt resId; + TInt err = CamUtility::GetPsiInt( ECamPsiVideoVFResSecondaryCamera, resId ); + if( err ) + { + vidVFRes = ROID( R_CAM_VIEWFINDER_RECT_CIF_ID ); + } + else + { + vidVFRes = ROID( resId ); + } + } + + PRINT1( _L( "Camera => CCamAppController::VideoViewFinderResourceId res id "), vidVFRes ) + return vidVFRes; + } + +// --------------------------------------------------------------------------- +// CCamAppController::HandleObservedEvent() +// Receives event codes from observables +// +// --------------------------------------------------------------------------- +// +void CCamAppController::HandleObservedEvent( TCamObserverEvent aEvent ) + { + switch( aEvent ) + { + case ECamObserverEventCaptureProcessComplete: + { + NotifyControllerObservers( ECamEventExitRequested, KErrNone ); + } + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CCamAppController::IsProfileSilent +// Return whether current profile is silent or not, uses warning +// tones setting to determine whether silent or not +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsProfileSilent() + { + TRAPD( ignore, iSilentProfile = IsProfileSilentL() ); + if ( ignore ) + { + } + return iSilentProfile; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::IsProfileSilentL +// Return whether current profile is silent or not, uses warning +// tones setting to determine whether silent or not +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsProfileSilentL() + { + // get current keypad volume as indication of whether + // or not we have a silent profile + CRepository* cr = CRepository::NewLC( KCRUidProfileEngine ); + TInt value; + User::LeaveIfError( cr->Get( KProEngActiveWarningTones, value ) ); + CleanupStack::PopAndDestroy( cr ); + + return ( value == 0 ); + } + + +// --------------------------------------------------------------------------- +// ResetInactivityTimer <> +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::ResetInactivityTimer( TAny* /*aPtr*/ ) + { + PRINT( _L("Camera =><= CCamAppController::ResetInactivityTimer") ); + + User::ResetInactivityTime(); + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CCamAppController::ToneShouldBeSilent +// Returns ETrue if the supplied toneId should be silent if the profile is +// set to silent. Does *not* take into account network variant forcing +// sounds on. +// --------------------------------------------------------------------------- +// +TBool CCamAppController::ToneShouldBeSilent( TCamSoundId aSoundId ) + { + if ( aSoundId == CaptureToneId() || + aSoundId == ECamVideoStartSoundId || + aSoundId == ECamVideoStopSoundId || + aSoundId == ECamVideoPauseSoundId || + aSoundId == ECamVideoResumeSoundId || + aSoundId == ECamAutoFocusComplete || + aSoundId == ECamSelfTimerSoundId ) + { + return ETrue; + } + else + { + return EFalse; + } + } + +// --------------------------------------------------------------------------- +// CCamAppController::HandleCaptureCompletion +// Inform any observers that are waiting for a capture completion event +// --------------------------------------------------------------------------- +// +void CCamAppController::HandleCaptureCompletion() + { + PRINT( _L( "Camera => CCamAppController::HandleCaptureCompletion()" ) ) + + SetOperation( ECamNoOperation ); + + // Re-enable screensaver + EnableScreenSaver( ETrue ); + + // If mmc dismount notification came while saving, allow the dismount now + if( iDismountPending ) + { + iDismountPending = EFalse; + iDriveChangeNotifier->SendAllowDismount(); + } + + // If any observers are waiting for a capture completion event + if ( iCaptureCompletionObserverHandler ) + { + iCaptureCompletionObserverHandler->BroadcastEvent( ECamObserverEventCaptureProcessComplete ); + delete iCaptureCompletionObserverHandler; + iCaptureCompletionObserverHandler = NULL; + } + + // If the camera orientation changed during capture and not in burst mode, + // set the new orientation + if ( iConfigManager && iConfigManager->IsOrientationSensorSupported() + && iOrientationChangeOccured + && iInfo.iImageMode != ECamImageCaptureBurst ) + { + iOrientationChangeOccured = EFalse; + TRAP_IGNORE( SetImageOrientationL() ); + } + + if ( iPendingRelease ) + { + PRINT( _L( "Camera <> CCamAppController::HandleCaptureCompletion(), DATAMAKE2" ) ) + ReleaseCamera(); + } + PRINT( _L( "Camera <= CCamAppController::HandleCaptureCompletion()" ) ) + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::CheckAfModeForScene +// Checks the current scene/based on scene to see if AF mode needs setting +// --------------------------------------------------------------------------- +// +void CCamAppController::CheckAfModeForScene( TBool aForceAFReset ) + { + PRINT(_L("Camera => CCamAppController::CheckAfModeForScene")); + + if ( iConfigManager && iConfigManager->IsAutoFocusSupported() ) + { + TRAP_IGNORE( iCameraController->DirectRequestL( ECamRequestSetAfRange ) ); + } + + PRINT(_L("Camera <= CCamAppController::CheckAfModeForScene")); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::TryAutoFocus +// Start an AF operation, if needed +// --------------------------------------------------------------------------- +// +TBool CCamAppController::TryAutoFocus() + { + PRINT( _L("Camera => CCamAppController::TryAutoFocus()") ); + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_TRYAUTOFOCUS, "e_CAM_APP_AF_LOCK 1" ); //CCORAPP_AF_LOCK_START + + if ( iConfigManager && iConfigManager->IsAutoFocusSupported() ) + { + if( ECamActiveCameraPrimary != iInfo.iActiveCamera || + ECamControllerImage != iInfo.iMode ) + { + PRINT( _L("Returning EFalse - Not using primary camera in still mode") ); + // Not using primary camera in still mode + return EFalse; // Not focusing + } + + PRINT( _L("Calling IssueDirectRequestL( ECamRequestStartAutofocus )") ); + return TryAFRequest( ECamRequestStartAutofocus ); + } + else + { + return ETrue; + } + } + + +// --------------------------------------------------------- +// CCamAppController::CurrentSceneHasForcedFocus +// Returns whether the current scene has focus forced to +// a particular value ( eg Macro/Landscape modes may have +// focus fixed to Macro/Infinite ) +// --------------------------------------------------------- +// +TBool CCamAppController::CurrentSceneHasForcedFocus() const + { + if ( iConfigManager && iConfigManager->IsAutoFocusSupported() ) + { + // Work out what the current scene is (or if current scene is user + // scene, what it's based on). + TInt currentScene = IntegerSettingValue( ECamSettingItemDynamicPhotoScene ); + if ( currentScene == ECamSceneUser ) + { + currentScene = IntegerSettingValue( ECamSettingItemUserSceneBasedOnScene ); + } + + TBool isFaceTrackingOn = (iConfigManager && + iConfigManager->IsFaceTrackingSupported() && + (iSettingsModel->IntegerSettingValue( + ECamSettingItemFaceTracking ) == ECamSettOn ) ); + + // Check if the current (or based on) scene is one that should *not* have + // a reticule. + if ( ( currentScene == ECamSceneScenery + || currentScene == ECamSceneNightScenery + || currentScene == ECamSceneSports ) + && !isFaceTrackingOn ) + { + return ETrue; + } + else + { + return EFalse; + } + } + else + { + return ETrue; + } + } + +// --------------------------------------------------------------------------- +// CCamAppController::CaptureToneDelayTimeout +// Timeout from capture tone delay timer +// --------------------------------------------------------------------------- +// +TInt CCamAppController::CaptureToneDelayTimeout( TAny* aPtr ) + { + PRINT( _L("Camera => CCamAppController::CaptureToneDelayTimeoutL") ) + static_cast( aPtr )->PlayDelayedCaptureTone(); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CCamAppController::PlayDelayedCaptureTone +// Play capture tone +// --------------------------------------------------------------------------- +// +void CCamAppController::PlayDelayedCaptureTone() + { + PlaySound( CaptureToneId(), EFalse ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::InitAutoFocusL +// Initalises the AutoFocus interface, if needed +// --------------------------------------------------------------------------- +// +void CCamAppController::InitAutoFocusL() + { + PRINT( _L("Camera => CCamAppController::InitAutoFocusL") ) + PRINT(_L("Camera !! DISABLED")); + PRINT( _L("Camera <= CCamAppController::InitAutoFocusL") ) + } + +// --------------------------------------------------------------------------- +// CCamAppController::CopySnapshotIfNeededL +// Helper function for McaeoSnapImageReady that makes a copy of the snapshot +// if needed to fake a viewfinder or for image rotation. +// --------------------------------------------------------------------------- +// + +void +CCamAppController::CopySnapshotIfNeeded( const CFbsBitmap& aSnapshot, TInt aError ) + { + if ( ECamImageCaptureTimeLapse == iInfo.iImageMode + || ECamControllerVideo == iInfo.iMode + || ( iConfigManager && iConfigManager->IsOrientationSensorSupported() && + iSettingsModel->IntegerSettingValue( ECamSettingItemImageRotation ) == ECamSettOn ) + ) + { + StopIdleTimer(); + delete iSnapShotCopy; + iSnapShotCopy = NULL; + TRAP_IGNORE ( ( iSnapShotCopy = new(ELeave) CFbsBitmap() ) ); + + if ( iSnapShotCopy ) + { + TInt dupeError = iSnapShotCopy->Duplicate( aSnapshot.Handle() ); + + if ( dupeError ) + { + iSnapShotCopy->Reset(); + delete iSnapShotCopy; + iSnapShotCopy = NULL; + } + else if ( iConfigManager && !iConfigManager->IsOrientationSensorSupported() ) + { + if( ECamImageCaptureTimeLapse == iInfo.iImageMode ) + { + // simulate the receipt of a viewfinder frame using the snapshot image + // McaeoViewFinderFrameReady( *iSnapShotCopy, aError ); + HandleViewfinderFrame( aError, iSnapShotCopy ); + } + } + } + } + } + + + +// --------------------------------------------------------------------------- +// CCamAppController::EnableScreenSaver +// Turns the screen saver on or off for timelapse capture +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::EnableScreenSaver( TBool aEnable ) + { + if ( !aEnable ) + { + // Stop the screensaver from appearing + RProperty::Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 1 ); + } + else + { + // Allow the screensaver to appear + RProperty::Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 0 ); + User::ResetInactivityTime(); + } + } + + +#ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT +// --------------------------------------------------------------------------- +// CCamAppController::SetPerformanceState +// +// --------------------------------------------------------------------------- +// +void CCamAppController::SetPerformanceState( TCamPerformanceState aState ) + { + iPerformanceState = aState; + } +#endif + +// --------------------------------------------------------------------------- +// CCamAppController::StartLocationTrailL() +// Connects and starts the locationtrail +// --------------------------------------------------------------------------- +// +void CCamAppController::StartLocationTrailL() + { + PRINT( _L("Camera => CCamAppController::StartLocationTrailL") ); + CCamAppUi* appUI = static_cast( CEikonEnv::Static()->AppUi() ); + + // If a stop request is pending but the trail is being restarted, stop + // and delete the timer + if( iLocationTrailTimer ) + { + iLocationTrailTimer->Cancel(); + delete iLocationTrailTimer; + iLocationTrailTimer = NULL; + } + + TInt err = KErrNone; +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) + if ( !iLocationTrailStarted ) + { + if ( !iLocationUtilityConnected ) + { + PRINT( _L("Camera => CCamAppController::StartLocationTrailL - iLocationUtility.Connect()") ); + TVwsViewId activeView; + if ( appUI->GetActiveViewId( activeView ) == KErrNone ) + { + if( ECamViewIdStillPreCapture == activeView.iViewUid.iUid ) + { + CCamPreCaptureViewBase* view = static_cast( appUI->View( activeView.iViewUid ) ); + view->SetLocationTrailConnecting(); + } + } + User::LeaveIfError( iLocationUtility.Connect() ); + iLocationUtilityConnected = ETrue; + } + err = iLocationUtility.StartLocationTrail( RLocationTrail::ECaptureAll ); + } +#endif + // If start fails, change the setting to off + if( KErrNone != err ) + { + PRINT1( _L("Camera :: CCamAppController::StartLocationTrailL error:%d encountered while starting location trail"), err ) + +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) + // Disconnect from the location utility + PRINT( _L("Camera => CCamAppController::StartLocationTrailL - Starting of LocationTrail failed -> iLocationUtility.Close()") ); + iLocationUtility.Close(); + iLocationUtilityConnected = EFalse; + SetIntegerSettingValueL( ECamSettingItemRecLocation, ECamLocationOff ); +#endif + + // Going to standby mode, location trail disabled + /* + TVwsViewId activeView; + if ( appUI->GetActiveViewId( activeView ) == KErrNone ) + { + CCamViewBase* view = static_cast( appUI->View( activeView.iViewUid ) ); + view->SwitchToStandbyModeL( TCamAppViewIds(activeView.iViewUid.iUid), err ); + } + */ + appUI->SetStandbyStatus( err ); + appUI->HandleCommandL( ECamCmdGoToStandby ); + } + else + { + iLocationTrailStarted = ETrue; + } + PRINT( _L("Camera <= CCamAppController::StartLocationTrailL") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::StopLocationTrail( TBool aCloseSession ) +// Stops the locationtrail +// --------------------------------------------------------------------------- +// +void CCamAppController::StopLocationTrail( TBool aCloseSession ) + { + PRINT1( _L("Camera => CCamAppController::StopLocationTrail operation mode:%d"), iInfo.iOperation ); +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) + if( iLocationTrailStarted ) + { + // if not ECamCapturing, ECamPausing, ECamPaused, ECamResuming or ECamCompleting + if( (iInfo.iOperation < ECamCapturing || iInfo.iOperation > ECamCompleting ) && + ( CurrentFullFileName() == KNullDesC || SavedCurrentImage() ) + ) + { + PRINT( _L("Camera :: CCamAppController::StopLocationTrail - stopping location trail") ) + iLocationUtility.StopLocationTrail(); + if ( aCloseSession ) + { + PRINT( _L("Camera => CCamAppController::StartLocationTrailL - iLocationUtility.Close()") ); + iLocationUtility.Close(); + iLocationUtilityConnected = EFalse; + } + iLocationTrailStarted = EFalse; + + // If a timer was used to stop the location trail, then cancel and delete the timer + if( iLocationTrailTimer ) + { + iLocationTrailTimer->Cancel(); + delete iLocationTrailTimer; + iLocationTrailTimer = NULL; + } + } + else + { + // Use a timer to close the trail in a few seconds + PRINT( _L("Camera :: CCamAppController::StopLocationTrail - location trail in use") ) + if( !iLocationTrailTimer ) + { + TRAP_IGNORE( iLocationTrailTimer = CCamTimer::NewL( KLocTrailCloseRetryTime, + TCallBack( CCamAppController::RetryStopLocationTrail, this ) ) ); + } + else // restart the timer + { + iLocationTrailTimer->Cancel(); + iLocationTrailTimer->SetTimeout( KLocTrailCloseRetryTime ); + } + iLocationTrailTimer->StartTimer(); + } + } + #endif + PRINT( _L("Camera <= CCamAppController::StopLocationTrail") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::RetryStopLocationTrail() +// Timer callback function to attempt to remove the location trail periodically +// --------------------------------------------------------------------------- +// +TInt CCamAppController::RetryStopLocationTrail( TAny* aPtr ) + { + PRINT( _L("Camera => CCamAppController::RetryStopLocationTrail") ) + static_cast( aPtr )->StopLocationTrail(); + PRINT( _L("Camera <= CCamAppController::RetryStopLocationTrail") ) + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCamAppController::CaptureKeyPressedWhileImageSaving +// Whether or not a capture key pressed during image saving +// ----------------------------------------------------------------------------- +// +TBool CCamAppController::CaptureKeyPressedWhileImageSaving() const + { + return iCaptureKeyPressedWhileImageSaving; + } + +// ----------------------------------------------------------------------------- +// CCamAppController::SetCaptureKeyPressedWhileImageSaving +// ----------------------------------------------------------------------------- +// +void CCamAppController::SetCaptureKeyPressedWhileImageSaving(TBool aCaptureKeyPressed) + { + iCaptureKeyPressedWhileImageSaving = aCaptureKeyPressed; + } + + + +// --------------------------------------------------------------------------- +// CamerasAvailable <> +// +// Commonly needed in UI classes, so added also support to get this info +// through this class. This way we avoid unnecessary binding of +// CCameraController and UI classes. +// --------------------------------------------------------------------------- +// +TInt +CCamAppController::CamerasAvailable() + { + return CCamCameraController::CamerasAvailable(); + } + +TBool +CCamAppController::TimeLapseSupported() + { + return (ECamSupportOn == iSettingsModel->VariantInfo().iTimeLapseSupport); + } + +TBool +CCamAppController::AlwaysOnSupported() + { + return (ECamSupportOn == iSettingsModel->VariantInfo().iAlwaysOnSupport); + } + +const TVersion& +CCamAppController::Version() + { + return iSettingsModel->VariantInfo().iVersion; + } + + +// <> +TBool +CCamAppController::Busy() const + { + return (EBusyNone != iBusyFlags || CameraControllerBusy() ); + } + +TBool +CCamAppController::CameraControllerBusy() const + { + return (iCameraController && ECamBusyOff != iCameraController->ControllerInfo().iBusy ); + } + +// =========================================================================== +// From MCamCameraObserver + +// --------------------------------------------------------------------------- +// HandleCameraEventL <> +// --------------------------------------------------------------------------- +// +void +CCamAppController +::HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData /*= NULL*/ ) + { +#ifdef _DEBUG + // Log viewfinder events with PRINT_FRQ + // #ifdef _DEBUG is used to avoid extra if in release builds + // where logging is not used anyway. + if( ECamCameraEventVfFrameReady == aEventId ) + { + PRINT_FRQ1( _L( "Camera => CCamAppController::HandleCameraEventL, event[%s]" ), + KCamCameraEventNames[aEventId] ); + } + else +#endif // _DEBUG + { + PRINT1( _L( "Camera => CCamAppController::HandleCameraEventL, event[%s]" ), + KCamCameraEventNames[aEventId] ); + } + + // in case we get poweron event before appui is completely constructed + // finish it here + if ( aEventId == ECamCameraEventPowerOn ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( iConfigManager && + iConfigManager->IsUIOrientationOverrideSupported() && + !appUi->IsUiConstructionComplete() ) + { + appUi->AppUIConstructCallbackL( appUi ); + } + } + + TInt handleError( KErrNone ); + + if( ECamCameraEventVfFrameReady != aEventId && + KErrNone == aStatus || KErrDiskFull == aStatus || KErrCompletion == aStatus ) + { + // Called for all events, except viewfinder frame ready event. + SetStateFromEvent( aEventId ); + } + + if( ECamCameraEventImageInit == aEventId || + ECamCameraEventVideoInit == aEventId ) + { + iSettingsRestoreNeeded = ETrue; + } + + + // NOTE: Consider that the ones needing these events + // receive them directly from Camera Controller? + switch( aEventId ) + { + case ECamCameraEventVfStart: + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + // For forced focus scenes, do one autofocus request once vf starts if needed + if( UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + if( CurrentSceneHasForcedFocus() || UiConfigManagerPtr()->IsAutofocusSetInHyperfocalAtStartup() ) + { + PRINT( _L( "Camera => CCamAppController::HandleCameraEventL, TryAFRequest( ECamRequestCancelAutofocus )") ); + TryAFRequest( ECamRequestCancelAutofocus ); + } + } + if( iSettingsRestoreNeeded ) + { + iSettingsRestoreNeeded = EFalse; + TRAP( aStatus, RestoreSettingsToCameraL() ); + } + // fixed toolbar is used only with touch devices + if ( IsTouchScreenSupported() ) + { + appUi->SetToolbarVisibility();// avoid flickering in settings view + PRINT( _L( "Camera <> SetToolbarVisibility done ") ); + } + // else use AP + else + { + if( iConfigManager && iConfigManager->IsUIOrientationOverrideSupported() ) + { + NotifyControllerObservers( ECamEventInitReady ); + } + } + + if ( UiConfigManagerPtr()->IsLocationSupported() && + !appUi->IsEmbedded()) + { + if( ECamLocationOn == IntegerSettingValue( ECamSettingItemRecLocation ) ) + { + if( ECamActiveCameraPrimary == ActiveCamera() && ECamStandby != CurrentOperation() ) + { + StartLocationTrailL(); + } + else // Secondary camera + { + PRINT( _L("Camera: CCamAppController::HandleCameraEventL - secondary camera, stop location trail") ) + StopLocationTrail(); + } + } + } + break; + } + case ECamCameraEventVfFrameReady: + { + HandleViewfinderFrame( aStatus, static_cast( aEventData ) ); + + if( KErrNone == aStatus && iSettingsRestoreNeeded ) + { + iSettingsRestoreNeeded = EFalse; + TRAP( aStatus, RestoreSettingsToCameraL() ); + } + return; + } + case ECamCameraEventSsReady: + { + TRAP_IGNORE( HandleSnapshotEvent( aStatus, static_cast( aEventData ) ) ); + + if ( ECamImageCaptureBurst == iInfo.iImageMode && + CurrentCapturedCount() < CaptureLimit() ) + { + // check memory level + TInt memoryLeft = 0; + HAL::Get( HALData::EMemoryRAMFree, memoryLeft ); + + if ( memoryLeft < KCriticalMemoryLevel ) + { + PRINT( _L("Camera <> RAM is below critical level #1") ) + // memory below critical level, need to stop capture + SoftStopBurstL( ETrue ); + EventHandlingErrorRecovery( KErrNoMemory ); + } + } + + break; + } + case ECamCameraEventImageData: + { +// TRAP_IGNORE( HandleImageCaptureEventL( aStatus, static_cast( aEventData ) ) ); + TRAP_IGNORE( HandleImageCaptureEventL( aStatus, static_cast( aEventData ) ) ); + if ( ECamImageCaptureBurst == iInfo.iImageMode && + CurrentCapturedCount() < CaptureLimit() ) + { + // check memory level + TInt memoryLeft = 0; + HAL::Get( HALData::EMemoryRAMFree, memoryLeft ); + if ( memoryLeft < KCriticalMemoryLevel ) + { + PRINT( _L("Camera <> RAM is below critical level #2") ) + // memory below critical level, need to stop capture + TRAP_IGNORE( iCameraController->DirectRequestL( ECamRequestImageCancel ) ); + EventHandlingErrorRecovery( KErrNoMemory ); + } + } + break; + } + case ECamCameraEventImageStop: + { + TRAP( aStatus, HandleImageStopEventL( aStatus, aEventData ? *static_cast( aEventData ) : 0 ) ); + break; + } + + case ECamCameraEventAutofocusSuccessful: // Flowthrough + case ECamCameraEventAutofocusFailed: + { + // Autofocusing is done, do possible pending capture + SetAfNeeded( EFalse ); + if( iCaptureRequested && !EngineProcessingCapture() ) + { + iCaptureRequested = EFalse; + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_HANDLECAMERAEVENTL, "e_CAM_APP_SHOT_TO_SNAPSHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMAPPCONTROLLER_HANDLECAMERAEVENTL, "e_CAM_PRI_SHOT_TO_SNAPSHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMAPPCONTROLLER_HANDLECAMERAEVENTL, "e_CAM_PRI_SHOT_TO_SAVE 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMAPPCONTROLLER_HANDLECAMERAEVENTL, "e_CAM_PRI_SHOT_TO_SHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMAPPCONTROLLER_HANDLECAMERAEVENTL, "e_CAM_APP_SHOT_TO_STILL 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMAPPCONTROLLER_HANDLECAMERAEVENTL, "e_CAM_APP_CAPTURE_START 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP6_CCAMAPPCONTROLLER_HANDLECAMERAEVENTL, "e_CAM_PRI_SERIAL_SHOOTING 1" ); + + Capture(); + } + break; + } + + case ECamCameraEventSettingsSingle: + { + TRAP_IGNORE( HandleSettingEventL( aStatus, aEventId, aEventData ) ); + return; + } + case ECamCameraEventVideoAsyncStop: + case ECamCameraEventVideoStop: + { + // we always want to handle these events. set the flag because + // there is a possibility that some other event has come before + // and caused the flag to be cleared + SetFlags(iBusyFlags, EBusyRequest); + if ( !IsMemoryAvailable( ECamMediaStorageCard, EFalse ) + && CurrentStorage() == ECamMediaStorageCard ) + { + aStatus = KErrNone; + } + if( aStatus != KErrNone && aStatus != KErrDiskFull && aStatus != KErrCompletion + && !( aStatus == KErrPathNotFound && IsCaptureStoppedForUsb() ) ) + { + iSaving = EFalse; + SetOperation( ECamStandby, KErrGeneral ); + } + else + { + // In case of no error, we are already in appropriate state + } + break; + } + case ECamCameraEventIveRecover: + { + if( !Busy() ) + { + PRINT( _L( "Camera => CCamAppController::HandleCameraEventL - Issue new recovery sequence" ) ); + SetStateFromEvent( ECamCameraEventReserveLose ); + SetTargetMode( ECamControllerImage ); + SetTargetImageMode( CurrentImageModeSetup() ); + IssueModeChangeSequenceL(); + } + else + { + PRINT( _L( "Camera => CCamAppController::HandleCameraEventL - Recovery sequence is active" ) ); + } + break; + } + case ECamCameraEventSequenceEnd: + { + // only for image mode + if( iConfigManager && iConfigManager->IsOrientationSensorSupported() + && ECamControllerImage == CurrentMode() ) + { + // If the camera orientation changed during initialization sequence and not in burst mode, + // set the new orientation + if ( iOrientationChangeOccured && + iInfo.iImageMode != ECamImageCaptureBurst ) + { + iOrientationChangeOccured = EFalse; + TRAP_IGNORE( SetImageOrientationL() ); + } + if( !iAccSensorListening ) + { + TRAP_IGNORE( UpdateSensorApiL( ETrue ) ); + } + } + if ( aStatus == KErrCancel ) + { + // sequence canceled, no need to event further + return; + } + break; + } + default: + break; + } + + + // ------------------------------------------------------- + // We have requested a series of operations. + // The sequences have ids, which we use to determine + // the right procedure. React when sequence ends. + if( IsFlagOn( iBusyFlags, EBusySequence ) ) + { + PRINT( _L( "Camera <> Sequence of requests pending" ) ); + TRAP( handleError, HandleSequenceEventL( aStatus, aEventId, aEventData ) ); + } + // ------------------------------------------------------- + // We have single request pending. + else if( IsFlagOn( iBusyFlags, EBusyRequest ) ) + { + PRINT( _L( "Camera <> Single request pending" ) ); + TRAP( handleError, HandleRequestEventL( aStatus, aEventId, aEventData ) ); + } + else if( IsFlagOn( iBusyFlags, EBusySetting ) ) + { + PRINT( _L( "Camera <> Settings finished" ) ); + TRAP( handleError, HandleSettingEventL( aStatus, aEventId, aEventData ) ); + } + // ------------------------------------------------------- + // No request pending for us. + // Direct request issued to Camera controller. + else + { + PRINT( _L( "Camera <> No requests pending!!" ) ); + // handle these .. + } + + // ------------------------------------------------------- + if( KErrNone != handleError ) + { + EventHandlingErrorRecovery( handleError ); + } + + // Reserve lost event is always handled. + if( ECamCameraEventReserveLose == aEventId && KErrNone != aStatus ) + { + SetOperation( ECamStandby, aStatus ); + } + + if( iPendingRelease && !Busy() && + !IsSavingInProgress() && iInfo.iOperation != ECamCapturing ) + { + // Finally, if camera release is pending, and we are no longer busy, + // call ReleaseCamera to get it done. + // ReleaseCamera is used instead of simply setting iInfo.iTargetMode, + // because it also handles stopping ongoing burst captures. + PRINT( _L( "Camera <> CCamAppController::HandleCameraEventL, release pending, calling ReleaseCamera..") ); + ReleaseCamera(); + } + +#ifdef _DEBUG + // Log viewfinder events with PRINT_FRQ + if( ECamCameraEventVfFrameReady == aEventId ) + { + PRINT_FRQ( _L( "Camera <= CCamAppController::HandleCameraEventL" ) ); + } + else +#endif // _DEBUG + { + PRINT( _L( "Camera <= CCamAppController::HandleCameraEventL" ) ); + } + } + +// =========================================================================== + + +// --------------------------------------------------------------------------- +// EventHandlingErrorRecovery +// --------------------------------------------------------------------------- +// +void +CCamAppController::EventHandlingErrorRecovery( TInt aError ) + { + PRINT1( _L( "Camera => CCamAppController::EventHandlingErrorRecovery, error:%d" ), aError ); + + __ASSERT_ALWAYS( aError != KErrNone, CamPanic( ECamPanicInvalidState ) ); + + iCaptureModeTransitionInProgress = EFalse; + + // Reset the saving flag to ensure that camera does not get stuck + iSaving = EFalse; + + iMuteNotifications = ETrue; + + // Cancel ongoing sequence if any + iCameraController->CancelSequence(); + + // Clear busy flags + iBusyFlags = EBusyNone; + iInfo.iBusyRequestId = ECamRequestNone; + + iMuteNotifications = EFalse; + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + //Don't change to Stand by mode if -4 error gotten during burst (somehow expected) + if(SequenceCaptureInProgress() && appUi->CurrentBurstMode() == ECamImageCaptureBurst && KErrNoMemory == aError ) + { + TRAP_IGNORE( appUi->HandleCameraErrorL(aError) ); + } + else + { + SetOperation( ECamStandby, aError ); + } + + NotifyControllerObservers( ECamEventControllerReady, aError ); + + PRINT( _L( "Camera <= CCamAppController::EventHandlingErrorRecovery" ) ); + } + +// --------------------------------------------------------------------------- +// HandleSettingEventL +// --------------------------------------------------------------------------- +// +void +CCamAppController::HandleSettingEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData ) + { + PRINT( _L( "Camera => CCamAppController::HandleSettingEventL" ) ); + // ------------------------------------------------------- + if( ECamCameraEventSettingsDone == aEventId ) + { + ClearFlags( iBusyFlags, EBusySetting ); + + // Need to clear any pending settings. + iSettingProvider->Reset(); + + if( IsInShutdownMode() && iInfo.iMode != ECamControllerIdle && iInfo.iMode != ECamControllerShutdown ) + { + PRINT( _L( "Camera <> CCamAppController: Releasing camera.." ) ); + IssueRequestL( ECamRequestRelease ); + } + else + { + PRINT( _L( "Camera <> CCamAppController: Got setting end event.." ) ); + if( KErrNone != aStatus ) + { + TCamCameraSettingId* cameraSetting = + static_cast( aEventData ); + + // Leave with the incoming error, if setting id not provided. + CheckNonNullL( cameraSetting, aStatus ); + + if( ECameraSettingFileName == *cameraSetting ) + { + DoVideoNameRetryL( aStatus ); + } + else + { + User::Leave( aStatus ); + } + } + else + { + ProceedPendingOrNotifyReadyL(); + } + } + } + // ------------------------------------------------------- + else if( ECamCameraEventSettingsSingle == aEventId ) + { + TCamCameraSettingId* cameraSetting = + static_cast( aEventData ); + + CheckNonNullL( cameraSetting, KErrNotFound ); + switch( *cameraSetting ) + { + case ECameraSettingDigitalZoom: + case ECameraSettingOpticalZoom: + { + PRINT( _L( "Camera <> CCamAppController: zoom event" ) ); + NotifyControllerObservers( ECamEventZoomStateChanged, aStatus ); + // Pending zooming done in HandleViewfinderFrame + break; + } + default: + PRINT( _L( "Camera <> CCamAppController: unhandled setting event" ) ); + break; + } + } + // ------------------------------------------------------- + else + { + // Ignored + } + // ------------------------------------------------------- + PRINT( _L( "Camera <= CCamAppController::HandleSettingEventL" ) ); + } + +// --------------------------------------------------------------------------- +// DoVideoNameRetryL +// --------------------------------------------------------------------------- +// +void +CCamAppController::DoVideoNameRetryL( TInt aStatus ) + { + PRINT( _L( "Camera => CCamAppController::DoVideoNameRetryL" ) ); + if ( IsFlagOn( iCameraController->State(), ECamVideoOn ) + && iVideoNameRetries > 0 ) + { + PRINT1( _L( "Camera <> video rename failed retries = %d retrying rename" ), iVideoNameRetries ); + + // Try again + --iVideoNameRetries; + TRAP_IGNORE( GenerateNextValidVideoPathL() ); + if ( ECamCapturing != iInfo.iOperation && ECamPaused != iInfo.iOperation ) + { + iSettingProvider->AddPendingSettingChangeL( ECamSettingItemVideoNameBase ); + } + IssueSettingsChangeRequestL(); + } + else if ( KErrDiskFull == aStatus + && ECamMediaStorageCard == IntegerSettingValue( ECamSettingItemVideoMediaStorage ) ) + { + PRINT( _L( "Camera McaeoVideoPrepareComplete disk full and set to memory card " ) ); + NotifyControllerObservers( ECamEventInvalidMemoryCard ); + + // ForceUsePhoneMemory + if( ExistMassStorage() ) + { + TRAP_IGNORE( + { + iSettingsModel->SetIntegerSettingValueL( ECamSettingItemVideoMediaStorage, + ECamMediaStorageMassStorage ); + GenerateNextValidVideoPathL(); + }); + } + else + { + TRAP_IGNORE( + { + iSettingsModel->SetIntegerSettingValueL( ECamSettingItemVideoMediaStorage, + ECamMediaStoragePhone ); + GenerateNextValidVideoPathL(); + }); + + } + iSettingProvider->AddPendingSettingChangeL( ECamSettingItemVideoMediaStorage ); + IssueSettingsChangeRequestL(); + } + // No retries left + else + { + PRINT1( _L( "Camera <> video prep failed retries = %d removing iVideoRequested" ), iVideoNameRetries ); + // remove pending request, so that new attempts to record are not blocked + if ( iVideoRequested ) + iVideoRequested = EFalse; + + User::LeaveIfError( aStatus ); + } + PRINT( _L( "Camera <= CCamAppController::DoVideoNameRetryL" ) ); + } + +// --------------------------------------------------------------------------- +// HandleCameraSequenceComplete +// --------------------------------------------------------------------------- +// +void +CCamAppController::HandleSequenceEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* /*aEventData*/ ) + { + PRINT( _L( "Camera => CCamAppController::HandleSequenceEventL" ) ); + + if( iDismountPending && + ( ECamCameraEventImageInit == aEventId || + ECamCameraEventVideoInit == aEventId || + ECamCameraEventSequenceEnd == aEventId ) ) + { + iDismountPending = EFalse; + iDriveChangeNotifier->SendAllowDismount(); + } + if( ECamCameraEventSequenceEnd == aEventId ) + { + ClearFlags( iBusyFlags, EBusySequence ); + + if( IsInShutdownMode() && iInfo.iMode != ECamControllerIdle && iInfo.iMode != ECamControllerShutdown ) + { + PRINT( _L( "Camera <> In shutdown mode!!" ) ); + IssueRequestL( ECamRequestRelease ); + } + else + { + User::LeaveIfError( aStatus ); + if( iCameraController && !iCameraController->IsWaitingIveResources() ) + { + PRINT( _L( "Camera <> sequence end, proceed with pending.." ) ); + ProceedPendingOrNotifyReadyL(); + } + } + } + + PRINT( _L( "Camera <= CCamAppController::HandleSequenceEventL" ) ); + } + +// --------------------------------------------------------------------------- +// HandleRequestEventL +// --------------------------------------------------------------------------- +// +void +CCamAppController::HandleRequestEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* /*aEventData*/ ) + { + PRINT( _L( "Camera => CCamAppController::HandleRequestEventL" ) ); + + // Check if pending operations that need immediate attention. + if( IsInShutdownMode() && iInfo.iMode != ECamControllerIdle && + iInfo.iMode != ECamControllerShutdown && + !iSaving && iInfo.iOperation != ECamCapturing && + iInfo.iOperation != ECamCompleting ) + { + PRINT( _L( "Camera <> in shutdown mode, release camera.." ) ); + IssueDirectRequestL( ECamRequestRelease ); + } + else + { + if( ECamCameraEventVideoStop == aEventId ) + { + ClearFlags( iBusyFlags, EBusyRequest ); + HandleVideoStopEvent( aStatus ); + //If postcapture view is set to off notify controller ready event + //for updating counter. + if(IntegerSettingValue(ECamSettingItemVideoShowCapturedVideo)!=ECamSettOn ) + { + NotifyControllerObservers( ECamEventControllerReady, KErrNone ); + } + } + else if( ECamCameraEventVideoAsyncStop == aEventId ) + { + HandleVideoAsyncStopEvent( aStatus ); + } + else + { + // Error handling in one place + User::LeaveIfError( aStatus ); + + // If our request is fully processed. + if( !CameraControllerBusy() ) + { + PRINT( _L( "Camera <> camera not busy, proceed or notify ready.." ) ); + ClearFlags( iBusyFlags, EBusyRequest ); + ProceedPendingOrNotifyReadyL(); + } + } + } + PRINT( _L( "Camera <= CCamAppController::HandleRequestEventL" ) ); + } + + +// --------------------------------------------------------------------------- +// IssueRequestL +// --------------------------------------------------------------------------- +// +void +CCamAppController +::IssueRequestL( const TCamCameraRequestId& aId ) + { + PRINT1( _L("Camera => CCamAppController::IssueRequestL request[%s]"), KCamRequestNames[aId] ); + + SetFlags( iBusyFlags, EBusyRequest ); + iInfo.iBusyRequestId = aId; + + TRAPD( error, iCameraController->RequestL( iInfo.iBusyRequestId ) ); + if( error != KErrNone ) + { + ClearFlags( iBusyFlags, EBusyRequest ); + iInfo.iBusyRequestId = ECamRequestNone; + User::Leave( error ); + } + + PRINT( _L("Camera <= CCamAppController::IssueRequestL") ); + } + +// --------------------------------------------------------------------------- +// IssueDirectRequestL +// --------------------------------------------------------------------------- +// +void +CCamAppController +::IssueDirectRequestL( const TCamCameraRequestId& aId ) + { + PRINT( _L("Camera => CCamAppController::IssueDirectRequestL") ); + iCameraController->DirectRequestL( aId ); + PRINT( _L("Camera <= CCamAppController::IssueDirectRequestL") ); + } + + +// --------------------------------------------------------------------------- +// IssueSettingsChangeRequestL +// --------------------------------------------------------------------------- +// +void +CCamAppController::IssueSettingsChangeRequestL() + { + PRINT( _L("Camera => CCamAppController::IssueSettingsChangeRequestL") ); + SetFlags( iBusyFlags, EBusySetting ); + + TRAPD( error, iCameraController->RequestSettingsChangeL() ); + if( KErrNone != error ) + { + ClearFlags( iBusyFlags, EBusySetting ); + User::Leave( error ); + } + PRINT( _L("Camera <= CCamAppController::IssueSettingsChangeRequestL") ); + } + +// --------------------------------------------------------------------------- +// ProceedPendingOrNotifyReadyL +// --------------------------------------------------------------------------- +// +void +CCamAppController::ProceedPendingOrNotifyReadyL() + { + PRINT( _L("Camera => CCamAppController::ProceedPendingOrNotifyReadyL") ); + PRINT4( _L("Camera <> iMode[%s] iTargetMode[%s] iImageMode[%s] iTargetImageMode[%s]"), + KCamModeNames[iInfo.iMode], + KCamModeNames[iInfo.iTargetMode], + KCamImageModeNames[iInfo.iImageMode], + KCamImageModeNames[iInfo.iTargetImageMode] ); + + __ASSERT_DEBUG( iCameraController, CamPanic( ECamPanicNullPointer ) ); + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + if( iInfo.iMode != iInfo.iTargetMode ) + { + if ( !IsInShutdownMode() && !iSaving && iInfo.iOperation != ECamCapturing ) + { + PRINT( _L("Camera <> CCamAppController: not in target mode, need to issue requests") ); + IssueModeChangeSequenceL(); + } + } + else if( iCameraController->ViewfinderState() != iInfo.iTargetVfState && + IsAppUiAvailable () && + !appUi->AppInBackground( ETrue ) && + !( iConfigManager && iConfigManager->IsUIOrientationOverrideSupported() && + iPendingRelease ) ) + { + PRINT( _L("Camera <> CCamAppController: need to start/stop viewfinder..") ); + IssueModeChangeSequenceL(); + } + else if( iSettingProvider + && iSettingProvider->PendingSettingChangeCount() > 0 ) + { + PRINT( _L("Camera <> CCamAppController: settings pending, proceed now..") ); + IssueSettingsChangeRequestL(); + } + else if( iVideoPrepareNeeded ) + { + PRINT( _L("Camera <> CCamAppController: video prepare pending, proceed now..") ); + iVideoPrepareNeeded = EFalse; + IssueRequestL( ECamRequestVideoInit ); + } + else + { + PRINT( _L("Camera <> CCamAppController: Target mode achieved") ); + if( iCaptureModeTransitionInProgress ) + { + PRINT( _L("Camera <> CCamAppController: capture mode transition complete") ); + iCaptureModeTransitionInProgress = EFalse; + SetImageMode( iInfo.iTargetImageMode ); + } + + if ( iSetNewPathnamesPending > ECamMediaStorageNone ) + { + TRAP_IGNORE( SetPathnamesToNewStorageL( iSetNewPathnamesPending ) ); + } + + if( iVideoRequested ) + { + PRINT( _L("Camera <> starting recording..") ); + iVideoRequested = EFalse; + IssueRequestL( ECamRequestVideoStart ); + PRINT( _L("Camera <> ..done") ); + } + + + NotifyControllerObservers( ECamEventEngineStateChanged, KErrNone ); + NotifyControllerObservers( ECamEventControllerReady, KErrNone ); + } + PRINT( _L("Camera <= CCamAppController::ProceedPendingOrNotifyReadyL") ); + } + +// --------------------------------------------------------------------------- +// SetStateFromEvent +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetStateFromEvent( TCamCameraEventId aEventId ) + { + PRINT3( _L("Camera => CCamAppController::SetStateFromEvent mode[%s] operation[%s] event[%s]"), + KCamModeNames[iInfo.iMode], + KCamCaptureOperationNames[iInfo.iOperation], + KCamCameraEventNames[aEventId] + ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + switch( aEventId ) + { + // ================================= + case ECamCameraEventReserveLose: + // SetMode( ECamControllerShutdown ); + SetMode( ECamControllerIdle ); + SetOperation( ECamNoOperation ); + break; + // --------------------------------- + case ECamCameraEventPowerOn: + PRINT( _L("Camera <> Init key sound system..") ); + iSoundPlayer->InitKeySoundSystem(); + PRINT( _L("Camera <> ..Init key sound system done") ); + break; + // --------------------------------- + case ECamCameraEventPowerOff: + // Reset the flash error status + if( iFlashStatus ) iFlashStatus->SetFlashError( EFalse ); + SetMode( ECamControllerIdle ); + SetOperation( ECamNoOperation ); + break; + // ================================= + // VF events + case ECamCameraEventVfStart: + if( iBacklightTimer + && !iBacklightTimer->IsActive() ) + { + //iBacklightTimer->Start( KBacklighTimerInterval, + // KBacklighTimerInterval, + // TCallBack( ResetInactivityTimer, this ) ); + iBacklightTimer->Start( 0, + KBacklighTimerInterval, + TCallBack( ResetInactivityTimer, this ) ); + } + iAFCancelInProgress = EFalse; + break; + // --------------------------------- + case ECamCameraEventVfStop: + if( iBacklightTimer ) + { + iBacklightTimer->Cancel(); + } + break; + // ================================= + case ECamCameraEventImageInit: + PRINT ( _L("Camera <> CCamAppController::SetStateFromEvent .. case ECamCameraEventImageInit") ); + SetMode( ECamControllerImage ); + + // Set the capture count now, so we don't need to set it when starting capture. + TRAP_IGNORE( InitCaptureLimitL() ); + SetOperation( ECamNoOperation ); + NotifyControllerObservers( ECamEventImageQualityChanged ); + + break; + // --------------------------------- + case ECamCameraEventImageStart: // Capture started, not finished. + PRINT ( _L("Camera <> CCamAppController::SetStateFromEvent .. case ECamCameraEventImageStart") ); + SetOperation( ECamCapturing ); + + // Make sure our cached value for image filename number is up to date. + iImageNumberCache = IntegerSettingValue( ECamSettingItemPhotoNumber ); + break; + // --------------------------------- + case ECamCameraEventImageStop: // Capture finished, unless in burst + PRINT ( _L("Camera <> CCamAppController::SetStateFromEvent .. case ECamCameraEventImageStop") ); + // Store image counter now. + TRAP_IGNORE( SetIntegerSettingValueL( ECamSettingItemPhotoNumber, iImageNumberCache ) ); + + if ( ECamImageCaptureBurst != iInfo.iImageMode ) + { + + //If canceled autofocusing previously then have to set + //autofocus range to get autofocusing work again. + + if(iAFCancelInProgress ) + { + iAFCancelInProgress = EFalse; + TRAP_IGNORE( iCameraController->DirectRequestL( ECamRequestSetAfRange ) ); + + } + + +// No operation change here. +// Set to Completing in SS event, and ECamNoOperation when image saved. +// SetOperation( ECamNoOperation ); + } + break; + // --------------------------------- + case ECamCameraEventImageRelease: + SetMode( ECamControllerIdle ); + SetOperation( ECamNoOperation ); + break; + // ================================= + case ECamCameraEventVideoInit: + SetMode( ECamControllerVideo ); + SetOperation( ECamNoOperation ); + break; + // --------------------------------- + case ECamCameraEventVideoStart: + iVideoRequested = EFalse; + SetOperation( ECamCapturing ); + break; + // --------------------------------- + case ECamCameraEventVideoPause: + PlaySound( ECamVideoPauseSoundId, EFalse ); + SetOperation( ECamPaused ); + break; + // --------------------------------- + case ECamCameraEventVideoStop: + SetOperation( ECamCompleting ); + break; + // --------------------------------- + case ECamCameraEventVideoRelease: + SetMode( ECamControllerIdle ); + SetOperation( ECamNoOperation ); + break; + // ================================= + case ECamCameraEventStartAutofocus: + + if ( !CurrentSceneHasForcedFocus() && + !iAFCancelInProgress ) + { + PRINT( _L("ECamCameraEventStartAutofocus -> Set operation state to ECamFocusing") ); + iCurrentAFRequest=ECamRequestStartAutofocus; + SetOperation( ECamFocusing ); + // fixed toolbar is used only with touch devices + if ( IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + } + break; + // --------------------------------- + case ECamCameraEventAutofocusSuccessful: + case ECamCameraEventAutofocusFailed: + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPCONTROLLER_SETSTATEFROMEVENT, "e_CAM_APP_AF_LOCK 0" ); //CCORAPP_AF_LOCK_END + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMAPPCONTROLLER_SETSTATEFROMEVENT, "e_CAM_APP_OVERLAY_UPD 1" ); //CCORAPP_OVERLAY_UPD_START + PRINT2( _L("Camera <> CCamAppController::SetStateFromEvent - iPendingAFRequest[%s] iCurrentAFRequest[%s]"), + KCamRequestNames[iPendingAFRequest], + KCamRequestNames[iCurrentAFRequest] ); + + if( iAFCancelInProgress && ECamRequestCancelAutofocus == iCurrentAFRequest && + ECamRequestCancelAutofocus == iPendingAFRequest ) + { + // Cancelling done, camera lens is in hyperfocal position. + // Return AF range back to normal, so that next autofocus request + // will use the right range for this scene. + iAFCancelInProgress = EFalse; + TRAP_IGNORE( iCameraController->DirectRequestL( ECamRequestSetAfRange ) ); + iPendingAFRequest=0; + iCurrentAFRequest=0; + NotifyControllerObservers( ECamEventFocusCancelled ); + + if ( !iCaptureRequested ) + { + SetOperation( ECamNoOperation ); + } + else + { + // do not notify observers if this happens after capture + // has been requested as that would result in invalid ui state + iInfo.iOperation = ECamNoOperation; + if( IsAfNeeded() ) + { + SetAfNeeded( EFalse ); + StartAutoFocus(); + } + } + } + else if( iCurrentAFRequest==iPendingAFRequest && + iPendingAFRequest==ECamRequestStartAutofocus + && !CurrentSceneHasForcedFocus() + ) + { + if( aEventId==ECamCameraEventAutofocusSuccessful ) + { + + PRINT( _L("ECamCameraEventAutofocusSuccessful -> Set operation state to ECamFocused") ); + + + if( iConfigManager && iConfigManager->IsAutoFocusSupported() && + !iCaptureRequested && appUi && appUi->SelfTimer() && + !appUi->SelfTimer()->IsActive()) + { + PlaySound( ECamAutoFocusComplete, EFalse ); + } + SetOperation( ECamFocused ); + } + else if( aEventId==ECamCameraEventAutofocusFailed ) + { + PRINT( _L("ECamCameraEventAutofocusFailed -> Set operation state to ECamFocusFailed") ); + if ( iConfigManager && iConfigManager->IsAutoFocusSupported() ) + { + PlaySound( ECamAutoFocusFailed, EFalse ); + } + SetOperation( ECamFocusFailed ); + } + iPendingAFRequest=0; + iCurrentAFRequest=0; + } + else if( iCurrentAFRequest != iPendingAFRequest && iPendingAFRequest !=0 + && !CurrentSceneHasForcedFocus() + ) + { + iCurrentAFRequest=iPendingAFRequest; + iPendingAFRequest=0; + TryAFRequest( iCurrentAFRequest ); + } + else if( CurrentSceneHasForcedFocus() ) + { + // Autofocus flags has to be reset in forced focus cases + iPendingAFRequest=0; + iCurrentAFRequest=0; + } + } + break; + // --------------------------------- + case ECamCameraEventCancelAutofocus: + { + // Set iAFCancelInProgress to true so that we don't change the + // reticule for the next focus successful/focus failed event. + iAFCancelInProgress = ETrue; + iCurrentAFRequest = ECamRequestCancelAutofocus; + // fixed toolbar is used only with touch devices + if ( !iCaptureRequested && IsTouchScreenSupported() ) + { + appUi->SetToolbarVisibility(); // avoid flickering in settings view + } + } + break; + // ================================= + default: + // No change to state with other events + break; + // ================================= + } + PRINT2( _L("Camera <= CCamAppController::SetStateFromEvent mode[%s] operation[%s]"), + KCamModeNames[iInfo.iMode], + KCamCaptureOperationNames[iInfo.iOperation] ); + } + +void +CCamAppController::InitCaptureLimitL() + { + // Set the capture count now, so we don't need to set it when starting capture. + switch( iInfo.iTargetImageMode ) + { + case ECamImageCaptureBurst: + PRINT1( _L("Camera <> CCamAppController .. burst mode as target, set capture limit to %d"), KShortBurstCount ); + SetCaptureLimitL( KShortBurstCount ); + break; + case ECamImageCaptureTimeLapse: + PRINT1( _L("Camera <> CCamAppController .. timelapse mode as target, set capture limit locally to max %d"), iLongSequenceLimit ); + SetCaptureLimitL( iLongSequenceLimit ); + break; + default: + PRINT( _L("Camera <> CCamAppController .. single mode as target, set capture limit locally to 1") ); + SetCaptureLimitL( 1 ); + break; + } + } + + +// =========================================================================== +// +TCamAppControllerInfo::TCamAppControllerInfo() + : iActiveCamera ( ECamActiveCameraNone ), + iMode ( ECamControllerIdle ), + iTargetMode ( ECamControllerIdle ), + iImageMode ( ECamImageCaptureNone ), + iTargetImageMode ( ECamImageCaptureNone ), + iOperation ( ECamNoOperation ), + iTargetVfState ( ECamTriIdle ), + iViewfinderMirror ( EFalse ), + iTargetImageResolution( 0 ), + iTargetImageQuality ( 0 ), + iBusyRequestId ( ECamRequestNone ) + { + } + + +// =========================================================================== + + +// +// +// +void CCamAppController::HandleFileHarvestingComplete() + { + PRINT( _L("Camera => CCamAppController::HandleFileHarvestingComplete" ) ); + // If release required but not done in postcapture not shown mode this is the + // last time to do it. Otherwise problems occurs in 2ndary camera if opened + if ( iPendingRelease && ECamSettOff == IntegerSettingValue( ECamSettingItemShowCapturedPhoto ) ) + { + PRINT( _L("Camera <> CCamAppController::HandleFileHarvestingComplete, releasing" ) ); + ReleaseCamera(); + } + PRINT( _L("Camera <= CCamAppController::HandleFileHarvestingComplete" ) ); + } + + +// +//CCamAppController::DeRegisterHarverterClientEvents +// +void CCamAppController::DeRegisterHarverterClientEvents() + { + if ( iImageSaveActive ) + { +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + iImageSaveActive->DeRegisterHarverterClientEvents(); +#endif //defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + } + } + + +// --------------------------------------------------------------------------- +// CCamAppController::Configuration +// +// --------------------------------------------------------------------------- +// +CCamConfiguration* +CCamAppController::Configuration() const + { + return iConfiguration; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::RestoreSettingsToCameraL +// Calls RestoreSettingIfNecessaryL for all supported camera settings. +// In case there were settings needing restoring, and camera controller +// is not busy, request camera controller to start setting changes. +// --------------------------------------------------------------------------- +// +void +CCamAppController::RestoreSettingsToCameraL() + { + PRINT( _L("Camera => CCamAppController::RestoreSettingsToCameraL" ) ); + const TCamCameraMode mode = CurrentMode(); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( IsAppUiAvailable() && appUi->CurrentViewState()==ECamViewStateUserSceneSetup ) + { + //restore user scence setting + DirectRestoreSettingIfNecessaryL( ECamSettingItemUserSceneWhitebalance ); + DirectRestoreSettingIfNecessaryL( ECamSettingItemUserSceneExposure ); + DirectRestoreSettingIfNecessaryL( ECamSettingItemUserSceneFlash ); + if ( UiConfigManagerPtr()->IsColorToneFeatureSupported() ) + DirectRestoreSettingIfNecessaryL( ECamSettingItemUserSceneColourFilter ); + if ( UiConfigManagerPtr()->IsBrightnessSupported() ) + DirectRestoreSettingIfNecessaryL( ECamSettingItemUserSceneBrightness ); + if ( UiConfigManagerPtr()->IsContrastSupported() ) + DirectRestoreSettingIfNecessaryL( ECamSettingItemUserSceneContrast ); + if ( UiConfigManagerPtr()->IsISOSupported() || UiConfigManagerPtr()->IsExtendedLightSensitivitySupported() ) + DirectRestoreSettingIfNecessaryL( ECamSettingItemUserSceneLightSensitivity ); + if ( ECamControllerImage == mode ) + { + if ( UiConfigManagerPtr()->IsSharpnessFeatureSupported() ) + DirectRestoreSettingIfNecessaryL( ECamSettingItemUserSceneImageSharpness ); + DirectRestoreSettingIfNecessaryL( ECamSettingItemPhotoDigitalZoom ); + } + else if ( ECamControllerVideo == mode ) + { + DirectRestoreSettingIfNecessaryL( ECamSettingItemVideoDigitalZoom ); + DirectRestoreSettingIfNecessaryL( ECamSettingItemVideoStab); + } + } + else if(iInfo.iActiveCamera == ECamActiveCameraPrimary) + { + if ( ECamControllerImage == mode ) + { + // Add rest of the pending settings where needed + RestoreSettingIfNecessaryL( ECamSettingItemDynamicPhotoWhiteBalance ); + RestoreSettingIfNecessaryL( ECamSettingItemDynamicPhotoExposure ); + + if ( UiConfigManagerPtr()->IsColorToneFeatureSupported() ) + RestoreSettingIfNecessaryL( ECamSettingItemDynamicPhotoColourFilter ); + + if ( UiConfigManagerPtr()->IsBrightnessSupported() ) + RestoreSettingIfNecessaryL( ECamSettingItemDynamicPhotoBrightness ); + + if ( UiConfigManagerPtr()->IsContrastSupported() ) + RestoreSettingIfNecessaryL( ECamSettingItemDynamicPhotoContrast ); + + if ( UiConfigManagerPtr()->IsSharpnessFeatureSupported() ) + RestoreSettingIfNecessaryL( ECamSettingItemDynamicPhotoImageSharpness ); + + if ( UiConfigManagerPtr()->IsISOSupported() || UiConfigManagerPtr()->IsExtendedLightSensitivitySupported() ) + { + RestoreSettingIfNecessaryL( ECamSettingItemDynamicPhotoLightSensitivity ); + } + + RestoreSettingIfNecessaryL( ECamSettingItemDynamicPhotoFlash ); + + RestoreSettingIfNecessaryL( ECamSettingItemPhotoDigitalZoom ); + } + else if ( ECamControllerVideo == mode ) + { + // Video settings in the toolbar + RestoreSettingIfNecessaryL( ECamSettingItemDynamicVideoWhiteBalance ); + RestoreSettingIfNecessaryL( ECamSettingItemDynamicVideoExposure ); + + if ( UiConfigManagerPtr()->IsColorToneFeatureSupported() ) + RestoreSettingIfNecessaryL( ECamSettingItemDynamicVideoColourFilter ); + + // The following settings are not supported in video mode toolbar + // However, the values may need to be reset, in case the setting was + // changed in image mode + if ( UiConfigManagerPtr()->IsBrightnessSupported() ) + RestoreSettingIfNecessaryL( ECamSettingItemDynamicVideoBrightness ); + + if ( UiConfigManagerPtr()->IsContrastSupported() ) + RestoreSettingIfNecessaryL( ECamSettingItemDynamicVideoContrast ); + + if ( UiConfigManagerPtr()->IsVideoStabilizationSupported() ) + { + RestoreSettingIfNecessaryL( ECamSettingItemVideoStab ); + } + RestoreSettingIfNecessaryL( ECamSettingItemVideoDigitalZoom ); + + RestoreSettingIfNecessaryL( ECamSettingItemDynamicVideoFlash ); + + RestoreSettingIfNecessaryL( ECamSettingItemContinuousAutofocus ); + } + } + else if(iInfo.iActiveCamera == ECamActiveCameraSecondary) + { + if ( ECamControllerImage == mode ) + { + // Not needed + } + else if ( ECamControllerVideo == mode ) + { + // Not needed + } + } + else + { + // Do nothing + } + + if( iSettingProvider->PendingSettingChangeCount() > 0 && + !iCameraController->ControllerInfo().iBusy ) + { + PRINT( _L("Camera <> CCamAppController::RestoreSettingsToCameraL - Issue settings change request") ); + IssueSettingsChangeRequestL( ); + } + + PRINT( _L("Camera <= CCamAppController::RestoreSettingsToCameraL" ) ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::RestoreSettingIfNecessaryL +// Checks from camera controller, whether the value of the setting given +// as argument has same value in camera hw and settings model (UI). +// If value is not the same, add the setting id to settingsmodel's list +// of pending changes. +// --------------------------------------------------------------------------- +// +void +CCamAppController::RestoreSettingIfNecessaryL( TCamSettingItemIds aSettingItem ) + { + // Convert UI setting ID to camera controller setting ID + TCamCameraSettingId camSettingId = + CCamSettingConversion::Map2CameraControllerSettingId( aSettingItem ); + + if( !iCameraController->SettingValueUpToDateL( camSettingId ) ) + { + PRINT1( _L("RestoreSettingIfNecessaryL - Restoring value for setting %s"), KCamSettingItemNames[aSettingItem] ); + iSettingProvider->AddPendingSettingChangeL( aSettingItem ); + } + else + { + if( aSettingItem == ECamSettingItemDynamicVideoFlash ) + { + TCamCameraSettingId cameraId( + CCamSettingConversion::Map2CameraControllerSettingId( aSettingItem ) ); + iCameraController->DirectSettingsChangeL( cameraId ); + } + PRINT1( _L("RestoreSettingIfNecessaryL - Setting %s has up-to-date value, no need to restore"), KCamSettingItemNames[aSettingItem] ); + } + } + + +// --------------------------------------------------------------------------- +// CCamAppController::DirectRestoreSettingIfNecessaryL +// Checks if the setting needs restoring (UI setting value doesn't match +// the actual setting value in camera). In that case, function +// directly set settting to camera +// --------------------------------------------------------------------------- +// +void +CCamAppController::DirectRestoreSettingIfNecessaryL( TCamSettingItemIds aSettingItem ) + { + + TCamCameraSettingId cameraId( + CCamSettingConversion::Map2CameraControllerSettingId( aSettingItem ) ); + if ( !iCameraController->SettingValueUpToDateL( cameraId ) ) + { + PRINT1( _L("RestoreSettingIfNecessaryL - Restoring value for setting %s"), KCamSettingItemNames[aSettingItem] ); + iCameraController->DirectSettingsChangeL( cameraId ); + } + } +// ----------------------------------------------------------------------------- +// CCamAppController::RestartTimeLapseTimerL() +// +// ----------------------------------------------------------------------------- +// +void CCamAppController::RestartTimeLapseTimerL() + { + PRINT( _L("Camera => CCamAppController::RestartTimeLapseTimerL inside this function" )) + if ( iTimeLapseTimer ) + { + iTimeLapseTimer->Cancel(); + iTimeLapseTimer->SetTimeout( KSecondInMicSec ); + } + else + { + iTimeLapseTimer = CCamTimer::NewL( KSecondInMicSec, TCallBack( CCamAppController::TimeLapseTimeoutL, this ) ); + } + + NotifyControllerObservers( ECamEventCounterUpdated ); + PRINT( _L("Camera <> CCamAppController::RestartTimeLapseTimerL starting timelapse timer" )); + + iTimeLapseStartTime.HomeTime(); + iTimeLapseTimer->StartTimer(); + + // Following trace may be useful to see timing related handling in TimeLapse mode + // TDateTime stTime = iTimeLapseStartTime.DateTime(); + // PRINT3( _L("Start time: %d:%d:%d"), stTime.Minute(), stTime.Second(), stTime.MicroSecond() ); + + PRINT( _L("Camera <= CCamAppController::RestartTimeLapseTimerL" )) + } + + +// --------------------------------------------------------------------------- +// SetSettingsRestoreNeeded +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetSettingsRestoreNeeded() + { + iSettingsRestoreNeeded = ETrue; + } + +// --------------------------------------------------------------------------- +// IsSettingsRestoreNeeded +// --------------------------------------------------------------------------- +// +TBool +CCamAppController::IsSettingsRestoreNeeded() const + { + return iSettingsRestoreNeeded; + } + +// --------------------------------------------------------------------------- +// StaticSettingsModel +// +// Gets the handle to the settings model, which is used inturn by the +// plugin to call the interfaces for performing needed actions. +// --------------------------------------------------------------------------- +// +TBool +CCamAppController::IsSceneSupported( const TInt aSceneId, TBool aPhotoScene ) const + { + if ( aPhotoScene ) + return static_cast(iSettingsModel)->IsImageSceneSupported( aSceneId ); + else + return static_cast(iSettingsModel)->IsVideoSceneSupported( aSceneId ); + } + +// --------------------------------------------------------------------------- +// StaticSettingsModel +// +// Gets the handle to the settings model, which is used inturn by the +// plugin to call the interfaces for performing needed actions. +// --------------------------------------------------------------------------- +// +MCamStaticSettings& +CCamAppController::StaticSettingsModel() + { + return static_cast(iSettingsModel)->StaticSettingsModel(); + } + + +// --------------------------------------------------------------------------- +// EngineRequestsPending +// --------------------------------------------------------------------------- +// +TBool CCamAppController::EngineRequestsPending() const + { + return IsFlagOn( iBusyFlags, EBusyRequest ); + } + +// --------------------------------------------------------------------------- +// CalculateVideoTimeRemainingL +// +// --------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds +CCamAppController::CalculateVideoTimeRemainingL(const TCamMediaStorage aStorage) + { + RFs& fs = CEikonEnv::Static()->FsSession(); + TInt drive = 0; + if(aStorage == ECamMediaStorageCurrent) + { + const TDesC& filename = CurrentVideoFileName(); + TParse fp; + User::LeaveIfError(fs.Parse(filename, fp)); + TPtrC driveletter = fp.Drive(); + TChar drl = driveletter[0]; + User::LeaveIfError(fs.CharToDrive(drl, drive)); + } + else + { + DriveInfo::TDefaultDrives driveInfo = static_cast(KErrNotFound); + switch(aStorage) + { + case ECamMediaStoragePhone: + driveInfo = DriveInfo::EDefaultPhoneMemory; + break; + case ECamMediaStorageCard: + driveInfo = DriveInfo::EDefaultRemovableMassStorage; + break; + case ECamMediaStorageMassStorage: + driveInfo = DriveInfo::EDefaultMassStorage; + break; + default: + break; + } + User::LeaveIfError(DriveInfo::GetDefaultDrive( driveInfo, drive )); + } + + // Get critical level for this drive type + TDriveInfo driveInfo; + fs.Drive(driveInfo, drive); + + TInt criticalDiskVal = 0; + if( driveInfo.iType == EMediaRam ) //RAM drives have diff critical levels + { + CRepository* repository = CRepository::NewLC( KCRUidDiskLevel ); + User::LeaveIfError( + repository->Get( KRamDiskCriticalLevel, criticalDiskVal ) ); + CleanupStack::PopAndDestroy( repository ); + } + else // Some other media type + { + CRepository* repository = CRepository::NewLC( KCRUidDiskLevel ); + User::LeaveIfError( + repository->Get( KDiskCriticalThreshold, criticalDiskVal ) ); + CleanupStack::PopAndDestroy( repository ); + } + + // Get the available space in volumeinfo.iFree + TVolumeInfo volumeinfo; + User::LeaveIfError(fs.Volume(volumeinfo, drive)); + + // Get the current video quality data + TInt videoQuality = iSettingsModel->IntegerSettingValue( + ECamSettingItemVideoQuality ); + CCamVideoQualityLevel& level = *( iSettingsModel-> + VideoQualityArray() )[videoQuality]; + + // Audio recording on/muted + TInt audioRec = iSettingsModel->IntegerSettingValue( + ECamSettingItemVideoAudioRec ); + TBool audioMute = ECamSettOff == audioRec; + + // Video file size limit (MMS case) + TInt videoLimit = 0; + if( ECamVideoClipShort == level.VideoLength() ) + { + // Short video, needs to fit into MMS message + videoLimit = CamUtility::MaxMmsSizeInBytesL(); + } + + TCamVideoTime videoTime( volumeinfo.iFree, // Free space + criticalDiskVal, // Critical space + //level.VideoFileType(), // Video codec + level.VideoBitRate(), // Video bitrate + //level.AudioType(), // Audio FourCC + level.AudioBitRate(), // Audio bitrate + videoLimit, // File size limit + audioMute, // Mute audio? + iConfiguration->CMRAvgVideoBitRateScaler() ); + + return videoTime.GetRemainingTimeL(); + } + + +// --------------------------------------------------------------------------- +// SetRemainingImageStored +// --------------------------------------------------------------------------- +// +void +CCamAppController::SetRemainingImageStored() + { + iValueIsStored = ETrue; + } +// --------------------------------------------------------------------------- +// IsRemainingImageStored +// --------------------------------------------------------------------------- +// +TBool +CCamAppController::IsRemainingImageStored() const + { + return iValueIsStored; + } + +// --------------------------------------------------------------------------- +// IsSavingInProgress +// --------------------------------------------------------------------------- +// +TBool +CCamAppController::IsSavingInProgress() const + { + return ( iImageSaveActive->Count() > 0 ); + } + +// --------------------------------------------------------------------------- +// CapturedImages +// --------------------------------------------------------------------------- +// + TInt CCamAppController::CapturedImages() const + { + return iCameraController->ControllerInfo().iCaptureCount; + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCamAppController::SetSettingsPlugin( CCamGSInterface* aPlugin ) + { + iPlugin = aPlugin; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetViewfinderWindowHandle +// --------------------------------------------------------------------------- +// +void CCamAppController::SetViewfinderWindowHandle( RWindowBase* aWindow ) + { + __ASSERT_ALWAYS( iCameraController, CamPanic( ECamPanicInvalidState ) ); + + iCameraController->SetViewfinderWindowHandle( aWindow ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::ViewfinderWindowDeleted +// --------------------------------------------------------------------------- +// +void CCamAppController::ViewfinderWindowDeleted( RWindowBase* aWindow ) + { + __ASSERT_ALWAYS( iCameraController, CamPanic( ECamPanicInvalidState ) ); + + iCameraController->ViewfinderWindowDeleted( aWindow ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::ExistMassStorage() +// --------------------------------------------------------------------------- +// +TBool CCamAppController::ExistMassStorage() const + { + const TUint KMassStorageBits = DriveInfo::EDriveInternal | + DriveInfo::EDriveExternallyMountable; + TInt drive; + TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ); + + if ( err != KErrNone ) + { + return EFalse; + } + + TUint driveStatus(0); + err = DriveInfo::GetDriveStatus( CCoeEnv::Static()->FsSession(), + drive, + driveStatus ); + + TInt usbPersonality; + TInt ret = RProperty::Get(KPSUidUsbWatcher, + KUsbWatcherSelectedPersonality, + usbPersonality); + + if ( err != KErrNone ) + { + return EFalse; + } + + if ( (driveStatus & KMassStorageBits) == KMassStorageBits && + !(driveStatus & DriveInfo::EDriveCorrupt) && + ((KErrNone == ret) && (KUsbPersonalityIdMS != usbPersonality) ) ) + { + return ETrue; + } + + return EFalse; + } + + +// ------------------------------------------------------------------------ +// CCamAppController::IsMemoryAvailable() +// ------------------------------------------------------------------------ +// +TBool +CCamAppController::IsMemoryAvailable(const TCamMediaStorage aStorage, TBool aIgnoreUsbPersonality ) const + { + TInt currentStorage = aStorage; + if(aStorage == ECamMediaStorageCurrent) + { + TCamCameraMode mode = CurrentMode(); + + if((ECamControllerImage != mode) && (ECamControllerVideo != mode)) + { + //This is needed for case where current mode is not yet set. + mode = TargetMode(); + } + + if(ECamControllerImage == mode) + { + currentStorage = static_cast( + IntegerSettingValue( + ECamSettingItemPhotoMediaStorage ) ); + } + else if(ECamControllerVideo == mode) + { + currentStorage = static_cast( + IntegerSettingValue( + ECamSettingItemVideoMediaStorage ) ); + } + else + { + //No impl + } + } + + TInt usbPersonality; + TInt ret = RProperty::Get(KPSUidUsbWatcher, + KUsbWatcherSelectedPersonality, + usbPersonality); + if ( !aIgnoreUsbPersonality ) + { + if ( ( currentStorage != ECamMediaStoragePhone ) && ( KErrNone == ret ) && + ( KUsbPersonalityIdMS == usbPersonality ) ) + { + return EFalse; + } + } + + DriveInfo::TDefaultDrives driveInfo = static_cast(KErrNotFound); + switch(currentStorage) + { + case ECamMediaStoragePhone: + driveInfo = DriveInfo::EDefaultPhoneMemory; + break; + case ECamMediaStorageCard: + driveInfo = DriveInfo::EDefaultRemovableMassStorage; + break; + case ECamMediaStorageMassStorage: + driveInfo = DriveInfo::EDefaultMassStorage; + break; + default: + break; + } + + + TInt drive; + TInt err = DriveInfo::GetDefaultDrive( driveInfo, drive ); + if(err) + { + return EFalse; + } + TUint driveStatus(0); + err = DriveInfo::GetDriveStatus( CCoeEnv::Static()->FsSession(), + drive, + driveStatus ); + if(err) + { + return EFalse; + } + + return ( (driveStatus & DriveInfo::EDrivePresent) && + !(driveStatus & DriveInfo::EDriveCorrupt) && + (driveStatus & DriveInfo::EDriveUserVisible) && + !(driveStatus & DriveInfo::EDriveInUse) && + !(driveStatus & DriveInfo::EDriveReadOnly) ); + } + + +// --------------------------------------------------------------------------- +// CCamAppController::IsDemandKeyRelease() +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsDemandKeyRelease() + { + return iDemandKeyRelease; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetDemandKeyRelease() +// --------------------------------------------------------------------------- +// +void CCamAppController::SetDemandKeyRelease( TBool aDemand ) + { + iDemandKeyRelease = aDemand; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::IsKeyLockOn() +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsKeyLockOn() + { + if ( iKeyLockStatusWatcher && iConfigManager && iConfigManager->IsKeyLockWatcherSupported() ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + TInt iKeyLockStatus = 0; + iKeyLockStatusWatcher->Get( iKeyLockStatus ); + if ( iKeyLockStatus == EKeyguardLocked && appUi ) + { + return ETrue; + } + else + { + return EFalse; + } + } + return EFalse; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::DriveChangeL +// --------------------------------------------------------------------------- +// +TInt CCamAppController::DriveChangeL( const TCamDriveChangeType aType ) + { + PRINT1( _L("Camera => CCamAppController::DriveChangeL aType: %d" ), aType ); + + TCamCameraMode mode = CurrentMode(); + TCamMediaStorage currentStorage; + + // Photos and videos are saved onto the same media, so no need to + // differentiate between still/video + currentStorage = static_cast( + IntegerSettingValueUnfiltered( ECamSettingItemPhotoMediaStorage ) ); + + PRINT1( _L("Camera <> iPreferredStorageLocation is now %d"), + iPreferredStorageLocation ); + PRINT1( _L("Camera <> Update iPreferredStorageLocation to %d"), + currentStorage ); + + iPreferredStorageLocation = currentStorage; + + if ( ECamMediaStoragePhone == iPreferredStorageLocation ) + { + PRINT( _L("Camera <> Phone memory is the preferred storage location. Nothing to be done here. Return KErrNone.") ) + PRINT( _L("Camera <= CCamAppController::DriveChangeL" ) ); + return KErrNone; + } + + if ( ( !IsMemoryAvailable( ECamMediaStorageCard, EFalse ) || + !IsMemoryAvailable( ECamMediaStorageMassStorage, EFalse ) ) || + !IsMemoryAvailable( iPreferredStorageLocation, ETrue ) ) + { + PRINT( _L("Camera <> USB personality is 'Mass storage' or iPreferredStorageLocation (MMC or mass memory) is unavailable") ) + + // Stop if recording a video to mass memory or MMC + if ( CurrentVideoOperation() == ECamCapturing || + CurrentVideoOperation() == ECamPaused ) + { + PRINT( _L("Camera <> Video capture in progress...") ) + + if ( !IsMemoryAvailable( iInitialVideoStorageLocation ) ) + { + PRINT( _L("Camera <> ...Stop video recording.") ) + iCaptureStoppedForUsb = ETrue; + StopVideoRecording(); + } + else + { + PRINT( _L("Camera <> ...Phone memory in use. No need to stop.") ) + } + + } + // Cancel if pending recording + else if( iVideoRequested ) + { + iVideoRequested = EFalse; + } + if ( SequenceCaptureInProgress() ) + { + PRINT( _L("Camera <> Sequence capture in progress. -> Stop and skip postcapture.") ) + + iCaptureStoppedForUsb = ETrue; + SoftStopBurstL( ETrue ); + } + // If in the middle of init sequence or saving a file, set the dismount + // pending so that the AllowDismount call will be made later + if( IsFlagOn( iBusyFlags, EBusySequence ) || iSaving ) + { + PRINT( _L("Camera <> CCamAppController::DriveChangeL sequence or saving ongoing" ) ); + + iDismountPending = ETrue; + // Mass memory may be the forced storage location. Then it's necessary + // to switch to (forced) phone memory + ForceUsePhoneMemoryL( ETrue ); + PRINT( _L("Camera <= CCamAppController::DriveChangeL dismount pending" ) ); + return KErrNotReady; + } + else + { + // Mass memory may be the forced storage location. Then it's necessary + // to switch to (forced) phone memory + ForceUsePhoneMemoryL( ETrue ); + + // Make sure toolbar is visible + CCamAppUi* appUi = static_cast( + CEikonEnv::Static()->AppUi() ); + CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar(); + + if ( fixedToolbar && ECamNoOperation == CurrentOperation() ) + { + fixedToolbar->SetToolbarVisibility( ETrue ); + } + + PRINT( _L("Camera <= CCamAppController::DriveChangeL dismount ok" ) ); + return KErrNone; + } + } + else if ( IsMemoryAvailable( iPreferredStorageLocation, ETrue ) && + ( ECamMediaStorageCard == iPreferredStorageLocation || + ECamMediaStorageMassStorage == iPreferredStorageLocation ) ) + { + PRINT( _L("Camera <> iPreferredStorageLocation (MMC or mass memory) is now available.") ) + + // if phone memory forced, then revert back to user selected location + if ( iForceUseOfPhoneMemory ) + { + PRINT( _L("Camera <> Phone memory is forced, switch back to user selected storage location.") ) + ForceUsePhoneMemoryL( EFalse ); + } + else + { + PRINT( _L("Camera <> !IsPhoneMemoryForced() -> No action.") ) + } + } + + PRINT( _L("Camera <= CCamAppController::DriveChangeL" ) ); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CurrentStorage +// --------------------------------------------------------------------------- +// +TCamMediaStorage CCamAppController::CurrentStorage() + { + return iCurrentStorage; + } + +// --------------------------------------------------------------------------- +// CCamAppController::IsAfNeeded +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsAfNeeded() + { + return iAfNeeded; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetAfNeeded +// --------------------------------------------------------------------------- +// +void CCamAppController::SetAfNeeded( TBool aAfNeeded ) + { + iAfNeeded = aAfNeeded; + } + +// --------------------------------------------------------------------------- +// CCamAppController::IsCaptureStoppedForUsb +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsCaptureStoppedForUsb() + { + return iCaptureStoppedForUsb; + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetCaptureStoppedForUsb +// --------------------------------------------------------------------------- +// +void CCamAppController::SetCaptureStoppedForUsb( TBool aCaptureStoppedForUsb ) + { + iCaptureStoppedForUsb = aCaptureStoppedForUsb; + } + +// --------------------------------------------------------------------------- +// CCamAppController::CancelDismountMonitoring +// --------------------------------------------------------------------------- +// +void CCamAppController::CancelDismountMonitoring() + { + if( iDriveChangeNotifier ) + { + iDriveChangeNotifier->CancelMonitoring(); + } + } + + +// --------------------------------------------------------------------------- +// CCamAppController::StartDismountMonitoring +// --------------------------------------------------------------------------- +// +void CCamAppController::StartDismountMonitoring() + { + if( iDriveChangeNotifier ) + { + iDriveChangeNotifier->StartMonitoring(); + } + } + +// --------------------------------------------------------------------------- +// CCamAppController::DeepSleepTimeout +// --------------------------------------------------------------------------- +// +TInt CCamAppController::DeepSleepTimeout( TAny* aPtr ) + { + static_cast( aPtr )->DoDeepSleepTimeout(); + return EFalse; // dummy + } + +// --------------------------------------------------------------------------- +// CCamAppController::DoDeepSleepTimeout +// --------------------------------------------------------------------------- +// +void CCamAppController::DoDeepSleepTimeout() + { + PRINT( _L("Camera => CCamAppController::DoDeepSleepTimeout") ); + + ReleaseCamera(); + iDeepSleepTimerExpired = ETrue; + iDeepSleepTimer->Cancel(); + + PRINT( _L("Camera <= CCamAppController::DoDeepSleepTimeout") ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::DeepSleepTimerStart +// --------------------------------------------------------------------------- +// +void CCamAppController::DeepSleepTimerStart() + { + PRINT( _L("Camera : DeepSleepTimerStart") ); + iDeepSleepTimerExpired = EFalse; + if ( iDeepSleepTimer && !iDeepSleepTimer->IsActive() ) + { + iDeepSleepTimer->StartTimer(); + } + } + +// --------------------------------------------------------------------------- +// CCamAppController::DeepSleepTimerCancel +// --------------------------------------------------------------------------- +// +void CCamAppController::DeepSleepTimerCancel() + { + PRINT( _L("Camera : DeepSleepTimerCancel") ); + if ( iDeepSleepTimer ) + { + iDeepSleepTimer->Cancel(); + } + } + +// --------------------------------------------------------------------------- +// CCamAppController::AllSnapshotsReceived +// --------------------------------------------------------------------------- +// +TBool CCamAppController::AllSnapshotsReceived() + { + PRINT1( _L("Camera <> AllSnapshotsReceived %d"), iAllSnapshotsReceived ); + return iAllSnapshotsReceived; + } + +// --------------------------------------------------------------------------- +// CCamAppController::PendingAFRequest +// --------------------------------------------------------------------------- +// +TInt CCamAppController::PendingAFRequest() + { + return iPendingAFRequest; + } + + + +// CCamAppController::IsTouchScreenSupported +// Return whether the device supports touch screen +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsTouchScreenSupported() + { + return AknLayoutUtils::PenEnabled(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::IsTouchScreenSupported +// Return whether the device supports direct screen viewfinder +// --------------------------------------------------------------------------- +// +TBool CCamAppController::IsDirectScreenVFSupported( TBool aPrimaryCamera ) + { + // test for integration + return iConfigManager->IsDSAViewFinderSupported( aPrimaryCamera ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::UiConfigManagerPtr +// handle to CameraUiConfigManager +// --------------------------------------------------------------------------- +// +CCameraUiConfigManager* CCamAppController::UiConfigManagerPtr() + { + __ASSERT_DEBUG(iConfigManager, CamPanic(ECamPanicNullPointer)); + return iConfigManager; + } + + +// --------------------------------------------------------------------------- +// CCamAppController::SetCameraOrientationModeL +// +// --------------------------------------------------------------------------- +// +void CCamAppController::SetCameraOrientationModeL( TInt aOrientation ) + { + iCameraController->SetOrientationModeL( aOrientation ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::CompleteCameraConstruction +// +// --------------------------------------------------------------------------- +// +void CCamAppController::CompleteCameraConstructionL() + { + PRINT( _L( "Camera => CCamAppController::CompleteCameraConstructionL" ) ); + iCameraController->CompleteSwitchCameraL(); + // start reserve and poweron already here + IssueModeChangeSequenceL( ETrue ); + PRINT( _L( "Camera <= CCamAppController::CompleteCameraConstructionL" ) ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::CurrentImageIndex +// +// --------------------------------------------------------------------------- +// +TInt CCamAppController::CurrentImageIndex() + { + return iCurrentImageIndex; + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamAppController::GenerateStartupSequenceL( RCamRequestArray& aSequence ) + { + PRINT( _L( "Camera => CCamAppController::GenerateStartupSequenceL" ) ); + + //Have to empty autofocusrequest values here because modechange could override + //currently processed autofocus request. + iPendingAFRequest=0; + iCurrentAFRequest=0; + iNoBurstCancel = EFalse; + iKeyUP = EFalse; + + aSequence.Append( ECamRequestReserve ); + aSequence.Append( ECamRequestPowerOn ); + + // ------------------------------------------------------- +#ifdef _DEBUG + PRINT( _L( "Camera <> Generated sequence: " ) ); + for( TInt i = 0; i < aSequence.Count(); i++ ) + { + PRINT2( _L( "Camera <> %d) %s" ), i, KCamRequestNames[aSequence[i]] ); + } +#endif + PRINT( _L( "Camera <= CCamAppController::GenerateStartupSequenceL" ) ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::RotateSnapshotL +// Copy and rotate snapshot bitmap before it is used to +// create a thumbnail +// --------------------------------------------------------------------------- +// +void CCamAppController::RotateSnapshotL() + { + PRINT( _L( "Camera => CCamAppController::RotateSnapshotL" ) ); + // empty the array + if( iRotationArray->Count() > 0 ) + { + iRotationArray->Reset(); + } + // copy snapshot to preserve the original snapshot bitmap + // first get the handle for the original snapshot bitmap + CFbsBitmap* snapshot = new (ELeave)CFbsBitmap(); + CleanupStack::PushL( snapshot ); + snapshot->Duplicate( BurstCaptureArray()->Snapshot( iCurrentImageIndex )->Handle() ); + //create a new bitmap with the same dimensions as the original snapshot + iRotatedSnapshot = new (ELeave)CFbsBitmap(); + iRotatedSnapshot->Create( snapshot->SizeInPixels(), snapshot->DisplayMode() ); + TRect tmpRect( TPoint( 0, 0 ), snapshot->SizeInPixels() ); + TInt tmpLen = tmpRect.Width() * tmpRect.Height() * 4; + //copy the snapshot data + iRotatedSnapshot->BeginDataAccess(); + snapshot->BeginDataAccess(); + Mem::Copy( iRotatedSnapshot->DataAddress(), snapshot->DataAddress(), tmpLen ); + iRotatedSnapshot->EndDataAccess(); + snapshot->EndDataAccess(); + // copy the filename + iRotationArray->SetNextNameL( BurstCaptureArray()->FileName( iCurrentImageIndex ), BurstCaptureArray()->ImageName( iCurrentImageIndex )); + // rotate the copied snapshot + if ( !iRotatorAo ) + { + iRotatorAo = CCamSyncRotatorAo::NewL( *this ); + } + iRotatorAo->RotateL( iRotatedSnapshot, MapCamOrientation2RotationAngle( iCaptureOrientation ) ); + + CleanupStack::Pop( snapshot ); + PRINT( _L( "Camera <= CCamAppController::RotateSnapshotL" ) ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::RotationCompleteL +// Notification of bitmap rotation complete events +// --------------------------------------------------------------------------- +// +void CCamAppController::RotationCompleteL( TInt aErr ) + { + PRINT1( _L( "Camera => CCamAppController::RotationCompleteL aErr:%d" ), aErr ); + // rotation completed, use the rotated bitmap to create a thumbnail + // in case of error, don't use the snapshot, thumbnail is created from + // the imagefile instead + if ( !aErr ) + { + iRotationArray->ReplaceSnapshot( iRotatedSnapshot, 0 ); + } + TRAP_IGNORE( iImageSaveActive->CreateThumbnailsL( *iRotationArray ) ); + + PRINT( _L( "Camera <= CCamAppController::RotationCompleteL" ) ); + } + +// --------------------------------------------------------------------------- +// CCamAppController::StoreFaceTrackingValue +// Calls CamSettingModel to save user defined FT setting +// --------------------------------------------------------------------------- +// +void CCamAppController::StoreFaceTrackingValue() + { + iSettingsModel->StoreFaceTrackingValue(); + } + +// --------------------------------------------------------------------------- +// CCamAppController::SetVideoInitNeeded +// Sets the value defining the need for CAE video init and prepare +// --------------------------------------------------------------------------- +// +void CCamAppController::SetVideoInitNeeded( TBool aVideoInitNeeded ) + { + iVideoInitNeeded = aVideoInitNeeded; + } + +// --------------------------------------------------------------------------- +// CCamAppController::VideoInitNeeded +// Returns the value defining the need for CAE video init and prepare +// --------------------------------------------------------------------------- +// +TBool CCamAppController::VideoInitNeeded() + { + return iVideoInitNeeded; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamApplicationPane.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamApplicationPane.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,251 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Control for containing the NaviPane +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +*/ + + +// INCLUDE FILES +#include +#include // For CEikApplication +#include +#include +#include +#include +#include // StringLoader +#include +#include // TResourceReader +#include +#include +#include +#include "CamApplicationPane.h" +#include "CamNaviCounter.h" +#include "CamNaviProgressBar.h" +#include "CamAppUi.h" +#include "CamUtility.h" + +#include +#include + +#include "CamLogger.h" + +#include "AknsBasicBackgroundControlContext.h" + + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------- +// CCamApplicationPane::NewL +// Factory construction function +// --------------------------------------------------------- +// +CCamApplicationPane* CCamApplicationPane::NewL( CCamAppController& aController ) + { + CCamApplicationPane* self = new( ELeave ) CCamApplicationPane( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// Destructor +CCamApplicationPane::~CCamApplicationPane() + { + PRINT( _L("Camera => ~CCamApplicationPane") ); + iNaviCounter = NULL; // Not owned + iNaviProgressBar = NULL; // Not owned + PRINT( _L("Camera <= ~CCamApplicationPane") ); + } + + +// --------------------------------------------------------- +// CCamApplicationPane::CCamApplicationPane +// C++ constructor +// --------------------------------------------------------- +// +CCamApplicationPane::CCamApplicationPane( CCamAppController& aController ) : iController( aController ) + { + } + +// --------------------------------------------------------- +// CCamApplicationPane::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamApplicationPane::ConstructL() + { + iAppPaneLayoutRect.LayoutRect( Rect(), ROID(R_CAM_APPLICATION_PANE_RECT_ID)); + SetRect( iAppPaneLayoutRect.Rect() ); + + iPaneInUse = EAppPaneUndefined; + } + +// --------------------------------------------------------- +// CCamApplicationPane::SizeChanged +// Called by framework when the view size is changed +// --------------------------------------------------------- +// +void CCamApplicationPane::SizeChanged() + { + } + +// --------------------------------------------------------- +// CCamApplicationPane::Draw +// Draw the control +// --------------------------------------------------------- +// +void CCamApplicationPane::Draw( const TRect& /* aRect */ ) const + { + } + + +// --------------------------------------------------------- +// CCamApplicationPane::CountComponentControls +// Returns the number of component controls to display +// --------------------------------------------------------- +// +TInt CCamApplicationPane::CountComponentControls() const + { + // If an active Navi Pane is defined, this is one control to show + if ( iPaneInUse != EAppPaneUndefined ) + return 1; + else + return 0; + } + +// ---------------------------------------------------- +// CCamApplicationPane::ComponentControl +// Return requested control +// ---------------------------------------------------- +// +CCoeControl* CCamApplicationPane::ComponentControl( TInt /*aIndex*/ ) const + { + CCoeControl* con = NULL; + switch ( iPaneInUse ) + { + case EAppPaneCounter: + { + con = iNaviCounter; + break; + } + + case EAppPaneProgress: + { + con = iNaviProgressBar; + break; + } + + case EAppPaneUndefined: + default: + { + break; + } + } + return con; + } + + + +// ---------------------------------------------------- +// CCamApplicationPane::ShowCounter +// Shows the NaviCounter control in the Application Pane +// ---------------------------------------------------- +// +void CCamApplicationPane::ShowCounter() + { + iPaneInUse = EAppPaneCounter; + iNaviCounter->MakeVisible( ETrue ); + iNaviProgressBar->MakeVisible( EFalse ); + } + + +// ---------------------------------------------------- +// CCamApplicationPane::ShowProgress +// Shows the NaviProgress control in the Application Pane +// ---------------------------------------------------- +// +void CCamApplicationPane::ShowProgress() + { + iPaneInUse = EAppPaneProgress; + iNaviProgressBar->MakeVisible( ETrue ); + iNaviCounter->MakeVisible( EFalse ); + } + + +// ---------------------------------------------------- +// CCamApplicationPane::InitialisePanesL +// Sets the owned panes to a known good state (all invisible) +// ---------------------------------------------------- +// +void CCamApplicationPane::InitialisePanesL() + { + iNaviCounter = static_cast( CEikonEnv::Static()->AppUi() )->NaviCounter(); + iNaviCounter->SetMopParent( this ); + iNaviCounter->SetContainerWindowL( *this ); + iNaviCounter->SetRect( Rect() ); + iNaviCounter->MakeVisible( EFalse ); + + iNaviProgressBar = static_cast( CEikonEnv::Static()->AppUi() )->NaviProgressBar(); + iNaviProgressBar->SetMopParent( this ); + iNaviProgressBar->SetContainerWindowL( *this ); + iNaviProgressBar->SetRect( Rect() ); + iNaviProgressBar->MakeVisible( EFalse ); + + if ( iPaneInUse == EAppPaneCounter ) + { + iNaviCounter->MakeVisible( ETrue ); + } + if ( iPaneInUse == EAppPaneProgress ) + { + iNaviProgressBar->MakeVisible( ETrue ); + } + } + +// ---------------------------------------------------- +// CCamApplicationPane::SetBurstModelL +// Sets the burst model to use if app pane showing burst +// filenames +// ---------------------------------------------------- +// +void CCamApplicationPane::SetBurstModelL( CCamBurstThumbnailGridModel* aModel ) + { + iNaviCounter->SetBurstModelL( aModel ); + } + + +// ---------------------------------------------------- +// CCamApplicationPane::SetCaptureMode +// Sets the capture mode the pane should indicate +// ---------------------------------------------------- +// +void CCamApplicationPane::SetCaptureMode( TCamCameraMode aMode ) + { + TRAP_IGNORE( ignore, iNaviCounter->SetCaptureModeL( aMode ) ); + } + + + +// End of File + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamAppui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamAppui.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,8414 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: App UI class for cameraapp + * +*/ + + +// This needs to be included first, because other include files +// may be variated using these flags. +#include +#include // TResourceReader +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // CAknTitlePane +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef __WINSCW__ +//#include +#endif + +#include +#include + +#include +#include + +#include "CameraappPrivateCRKeys.h" +#include "CamAppUi.h" +#include "CamUtility.h" +#include "CamAppController.h" +#include "CamControllerObservers.h" +#include "CamTimer.h" +#include "CamLogger.h" +#include "CamStillPreCaptureView.h" +#include "CamStillPostCaptureView.h" +#include "CamVideoPreCaptureView.h" +#include "CamVideoPostCaptureView.h" +#include "CamBurstThumbnailView.h" +#include "CamSelfTimer.h" +#include "CamPanic.h" +#include "CamBurstModeObserver.h" +#include "CamStillUserSceneSetupView.h" +#include "CamNaviCounterControl.h" +#include "CamNaviCounterModel.h" +#include "CamNaviProgressBarControl.h" +#include "Cam.hrh" +#include "CamSettings.hrh" +#include "CamProductSpecificSettings.hrh" +#include "CamAppUiBase.h" +#include "CamWaitDialog.h" +#include "CamSidePane.h" +#include "CamZoomPane.h" +#include "CamAppUid.h" +#include +#include "CameraVariant.hrh" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamAppUiTraces.h" +#endif +#include "camactivepalettehandler.h" +#include "CamContainerBase.h" +#include "camuidconstants.h" +#include "CamGSInterface.h" +#include "CamFileCheckAo.h" +#include "CamLocalViewIds.h" +#include "CameraUiConfigManager.h" + +#include "MCamAddToAlbumObserver.h" +#include "CamCollectionManagerAo.h" +#include "glxgallery.hrh" +#include "glxcollectionplugincamera.hrh" +#include "s32mem.h" + + +#include "camflashstatus.h" +#include "CamMemoryMonitor.h" + + + +// =========================================================================== +// Constants + +// Sequence mode related constants that define the amount of pictures taken +// with sequence mode. +const TInt KShortBurstCount = 18; // number of images captured during burst + +// When asked if current memory is full in video mode +// there needs to be at least following amount of recording +// time left or memory is said to be full. +const TTimeIntervalMicroSeconds KMemoryFullVideoRemaining = 1000*1000; + +// This is used to find the window group id for Eikon Server. +// The Eikon Server window group id is later used to ignore all window server +// events saying Eikon Server has gained focus. +_LIT( KEikonServer, "EikonServer" ); + +//const TCamMediaStorage KCamInternalStorage = ECamMediaStoragePhone; + +const TUint KCameraEventInterest = ( ECamCameraEventClassBasicControl + | ECamCameraEventClassImage + | ECamCameraEventClassVideo + | ECamCameraEventClassVfControl + | ECamCameraEventClassSsControl + | ECamCameraEventClassSettings ); + + + +// =========================================================================== +// Member functions + +// ----------------------------------------------------------------------------- +// CCamAppUi::~CCamAppUi +// Destructor +// ----------------------------------------------------------------------------- +// +CCamAppUi::~CCamAppUi() + { + PRINT( _L("Camera => ~CCamAppUi" )) + if ( iMemoryMonitor ) + { + iMemoryMonitor->StopMonitoring(); + delete iMemoryMonitor; + iMemoryMonitor = 0; + } + + iController.SetAppUiAvailable( EFalse ); + + iResourceLoaders.Close(); + +#ifdef CAMERAAPP_DELAYED_POSTCAPTURE_CREATION + if( iPostCapIdle ) + { + iPostCapIdle->Cancel(); + delete iPostCapIdle; + } +#endif + + if ( iFileCheckAo ) + { + iFileCheckAo->Cancel(); + delete iFileCheckAo; + } + + if ( iController.UiConfigManagerPtr()->IsOrientationSensorSupported() && + iSensorIdle ) + { + CancelSensorIdle(); + delete iSensorIdle; + } + +#if !defined(__WINSCW__) + // relinquish capture keys + UnRegisterCaptureKeys(); +#endif + + SaveCaptureMode(); + SaveCourtesyUiState(); + + delete iDecoratedNaviPaneCounter; + delete iDecoratedNaviPaneProgressBar; +#if defined( CAMERAAPP_CAPI_V2_DVF ) + if ( iSelfTimer ) + { + iSelfTimer->RemoveObserver( this ); + } +#endif // CAMERAAPP_CAPI_V2_DVF + delete iSelfTimer; + delete iParentAppName; + delete iTextResolver; + + iController.RemoveControllerObserver( this ); + + // Burst mode observers are not owned, delete only the pointers to them. + iBurstModeObservers.Close(); + + if ( iWaitTimer && iWaitTimer->IsActive() ) + { + iWaitTimer->Cancel(); + } + delete iWaitTimer; + delete iDocHandler; + delete iCamSidePane; + delete iCamZoomPane; + + delete iRepository; + +/*#ifndef __WINSCW__ + delete iSFIUtils; +#endif*/ + + delete iNaviCounterControl; + delete iNaviProgressBarControl; + delete iNaviCounterModel; + delete iNaviProgressBarModel; + delete iActivePaletteHandler; + iActivePaletteHandler = NULL; + + if( iCourtesyTimer ) + { + iCourtesyTimer->Cancel(); + } + delete iCourtesyTimer; + delete iScreenClearer; + delete iVolumeKeyObserver; + + delete iCollectionManager; + iCollectionManager = NULL; + + PRINT( _L("Camera <= ~CCamAppUi" )) + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamAppUi::ConstructL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP2_CCAMAPPUI_CONSTRUCTL, "e_CCamAppUi_ConstructL 1" ); + PRINT( _L("Camera => CCamAppUi::ConstructL") ) + iRotatedKeyEvent = ETrue; + iReturnedFromPlugin = EFalse; + iController.SetAppUiAvailable( ETrue ); + + iLockedQwertyState = E2ndCamUnknown; + iMemoryMonitor = CCamMemoryMonitor::NewL( this, &iController ); + + TInt memError = + iMemoryMonitor->CheckAndRequestMemoryL( iController.UiConfigManagerPtr()->CriticalLevelRamMemory(), + iController.UiConfigManagerPtr()->RequiredRamMemory(), + ETrue ); + + + TInt freeMemory = 0; + HAL::Get( HALData::EMemoryRAMFree, freeMemory ); + if ( memError && freeMemory < iController.UiConfigManagerPtr()->CriticalLevelRamMemoryFocusGained() ) + { + User::Leave( memError ); + } + iUiConstructionComplete = EFalse; + iDSASupported = iController.UiConfigManagerPtr()->IsDSAViewFinderSupported(); + + TBool uiOrientationOverride = iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported(); + + // The embedded views are set after ConstructL completes + // but the value is only of interest if the app is embedded + iEmbeddedViewSet = !IsEmbedded(); + PRINT1( _L("Camera => CCamAppUi::ConstructL iEmbeddedViewSet:%d"), iEmbeddedViewSet ); + + // In embedded case requesting new file without defined resolution + // the 0*0 is interpreted as the default mms size resolution + iRequestedNewFileResolution.SetSize( 0, 0 ); + + // Camera window group id + iMyWgId = iCoeEnv->RootWin().Identifier(); + + // Get the id of Eikon Server window group + iEikonServerWindowGroupId = iCoeEnv->WsSession().FindWindowGroupIdentifier( + 0, + KEikonServer ); + + CApaWindowGroupName::FindByAppUid( + KBtNotifierServerUid, + iCoeEnv->WsSession(), + iBTServerWindowGroupId); + + CApaWindowGroupName::FindByAppUid( + KPhoneAppUid, + iCoeEnv->WsSession(), + iPhoneAppWindowGroupId); + + PRINT( _L("Camera <> create new repository") ); + TInt crValue = 0; + if( !iRepository ) + { + iRepository = CRepository::NewL( KCRUidCameraappSettings ); + } + + // get softkey position + CamUtility::GetPsiInt( ECamPsiSoftKeyPosition, iSoftkeyPosition ); + + iCamOrientation = ReadCurrentDeviceOrientation(); + PRINT1( _L("Camera <> CurrentDeviceOrientation (%d)"), iCamOrientation ) + PERF_EVENT_START_L2( EPerfEventAvkonUIConstruction ); + TInt orientation; + if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() ) + { + PRINT( _L("Camera <> using slider position to set orientation") ); + // Use the current slider position for the required orientation + TInt sliderPosition; + TInt err = RProperty::Get( + CameraPlatPSKeys::KPSCameraPlatUid, + CameraPlatPSKeys::KLensCoverStatus, + sliderPosition ); + + // ToDo this could be removed after PCFW has released new implementation (wk25/2009) + if( err == KErrNotFound ) + { + PRINT( _L("Camera <> using slider position to set orientation") ); + err = RProperty::Get( + NMusResourceApi::KCategoryUid, + NMusResourceApi::KCameraAvailability, + sliderPosition ); + } + PRINT2( _L("Camera <> slider position = %d, error = %d"), + sliderPosition, err ); + + // If there is an error then assume the slider is closed (as long as there is + // more than one camera) + if ( err ) + { + PRINT1( _L("Camera <> Slider status err%d - Check status later"),err ) + iController.SetCameraSwitchRequired( ESwitchToUnknown ); + } + if ( ( ( CCamAppController::CamerasAvailable() > 1 && + sliderPosition == CameraPlatPSKeys::EClosed ) || + err != KErrNone ) && !IsQwerty2ndCamera( ETrue ) ) + { + PRINT( _L("Camera <> setting orientation for secondary camera") ) + CamUtility::GetPsiInt( ECamPsiSecondaryCameraOrientation, orientation ); + } + else + { + PRINT( _L("Camera <> setting orientation for primary camera") ) + CamUtility::GetPsiInt( ECamPsiPrimaryCameraOrientation, orientation ); + } + } + else + { + // Without lens cover support, always start to primary camera + CamUtility::GetPsiInt( ECamPsiPrimaryCameraOrientation, orientation ); + } + + // Finish engine construction + if( uiOrientationOverride ) + { + iController.CompleteConstructionL(); + } + + if ( orientation == ( TInt ) EAppUiOrientationLandscape ) + { + PRINT( _L("Camera <> orientation is landscape ") ) + iCamOrientation = (ECamHandLeft == iSoftkeyPosition ) + ? ECamOrientationCamcorderLeft + : ECamOrientationCamcorder; + if( uiOrientationOverride ) + { + //set orientation to CCamera + iController.SetCameraOrientationModeL( CFbsBitGc::EGraphicsOrientationRotated90 ); + // and complete the cameracontroller construction + iController.CompleteCameraConstructionL(); + } + PRINT( _L("Camera <> Calling BaseConstructL") ) + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPUI_CONSTRUCTL, "e_CAM_APP_BASE_CONSTRUCT 1" ); //CCORAPP_APP_BASE_CONSTRUCT_START + BaseConstructL( EAppOrientationLandscape | EAknEnableSkin | EAknEnableMSK | + ENonStandardResourceFile | EAknSingleClickCompatible ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMAPPUI_CONSTRUCTL, "e_CAM_APP_BASE_CONSTRUCT 0" ); //CCORAPP_APP_BASE_CONSTRUCT_END + PRINT( _L("Camera <> BaseConstructL Complete") ) + } + else + { + PRINT( _L("Camera <> orientation is portrait") ) + iCamOrientation = ECamOrientationPortrait; + if( uiOrientationOverride ) + { + //set orientation to CCamera + iController.SetCameraOrientationModeL( CFbsBitGc::EGraphicsOrientationRotated270 ); + // and complete the cameracontroller construction + iController.CompleteCameraConstructionL(); + } + PRINT( _L("Camera <> Calling BaseConstructL") ) + OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMAPPUI_CONSTRUCTL, "e_CAM_APP_BASE_CONSTRUCT 1" ); + BaseConstructL( EAppOrientationPortrait | EAknEnableSkin | EAknEnableMSK | + ENonStandardResourceFile ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMAPPUI_CONSTRUCTL, "e_CAM_APP_BASE_CONSTRUCT 0" ); + PRINT( _L("Camera <> BaseConstructL Complete") ) + } + + PERF_EVENT_END_L2( EPerfEventAvkonUIConstruction ); + +#if !defined (__WINSCW__) +#if !( defined(__WINS__) || defined(__WINSCW__) ) + // Ensure that the macro switch keys are always captured by this + // application. + if ( !AppInBackground( EFalse ) ) //camera is constructed in background + { + RegisterCaptureKeysL(); + } +#endif // !defined(__WINS__) || defined(__WINSCW__) +#endif + + if( !uiOrientationOverride ) + { + // Load the settings model static settings + PRINT( _L("Camera <> call CCamAppController::LoadStaticSettingsL..") ) + iController.LoadStaticSettingsL( IsEmbedded() ); + + // Check the screen size if it matches the orientation we expect. + // If not, delay the initialization until HandleScreenDeviceChangedL is called. + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP6_CCAMAPPUI_CONSTRUCTL, "e_ReadUiOrientationFromWindowServer 1" ); + TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels(); + PRINT2( _L("<> CCamAppUi::ConstructL() iCoeEnv->ScreenDevice()->SizeInPixels(): w=%d h=%d"), screenSize.iWidth, screenSize.iHeight ); + TBool expectLandscape = (iCamOrientation != ECamOrientationPortrait); + TBool isLandscape = (screenSize.iWidth > screenSize.iHeight); + if( isLandscape != expectLandscape || AppInBackground( EFalse ) ) //screen is not ready or camera app is in background + { + iEngineConstructionDelayed = ETrue; + } + +OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP7_CCAMAPPUI_CONSTRUCTL, "e_ReadUiOrientationFromWindowServer 0" ); + + // initialise the self timer mode + iInSelfTimerMode = ECamSelfTimerDisabled; + + if ( !iEngineConstructionDelayed ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP8_CCAMAPPUI_CONSTRUCTL, "e_EngineConstructionDelayed 1" ); + iController.CompleteConstructionL(); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP9_CCAMAPPUI_CONSTRUCTL, "e_EngineConstructionDelayed 0" ); + + } + } + else + { + iEngineConstructionDelayed = EFalse; + iInSelfTimerMode = ECamSelfTimerDisabled; + } + + + iEmbeddedObserver = NULL; + + iController.AddControllerObserverL( this ); + iController.AddCameraObserverL( this, KCameraEventInterest ); + + if( !uiOrientationOverride ) + { +/*#ifndef __WINSCW__ + // Initialize SFIUtils + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP10_CCAMAPPUI_CONSTRUCTL, "e_InitSendFileInCall 1" ); + PRINT(_L("iSFIUtils = CSFIUtilsAppInterface::NewL -->")); + TRAPD(errSFI,iSFIUtils = CSFIUtilsAppInterface::NewL()); + PRINT1(_L("iSFIUtils = CSFIUtilsAppInterface::NewL <-- errSFI=%d"),errSFI); + User::LeaveIfError(errSFI); + iSendFileInCall = EFalse; + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP11_CCAMAPPUI_CONSTRUCTL, "e_InitSendFileInCall 0" ); + PRINT( _L("iSendFileInCall = EFalse") ); +#endif*/ + + // Create text resolver for error note text + iTextResolver = CTextResolver::NewL(); + + ConstructPreCaptureViewsL(); + + iSelfTimer = CCamSelfTimer::NewL( iController ); +#if defined( CAMERAAPP_CAPI_V2_DVF ) + iSelfTimer->AddObserverL( this ); +#endif // CAMERAAPP_CAPI_V2_DVF + + PRINT( _L("Camera <> creating navicounter model") ); + iNaviCounterModel = CCamNaviCounterModel::NewL( iController ); + PRINT( _L("Camera <> append navicounter to resourceloaders") ); + User::LeaveIfError( iResourceLoaders.Append(iNaviCounterModel) ); + + PRINT( _L("Camera <> creating progress bar model") ); + iNaviProgressBarModel = CCamNaviProgressBarModel::NewL( iController ); + PRINT( _L("Camera <> append progressbar to resourceloaders") ); + User::LeaveIfError(iResourceLoaders.Append(iNaviProgressBarModel)); + + ConstructNaviPaneL(); + } + + + iRepository->Get( KCamCrAlwaysDrawCourtesyUi, crValue ); + iAlwaysDrawPreCaptureCourtesyUI = (crValue == KCamCrAlwaysDrawCourtesyUiIsOn); + + iCoeEnv->RootWin().EnableScreenChangeEvents(); + + + if( uiOrientationOverride ) + { + // always start in still mode + iMode = ECamControllerImage; + iTargetMode = ECamControllerImage; + } + else + { + // If the view launch needs to wait until the engine + // is constructed or the embedded launch view is set, the starting + // state will be standby + if ( !IsConstructionComplete() ) + { + iViewState = ECamViewStateStandby; + } + + // Get start up mode from settings. + // If the application is embedded the new view will be set + // when HandleNewFileL is called by the framework + PRINT( _L("Camera <> CCamAppUi::ConstructL set default view") ); + if ( StartupMode() == ECamStillCapture ) + { + iMode = ECamControllerImage; + iTargetMode = ECamControllerImage; + SetDefaultViewL( *iStillCaptureView ); + } + else + { + iMode = ECamControllerVideo; + iTargetMode = ECamControllerVideo; + SetDefaultViewL( *iVideoCaptureView ); + } + + + if( !iEngineConstructionDelayed ) + { + // pre-construct side-pane & zoom pane + // get whether we overlay sidepane over view-finder + TBool overlayViewFinder; + User::LeaveIfError( CamUtility::GetPsiInt( ECamPsiOverLaySidePane, overlayViewFinder ) ); + PRINT( _L("Camera <> CCamAppUi::ConstructL create sidepane") ); + iCamSidePane = CCamSidePane::NewL( iController, overlayViewFinder ); + User::LeaveIfError(iResourceLoaders.Append(iCamSidePane)); + + PRINT( _L("Camera <> CCamAppUi::ConstructL create zoom pane") ); + iCamZoomPane = CCamZoomPane::NewL( iController, overlayViewFinder ); + User::LeaveIfError(iResourceLoaders.Append(iCamZoomPane)); + } + } + // create the timer used for callbacks + iWaitTimer = CPeriodic::NewL( CActive::EPriorityHigh ); + + + // initialise the view construction states + iPostCaptureViewsConstructed = EFalse; + iUserSceneSetupViewConstructed = EFalse; + iCustomiseToolbarViewConstructed = EFalse; + + if( !uiOrientationOverride ) + { + PRINT( _L("Camera => CCamAppUi::ConstructL create doc handler") ); + iDocHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() ); + iController.CheckMemoryToUseL(); + + // create navi-pane and navi-porgress bar for use in camcorder mode + PRINT( _L("Camera => CCamAppUi::ConstructL create navicounter control") ); + iNaviCounterControl = CCamNaviCounterControl::NewL( *iNaviCounterModel ); + iNaviCounterControl->SetExtentToWholeScreen(); + + PRINT( _L("Camera => CCamAppUi::ConstructL create progress bar control") ); + iNaviProgressBarControl = CCamNaviProgressBarControl::NewL( *iNaviProgressBarModel ); + + // get max num of images for burst capture + CamUtility::GetPsiInt( ECamPsiMaxBurstCapture, iMaxBurstCaptureNum ); + + PRINT( _L("Camera => CCamAppUi::ConstructL create AP handler") ); + iActivePaletteHandler = CCamActivePaletteHandler::NewL( iController, EFalse ); + } + + iDrawPreCaptureCourtesyUI = ETrue; + iDrawPostCaptureCourtesyUI = ETrue; + iAlwaysDrawPostCaptureCourtesyUI = ETrue; + iLeftSoftKeyPressed = EFalse; + if( !uiOrientationOverride ) + { + // get coutesy UI timeout + TInt timeoutValue; + CamUtility::GetPsiInt( ECamPsiCourtesyUiTimeoutValue, timeoutValue ); + + iCourtesyTimer = CCamTimer::NewL( timeoutValue * 1000000, + TCallBack( CCamAppUi::CourtesyTimeout, this ) ); + + PRINT( _L("Camera => CCamAppUi::ConstructL update navi models") ); + UpdateNaviModelsL(); + PRINT( _L("Camera => CCamAppUi::ConstructL navi counter reload resources") ); + iNaviCounterModel->ReloadResourceDataL(); + PRINT( _L("Camera => CCamAppUi::ConstructL navi progress bar reload resources") ); + iNaviProgressBarModel->ReloadResourceDataL(); + } + + iZoomPaneShown = EFalse; + iFirstBoot = ETrue; // Show zoom + iProcessingScreenRedraw = EFalse; + iSendAsInProgress = EFalse; + + if( !uiOrientationOverride ) + { + iFileCheckAo = CCamFileCheckAo::NewL( iController, *this ); + iCollectionManager = new (ELeave) CCamCollectionManagerAO( *this ); + } + + iCheckOperationInProgress = EFalse; + iLostFocusToNewWindow = EFalse; + iFirstVFStart = ETrue; + + iInternalStorage = iController.ExistMassStorage()?ECamMediaStorageMassStorage:ECamMediaStoragePhone; + + if ( !uiOrientationOverride ) + { + iUiConstructionComplete = ETrue; + } + iMemoryMonitor->StartMonitoring( iController.UiConfigManagerPtr()->CriticalLevelRamMemoryFocusGained(), + iController.UiConfigManagerPtr()->RequiredRamMemoryFocusGained() ); + PRINT( _L("Camera <= CCamAppUi::ConstructL") ) + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP3_CCAMAPPUI_CONSTRUCTL, "e_CCamAppUi_ConstructL 0" ); + } + + + +// ----------------------------------------------------------------------------- +// IsInternalView +// ----------------------------------------------------------------------------- +// +TBool CCamAppUi::IsInternalView( TCamViewState aViewState ) const + { + PRINT1( _L("Camera => CCamAppUi::IsInternalView [%s]"), KCamViewStateNames[aViewState] ); + + TBool internal( EFalse ); + + if ( aViewState < ECamViewStateRangeInternalMax + && aViewState > ECamViewStateRangeInternalMin ) + { + internal = ETrue; + } + else if( aViewState < ECamViewStateRangeExternalMax + && aViewState > ECamViewStateRangeExternalMin ) + { + internal = EFalse; + } + else + { + CamPanic( ECamPanicInvalidView ); + } + + PRINT1( _L("Camera <= CCamAppUi::IsInternalView, return %d"), internal ); + return internal; + } + + + +// ----------------------------------------------------------------------------- +// CCamAppUi::IsConstructionComplete +// Returns whether or not all construction has completed +// ----------------------------------------------------------------------------- +// +TBool CCamAppUi::IsConstructionComplete() const + { + TBool complete = ETrue; + complete = !iEngineConstructionDelayed; + return complete && iEmbeddedViewSet; + } + + +// ----------------------------------------------------------------------------- +// CCamAppUi::NaviCounter +// Returns the pointer to the NaviCounter control +// ----------------------------------------------------------------------------- +// +CCamNaviCounterControl* CCamAppUi::NaviCounterControl() + { + return iNaviCounterControl; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::NaviProgressBar +// Returns the pointer to the NaviProgress control +// ----------------------------------------------------------------------------- +// +CCamNaviProgressBarControl* CCamAppUi::NaviProgressBarControl() + { + return iNaviProgressBarControl; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::NaviCounterModel +// Returns the pointer to the NaviCounter model +// ----------------------------------------------------------------------------- +// +CCamNaviCounterModel* CCamAppUi::NaviCounterModel() + { + return iNaviCounterModel; + } + + +// ----------------------------------------------------------------------------- +// CCamAppUi::CCamAppUi +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamAppUi::CCamAppUi( CCamAppController& aController ) + : iController( aController ), + iViewState( ECamViewStatePreCapture ), + iTargetViewState( ECamViewStatePreCapture ), + iPreventActivePaletteDisplay( EFalse ), + iInternalStorage(ECamMediaStorageNone) + { + } + +// ---------------------------------------------------- +// CCamAppUi::SetTitleL +// Set title pane text from a resource. +// ---------------------------------------------------- +// +void CCamAppUi::SetTitleL( TInt aResourceId ) + { + // Set title + CAknTitlePane* title = static_cast( + StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); + TResourceReader reader; + iCoeEnv->CreateResourceReaderLC( reader, aResourceId ); + title->SetFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // resource reader + } + +// ---------------------------------------------------- +// CCamAppUi::SetTitleL +// Set title pane text from a descriptor. +// ---------------------------------------------------- +// +void CCamAppUi::SetTitleL( const TDesC& aText ) + { + CAknTitlePane* title = static_cast( + StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); + title->SetTextL( aText ); + } + + + +// ---------------------------------------------------- +// CCamAppUi::PushNaviPaneCounterL +// Push navi pane counter on to navi pane stack. +// ---------------------------------------------------- +// +void +CCamAppUi::PushNaviPaneCounterL() + { + iNaviCounterModel->SetCaptureModeL( iMode, iImageMode ); + iDecoratedNaviPaneCounter->MakeScrollButtonVisible( EFalse ); + NaviPaneL()->PushL( *iDecoratedNaviPaneCounter ); + } + +// ---------------------------------------------------- +// CCamAppUi::PushNaviPaneProgressBarL +// Push navi pane progress bar on to navi pane stack. +// ---------------------------------------------------- +// +void CCamAppUi::PushNaviPaneProgressBarL() + { + iDecoratedNaviPaneProgressBar->MakeScrollButtonVisible( EFalse ); + NaviPaneL()->PushL( *iDecoratedNaviPaneProgressBar ); + } + +// ---------------------------------------------------- +// CCamAppUi::PushDefaultNaviPaneL +// Push default navi pane on to navi pane stack. +// ---------------------------------------------------- +// +void CCamAppUi::PushDefaultNaviPaneL() + { + NaviPaneL()->PushDefaultL(); + } + + +// ---------------------------------------------------- +// CCamAppUi::DisplayDeleteNoteL +// Call DisplayDeleteNoteL on the current view +// ---------------------------------------------------- +// +TBool CCamAppUi::DisplayDeleteNoteL() + { + TBool deleted = + static_cast( iView )->DisplayDeleteNoteL(); + + // If the image/video has been deleted, switch view + if ( deleted ) + { + + if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() && IsEmbedded() ) + { + // if in embedded mode, then check the status of the slide + // and set a pending camera switch if the slide has been + // opened/closed after starting the capture + iController.CheckSlideStatus(); + } + + // if this is burst mode and there are still images left, + // return to thumbnail view + if ( ECamImageCaptureBurst == iController.CurrentImageModeSetup() + && 0 < iController.CurrentItemCount() ) + { + iTargetViewState = ECamViewStateBurstThumbnail; + } + // otherwise switch to pre-capture view + else + { + iTargetViewState = ECamViewStatePreCapture; + } + TrySwitchViewL(); + } + else + { + } + return deleted; + } + +// ---------------------------------------------------- +// CCamAppUi::SelfTimerEnableL +// Enable or disable SelfTimer functionality +// ---------------------------------------------------- +// +void CCamAppUi::SelfTimerEnableL( TCamSelfTimerFunctions aState ) + { + // If the requested state is the current state, do nothing. + if ( iInSelfTimerMode == aState ) + { + return; + } + + __ASSERT_DEBUG( iSelfTimer, CamPanic( ECamPanicNullPointer ) ); + + // Update the member variable + iInSelfTimerMode = aState; + + if ( aState != ECamSelfTimerDisabled ) + { + // Set up for current timer mode + iSelfTimer->SetModeL( iMode, iImageMode, iInSelfTimerMode ); + UpdateCba(); + } + else + { + // stop the timer and remove the indicator from the side pane + iSelfTimer->Cancel(); + + // In capture setup mode, toolbar and indicators are not visible + // They will be updated when returning to precap, similarily to + // when setting the self timer mode above + if( iPreCaptureMode != ECamPreCapCaptureSetup ) + { + // Re-show the active palette + iActivePaletteHandler->UpdateActivePaletteL(); + iPreventActivePaletteDisplay = EFalse; + SetActivePaletteVisibility( ETrue ); + + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* toolbar = CurrentFixedToolbar(); + if (toolbar) + { + toolbar->SetToolbarVisibility( ETrue ); + } + } + // Cancel any active focusing operation + // this won't cancel if capture has already been requested + iController.CancelFocusAndCapture(); + + iStillCaptureView->UpdateToolbarIconsL(); + + // Raise precapture UI and restart courtesy UI timer, + // if hide icons is enabled. + RaisePreCaptureCourtesyUI(EFalse); + } + + UpdateCba(); + } + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::SelfTimerEnabled +// Returns current self-timer state +// ----------------------------------------------------------------------------- +// +TBool CCamAppUi::SelfTimerEnabled() const + { + return ( iInSelfTimerMode != ECamSelfTimerDisabled ); + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::SelfTimer +// Returns pointer to self-timer object +// ----------------------------------------------------------------------------- +// +CCamSelfTimer* CCamAppUi::SelfTimer() + { + return iSelfTimer; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::AddBurstModeObserverL +// Register an observer for burst mode changes +// ----------------------------------------------------------------------------- +// +void +CCamAppUi::AddBurstModeObserverL( MCamBurstModeObserver* aBurstModeObserver ) + { + // Check for non-null and only add once. + if( aBurstModeObserver && + KErrNotFound == iBurstModeObservers.Find( aBurstModeObserver ) ) + { + iBurstModeObservers.AppendL( aBurstModeObserver ); + } + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::RemoveBurstModeObserver +// Remove the burst mode observer +// ----------------------------------------------------------------------------- +// +void +CCamAppUi::RemoveBurstModeObserver( const MCamBurstModeObserver* aBurstModeObserver ) + { + if( aBurstModeObserver ) + { + TInt index = iBurstModeObservers.Find( aBurstModeObserver ); + if( KErrNotFound != index ) + { + iBurstModeObservers.Remove( index ); + } + } + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::IsBurstEnabled +// Return burst mode enabled state +// ----------------------------------------------------------------------------- +// +TBool CCamAppUi::IsBurstEnabled() const + { + PRINT_FRQ( _L("Camera => CCamAppUi::IsBurstEnabled" ) ) + TBool ret = EFalse; + if ( ECamImageCaptureBurst == iImageMode + || ECamImageCaptureTimeLapse == iImageMode ) + { + ret = ETrue; + } + + PRINT_FRQ( _L("Camera <= CCamAppUi::IsBurstEnabled" ) ) + return ret; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::CurrentBurstMode +// Return burst mode enabled type +// ----------------------------------------------------------------------------- +// +TCamImageCaptureMode CCamAppUi::CurrentBurstMode() const + { + PRINT_FRQ( _L("Camera => CCamAppUi::CurrentBurstMode" ) ) + TCamImageCaptureMode mode( ECamImageCaptureNone ); + + if ( ECamImageCaptureBurst == iImageMode + || ECamImageCaptureTimeLapse == iImageMode ) + { + mode = iImageMode; + } + + PRINT_FRQ( _L("Camera <= CCamAppUi::CurrentBurstMode" ) ) + return mode; + } + + +// ----------------------------------------------------------------------------- +// CCamAppUi::IsSecondCameraEnabled +// Returns whether or the secondary camera has been activated +// Will return ETrue when when the second camera is active +// ----------------------------------------------------------------------------- +// +TBool CCamAppUi::IsSecondCameraEnabled() const + { + PRINT_FRQ( _L("Camera =><= CCamAppUi::IsSecondCameraEnabled" )) + return iController.ActiveCamera() == ECamActiveCameraSecondary; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::IsQwerty2ndCamera +// ----------------------------------------------------------------------------- +// +TBool CCamAppUi::IsQwerty2ndCamera( TBool aLock ) + { + TBool ret = EFalse; + if ( aLock ) + { + iLockedQwertyState = E2ndCamUnknown; + } + + switch( iLockedQwertyState ) + { + case E2ndCamPortraitForced: + { + ret = EFalse; + break; + } + case E2ndCamLandscapeForced: + { + ret = ETrue; + break; + } + case E2ndCamUnknown: + { + // Get variant setting i.e. initialize + TInt value = 0; + if ( iController.UiConfigManagerPtr() ) + { + value = iController.UiConfigManagerPtr()->IsQwerty2ndCamera(); + + iLockedQwertyState = static_cast(value); + if ( iLockedQwertyState == E2ndCamAuto ) + { + ret = CamUtility::IsQwertyOpen(); + } + else + { + ret = iLockedQwertyState == E2ndCamLandscapeForced; + } + } + break; + } + case E2ndCamAuto: + { + ret = CamUtility::IsQwertyOpen(); + break; + } + default: + break; + } + + if ( aLock ) + { + iLockedQwertyState = ret?E2ndCamLandscapeForced:E2ndCamPortraitForced; + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::IsWaitDialog +// ----------------------------------------------------------------------------- +// +TBool CCamAppUi::IsWaitDialog() const + { + return iWaitDialog != NULL; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::ActiveCamera +// Returns the active camera +// ----------------------------------------------------------------------------- +// +TCamActiveCamera CCamAppUi::ActiveCamera() const + { + return iController.ActiveCamera(); + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::HandleCommandL +// Handle user menu selections +// ----------------------------------------------------------------------------- +// +void CCamAppUi::HandleCommandL( TInt aCommand ) + { + PRINT1( _L("Camera => CCamAppUi::HandleCommandL (%d)"), aCommand ) + switch( aCommand ) + { + // ----------------------------------------------------- + case ECamCmdRaiseCourtesyUI: + { + if ( ECamViewStatePreCapture == iViewState ) + { + RaisePreCaptureCourtesyUI(EFalse); + } + else if ( ECamViewStatePostCapture == iViewState ) + { + // iLeftSoftKeyPressed resembles the Left SoftKey(LSK) + // press when AP tool bar is hidden + + if ( iLeftSoftKeyPressed ) + { + // LSK is pressed, we raise the AP tool bar + RaisePostCaptureCourtesyUI(); + } + else + { + // RSK is pressed, we return back to PreCaptureView + HandleCommandL( EAknSoftkeyBack ); + } + + } + else + { + } + } + break; + + // ----------------------------------------------------- + case ECamCmdSceneSettingList: + { + iTargetViewState = ECamViewStateSceneSettingList; + TrySwitchViewL(); + } + break; + // ----------------------------------------------------- + case ECamCmdGoToStandby: + { + CAknTitlePane* title = static_cast + ( StatusPane()->ControlL( TUid::Uid ( EEikStatusPaneUidTitle ) ) ); + + title->SetTextL( _L("") ); + title->MakeVisible( ETrue ); + title->DrawNow(); + SetActivePaletteVisibility( EFalse ); + + if ( iView + && ( iStillCaptureView == iView || iVideoCaptureView == iView ) ) + { + iProcessingScreenRedraw = ETrue; + static_cast( iView )->Container()->DrawNow(); + iProcessingScreenRedraw = EFalse; + } + + PRINT1( _L("CCamAppUi::HandleCommandL standby %d"), iViewState ); + iTargetViewState = ECamViewStateStandby; + TrySwitchViewL(); + } + break; + // ----------------------------------------------------- + case ECamCmdSwitchToPrecapture: + { + iTargetViewState = ECamViewStatePreCapture; + TrySwitchViewL(); + } + break; + // ----------------------------------------------------- + case ECamCmdNewPhoto: + { + if ( !iController.IsViewFinding() && iController.EngineRequestsPending() ) + { + return; + } + // check if currently preparing return + if ( iController.CaptureModeTransitionInProgress() ) + { + return; + } + #ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT + PERF_EVENT_START_L1( EPerfEventSwitchToStillMode ); + iController.SetPerformanceState( EPerfWaitingForStillMode ); + #endif + + if ( iMode == ECamControllerVideo ) + { + ZoomPane()->ResetZoomTo1x(); + } + + // Hide the active palette before switching so that + // it is not visible until the preview is visible. + + SetActivePaletteVisibility( EFalse ); + if( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && + iVideoCaptureView->Container() ) + { + PRINT( _L("Camera <> CCamAppUi::HandleCommandL calling Draw") ); + iVideoCaptureView->Container()->DrawNow(); + } + // Switch to still pre capture view + iTargetViewState = ECamViewStatePreCapture; + // if coming from video mode then set single capture mode + // otherwise stay with the current capture mode + if ( iMode == ECamControllerVideo ) + { + iTargetMode = ECamControllerImage; + } + TrySwitchViewL(); + + + } + break; + case EEikCmdExit: // fallthrough + case EAknSoftkeyExit: + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP3_CCAMAPPUI_HANDLECOMMANDL, "e_ExternalExit 1" ); + PRINT( _L("Camera CCamAppUi external exit call") ); + if ( iEikonEnv->StartedAsServerApp() ) + { + if ( iEmbeddedObserver ) + { + iEmbeddedObserver->AbortL(); + } + CloseAppL(); + } + else +/*#ifndef __WINS__ + { + if( iSendFileInCall ) + { + // bring phone app to fore ground + BringPhoneAppToForeGroundL(); + } + else + { + // hide task icon immediately so it doesn't show during + // closing which might take a while + HideTaskL( ETrue ); + CloseAppL(); + } + } +#else*/ + { + HideTaskL( ETrue ); + CloseAppL(); + } +//#endif + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP5_CCAMAPPUI_HANDLECOMMANDL, "e_ExternalExit 0" ); + } + break; + // ----------------------------------------------------- + case ECamCmdInternalExit: + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_HANDLECOMMANDL, "e_ECamCmdInternalExit 1" ); + PRINT( _L("Camera <> CCamAppUi::HandleCommandL case ECamCmdInternalExit") ); + #ifdef CAMERAAPP_PERF_LOG_MEMORY + // Manually save the current memory log data. This is needed + // in case the application just goes to background, in which + // case the log data is not saved automatically. + CCamPerformanceLogger::SaveAndReset(); + #endif + + #ifdef CAMERAAPP_PERF_LOG_TRACES + // Shutdown end event cannot be logged to memory logger + // So also log start event only to traces + if( !iController.AlwaysOnSupported() ) + { + PERF_EVENT_START_TRACE( EPerfEventApplicationShutdown ); + } + #endif + PRINT( _L("Camera CCamAppUi::ECamCmdInternalExit") ); + InternalExitL(); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_HANDLECOMMANDL, "e_ECamCmdInternalExit 0" ); + } + break; + // ----------------------------------------------------- + case ECamCmdSlideClosedExit: + { + // The controller tells the AppUi that the app needs to + // do an internal exit because the slider has closed. + // However the view needs to do some processing of this command + // e.g. to ensure that the application leaves standby mode. + // Pass the cammand on to the view. It will come back to + // the AppUi as ECamCmdInternalExit + OstTrace0( TRACE_PERFORMANCE_DETAIL, DUP2_CCAMAPPUI_HANDLECOMMANDL, "e_ECamCmdSlideClosedExit 1" ); + + iLensCoverExit = ETrue; + PRINT( _L("Camera CCamAppUi::ECamCmdSlideClosedExit") ); + if ( iView ) + { + PRINT( _L("Camera CCamAppUi passing ECamCmdSlideClosedExit to iView") ); + iView->HandleCommandL( ECamCmdInternalExit ); + } + else + { + PRINT( _L("Camera CCamAppUi handlingECamCmdSlideClosedExit") ); + HandleCommandL( ECamCmdInternalExit ); + } + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP4_CCAMAPPUI_HANDLECOMMANDL, "e_ECamCmdSlideClosedExit 0" ); + } + break; + // ----------------------------------------------------- + case EAknSoftkeyBack: + { + PRINT( _L("Camera <> CCamAppUi::HandleCommandL case EAknSoftkeyBack") ); + // If in burst mode + if ( iImageMode == ECamImageCaptureBurst ) + { + // If in burst post-capture view, "back" is to the thumbnail grid + if ( iViewState == ECamViewStatePostCapture ) + { + iTargetViewState = ECamViewStateBurstThumbnail ; + } + else // From any other burst view... + { + iTargetViewState = ECamViewStatePreCapture; + } + } + // Switch to pre capture view + else + { + iTargetViewState = ECamViewStatePreCapture; + } + TrySwitchViewL(); + } + break; + // ----------------------------------------------------- + case ECamCmdDelete: + { + // Request that the view displays the delete confirmation note + if(!iController.IsProcessingCapture()) + { + DisplayDeleteNoteL(); + } + else + { + //Do Nothing + } + } + break; + // ----------------------------------------------------- + case ECamCmdNewVideo: + { + // check if currently preparing return + if ( iController.CaptureModeTransitionInProgress() ) + { + return; + } + #ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT + PERF_EVENT_START_L1( EPerfEventSwitchToVideoMode ); + iController.SetPerformanceState( EPerfWaitingForVideoMode ); + #endif + + if ( iMode == ECamControllerImage ) + { + ZoomPane()->ResetZoomTo1x(); + } + + // Hide the active palette before any attempt to switch off burst mode + // otherwise the view switch to video fails when we call GetFocusWindowGroup to + // see which application has the foreground. Use SetSuppressUIRiseOnViewfinderStart + // otherwise the AP is raised automatically when the viewfinder starts. + + SetActivePaletteVisibility( EFalse ); + SetSuppressUIRiseOnViewfinderStart( ETrue ); + // Switch burst mode off before changing to video + if ( IsBurstEnabled() ) + { + SwitchStillCaptureModeL( ECamImageCaptureSingle, EFalse ); + PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdNewVideo completed switch to single")); + } + + // Switch to video pre capture view + iTargetViewState = ECamViewStatePreCapture; + iTargetMode = ECamControllerVideo; + SetSuppressUIRiseOnViewfinderStart( EFalse ); + PRINT( _L("Camera => CCamAppUi::HandleCommandL Try switch to video mode")); + TrySwitchViewL(); + } + break; + // ----------------------------------------------------- + case ECamCmdSelfTimer1: // 10-sec self-timer + { + SelfTimerEnableL( ECamSelfTimerMode1 ); + } + break; + // ----------------------------------------------------- + case ECamCmdSelfTimer2: // 2-sec self-timer + { + SelfTimerEnableL( ECamSelfTimerMode2 ); + } + break; + // ----------------------------------------------------- + case ECamCmdSelfTimer3: // (not supported) + { + SelfTimerEnableL( ECamSelfTimerMode3 ); + } + break; + // ----------------------------------------------------- + case ECamCmdSelfTimerActivate: + { + // Self timed capture happens either from shutter press or + // self timer activate event from softkey press. Shutter + // press case is handled in CCamStillPreCaptureContainer. + if( iController.UiConfigManagerPtr()->IsXenonFlashSupported() && + !iController.CheckFlash() ) + { + // Flash is not ready for taking a picture + return; + } + + // In touch UI we will get two ECamCmdSelfTimerActivate commands + // immediately then the user touches the left softkey to activate + // self-timer. We need to ignore the second one to enable the counter + // to count down properly. + + // only start countdown if there is space to save image + if ( CheckMemoryL() ) + { + if ( iMode != ECamControllerVideo ) + { + InitCaptureCountL(); + } + // Start capture operation NOW + iSelfTimer->StartSelfTimer(); + + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* toolbar = CurrentFixedToolbar(); + if (toolbar) + { + toolbar->SetToolbarVisibility( EFalse ); + } + } + + iPreventActivePaletteDisplay = ETrue; + SetActivePaletteVisibility( EFalse ); + + // Update CBA + UpdateCba(); + } + } + break; + // ----------------------------------------------------- + case ECamCmdSelfTimerCancel: + { + // Called when the user clicks "Cancel" to leave self-timer mode + SelfTimerEnableL( ECamSelfTimerDisabled ); + } + break; + // ----------------------------------------------------- + case ECamCmdSettings: + { + // Turn off the courtesy timer if its active so that the softkeys + // will remain active + if( iCourtesyTimer ) + { + iCourtesyTimer->Cancel(); + } + + iReturnedFromPlugin = EFalse; + iSettingsPluginLaunched = ETrue; + SetActivePaletteVisibility( EFalse ); + CCamViewBase* precapView = NULL; + if ( iView == iStillCaptureView || + iView == iVideoCaptureView ) + { + precapView = static_cast( iView ); + __ASSERT_DEBUG(precapView, CamPanic(ECamPanicNullPointer)); + precapView->BlankSoftkeysL(); + } + iTargetViewState = ECamViewStateSettings; + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* toolbar = CurrentFixedToolbar(); + if ( toolbar ) + { + toolbar->SetToolbarVisibility( EFalse ); + } + } + TrySwitchViewL(); + } + break; + // ----------------------------------------------------- + case ECamCmdSelect: + { + PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSelect")); + if ( iEikonEnv->StartedAsServerApp() ) + { + const TDesC& name( iController.CurrentFullFileName() ); + + PRINT1( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSelect %S"), &name ) + iEmbeddedObserver->FileCompleteL( name ); + iController.EnterShutdownMode( ETrue ); + } +/*#ifndef __WINS__ + else if ( iSendFileInCall ) + { + PRINT( _L("CCamAppUi::HandleCommandL SendMedia file") ) + // handle in-call send interaction + + // Sending of captured media file and to return to call view after sending + BringPhoneAppToForeGroundL(); + DoInCallSendL(); + HideTaskL( ETrue ); // otherwise camera would show in "Active Applications" + iPretendExit = ETrue; // we are basicly in a "pretended exit" state + //BringPhoneAppToForeGroundL(); + } +#endif*/ + else + { + // ACS What do we need to do here? Call internal exit? + // this will exit when any current process completes + iController.EnterShutdownMode( EFalse ); + } + } + break; + // ----------------------------------------------------- + case EAknSoftkeyEmpty: // Must handle this key, but do nothing + break; + // ----------------------------------------------------- + case ECamCmdPhotos: + { + TUid msgUidLastModified(TUid::Uid(KGlxActivationCmdShowLastModified)); + TUid msgUidCameraAlbum(TUid::Uid(KGlxActivationCameraAlbum)); + TApaTaskList apaTaskList( CCoeEnv::Static()->WsSession() ); + TApaTask apaTask = apaTaskList.FindApp( TUid::Uid( KGlxGalleryApplicationUid) ); + + TBuf8<100> buffer; + RDesWriteStream stream( buffer ); + CleanupClosePushL( stream ); + stream.Open( buffer ); + + + if ( ECamViewStatePreCapture == iViewState ) + { + stream << msgUidCameraAlbum; + } + else + { + stream << msgUidLastModified; + } + stream.CommitL(); + + //Hide fixed toolbar before calling to start photos. + if ( iController.IsTouchScreenSupported() && + IsSecondCameraEnabled() && + iViewState == ECamViewStatePreCapture ) + { + CAknToolbar* fixedToolbar = CurrentFixedToolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + //Bitmap mode's VF consumes much of CPU in second camera, stop VF in advance to accelerate switching to photos. + iController.StopViewFinder(); + } + + if ( apaTask.Exists() ) + { + // sending APA task message + apaTask.SendMessage( TUid::Uid( KGlxActivationCmdShowLastModified ), + buffer ); + } + else // Photos Application is not running + { + StartAppCmdLineL( buffer ); + } + CleanupStack::PopAndDestroy( &stream ); + } + break; + // ----------------------------------------------------- + // This should only be available when time lapse is not supported + // so the current mode should be still or multi + case ECamCmdToggleMulti: + { + if ( iImageMode == ECamImageCaptureSingle ) + { + TRAPD( ignore, SwitchStillCaptureModeL( ECamImageCaptureBurst, ETrue ) ); + if ( ignore ) + { + // do nothing + } + } + else if ( iImageMode == ECamImageCaptureBurst ) + { + SwitchStillCaptureModeL( ECamImageCaptureSingle, ETrue ); + } + else + { + // Lint + } + + // Update timelapse interval + iController.SetTimeLapseInterval( 0 ); + + // stop and start the viewfinder in order to update the settings + iController.ExitViewfinderMode( ECamControllerImage ); + iController.EnterViewfinderMode( ECamControllerImage ); + + } + break; + // ----------------------------------------------------- + // Toggle facetracking setting + case ECamCmdToggleFacetracking: + { + if ( iController.UiConfigManagerPtr()->IsFaceTrackingSupported() ) + { + if ( iController.IntegerSettingValue( ECamSettingItemFaceTracking ) == ECamSettOn ) + { + iController.SetIntegerSettingValueL( + ECamSettingItemFaceTracking, + ECamSettOff ); + } + else + { + iController.SetIntegerSettingValueL( + ECamSettingItemFaceTracking, + ECamSettOn ); + } + iController.TryAFRequest( ECamRequestCancelAutofocus ); + } + } + break; + // ----------------------------------------------------- + // Switch to single capture + case ECamCmdSingleCapture: + { + SwitchStillCaptureModeL( ECamImageCaptureSingle, ETrue ); + } + break; + // ----------------------------------------------------- + // Activate burst mode + case ECamCmdSequence: + { + SwitchStillCaptureModeL( ECamImageCaptureBurst, ETrue ); + } + break; + // ----------------------------------------------------- + // Activate time lapse mode + case ECamCmdTimeLapse: + { + SwitchStillCaptureModeL( ECamImageCaptureTimeLapse, ETrue ); + } + break; + // ----------------------------------------------------- + case ECamCmdOpenPhoto: + { + if(iViewState == ECamViewStateBurstThumbnail ) + { + iTargetViewState = ECamViewStatePostCapture; + TrySwitchViewL(); + } + } + break; + // ----------------------------------------------------- + case ECamCmdUserScene: + { + iTargetViewState = ECamViewStateUserSceneSetup; + TrySwitchViewL(); + } + break; + // ----------------------------------------------------- + case ECamCmdPlay: + { + TDataType dataType; + SetEmbedding( ETrue ); + iDocHandler->OpenFileEmbeddedL( iController.CurrentFullFileName(), + dataType ); + } + break; + // ----------------------------------------------------- + case ECamCmdSwitchCamera: + { + PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSwitchCamera" )) + //If modechange sequence going on ignore switching... + if( iController.CaptureModeTransitionInProgress() || + iController.CaptureState() != ECamCaptureOff || + iController.IsSavingInProgress() ) + { + PRINT( _L("Camera <= CCamAppUi::HandleCommandL STOP ECamCmdSwitchCamera" )) + iController.SetCameraSwitchRequired( ESwitchDone ); + break; + } + + // Hide fixed toolbar and softkeys to prevent blinking + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = CurrentFixedToolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + CCamViewBase* precapView = static_cast( iView ); + __ASSERT_DEBUG( precapView, CamPanic( ECamPanicNullPointer )); + if ( precapView ) + { + precapView->ViewCba()->MakeVisible( EFalse ); + } + + PRINT( _L("Camera <> CCamAppUi::HandleCommandL continue ECamCmdSwitchCamera" )) + + if ( ActiveCamera() == ECamActiveCameraPrimary && IsBurstEnabled() ) + { + SwitchStillCaptureModeL( ECamImageCaptureSingle, EFalse ); + } + + TInt primaryOrientation = EAppUiOrientationUnspecified; + TInt secondaryOrientation = EAppUiOrientationUnspecified; + TCamPsiKey orientation = IsQwerty2ndCamera( ETrue )? + ECamPsiPrimaryCameraOrientation: + ECamPsiSecondaryCameraOrientation; + if ( !CamUtility::GetPsiInt( ECamPsiPrimaryCameraOrientation, + primaryOrientation ) && + !CamUtility::GetPsiInt( orientation, + secondaryOrientation ) ) + { + if ( primaryOrientation != secondaryOrientation || IsQwerty2ndCamera() ) + { + if( ( !IsSecondCameraEnabled() || + iController.CameraSwitchQueued() == ESwitchSecondaryOrientation ) && + !IsQwerty2ndCamera() ) + { + PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSwitchCamera 2ndary portrait" )) + iCamOrientation = ECamOrientationPortrait; + SetOrientationL( static_cast( secondaryOrientation ) ); + + if ( iController.IsTouchScreenSupported() ) + { + iStillCaptureView->CreateAndSetToolbarL( R_CAM_STILL_PRECAPTURE_TOOLBAR_PORTRAIT ); + iVideoCaptureView->CreateAndSetToolbarL( R_CAM_VIDEO_PRECAPTURE_TOOLBAR_PORTRAIT ); + } + + StatusPane()->MakeVisible( ETrue ); + } + else + { + PRINT( _L("Camera => CCamAppUi::HandleCommandL ECamCmdSwitchCamera 1ary or 2nd landscape" )) + iCamOrientation = (iSoftkeyPosition == ECamHandLeft) + ? ECamOrientationCamcorderLeft + : ECamOrientationCamcorder; + + SetOrientationL( + static_cast( primaryOrientation ) ); + + if ( iController.IsTouchScreenSupported() ) + { + if ( ( !IsSecondCameraEnabled() || iController.CameraSwitchQueued() == ESwitchSecondaryOrientation ) && + IsQwerty2ndCamera() ) + { + iStillCaptureView->CreateAndSetToolbarL( + R_CAM_STILL_PRECAPTURE_TOOLBAR_LANDSCAPE ); + iVideoCaptureView->CreateAndSetToolbarL( + R_CAM_VIDEO_PRECAPTURE_TOOLBAR_LANDSCAPE ); + } + else + { + iStillCaptureView->CreateAndSetToolbarL( + R_CAM_STILL_PRECAPTURE_TOOLBAR ); + if(iController.UiConfigManagerPtr()->IsXenonFlashSupported()) + { + iVideoCaptureView->CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR); + iVideoCaptureView->UpdateToolbarIconsL(); + } + else + { + iVideoCaptureView->CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR_VIDEOLIGHT); + } + } + } + + StatusPane()->MakeVisible( EFalse ); + } + UpdateNaviModelsL(); + + //Reset zoom when changing cameras + ZoomPane()->ResetZoomTo1x(); + + TInt rl( 0 ); + for ( rl = 0; rl < iResourceLoaders.Count(); rl++ ) + { + iResourceLoaders[rl]->ReloadResourceDataL(); + } + + iCamSidePane->UpdateLayout(); + iTargetViewState = ECamViewStatePreCapture; + delete iScreenClearer; + iScreenClearer = NULL; + iScreenClearer = CAknLocalScreenClearer::NewL( + IsSecondCameraEnabled() || IsQwerty2ndCamera() ); + TrySwitchViewL( ETrue ); + iController.SwitchCameraL(); + } + } + } + break; + // ----------------------------------------------------- + case EAknCmdHelp: + { + LaunchHelpL(); + } + break; + // ----------------------------------------------------- + case ECamCmdRedrawScreen: + { + if( !iProcessingScreenRedraw && iView ) + { + iProcessingScreenRedraw = ETrue; + iView->HandleCommandL(ECamCmdRedrawScreen); + iProcessingScreenRedraw = EFalse; + } + } + break; + // ----------------------------------------------------- + case ECamCmdShootSetup: // fall through + case ECamCmdFlash: // fall through + case ECamCmdAddAudio: // fall through + case ECamCmdEdit: // fall through + case ECamCmdPrint: // fall through + case ECamCmdSendToCallerMultimedia: // fall through + case ECamCmdRenameImage: // fall through + case ECamCmdRenameVideo: // fall through + { + User::Leave( KErrNotSupported ); + } + break; + + // ----------------------------------------------------- + case ECamCmdViewfinderGrid: + { + SelectViewFinderGridSettingL(); + break; + } + + // ----------------------------------------------------- + case EAknCmdTaskSwapper: + /* + * MSK: Active Applications + * This command is actually handled by Avkon FW + * Applications should not handle this + */ + break; + //------------------------------------------------------- + default: + { + PRINT( _L("Camera <> CCamAppUi::HandleCommandL does nothing") ) + } + break; + } + // ----------------------------------------------------- + PRINT( _L("Camera <= CCamAppUi::HandleCommandL") ) + } + +// =========================================================================== +// From MCamCameraObserver + +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// + +void +CCamAppUi::HandleCameraEventL( TInt /*aStatus*/, + TCamCameraEventId aEventId, + TAny* /*aEventData //= NULL */ + ) + { + switch( aEventId ) + { + // ----------------------------------------------------- + case ECamCameraEventVfStart: // ECamEventViewFinderStarted + { + PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL ECamCameraEventVfStart" ) ) + if( iScreenClearer ) + { + delete iScreenClearer; + iScreenClearer = NULL; + } +#ifdef CAMERAAPP_DELAYED_POSTCAPTURE_CREATION + + // Construct postcapture views when idle + // or latest when view switch is requested + StartPostCapIdleL(); +#else + TRAPD( err, ConstructPostCaptureViewsL() ) + if ( KErrNone != err ) + { + TRAP_IGNORE( HandleCameraErrorL( err ) ); + + // if embedded need to notify embeddee + if ( iEikonEnv->StartedAsServerApp() ) + { + iEmbeddedObserver->AbortL(); + } + else + { + CloseAppL(); + } + } +#endif + // Only show the Active Palette once viewfinding has started + iPreventActivePaletteDisplay = EFalse; + + // For forced focus scenes, do one autofocus request once vf starts if needed + if( iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + if( iController.CurrentSceneHasForcedFocus() ) + { + PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL, TryAFRequest( ECamRequestCancelAutofocus )") ); + //Only autofocuscancel will set AFrange which is needed for forced focus cases + iController.TryAFRequest( ECamRequestCancelAutofocus ); + } + else // For scenes with reticule cancel the autofocus, which sets the focus correctly + { + if ( iController.UiConfigManagerPtr()->IsAutofocusSetInHyperfocalAtStartup() ) + { + PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL, TryAFRequest( ECamRequestCancelAutofocus )") ); + iController.TryAFRequest( ECamRequestCancelAutofocus ); + } + else if ( !iFirstVFStart ) + { + iController.TryAFRequest( ECamRequestCancelAutofocus ); + } + } + } + iFirstVFStart = EFalse; + + break; + } + // ----------------------------------------------------- + case ECamCameraEventVideoAsyncStop: // Audio and video streams are stopped + { + PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL ECamCameraEventVideoAsyncStop" ) ) + // Stop View finder if not needed to left run + if ( iController.IntegerSettingValue( ECamSettingItemVideoShowCapturedVideo ) == ECamSettOn ) + { + iController.StopViewFinderEcam(); + } + break; + } + // ----------------------------------------------------- + case ECamCameraEventPowerOnRequested: + { + // event only send if UIOrientationOverride feature is supported, + // in that case UI construction is divided into two parts, call here + // to complete the construction if in first startup + if( iFirstBoot ) + { + PRINT( _L( "Camera <> CCamAppUi::HandleCameraEventL ECamCameraEventPowerOnRequested" ) ) + if ( iWaitTimer->IsActive() ) + { + PRINT( _L( "Camera <> timer already active" ) ) + iWaitTimer->Cancel(); + } + PRINT( _L( "Camera <> start the appui construct timer" ) ) + iWaitTimer->Start( 0, 0, TCallBack( AppUIConstructCallbackL, this ) ); + } + else + { + //load settings in case they were changed via GS + iController.LoadStaticSettingsL( IsEmbedded() ); + // and check the availability of the memory to be used + iController.CheckMemoryToUseL(); + } + break; + } + default: + { + break; + } + + } + + } +// =========================================================================== + +// ----------------------------------------------------------------------------- +// CCamAppUi::HandleControllerEventL +// Handle controller events +// ----------------------------------------------------------------------------- +// +void +CCamAppUi::HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ) + { + PRINT1( _L( "Camera => CCamAppUi::HandleControllerEventL() %d" ), aEvent ); + switch ( aEvent ) + { + // ----------------------------------------------------- + case ECamEventExitRequested: + { + PRINT( _L( "Camera <> case ECamEventExitRequested" ) ) + if ( SettingsLaunchedFromCamera() ) + { + SettingsPluginExitedL( ECameraCompleteExit ); + } + if ( iWaitTimer->IsActive() ) + { + PRINT( _L( "Camera <> timer already active" ) ) + iWaitTimer->Cancel(); + } + PRINT( _L( "Camera <> start the exit timer" ) ) + iWaitTimer->Start( 0, 0, TCallBack( CallExit, this ) ); + break; + } + // ----------------------------------------------------- + case ECamEventOperationStateChanged: + { + PRINT( _L("Camera <> case ECamEventOperationStateChanged") ) + + switch ( iController.CurrentOperation() ) + { + case ECamFocusing: + UpdateCba(); + break; + case ECamCapturing: + iPreventActivePaletteDisplay = ETrue; + SetActivePaletteVisibility( EFalse ); + //Image capture has started. If postcaptureview is enabled assume that postcapture + //is next view. Thus if camera goes to background and comes back to foreground don't + //start viewfinder because it is not needed in postcapture view. If image capture fails + //or is canceled enabling viewfinder is possible. + if ( iView && ( iStillCaptureView == iView || iVideoCaptureView == iView ) + && ShowPostCaptureView() ) + { + SetAssumePostCaptureView( ETrue ); + } + break; + case ECamStandby: + //DismissMemoryNote(); + HandleStandbyEventL( aError ); + break; + case ECamNoOperation: + { + if( iPreventActivePaletteDisplay ) + { + iPreventActivePaletteDisplay = EFalse; + } + } + break; + default: + break; + } + break; + } + // ----------------------------------------------------- + case ECamEventRecordComplete: + { + PRINT( _L("Camera <> case ECamEventRecordComplete") ) + // Dismiss the saving video clip wait dialog + if ( iWaitDialog ) + { + iWaitDialog->ProcessFinishedL(); + //iWaitDialog = NULL; //ProcessFinishedL() will make iWaitDialog NULL asynchronously + } + + // switch on active palette recording is complete + if( ECamOrientationCamcorder == iCamOrientation + || ECamOrientationCamcorderLeft == iCamOrientation + || ECamOrientationPortrait == iCamOrientation ) + { + iPreventActivePaletteDisplay = EFalse; + if ( DrawPreCaptureCourtesyUI() ) + { + SetActivePaletteVisibility( ETrue ); + } + } + if ( iController.InCallOrRinging() && + iController.IntegerSettingValue( ECamSettingItemVideoShowCapturedVideo ) == ECamSettOn ) + { + // when video recording is stopped by incoming call + // and post capture view is turned on, post capture timer + // should only start after some user interaction + iDelayVideoPostCaptureTimeout = ETrue; + } + } //lint -fallthrough to switch to post capture view + // ----------------------------------------------------- + case ECamEventSnapshotReady: + { + PRINT( _L("Camera <> case ECamEventSnapshotReady") ) + + // If burst mode is active, do nothing until the whole burst completes + if ( IsBurstEnabled() ) + { + // handle error if necessary + HandleCameraErrorL( aError ); + + // Check if there was an error, and there were no successful + // captures. In this case, we will be staying in pre-capture view + // so allow the active palette to be displayed again + if ( aError != KErrNone && + iController.CurrentItemCount() == 0 ) + { + iPreventActivePaletteDisplay = EFalse; + SetActivePaletteVisibility( ETrue ); + } + + break; + } + // if the MMC has been removed while recording video to it, + // don't go to post-capture view + else if ( iMode == ECamControllerVideo + && iController.IntegerSettingValueUnfiltered( ECamSettingItemVideoMediaStorage ) + == ECamMediaStorageCard + && ( aError != KErrNone && aError != KErrDiskFull ) + && CamUtility::MemoryCardStatus() != ECamMemoryCardInserted ) + { + iTargetViewState = ECamViewStatePreCapture; + } + // if USB was connected while MMC or mass storage was used as storage, + // don't go to postcapture + else if ( CamUtility::IsUsbActive() && + ( iController.CurrentStorage() == ECamMediaStorageCard || + iController.CurrentStorage() == ECamMediaStorageMassStorage ) ) + { + iTargetViewState = ECamViewStatePreCapture; + } + else if ( iController.IsCaptureStoppedForUsb() && + ( iController.CurrentStorage() == ECamMediaStorageCard || + iController.CurrentStorage() == ECamMediaStorageMassStorage ) ) + { + PRINT( _L("Camera <> HandleControllerEventL ECamEventSnapshotReady: video stopped for usb" ) ); + iTargetViewState = ECamViewStatePreCapture; + } + // If there was an error (we have no snap), we must stay in pre-capture view + else if ( aError ) + { + iPreventActivePaletteDisplay = EFalse; + SetActivePaletteVisibility( ETrue ); + iController.SetCaptureKeyPressedWhileImageSaving(EFalse); + // To be able to continue viewfinding + iController.FreezeViewFinder( EFalse ); + + iTargetViewState = ECamViewStatePreCapture; + } + // If the user has the show captured image setting turned on. + // switch to post capture view (Except in burst mode) + else if ( ShowPostCaptureView() ) + { + if( iController.CaptureKeyPressedWhileImageSaving() ) + { + PRINT( _L("Camera <> HandleControllerEventL ECamEventSnapshotReady - Capture key pressed while saving ") ) + iController.SetCaptureKeyPressedWhileImageSaving(EFalse); + iTargetViewState = ECamViewStatePreCapture; + SetSuppressUIRiseOnViewfinderStart( ETrue ); + // To be able to continue viewfinding + iController.FreezeViewFinder( EFalse ); + } + else + { + if ( !CamUtility::IsBatteryPowerEmpty() ) + { + if ( iLensCoverExit ) + { + PRINT (_L ("Camera <> set target to precapture if Battery not Empty") ); + iTargetViewState = ECamViewStatePreCapture; + } + else + { + PRINT (_L ("Camera <> set target to postcapture if Battery not Empty") ); + iTargetViewState = ECamViewStatePostCapture; + + //We need to blank the precapture view CBA here to prevent + //blinking when changing back to precapture from postcapture + UpdateCba(); + } + } + } + } + + // Always switch to post capture view if self timer is enabled + else if ( iInSelfTimerMode != ECamSelfTimerDisabled ) + { + iTargetViewState = ECamViewStatePostCapture; + // ensure that the view doesn't switch to precapture view when + // ECamEventCaptureComplete is received + iSelfTimedCapture = ETrue; + } + // Otherwise, + // if not showing captured images go straight to pre capture view + // (Except in burst mode) + else + { + iTargetViewState = ECamViewStatePreCapture; + SetSuppressUIRiseOnViewfinderStart( ETrue ); + } + + // The app is not going to try to switch to post capture view at all + // so the array needs to be released now. + if ( iTargetViewState == ECamViewStatePreCapture ) + { + iController.ReleaseArray(); + } + + // If no view switch is needed make sure the cba is not disabled + // and the self timer is switched off + if ( ViewSwitchRequired() != ECamViewSwitch ) + { + if ( iInSelfTimerMode != ECamSelfTimerDisabled ) + { + SelfTimerEnableL( ECamSelfTimerDisabled ); + } + UpdateCba(); + } + TrySwitchViewL(); + + break; + } + // ----------------------------------------------------- + case ECamEventCaptureComplete: + { + PRINT( _L("Camera <> case ECamEventCaptureComplete") ) + // check if exit is required + if ( iController.CheckExitStatus() ) + { + PRINT( _L("Camera <> calling internal exit after checking exit status") ) + // The exit event is replacing the view switch, + // so release the array now + iController.ReleaseArray(); + InternalExitL(); + return; + } + if( ECamControllerImage == iMode ) + { + switch( iImageMode ) + { + // ----------------------------- + // If burst mode is active, + // only switch view when the whole burst completes + case ECamImageCaptureBurst: + { + // If there are images to show (i.e. user has not cancelled), + // switch to thumbnail view. "Show captured images" setting has no + // effect in burst mode + + if ( iController.CurrentItemCount() != 0 && !iController.IsCaptureStoppedForUsb() ) + { + iTargetViewState = ECamViewStateBurstThumbnail; + + // Normally iPreventActivePaletteDisplay is set to EFalse when + // postcture AP is shown, but in burst case that doesn't + // necessarily happen so do this here. + iPreventActivePaletteDisplay = EFalse; + } + // Otherwise, no images to show. Go straight to pre capture view. + else + { + iTargetViewState = ECamViewStatePreCapture; + // The app is not going to try to switch to post capture view at + // all. So the array needs to be released now. + iController.ReleaseArray(); + iController.StopViewFinder(); + iController.StartViewFinder(); + } + // If no view switch is needed make sure the cba is not disabled + // and the self timer is switched off + if ( ViewSwitchRequired() != ECamViewSwitch ) + { + if ( iInSelfTimerMode != ECamSelfTimerDisabled ) + { + SelfTimerEnableL( ECamSelfTimerDisabled ); + } + UpdateCba(); + } + + TrySwitchViewL(); + break; + } + // ----------------------------- + case ECamImageCaptureTimeLapse: + { + iTargetViewState = ECamViewStatePostCapture; + TrySwitchViewL(); + break; + } + // ----------------------------- + case ECamImageCaptureSingle: + { + PRINT( _L("Camera <> case ECamImageCaptureSingle") ) + if( aError != KErrNone ) + { + PRINT( _L("Camera <> error received") ) + // handle error if necessary + HandleCameraErrorL( aError ); + + iPreventActivePaletteDisplay = EFalse; + SetActivePaletteVisibility( ETrue ); + + if (iCamOrientation == ECamOrientationPortrait) + { + iTargetViewState = ECamViewStatePrePortraitCapture; + } + else + { + iTargetViewState = ECamViewStatePreCapture; + } + TrySwitchViewL(); + } + else + { + PRINT( _L("Camera <> no errors in") ) + if ( !ShowPostCaptureView() && + iInSelfTimerMode == ECamSelfTimerDisabled && + !IsSelfTimedCapture() ) + { + PRINT( _L("Camera <> update cba") ) + UpdateCba(); + if( ActiveCamera() != ECamActiveCameraPrimary ) + { + PRINT( _L("Camera <> release array") ) + iController.ReleaseArray(); + } + iPreventActivePaletteDisplay = EFalse; + SetActivePaletteVisibility( ETrue ); + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = CurrentFixedToolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( ETrue ); + } + } + HandleCommandL( ECamCmdRaiseCourtesyUI ); + if ( IsSecondCameraEnabled() || IsEmbedded() ) + { + //For secondary or embedded camera the viewfinder + //was stopped. Restart it now. + iController.StartViewFinder(); + } + } + else if ( !ShowPostCaptureView() && + iInSelfTimerMode != ECamSelfTimerDisabled ) + { + SelfTimerEnableL( ECamSelfTimerDisabled ); + } + } + break; + } + // ----------------------------- + default: + { + // do nothing + break; + } + // ----------------------------- + } + } + // reset the selftimed capture flag for next capture + PRINT( _L("resetting iSelfTimedCapture") ) + iSelfTimedCapture = EFalse; + break; + } + // ----------------------------- + case ECamEventControllerReady: + { + if ( iView ) + { + if ( iFirstBoot && IsSecondCameraEnabled() + && IsQwerty2ndCamera() + && CurrentViewState() != ECamViewStateStandby ) + { + PRINT( _L("Camera <> Booting directly to the secondary camera") ) + // Main camera settings are loades as default. + // Need to be updated to secondary + iStillCaptureView->CreateAndSetToolbarL( + R_CAM_STILL_PRECAPTURE_TOOLBAR_LANDSCAPE ); + iVideoCaptureView->CreateAndSetToolbarL( + R_CAM_VIDEO_PRECAPTURE_TOOLBAR_LANDSCAPE ); + // Add toolbar observer. Needed in first boot to secondary + SetPreCaptureMode( ECamPreCapViewfinder ); + } + iFirstBoot = EFalse; + iView->HandleCommandL( ECamCmdPopUpMenuZoom ); + } + //Remaining recording time counter update needed when recording has stopped and + //show last captured video setting is off. + if( iNaviPaneCounterControl && !ShowPostCaptureView() && iMode == ECamControllerVideo ) + { + iNaviPaneCounterControl->ForceNaviPaneUpdate(); + } + break; + } + // ----------------------------- + // ----------------------------------------------------- + // The MMC is removed + case ECamEventMemoryCardHotswap: + { + TBool mmcInUse = EFalse; + + TCamMediaStorage currentLocation = + static_cast( + iController.IntegerSettingValueUnfiltered( + ECamSettingItemVideoMediaStorage ) ); + + // if app is in back show MMC note on returning to foreground + PRINT( _L("Camera => CCamAppUi::HandleControllerEventL ECamEventMMCHotswap") ) + if ( currentLocation == ECamMediaStorageCard ) + { + if ( AppInBackground( ETrue ) && iReturnFromBackground ) + { + PRINT( _L("Camera => CCamAppUi::HandleControllerEventL ECamEventMMCHotswap bckgrn") ) + //iMMCRemoveNoteRequired = ETrue; + + // Force use of phone memory. + // with multiple drive support, + // this actually uses the internal mass memory + iController.UsePhoneMemoryL(); + } + else // show note on next capture attempt + { + PRINT( _L("Camera => CCamAppUi::HandleControllerEventL ECamEventMMCHotswap not bckgrnd") ) + iMMCRemoveNoteRequiredOnCapture = ETrue; + + // force update of navi pane + iNaviPaneCounterControl->ForceNaviPaneUpdate(); + if ( IsDirectViewfinderActive() ) + { + TRAP_IGNORE( HandleCommandL( ECamCmdRedrawScreen ) ); + } + } + } + + // if the current mode is video, and the storage location is MMC + if ( ECamControllerVideo == iMode ) + { + mmcInUse = (ECamMediaStorageCard == currentLocation); + } + // if the current mode is still, and the storage location is MMC + else + { + mmcInUse = ( ECamMediaStorageCard == + iController.IntegerSettingValueUnfiltered( + ECamSettingItemPhotoMediaStorage ) ); + } + + // If a post capture view is active, and the current files + // are saved to the MMC, switch to pre capture view + if ( mmcInUse + && ( ECamViewStateBurstThumbnail == iViewState + || ECamViewStatePostCapture == iViewState ) + ) + { + if (iCamOrientation == ECamOrientationPortrait) + { + iTargetViewState = ECamViewStatePrePortraitCapture; + } + else + { + iTargetViewState = ECamViewStatePreCapture; + } + TrySwitchViewL(); + } + break; + } + // ----------------------------------------------------- + case ECamEventCounterUpdated: + break; + // ----------------------------------------------------- + case ECamEventVideoPauseTimeout: + { + PRINT( _L( "Camera <> case ECamEventVideoPauseTimeout" ) ) + EndCapture(); + break; + } + // ----------------------------------------------------- + case ECamEventSaveLocationChanged: + { + PRINT( _L( "Camera <> case ECamEventSaveLocationChanged" ) ) + if ( IsMMCRemovedNotePending() && + ( CamUtility::MemoryCardStatus() != ECamMemoryCardNotInserted ) ) + { + iMMCRemoveNoteRequired = EFalse; + iMMCRemoveNoteRequiredOnCapture = EFalse; + } + if ( IsDirectViewfinderActive() ) + { + TRAP_IGNORE( HandleCommandL( ECamCmdRedrawScreen ) ); + } + break; + } + + // ----------------------------------------------------- + case ECamEventSaveComplete: + { + PRINT( _L( "Camera <> case ECamEventSaveComplete" ) ) + if ( ECamImageCaptureSingle == iImageMode ) + { + if( iController.CaptureKeyPressedWhileImageSaving() && + ShowPostCaptureView()) + { + PRINT( _L("Camera <> HandleControllerEventL ECamEventSaveComplete - Capture key pressed while saving ") ) + iController.SetCaptureKeyPressedWhileImageSaving(EFalse); + if (iCamOrientation == ECamOrientationPortrait) + { + iTargetViewState = ECamViewStatePrePortraitCapture; + } + else + { + iTargetViewState = ECamViewStatePreCapture; + } + TrySwitchViewL(); + } + } + break; + } + // ----------------------------------------------------- + case ECamEventMediaFileChanged: + { + + if ( iController.UiConfigManagerPtr() && + !iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + PRINT2( _L( "Camera <> CCamAppU, ECamEventMediaFileChanged, mode [%s], targetmode[%s]" ), + KCamModeNames[ iController.CurrentMode() ], + KCamModeNames[ iController.TargetMode() ] ) + + if( iEndKeyPressed ) + { + if ( iController.CurrentMode() == ECamControllerShutdown || + iController.IsInShutdownMode() ) + { + PRINT( _L( "Camera <> ECamEventMediaFileChanged, notify shutdown" ) ) + HandleControllerEventL( ECamEventExitRequested, KErrNone ); + } + } + } + + if ( iController.UiConfigManagerPtr() && iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + // If record location setting is on, stop location trail + if ( ECamViewStatePreCapture != iViewState && ECamLocationOn == iController.IntegerSettingValue( ECamSettingItemRecLocation ) ) + { + PRINT( _L("Camera: Gallery notified and non pre-capture view, stop location trail") ) + iController.StopLocationTrail(); + } + else + { + PRINT1( _L("Camera: location trail not in use or view state (%d) is precapture"), iViewState ) + } + } + + break; + } + // ----------------------------------------------------- + case ECamEventCameraChanged: + { + PRINT( _L("Camera <> case ECamEventCameraChanged")) + // exit standby and use the new camera + if( iView) + { + iView->HandleCommandL( ECamCmdExitStandby ); + } + break; + } + // ----------------------------------------------------- + case ECamEventInvalidMemoryCard: + { + PRINT( _L( "Camera <> case ECamEventInvalidMemoryCard" ) ); + ShowErrorNoteL( ECamMemoryStatusCardNotInserted ); + break; + } + // ----------------------------------------------------- + case ECamEventRestoreCameraSettings: + { + PRINT( _L( "Camera <> case ECamEventRestoreCameraSettings" ) ); + if ( SettingsLaunchedFromCamera() ) + { + iSettingsPluginLaunched = EFalse; + iReturnedFromPlugin = ETrue; + } + iTargetViewState = ECamViewStatePreCapture; + + // get start up mode from settings + if ( StartupMode() == ECamStillCapture ) + { + iMode = ECamControllerImage; + iTargetMode = ECamControllerImage; + SetDefaultViewL( *iStillCaptureView ); + } + else + { + iMode = ECamControllerVideo; + iTargetMode = ECamControllerVideo; + SetDefaultViewL( *iVideoCaptureView ); + } + + TrySwitchViewL(); + break; + } + // ----------------------------------------------------- + case ECamEventCallStateChanged: + SelfTimerEnableL( ECamSelfTimerDisabled ); + break; + // ----------------------------------------------------- + default: + break; + // ----------------------------------------------------- + } + PRINT( _L( "Camera: <= CCamAppUi::HandleControllerEventL()" ) ); + } + +// ----------------------------------------------------------------------------- +// HandleStandbyEventL +// ----------------------------------------------------------------------------- +// +void +CCamAppUi::HandleStandbyEventL( TInt aStatus ) + { + PRINT( _L( "Camera => CCamAppUi::HandleStandbyEventL") ); + if( !iPretendExit && + !AppInBackground( EFalse ) ) + { + if( ECamViewStateStandby != iViewState ) + { + DismissMemoryNoteL(); + + if( IsInternalView( iViewState ) ) + { + + if ( aStatus != KErrInUse && + iPreCaptureMode == ECamPreCapCaptureSetup || + iPreCaptureMode == ECamPreCapSceneSetting ) + { + // VF settings does not go to standby state, VF is stopped instead + // Screen saver releases resources + iViewFinderStopped = ETrue; + PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: in one of settings view. Release camera") ); + iController.ReleaseCamera(); + //Draw black viewfinder area. Because camera is in internal viewstate view is valid. + static_cast( iView )->HandleCommandL( ECamCmdRedrawScreen ); + } + else + { + PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: call iView->ExitAllModesL") ); + PRINT1( _L( "Camera <> CCamAppUi::HandleStandbyEventL: iView = 0x%x"), iView ); + // Exit any special modes. + // If AppUI construction is not finished, do it first, otherwise + // the view has not been created yet + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && + !iUiConstructionComplete ) + { + CompleteAppUIConstructionL(); + } + else + { + static_cast( iView )->ExitAllModesL(); + } + + } + } + // Not InternalView + else + { + PRINT( _L( "Camera <= CCamAppUi::HandleStandbyEventL: Not internalView, standby ignored, return") ); + return; + } + + // VF settings does not go to standby state, VF is stopped instead + if ( aStatus == KErrInUse || iPreCaptureMode != ECamPreCapCaptureSetup && + iPreCaptureMode != ECamPreCapSceneSetting ) + { + PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: Set standby status..") ); + SetStandbyStatus( aStatus ); + if ( iController.InVideocallOrRinging() && iScreenClearer ) + { + delete iScreenClearer; + iScreenClearer = NULL; + } + + PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: Send command ECamCmdGoToStandby..") ); + HandleCommandL( ECamCmdGoToStandby ); + } + } + else + { + PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: Already in standby, ignored!") ); + } + } + else + { + PRINT( _L( "Camera <> CCamAppUi::HandleStandbyEventL: Camera already in background, no action..") ); + } + PRINT( _L( "Camera <= CCamAppUi::HandleStandbyEventL") ); + } + +// ----------------------------------------------------------------------------- +// SetStandbyStatus +// ----------------------------------------------------------------------------- +// +void CCamAppUi::SetStandbyStatus( TInt aStatus ) + { + PRINT1( _L( "Camera =><= CCamAppUi::SetStandbyStatus( %d )"), aStatus ); + iStandbyStatus = aStatus; + } + +// ----------------------------------------------------------------------------- +// StandbyStatus +// ----------------------------------------------------------------------------- +// +TInt CCamAppUi::StandbyStatus() const + { + return iStandbyStatus; + } + +// --------------------------------------------------------- +// CCamAppUi::IsEmbedded +// Retrun whether we are embedded or not +// --------------------------------------------------------- +// +TBool CCamAppUi::IsEmbedded() const + { + PRINT( _L("Camera => CCamAppUi::IsEmbedded") ); +/*#ifndef __WINS__ + PRINT1( _L("CCamAppUi::IsEmbedded %d"), iSendFileInCall ); + // treat inCallSend mode as same as embedded + if( iSendFileInCall ) + { + PRINT( _L("CCamAppUi::IsEmbedded iCall" ) ); + return ETrue; + } +#endif*/ + PRINT( _L("Camera <= CCamAppUi::IsEmbedded") ); + return iEikonEnv->StartedAsServerApp(); + } + + +// --------------------------------------------------------- +// --------------------------------------------------------- +// CCamAppUi::HandleWsEventL +// Handle a window server event. Used to handle focus loss +// --------------------------------------------------------- +// +void +CCamAppUi::HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* aDestination ) + { + + TInt type = aEvent.Type(); + + PRINT1( _L("Camera => CCamAppUi::HandleWsEventL (type: %d)"), type ) + // In case we receive an enter key event, we should map it to MSK + if ( aEvent.Type() == EEventKey && aEvent.Key()->iRepeats == 0 && + aEvent.Key()->iScanCode == EStdKeyEnter && + !( iMode == ECamControllerVideo && iViewState == ECamViewStatePreCapture && iController.IsDemandKeyRelease() ) ) + { + PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: mapping enter to MSK") ); + // Gets the window group id of the app in foreground + TInt windowGroupId = iCoeEnv->WsSession().GetFocusWindowGroup(); + // if the foreground app is this app + if ( windowGroupId == iMyWgId ) + { + // enter key should be mapped to MSK. + TWsEvent ownEvent = aEvent; + ownEvent.Key()->iScanCode = EStdKeyDevice3; + ownEvent.Key()->iCode = EKeyOK; + iCoeEnv->WsSession().SendEventToWindowGroup(windowGroupId, ownEvent); + } + } + // in case we receive a long press of applications key when the self timer is + // enabled, we should cancel the self timer + else if ( aEvent.Type() == EEventKey && + aEvent.Key()->iScanCode == EStdKeyApplication0 && + aEvent.Key()->iRepeats > 0 && + SelfTimerEnabled() ) + { + SelfTimerEnableL( ECamSelfTimerDisabled ); + } + // in other cases do the normal handling + else + { + + switch ( type ) + { + // a new window group has the focus + case EEventFocusGroupChanged: + { + PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: case EEventFocusGroupChanged") ); + + // When camera looses its focus after going to background + // during the state of ViaPlayer play back mode + // we dont perform any operation; but return directly + if ( iViewState == ECamViewStateViaPlayer ) + { + // We call the base class and return + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + return; + } + + // When camera looses its focus after going to background + // we return to the same settings page that was before + if ( SettingsLaunchedFromCamera() ) + { + // We call the base class and return + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + return; + } + // we are going to background no need for harvester callbacks. + iController.DeRegisterHarverterClientEvents(); + + if ( AppInBackground( ETrue ) && iPretendExit ) + { + //Make the current container invisible to prevent windowserver from bringing it to front + //before the foreground event. + TVwsViewId currentViewId; + GetActiveViewId( currentViewId ); + switch ( currentViewId.iViewUid.iUid ) + { + case ECamViewIdStillPreCapture: + { + if( iStillCaptureView->Container() && + !APHandler()->AccessedViaAP() ) + { + iStillCaptureView->Container()->MakeVisible( EFalse ); + } + iLastHiddenViewId = currentViewId.iViewUid; + break; + } + case ECamViewIdStillPostCapture: + { + CCamStillPostCaptureView* stillPostCaptureView = + ((CCamStillPostCaptureView*)View( currentViewId.iViewUid )); + if( stillPostCaptureView && stillPostCaptureView->Container() ) + { + stillPostCaptureView->Container()->MakeVisible( EFalse ); + } + iLastHiddenViewId = currentViewId.iViewUid; + break; + } + case ECamViewIdVideoPreCapture: + { + if( iVideoCaptureView->Container() && + !APHandler()->AccessedViaAP() ) + { + iVideoCaptureView->Container()->MakeVisible( EFalse ); + } + iLastHiddenViewId = currentViewId.iViewUid; + break; + } + case ECamViewIdVideoPostCapture: + { + CCamVideoPostCaptureView* videoPostCaptureView = + ((CCamVideoPostCaptureView*)View( currentViewId.iViewUid )); + if( videoPostCaptureView && videoPostCaptureView->Container() ) + { + videoPostCaptureView->Container()->MakeVisible( EFalse ); + } + iLastHiddenViewId = currentViewId.iViewUid; + break; + } + default: + break; + } + } + + // if the application has gone to the background + // note this does not include eikon server windows + // The exception to this is when the slider is closed with keypad + // lock active and the app grid opens with a keypad status note. + // We know in this situation that the app should release resources. + if ( AppInBackground( EFalse ) || + ( AppInBackground( ETrue ) && iPretendExit ) ) + { + PRINT( _L("Camera <> AppUI EEventFocusGroupChanged A")) + // when we return to foreground we use this boolean to + // check if we have to still exit the settings modes e.g. + // UserScene or SceneSettings that we are in when screen saver + // comes or going InternalExit + iLostFocusToNewWindow = ETrue; + + // Handle losing focus to another application + // this is used for behaviour that does not need to occur + // when views go to the background for another view within our + // own application. Also for when the application was behind + // an eikon server window but another application has now taken + // the foreground + + if( iView && iReturnedFromPlugin ) + { + PRINT( _L("Camera <> AppUI EEventFocusGroupChanged B")) + static_cast( iView )->HandleFocusLossL(); + } + + // the application knows it is in the background so we are + // not interested in any more events + iCoeEnv->RootWin().DisableFocusChangeEvents(); + // disable timeout to standby when going to background + iController.StopIdleTimer(); + + // We need to know if we gain focus from a true background event + iReturnFromBackground = ETrue; + // Sent to the background, so compress the heap + User::Heap().Compress(); + + // stop listening mmc dismount notifications + iController.CancelDismountMonitoring(); + + #if !defined (__WINSCW__) + if ( AppInBackground( ETrue ) ) + { + // relinquish capture keys + UnRegisterCaptureKeys(); + } + #endif + } + + if( AppInBackground(EFalse) || ( !CamUtility::IsBatteryPowerOK() && + !CamUtility::IsBatteryCharging() ) ) + { + if( ECamControllerVideo == iMode ) + { + TCamCaptureOperation operation( iController.CurrentOperation() ); + // In case of phone app, video rec is stopped already when the call starts ringing + if ( ( !iController.CurrentlySavingVideo() ) && + ( ECamCapturing == operation + || ECamPaused == operation + || ECamPausing == operation + || ECamResuming == operation ) ) + { + iController.StopVideoRecording(); + } + } + else if( iController.SequenceCaptureInProgress() && IsBurstEnabled() ) + { + iController.StopSequenceCaptureL(); + } + else + { + if( iController.IsViewFinding() ) + { + if(CamUtility::IsBatteryPowerOK() ) + { + iController.StopViewFinder(); + iViewFinderStopped = ETrue; + } + // stop self timer countdown if necessary + if( SelfTimer() && SelfTimer()->IsActive() && + CamUtility::IsBatteryPowerOK() ) + { + // If low battery note appears, do not cancel self timer + SelfTimerEnableL( ECamSelfTimerDisabled ); + } + } + } + } + break; + } + // ----------------------------------------------------- + // the camera app has regained the focus + case EEventFocusGained: + { + PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: case EEventFocusGained") ); + TBool uiOverride = iController.UiConfigManagerPtr() && iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported(); + + if ( !iSendAsInProgress ) + { + // if we've regained focus assume we're not embedding anything + SetEmbedding( EFalse ); + } + + //Make the current container visible again. This way the camera ui doesn't flash quickly in the portait mode + //when returning from the background. unless this is first startup and uiorientationioverride api is used + if ( !uiOverride || ( !iFirstBoot && uiOverride ) ) + { + switch ( iLastHiddenViewId.iUid ) + { + case ECamViewIdStillPreCapture: + { + if( iStillCaptureView->Container() + && !APHandler()->AccessedViaAP()) + { + iStillCaptureView->Container()->MakeVisible( ETrue ); + } + break; + } + case ECamViewIdStillPostCapture: + { + CCamStillPostCaptureView* stillPostCaptureView = + ((CCamStillPostCaptureView*)View( iLastHiddenViewId )); + if( stillPostCaptureView && stillPostCaptureView->Container() ) + { + stillPostCaptureView->Container()->MakeVisible( ETrue ); + } + break; + } + case ECamViewIdVideoPreCapture: + { + if( iVideoCaptureView->Container() + && !APHandler()->AccessedViaAP()) + { + iVideoCaptureView->Container()->MakeVisible( ETrue ); + } + break; + } + case ECamViewIdVideoPostCapture: + { + CCamVideoPostCaptureView* videoPostCaptureView = + ((CCamVideoPostCaptureView*)View( iLastHiddenViewId )); + if( videoPostCaptureView && videoPostCaptureView->Container() ) + { + videoPostCaptureView->Container()->MakeVisible( ETrue ); + } + break; + } + default: + break; + } + } + // focus gained event is received while videocall is active + if ( iController.InVideocallOrRinging() ) + { + if ( ECamViewStateStandby == iViewState && + StandbyStatus() == KErrInUse ) + { + // We call the base class and return + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + return; + } + else if ( iViewState != ECamViewStateSettings && + iViewState != ECamViewStateViaPlayer && + iTargetViewState != ECamViewStatePostCapture && + !iFirstBoot ) + { + //Don't update task state in case of embedded camera + if ( !iEikonEnv->StartedAsServerApp()) + { + HideTaskL( EFalse ); + } + iPretendExit = EFalse; + // Go to standby with error + HandleStandbyEventL( KErrInUse ); + // We call the base class and return + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + return; + } + } + // Only do startup performance traces if this is + // a subsequent startup. + if ( IsInPretendExit() ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAPPUI_HANDLEWSEVENTL, "e_CAM_APP_INIT 1" ); //CCORAPP_APP_INIT_START + } + + PERF_EVENT_START_L1( EPerfEventAppSubsequentStartup ); + + // start listening mmc dismount notifications + iController.StartDismountMonitoring(); + + if ( !uiOverride || ( !iFirstBoot && uiOverride ) ) + { + NotifyViews( ECamAppEventFocusGained ); + if( !uiOverride ) + { + // whenever we come from background, we reset the image, + // video & common settings as there is a possibility that + // some settings might have changed from the GS application + // by the user. + iController.LoadStaticSettingsL( IsEmbedded() ); + } + + iStillCaptureView->UpdateToolbarIconsL(); + if( !uiOverride ) + { + //check for silent profile whenever we come to foreground. + iController.IsProfileSilent(); + } + } + + //Check existance of current file if in video or image in + //burstthumbnail view. + if( CurrentViewState() == ECamViewStateBurstThumbnail ) + { + StartFileNameCheck(); + } + /* + * We check if the state of the camera is in the ViaPlayer mode state + * if so, then we just activate the player view and return after + * coming from the background. + */ + if ( iViewState == ECamViewStateViaPlayer ) + { + ActivateLocalViewL ( iViaPlayerUid ); + // We call the base class and return + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + return; + } + else if ( iTargetViewState == ECamViewStatePostCapture ) + { + TrySwitchViewL( ETrue ); + // register an interest in new events + iCoeEnv->RootWin().EnableFocusChangeEvents(); // ignore error + +#if !defined (__WINSCW__) + // Grab capture keys + RegisterCaptureKeysL(); + +#endif + // iPretendExit flag needs to be reset before returning, otherwise + // views think we are still in exit state and will not reserve camera + iPretendExit = EFalse; + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + return; + } + else if ( SettingsLaunchedFromCamera() ) + { + if ( iController.InVideocallOrRinging() && + iController.CurrentOperation() == ECamNoOperation ) + { + iTargetViewState = ECamViewStatePreCapture; + } + else + { + CCamViewBase *precapView = static_cast( iView ); + __ASSERT_DEBUG(precapView, CamPanic(ECamPanicNullPointer)); + if( precapView->IsInStandbyMode() ) + { + iView->HandleCommandL( ECamCmdExitStandby ); + } + iTargetViewState = ECamViewStateSettings; + } + TrySwitchViewL(); + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + return; + } + else + { + // we are now sure that settings plugin is not active + iReturnedFromPlugin = ETrue; + } + + + if ( iLostFocusToNewWindow ) + { + if ( ECamViewStateBurstThumbnail != iTargetViewState ) + { + iLostFocusToNewWindow = EFalse; + } + } + if( !uiOverride || ( !iFirstBoot && uiOverride ) ) + { + StartCheckingDefaultAlbumIdL(); + } + + // Free the needed ram memory if not enough available + iMemoryMonitor->CheckAndRequestMemoryL( + iController.UiConfigManagerPtr()->CriticalLevelRamMemoryFocusGained(), + iController.UiConfigManagerPtr()->RequiredRamMemoryFocusGained(), + EFalse ); + + + iController.SetEndKeyExitWaiting( EFalse ); + //Don't update task state in case of embedded camera + if ( !iEikonEnv->StartedAsServerApp()) + { + HideTaskL( EFalse ); + } + // Restart the sensor idle + if ( iController.UiConfigManagerPtr()->IsOrientationSensorSupported() ) + { + // Handle sensor api init when we have idle time + StartSensorIdleL(); + } + + // the focus can be regained during a SendAs Bluetooth operation + // so don't try to exit the app if SendAs is in progress - the + // exit check will be performed once SendAs completes + // The same applies while a sequence capture is being completed + if ( !iSendAsInProgress && !iController.SequenceCaptureInProgress() ) + { + PRINT( _L("Camera <> CCamAppUi::HandleWsEventL EEventFocusGained checking exit status") ) + // check if exit is required + if ( iController.CheckExitStatus() ) + { + InternalExitL(); + PRINT( _L("Camera <= CCamAppUi::HandleWsEventL, internal exit") ) + return; + } + } + + // register an interest in new events + iCoeEnv->RootWin().EnableFocusChangeEvents(); // ignore error + + #if !defined (__WINSCW__) + // Grab capture keys + RegisterCaptureKeysL(); + + #endif + + iReturnFromBackground = EFalse; + + // When the application gains focus + // the memory to use should be re-checked for + // availability. If uioverride supported, check + // made later since settings not loaded at this point + if ( !uiOverride ) + { + iController.CheckMemoryToUseL(); + } + + TBool returningFromPretendExit = iPretendExit; + iPretendExit = EFalse; + + TCamViewSwitch switchNeeded = ECamViewSwitchNone; + + // if a view switch has been waiting for the application to get + // the foreground. + if ( iPendingViewSwitch != EPendingViewSwitchNone && + !iSendAsInProgress ) + { + // In case the application is exited from portrait mode + // and landscape should be used -> orientation switch is required + TAppUiOrientation appOrientation = CAknAppUiBase::Orientation(); + if ( EAppUiOrientationPortrait == appOrientation ) + { + SwitchOrientationIfRequiredL( + CAknAppUiBase::EAppUiOrientationUnspecified ); + } + TBool deactivateFirst = + ( iPendingViewSwitch == EPendingViewSwitchDeactivateFirst ); + switchNeeded = ViewSwitchRequired( deactivateFirst ); + iPendingViewSwitch = EPendingViewSwitchNone; + TrySwitchViewL( deactivateFirst ); + } + else + { + if( iViewFinderStopped ) + { + // don't start VF if EEventFocusGroupChanged is coming later + if( !iLostFocusToNewWindow && + iController.CurrentMode() == ECamControllerImage || + iController.CurrentMode() == ECamControllerVideo ) + { + iController.StartViewFinder(); + } + iLostFocusToNewWindow = EFalse; + } + } + + // force side pane and active palette to update if simulating app + // launch this has to be done after the call to TrySwitchViewL() to + // ensure that IsBurstEnabled() returns the correct value. + if ( returningFromPretendExit ) + { + /*if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + // If record location setting is on, start location trail, + // provided, primary camera and pre-capture view + if ( ECamLocationOn == iController.IntegerSettingValue( ECamSettingItemRecLocation ) + && ECamActiveCameraPrimary == ActiveCamera() + && ECamViewStatePreCapture == iViewState + ) + { + iController.StartLocationTrailL(); + } + }*/ + + iCamSidePane->SetCaptureMode( iMode ); + // The active palette is always switched on when simulating + // app launch + iPreventActivePaletteDisplay = EFalse; + + + if ( iView == iVideoCaptureView ) + { + iVideoCaptureView->UpdateToolbarIconsL(); + } + } + + if ( uiOverride && ( returningFromPretendExit || iFirstBoot ) ) + { + SetActivePaletteVisibility( EFalse ); + } + else if ( !TimeLapseSliderShown() && + iViewState == ECamViewStatePreCapture && + switchNeeded != ECamViewSwitch && + !uiOverride ) + { + RaisePreCaptureCourtesyUI( ETrue ); + } + + // If keylock is set on when recording is starting up but not yet + // started, display toolbar when keylock is set off since we are + // returning to precapture view, unless capturing is still going on. + if ( iView == iVideoCaptureView + && iController.CurrentOperation() != ECamCapturing + && !iController.IsProcessingCapture() ) + { + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* toolbar = CurrentFixedToolbar(); + if ( toolbar ) + { + toolbar->SetToolbarVisibility( ETrue ); + } + } + } + break; + } + // ----------------------------------------------------- + case EEventFocusLost: + { + PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: case EEventFocusLost") ); + + //When go to background from video post caputure view, we need to hide the toolbar to avoid icons overlap + if( AppInBackground( EFalse ) + && iViewState == ECamViewStatePostCapture + && iMode == ECamControllerVideo ) + { + SubmergeToolbar(); + } + + // focus lost event while videocall active and camera in standby, + // no notification to views + if ( iController.InVideocallOrRinging() + && ECamViewStateStandby == iViewState ) + { + // We call the base class and return + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + return; + } + + NotifyViews( ECamAppEventFocusLost ); + + if ( iController.UiConfigManagerPtr() + && iController.UiConfigManagerPtr()->IsOrientationSensorSupported() ) + // Shut down the Sensor API object. + iController.UpdateSensorApiL(EFalse); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + // If record location setting is on, stop location trail when losing focus + if ( AppInBackground( EFalse ) ) + { + PRINT( _L("Camera: CCamAppUi::HandleWsEventL focus lost, stop location trail") ) + iController.StopLocationTrail(); + } + } + + #if !defined (__WINSCW__) + // relinquish capture keys + UnRegisterCaptureKeys(); + + RArray halfCaptureKeys; + CleanupClosePushL( halfCaptureKeys ); + + // now get half key press code to register + if ( iController.UiConfigManagerPtr() ) + { + iController.UiConfigManagerPtr()-> + SupportedPrimaryCameraAutoFocusKeyL( halfCaptureKeys ); + } + if ( halfCaptureKeys.Count() > 0 ) + { + // Simulate key up event for the half-press key to make + // sure autofocus does not get stuck when we lose focus. + TKeyEvent key; + key.iRepeats = 0; + key.iCode = 0; + key.iScanCode = halfCaptureKeys[0]; + key.iModifiers = 0; + iEikonEnv->SimulateKeyEventL( key, EEventKeyUp ); + } + CleanupStack::PopAndDestroy( &halfCaptureKeys ); + #endif + break; + } + // ----------------------------------------------------- + case KUidValueAknsSkinChangeEvent: + { + if ( iNaviProgressBarModel ) + { + iNaviProgressBarModel->ReloadResourceDataL(); + } + break; + } + case EEventPointer: + PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: EEventPointer") ); + // restart idle timer every time screen is touched + iController.StartIdleTimer(); + break; + // ----------------------------------------------------- + default: + PRINT( _L("Camera <> CCamAppUi::HandleWsEventL: unhandled case") ); + break; + // ----------------------------------------------------- + } + + CAknAppUi::HandleWsEventL( aEvent, aDestination ); + } + PRINT( _L("Camera <= CCamAppUi::HandleWsEventL") ); + } + + +// ----------------------------------------------------------------------------- +// NotifyViews +// ----------------------------------------------------------------------------- +// +void +CCamAppUi::NotifyViews( const TCamAppEvent& aEvent ) + { + PRINT( _L("Camera => CCamAppUi::NotifyViews") ); + TUid settingsPluginUid = KNullUid; + if ( iPlugin ) + { + settingsPluginUid = iPlugin->Id(); + } + + for( TInt i = 0; i < iViews->Count(); i++ ) + { + const TUid& uid( (*iViews)[i]->Id() ); + PRINT2( _L("Camera <> View[%2d] uid[%3d]"), i, uid.iUid ); + + + if ( + KGSCamImageSettingsViewId != uid && + KGSCamVideoSettingsViewId != uid && + settingsPluginUid != uid && + ECamViewIdViaPlayerPlayBack != uid.iUid ) + + { + static_cast( (*iViews)[i] )->HandleAppEvent( aEvent ); + } + } + + PRINT( _L("Camera <= CCamAppUi::NotifyViews") ); + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::ConstructPreCaptureViewsL +// Construct the application views +// ----------------------------------------------------------------------------- +// +void CCamAppUi::ConstructPreCaptureViewsL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CONSTRUCTPRECAPTUREVIEWSL, "e_CCamAppUi_ConstructPreCaptureViewsL 1" ); + PRINT( _L( "Camera => CCamAppUi::ConstructPreCaptureViewsL()" ) ); + PERF_EVENT_START_L2( EPerfEventPreCaptureViewConstruction ); + + // Initialize views + CCamStillPreCaptureView* stillView = + CCamStillPreCaptureView::NewLC( iController ); + iStillCaptureView = stillView; + + AddViewL( stillView ); + CleanupStack::Pop( stillView ); + + PRINT( _L( "Camera => CCamAppUi::ConstructPreCaptureViewsL() still view complete" ) ); + + CCamVideoPreCaptureView* videoView = CCamVideoPreCaptureView::NewLC( iController ); + iVideoCaptureView = videoView; + + AddViewL( videoView ); + CleanupStack::Pop( videoView ); + +#if !( defined(__WINS__) || defined(__WINSCW__) ) + // Get Central Repository key indicating if product uses volume keys + // for zoom. Load the zoom pane orientation value from the Central + // Repository + if( !iRepository ) + { + iRepository = CRepository::NewL( KCRUidCameraappSettings ); + } + + TInt val = 0; + TInt err = iRepository->Get( KCamCrZoomUsingVolumeKeys, val ); + + // If there is an error then assume volume keys not used + if ( err ) + { + iZoomUsingVolumeKeys = EFalse; + } + else + { + iZoomUsingVolumeKeys = val; + } + + if( iZoomUsingVolumeKeys ) + { + // Remote controller observe + delete iVolumeKeyObserver; + iVolumeKeyObserver = NULL; + iVolumeKeyObserver = CCamRemConObserver::NewL( *this ); + } + +#else + iZoomUsingVolumeKeys = EFalse; +#endif // !( defined(__WINS__) || defined(__WINSCW__) ) + + PERF_EVENT_END_L2( EPerfEventPreCaptureViewConstruction ); + PRINT( _L( "Camera <= CCamAppUi::ConstructPreCaptureViewsL()" ) ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_CONSTRUCTPRECAPTUREVIEWSL, "e_CCamAppUi_ConstructPreCaptureViewsL 0" ); + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::ConstructPostCaptureViewsL +// Construct the application views +// ----------------------------------------------------------------------------- +// +void CCamAppUi::ConstructPostCaptureViewsL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CONSTRUCTPOSTCAPTUREVIEWSL, "e_CCamAppUi_ConstructPostCaptureViewsL 1" ); + PRINT( _L( "Camera => CCamAppUi::ConstructPostCaptureViewsL()" ) ); + if ( iPostCaptureViewsConstructed ) + { + PRINT( _L( "Camera <= CCamAppUi::ConstructPostCaptureViewsL(,)iPostCaptureViewsConstructed == ETrue" ) ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP2_CCAMAPPUI_CONSTRUCTPOSTCAPTUREVIEWSL, "e_CCamAppUi_ConstructPostCaptureViewsL 0" ); + return; + } + + PERF_EVENT_START_L2( EPerfEventPostCaptureViewConstruction ); + + ConstructPostCaptureViewIfRequiredL( ECamViewStatePostCapture, + ECamControllerImage ); + ConstructPostCaptureViewIfRequiredL( ECamViewStateBurstThumbnail, + ECamControllerImage ); + ConstructPostCaptureViewIfRequiredL( ECamViewStatePostCapture, + ECamControllerVideo ); + + iPostCaptureViewsConstructed = ETrue; + PERF_EVENT_END_L2( EPerfEventPostCaptureViewConstruction ); + PRINT( _L( "Camera <= CCamAppUi::ConstructPostCaptureViewsL()" ) ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_CONSTRUCTPOSTCAPTUREVIEWSL, "e_CCamAppUi_ConstructPostCaptureViewsL 0" ); + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::ConstructViewIfRequiredL +// Construct the application views +// ----------------------------------------------------------------------------- +// +void CCamAppUi::ConstructViewIfRequiredL() + { + PRINT( _L( "Camera => CCamAppUi::ConstructViewIfRequiredL()" ) ); + + // Initialize views + CAknView* view( NULL ); + + switch( iTargetViewState ) + { + // ----------------------------------------------------- + // Construct one of the postcapture views if needed + case ECamViewStateBurstThumbnail: + case ECamViewStatePostCapture: + { + ConstructPostCaptureViewIfRequiredL( iTargetViewState, iMode ); + break; + } + // ----------------------------------------------------- + // construct settings views if needed + case ECamViewStateSettings: + { + if( !iPlugin ) + { + CCamGSInterface* plugin = CCamGSInterface::NewL( KCamGSPluginUid ); + CleanupStack::PushL( plugin ); + AddViewL( plugin ); // Transfer ownership to AppUi + CleanupStack::Pop( plugin ); + iPlugin = plugin; + } + break; + } + // ----------------------------------------------------- + // construct user scene setup view if needed + case ECamViewStateUserSceneSetup: + { + if( !iUserSceneSetupViewConstructed ) + { + view = CCamStillUserSceneSetupView::NewLC( iController ); + AddViewL( view ); + CleanupStack::Pop( view ); + iUserSceneSetupViewConstructed = ETrue; + } + break; + } + // ----------------------------------------------------- + + default: + { + // no action + break; + } + // ----------------------------------------------------- + } + PRINT( _L( "Camera <= CCamAppUi::ConstructViewIfRequiredL" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::ConstructNaviPaneL +// Construct the navi pane +// ----------------------------------------------------------------------------- +// +void CCamAppUi::ConstructNaviPaneL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CONSTRUCTNAVIPANEL, "e_CCamAppUi_ConstructNaviPaneL 1" ); + // Navi pane indicators + iNaviPaneCounterControl = + CCamNaviCounterControl::NewL( *iNaviCounterModel ); + + iDecoratedNaviPaneCounter = + CAknNavigationDecorator::NewL( NaviPaneL(), iNaviPaneCounterControl ); + + iDecoratedNaviPaneCounter->SetContainerWindowL( + *(StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ) ); + iNaviPaneCounterControl->SetContainerWindowL( *iDecoratedNaviPaneCounter ); + + iNaviPaneProgressBarControl = + CCamNaviProgressBarControl::NewL( *iNaviProgressBarModel ); + + iDecoratedNaviPaneProgressBar = CAknNavigationDecorator::NewL( + NaviPaneL(), iNaviPaneProgressBarControl ); + + iDecoratedNaviPaneProgressBar->SetContainerWindowL( + *(StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ) ); + iNaviPaneProgressBarControl->SetContainerWindowL( + *iDecoratedNaviPaneProgressBar ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_CONSTRUCTNAVIPANEL, "e_CCamAppUi_ConstructNaviPaneL 0" ); + } + +// ---------------------------------------------------- +// CCamAppUi::DoPostCaptureTimeoutL +// Implementation function for post capture view timeout +// ---------------------------------------------------- +// +TInt CCamAppUi::DoPostCaptureTimeoutL() + { + // If burst mode is active, switch to thumbnail view + if ( iViewState == ECamViewStatePostCapture && + iImageMode == ECamImageCaptureBurst ) + { + iTargetViewState = ECamViewStateBurstThumbnail ; + } + // otherwise, return to pre-capture view + else if (iCamOrientation == ECamOrientationPortrait) + { + iTargetViewState = ECamViewStatePrePortraitCapture; + } + else + { + iTargetViewState = ECamViewStatePreCapture; + } + + TrySwitchViewL(); + return EFalse; + } + +// ---------------------------------------------------- +// CCamAppUi::TrySwitchViewL +// Try to switch active view +// ---------------------------------------------------- +// +void +CCamAppUi::TrySwitchViewL( TBool aDeactivateFirst ) + { + PRINT2(_L("Camera => CCamAppUi::TrySwitchViewL, iTargetViewState = %d, iViewState = %d"), iTargetViewState, iViewState); + PRINT2(_L("Camera <> CCamAppUi::TrySwitchViewL, iTargetMode = %d, iMode = %d"), iTargetMode, iMode); + + //Sometimes current view and target view are same. For example switching from main camera to secondary camera + //always sets target mode to precaptrueview and current view could already be in precapture view. This is fine + //but In some postcaptureview cases current view and targetview is postcapture. + //In those cases view switching is not needed unless current mode also changes. + if( (iViewState==iTargetViewState) && ( iViewState==ECamViewStatePostCapture) && (iMode==iTargetMode) ) + { + PRINT(_L("Camera <> CCamAppUi::TrySwitchViewL, CALLED WITHOUT PURPOSE")); + return; + } + + if( iZoomUsingVolumeKeys && !iVolumeKeyObserver && + ECamViewStatePreCapture == iTargetViewState ) + { + // Volumekeyobserver has been removed due to activating an external + // view. Volume keys are only needed for zooming in precapture, so we + // re-create the observer during next switch to precap (=now) + iVolumeKeyObserver = CCamRemConObserver::NewL( *this ); + } + + + //if burst capture stopped for usb inserted, iTargetViewState is ECamViewStatePreCapture, it need to stop sequence capture too. + if ( iViewState == ECamViewStatePreCapture && + ( iTargetViewState == ECamViewStateBurstThumbnail || + ( ( iTargetViewState == ECamViewStatePreCapture ) && iController.IsCaptureStoppedForUsb() ) ) && + iController.SequenceCaptureInProgress() ) + { + iController.StopSequenceCaptureL(); + } + + // some views are only constructed when they are first used + TRAPD( err, ConstructViewIfRequiredL() ) + PRINT1( _L( "Camera <> view constrcuction status:%d"), err ) + // if the view construction failed + if ( err ) + { + iTargetViewState = ECamViewStatePreCapture; + User::Leave( err ); + } + + // if the application is in the background the view switch will happen + // when we get the foreground again. This stops the app coming back to + // the foreground when the view switch occurs. + // If keylock is enabled, view switching is allowed in order to avoid + // flickering + + if ( AppInBackground( ETrue ) && ECamViewStateStandby != iTargetViewState ) + { + PRINT( _L("Camera <> app in background set pending view switch") ) + if ( aDeactivateFirst ) + { + PRINT( _L("Camera <> setting iPendingViewSwitch = EPendingViewSwitchDeactivateFirst") ) + iPendingViewSwitch = EPendingViewSwitchDeactivateFirst; + } + else + { + // If a deactivate first view switch has already been requested + // then don't overwrite it + if ( iPendingViewSwitch != EPendingViewSwitchDeactivateFirst ) + { + PRINT( _L("Camera <> setting iPendingViewSwitch = EPendingViewSwitchNormal") ) + iPendingViewSwitch = EPendingViewSwitchNormal; + } + } + PRINT( _L("Camera TrySwitchViewL returning without switch") ); + return; + } + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && + !iUiConstructionComplete ) + { + iPendingViewSwitch = EPendingViewSwitchNormal; + PRINT( _L("Camera <= CCamAppUi::TrySwitchViewL setting EPendingViewSwitchNormal, return") ); + return; + } + + TCamViewSwitch switchNeeded = ViewSwitchRequired( aDeactivateFirst ); + PRINT( _L("Camera TrySwitchViewL C") ) + if ( iTargetViewState == ECamViewStatePreCapture ) + { + PRINT( _L("Camera TrySwitchViewL D") ) + // if going back to precapture view in timelapse mode then the array + // of timelapse filenames can now be deleted + if ( iImageMode == ECamImageCaptureTimeLapse ) + { + iController.ResetTimelapseArray(); + } + + // If exiting a post capture view, release the capture array + if ( iViewState == ECamViewStatePostCapture ) + { + iController.ReleaseArray(); + } + else if( iViewState == ECamViewStateBurstThumbnail ) + { + iController.ReleaseArray( ETrue ); + } + if ( iPreCaptureMode != ECamPreCapTimeLapseSlider ) + { + iPreCaptureMode = ECamPreCapViewfinder; + } + } + + if ( iTargetViewState == ECamViewStatePostCapture ) + { + // If going to post capture, make sure the AP is displayed + iPreventActivePaletteDisplay = EFalse; + } + + // If no switches are required + if ( switchNeeded == ECamViewSwitchNone ) + { + PRINT( _L("Camera TrySwitchViewL no VS") ) + if ( IsDirectViewfinderActive() ) + { + TRAP_IGNORE(HandleCommandL( ECamCmdRedrawScreen )); + } + return; + } + // If a full view switch is required, activate new view + if ( switchNeeded == ECamViewSwitch ) + { + PRINT( _L("Camera <> CCamAppUi::TrySwitchViewL: Stop VF for full view switch") ) + // this skip VF stopping if DV is active and camera is in standby mode + // possible if screensaver delay is short and startup takes long enough + if ( ECamViewStateStandby == iViewState && + // DSVF active or in bitmap mode in any active camera (no need to stop VF) + ( IsDirectViewfinderActive() || + ( ECamActiveCameraSecondary == ActiveCamera() && + !iController.UiConfigManagerPtr()->IsDSAViewFinderSupported( EFalse ) ) || + ( ECamActiveCameraPrimary == ActiveCamera() && + !iController.UiConfigManagerPtr()->IsDSAViewFinderSupported( ETrue ) ) ) ) + { + PRINT( _L("Camera <> CCamAppUi::TrySwitchViewL: !!! No stopviewfinder in Standby !!!") ) + } + else + { + SetViewFinderInTransit(ETrue); + iController.StopViewFinder(); + TUid viewId = iView->Id(); + if(viewId == TUid::Uid( ECamViewIdStillPreCapture ) + || viewId == TUid::Uid( ECamViewIdVideoPreCapture )) + { + CCamViewBase* view = static_cast(iView); + CCamContainerBase* container = view->Container(); + container->DrawNow(); + } + + } + PRINT( _L("Camera TrySwitchViewL E") ) + TUid uid; + TUid messageUid; + TBool validView = ViewId( iTargetViewState, + iTargetMode, + iTargetImageMode, + uid, + messageUid, + aDeactivateFirst ); + PRINT2(_L("Camera <> CCamAppUi::TrySwitchViewL, iTargetViewState = %d, iViewState = %d"), + iTargetViewState, iViewState); + PRINT2(_L("Camera <> CCamAppUi::TrySwitchViewL, uid = %d, messageUid = %d"), + uid.iUid, messageUid.iUid); + + __ASSERT_DEBUG( validView, CamPanic( ECamPanicInvalidView ) ); + + if ( validView ) + { + PRINT( _L("Camera TrySwitchViewL f") ) + // the cba is reset when the view is activated + iCbaIsDisabled = EFalse; + ActivateLocalViewL( uid, messageUid, KNullDesC8 ); + // If self timer mode is enabled and we are switching views, we need to + // disable Self Timer + if ( iInSelfTimerMode != ECamSelfTimerDisabled) + { + SelfTimerEnableL( ECamSelfTimerDisabled ); + } + } + } + + // Mode only switches are handled here + + // ...if we are switching to/from the video/photo views then + // ...reset the dynamic settings. + if ( ( ( iMode != ECamControllerVideo ) && + ( iTargetMode == ECamControllerVideo ) ) + || + ( ( iMode == ECamControllerVideo ) && + ( iTargetMode != ECamControllerVideo ) ) ) + { +#ifdef RESET_DYNAMIC_SETTINGS_WHEN_SWITCH_MODE + iController.SetDynamicSettingsToDefaults(); +#endif // RESET_DYNAMIC_SETTINGS_WHEN_SWITCH_MODE + } + + if ( iController.UiConfigManagerPtr() && iDSASupported ) + { + // ...check if we are moving to BurstCapture + // + if ( // If entering burst mode... + ( ( iTargetImageMode == ECamImageCaptureBurst || + iTargetImageMode == ECamImageCaptureTimeLapse ) && + iImageMode == ECamImageCaptureSingle ) + // ...or leaving burst mode + || + ( ( iImageMode == ECamImageCaptureBurst || + iImageMode == ECamImageCaptureTimeLapse ) && + iTargetImageMode == ECamImageCaptureSingle ) + ) + { + // Stop the viewfinder (using the current state) + PRINT( _L("Camera TrySwitchViewL burst stop VF") ) + iController.StopViewFinder(); + + // Update AppUi internal state + iViewState = iTargetViewState; + iMode = iTargetMode; + iImageMode = iTargetImageMode; + + } + else + { + // Not entering/leaving burst mode, so just update the state + iViewState = iTargetViewState; + iMode = iTargetMode; + iImageMode = iTargetImageMode; + } + } + else + { + // ...set the current capture mode and view state to the targets. + iViewState = iTargetViewState; + iMode = iTargetMode; + iImageMode = iTargetImageMode; + } + + PRINT(_L("Camera <= CCamAppUi::TrySwitchViewL")); + } + +// ---------------------------------------------------- +// CCamAppUi::ViewSwitchRequired +// Is a switch of the active view necessary +// ---------------------------------------------------- +// + +CCamAppUi::TCamViewSwitch +CCamAppUi::ViewSwitchRequired( TBool aDeactivateFirst ) const + { + CCamAppUi::TCamViewSwitch vSwitch = ECamViewSwitchNone; + + if ( aDeactivateFirst ) + { + // View switch required + vSwitch = ECamViewSwitch; + } + else + { + // Post <=> Pre and/or Video <=> Image always require view switch + if ( iTargetViewState == iViewState + && iTargetMode == iMode ) + { + // single / burst / timelapse + if( iTargetImageMode == iImageMode ) + { + // Completely same mode already + vSwitch = ECamViewSwitchNone; + } + else + { + // No view switch is required for changing between these modes + vSwitch = ECamViewSwitchModeOnly; + } + } + else + { + // View switch required + vSwitch = ECamViewSwitch; + } + } + + return vSwitch; + } + +// ---------------------------------------------------- +// CCamAppUi::ViewId +// Get uid of view with requested state and mode +// ---------------------------------------------------- +// +TBool CCamAppUi::ViewId( TCamViewState aState, + TCamCameraMode aMode, + TCamImageCaptureMode aImageMode, + TUid& aUid, + TUid& aMessageUid, + TBool aDeactivateFirst ) + { + aMessageUid.iUid = 0; + + TBool found = EFalse; + switch ( aState ) + { + // ----------------------------------------------------- + case ECamViewStateStandby: + { + // Custom message to pass to the view, is to initiate standby + aMessageUid.iUid = ECamViewMessageStandby; + } + //lint -fallthrough + // ----------------------------------------------------- + case ECamViewStatePreCapture: // fallthrough + { + if ( aDeactivateFirst ) + { + aMessageUid.iUid = ECamViewMessageDeactivateFirst; + } + if ( aMode == ECamControllerVideo ) + { + aUid.iUid = ECamViewIdVideoPreCapture; + } + else + { + aUid.iUid = ECamViewIdStillPreCapture; + } + found = ETrue; + break; + } + // ----------------------------------------------------- + case ECamViewStateSceneSettingList: + { + // Ensure the view starts with the capture setup menu displayed. + aMessageUid.iUid = ECamViewMessageSceneSettingList; + if ( aMode == ECamControllerVideo ) + { + aUid.iUid = ECamViewIdVideoPreCapture; + } + else + { + aUid.iUid = ECamViewIdStillPreCapture; + } + found = ETrue; + break; + } + // ----------------------------------------------------- + case ECamViewStatePostCapture: + { + if ( aMode == ECamControllerVideo ) + { + aUid.iUid = ECamViewIdVideoPostCapture; + } + else + { + aUid.iUid = ECamViewIdStillPostCapture; + } + found = ETrue; + break; + } + // ----------------------------------------------------- + case ECamViewStateBurstThumbnail: + { + if ( ECamControllerImage == aMode + && ECamImageCaptureBurst == aImageMode ) + { + aUid.iUid = ECamViewIdBurstThumbnail; + // We have view id for multi capture mode + found = ETrue; + } + else + { + // No valid view id + found = EFalse; + } + break; + } + // ----------------------------------------------------- + case ECamViewStateSettings: + { + TUid viewUid = KNullUid; + aMessageUid = KNullUid; + + if ( ECamControllerVideo == aMode ) + { + if ( IsSecondCameraEnabled() ) + { + aMessageUid = TUid::Uid( KGSSecondaryCameraVideoSettingsView ); + } + viewUid = KGSCamVideoSettingsViewId; + } + else + { + if ( IsSecondCameraEnabled() ) + { + aMessageUid = TUid::Uid( KGSSecondaryCameraPhotoSettingsView ); + } + viewUid = KGSCamImageSettingsViewId; + } + + if ( iPlugin ) + { + aUid = viewUid; + found = ETrue; + } + + break; + } + // ----------------------------------------------------- + case ECamViewStateUserSceneSetup: + { + if ( aMode != ECamControllerVideo ) + { + aUid.iUid = ECamViewIdPhotoUserSceneSetup; + // We have a photo user scene setup view id + found = ETrue; + } + else + { + found = EFalse; + } + break; + } + // ----------------------------------------------------- + default: + break; + // ----------------------------------------------------- + } + + return found; + } + +// ---------------------------------------------------- +// CCamAppUi::NaviPaneL +// Return a pointer to the status pane's navi control container +// ---------------------------------------------------- +// +CAknNavigationControlContainer* CCamAppUi::NaviPaneL() + { + return static_cast( + StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); + } + +// --------------------------------------------------------------------------- +// CCamAppUi::UpdateCba +// Update softkeys to reflect current state +// --------------------------------------------------------------------------- +// +void CCamAppUi::UpdateCba() + { + CCamViewBase* view = static_cast( iView ); + TRAP_IGNORE( view->UpdateCbaL() ); + } + +// Added back, but modified the note string resource +// ---------------------------------------------------- +// CCamAppUi::DisplayWaitDialogL +// Displays the wait dialog when saving video +// ---------------------------------------------------- +// +void CCamAppUi::DisplayWaitDialogL() + { +// __ASSERT_DEBUG( iWaitDialog == NULL, CamPanic( ECamPanicUi ) ); + if ( iWaitDialog == NULL ) + { + // Display saving video wait note + // The wait note has its initial delay disabled. This is because the call + // to the engine to stop recording does not return until the video save + // etc. has completed. This does not give the wait dialog a chance to + // receive its timer call back and display itself. + iWaitDialog = new( ELeave ) CCamWaitDialog( + reinterpret_cast( &iWaitDialog ), ETrue ); + iWaitDialog->ExecuteLD( R_CAM_SAVING_VIDEO_WAIT_NOTE ); + // From base class CEikDialog to prevent S60 style CBAs from showing + // unnecessarily + iWaitDialog->ButtonGroupContainer().MakeVisible(EFalse); + } + } + + +// --------------------------------------------------------- +// CCamAppUi::StartupMode +// Get startup capture mode from settings +// --------------------------------------------------------- +// +TCamStartupMode CCamAppUi::StartupMode() const + { + __ASSERT_DEBUG( iRepository, CamPanic( ECamPanicNullPointer ) ); + + TInt value = 0; + TInt err = iRepository->Get( KCamCrDefaultCaptureMode, value ); + TCamStartupMode setting = static_cast( value ); + if ( err == KErrAbort || + err == KErrPermissionDenied || + err == KErrNotFound || + err == KErrArgument ) + { + PRINT1( _L("Camera <> CCamAppUi::StartupMode err=%d"), err ); + CamPanic( ECamPanicDefaultNotFoundInIniFile ); + } + + return setting; + } + +// --------------------------------------------------------- +// CCamAppUi::SaveCaptureMode +// Save current capture mode to settings +// --------------------------------------------------------- +// +void CCamAppUi::SaveCaptureMode() + { + // Since this function can be called from the destructor, it is neccesary + // to check that iRepository is not null prior to use + if ( iRepository && !IsEmbedded() ) + { + switch ( iMode ) + { + case ECamControllerImage: + // Ignore errors + iRepository->Set( KCamCrDefaultCaptureMode, ECamStillCapture ); + break; + case ECamControllerVideo: + // Ignore errors + iRepository->Set( KCamCrDefaultCaptureMode, ECamVideoCapture ); + break; + default: + break; + } + } + } + + +// --------------------------------------------------------- +// CCamAppUi::SaveCourtesyUiState +// Save whether or not the UI should always be drawn. +// --------------------------------------------------------- +// + +void CCamAppUi::SaveCourtesyUiState() + { + // Since this function can be called from the destructor, + // it is neccesary to check that iRepository is not null prior to use + if ( iRepository ) + { + iRepository->Set( KCamCrAlwaysDrawCourtesyUi, + iAlwaysDrawPreCaptureCourtesyUI ); + } + } + + + +// --------------------------------------------------------- +// CCamAppUi::InitCaptureCountL +// Sets up the number of images to be captured +// --------------------------------------------------------- +// +void CCamAppUi::InitCaptureCountL() + { + PRINT( _L("Camera => CCamAppUi::InitCaptureCountL" )) + // If video mode is active, capture count is not used + if ( iMode == ECamControllerImage ) + { + TInt imageCount = 1; + + switch( iImageMode ) + { + case ECamImageCaptureBurst: + // Capture count initially set to 6 for short burst. + // Once long burst is determined we adjust the burst count. + // This approach keeps short burst as fast as possible. + imageCount = KShortBurstCount; + break; + case ECamImageCaptureTimeLapse: + // In timelapse mode set the limit as high as possible, + // unless self-timer is used. In that case only 6 images + // will be captured. + if ( ECamSelfTimerDisabled != iInSelfTimerMode ) + { + imageCount = KShortBurstCount; + } + else + { + imageCount = iMaxBurstCaptureNum; + } + break; + default: + // Single capture mode. Keep 1 as limit. + break; + } + + iController.SetCaptureLimitL( imageCount ); + } + PRINT( _L("Camera <= CCamAppUi::InitCaptureCountL" )) + } + +// --------------------------------------------------------- +// CCamAppUi::SetCaptureMode +// Set the current capture mode +// --------------------------------------------------------- +// +void +CCamAppUi::SetCaptureMode( TCamCameraMode aMode, + TCamImageCaptureMode aImageMode /*= ECamImageCaptureNone*/) + { + iMode = aMode; + iImageMode = aImageMode; + iTargetMode = aMode; + iTargetImageMode = aImageMode; + } + +// --------------------------------------------------------- +// CCamAppUi::SetTitleEmbeddedL +// Set title to the name of embedding application +// --------------------------------------------------------- +// +void CCamAppUi::SetTitleEmbeddedL() + { + if (iParentAppName != NULL ) + { + SetTitleL ( *iParentAppName ); + } + } + +// --------------------------------------------------------- +// CCamAppUi::CheckMemoryL +// Checks if there is sufficient space available for capture +// --------------------------------------------------------- +// +TBool +CCamAppUi::CheckMemoryL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CHECKMEMORYL, + "e_CCamAppUi_CheckMemoryL 1" ); + PRINT( _L("Camera => CCamAppUi::CheckMemoryL") ); + TBool capture = ETrue; + + TCamMediaStorage storeToCheck = ECamMediaStorageCurrent; + + if ( ECamControllerVideo == iController.CurrentMode() && + ECamMediaStorageCard == iController.IntegerSettingValue( ECamSettingItemVideoMediaStorage ) && + IsMemoryFullOrUnavailable( ECamMediaStorageCard ) ) + { + storeToCheck = ECamMediaStorageCard; + } + if(AllMemoriesFullOrUnavailable()) + { + HBufC* text = StringLoader::LoadLC(R_NOTE_TEXT_ALLMEMORY_FULL); + TInt ret = ShowOOMNoteL( *text, EFalse); + capture = EFalse; + CleanupStack::PopAndDestroy(text); + } + else if(IsMemoryFullOrUnavailable( storeToCheck )) + { + HBufC* text = StringLoader::LoadLC(R_NOTE_TEXT_MEMORY_FULL); + CAknStaticNoteDialog* note = new( ELeave ) CAknStaticNoteDialog; + note->PrepareLC( R_CAM_OOM_NOTE_OK_CANCEL); + note->SetTextL( *text ); + iController.StopIdleTimer(); + TInt ret = note->RunDlgLD(); + CleanupStack::PopAndDestroy( text ); + if(EAknSoftkeyOk == ret) + { + //when memoryDialog showed, redraw background + if ( IsDirectViewfinderActive() ) + { + TRAP_IGNORE( HandleCommandL( ECamCmdRedrawScreen ) ); + } + + TInt supportedMemTypes = 0; + TCamMediaStorage currentLocation; + TInt key = ( ECamControllerVideo == iMode ) + ? ECamSettingItemVideoMediaStorage + : ECamSettingItemPhotoMediaStorage; + + if ( iMMCRemoveNoteRequiredOnCapture ) + { + iMMCRemoveNoteRequiredOnCapture = EFalse; + currentLocation = static_cast( + iController. + IntegerSettingValueUnfiltered( key ) ); + } + else + { + currentLocation = static_cast( + iController.IntegerSettingValue( key ) ); + } + if(currentLocation != ECamMediaStoragePhone && + !IsMemoryFullOrUnavailable(ECamMediaStoragePhone)) + { + supportedMemTypes |= AknCommonDialogsDynMem::EMemoryTypePhone; + } + if(currentLocation != ECamMediaStorageCard && + !IsMemoryFullOrUnavailable(ECamMediaStorageCard)) + { + supportedMemTypes |= AknCommonDialogsDynMem::EMemoryTypeMMCExternal; + } + if(currentLocation != ECamMediaStorageMassStorage && + !IsMemoryFullOrUnavailable(ECamMediaStorageMassStorage)) + { + supportedMemTypes |= + AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage; + } + + CAknMemorySelectionDialogMultiDrive* memoryDialog = + CAknMemorySelectionDialogMultiDrive::NewL( + ECFDDialogTypeSelect, + R_CAM_MEMORY_SELECT_DIALOG, + EFalse, + supportedMemTypes ); + TDriveNumber driveNumber = static_cast(KErrNotFound); + CAknCommonDialogsBase::TReturnKey result = + memoryDialog->ExecuteL( driveNumber ); + + if ( result != CAknCommonDialogsBase::TReturnKey( + CAknCommonDialogsBase::ERightSoftkey) ) + { + DriveInfo::TDefaultDrives memVal = + static_cast( + CamUtility::GetDriveTypeFromDriveNumber(driveNumber)); + TInt settingValue = + CamUtility::MapFromSettingsListMemory( memVal ); + iController.SetIntegerSettingValueL(key,settingValue); + } + else + { + //No impl. + } + capture = EFalse; + } + else + { + capture = EFalse; + } + iController.StartIdleTimer(); + } + + PRINT1( _L("Camera <= CCamAppUi::CheckMemoryL, capture ok: %d"), capture ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_CHECKMEMORYL, + "e_CCamAppUi_CheckMemoryL 0" ); + return capture; + } + +// --------------------------------------------------------- +// CCamAppUi::ShowErrorNoteL +// Display error note +// --------------------------------------------------------- +// +void +CCamAppUi::ShowErrorNoteL( TCamMemoryStatus aStatus ) + { + PRINT( _L("Camera => CCamAppUi::ShowErrorNoteL") ); + TInt resourceId; + + TCamMediaStorage currentLocation; + if ( iMode == ECamControllerVideo ) + { + currentLocation = static_cast + ( iController.IntegerSettingValueUnfiltered( ECamSettingItemVideoMediaStorage ) ); + } + else // photo or burst mode + { + currentLocation = static_cast + ( iController.IntegerSettingValueUnfiltered( ECamSettingItemPhotoMediaStorage ) ); + } + TInt NumberOfParameters = 0; + TInt drive; + TFileName path; + TInt DriveError = KErrNone; + + // load text from resource + switch ( aStatus ) + { + case ECamMemoryStatusMassStorageFull: + { + // internal and card both full + resourceId = R_NOTE_TEXT_MASSMEMORY_FULL; + // Get the root path of the memory. + DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ); + DriveError = PathInfo::GetRootPath( path, drive ); + if ( DriveError == KErrNone ) + { + // %U parameter + NumberOfParameters = 1; + } + else + { + // no %U parameter + NumberOfParameters = 0; + } + } + break; + + case ECamMemoryStatusFull: + { + if ( currentLocation == ECamMediaStorageMassStorage ) + { + // internal mass storage full + resourceId = R_NOTE_TEXT_MASSMEMORY_FULL; + // Get the root path of the memory. + DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ); + DriveError = PathInfo::GetRootPath( path, drive ); + } + else if ( currentLocation == ECamMediaStoragePhone ) + { + // internal phone memory full + resourceId = R_NOTE_TEXT_NOT_ENOUGH_DEVICE_MEMORY; + // Get the root path of the memory. + DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, drive ); + DriveError = PathInfo::GetRootPath( path, drive ); + } + else + { + // memory card full + resourceId = R_NOTE_TEXT_NOT_ENOUGH_MEMORY_CARD_DEFAULTNAME; + // Get the root path of the memory. + DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive ); + DriveError = PathInfo::GetRootPath( path, drive ); + } + if ( DriveError == KErrNone ) + { + // %U parameter + NumberOfParameters = 1; + } + else + { + // no %U parameter + NumberOfParameters = 0; + } + + } + break; + + case ECamMemoryStatusInternalFull: + { + if ( currentLocation == ECamMediaStorageMassStorage ) + { + // internal space full + resourceId = R_NOTE_TEXT_MASSMEMORY_FULL; + // Get the root path of the memory. + DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ); + DriveError = PathInfo::GetRootPath( path, drive ); + } + else + { + // internal space full + resourceId = R_NOTE_TEXT_NOT_ENOUGH_DEVICE_MEMORY; + // Get the root path of the memory. + DriveError = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, drive ); + DriveError = PathInfo::GetRootPath( path, drive ); + } + if ( DriveError == KErrNone ) + { + // %U parameter + NumberOfParameters = 1; + } + else + { + // no %U parameter + NumberOfParameters = 0; + } + } + break; + + case ECamMemoryStatusCardNotInserted: // fallthrough + case ECamMemoryStatusCardLocked: + { + // card not present or corrupt or locked + resourceId = R_NOTE_TEXT_CARD_NOT_INSERTED; + } + break; + + case ECamMemoryStatusCardReadOnly: + { + // card read-only + resourceId = R_NOTE_TEXT_CARD_READ_ONLY; + } + break; + + default: + { + // invalid status - don't show note + return; + } + } + + // prevent timeout to standby - stop standby timer + iController.StopIdleTimer(); + + if ( iView && ( iStillCaptureView == iView || iVideoCaptureView == iView ) ) + { + // Precapture view is visible... Enable the non-fading flag here to keep + // viewfinder visible under the note. The non-fading flag is reset when + // getting the EEventFocusGained event + CCoeControl* container = static_cast( iView )->Container(); + if ( container ) + { + RDrawableWindow* window = container->DrawableWindow(); + if ( window ) + { + window->SetNonFading( ETrue ); + } + } + } + if ( NumberOfParameters == 0 ) + { + // set error note text + HBufC* text = StringLoader::LoadLC( resourceId ); + // show error note + CAknStaticNoteDialog* note = new( ELeave ) CAknStaticNoteDialog; + note->PrepareLC( R_CAM_ERROR_NOTE ); + note->SetTextL( *text ); + note->RunDlgLD(); + CleanupStack::PopAndDestroy( text ); + } + else if ( NumberOfParameters == 1 ) + { + // set error note text + HBufC* text = StringLoader::LoadLC( resourceId, path, iEikonEnv ); + // show error note + CAknStaticNoteDialog* note = new( ELeave ) CAknStaticNoteDialog; + note->PrepareLC( R_CAM_ERROR_NOTE ); + note->SetTextL( *text ); + note->RunDlgLD(); + CleanupStack::PopAndDestroy( text ); + } + + // restart standby timer + iController.StartIdleTimer(); + + PRINT( _L("Camera <= CCamAppUi::ShowErrorNoteL") ); + } + +// --------------------------------------------------------- +// CCamAppUi::ShowOOMNoteL +// Display error note for OOM condition +// --------------------------------------------------------- +// +TInt CCamAppUi::ShowOOMNoteL( TDesC& aLabel, TBool aWithCancel ) + { + // prevent timeout to standby - stop standby timer + iController.StopIdleTimer(); + + // show OOM note + CAknStaticNoteDialog* note = new( ELeave ) CAknStaticNoteDialog; + if(aWithCancel) + note->PrepareLC( R_CAM_OOM_NOTE_OK_CANCEL); + else + note->PrepareLC( R_CAM_OOM_NOTE_OK_EMPTY); + note->SetTextL( aLabel ); + TInt ret = note->RunDlgLD(); + + // restart standby timer + iController.StartIdleTimer(); + + return ret; + } + +// --------------------------------------------------------- +// CCamAppUi::ShowMMCRemovalNoteIfRequiredL +// Shows the mmc removal note if it is required +// --------------------------------------------------------- +// +void +CCamAppUi::ShowMMCRemovalNoteIfRequiredL() + { + PRINT( _L("Camera => CCamAppUi::ShowMMCRemovalNoteIfRequiredL") ); + // If we have detected a removal and not shown the note. + if ( iViewState != ECamViewStateStandby && iMMCRemoveNoteRequired ) + { + PRINT( _L("Camera <> Need to show note") ); + + iMMCRemoveNoteRequired = EFalse; + // Show the card not inserted note + if( !iSendAsInProgress ) + { + PRINT( _L("Camera <> showing note..") ); + ShowErrorNoteL( ECamMemoryStatusCardNotInserted ); + PRINT( _L("Camera <> ..done") ); + } + } + if ( IsDirectViewfinderActive() ) + { + TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen)); + } + PRINT( _L("Camera <= CCamAppUi::ShowMMCRemovalNoteIfRequiredL") ); + } + +// --------------------------------------------------------- +// CCamAppUi::CheckMemoryCard +// Check status of the memory card +// --------------------------------------------------------- +// +void CCamAppUi::CheckMemoryCard( TBool& aFull, + TCamMemoryStatus& aStatus, TCamMediaStorage aCurrentLocation ) + { + // check if memory card is full + aFull = MemoryFull( ECamMediaStorageCard, aCurrentLocation ); + + // get status of card + TCamMemoryCardStatus cardStatus = CamUtility::MemoryCardStatus(); + switch ( cardStatus ) + { + case ECamMemoryCardLocked: + { + // card is locked + aStatus = ECamMemoryStatusCardLocked; + } + break; + case ECamMemoryCardInserted: + { + aStatus = ECamMemoryStatusOK; + } + break; + case ECamMemoryCardNotInserted: + default: + { + aStatus = ECamMemoryStatusCardNotInserted; + } + break; + } + } + +// --------------------------------------------------------- +// CCamAppUi::MemoryFull +// Check if the memory location (phone or card) is full +// --------------------------------------------------------- +// +TBool +CCamAppUi::MemoryFull( TCamMediaStorage aStorage, + TCamMediaStorage aCurrentLocation ) + { + PRINT( _L("Camera => CCamAppUi::MemoryFull") ); + TBool cardFull = ETrue; + + if ( iMode != ECamControllerVideo ) + { + // check there is space for image(s) + TInt numImages = iController.ImagesRemaining( aStorage, IsBurstEnabled() ); + + // at least 1 image for still capture and 2 for sequence capture + if ( ( iImageMode == ECamImageCaptureSingle && numImages > 0 ) || + numImages > 1 ) + { + cardFull = EFalse; + } + else + { + cardFull = ETrue; + } + } + else // capture mode is video + { + // If we want to know the remaining time at the current storage location + // we can obtain this from the engine. + if ( aStorage == aCurrentLocation ) + { + TTimeIntervalMicroSeconds timeRemaining = iController.RecordTimeRemaining(); + + // Check that enough rec time available + // or that we are recording short (MMS) video + if ( timeRemaining >= KMemoryFullVideoRemaining ) + { + PRINT( _L("Camera <> not full 1") ); + cardFull = EFalse; + } + else + { + PRINT( _L("Camera <> full 1") ); + cardFull = ETrue; + } + } + else + { + // We want to know how much remaining time is available on the + // storage location not currently in use. + // We don't have a reliable way of estimating this, so we will + // assume that if there is more space available than on the current + // storage location, then the memory is not full. + + TTimeIntervalMicroSeconds phoneMemoryFree = + CamUtility::MemoryFree( DriveInfo::EDefaultPhoneMemory ); + TTimeIntervalMicroSeconds cardMemoryFree = + CamUtility::MemoryFree( DriveInfo::EDefaultRemovableMassStorage ); + TTimeIntervalMicroSeconds MassMemoryFree = + CamUtility::MemoryFree( DriveInfo::EDefaultMassStorage ); + if ( aCurrentLocation == ECamMediaStoragePhone ) + { + if ( phoneMemoryFree > cardMemoryFree + && phoneMemoryFree > MassMemoryFree + ) + { + PRINT( _L("Camera <> full 2") ); + cardFull = ETrue; + } + else + { + PRINT( _L("Camera <> not full 2") ); + cardFull = EFalse; + } + } + else if ( aCurrentLocation == ECamMediaStorageMassStorage ) + { + if ( MassMemoryFree > cardMemoryFree + && MassMemoryFree > phoneMemoryFree ) + { + PRINT( _L("Camera <> full 3") ); + cardFull = ETrue; + } + else + { + PRINT( _L("Camera <> not full 3") ); + cardFull = EFalse; + } + } + else + { + if ( cardMemoryFree > phoneMemoryFree + && cardMemoryFree > MassMemoryFree ) + { + PRINT( _L("Camera <> full 4") ); + cardFull = ETrue; + } + else + { + PRINT( _L("Camera <> not full 4") ); + cardFull = EFalse; + } + } + } + } + + PRINT1( _L("Camera <= CCamAppUi::MemoryFull, full:%d"), cardFull ); + return cardFull; + } + +// --------------------------------------------------------- +// CCamAppUi::StartCaptureL +// Starts the video/photo capture +// --------------------------------------------------------- +// +TKeyResponse +CCamAppUi::StartCaptureL( const TKeyEvent& /*aKeyEvent*/ ) + { + PRINT( _L("Camera => CCamAppUi::StartCaptureL") ); + iLensCoverExit = EFalse; + if ( iMode != ECamControllerVideo ) + { + // Check for active viewfinder before proceeding with capture + if ( !iController.IsViewFinding() ) + { + // VF not active - stop capture + PRINT( _L("Camera <= CCamAppUi::StartCaptureL, not vf") ); + return EKeyWasNotConsumed; + } + // If the view is in self-timer mode, pressing of the shutter + // button initiates the timer... + if ( iInSelfTimerMode != ECamSelfTimerDisabled ) + { + __ASSERT_DEBUG( iSelfTimer, CamPanic( ECamPanicNullPointer ) ); + // Will start timer if not already started. + // If already started, forces capture NOW. + /*iSelfTimer->StartSelfTimer(); + + // Change CBA to be SK1 (Blank) SK2 (Cancel) + UpdateCba();*/ + HandleCommandL(ECamCmdSelfTimerActivate); + } + else // Not in SelfTimer mode so just take the photo. + { + if ( iController.IsProcessingCapture() ) + { + PRINT( _L("Camera <= CCamAppUi::StartCaptureL - already processing - ignored capture key") ); + return EKeyWasNotConsumed; + } + + // Start capture + iController.Capture(); + + // Ensure softkeys are correct for sequence + if ( IsBurstEnabled() ) + { + if( ECamImageCaptureBurst == iImageMode ) + { + //Disable cancel autofocus and capture functionality from now on until burst is finished. + PRINT( _L("Camera <> CCamAppUi::StartCaptureL, SetNoBurstCancel( ETrue )") ); + iController.SetKeyUp(); + iController.SetNoBurstCancel( ETrue ); + } + // Make sure cancel softkey is displayed + iPreventActivePaletteDisplay = ETrue; + static_cast( iView )->UnsetCourtesySoftKeysL(); + // Change CBA to be SK1 (Blank) SK2 (Cancel) + UpdateCba(); + + // disable timeout to standby during burst capture + iController.StopIdleTimer(); + } + } + // Shutter key - full press -> perform capture + PRINT( _L("Camera <= CCamAppUi::StartCaptureL, image capture requested") ); + return EKeyWasConsumed; + } + + // video capture mode + else + { + // check for available space before proceeding with capture + TInt callType( EPSCTsyCallTypeUninitialized ); + RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType ); + // video call or no memory available - stop capture + if ( callType == EPSCTsyCallTypeH324Multimedia || !iController.IsViewFinding() || !CheckMemoryL() ) + { + PRINT( _L("Camera <= CCamAppUi::StartCaptureL, video no memory") ); + return EKeyWasNotConsumed; + } + PERF_EVENT_END_L1( EPerfEventKeyToCapture ); + PERF_EVENT_START_L1( EPerfEventStartVideoRecording ); + static_cast( iView )->UnsetCourtesySoftKeysL(); + iController.StartVideoRecordingL(); + PRINT( _L("Camera <= CCamAppUi::StartCaptureL, video capture requested") ); + return EKeyWasConsumed; + } + } + +// --------------------------------------------------------- +// CCamAppUi::EndCapture +// Stops the capture of video +// --------------------------------------------------------- +// +void CCamAppUi::EndCapture() + { + PRINT( _L("Camera => CCamAppUi::EndCapture") ); + if ( ECamControllerVideo == iMode && !iController.IsDemandKeyRelease() ) + { + TCamCaptureOperation operation = iController.CurrentOperation(); + // if in video recording or paused state + if ( ECamCapturing == operation + || ECamPaused == operation ) + { + // if already requested to stop the recording + // but the operation hasn't completed yet + // then just return + if ( iWaitTimer->IsActive() ) + { + return; + } + + ZoomPane()->StopZoom(); + ZoomPane()->MakeVisible( EFalse, ETrue ); + // ignore any errors (eg out of memory) + TRAP_IGNORE( SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ) ); + TRAP_IGNORE( DisplayWaitDialogL() ); + // give the wait dialog a chance to display itself + iWaitTimer->Start( 0, 0, TCallBack( StopVideoRecording, this ) ); + } + } + PRINT( _L("Camera <= CCamAppUi::EndCapture") ); + } + +// --------------------------------------------------------- +// CCamAppUi::SwitchOrientationIfRequiredL +// Change to the new orientation if necessary +// --------------------------------------------------------- +// +void CCamAppUi::SwitchOrientationIfRequiredL( TInt aNewOrientation ) + { + TInt error = KErrNone; + // No orientation specified, find the default orientation + if ( aNewOrientation == EAppUiOrientationUnspecified ) + { + if ( iController.UiConfigManagerPtr()->IsSecondaryCameraSupported() ) + { + // Default orientation is determined by current active camera + if ( IsSecondCameraEnabled() && !IsQwerty2ndCamera() ) + { + error = CamUtility::GetPsiInt( ECamPsiSecondaryCameraOrientation, aNewOrientation ); + } + else + { + error = CamUtility::GetPsiInt( ECamPsiPrimaryCameraOrientation, aNewOrientation ); + } + } + else + { + error = CamUtility::GetPsiInt( ECamPsiOrientation, aNewOrientation ); + } + } + TAppUiOrientation currentOrientation = Orientation(); + if ( !error && ( aNewOrientation != currentOrientation ) ) + { + PRINT( _L("Camera => CCamAppUi::SwitchOrientationIfRequiredL set orient" )) + SetOrientationL( static_cast( aNewOrientation ) ); + } + } + +// --------------------------------------------------------- +// CCamAppUi::HandleScreenDeviceChangedL +// Handle change of orientation etc. +// --------------------------------------------------------- +// +void CCamAppUi::HandleScreenDeviceChangedL() + { + PRINT( _L("Camera => CCamAppUi::HandleScreenDeviceChangedL") ) + CAknAppUiBase::HandleScreenDeviceChangedL(); + if ( iEngineConstructionDelayed ) + { + PRINT( _L("CCamAppUi::HandleScreenDeviceChangedL continuing engine construction") ); + iEngineConstructionDelayed = EFalse; + iController.CompleteConstructionL(); + // Don't set the target mode here. If the application is not embedded + // the mode will already be correct. If embedded, the target mode is set + // when the HandleNewFileL function is called. + iTargetViewState = ECamViewStatePreCapture; + + // pre-construct side-pane & zoom pane + // get whether we overlay sidepane over view-finder + TBool overlayViewFinder = EFalse; + User::LeaveIfError( CamUtility::GetPsiInt( ECamPsiOverLaySidePane, overlayViewFinder ) ); + + iCamSidePane = CCamSidePane::NewL( iController, overlayViewFinder ); + User::LeaveIfError(iResourceLoaders.Append(iCamSidePane)); + + iCamZoomPane = CCamZoomPane::NewL( iController, overlayViewFinder ); + User::LeaveIfError(iResourceLoaders.Append(iCamZoomPane)); + + // Exit standby mode now + // (unless still waiting for HandleNewFileL command - embedded only) + if ( IsConstructionComplete() ) + { + // make sure standby exits as this may not actually result in + // a view switch if the correct view is already activated + if( iView ) + { + iView->HandleCommandL( ECamCmdExitStandby ); + } + + iViewState = ECamViewStatePreCapture; + TrySwitchViewL(); + } + } + + if ( iController.UiConfigManagerPtr()->IsSecondaryCameraSupported() ) + { + if ( iCameraSwitchDelayed ) + { + PRINT( _L("CCamAppUi::HandleScreenDeviceChangedL restarting switch camera") ); + iCameraSwitchDelayed = EFalse; + iController.SwitchCameraL(); + // The keys will have been blanked - update them + static_cast( iView )->UpdateCbaL(); + } + } + PRINT( _L("Camera <= CCamAppUi::HandleScreenDeviceChangedL") ); + } + +// --------------------------------------------------------- +// CCamAppUi::StopVideoRecording +// Stops the video recording +// --------------------------------------------------------- +// +TInt CCamAppUi::StopVideoRecording( TAny* aAny ) + { + PRINT( _L("Camera => CCamAppUi::StopVideoRecording") ); + CCamAppUi* appui = static_cast( aAny ); + __ASSERT_DEBUG( appui != NULL && appui->iWaitTimer != NULL, CamPanic( ECamPanicNullPointer ) ); + appui->iWaitTimer->Cancel(); + appui->iController.StopVideoRecordingAsync(); + PRINT( _L("Camera <= CCamAppUi::StopVideoRecording") ); + return KErrNone; + } + +// --------------------------------------------------------- +// CCamAppUi::CallExit +// Exit the application +// --------------------------------------------------------- +// +TInt CCamAppUi::CallExit( TAny* aAny ) + { + PRINT( _L("Camera => CCamAppUi::CallExit") ) + CCamAppUi* appui = static_cast( aAny ); + __ASSERT_DEBUG( appui != NULL && appui->iWaitTimer != NULL, CamPanic( ECamPanicNullPointer ) ); + appui->iWaitTimer->Cancel(); + appui->Exit(); + return KErrNone; + } + +// --------------------------------------------------------- +// CCamAppUi::CloseAppL +// Exit the application +// --------------------------------------------------------- +// +void CCamAppUi::CloseAppL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_CLOSEAPPL, "e_CCamAppUi_CloseAppL 1" ); + + PRINT( _L("Camera => CCamAppUi::CloseAppL") ) + + // cancel the self timer if active - can be active + // if closing the slide while counting down + if ( iInSelfTimerMode != ECamSelfTimerDisabled ) + { + SelfTimerEnableL( ECamSelfTimerDisabled ); + } + + // if we are exiting cam app, we dont need any updates + // for the navipane + if ( NULL != iNaviCounterControl && NULL != iNaviPaneCounterControl && + NULL != iNaviProgressBarControl && NULL != iNaviPaneProgressBarControl ) + { + UpdateNaviModelsL( EFalse ); + } + + if ( iEikonEnv->StartedAsServerApp() ) + { + TCamCaptureOperation operation( iController.CurrentOperation() ); + + // If recording a video, ensure exit after video recording process has completed + if( ECamControllerVideo == iMode + && ( ECamCapturing == operation + || ECamPausing == operation + || ECamPaused == operation + || ECamResuming == operation ) ) + { + iController.EnterShutdownMode( EFalse ); + } + // Otherwise, close application immediately. + else + { + iController.EnterShutdownMode( ETrue ); + Exit(); + } + } + else + { + // this will exit when any current process completes + iController.EnterShutdownMode( EFalse ); + } + PRINT( _L("Camera <= CCamAppUi::CloseAppL") ) + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP_CCAMAPPUI_CLOSEAPPL, "e_CCamAppUi_CloseAppL 0" ); + + } + +// --------------------------------------------------------- +// CCamAppUi::InternalExitL +// Exit the application from an internal call - this often means +// just going to the background and resetting the settings/modes +// --------------------------------------------------------- +// +void CCamAppUi::InternalExitL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_INTERNALEXITL, "e_CCamAppUi_InternalExitL 1" ); + + PRINT( _L("Camera => CCamAppUi::InternalExitL") ); + + iController.StoreFaceTrackingValue(); // store the current FT setting + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + // If record location setting is on, stop location trail + if ( ECamLocationOn == iController.IntegerSettingValue( ECamSettingItemRecLocation ) ) + { + // The parameter ETrue for also closing the session to location utility server + // when exiting camera. + iController.StopLocationTrail( ETrue ); + } + } + + if( !iController.IsSavingInProgress() ) + { + iController.ReleaseArray(ETrue); + } + + if ( iEikonEnv->StartedAsServerApp() || !iController.AlwaysOnSupported() ) + { + CloseAppL(); + } + else if ( SettingsLaunchedFromCamera() ) + { + //If internal exit was called from settings, we need to set the camera to + //background before closing it to prevent view switch and that way ensuring + //that all the camera resources are released in exit. + SendCameraAppToBackgroundL(); + CloseAppL(); + } + else + { + // if UI orientetion override is supported or lens cover is not and + // exiting 2ndary camera, set cameraswitch to main camera since + // always starting in maincamera stillmode + if ( iController.UiConfigManagerPtr() && + ( iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() || + !iController.UiConfigManagerPtr()->IsLensCoverSupported() ) && + IsSecondCameraEnabled() ) + { + iController.SetCameraSwitchRequired( ESwitchSecondaryToPrimary ); + } + else if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() ) + { + PRINT( _L("Camera <> SetCameraSwitchRequired -> ESwitchToUnknown") ); + iController.SetCameraSwitchRequired( ESwitchToUnknown ); + } + // cancel the self timer if active - can be active + // if closing the slide while counting down + if ( iInSelfTimerMode != ECamSelfTimerDisabled) + { + SelfTimerEnableL( ECamSelfTimerDisabled ); + } + + if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() ) + { + iController.SliderCloseEventActioned(); + } + + iController.SetEndKeyExitWaiting( EFalse ); + PRINT( _L("Camera CCamAppUi::InternalExitL - setting zoom reset pending") ); + + iCamZoomPane->ResetToDefaultAfterPrepare( ETrue ); + SendCameraAppToBackgroundL(); + + // if faster startup feature is supported, always start in stillmode after exit + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && + iMode == ECamControllerVideo ) + { + PRINT( _L("Camera <> InternalExitL - switching to still precapture") ); + iTargetMode = ECamControllerImage; + iTargetViewState = ECamViewStatePreCapture; + TrySwitchViewL( ETrue ); + } + else if ( iView && iViewState != ECamViewStatePreCapture && iReturnedFromPlugin ) + { + PRINT( _L("Camera: CCamAppUi::InternalExitL - switching to precapture mode") ) + iTargetViewState = ECamViewStatePreCapture; + TrySwitchViewL( ETrue ); + } + + // If the application is already in the background but has not released + // the resources (e.g. it was behind an eikon server window and had not yet set + // the iPretendExit flag) then the view needs to know that the resources should + // be released now. + // This situation occurs when the application is 'pretending' to exit after a + // slider closed event, but the keypad lock note appeared (but only if it was + // in the middle of capturing a sequence as the exit is delayed for the sequence + // to complete). + // HandleFocusLoss() releases the resources in situations where the app was + // 'continuing in the background'. This release of resources will only occur + // once as the iContinueInBackground flag is reset as soon as the resources are + // released. + + if ( iView && iReturnedFromPlugin ) + { + PRINT( _L("Camera InternalExitL calling iView->HandleFocusLossL()") ); + static_cast( iView )->HandleFocusLossL(); + } + // Reset active palette position. As this is done before pretended exit, + // no AP update is needed when the application is returned to foreground + if( iActivePaletteHandler && iReturnedFromPlugin ) + { + iActivePaletteHandler->ResetToDefaultItem(); + // Ensure AP visibility on camera startup (also for 2ndary camera) + // unless UI orientation override is used + if ( iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) + { + iActivePaletteHandler->SetVisibility( EFalse ); + } + else + { + iActivePaletteHandler->SetVisibility( ETrue ); + } + if( ECamViewStatePreCapture == iViewState ) + { + iDrawPreCaptureCourtesyUI = ETrue; + if ( !iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) + { + RaisePreCaptureCourtesyUI(EFalse); + } + + if ( IsSecondCameraEnabled() + && !IsEmbedded() ) + { + if ( ECamControllerVideo == iMode ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD_SECONDARY ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_SECONDARY ); + } + } + } + } + + // Cancel delayed sensor initialization, in case it's still pending when + // internal exit is requested. + if ( iController.UiConfigManagerPtr()->IsOrientationSensorSupported() ) + { + CancelSensorIdle(); + } + + if ( iController.UiConfigManagerPtr()->IsXenonFlashSupported() ) + { + // Reset the flash error status + iController.FlashStatus()->SetFlashError( EFalse ); + } +/*#ifndef __WINS__ + if ( iSendFileInCall ) + { + // bring phone app to fore ground + BringPhoneAppToForeGroundL(); + } +#endif // __WINS__ */ + } + + if ( iView && ( iStillCaptureView == iView || iVideoCaptureView == iView ) + && ShowPostCaptureView() ) + { + SetAssumePostCaptureView( EFalse ); + } + + if( iController.IsViewFinding() ) + { + iController.StopViewFinder(); + iViewFinderStopped = ETrue; + } + + PRINT( _L("Camera <= CCamAppUi::InternalExitL") ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP_CCAMAPPUI_INTERNALEXITL, "e_CCamAppUi_InternalExitL 0" ); + + } + +// --------------------------------------------------------- +// CCamAppUi::CallSwitch +// Switch view +// --------------------------------------------------------- +// +TInt CCamAppUi::CallSwitch( TAny* aAny ) + { + CCamAppUi* appui = static_cast( aAny ); + __ASSERT_DEBUG( appui != NULL, CamPanic( ECamPanicNullPointer ) ); + appui->iWaitTimer->Cancel(); + TRAP_IGNORE( appui->TrySwitchViewL() ); + return KErrNone; + } + + +// --------------------------------------------------------- +// CCamAppUi::AppInBackground +// Whether or not the app is in the background +// --------------------------------------------------------- +// +TBool CCamAppUi::AppInBackground( TBool aIncludeNotifier ) const + { + PRINT1( _L("Camera => CCamAppUi::AppInBackground( %d )" ), aIncludeNotifier ); + TBool aBackground = EFalse; + // Gets the window group id of the app coming in foreground + TInt windowGroupId = iCoeEnv->WsSession().GetFocusWindowGroup(); + + PRINT1( _L("Camera CCamAppUi::AppInBackground windowGroupId=%d" ), windowGroupId ); + + // Check if the window group moving to the front is the AknCapServer. + // This often happens when OOM or out of disk space notes are shown + TBool capServerGroup = CamUtility::IdMatchesName( windowGroupId, KAknCapServer ); + + // AknNotifyServer notifies e.g. Location related events. + TBool nfyServerGroup = CamUtility::IdMatchesName( windowGroupId, KAknNotifyServer ); + + // KPbkSever - Contacts App; Assign to contacts scenario + TBool pbkServerGroup = CamUtility::IdMatchesName( windowGroupId, KPbkServer ); + PRINT1( _L("Camera CCamAppUi::AppInBackground iMyWgId=%d" ), iMyWgId ); + // if the foreground app is not this app + if ( windowGroupId != iMyWgId ) + { + // if another app has the foreground + if ( !capServerGroup + && !nfyServerGroup + && !pbkServerGroup + && windowGroupId != iEikonServerWindowGroupId + && windowGroupId != iBTServerWindowGroupId + ) + { + PRINT(_L("Camera CCamAppUi::AppInBackground non-AKN, non-EIK serv has focus")); + aBackground = ETrue; + } + // if the eikon server has the foreground and we're classing that as + // putting us in the background + else if ( aIncludeNotifier ) + { + // Check whether the new foreground window is an Eikon window + if ( windowGroupId == iEikonServerWindowGroupId ) + { + PRINT(_L("Camera <> CCamAppUi::AppInBackground EIK SERV HAS FOCUS")); + aBackground = ETrue; + } + // Check if AknCapServer is in the foreground (includes other notes) + else if ( capServerGroup ) + { + PRINT(_L("Camera <> CCamAppUi::AppInBackground CAP SERV HAS FOCUS")); + aBackground = ETrue; + } + else if( nfyServerGroup ) + { + PRINT(_L("Camera <> CCamAppUi::AppInBackground Avkon notify server has focus")); + aBackground = ETrue; + } + else if ( windowGroupId == iBTServerWindowGroupId ) + { + PRINT(_L("Camera <> CCamAppUi::AppInBackground BT SERV HAS FOCUS")); + aBackground = ETrue; + } + else // empty statement for lint + { + } + } + else // empty statement for lint + { + } + } + PRINT1( _L("Camera <= CCamAppUi::AppInBackground return(%d)" ), aBackground ); + return aBackground; + } + + +// --------------------------------------------------------- +// CCamAppUi::LaunchHelpL +// Launch the context sensitive help application +// --------------------------------------------------------- +// +void CCamAppUi::LaunchHelpL() + { + PRINT( _L("Camera => CCamAppUi::LaunchHelpL") ); + TCoeHelpContext helpContext; + helpContext.iMajor = TUid::Uid( KCameraappUID ); + + // Check which view is active to obtain the help context + TVwsViewId currentViewId; + TInt err = GetActiveViewId( currentViewId ); + if ( err == KErrNone ) + { + switch ( currentViewId.iViewUid.iUid ) + { + case ECamViewIdStillPreCapture: + // Still precapture can have multiple modes. We must ask it + // for the current context. + iStillCaptureView->GetHelpContext( helpContext ); + break; + case ECamViewIdStillPostCapture: + helpContext.iContext = KLCAM_HLP_POST_PHOTO; + break; + case ECamViewIdVideoPreCapture: + // Video precapture can have multiple modes. We must ask it + // for the current context. + iVideoCaptureView->GetHelpContext( helpContext ); + break; + case ECamViewIdVideoPostCapture: + helpContext.iContext = KLCAM_HLP_POST_VIDEO; + break; + case ECamViewIdBurstThumbnail: + helpContext.iContext = KLCAM_HLP_POST_SEQ; + break; + case ECamViewIdVideoSettings: + helpContext.iContext = KLCAM_HLP_SETTINGS_VIDEO; + break; + case ECamViewIdPhotoSettings: + helpContext.iContext = KLCAM_HLP_SETTINGS_PHOTO; + break; + case ECamViewIdPhotoUserSceneSetup: + helpContext.iContext = KLCAM_HLP_SETTINGS_PHOUSER; + break; + default: + break; + } + } + else if ( err == KErrNotFound && iPreCaptureMode == ECamPreCapStandby ) + { + // This is a work-around for the problem of GetActiveViewId() + // returning -1 when in the Standby view. + if ( IsEmbedded() ) + { + helpContext.iContext = KLCAM_HLP_STANDYBY_EM; + } + else + { + helpContext.iContext = KLCAM_HLP_STANDYBY_EM; + } + } + else + { + User::Leave( err ); + } + + PRINT1( _L("Camera <> CCamAppUi::LaunchHelpL, help context: %S"), &(helpContext.iContext) ); + + // Create the context array and append the single context item + CArrayFix* contextArray = + new ( ELeave ) CArrayFixFlat ( 1 ); + + CleanupStack::PushL( contextArray ); + contextArray->AppendL( helpContext ); + CleanupStack::Pop( contextArray ); + + //Launch help - takes ownership of context array + HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), + contextArray ); + + PRINT( _L("Camera <= CCamAppUi::LaunchHelpL") ); + } + +#ifndef __WINS__ +// --------------------------------------------------------- +// CCamAppUi::ProcessCommandParametersL +// Allow Camera application to respond to request for in-call send +// functionality from Phone application +// --------------------------------------------------------- +// +TBool CCamAppUi::ProcessCommandParametersL( + TApaCommand aCommand, + TFileName& aDocumentName, + const TDesC8& /*aTail*/ ) + { + PRINT( _L("CCamAppUi::ProcessCommandParametersL") ); + // Check if we should start in SFI mode +/* if ( aCommand == EApaCommandOpen && aDocumentName == KSFITrailing ) + { + if ( !SFIUtility() ) + { + PRINT( _L("CCamAppUi::ProcessCommandParametersL !!") ); + return EFalse; + } + SFIUtility()->IsCLIValidL(); + + iSendFileInCall = ETrue; + PRINT( _L("CCamAppUi::ProcessCommandParametersL iSendFileInCall = ETrue") ); + // Make sure that the static settings are loaded + iController.LoadStaticSettingsL( ETrue ); + }*/ + return EFalse; + } + +// --------------------------------------------------------- +// CCamAppUi::HandleMessageL +// Bring Camera app to foreground in response to request for in-call send +// --------------------------------------------------------- +// +MCoeMessageObserver::TMessageResponse CCamAppUi::HandleMessageL( + TUint32 aClientHandleOfTargetWindowGroup, + TUid aMessageUid, + const TDesC8& aMessageParameters ) + { + PRINT( _L("CCamAppUi::HandleMessageL") ); + // Go to SFI mode at run-time if requested by SFIUtils + // using a window server message. + if ( aMessageUid.iUid == 0 && aMessageParameters.Length() > 0 ) + { + TInt lengthInCharacters = + ( aMessageParameters.Length() * sizeof( TUint8 ) ) / + sizeof( TUint16 ); + TPtrC message( + reinterpret_cast( aMessageParameters.Ptr() ), + lengthInCharacters ); + + /*if ( message == KSFITrailing ) + { + if ( !SFIUtility() ) + { + // Jump to foreground anyway, even if SFI mode cannot + // be activated. + iEikonEnv->RootWin().SetOrdinalPosition( 0, 0 ); + return CAknAppUi::HandleMessageL( + aClientHandleOfTargetWindowGroup, + aMessageUid, + aMessageParameters ); + } + + SFIUtility()->IsCLIValidL(); + + iSendFileInCall = ETrue; + PRINT( _L("CCamAppUi::HandleMessageL iSendFileInCall = ETrue") ); + + // Jump to foreground + iEikonEnv->RootWin().SetOrdinalPosition( 0, 0 ); + + // load embedded static settings + iController.LoadStaticSettingsL( ETrue ); + }*/ + } + return CAknAppUi::HandleMessageL( aClientHandleOfTargetWindowGroup, + aMessageUid, aMessageParameters); + } + +#endif // HANDLE_TRANSITIONAL_UI + +// --------------------------------------------------------- +// CCamAppUi::SidePane +// Return reference to side-pane object +// --------------------------------------------------------- +// +CCamSidePane* CCamAppUi::SidePane() + { + return iCamSidePane; + } + +// --------------------------------------------------------- +// CCamAppUi::ZoomPane +// Return reference to zoom-pane object +// --------------------------------------------------------- +// +CCamZoomPane* CCamAppUi::ZoomPane() + { + return iCamZoomPane; + } + +// --------------------------------------------------------- +// CCamAppUi::CurrentViewState +// Return current view state +// --------------------------------------------------------- +// +TCamViewState CCamAppUi::CurrentViewState() const + { + return iViewState; + } + +// --------------------------------------------------------- +// CCamAppUi::TargetViewState +// Returns target view state +// --------------------------------------------------------- +// +TCamViewState CCamAppUi::TargetViewState() + { + return iTargetViewState; + } + +// --------------------------------------------------------- +// CCamAppUi::TargetMode +// --------------------------------------------------------- +// +TCamCameraMode CCamAppUi::TargetMode() const + { + return iTargetMode; + } + +// --------------------------------------------------------- +// CCamAppUi::HandleShutterKeyL +// Handles the shutter key press +// --------------------------------------------------------- +// +void CCamAppUi::HandleShutterKeyL( TBool aPressed ) + { + // only handle the shutter key if the app is + // in the foreground and view finder is active + if ( !AppInBackground( ETrue ) ) + { + RArray captureKeys; + CleanupClosePushL( captureKeys ); + + if ( iController.UiConfigManagerPtr() ) + { + iController.UiConfigManagerPtr()-> + SupportedPrimaryCameraCaptureKeyL( captureKeys ); + if ( captureKeys.Count() <= 0 ) + { + User::Leave( KErrNotSupported ); + } + } + TKeyEvent keyEvent; + keyEvent.iScanCode = captureKeys[0];//EProductKeyCapture + keyEvent.iModifiers = 0; + keyEvent.iRepeats = 0; + + CleanupStack::PopAndDestroy( &captureKeys ); + + // check we have a currently active view + if( iView ) + { + CCoeControl* container = static_cast( iView )->Container(); + if ( container ) + { + if ( aPressed ) + { + container->OfferKeyEventL( keyEvent, EEventKeyDown ); + } + else + { + container->OfferKeyEventL( keyEvent, EEventKeyUp ); + } + } + } + } + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::HandleVolumeKeyEvent +// +// --------------------------------------------------------------------------- +// +void CCamAppUi::HandleVolumeKeyEvent( TRemConCoreApiOperationId aOperationId, + TRemConCoreApiButtonAction aButtonAct ) + { + PRINT2( _L("Camera => CCamAppUi::HandleVolumeKeyEvent op (%d) act (%d)"), aOperationId, aButtonAct ) + + if ( !iZoomUsingVolumeKeys ) + { + PRINT( _L("Camera <= CCamAppUi::HandleVolumeKeyEvent NOT zooming with volume keys") ) + return; + } + // only handle the shutter key if the app is + // in the foreground and view finder is active + if ( !AppInBackground( ETrue ) ) + { + PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent yes")) + // check we have a currently active view + if( iView && ( iCamOrientation == ECamOrientationCamcorder + || iCamOrientation == ECamOrientationCamcorderLeft) && + ECamViewStatePreCapture == iViewState ) // Zoom only needed in precap + { + CCoeControl* container = static_cast( iView )->Container(); + if ( container ) + { + PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent cont")) + TKeyEvent keyEvent; + keyEvent.iModifiers = 0; + keyEvent.iRepeats = 0; + + // map up/down to appropriate zoom key + if( aOperationId == ERemConCoreApiVolumeUp ) + { + PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent up")) + keyEvent.iScanCode = EStdKeyIncVolume; + } + else if( aOperationId == ERemConCoreApiVolumeDown ) + { + PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent down")) + keyEvent.iScanCode = EStdKeyDecVolume; + } + else + { + PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent ??")) + } + // map event type + if ( aButtonAct == ERemConCoreApiButtonPress ) + { + PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent press")) + TRAP_IGNORE( container->OfferKeyEventL( keyEvent, EEventKeyDown ) ); + } + else if( aButtonAct == ERemConCoreApiButtonRelease ) + { + PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent release")) + TRAP_IGNORE( container->OfferKeyEventL( keyEvent, EEventKeyUp ) ); + } + else if( aButtonAct == ERemConCoreApiButtonClick ) + { + PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent click")) + TRAP_IGNORE( container->OfferKeyEventL( keyEvent, EEventUser ) ); + } + else + { + PRINT( _L("Camera <> CCamAppUi::HandleVolumeKeyEvent unhandled volume keypress")) + } + } + } + } + PRINT( _L("Camera <= CCamAppUi::HandleVolumeKeyEvent")) + } + + +// --------------------------------------------------------- +// CCamAppUi::SetEmbedding +// Sets embedding flag +// --------------------------------------------------------- +// +void CCamAppUi::SetEmbedding( TBool aEmbedding ) + { + PRINT1( _L("Camera => CCamAppUi::SetEmbedding %d"), aEmbedding ) + iEmbedding = aEmbedding; + PRINT( _L("Camera <= CCamAppUi::SetEmbedding") ) + } + +// --------------------------------------------------------- +// CCamAppUi::Embedding +// Returns embedding flag +// --------------------------------------------------------- +// +TBool CCamAppUi::Embedding() const + { + PRINT1( _L("Camera => CCamAppUi::Embedding %d"), iEmbedding ) + PRINT( _L("Camera <= CCamAppUi::Embedding") ) + return iEmbedding; + } + +// --------------------------------------------------------- +// CCamAppUi::SetSendAsInProgressL +// Sets the SendAs flag +// --------------------------------------------------------- +// +void CCamAppUi::SetSendAsInProgressL( TBool aSendAsInProgress ) + { + PRINT1( _L("Camera => CCamAppUi::SetSendAsInProgressL %d"), aSendAsInProgress ); + // Check before updating embedding status. + TBool exitStatus = iController.CheckExitStatus(); + + iSendAsInProgress = aSendAsInProgress; + SetEmbedding( aSendAsInProgress ); + + if ( !iSendAsInProgress ) + { + PRINT( _L("Camera <> CCamAppUi::SetSendAsInProgressL - checking exit status..") ); + // Exit not wanted when embedding / embedded + // Check if camera switch is required. + if ( exitStatus ) + { + InternalExitL(); + } + else if ( iPendingViewSwitch != EPendingViewSwitchNone ) + { + iPendingViewSwitch = EPendingViewSwitchNone; + iWaitTimer->Start( 0, 0, TCallBack( CallSwitch, this ) ); + } + else + { + // Do nothing + } + } + PRINT( _L("Camera <= CCamAppUi::SetSendAsInProgressL") ); + } + +// --------------------------------------------------------- +// CCamAppUi::SendAsInProgressL +// Get the SendAs flag value +// --------------------------------------------------------- +// +TBool CCamAppUi::SendAsInProgress() const + { + return iSendAsInProgress; + } + + +// --------------------------------------------------------- +// CCamAppUi::IsMMCRemoveNotePending +// Return whether an MMC removal note is pending +// --------------------------------------------------------- +// +TBool CCamAppUi::IsMMCRemovedNotePending() const + { + if ( iMMCRemoveNoteRequired || iMMCRemoveNoteRequiredOnCapture ) + { + return ETrue; + } + else + { + return EFalse; + } + } + +// --------------------------------------------------------- +// CCamAppUi::HandleCameraErrorL +// Display an error note +// --------------------------------------------------------- +// +void CCamAppUi::HandleCameraErrorL( TInt aError ) + { + if( aError == KErrNoMemory ) + { + PRINT( _L( "Camera => CCamAppUi::HandleCameraErrorL KErrNoMemory" ) ); + HBufC* text = StringLoader::LoadLC( R_CAM_MEMLO_NOT_ENOUGH_MEMORY ); + // Display an error note + CAknErrorNote* dlg = new (ELeave) CAknErrorNote( ETrue ); + dlg->ExecuteLD( *text ); + + CleanupStack::PopAndDestroy( text ); + } + else if ( aError ) + { + PRINT1( _L( "Camera => CCamAppUi::HandleCameraErrorL (%d)" ), aError ); + + // Resolve the error text with no context or separator + TPtrC buf; + buf.Set( iTextResolver->ResolveErrorString( aError, CTextResolver::ECtxNoCtxNoSeparator ) ); + + // Display an error note + CAknErrorNote* dlg = new (ELeave) CAknErrorNote( ETrue ); + dlg->ExecuteLD( buf ); + + PRINT( _L( "Camera <= CCamAppUi::HandleCameraErrorL" ) ); + } + else + { + } + } + +// --------------------------------------------------------- +// CCamAppUi::TextResolver +// Offers a reference to appui's TextResolver instance +// --------------------------------------------------------- +// +CTextResolver* CCamAppUi::TextResolver() + { + return iTextResolver; + } + + +#ifndef __WINS__ +// --------------------------------------------------------- +// CCamAppUi::SFIUtility +// Return pointer to in-call send utility object +// --------------------------------------------------------- +// +/*CSFIUtilsAppInterface* CCamAppUi::SFIUtility() const + { + return iSFIUtils; + }*/ + +// --------------------------------------------------------- +// CCamAppUi::IsInCallSend +// Return whether in in-call send mode +// --------------------------------------------------------- +// +/*TBool CCamAppUi::IsInCallSend() const + { + return iSendFileInCall; + }*/ + +// --------------------------------------------------------------------------- +// CCamAppUi::DoInCallSendL +// Handle send to caller functionality +// --------------------------------------------------------------------------- +// +/*void CCamAppUi::DoInCallSendL() const + { + PRINT( _L("CCamAppUi::DoInCallSendL in") ); + if ( iSFIUtils && iSFIUtils->IsCLIValidL() ) + { + PRINT( _L("CCamAppUi::DoInCallSendL send") ); + iSFIUtils->SendMediaFileL( iController.CurrentFullFileName() ); + } + PRINT( _L("CCamAppUi::DoInCallSendL out") ); + } */ + +// --------------------------------------------------------------------------- +// CCamAppUi::BringPhoneAppToForeGroundL +// Bring phone application to foreground +// --------------------------------------------------------------------------- +// +void CCamAppUi::BringPhoneAppToForeGroundL() + { + PRINT( _L("CCamAppUi::BringPhoneAppToForeGroundL") ); + TApaTaskList apaTaskList( CCoeEnv::Static()->WsSession() ); + TApaTask apaTask = apaTaskList.FindApp( KPhoneAppUid ); + if ( apaTask.Exists() ) + { + apaTask.BringToForeground(); + } + + // load non-embedded static settings + iController.LoadStaticSettingsL( EFalse ); + // no longer in SFI state +// iSendFileInCall = EFalse; + + // set us back to pre-capture + iTargetViewState = ECamViewStatePreCapture; + // when camera is used again, TrySwitchViewL() will be called + iPendingViewSwitch = EPendingViewSwitchDeactivateFirst; + + PRINT( _L("CCamAppUi::BringPhoneAppToForeGroundL iSendFileInCall = EFalse") ); + } + +#endif + +// --------------------------------------------------------- +// CCamAppUi::IsInPretendExit +// Indicates whether or not the application is in a simulated exit situation +// --------------------------------------------------------- +// +TBool CCamAppUi::IsInPretendExit() const + { + return iPretendExit; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SendCameraAppToBackgroundL +// Sends the camera application to the background, to pretend we're closing +// --------------------------------------------------------------------------- +// +void CCamAppUi::SendCameraAppToBackgroundL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMAPPUI_SENDCAMERAAPPTOBACKGROUNDL, "e_CCamAppUi_SendCameraAppToBackgroundL 1" ); + + PRINT( _L("Camera => CCamAppUi::SendCameraAppToBackgroundL") ); + // Pretend we're closing, so reset the dynamic settings. + iController.SetDynamicSettingsToDefaults(); + + // stop listening mmc dismount notifications + iController.CancelDismountMonitoring(); + + // Switch sequence capture off if the app is going to pretend to close + if ( IsBurstEnabled() ) + { + PRINT( _L("CCamAppUi::SendCameraAppToBackgroundL calling ToggleMulti") ); + SwitchStillCaptureModeL( ECamImageCaptureSingle, EFalse ); + } + + // Send the task with the given WgId to the background + CAknSgcClient::MoveApp( iMyWgId, ESgcMoveAppToBackground ); + + // Hide from task list/FSW and send to background + HideTaskL( ETrue ); + iPretendExit = ETrue; + iFirstVFStart = ETrue; + + PRINT( _L("Camera <= CCamAppUi::SendCameraAppToBackgroundL") ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMAPPUI_SENDCAMERAAPPTOBACKGROUNDL, "e_CCamAppUi_SendCameraAppToBackgroundL 0" ); + + } + +// --------------------------------------------------------------------------- +// CCamAppUi::HideTaskL +// Hides or shows the Camera app task in the tasklist +// --------------------------------------------------------------------------- +// +void CCamAppUi::HideTaskL(TBool aHide) + { + // HideApplicationFromFSW also hides running status from menu grid + HideApplicationFromFSW( aHide ); + + // The following ensures that the task is hidden even if an embedded camera app is also running + RWsSession session = iEikonEnv->WsSession(); + CApaWindowGroupName* wgName = CApaWindowGroupName::NewL( session, iMyWgId ); + wgName->SetHidden( aHide ); + wgName->SetWindowGroupName( iEikonEnv->RootWin() ); + delete wgName; + } + +// --------------------------------------------------------- +// CCamAppUi::StartAsServerAppL +// Start application as file server application +// --------------------------------------------------------- +// +void +CCamAppUi::StartAsServerAppL( MCamEmbeddedObserver* aEmbeddedObserver, + TInt aMode ) + { + PRINT( _L("Camera => CCamAppUi::StartAsServerAppL") ); + + __ASSERT_ALWAYS( aMode == ECamControllerVideo || aMode == ECamControllerImage, + CamPanic( ECamPanicNotSupported ) ); + + // Load Embedded Settings + iController.LoadStaticSettingsL( ETrue ); + iEmbeddedViewSet = ETrue; + iEmbeddedObserver = aEmbeddedObserver; + iTargetViewState = ECamViewStatePreCapture; + + + if ( aMode == ECamControllerVideo ) + { + iTargetMode = ECamControllerVideo; + } + else if ( aMode == ECamControllerImage ) + { + iTargetMode = ECamControllerImage; + } + + // Find the parent app's name: + + RWsSession ws = iEikonEnv->WsSession(); + + // Get a list of the names and IDs of the all the window groups + RArray windowList; + CleanupClosePushL(windowList); + + // Get a list of window group IDs + User::LeaveIfError(ws.WindowGroupList(&windowList)); + + // Find our window group ID + RThread thread; + TInt cameraWindowGroup = ws.FindWindowGroupIdentifier(0, thread.Id()); + thread.Close(); + + TInt parentID = 0; + TBool found = EFalse; + + // Find our window ID in the list, to look up the parent ID + for( TInt i = 0; !found && i < windowList.Count(); i++ ) + { + RWsSession::TWindowGroupChainInfo windowInfo = windowList[i]; + if ( windowInfo.iId == cameraWindowGroup ) + { + parentID = windowInfo.iParentId; + found = ETrue; + } + } + + CleanupStack::PopAndDestroy(&windowList); + + if ( found ) + { + TBuf<100> windowName; + ws.GetWindowGroupNameFromIdentifier( parentID, windowName ); + + // The format of windowName is: + // [number][zero-char][UID of app][zero-char][Title of window][zero-char] + // We want to discard everything up to the window title: + for ( TInt t = 0; t < 2; t++ ) + { + TInt zeroPos = windowName.Locate(0); + + if ( zeroPos != KErrNotFound + && zeroPos < windowName.Length() ) + { + windowName.Delete(0, zeroPos + 1); + } + } + + // And the final zero-char + if ( windowName.Length() > 0 ) + { + if ( windowName[windowName.Length() - 1] == 0 ) + { + windowName.Delete(windowName.Length() - 1, 1); + } + } + + if ( windowName.Length() > 0 ) + { + iParentAppName = HBufC::NewL(windowName.Length()); + iParentAppName->Des().Copy(windowName); + + SetTitleL(windowName); + } + else + { + // Something's wrong - act as if we haven't found it + found = EFalse; + } + } + + // We were unable to find the parent app's name, so fall back on our own app title + if( !found ) + { + iParentAppName = StringLoader::LoadL(R_CAM_GENERIC_TITLE_NAME); + } + + // make sure standby exits as this may not actually result in + // a view switch if the correct view is already activated + if( iView ) + { + iView->HandleCommandL( ECamCmdExitStandby ); + } + iViewState = ECamViewStatePreCapture; + iTargetViewState = ECamViewStatePreCapture; + TrySwitchViewL(); + + + PRINT( _L("Camera <= CCamAppUi::StartAsServerAppL") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::CamOrientation +// Returns the current orientation of the app +// --------------------------------------------------------------------------- +// +TCamOrientation CCamAppUi::CamOrientation() + { + return iCamOrientation; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SetCamOrientationToLandscape() +// Set the current orientation as landscape +// --------------------------------------------------------------------------- +// +void CCamAppUi::SetCamOrientationToLandscape() + { + iCamOrientation = (ECamHandLeft == iSoftkeyPosition ) + ? ECamOrientationCamcorderLeft + : ECamOrientationCamcorder; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::AppUiOrientation +// Returns the AppUi orientation (e.g. Portrait or Landscape) for the given product-specific orientation +// --------------------------------------------------------------------------- +// +CAknAppUiBase::TAppUiOrientation CCamAppUi::AppUiOrientation(TCamOrientation aCamOrientation) + { + switch ( aCamOrientation ) + { + case ECamOrientationCamcorder: // fallthrough + case ECamOrientationCamcorderLeft: + { + return CAknAppUiBase::EAppUiOrientationLandscape; + } + case ECamOrientationViewMode: + { + return CAknAppUiBase::EAppUiOrientationLandscape; + } + case ECamOrientationPortrait: + { + return CAknAppUiBase::EAppUiOrientationPortrait; + } + default: + { + return CAknAppUiBase::EAppUiOrientationUnspecified; + } + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::LayoutStateToOrientation +// Returns the camera orientation based on the layout state set by the phone +// --------------------------------------------------------------------------- +// +TCamOrientation CCamAppUi::LayoutStateToOrientation( TInt aLayoutState ) + { + TCamOrientation orientation = ECamOrientationDefault; + +#ifdef __WINS__ + switch(aLayoutState) + { + // Emulator numbers + case 2: + orientation = ECamOrientationPortrait; + break; + case 6: + if( iSoftkeyPosition == ECamHandLeft ) + { + orientation = ECamOrientationCamcorderLeft; + } + else + { + orientation = ECamOrientationCamcorder; + } + break; + } +#else // !__WINS__ + switch(aLayoutState) + { + // Magic number alert! + // These numbers come from AknPriv.rss, where they are currently hardcoded + case 0: + orientation = ECamOrientationPortrait; + break; + case 1: + if( iSoftkeyPosition == ECamHandLeft ) + { + orientation = ECamOrientationCamcorderLeft; + } + else + { + orientation = ECamOrientationCamcorder; + } + break; + case 2: + orientation = ECamOrientationViewMode; + break; + case 3: + orientation = ECamOrientationPortrait; + break; + default: + orientation = ECamOrientationDefault; + break; + } +#endif // __WINS__ + + return orientation; + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::ReadCurrentDeviceOrientation +// Returns the camera orientation based on the layout state set by the phone +// --------------------------------------------------------------------------- +// +TCamOrientation CCamAppUi::ReadCurrentDeviceOrientation() + { + PRINT( _L("Camera <> CCamAppUi::ReadCurrentDeviceOrientation") ) + return ECamOrientationDefault; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::ActivePalette +// Return handle to Active Palette +// --------------------------------------------------------------------------- +// +MActivePalette2UI* CCamAppUi::ActivePalette() const + { + return iActivePaletteHandler->ActivePalette(); + } + +// --------------------------------------------------------------------------- +// CCamAppUi::APHandler +// Returns pointer to Active Palette handler +// --------------------------------------------------------------------------- +// +CCamActivePaletteHandler* CCamAppUi::APHandler() const + { + return iActivePaletteHandler; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::DrawPreCaptureCourtesyUI +// Returns whether the optional precapture UI should be currently shown +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::DrawPreCaptureCourtesyUI() const + { + if ( CourtesyUiApplies() ) + { + return iDrawPreCaptureCourtesyUI; + } + else + { + // Otherwise always draw the UI + return ETrue; + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::DrawPostCaptureCourtesyUI +// Returns whether the optional postcapture UI should be currently shown +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::DrawPostCaptureCourtesyUI() const + { + if ( CourtesyUiApplies() ) + { + return iDrawPostCaptureCourtesyUI; + } + else + { + // Otherwise always draw the UI + return ETrue; + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::AlwaysDrawPreCaptureCourtesyUI +// Returns whether the optional precapture UI should always be shown +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::AlwaysDrawPreCaptureCourtesyUI() const + { + return iAlwaysDrawPreCaptureCourtesyUI; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::AlwaysDrawPostCaptureCourtesyUI +// Returns whether the optional postcapture UI should always be shown +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::AlwaysDrawPostCaptureCourtesyUI() const + { + return iAlwaysDrawPostCaptureCourtesyUI; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SetAlwaysDrawPreCaptureCourtesyUI +// Set whether the optional precapture UI should always be shown +// --------------------------------------------------------------------------- +// +void CCamAppUi::SetAlwaysDrawPreCaptureCourtesyUI( TBool aNewSetting ) + { + iAlwaysDrawPreCaptureCourtesyUI = aNewSetting; + + if ( aNewSetting ) + { + RaisePreCaptureCourtesyUI(EFalse); + } + else + { + SubmergePreCaptureCourtesyUI(); + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SetAlwaysDrawPostCaptureCourtesyUI +// Set whether the optional postcapture UI should always be shown +// --------------------------------------------------------------------------- +// +void CCamAppUi::SetAlwaysDrawPostCaptureCourtesyUI(TBool aNewSetting) + { + iAlwaysDrawPostCaptureCourtesyUI = aNewSetting; + + if ( aNewSetting ) + { + RaisePostCaptureCourtesyUI(); + } + else + { + SubmergePostCaptureCourtesyUI(); + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::CourtesyTimeout +// Called after 15 seconds of key inactivity +// --------------------------------------------------------------------------- +// +TInt CCamAppUi::CourtesyTimeout( TAny* aPtr ) + { + return static_cast( aPtr )->DoCourtesyTimeout(); + } + +// --------------------------------------------------------------------------- +// CCamAppUi::DoCourtesyTimeoutL +// Called after 15 seconds of key inactivity +// --------------------------------------------------------------------------- +// +TInt CCamAppUi::DoCourtesyTimeout() + { + if ( iCourtesyTimerInPreCapture ) + { + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* toolbar = CurrentFixedToolbar(); + if ( toolbar ) + { + CAknToolbarExtension* toolbarextension = + toolbar->ToolbarExtension(); + if ( toolbarextension && toolbarextension->IsShown() ) + { + // Do not hide courtesy UI when toolbar extension is open + + return EFalse; + } + } + } + iDrawPreCaptureCourtesyUI = EFalse; + SubmergePreCaptureCourtesyUI(); + } + + iCourtesyTimer->Cancel(); + + return EFalse; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::CheckCourtesyKeyEventL +// Check whether the current key event should raise the optional UI +// --------------------------------------------------------------------------- +// +TKeyResponse CCamAppUi::CheckCourtesyKeyEventL( + const TKeyEvent aKeyEvent, + TEventCode aType, + TBool aInPreCapture ) + { + PRINT(_L("Camera => CheckCourtesyKeyEventL")) + + TKeyResponse retVal = EKeyWasNotConsumed; + + if ( CourtesyUiApplies() ) + { + // Always reset the timer on any key event, if appropriate + if( ( ( aInPreCapture && !iAlwaysDrawPreCaptureCourtesyUI ) + || ( !aInPreCapture && !iAlwaysDrawPostCaptureCourtesyUI ) + ) + && + ( ( aInPreCapture && iDrawPreCaptureCourtesyUI ) + || (!aInPreCapture && iDrawPostCaptureCourtesyUI ) + ) + ) + { + iCourtesyTimer->Cancel(); + iCourtesyTimer->StartTimer(); + iCourtesyTimerInPreCapture = aInPreCapture; + } + // Here we check if the LSK key is pressed by using the scan code + // We do this, to show the active tool bar when LSK is pressed when + // the AP tool bar is hidden AND Pressing "RSK" shall have to return + // to PreCaptureView (Image/Video mode) + // LSK --> Left Softkey + // RSK --> Right Softkey + if ( aType == EEventKeyDown && + aKeyEvent.iScanCode == EStdKeyDevice0 ) + { + iLeftSoftKeyPressed = ETrue; + } + else + { + iLeftSoftKeyPressed = EFalse; + } + + if ( iController.UiConfigManagerPtr() && + !iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + if ( aType == EEventKey && + aKeyEvent.iScanCode == EStdKeyNo ) + { + iEndKeyPressed = ETrue; + } + else + { + iEndKeyPressed = EFalse; + } + } + + const TCamCaptureOperation operation( iController.CurrentOperation() ); + if ( aType == EEventKey ) + { + if ( EStdKeyRightArrow == aKeyEvent.iScanCode && !iController.IsTouchScreenSupported() ) + { + if( aInPreCapture ) + { + // during sequence capturing, Navi-Right is inactive to affect CourtesyUI + if ( !( IsBurstEnabled() && ( ECamCapturing == operation || ECamCompleting == operation ) ) ) + { + iDrawPreCaptureCourtesyUI = EFalse; + if ( !IsSecondCameraEnabled() ) + { + SubmergePreCaptureCourtesyUI(); + } + else if ( !IsEmbedded() ) + { + SetActivePaletteVisibility( EFalse ); + if ( ECamControllerVideo == iMode ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD_TXT ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_TXT ); + } + } + } + } + else + { + iDrawPostCaptureCourtesyUI = EFalse; + if ( !IsSecondCameraEnabled() ) + { + SubmergePostCaptureCourtesyUI(); + } + else + { + SetActivePaletteVisibility( EFalse ); + } + } + return EKeyWasConsumed; + } + + else if ( ( EStdKeyLeftArrow == aKeyEvent.iScanCode + || (!aInPreCapture && EStdKeyDevice3 == aKeyEvent.iScanCode && !IsToolBarVisible() ) ) + && !iController.IsTouchScreenSupported() ) + { + iRotatedKeyEvent = ETrue; + if( aInPreCapture ) + { + // during sequence capturing, Navi-Left is inactive to affect CourtesyUI + if ( !( IsBurstEnabled() && ( ECamCapturing == operation || ECamCompleting == operation ) ) ) + { + iDrawPreCaptureCourtesyUI = ETrue; + RaisePreCaptureCourtesyUI(EFalse); + + if ( /*IsSecondCameraEnabled() + &&*/ !IsEmbedded() ) + { + if ( ECamControllerVideo == iMode ) + { + IsSecondCameraEnabled()?SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD_SECONDARY ): + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD ); + } + else + { + IsSecondCameraEnabled()?SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_SECONDARY ): + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE ); + } + } + } + } + else + { + iDrawPostCaptureCourtesyUI = ETrue; + RaisePostCaptureCourtesyUI(); + } + return EKeyWasConsumed; + } + // Only check if the user has turned the UI off + if( ( aInPreCapture && !iAlwaysDrawPreCaptureCourtesyUI ) + || ( !aInPreCapture && !iAlwaysDrawPostCaptureCourtesyUI )) + { + // Decide whether to turn the UI back on + if( ( aInPreCapture && !iDrawPreCaptureCourtesyUI) + || (!aInPreCapture && !iDrawPostCaptureCourtesyUI)) + { + if ( aKeyEvent.iScanCode == EStdKeyUpArrow + || aKeyEvent.iScanCode == EStdKeyDownArrow + || aKeyEvent.iScanCode == EStdKeyDevice3 + // Navikey select + ) + { + if ( aInPreCapture ) + { + RaisePreCaptureCourtesyUI(EFalse); + } + else + { + RaisePostCaptureCourtesyUI(); + } + retVal = EKeyWasConsumed; + } + } +#ifndef __WINS__ + RArray halfCaptureKeys; + CleanupClosePushL( halfCaptureKeys ); + + // now get half key press code to register + if ( iController.UiConfigManagerPtr() ) + { + iController.UiConfigManagerPtr()-> + SupportedPrimaryCameraAutoFocusKeyL( halfCaptureKeys ); + } + if ( halfCaptureKeys.Count() > 0 ) + { + if ( aInPreCapture && aKeyEvent.iScanCode + == halfCaptureKeys[0] ) + { + SubmergePreCaptureCourtesyUI(); + retVal = EKeyWasConsumed; + } + } + CleanupStack::PopAndDestroy( &halfCaptureKeys ); +#else + if ( aInPreCapture && aKeyEvent.iScanCode + == EProductKeyCaptureHalf ) + { + SubmergePreCaptureCourtesyUI(); + retVal = EKeyWasConsumed; + } +#endif + } + } + } + PRINT(_L("Camera <= CheckCourtesyKeyEvent")) + + return retVal; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::RaisePreCaptureCourtesyUI +// Shows the optional precapture UI +// --------------------------------------------------------------------------- +// +void CCamAppUi::RaisePreCaptureCourtesyUI(TBool aShowZoomBar) + { + PRINT1(_L("Camera => CCamAppUi::RaisePreCaptureCourtesyUI \ + aShowZoomBar = %d"), aShowZoomBar); + + if ( CourtesyUiApplies() && iDrawPreCaptureCourtesyUI ) + { + + iDrawPreCaptureCourtesyUI = ETrue; + + if ( iCamZoomPane && aShowZoomBar && !iCamZoomPane->IsZoomAtMinimum() ) + { + PRINT(_L("Camera == CCamAppUi::RaisePreCaptureCourtesyUI \ + Showing zoom pane")); + + CCamViewBase* view = NULL; + + if ( iMode == ECamControllerVideo ) + { + view = iVideoCaptureView; + } + else + { + view = iStillCaptureView; + } + + if ( view ) + { + CCamContainerBase* container = view->Container(); + + if ( container ) + { + container->ShowZoomPaneWithTimer(); + } + } + } + else + { + if ( iZoomPaneShown && iRotatedKeyEvent ) + { + HideZoomPane(ETrue); + iRotatedKeyEvent = EFalse; + } + } + PRINT(_L("Camera == CCamAppUi::RaisePreCaptureCourtesyUI Showing AP")); + SetActivePaletteVisibility( ETrue ); + + TUid settingsPluginUid = KNullUid; + + if ( iPlugin ) + { + settingsPluginUid = iPlugin->Id(); + } + + if ( iView ) + { + const TUid uid1( iView->Id() ); + const TInt uid( uid1.iUid ); + + if( !iController.InVideocallOrRinging() && + ( ECamViewIdStillPreCapture == uid || + ECamViewIdStillPostCapture == uid || + ECamViewIdVideoPreCapture == uid || + ECamViewIdVideoPostCapture == uid || + ECamViewIdBurstThumbnail == uid ) + ) + { + TRAP_IGNORE( static_cast + ( iView )->UnsetCourtesySoftKeysL() ); + } + } + + TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen)); + + iCourtesyTimerInPreCapture = ETrue; + + if ( iCourtesyTimer ) + { + iCourtesyTimer->Cancel(); + + if ( !iAlwaysDrawPreCaptureCourtesyUI ) + { + iCourtesyTimer->StartTimer(); + } + } + } + PRINT(_L("Camera <= CCamAppUi::RaisePreCaptureCourtesyUI")) + } + +// --------------------------------------------------------------------------- +// CCamAppUi::RaisePostCaptureCourtesyUI +// Shows the optional postcapture UI +// --------------------------------------------------------------------------- +// +void CCamAppUi::RaisePostCaptureCourtesyUI() + { + PRINT(_L("Camera => CCamAppUi::RaisePostCaptureCourtesyUI")) + if ( CourtesyUiApplies() ) + { + iDrawPostCaptureCourtesyUI = ETrue; + + SetActivePaletteVisibility( ETrue ); + + if ( iView ) + { + TRAP_IGNORE(static_cast + (iView)->UnsetCourtesySoftKeysL()); + } + + TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen)); + + iCourtesyTimerInPreCapture = EFalse; + + } + PRINT(_L("Camera <= CCamAppUi::RaisePostCaptureCourtesyUI")) + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SubmergePreCaptureCourtesyUI +// Hides the optional precapture UI +// --------------------------------------------------------------------------- +// +void CCamAppUi::SubmergePreCaptureCourtesyUI() + { + PRINT(_L("Camera => CCamAppUi::SubmergePreCaptureCourtesyUI")) + + const TCamCaptureOperation operation( iController.CurrentOperation() ); + + + + if ( ( CourtesyUiApplies() && !iDrawPreCaptureCourtesyUI + && !SelfTimerEnabled() + && ECamViewStatePreCapture == iViewState ) + // and if we are burst capturing + // then do not remove the cancel softkey + && !( IsBurstEnabled() + && (ECamCapturing == operation + ||ECamCompleting == operation ) ) ) + { + if ( FullScreenViewfinderEnabled() ) + { + // Don't submerge if we're capturing time-lapse photos + if ( !(ECamImageCaptureTimeLapse == CurrentBurstMode() + && iController.SequenceCaptureInProgress()) ) + { + + if ( ECamControllerVideo == iMode ) + { + + SetActivePaletteVisibility( EFalse ); + + if ( iController.IsTouchScreenSupported() ) + { + // Enable fixed toolbar + CAknToolbar* toolbar = CurrentFixedToolbar(); + if ( toolbar ) + { + toolbar->SetToolbarVisibility( EFalse ); + } + } + + if ( iView ) + { + if(!iController.IsTouchScreenSupported()) + { + TRAP_IGNORE(static_cast + (iView)->SetCourtesySoftKeysL()); + } + else + { + TRAP_IGNORE(static_cast + (iView)->UnsetCourtesySoftKeysL()); + } + } + + } // end if ( iMode == ECamControllerVideo ) + else + { + // in still mode toolbar and softkeys + // are not to be hidden as part of courtesy ui + // imode: ECamControllerIdle, ECamControllerImage, + // or ECamControllerShutdown + + SetActivePaletteVisibility( EFalse ); + + if ( iView ) + { + if(!iController.IsTouchScreenSupported()) + { + TRAP_IGNORE(static_cast + (iView)->SetCourtesySoftKeysL()); + } + else + { + TRAP_IGNORE(static_cast + (iView)->UnsetCourtesySoftKeysL()); + } + } + + } + + TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen)); + } + + } // if ( FullScreenViewfinderEnabled() + } + PRINT(_L("Camera <= CCamAppUi::SubmergePreCaptureCourtesyUI")) + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::SubmergePostCaptureCourtesyUI +// Hides the optional postcapture UI +// --------------------------------------------------------------------------- +// +void CCamAppUi::SubmergePostCaptureCourtesyUI() + { + PRINT(_L("Camera => CCamAppUi::SubmergePostCaptureCourtesyUI")) + if ( CourtesyUiApplies() + + && ECamViewStatePostCapture == iViewState ) + { + iDrawPostCaptureCourtesyUI = EFalse; + + SetActivePaletteVisibility( EFalse ); + + if ( iView ) + { + TRAP_IGNORE(static_cast + (iView)->SetCourtesySoftKeysL()); + } + + TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen)); + } + PRINT(_L("Camera <= CCamAppUi::SubmergePostCaptureCourtesyUI")) + } + +// --------------------------------------------------------------------------- +// CCamAppUi::ShowZoomPane +// Needed to show or update the zoom pane in direct viewfinder mode, +// or where the active toolbar is used. +// --------------------------------------------------------------------------- +// +void CCamAppUi::ShowZoomPane(TBool aRedraw) + { + PRINT( _L("Camera => CCamAppUi::ShowZoomPane" )) + iZoomPaneShown = ETrue; + + if ( aRedraw && IsDirectViewfinderActive() ) + { + TRAP_IGNORE(HandleCommandL(ECamCmdRedrawScreen)); + } + PRINT( _L("Camera <= CCamAppUi::ShowZoomPane" )) + } + +// --------------------------------------------------------------------------- +// CCamAppUi::HideZoomPane +// Needed to hide the zoom pane in direct viewfinder mode, +// or where the active toolbar is used. +// --------------------------------------------------------------------------- +// +void CCamAppUi::HideZoomPane( TBool aRedraw ) + { + PRINT( _L("Camera => CCamAppUi::HideZoomPane" )) + iZoomPaneShown = EFalse; + + if ( iDrawPreCaptureCourtesyUI && iController.IsViewFinding() ) + { + if ( iViewState == ECamViewStatePreCapture ) + { + SetActivePaletteVisibility( ETrue ); + } + } + + if ( aRedraw && IsDirectViewfinderActive() ) + { + TRAP_IGNORE( HandleCommandL(ECamCmdRedrawScreen ) ); + } + PRINT( _L("Camera <= CCamAppUi::HideZoomPane" )) + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SetActivePaletteVisibility +// Displays or hides the active palette, depending on some inbuilt restraints +// --------------------------------------------------------------------------- +// + +void CCamAppUi::SetActivePaletteVisibility( TBool aShown ) + { + PRINT1( _L("Camera => CCamAppUi::SetActivePaletteVisibility %d" ), aShown ) + + if ( !iController.IsTouchScreenSupported() ) + { + if ( ECamOrientationCamcorder == iCamOrientation + || ECamOrientationCamcorderLeft == iCamOrientation + || ECamOrientationPortrait == iCamOrientation ) + { + TCamCaptureOperation operation = iController.CurrentOperation(); + + // Does the current video mode prevent showing. + // + TBool videoOperationPrevents = + ( ECamControllerVideo == iMode ) + && ( ECamCapturing == operation || ECamPaused == operation ); + + TBool imageOperationPrevents = + ( ECamControllerImage == iMode ) + && ( ECamCapturing == operation || ECamCompleting == operation + || ECamFocusing == operation || ECamFocused == operation + || ECamFocusFailed == operation ); + + if ( (!aShown ) + + || ( aShown && !iPreventActivePaletteDisplay + && !TimeLapseSliderShown() + && ( iViewState == ECamViewStatePostCapture + || FullScreenViewfinderEnabled() + || IsSecondCameraEnabled() ) + && !videoOperationPrevents + && !imageOperationPrevents + && ((iDrawPreCaptureCourtesyUI && iViewState == ECamViewStatePreCapture) + || (iDrawPostCaptureCourtesyUI && iViewState == ECamViewStatePostCapture) )) + ) + { + if ( iActivePaletteHandler ) + { + PRINT1(_L("Precapture mode is %d"),iPreCaptureMode) + PRINT(_L("Setting Active Palette Visibility")) + iActivePaletteHandler->SetVisibility( aShown ); + if ( ( !IsEmbedded() && IsSecondCameraEnabled() ) + || !IsSecondCameraEnabled() ) + { + iToolbarVisibility = aShown; + } + else if ( IsEmbedded() && IsSecondCameraEnabled() ) + { + iToolbarVisibility = EFalse; + } + } + } + } + } + PRINT( _L("Camera <= CCamAppUi::SetActivePaletteVisibility" )) + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::IsDirectViewfinderActive +// Detects whether the direct viewfinder is in use or not +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::IsDirectViewfinderActive() + { + if ( iController.UiConfigManagerPtr() && + ( ( iDSASupported && iCamOrientation == ECamOrientationCamcorder || + iCamOrientation == ECamOrientationCamcorderLeft ) || + ( iController.IsDirectScreenVFSupported( EFalse ) && + iCamOrientation == ECamOrientationPortrait ) ) && + !( IsBurstEnabled() && iController.SequenceCaptureInProgress() ) ) + { + return ETrue; + } + return EFalse; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::UpdateNaviModelsL +// Called to set the correct navicounter / naviprogress controls to "active" +// --------------------------------------------------------------------------- +// +void CCamAppUi::UpdateNaviModelsL( const TBool aUpdateNavi ) + { + iNaviCounterControl->SetActiveL( EFalse ); + iNaviPaneCounterControl->SetActiveL( EFalse ); + iNaviProgressBarControl->SetActiveL( EFalse ); + iNaviPaneProgressBarControl->SetActiveL( EFalse ); + if ( !aUpdateNavi ) + { + // We are immediately closing the app or in Pretend Exit + // No need to update NaviPane + return; + } + else if ( ECamOrientationCamcorder == iCamOrientation + || ECamOrientationCamcorderLeft == iCamOrientation + || ECamOrientationPortrait == iCamOrientation ) + { + iNaviCounterControl->SetExtentToWholeScreen(); + iNaviCounterControl->SetActiveL( ETrue ); + iNaviProgressBarControl->SetExtentToWholeScreen(); + iNaviProgressBarControl->SetActiveL( ETrue ); + } + else + { + iNaviPaneCounterControl->SetActiveL( ETrue ); + iNaviPaneProgressBarControl->SetActiveL( ETrue ); + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::AppController +// Returns the app controller +// --------------------------------------------------------------------------- +// +MCamAppController& CCamAppUi::AppController() + { + return iController; + } + +// --------------------------------------------------------- +// CCamAppUi::ForegroundAppIsPhoneApp +// Whether or not the phone app is in the foreground +// --------------------------------------------------------- +// +TBool CCamAppUi::ForegroundAppIsPhoneApp() const + { + TBool phoneInForeground = EFalse; + // Gets the window group id of the app coming in foreground + TInt windowGroupId = iCoeEnv->WsSession().GetFocusWindowGroup(); + if ( windowGroupId == iPhoneAppWindowGroupId ) + { + phoneInForeground = ETrue; + } + return phoneInForeground; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SwitchStillCaptureModeL +// Change the still capture mode +// --------------------------------------------------------------------------- +// +void +CCamAppUi::SwitchStillCaptureModeL( TCamImageCaptureMode aImageMode, + TBool aReprepare, + TBool aUpdateUi /*=ETrue*/) + { + PRINT( _L( "Camera => CCamAppUi::SwitchStillCaptureModeL" ) ) + + iTargetImageMode = aImageMode; + + if ( iController.UiConfigManagerPtr()->IsXenonFlashSupported() ) + { + switch( iTargetImageMode ) + { + case ECamImageCaptureSingle: + case ECamImageCaptureTimeLapse: + { + // Switching from burst mode to single/timelapse mode. + // Restore previous original flash setting. + iController.RestoreFlashMode(); + break; + } + case ECamImageCaptureBurst: + { + if( iImageMode != iTargetImageMode ) + { + // Switching from single/timelapse capture to burst mode. + // Save current flash mode, and disable flash. + iController.SaveFlashMode(); + } + iController.SetIntegerSettingValueL( ECamSettingItemDynamicPhotoFlash, + ECamFlashOff ); + break; + } + } + } + + TBool burstEnabled = ( ECamImageCaptureBurst == aImageMode + || ECamImageCaptureTimeLapse == aImageMode ); + + if ( iController.TimeLapseSupported() ) + { + // if burst has been disabled + // then make sure the timelapse interval has been + // set back to 0 in the controller. + if ( !burstEnabled ) + { + iController.SetTimeLapseInterval( TInt64(0) ); + } + } + + if ( iImageMode != iTargetImageMode ) + { + // Inform any observers that burst mode has been changed + TInt count = iBurstModeObservers.Count(); + TInt i; + for ( i = 0; i < count; i++ ) + { + iBurstModeObservers[i]->BurstModeActiveL( burstEnabled, aReprepare ); + } + } + + if( aUpdateUi ) + { + TrySwitchViewL(); + } + + iController.BurstModeActiveL( burstEnabled, aReprepare ); + + if( aUpdateUi ) + { + iNaviCounterModel->SetCaptureModeL( iMode, iImageMode ); + + if ( aReprepare ) + { + PRINT( _L( "Camera <> CCamAppUi::SwitchStillCaptureModeL: update AP.." )) + iActivePaletteHandler->UpdateActivePaletteL(); + } + } + PRINT( _L("Camera <= CCamAppUi::SwitchStillCaptureModeL") ) + } + +#if !defined(__WINSCW__) +// --------------------------------------------------------------------------- +// CCamAppUi::RegisterCaptureKeysL +// Register to capture half and full shutter press key events +// --------------------------------------------------------------------------- +// +void CCamAppUi::RegisterCaptureKeysL() + { + RArray captureKeys; + CleanupClosePushL( captureKeys ); + + if ( iController.UiConfigManagerPtr() ) + { + iController.UiConfigManagerPtr()-> + SupportedPrimaryCameraCaptureKeyL( captureKeys ); + } + + if( iCameraKeyHandle == 0 ) + { + iCameraKeyHandle = iCoeEnv->RootWin().CaptureKey( EKeyCamera, 0, 0 ); + } + + if( iFullShutterUpDownHandle == 0 ) + { + if ( captureKeys.Count() > 0 ) + { + //EProductKeyCapture + iFullShutterUpDownHandle = iCoeEnv-> + RootWin().CaptureKeyUpAndDowns( captureKeys[0] , 0, 0 ); + } + + } + + if( iFullShutterPressHandle == 0 ) + { + if ( captureKeys.Count() > 0 ) + { + iFullShutterPressHandle = iCoeEnv-> + RootWin().CaptureKey( captureKeys[0], 0, 0 ); + } + } + + if( iHalfShutterPressHandle == 0 ) + { + captureKeys.Reset(); + + // now get half key press code to register + if ( iController.UiConfigManagerPtr() ) + { + iController.UiConfigManagerPtr()-> + SupportedPrimaryCameraAutoFocusKeyL( captureKeys ); + } + if ( captureKeys.Count() > 0 ) + { + iHalfShutterPressHandle = iCoeEnv-> + RootWin().CaptureKey( captureKeys[0], 0, 0 ); + } + } + CleanupStack::PopAndDestroy( &captureKeys ); + } + +// --------------------------------------------------------------------------- +// CCamAppUi::UnRegisterCaptureKeys +// Release capture of half and full shutter press key events +// --------------------------------------------------------------------------- +// +void CCamAppUi::UnRegisterCaptureKeys() + { + //Since this function can be called from the destructor, we should + //check that iCoeEnv isn't null prior to using it. + if( iCoeEnv ) + { + if ( iCameraKeyHandle > 0 ) + { + iCoeEnv->RootWin().CancelCaptureKey( iCameraKeyHandle ); + iCameraKeyHandle = 0; + } + if ( iFullShutterPressHandle > 0 ) + { + iCoeEnv->RootWin().CancelCaptureKey( iFullShutterPressHandle ); + iFullShutterPressHandle = 0; + } + if ( iHalfShutterPressHandle > 0 ) + { + iCoeEnv->RootWin().CancelCaptureKey( iHalfShutterPressHandle ); + iHalfShutterPressHandle = 0; + } + + if ( iFullShutterUpDownHandle > 0 ) + { + iCoeEnv->RootWin().CancelCaptureKey( iFullShutterUpDownHandle ); + iFullShutterUpDownHandle = 0; + } + } + } + +#endif + +// --------------------------------------------------------------------------- +// CCamAppUi::SetSoftKeysL +// Sets the softkeys to the specified Resource ID +// --------------------------------------------------------------------------- +// +void CCamAppUi::SetSoftKeysL( TInt aResource ) + { + PRINT1( _L("Camera => CCamAppUi::SetSoftKeysL resource:%x"), aResource ); + if ( iView ) + { + static_cast(iView)->SetSoftKeysL(aResource); + } + PRINT( _L("Camera <= CCamAppUi::SetSoftKeysL") ); + } + +// --------------------------------------------------------------------------- +// CCamAppUi::TimeLapseSliderShown +// Returns whether time lapse slider is currently shown +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::TimeLapseSliderShown() const + { + return ECamPreCapTimeLapseSlider == iPreCaptureMode; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::FullScreenViewfinderEnabled +// Returns whether or not the full screen viewfinder is being shown +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::FullScreenViewfinderEnabled() const + { + TBool retVal = EFalse; + + if ( ECamViewStatePreCapture == iViewState + && ( ECamOrientationCamcorder == iCamOrientation + || ECamOrientationCamcorderLeft == iCamOrientation ) + && ECamPreCapViewfinder == iPreCaptureMode) + { + retVal = ETrue; + } + + return retVal; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SetPreCaptureModeL +// Sets the current pre-capture mode +// --------------------------------------------------------------------------- +// +void CCamAppUi::SetPreCaptureModeL(TCamPreCaptureMode aMode) + { + PRINT(_L("Camera=>CCamAppUi::SetPreCaptureMode")) + iPreCaptureMode = aMode; + + CCamViewBase* precapView = NULL; + if ( iView == iStillCaptureView || + iView == iVideoCaptureView ) + { + precapView = static_cast( iView ); + __ASSERT_DEBUG( precapView, CamPanic( ECamPanicNullPointer )); + } + + if ( ECamPreCapViewfinder == iPreCaptureMode ) + { + if ( !( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) ) + { + RaisePreCaptureCourtesyUI(ETrue); + } + if ( precapView ) + { + if ( iView == iStillCaptureView ) + { + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + if ( IsSecondCameraEnabled() ) + { + TInt resourceId = IsQwerty2ndCamera()? + R_CAM_STILL_PRECAPTURE_TOOLBAR_LANDSCAPE: + R_CAM_STILL_PRECAPTURE_TOOLBAR_PORTRAIT; + precapView->CreateAndSetToolbarL( resourceId ); + } + else + { + precapView->CreateAndSetToolbarL( R_CAM_STILL_PRECAPTURE_TOOLBAR ); + } + CAknToolbar* fixedToolbar = CurrentFixedToolbar(); + fixedToolbar->SetToolbarVisibility( EFalse ); + + if ( !IsSecondCameraEnabled() ) + { + iStillCaptureView->UpdateToolbarIconsL(); + } + + fixedToolbar->SetToolbarObserver( iStillCaptureView ); + SetToolbarVisibility(); + + if ( IsEmbedded() ) + { + iStillCaptureView->HideButton( ECamCmdNewVideo ); + } + + // Make sure toolbar extension button has no background + CAknButton* extensionButton = static_cast( + fixedToolbar->ControlOrNull( ECamCmdToolbarExtension ) ); + if ( extensionButton ) + { + extensionButton->SetButtonFlags( + // Set KAknButtonNoFrame flag for extension buttons + extensionButton->ButtonFlags() | KAknButtonNoFrame ); + } + } + } + else if ( iView == iVideoCaptureView ) + { + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + if ( IsSecondCameraEnabled() ) + { + TInt resourceId = IsQwerty2ndCamera()? + R_CAM_VIDEO_PRECAPTURE_TOOLBAR_LANDSCAPE: + R_CAM_VIDEO_PRECAPTURE_TOOLBAR_PORTRAIT; + precapView->CreateAndSetToolbarL( resourceId ); + } + else + { + if(iController.UiConfigManagerPtr()->IsXenonFlashSupported()) + { + precapView->CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR); + } + else + { + precapView->CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR_VIDEOLIGHT); + } + } + CAknToolbar* fixedToolbar = CurrentFixedToolbar(); + fixedToolbar->SetToolbarVisibility( EFalse ); + + if ( !IsSecondCameraEnabled() ) + { + iVideoCaptureView->UpdateToolbarIconsL(); + } + + fixedToolbar->SetToolbarObserver( iVideoCaptureView ); + SetToolbarVisibility(); + if ( IsEmbedded() ) + { + iVideoCaptureView->HideButton( ECamCmdNewPhoto ); + } + + // Make sure toolbar extension button has no background + CAknButton* extensionButton = static_cast( + fixedToolbar->ControlOrNull( ECamCmdToolbarExtension ) ); + if ( extensionButton ) + { + extensionButton->SetButtonFlags( + // Set KAknButtonNoFrame flag for extension buttons + extensionButton->ButtonFlags() | KAknButtonNoFrame ); + } + } + } + + if( !IsSecondCameraEnabled() || IsQwerty2ndCamera() ) + { + EikSoftkeyPostingTransparency::MakeTransparent( + *precapView->ViewCba(), ETrue ); + + if( iDrawPreCaptureCourtesyUI ) + { + precapView->ViewCba()->MakeVisible( ETrue ); + } + } + + } + } + else + { + if ( precapView ) + { + precapView->ViewCba()->MakeVisible( ETrue ); + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + precapView->CreateAndSetToolbarL( R_CAM_EMPTY_FIXED_TOOLBAR ); + } + EikSoftkeyPostingTransparency::MakeTransparent( + *precapView->ViewCba(), EFalse ); + } + SetActivePaletteVisibility( EFalse ); + } + + if ( iViewState != ECamViewStateUserSceneSetup ) + { + if ( CamUtility::IsNhdDevice() ) + { + StatusPane()->MakeVisible( aMode == ECamPreCapStandby || + IsSecondCameraEnabled() && + !IsQwerty2ndCamera() || + SettingsLaunchedFromCamera() ); + } + else + { + // Settings, launched via toolbar, have a visible statuspane in + // Non-touch device + StatusPane()->MakeVisible( !precapView || + aMode != ECamPreCapViewfinder && + aMode != ECamPreCapTimeLapseSlider || + IsSecondCameraEnabled() || + SettingsLaunchedFromCamera() ); + } + } + + + PRINT(_L("Camera<=CCamAppUi::SetPreCaptureMode")) + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SetPreCaptureMode +// Sets the current pre-capture mode +// --------------------------------------------------------------------------- +// +void CCamAppUi::SetPreCaptureMode( TCamPreCaptureMode aMode ) + { + TRAPD(err, SetPreCaptureModeL( aMode ) ); + if ( err ) + { + PRINT1(_L("Camera<=CCamAppUi::SetPreCaptureModeL Leave=%d"), err) + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::ShowPostCaptureView +// Whether to show the post capture view in current mode +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::ShowPostCaptureView() const + { + TInt settingId( ( ECamControllerVideo == iMode ) + ? ECamSettingItemVideoShowCapturedVideo + : ECamSettingItemShowCapturedPhoto ); + + return ( ECamSettOn == iController.IntegerSettingValue( settingId ) ); + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::SuppressUIRiseOnViewfinderStart +// Whether the automatic UI-rise should be suppressed on +// next viewfinder start event +// --------------------------------------------------------------------------- +// +TBool +CCamAppUi::SuppressUIRiseOnViewfinderStart() const + { + return iSuppressUIRise; + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::SetSuppressUIRiseOnViewfinderStart +// Sets whether the automatic UI-rise should be suppressed on +// next viewfinder start event +// --------------------------------------------------------------------------- +// +void +CCamAppUi::SetSuppressUIRiseOnViewfinderStart(TBool aSuppress) + { + iSuppressUIRise = aSuppress; + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::SelectViewFinderGridSettingL +// Select the viewfinder grid setting. +// Currently only sets the grid ON or OFF. +// --------------------------------------------------------------------------- +// +void +CCamAppUi::SelectViewFinderGridSettingL() + { + PRINT( _L("Camera => CCamAppUi::SelectViewFinderGridSettingL") ); + PRINT1( _L("Camera <> ECamSettingItemViewfinderGrid == (%d)"), + ECamSettingItemViewfinderGrid ); + + TInt current = iController.IntegerSettingValue( ECamSettingItemViewfinderGrid ); + TInt invert = (current == ECamViewfinderGridOn) + ? ECamViewfinderGridOff + : ECamViewfinderGridOn; + + // Switch the value. + iController.SetIntegerSettingValueL( ECamSettingItemViewfinderGrid, invert ); + + // We'll get a HandleControllerEventL callback + // from iController when the value has been set. + PRINT( _L("Camera <= CCamAppUi::SelectViewFinderGridSettingL") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::ConstructPostCaptureViewIfRequiredL +// +// Construct a postcapture view if not already constructed +// +// The following parameter combinations can be used: +// * Still postcapture view: aViewState = ECamViewStatePostCapture, +// aMode = ECamControllerImage +// * Burst thumbnail view: aViewState = ECamViewStateBurstThumbnail +// aMode = << ignored >> +// * Video postcapture view: aViewState = ECamViewStatePostCapture, +// aMode = ECamControllerVideo +// --------------------------------------------------------------------------- +// +void +CCamAppUi::ConstructPostCaptureViewIfRequiredL( TCamViewState aViewState, + TCamCameraMode aCaptureMode ) + { + CAknView* view; + + if( ECamViewStateBurstThumbnail == aViewState ) + { + // Burst thumbnail view + if( !iBurstThumbnailViewConstructed ) + { + PRINT( _L("Camera => CCamAppUi::\ + ConstructPostCaptureViewIfRequiredL - BurstThumbnail") ); + view = CCamBurstThumbnailView::NewLC( iController ); + AddViewL( view ); + CleanupStack::Pop( view ); + iBurstThumbnailViewConstructed = ETrue; + PRINT( _L("Camera <= CCamAppUi::\ + ConstructPostCaptureViewIfRequiredL - BurstThumbnail") ); + } + } + else if( ECamViewStatePostCapture == aViewState ) + { + if( ECamControllerVideo == aCaptureMode ) + { + // Video postcapture + if( !iVideoPostCaptureViewConstructed ) + { + PRINT( _L("Camera => \ + CCamAppUi::ConstructPostCaptureViewIfRequiredL \ + - VideoPostCapture") ); + view = CCamVideoPostCaptureView::NewLC( iController ); + AddViewL( view ); + CleanupStack::Pop( view ); + iVideoPostCaptureViewConstructed = ETrue; + PRINT( _L("Camera <= \ + CCamAppUi::ConstructPostCaptureViewIfRequiredL \ + - VideoPostCapture") ); + } + } + else + { + // Still postcapture + if( !iStillPostCaptureViewConstructed ) + { + PRINT( _L("Camera => \ + CCamAppUi::ConstructPostCaptureViewIfRequiredL \ + - StillPostCapture") ); + view = CCamStillPostCaptureView::NewLC( iController ); + AddViewL( view ); + CleanupStack::Pop( view ); + iStillPostCaptureViewConstructed = ETrue; + PRINT( _L("Camera <= \ + CCamAppUi::ConstructPostCaptureViewIfRequiredL \ + - StillPostCapture") ); + } + } + } + } + + +#ifdef CAMERAAPP_DELAYED_POSTCAPTURE_CREATION + +// --------------------------------------------------------------------------- +// CCamAppUi::StartPostCapIdleL +// +// Starts calls to PostCapIdleCallBack during processor idle time. The calls +// are continued until PostCapIdleCallBack is done. +// +// --------------------------------------------------------------------------- +void CCamAppUi::StartPostCapIdleL() + { + if( !iPostCapIdle ) + { + iPostCapIdle = CIdle::NewL( CActive::EPriorityIdle ); + iPostCapProgress = ECamConstructStillPostCap; + iPostCapIdle->Start( TCallBack( PostCapIdleCallBack, this ) ); + } + else + { + // iPostCapIdle already exists. + // Do nothing - the views have already been constructed + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::PostCapIdleCallBack +// +// Handles postcapture view construction so that each call to this function +// constructs one postcapture view. Returns ETrue if there are still more views +// to construct, EFalse if all are finished and no further calls are required. +// +// --------------------------------------------------------------------------- +TInt CCamAppUi::PostCapIdleCallBack( TAny* aSelf ) + { + PRINT( _L("Camera => CCamAppUi::PostCapIdleCallBack") ); + TInt ret = EFalse; + + CCamAppUi* self = static_cast( aSelf ); + if( self ) + { + if( ECamConstructStillPostCap == self->iPostCapProgress ) + { + TRAP_IGNORE( self->ConstructPostCaptureViewIfRequiredL( + ECamViewStatePostCapture, ECamControllerImage ) ); + self->iPostCapProgress = ECamConstructBurstPostCap; + ret = ETrue; + } + else if( ECamConstructBurstPostCap == self->iPostCapProgress ) + { + TRAP_IGNORE( self->ConstructPostCaptureViewIfRequiredL( + ECamViewStateBurstThumbnail, ECamControllerImage ) ); + self->iPostCapProgress = ECamConstructVideoPostCap; + ret = ETrue; + } + else if( ECamConstructVideoPostCap == self->iPostCapProgress ) + { + TRAP_IGNORE( self->ConstructPostCaptureViewIfRequiredL( + ECamViewStatePostCapture, ECamControllerVideo ) ); + self->iPostCapProgress = ECamPostCapsDone; + // Complete + ret = EFalse; + } + } + + PRINT( _L("Camera <= CCamAppUi::PostCapIdleCallBack") ); + return ret; + } + +#endif // CAMERAAPP_DELAYED_POSTCAPTURE_CREATION + + +// --------------------------------------------------------------------------- +// CCamAppUi::StartSensorIdleL +// +// Initiates a call to SensorIdleCallback during processor idle time +// --------------------------------------------------------------------------- +// +void CCamAppUi::StartSensorIdleL() + { + if ( iController.UiConfigManagerPtr()->IsOrientationSensorSupported() ) + { + if( iSensorIdleRunning ) + { + // Delayed sensor initialization is already in progress + return; + } + + if( !iSensorIdle ) + { + // Instantiate new CIdle + iSensorIdle = CIdle::NewL( CActive::EPriorityIdle ); + } + else + { + // Cancel existing the existing request, just in case + iSensorIdle->Cancel(); + } + + // Initialize the idle callback + iSensorIdle->Start( TCallBack( SensorIdleCallBack, this ) ); + iSensorIdleRunning = ETrue; + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::CancelSensorIdle +// +// Cancels the (possibly) pending call to SensorIdleCallBack +// --------------------------------------------------------------------------- +// +void CCamAppUi::CancelSensorIdle() + { + if ( iController.UiConfigManagerPtr()->IsOrientationSensorSupported() ) + { + if( iSensorIdle && iSensorIdleRunning ) + { + iSensorIdle->Cancel(); + iSensorIdleRunning = EFalse; + } + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SensorIdleCallBack +// +// Calls iControler.UpdateSensorApiL +// --------------------------------------------------------------------------- +// +TInt CCamAppUi::SensorIdleCallBack( TAny* aSelf ) + { + CCamAppUi* self = static_cast( aSelf ); + + if( self ) + { + TRAP_IGNORE( self->iController.UpdateSensorApiL( ETrue ) ); + self->iSensorIdleRunning = EFalse; + } + return EFalse; // No more calls needed + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::IsSelfTimedCapture +// Whether the current capture was selftimer initiated +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::IsSelfTimedCapture() const + { + return iSelfTimedCapture; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::DismissMemoryNoteL +// Dismisses out of memory / memory card removed note, if active. +// --------------------------------------------------------------------------- +// +void +CCamAppUi::DismissMemoryNoteL() + { + if( iMemoryNote ) + { + if( iMemoryNote->IsFocused() ) + { + // For some reason, the note's softkeys are displayed in standby mode, + // even though the note itself has been dismissed (=deleted) + // HACK: + // If the note is focused, we know that also its softkeys are in use, + // so we can simulate key events to emulate user closing the note + // using left softkey. + + TKeyEvent key; + key.iRepeats = 0; + key.iCode = EKeyDevice0; + key.iModifiers = 0; + iEikonEnv->SimulateKeyEventL( key, EEventKeyDown ); + CEikButtonGroupContainer::Current()->OfferKeyEventL( key, + EEventKeyDown ); + } + + // Make sure the note closes even if it wasn't focused. + delete iMemoryNote; + iMemoryNote = NULL; + } + } + + +// --------------------------------------------------------------------------- +// Starts Gallery Application command line +// --------------------------------------------------------------------------- +// + + +void +CCamAppUi::StartAppCmdLineL( const TDes8& aData ) + { + // MM not running yet - use Command Line Tail + RApaLsSession appArcSession; + CleanupClosePushL( appArcSession ); + User::LeaveIfError( appArcSession.Connect() ); + TApaAppInfo appInfo; + User::LeaveIfError( appArcSession.GetAppInfo( appInfo, + TUid::Uid( KGlxGalleryApplicationUid) ) ); + + CApaCommandLine* cmdLine = CApaCommandLine::NewLC(); + cmdLine->SetExecutableNameL( appInfo.iFullName ); + cmdLine->SetCommandL( EApaCommandRun ); + cmdLine->SetTailEndL( aData ); + + User::LeaveIfError( appArcSession.StartApp( *cmdLine ) ); + + CleanupStack::PopAndDestroy( cmdLine ); + CleanupStack::PopAndDestroy( &appArcSession ); + } +// --------------------------------------------------------------------------- +// CCamAppUi::StartCheckingDefaultAlbumIdL() +// We start check operation to see if "Default Album exists" +// Usecase: Whenever the camera returns from background/startup we first start +// checking the default album which is set, if any, to make sure that album +// really exists. If not, then we set back the value of setting item "Add to +// album" to "No" in Image/Video setting image settings +// --------------------------------------------------------------------------- +// +void CCamAppUi::StartCheckingDefaultAlbumIdL() + { + TBool checkAlbum = ( + iController.IntegerSettingValue( + ECamSettingItemPhotoStoreInAlbum ) == ECamSettYes || + iController.IntegerSettingValue( + ECamSettingItemVideoStoreInAlbum ) == ECamSettYes ); + + if ( !iCheckOperationInProgress && checkAlbum ) + { + TUint32 defaultAlbumId = + static_cast ( + iController.IntegerSettingValue( + ECamSettingItemDefaultAlbumId ) ); + if ( iCollectionManager ) + { + iCheckOperationInProgress = ETrue; + iCollectionManager->CheckForAlbumExistenceL( defaultAlbumId ); + } + } + + } + +// --------------------------------------------------------------------------- +// CCamAppUi::CheckAlbumIdOperationCompleteL +// Call back method, which is called once the check operation is complete +// --------------------------------------------------------------------------- +// +void CCamAppUi::CheckAlbumIdOperationCompleteL( + TBool aAlbumExists, const TDesC& /*aAlbumTitle*/ ) + { + PRINT( _L("CCamAppUi::CheckAlbumIdOperationCompleteL --> ENTERS") ); + if ( iController.UiConfigManagerPtr()->IsPhotosSupported() ) + { + if ( iCheckOperationInProgress ) + { + PRINT( _L("CheckAlbumIdOperationCompleteL \ + iCheckOperationInProgress: ETRUE") ); + iCheckOperationInProgress = EFalse; + if ( !aAlbumExists ) + { + // Reset all the values to the default ones, + // if the default album doesnt exist, when returned from background + iController.SetIntegerSettingValueL( + ECamSettingItemPhotoStoreInAlbum, + ECamSettNo ); + iController.SetIntegerSettingValueL( + ECamSettingItemVideoStoreInAlbum, + ECamSettNo ); + // reseting the album id to the default value "0" + iController.SetIntegerSettingValueL( + ECamSettingItemDefaultAlbumId, + 0 ); + } + } + } + PRINT( _L("CCamAppUi::CheckAlbumIdOperationCompleteL <-- EXITS") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::SettingsLaunchedFromCamera() +// We keep track of plugin event launched from camera +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::SettingsLaunchedFromCamera() const + { + return iSettingsPluginLaunched; + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::SettingsPluginExitedL +// We handle the case when settings plugin exists +// --------------------------------------------------------------------------- +// +void CCamAppUi::SettingsPluginExitedL( TCamSettingsPluginExitMessage aType ) + { + iSettingsPluginLaunched = EFalse; + iTargetViewState = ECamViewStatePreCapture; + TrySwitchViewL(); + + switch ( aType ) + { + case ECameraPluginExit: + { + // we exit the plugin and switch to pre-capture + iReturnedFromPlugin = ETrue; + break; + } + case ECameraInternalExit: + { + // Internal Exit from Plugin -> Options -> Exit + iReturnedFromPlugin = EFalse; + InternalExitL(); + break; + } + case ECameraCompleteExit: + { + // Plugiin -> End Key or "c" key + iReturnedFromPlugin = EFalse; + break; + } + } + PRINT( _L("Camera <= CCamAppUi::SettingsPluginExitedL") ); + } + +// --------------------------------------------------------------------------- +// CCamAppUi::StaticSettingsModel() +// +// Gets the handle to the settings model, which is used inturn by the +// plugin to call the interfaces for performing needed actions. +// --------------------------------------------------------------------------- +// +MCamStaticSettings& +CCamAppUi::StaticSettingsModel() + { + return iController.StaticSettingsModel(); + } + +// --------------------------------------------------------------------------- +// CCamAppUi::CreateNaviBitmapsL +// Draw the counter to the bitmap used in the navi pane +// --------------------------------------------------------------------------- +// +void +CCamAppUi::CreateNaviBitmapsL( TBool aDrawStorageIconAndCounter ) + { + if ( iNaviCounterModel ) + { + iNaviCounterModel->CreateNaviBitmapsL( aDrawStorageIconAndCounter ); + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::ReadyToDraw +// Checks whether its safe to draw controls +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::ReadyToDraw() const + { + if ( AppInBackground( ETrue ) || !iView ) + { + return EFalse; + } + else + { + return ETrue; + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::StartFileNameCheck +// Checks whether the file name is deleted/renamed outside camera +// --------------------------------------------------------------------------- +// +void CCamAppUi::StartFileNameCheck() + { + PRINT( _L("Camera => CCamAppUi::StartFileNameCheck") ); + if( !iFileCheckAo->IsActive() ) + { + iFileCheckAo->Start(); + } + PRINT( _L("Camera <= CCamAppUi::StartFileNameCheck") ); + } + + +// --------------------------------------------------------------------------- +// CCamAppUi::FileCheckingComplete +// Handle a file checking complete event. Used to inform +// when filechecking active object. +// has finished checking existance of files. +// --------------------------------------------------------------------------- +// +void CCamAppUi::FileCheckingCompleteL( TInt aStatus, TInt aError ) + { + PRINT2( _L("Camera => CCamAppUi::FileCheckingComplete(), \ + aStatus=%d, aError=%d "), aStatus, aError ) + + if( aStatus <= 0 || KErrNone != aError ) + { + PRINT( _L("Camera <> CCamAppUi::FileCheckingComplete: \ + all files deleted, trying viewswitch") ); + iTargetViewState = ECamViewStatePreCapture; + TrySwitchViewL( ETrue ); + } + else if ( aStatus < iController.BurstCaptureArray()->Count() ) + { + PRINT2( _L("Camera <> CCamAppUi::FileCheckingComplete: %d < %d,\ + some file(s) have been deleted"), + aStatus, + iController.BurstCaptureArray()->Count() ); + + if ( iViewState == ECamViewStateBurstThumbnail || iViewState == ECamViewStatePostCapture ) + { + PRINT( _L("Camera <> CCamAppUi::FileCheckingComplete() updating thumbnail view") ); + CCamBurstThumbnailView* thumbnailView = + static_cast( View( TUid::Uid( ECamViewIdBurstThumbnail ) ) ); + + if ( thumbnailView ) + { + thumbnailView->ImageFilesDeleted(); + } + + if ( iViewState == ECamViewStatePostCapture ) + { + // view state is post-capture, check if the image currently viewed has been deleted + if ( iController.BurstCaptureArray()->IsDeleted( iController.CurrentImageIndex() ) ) + { + //switch back to burst thumbnail view + HandleCommandL( EAknSoftkeyBack ); + } + + } + } + } + + //When return to video post capture view from background, we need to determine whether show the toolbar + if( iReturnFromBackground + && iViewState == ECamViewStatePostCapture + && iMode == ECamControllerVideo ) + { + SetToolbarVisibility(); + } + + PRINT( _L("Camera <= CCamAppUi::FileCheckingComplete()") ); + } + +// --------------------------------------------------------------------------- +// CCamAppUi::HandleSelfTimerEvent +// Handle self-timer event +// --------------------------------------------------------------------------- +// +void CCamAppUi::HandleSelfTimerEvent( TCamSelfTimerEvent aEvent, + TInt aCountDown ) + { +#if defined( CAMERAAPP_CAPI_V2_DVF ) + TRAP_IGNORE( HandleCommandL( ECamCmdRedrawScreen ) ); +#else + (void) aEvent; + (void) aCountDown; +#endif // CAMERAAPP_CAPI_V2_DVF + } + +// --------------------------------------------------------------------------- +// CCamAppUi::RequestedNewFileResolution +// Set the requested resolution for a new file +// --------------------------------------------------------------------------- +// +void CCamAppUi::SetRequestedNewFileResolution( + const TSize& aRequestedResolution ) + { + iRequestedNewFileResolution.SetSize( + aRequestedResolution.iWidth, + aRequestedResolution.iHeight ); + } + +// --------------------------------------------------------------------------- +// CCamAppUi::RequestedNewFileResolution +// Get the requested resolution for a new file +// --------------------------------------------------------------------------- +// +TSize CCamAppUi::RequestedNewFileResolution() const + { + // Default is TSize(0, 0) which interpreted as MMS quality resolution + return iRequestedNewFileResolution; + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SetToolbarVisibility +// Set toolbar visibility in according to whether current view and +// mode are fit. When embedded camera starts up, view and mode may +// not be fit. +// --------------------------------------------------------------------------- +// +void CCamAppUi::SetToolbarVisibility() + { + // fixed toolbar is used only with touch devices + CAknToolbar* fixedToolbar = CurrentFixedToolbar(); + if ( iController.IsTouchScreenSupported() && fixedToolbar ) + { + if ( IsEmbedded() ) + { + // Check that iMode matches iTargetMode and that the corresponding + // view is active. + if ( iMode == iTargetMode && + ( ( iMode == ECamControllerVideo && iView == iVideoCaptureView ) || + ( iMode == ECamControllerImage && iView == iStillCaptureView ) ) ) + { + fixedToolbar->SetToolbarVisibility( ETrue ); + } + else + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + else + { + if( (iPreCaptureMode != ECamPreCapCaptureSetup) && + (iPreCaptureMode != ECamPreCapGenericSetting) && + (iPreCaptureMode != ECamPreCapSceneSetting ) ) + { + fixedToolbar->SetToolbarVisibility( ETrue ); + } + else + { + // No toolbar with the settings view + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SubmergeToolbar +// Hide toolbar if needed. +// --------------------------------------------------------------------------- +// +void CCamAppUi::SubmergeToolbar() + { + PRINT( _L("Camera => CCamAppUi::SubmergeToolbar()") ); + // fixed toolbar is used only with touch devices + CAknToolbar* fixedToolbar = CurrentFixedToolbar(); + if ( iController.IsTouchScreenSupported() && fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + PRINT( _L("Camera <= CCamAppUi::SubmergeToolbar()") ); + } + +// --------------------------------------------------------------------------- +// Check if it's applicable to use the courtesy UI +// --------------------------------------------------------------------------- +// +TBool CCamAppUi::CourtesyUiApplies() const + { + return ( ECamCapturing != iController.CurrentVideoOperation() + && ECamPaused != iController.CurrentVideoOperation() + && !SelfTimerEnabled() + && ( ECamOrientationCamcorder == iCamOrientation || + ECamOrientationCamcorderLeft == iCamOrientation || + ECamOrientationPortrait == iCamOrientation ) ); + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::IsToolBarVisible +// Returns whether or the tool bar has been activated +// Will return ETrue when when the tool bar is active +// ----------------------------------------------------------------------------- +// +TBool CCamAppUi::IsToolBarVisible() const + { + PRINT1( _L("Camera => CCamAppUi::IsToolBarVisible %d" ), iToolbarVisibility ) + return iToolbarVisibility; + } + + +// ----------------------------------------------------------------------------- +// CCamAppUi::SetAssumePostCaptureView +// Sets iAssumePostCapture flag according to aValue +// ----------------------------------------------------------------------------- +// +void CCamAppUi::SetAssumePostCaptureView( TBool aValue ) + { + if ( iView + && ( iStillCaptureView == iView || iVideoCaptureView == iView ) ) + { + static_cast( iView )->SetPostCaptureViewAsumption( aValue ); + } + } + +// --------------------------------------------------------------------------- +// CCamAppUi::SetDrawPreCaptureCourtesyUI +// Set iDrawPreCaptureCourtesyUI flag +// --------------------------------------------------------------------------- +// +void CCamAppUi::SetDrawPreCaptureCourtesyUI(TBool iDraw) + { + if( iDraw ) + { + iDrawPreCaptureCourtesyUI = ETrue; + } + else + { + iDrawPreCaptureCourtesyUI = EFalse; + } + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::IsMemoryFullOrUnavailable +// ----------------------------------------------------------------------------- +// +TBool +CCamAppUi::IsMemoryFullOrUnavailable(const TCamMediaStorage + aStorageLocation) const + { + if(!iController.IsMemoryAvailable(aStorageLocation)) + return ETrue; + + if(iMode == ECamControllerImage) + { + TInt availableMemoryUnits = 0; + availableMemoryUnits = + iController.ImagesRemaining(aStorageLocation,EFalse); + return (availableMemoryUnits <= 0); + } + else if(iMode == ECamControllerVideo) + { + TTimeIntervalMicroSeconds timeLeft = 0; + TRAPD(err,timeLeft = + iController. + CalculateVideoTimeRemainingL(aStorageLocation);); + if(err) + timeLeft = 0; + return (timeLeft < KMemoryFullVideoRemaining); + } + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::AllMemoriesFullOrUnavailable +// ----------------------------------------------------------------------------- +// +TBool CCamAppUi::AllMemoriesFullOrUnavailable() const + { + return ( IsMemoryFullOrUnavailable(ECamMediaStoragePhone) && + IsMemoryFullOrUnavailable(ECamMediaStorageCard) && + IsMemoryFullOrUnavailable(ECamMediaStorageMassStorage) ); + } + + +// --------------------------------------------------------- +// CCamAppUi::AppUIConstructCallbackL +// +// --------------------------------------------------------- +// +TInt CCamAppUi::AppUIConstructCallbackL( TAny* aAny ) + { + PRINT( _L("Camera => CCamAppUi::AppUIConstructCallbackL") ) + CCamAppUi* appui = static_cast( aAny ); + __ASSERT_DEBUG( appui != NULL && appui->iWaitTimer != NULL, CamPanic( ECamPanicNullPointer ) ); + appui->iWaitTimer->Cancel(); + if ( !appui->IsUiConstructionComplete() ) + { + appui->CompleteAppUIConstructionL(); + } + PRINT( _L("Camera <= CCamAppUi::AppUIConstructCallbackL") ) + return KErrNone; + } + +// --------------------------------------------------------- +// CCamAppUi::CompleteAppUIConstructionL +// +// --------------------------------------------------------- +// +void CCamAppUi::CompleteAppUIConstructionL() + { + PRINT( _L("Camera => CCamAppUi::CompleteAppUIConstructionL") ) + iUiConstructionComplete = ETrue; + // Load the settings model static settings + PRINT( _L("Camera <> call CCamAppController::LoadStaticSettingsL..") ) + iController.LoadStaticSettingsL( IsEmbedded() ); + +/*#ifndef __WINSCW__ + if ( !iSFIUtils ) + { + // Initialize SFIUtils + iSFIUtils = CSFIUtilsAppInterface::NewL(); + iSendFileInCall = EFalse; + PRINT( _L("iSendFileInCall = EFalse") ); + } +#endif */ + + // Create text resolver for error note text + iTextResolver = CTextResolver::NewL(); + + ConstructPreCaptureViewsL(); + + iSelfTimer = CCamSelfTimer::NewL( iController ); +#if defined( CAMERAAPP_CAPI_V2_DVF ) + iSelfTimer->AddObserverL( this ); +#endif // CAMERAAPP_CAPI_V2_DVF + + PRINT( _L("Camera <> creating navicounter model") ); + iNaviCounterModel = CCamNaviCounterModel::NewL( iController ); + PRINT( _L("Camera <> append navicounter to resourceloaders") ); + User::LeaveIfError( iResourceLoaders.Append(iNaviCounterModel) ); + + PRINT( _L("Camera <> creating progress bar model") ); + iNaviProgressBarModel = CCamNaviProgressBarModel::NewL( iController ); + PRINT( _L("Camera <> append progressbar to resourceloaders") ); + User::LeaveIfError(iResourceLoaders.Append(iNaviProgressBarModel)); + + ConstructNaviPaneL(); + + //always start in stillmode + SetDefaultViewL( *iStillCaptureView ); + + // pre-construct side-pane & zoom pane + // get whether we overlay sidepane over view-finder + TBool overlayViewFinder; + User::LeaveIfError( CamUtility::GetPsiInt( ECamPsiOverLaySidePane, overlayViewFinder ) ); + PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create sidepane") ); + iCamSidePane = CCamSidePane::NewL( iController, overlayViewFinder ); + User::LeaveIfError(iResourceLoaders.Append(iCamSidePane)); + + PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create zoom pane") ); + iCamZoomPane = CCamZoomPane::NewL( iController, overlayViewFinder ); + User::LeaveIfError(iResourceLoaders.Append(iCamZoomPane)); + + PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create doc handler") ); + iDocHandler = CDocumentHandler::NewL( CEikonEnv::Static()->Process() ); + + // Check to see if we are set to use mmc storage but the card has + // been removed. + if( iController.CheckMemoryToUseL() ) + { + // Record that we need to show the mmc removal note when the ui is + // ready. + iMMCRemoveNoteRequired = ETrue; + } + + // create navi-pane and navi-porgress bar for use in camcorder mode + PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create navicounter control") ); + iNaviCounterControl = CCamNaviCounterControl::NewL( *iNaviCounterModel ); + iNaviCounterControl->SetExtentToWholeScreen(); + + PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create progress bar control") ); + iNaviProgressBarControl = CCamNaviProgressBarControl::NewL( *iNaviProgressBarModel ); + + // get max num of images for burst capture + CamUtility::GetPsiInt( ECamPsiMaxBurstCapture, iMaxBurstCaptureNum ); + + PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL create AP handler") ); + iActivePaletteHandler = CCamActivePaletteHandler::NewL( iController, EFalse ); + + // get coutesy UI timeout + TInt timeoutValue; + CamUtility::GetPsiInt( ECamPsiCourtesyUiTimeoutValue, timeoutValue ); + + iCourtesyTimer = CCamTimer::NewL( timeoutValue * 1000000, + TCallBack( CCamAppUi::CourtesyTimeout, this ) ); + + PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL update navi models") ); + UpdateNaviModelsL(); + PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL navi counter reload resources") ); + iNaviCounterModel->ReloadResourceDataL(); + PRINT( _L("Camera <> CCamAppUi::CompleteAppUIConstructionL navi progress bar reload resources") ); + iNaviProgressBarModel->ReloadResourceDataL(); + + iFileCheckAo = CCamFileCheckAo::NewL( iController, *this ); + iCollectionManager = new (ELeave) CCamCollectionManagerAO( *this ); + + //iStillCaptureView->Container()->MakeVisible( ETrue ); + ActivateLocalViewL( iStillCaptureView->Id() ); + + StartCheckingDefaultAlbumIdL(); + PRINT( _L("Camera <= CCamAppUi::CompleteAppUIConstructionL") ) + } + +// --------------------------------------------------------- +// CCamAppUi::IsUiConstructionComplete() +// +// --------------------------------------------------------- +// +TBool CCamAppUi::IsUiConstructionComplete() + { + return iUiConstructionComplete; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::SetLensCoverExit +// Sets iLensCoverExit flag according to aValue +// ----------------------------------------------------------------------------- +// +void CCamAppUi::SetLensCoverExit( TBool aValue ) + { + iLensCoverExit = aValue; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::SetViewFinderStoppedStatus +// set whether camera viewfinder stop or not +// @param aViewFinderStopped ETrue viewfinder is stoped,EFalse viewfinder is runing +// ----------------------------------------------------------------------------- +// +void CCamAppUi::SetViewFinderStoppedStatus( TBool aViewFinderStopped ) + { + iViewFinderStopped = aViewFinderStopped; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::IsViewFinderInTransit +// ----------------------------------------------------------------------------- +// +TBool CCamAppUi::IsViewFinderInTransit() + { + return iViewFinderInTransit; + } + +// ----------------------------------------------------------------------------- +// CCamAppUi::SetViewFinderInTransit +// ----------------------------------------------------------------------------- +// +void CCamAppUi::SetViewFinderInTransit(TBool aInTransit) + { + iViewFinderInTransit = aInTransit; + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamBmpRotatorAo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamBmpRotatorAo.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility class to rotate bitmaps* +*/ + + + +// INCLUDE FILES +#include +#include +#include "CamBmpRotatorAo.h" +#include "camlogging.h" + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamBmpRotatorAo::CCamBmpRotatorAo +// C++ constructor +// ----------------------------------------------------------------------------- +// +CCamBmpRotatorAo::CCamBmpRotatorAo() : CActive( EPriorityHigh ) + { + } + +// ----------------------------------------------------------------------------- +// CCamBmpRotatorAo::ConstructL +// Second phase constructor. +// ----------------------------------------------------------------------------- +// +void CCamBmpRotatorAo::ConstructL() + { + iRotator = CBitmapRotator::NewL(); + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CCamBmpRotatorAo::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamBmpRotatorAo* CCamBmpRotatorAo::NewL() + { + CCamBmpRotatorAo* self = new( ELeave ) CCamBmpRotatorAo(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CCamBmpRotatorAo::~CCamBmpRotatorAo() +// Destructor +// ----------------------------------------------------------------------------- +// +CCamBmpRotatorAo::~CCamBmpRotatorAo() + { + PRINT( _L("Camera => ~CCamBmpRotatorAo") ); + if ( IsActive() ) + { + Cancel(); + } + + delete iRotator; + iQueue.ResetAndDestroy(); + PRINT( _L("Camera <= ~CCamBmpRotatorAo") ); + } + + + +// ----------------------------------------------------------------------------- +// CCamBmpRotatorAo::AddToQueueL +// Adds the specified bitmap/rotator to the queue of items to be rotated +// ----------------------------------------------------------------------------- +// +void CCamBmpRotatorAo::AddToQueueL( CFbsBitmap* aBitmap, CBitmapRotator::TRotationAngle aAngle ) + { + CRotateTask* task = new ( ELeave ) CRotateTask; + CleanupStack::PushL( task ); + task->iBitmap = aBitmap; + task->iAngle = aAngle; + User::LeaveIfError( iQueue.Append( task ) ); + CleanupStack::Pop( task ); + } + +// ----------------------------------------------------------------------------- +// CCamBmpRotatorAo::RunL +// Called when a rotation operation is completed (or cancelled) +// ----------------------------------------------------------------------------- +// +void CCamBmpRotatorAo::RunL() + { + // Pop the completed image from the queue. + CRotateTask* task = iQueue[0]; + iQueue.Remove( 0 ); + delete task; // NOTE: no need to delete bitmap (as not owned) + + // If rotate completed successfully... + // ... and there are more left on the queue... + // ... then start the next rotate + if ( iStatus.Int() == KErrNone ) + { + if ( iQueue.Count() > 0 ) + { + StartNextRotate(); + } + } + else + { + // Rotation failed; cancel further rotation attempts in + // the queue + iQueue.ResetAndDestroy(); + } + } + +// ----------------------------------------------------------------------------- +// CCamBmpRotatorAo::DoCancel +// Called to cancel an outstanding rotation operation +// ----------------------------------------------------------------------------- +// +void CCamBmpRotatorAo::DoCancel() + { + iRotator->Cancel(); + } + +// ----------------------------------------------------------------------------- +// CCamBmpRotatorAo::StartNextRotate +// Called to start the next queued rotation task. If no tasks are queued, does nothing +// ----------------------------------------------------------------------------- +// +void CCamBmpRotatorAo::StartNextRotate() + { + if ( iQueue.Count() == 0 ) + return; + + CRotateTask* task = iQueue[0]; + + iRotator->Rotate( &iStatus, *task->iBitmap, task->iAngle ); + SetActive(); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamBurstCaptureArray.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamBurstCaptureArray.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,581 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: A class that represents a single item in a burst capture +* +* Copyright © 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include + +#include +#include + +#include "CamBurstCaptureArray.h" +#include "CamImageSaveActive.h" +#include "CamPanic.h" +#include "camlogging.h" + + +// CONSTANTS + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// CCamBurstCaptureItem::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamBurstCaptureArray::CCamBurstCaptureItem* CCamBurstCaptureArray::CCamBurstCaptureItem::NewLC() + { + CCamBurstCaptureItem* self = new( ELeave ) CCamBurstCaptureItem(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureItem destructor +// +// --------------------------------------------------------------------------- +// +CCamBurstCaptureArray::CCamBurstCaptureItem::~CCamBurstCaptureItem() + { + PRINT( _L("Camera => ~CCamBurstCaptureItem") ); + delete iFileName; + delete iImageName; + delete iSnapshot; + PRINT( _L("Camera <= ~CCamBurstCaptureItem") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureItem::SetNameL +// Sets the item's full file path and image name +// --------------------------------------------------------------------------- +// +void CCamBurstCaptureArray::CCamBurstCaptureItem::SetNameL( const TDesC& aFullFileName, + const TDesC& aImageName ) + { + delete iFileName; + iFileName = NULL; + delete iImageName; + iImageName = NULL; + iFileName = aFullFileName.AllocL(); + iImageName = aImageName.AllocL(); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureItem::SetSnapshotL +// Stores the snapshot bitmap in the item +// --------------------------------------------------------------------------- +// +void CCamBurstCaptureArray::CCamBurstCaptureItem::SetSnapshotL( const CFbsBitmap& aSnapshot ) + { + delete iSnapshot; + iSnapshot = NULL; + + // Create bitmap + iSnapshot = new( ELeave ) CFbsBitmap(); + TInt createError = iSnapshot->Duplicate( aSnapshot.Handle() ); + + if ( createError ) + { + delete iSnapshot; + iSnapshot = NULL; + } + + User::LeaveIfError( createError ); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureItem::SetDeleted +// Sets the item's deletion state +// --------------------------------------------------------------------------- +// +void CCamBurstCaptureArray::CCamBurstCaptureItem::SetDeleted( TBool aDeleted ) + { + iIsDeleted = aDeleted; + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureItem::FileName +// Return a pointer to the full file path and name +// --------------------------------------------------------------------------- +// +const TDesC& CCamBurstCaptureArray::CCamBurstCaptureItem::FileName() const + { + if( !iFileName ) + { + return KNullDesC; + } + else + { + return *iFileName; + } + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureItem::ImageName +// Return a pointer to the image name +// --------------------------------------------------------------------------- +// +const TDesC& CCamBurstCaptureArray::CCamBurstCaptureItem::ImageName() const + { + return *iImageName; + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupListItem::Bitmap +// Return a pointer to the bitmap +// --------------------------------------------------------------------------- +// +const CFbsBitmap* CCamBurstCaptureArray::CCamBurstCaptureItem::Snapshot() const + { + return iSnapshot; + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureItem::IsDeleted +// Whether or not the item has been marked for deletion +// --------------------------------------------------------------------------- +// +TBool CCamBurstCaptureArray::CCamBurstCaptureItem::IsDeleted() const + { + return iIsDeleted; + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::CCamBurstCaptureItem::ReplaceSnapshot +// Replaces the bitmap. +// --------------------------------------------------------------------------- +// +TBool CCamBurstCaptureArray::CCamBurstCaptureItem::ReplaceSnapshot( + const CFbsBitmap* aBitmap ) + { + if( !iSnapshot ) + { + TRAPD( err, iSnapshot = new( ELeave ) CFbsBitmap() ); + if( err ) + { + return EFalse; + } + } + if ( iSnapshot->Duplicate( aBitmap->Handle() ) ) + { + return EFalse; + } + return ETrue; + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureItem::CCamBurstCaptureItem +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamBurstCaptureArray::CCamBurstCaptureItem::CCamBurstCaptureItem() + { + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureItem::ConstructL +// Second phase construction +// --------------------------------------------------------------------------- +// +void CCamBurstCaptureArray::CCamBurstCaptureItem::ConstructL() + { + } + +// ----------------------------------------------------------------------------- +// CCamBurstCaptureArray::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamBurstCaptureArray* CCamBurstCaptureArray::NewL( CCamImageSaveActive& aImageSaveActive ) + { + CCamBurstCaptureArray* self = new( ELeave ) CCamBurstCaptureArray( aImageSaveActive ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray destructor +// +// --------------------------------------------------------------------------- +// +CCamBurstCaptureArray::~CCamBurstCaptureArray() + { + iBurstItems.ResetAndDestroy(); + iBurstItems.Close(); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::SetNameL +// Sets an item's full file path and image name +// --------------------------------------------------------------------------- +// +void CCamBurstCaptureArray::SetNameL( const TDesC& aFullFileName, + const TDesC& aImageName, TInt aIndex ) + { + PRINT1( _L("Camera => CCamBurstCaptureArray::SetNameL, name:[%S]"), &aFullFileName ); + iBurstItems[aIndex]->SetNameL( aFullFileName, aImageName ); + PRINT( _L("Camera <= CCamBurstCaptureArray::SetNameL") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::AlreadySavedFile +// Returns whether a particular file has already been saved. +// --------------------------------------------------------------------------- +// +TBool CCamBurstCaptureArray::AlreadySavedFile( const TDesC& aFilename ) + { + return iImageSaveActive.AlreadySavedFile( aFilename ); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::CurrentlySavingFile +// Returns whether a particular file is in the process of being saved. +// --------------------------------------------------------------------------- +// +TBool CCamBurstCaptureArray::CurrentlySavingFile( const TDesC& aFilename ) + { + return iImageSaveActive.CurrentlySavingFile( aFilename ); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::Count +// Return the number of items in the array +// --------------------------------------------------------------------------- +// +TInt CCamBurstCaptureArray::Count() const + { + return iBurstItems.Count(); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::Reset +// Delete unwanted items from the array +// --------------------------------------------------------------------------- +// +void CCamBurstCaptureArray::Reset( TInt aRequiredCount ) + { + PRINT1( _L("Camera => CCamBurstCaptureArray::Reset(%d)"), aRequiredCount ); + TInt count = iBurstItems.Count(); + // if the current count is less than the required count + if ( aRequiredCount >= count ) + { + return; + } + // if the required count is 0 or less, empty the array + if ( aRequiredCount <= 0 ) + { + iBurstItems.ResetAndDestroy(); + iNextSetName = 0; + iNextGetName = 0; + iNextSnapshot = 0; + iImagesRemaining = 0; + } + // otherwise delete the unwanted items + else + { + TInt index; + // repeat for every extra item + for ( index = count - 1; index >= aRequiredCount; index-- ) + { + CCamBurstCaptureItem* item = iBurstItems[index]; + if ( !item->IsDeleted() ) + { + iImagesRemaining--; + } + iBurstItems.Remove( index ); + delete item; + } + // reset the accessing indexes if necessary + count = iBurstItems.Count(); + iNextSetName = Min( iNextSetName, count ); + iNextSnapshot = Min( iNextSnapshot, count ); + } + User::Heap().Compress(); + PRINT( _L("Camera <= CCamBurstCaptureArray::Reset") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::SetNextNameL +// Set the item's full file path and image name +// --------------------------------------------------------------------------- +// +void CCamBurstCaptureArray::SetNextNameL( const TDesC& aFullFileName, const TDesC& aImageName ) + { + PRINT1( _L("Camera => CCamBurstCaptureArray::SetNextNameL, name:[%S]"), &aFullFileName ); + CheckArraySizeL( iNextSetName ); + iBurstItems[iNextSetName]->SetNameL( aFullFileName, aImageName ); + iNextSetName++; + PRINT( _L("Camera <= CCamBurstCaptureArray::SetNextNameL") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::SetNextSnapshotL +// Stores the snapshot bitmap in the item +// --------------------------------------------------------------------------- +// +void CCamBurstCaptureArray::SetNextSnapshotL( const CFbsBitmap& aSnapshot ) + { + PRINT( _L("Camera => CCamBurstCaptureArray::SetNextSnapshotL") ); + CheckArraySizeL( iNextSnapshot ); + TInt nextIndex = iNextSnapshot; + iNextSnapshot++; + iBurstItems[nextIndex]->SetSnapshotL( aSnapshot ); + PRINT( _L("Camera <= CCamBurstCaptureArray::SetNextSnapshotL") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::SetDeleted +// Sets the items deletion state +// --------------------------------------------------------------------------- +// +TInt CCamBurstCaptureArray::SetDeleted( TInt aItemIndex, TBool aDeleted ) + { + PRINT2( _L("Camera => CCamBurstCaptureArray::SetDeleted( index:%d, deleted:%d )"), aItemIndex, aDeleted ); + TInt ret = KErrNone; + + __ASSERT_DEBUG( aItemIndex < Count() && aItemIndex >= 0, + CamPanic( ECamPanicBadIndex ) ); + + if ( aDeleted == iBurstItems[aItemIndex]->IsDeleted() ) + { + PRINT( _L("Camera <= CCamBurstCaptureArray::SetDeleted A") ); + return ret; + } + + if ( aDeleted ) + { + //iImagesRemaining--; + TInt saveRequested = EFalse; + // if the image save has already been requested + if ( aItemIndex < iNextGetName ) + { + saveRequested = ETrue; + } + iImageSaveActive.CancelThumbnail( aItemIndex ); + ret = iImageSaveActive.DeleteFile( iBurstItems[aItemIndex]->FileName(), saveRequested ); + + PRINT1( _L("Camera <> CCamBurstCaptureArray::SetDeleted iImageSaveActive.DeleteFile() returned %d" ), ret ); + // file might have already been deleted and that's ok so ignore -NotFound errors + if( ret == KErrNone || ret == KErrNotFound || ret == KErrPathNotFound ) + { + iImagesRemaining--; + } + } + else + { + iImagesRemaining++; + } + if( ret == KErrNone || ret == KErrNotFound || ret == KErrPathNotFound ) + { + iBurstItems[aItemIndex]->SetDeleted( aDeleted ); + } + + PRINT( _L("Camera <= CCamBurstCaptureArray::SetDeleted B") ); + return ret; + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::IsNextImageDeleted +// Increments iNextGetName and returns ETrue if the next image is marked for +// deletion, otherwise returns EFalse +// --------------------------------------------------------------------------- +// +TBool CCamBurstCaptureArray::IsNextImageDeleted() + { + PRINT( _L("Camera => CCamBurstCaptureArray::IsNextImageDeleted") ); + TBool deleted( EFalse ); + + if ( iNextGetName >= Count() ) + { + PRINT2( _L("Camera <> index(%d) out of range(%d), return deleted"), iNextGetName, Count() ); + deleted = ETrue; + } + else if ( iBurstItems[iNextGetName]->IsDeleted() ) + { + PRINT( _L("Camera <> next item marked deleted") ); + iNextGetName++; + deleted = ETrue; + } + else + { + deleted = EFalse; + } + + PRINT1( _L("Camera <= CCamBurstCaptureArray::IsNextImageDeleted, return: %d"), deleted ); + return deleted; + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::NextFileName +// Returns a pointer to the full file path and name for the next image +// --------------------------------------------------------------------------- +// +const TDesC& CCamBurstCaptureArray::NextFileName() + { + PRINT( _L("Camera => CCamBurstCaptureArray::NextFileName") ); + if ( iNextGetName >= Count() ) + { + PRINT( _L("Camera <> Returning KNullDesC") ); + return KNullDesC; + } + + TInt itemIndex = iNextGetName; + iNextGetName++; + + PRINT( _L("Camera <= CCamBurstCaptureArray::NextFileName") ); + return iBurstItems[itemIndex]->FileName(); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::NextFileIndex +// Returns the index of the next image +// --------------------------------------------------------------------------- +// +TInt CCamBurstCaptureArray::NextFileIndex() const + { + return iNextGetName; + } + + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::FileName +// Returns a pointer to the full file path and name +// --------------------------------------------------------------------------- +// +const TDesC& CCamBurstCaptureArray::FileName( TInt aItemIndex ) const + { + if ( aItemIndex >= Count() || aItemIndex < 0 ) + { + return KNullDesC; + } + return iBurstItems[aItemIndex]->FileName(); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::ImageName +// Returns a pointer to the image name +// --------------------------------------------------------------------------- +// +const TDesC& CCamBurstCaptureArray::ImageName( TInt aItemIndex ) const + { + if ( aItemIndex >= Count() || aItemIndex < 0 ) + { + return KNullDesC; + } + return iBurstItems[aItemIndex]->ImageName(); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::Snapshot +// Returns a pointer to the snapshot image +// --------------------------------------------------------------------------- +// +const CFbsBitmap* CCamBurstCaptureArray::Snapshot( TInt aItemIndex ) const + { + if ( aItemIndex >= Count() || aItemIndex < 0 ) + { + return NULL; + } + return iBurstItems[aItemIndex]->Snapshot(); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::IsDeleted +// Returns the item's deletion state +// --------------------------------------------------------------------------- +// +TBool CCamBurstCaptureArray::IsDeleted( TInt aItemIndex ) const + { + if ( aItemIndex >= Count() ) + { + return ETrue; + } + return iBurstItems[aItemIndex]->IsDeleted(); + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::ReplaceSnapshot +// Replaces the bitmap in the given index. +// --------------------------------------------------------------------------- +// +TBool CCamBurstCaptureArray::ReplaceSnapshot( + const CFbsBitmap* aBitmap, + TInt aItemIndex ) + { + if ( ( iBurstItems.Count() > aItemIndex ) && + ( aItemIndex >= 0 ) ) + { + return iBurstItems[aItemIndex]->ReplaceSnapshot( aBitmap ); + } + return EFalse; + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::CCamBurstCaptureArray +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamBurstCaptureArray::CCamBurstCaptureArray( CCamImageSaveActive& aImageSaveActive ) +: iImageSaveActive( aImageSaveActive ) + { + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::ConstructL +// Second phase construction +// --------------------------------------------------------------------------- +// +void CCamBurstCaptureArray::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// CCamBurstCaptureArray::CheckArraySizeL +// Add extra items to the array if required +// --------------------------------------------------------------------------- +// +void CCamBurstCaptureArray::CheckArraySizeL( TInt aRequiredIndex ) + { + TInt count = Count(); + TInt i; + for ( i = count; i <= aRequiredIndex; i++ ) + { + CCamBurstCaptureItem* newItem = CCamBurstCaptureItem::NewLC(); + iBurstItems.AppendL( newItem ); + CleanupStack::Pop( newItem ); + iImagesRemaining++; + } + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamBurstThumbnailContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamBurstThumbnailContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,335 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container class for burst thumbnail view* +*/ + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include // AknLayoutScalable_Apps + + +#include "CamBurstThumbnailContainer.h" +#include "CamBurstThumbnailGrid.h" +#include "camlogging.h" +#include "CamUtility.h" + + + +// CONSTANTS + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailContainer::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamBurstThumbnailContainer* CCamBurstThumbnailContainer::NewL( + CCamAppController& aController, + CAknView& aView, + const TRect& aRect, + CCamBurstThumbnailGridModel& aGridModel ) + { + CCamBurstThumbnailContainer* self = new( ELeave ) + CCamBurstThumbnailContainer( aController, aView, aGridModel ); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + CleanupStack::Pop( ); + // return newly created CCamBurstThumbnailContainer instance + return self; + } + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailContainer +// Destructor +// --------------------------------------------------------------------------- +// +CCamBurstThumbnailContainer::~CCamBurstThumbnailContainer() + { + delete iGridControl; + } + +// --------------------------------------------------------- +// CCamBurstThumbnailContainer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamBurstThumbnailContainer::ConstructL( const TRect& aRect ) + { + + PRINT( _L("Camera => CCamBurstThumbnailContainer::ConstructL") ); + CCamContainerBase::BaseConstructL( aRect ); + + iGridControl = CCamBurstThumbnailGrid::NewL( this , iGridModel ); + + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect ); + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, + statusPaneRect ); + + // layout area rectangle contains the area, where components need to be + // drawn to. the container size is the whole screen, but the layouts are + // for the client area. aRect is the container size that might include or + // might not include statuspane area. calculating area self will + // go around the problem + TRect layoutAreaRect; + layoutAreaRect = mainPaneRect; + layoutAreaRect.BoundingRect( statusPaneRect ); + + + TAknLayoutRect burstPaneRect; + if ( CamUtility::IsNhdDevice() ) + { + // use layoutAreaRect for nhd (contains the statuspane) + burstPaneRect.LayoutRect( layoutAreaRect, AknLayoutScalable_Apps::main_cam4_burst_pane() ); + // SetRect( layoutAreaRect ); + } + else + { + // use mainpane for vga + burstPaneRect.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_cam4_burst_pane() ); + + } + + + // layout grid + TInt gridSize = iGridModel.NoOfValidCells(); + + if ( gridSize <= KBurstGridDefaultThumbnails) + { + AknLayoutUtils::LayoutControl( iGridControl, /*aRect*/ + burstPaneRect.Rect(), + AknLayoutScalable_Apps::grid_cam4_burst_pane(1) ); + } + else if ( gridSize <= KBurstGridMaxVisibleThumbnails ) + { + AknLayoutUtils::LayoutControl( iGridControl, //aRect, + burstPaneRect.Rect(), + AknLayoutScalable_Apps::grid_cam4_burst_pane(3) ); + } + else // gridSize > KBurstGridMaxVisibleThumbnails + { + AknLayoutUtils::LayoutControl( iGridControl, //aRect + burstPaneRect.Rect(), + AknLayoutScalable_Apps::grid_cam4_burst_pane(5) ); + } + + // scroll bar + if ( gridSize > KBurstGridMaxVisibleThumbnails ) + { + // Will create the scrollbar if it is needed + iGridControl->SetMopParent( this ); + iGridControl->CreateScrollBarL(); + iGridControl->SetupScrollbarL( ); + } + + + iFeedback = MTouchFeedback::Instance(); + + // make sure that softkeys are shown + DrawableWindow()->SetOrdinalPosition( KCamPostCaptureWindowOrdinalPos ); + + PRINT( _L("Camera <= CCamBurstThumbnailContainer::ConstructL") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailContainer::CCamBurstThumbnailContainer +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamBurstThumbnailContainer::CCamBurstThumbnailContainer( + CCamAppController& aController, + CAknView& aView, + CCamBurstThumbnailGridModel& aGridModel ) +: CCamContainerBase( aController, aView ), iGridModel( aGridModel ) + { + } + +// --------------------------------------------------------- +// CCamBurstThumbnailContainer::CountComponentControls +// Returns the number of controls owned +// --------------------------------------------------------- +// +TInt CCamBurstThumbnailContainer::CountComponentControls() const + { + return 1; // Return the number of controls inside this container + } + +// --------------------------------------------------------- +// CCamBurstThumbnailContainer::ComponentControl +// Return pointer to a contained control +// --------------------------------------------------------- +// +CCoeControl* CCamBurstThumbnailContainer::ComponentControl( TInt aIndex ) const + { + switch ( aIndex ) + { + case 0: + { + return iGridControl; + } + default: + break; + } + + // Should never get here + return NULL; + } + + +// --------------------------------------------------------- +// CCamBurstThumbnailContainer::Draw +// Draw control +// --------------------------------------------------------- +// +void CCamBurstThumbnailContainer::Draw( const TRect& aRect ) const + { + + CWindowGc& gc = SystemGc(); + + // Draw skin background for the + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, gc, aRect ); + + //gc.Clear( Rect() ); + + } + +// ---------------------------------------------------- +// CCamBurstThumbnailContainer::OfferKeyEventL +// Handles this application view's command keys. Forwards other +// keys to child control(s). +// ---------------------------------------------------- +// +TKeyResponse +CCamBurstThumbnailContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + PRINT( _L("Camera => CCamBurstThumbnailContainer::OfferKeyEventL") ); + TKeyResponse response( EKeyWasNotConsumed ); + TBool captureKey = IsCaptureKeyL( aKeyEvent, aType ); + + TBool embedded = static_cast( + CEikonEnv::Static()->AppUi() )->IsEmbedded(); + + // If the back softkey is pressed + if ( aKeyEvent.iScanCode == EStdKeyDevice1 ) + { + response = EKeyWasNotConsumed; // indicate key press was not processed + } + else if ( aKeyEvent.iScanCode == EStdKeyDevice3 ) // Select key + { + // Will pass it on to the view + response = CCamContainerBase::OfferKeyEventL( aKeyEvent, aType ); + } + //make sure to unset DemandKeyRelease + else if( aType == EEventKeyUp && !embedded ) + { + iController.SetDemandKeyRelease( EFalse ); + } + else if ( captureKey // && aKeyEvent.iScanCode == EProductKeyCapture ) + || IsShutterKeyL( aKeyEvent, aType ) + ) + { + if ( aType == EEventKeyDown ) + // check needed, since EEventFocusLost produces EEventKeyUp for shutterkey + { + if ( !embedded ) + { + iGridModel.CancelThumbnails(); + + iView.HandleCommandL( ECamCmdNewPhoto ); + // Demand to relese capture key in pre capture view + iController.SetDemandKeyRelease( ETrue ); + response = EKeyWasConsumed; + } + + } + } + else if ( aType == EEventKey && + aKeyEvent.iScanCode == EStdKeyBackspace ) // Handle 'C' key + { + iView.HandleCommandL( ECamCmdDelete ); + response = EKeyWasConsumed; + } + else if ( aKeyEvent.iScanCode == EStdKeyYes + && aType == EEventKey && !AknLayoutUtils::PenEnabled() ) + { + iView.HandleCommandL( ECamCmdQuickSend ); + response = EKeyWasConsumed; + } + else + { + PRINT( _L("Camera <> CCamBurstThumbnailContainer: offer key to grid control..") ); + response = iGridControl->OfferKeyEventL( aKeyEvent, aType ); + } + + PRINT1( _L("Camera <= CCamBurstThumbnailContainer::OfferKeyEventL, return %d"), response ); + return response; + } + +void CCamBurstThumbnailContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + //CCoeControl::HandlePointerEventL( aPointerEvent ); + + PRINT3( _L("Camera => CCamBurstThumbnailContainer::HandlePointerEventL iType=%d iPosition=(%d, %d)"), + aPointerEvent.iType, + aPointerEvent.iPosition.iX, + aPointerEvent.iPosition.iY ); + + + if ( aPointerEvent.iType == TPointerEvent::EButton1Up) + { + // check if the pointer event should be handled as grid selection + if ( iGridControl && iGridControl->Rect().Contains( aPointerEvent.iPosition ) ) + { + TInt gridItem = iGridControl->HitTestGridItems( aPointerEvent.iPosition ); + + if ( gridItem >= 0 ) + { + + if ( iFeedback ) + { + iFeedback->InstantFeedback( ETouchFeedbackBasic ); + } + // inform model about the new higlighted item + if ( iGridModel.SetHighlight( gridItem ) ) + { + // highlight changed -> redraw + DrawDeferred(); + } + else + { + // highlight item did not change -> open item in postcapture view + iView.HandleCommandL( EAknSoftkeySelect ); + } + } + } + + } + + + PRINT( _L("Camera <= CCamBurstThumbnailContainer::HandlePointerEventL")); + + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamBurstThumbnailGrid.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamBurstThumbnailGrid.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,835 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for displaying the images captured by a Burst session.* +*/ + + + +// INCLUDE FILES +#include +#include +#include // For CEikScrollBar +#include // For CBitmapScaler +#include +#include +#include // For TResourceReader +#include +#include +#include +#include // EMbmAvkonQgn_indi_marked_grid_add + +#include +#include + +#include +#include +#include // AknLayoutScalable_Apps + +#include "camuiconstants.h" + +#include "CamUtility.h" +#include "CamBurstThumbnailGrid.h" +#include "CamAppUi.h" +#include "CamPanic.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGrid::CCamBurstThumbnailGrid +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamBurstThumbnailGrid::CCamBurstThumbnailGrid( CCamBurstThumbnailGridModel& aModel ) : + iModel( aModel ) + { + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGrid::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGrid::ConstructL( const CCoeControl* aParent ) + {// Fill in the model + + SetContainerWindowL( *aParent ); + + // Generate the grid size (either 6 for 3x2 or 9 for 3x3 grid) + iGridSize = iModel.GridHeight() * KGridWidth; + + + + // Create component bitmaps + // TFileName resFileName; + //CamUtility::ResourceFileName( resFileName ); + //TPtrC resname = resFileName; + + iBitmapMark = NULL; + iBitmapMarkMask = NULL; + + AknIconUtils::CreateIconL( iBitmapMark, + iBitmapMarkMask, + AknIconUtils::AvkonIconFileName(), + EMbmAvkonQgn_indi_marked_grid_add, + EMbmAvkonQgn_indi_marked_grid_add_mask ); + + // Request notification of Deletion and new Thumbnail events + iModel.AddModelObserverL( this, CCamBurstThumbnailGridModel::EModelEventDeleted | + CCamBurstThumbnailGridModel::EModelEventThumb ); + + + UpdateLayout(); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGrid::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamBurstThumbnailGrid* CCamBurstThumbnailGrid::NewL( const CCoeControl* aParent, CCamBurstThumbnailGridModel& aModel ) + { + CCamBurstThumbnailGrid* self = new( ELeave ) CCamBurstThumbnailGrid( aModel ); + + CleanupStack::PushL( self ); + self->ConstructL( aParent ); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +CCamBurstThumbnailGrid::~CCamBurstThumbnailGrid() + { + delete iBitmapMark; + delete iBitmapMarkMask; + + // Remove notification of Deletion and new Thumbnail events + iModel.RemoveModelObserver( this, CCamBurstThumbnailGridModel::EModelEventDeleted | + CCamBurstThumbnailGridModel::EModelEventThumb ); + + DeleteScrollBar(); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGrid::Draw +// The control's drawing function +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGrid::Draw( const TRect& aRect ) const + { + PRINT( _L("Camera => CCamBurstThumbnailGrid::Draw") ); + + CWindowGc& gc = SystemGc(); + + // Draw skin background + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, gc, Rect() ); + + TInt index = 0; + TInt visibleIndex = iModel.TopLeftGridIndex(); // first visible item index + TInt y = 0; + TInt x = 0; + for ( y = 0; y < iModel.GridHeight(); y++ ) // height of visible grid + { + for ( x = 0; x < KGridWidth; x++ ) + { + + if ( visibleIndex >= iModel.NoOfValidCells() ) + { + break; // only breaks the inner for-loop + } + + // Draw the outline rectangle for the Cell + //gc.SetPenColor( KGreyOutline ); // From the screenshot + TRect r = iGridCellLayout[ index ].iCellRect.Rect(); + + // draw background highlight for the focused item + if ( iModel.HighlightedGridIndex() == visibleIndex ) + { +#ifdef _DEBUG + TRect _cell = iGridCellLayout[ index ].iCellRect.Rect(); + TRect _high = iGridCellLayout[ index ].iHighRect.Rect(); + TRect _thmb = iGridCellLayout[ index ].iThmbRect.Rect(); + PRINT4( _L("Camera <> CCamBurstThumbnailGrid - grid cell rect[x:%d y:%d w:%d h%d]"), + _cell.iTl.iX, _cell.iTl.iY, _cell.Width(), _cell.Height() ); + PRINT4( _L("Camera <> CCamBurstThumbnailGrid - highlight rect[x:%d y:%d w:%d h%d]"), + _high.iTl.iX, _high.iTl.iY, _high.Width(), _high.Height() ); + PRINT4( _L("Camera <> CCamBurstThumbnailGrid - thumbnail rect[x:%d y:%d w:%d h%d]"), + _thmb.iTl.iX, _thmb.iTl.iY, _thmb.Width(), _thmb.Height() ); +#endif // _DEBUG + + TRgb highlight; + AknsUtils::GetCachedColor( skin, highlight, KAknsIIDQsnHighlightColors, + EAknsCIQsnHighlightColorsCG1 ); + PRINT1( _L("Camera <> CCamBurstThumbnailGrid::Draw - highlight color: 0x%08x"), highlight.Internal() ); + gc.SetBrushColor( highlight ); + gc.Clear( r ); + } + + + CThumbnailGridItem* item = iModel.GridItem( visibleIndex ); + + if ( item ) + { + + TRect trgRect( iGridCellLayout[ index ].iThmbRect.Rect() ); + if ( item->iDisplayThumb ) + { + PRINT( _L("Camera <> CCamBurstThumbnailGrid::Draw - prescaled thumb available") ); + + // Thumbnail grid sizer provides an image that fits + // to the given rect by one dimension and is larger in the other. + // (If aspect ratios don't match.) Crop the oversize area. + gc.SetClippingRect( trgRect ); + + const TSize& bmpSize( item->iDisplayThumb->SizeInPixels() ); + PRINT2( _L("Camera <> CCamBurstThumbnailGrid - bmp size [w:%d h%d]"), + bmpSize.iWidth, bmpSize.iHeight ); + + PRINT2( _L("Camera <> CCamBurstThumbnailGrid - cell size [w:%d h%d]"), + trgRect.Width(), trgRect.Height() ); + + // Move the start of drawing so, that the image stays centered to the available area. + TInt widthDif = bmpSize.iWidth - trgRect.Width(); + TInt heightDif = bmpSize.iHeight - trgRect.Height(); + TPoint drawTl = trgRect.iTl - TPoint( widthDif/2, heightDif/2 ); + PRINT2( _L("Camera <> CCamBurstThumbnailGrid - draw start offset [x:%d y%d]"), + widthDif, heightDif ); + + gc.BitBlt( drawTl, item->iDisplayThumb ); + gc.SetClippingRect( aRect ); + } + else // no rescaled bitmap exists, and we can fast-rescale snapshot + { + PRINT( _L("Camera <> CCamBurstThumbnailGrid::Draw - prescaled thumb NOT available") ); + const CFbsBitmap* bmp = iModel.Snapshot( iModel.TopLeftGridIndex() + index ); + + if ( bmp ) + { + TSize bmpSize( bmp->SizeInPixels() ); + TRect srcRect( bmpSize ); + + TReal bmpRatio( TReal( bmpSize.iWidth ) / TReal( bmpSize.iHeight ) ); + TReal trgRatio( TReal( trgRect.Width() ) / TReal( trgRect.Height() ) ); + + if( bmpRatio > trgRatio ) + { + // Thumbnail aspect ratio is wider than the target cell area. + // Crop some of the thumbnail width off and fill the target rect. + const TInt width = Max( bmpSize.iHeight * trgRatio, 1 ); + const TInt crop = ( bmpSize.iWidth - width ) / 2; + srcRect.Shrink( crop, 0 ); + } + if( bmpRatio < trgRatio ) + { + // Bitmap is higher than the screen. + // Crop some of the thumbnail height off and fill the target rect. + const TInt height = Max( bmpSize.iWidth * trgRatio, 1 ); + const TInt crop = ( bmpSize.iHeight - height ) / 2; + srcRect.Shrink( 0, crop ); + } + + PRINT2( _L("Camera <> CCamBurstThumbnailGrid - bmp size [w:%d h%d]"), + bmpSize.iWidth, bmpSize.iHeight ); + PRINT4( _L("Camera <> CCamBurstThumbnailGrid - bmp cropped [x:%d y:%d w:%d h%d]"), + srcRect.iTl.iX, srcRect.iTl.iY, srcRect.Width(), srcRect.Height() ); + PRINT4( _L("Camera <> CCamBurstThumbnailGrid - trg rect [x:%d y:%d w:%d h%d]"), + trgRect.iTl.iX, trgRect.iTl.iY, trgRect.Width(), trgRect.Height() ); + + gc.DrawBitmap( trgRect, bmp, srcRect ); + } + + } + + // Draw the marked symbol + if ( item->iMarked ) + { + PRINT2(_L("CAMERA <> CCamBurstThumbnailGrid::Draw (item marked) x:%d y:%d"), x, y ) + + TRect mark = iGridCellLayout[ index ].iMarkRect.Rect(); + + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); // Make sure background isn't drawn + gc.BitBltMasked( iGridCellLayout[ index ].iMarkRect.Rect().iTl, + iBitmapMark, + iBitmapMark->SizeInPixels(), + iBitmapMarkMask, + EFalse ); + + } + + } // end of: if ( item ) + + index++; + visibleIndex++; + } // for x + } // for y + + PRINT( _L("Camera <= CCamBurstThumbnailGrid::Draw") ); + } + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::CountComponentControls +// Returns the number of component controls +// --------------------------------------------------------- +// +TInt CCamBurstThumbnailGrid::CountComponentControls() const + { + TInt count = 0; // Return the number of controls inside this container + if ( iScrollFrame ) + { + count = iScrollFrame->CountComponentControls(); + } + return count; + } + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::SizeChanged +// Constructs the grid layout structure +// --------------------------------------------------------- +// +void CCamBurstThumbnailGrid::SizeChanged() + { + + PRINT( _L("Camera => CCamBurstThumbnailGrid::SizeChanged()") ); + + ReadLayout(); + + // set the new thumbnail size for gridmodel (to be used with thumbnail scaling) + // use layout for the first cell (all thumbnails are same size) + iModel.SetThumbnailSize( iGridCellLayout[0].iThmbRect.Rect().Size() ); + + AknIconUtils::SetSize( iBitmapMark, iGridCellLayout[0].iMarkRect.Rect().Size() ); + AknIconUtils::SetSize( iBitmapMarkMask, iGridCellLayout[0].iMarkRect.Rect().Size() ); + + PRINT( _L("Camera <= CCamBurstThumbnailGrid::SizeChanged()") ); + } + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::ResourceId +// Returns the ID of the resource to use for the grid structure +// --------------------------------------------------------- +// +TInt CCamBurstThumbnailGrid::ResourceId() + { + TInt resource = 0; + if ( iModel.NoOfValidCells() > KSmallGridCellCount ) + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + resource = R_CAM_BURST_POST_CAPTURE_GRID_ARRAY; + } + else + { + resource = R_CAM_BURST_POST_CAPTURE_GRID_ARRAY; + } + } + else // Else six or less image to be used + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + resource = R_CAM_BURST_POST_CAPTURE_GRID_ARRAY_UPTO_SIX; + } + else + { + resource = R_CAM_BURST_POST_CAPTURE_GRID_ARRAY_UPTO_SIX_AH; + } + } + return resource; + } + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::ReadLayoutL +// --------------------------------------------------------- +// +void CCamBurstThumbnailGrid::ReadLayout() + { + PRINT( _L("Camera => CCamBurstThumbnailGrid::ReadLayout() ") ); + + + TInt layoutVariantForThumbnail = 0; + TInt layoutVariantForCell = 1; + + if ( iModel.NoOfValidCells() <= KBurstGridDefaultThumbnails) + { + layoutVariantForThumbnail = 0; + layoutVariantForCell = 1; + } + else if ( iModel.NoOfValidCells() <= KBurstGridMaxVisibleThumbnails ) + { + layoutVariantForThumbnail = 1; + layoutVariantForCell = 3; + } + else // iModel.NoOfValidCells() > KBurstGridMaxVisibleThumbnails + { + layoutVariantForThumbnail = 2; + layoutVariantForCell = 5; + } + + TInt i = 0; + TInt y = 0; + TInt x = 0; + + // set all layout entries for cells + for ( y = 0; y < iModel.GridHeight(); y++ ) + { + for ( x = 0; x < KGridWidth; x++ ) + { + iGridCellLayout[i].iCellRect.LayoutRect( Rect(), + AknLayoutScalable_Apps::cell_cam4_burst_pane( layoutVariantForCell, x, y ) ); + iGridCellLayout[i].iThmbRect.LayoutRect( iGridCellLayout[i].iCellRect.Rect(), + AknLayoutScalable_Apps::cell_cam4_burst_pane_g1( layoutVariantForThumbnail, 0, 0 ) ); + iGridCellLayout[i].iMarkRect.LayoutRect( iGridCellLayout[i].iThmbRect.Rect(), + AknLayoutScalable_Apps::cell_cam4_burst_pane_g2( layoutVariantForThumbnail ) ); + i++; + } + } + + PRINT( _L("Camera <= CCamBurstThumbnailGrid::ReadLayout() ") ); + } + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::ComponentControl +// Returns the requested component control +// --------------------------------------------------------- +// +CCoeControl* CCamBurstThumbnailGrid::ComponentControl( TInt aIndex ) const + { + if ( iScrollFrame ) + { + return iScrollFrame->ComponentControl( aIndex ); + } + else + { + return NULL; + } + } + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::ThumbnailGenerated +// Called when a thumbnail has been scaled +// --------------------------------------------------------- +// +void CCamBurstThumbnailGrid::ThumbnailGenerated() + { + DrawDeferred(); + } + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::HandleScrollEventL +// --------------------------------------------------------- +// +void CCamBurstThumbnailGrid::HandleScrollEventL( CEikScrollBar* aScrollBar, TEikScrollEvent aEventType ) + { + + // compare to old position, set correct starting point for drawing the grid + + TInt numOfRows = ( iModel.NoOfValidCells() / KGridWidth ) ; + if ( iModel.NoOfValidCells() % KGridWidth != 0 ) + { + numOfRows++; + } + + TInt oldRow = ( iModel.TopLeftGridIndex() / KGridWidth ); + if ( iModel.TopLeftGridIndex() % KGridWidth != 0 ) + { + oldRow++; + } + + TInt newRow = aScrollBar->ThumbPosition(); + PRINT1( _L("Camera <> CCamBurstThumbnailGrid::HandleScrollEventL - thumb postition %d"), newRow ); + + + if ( oldRow != newRow ) + { + iModel.ScrollGrid( ETrue, newRow); + DrawDeferred(); + } + } + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::ImagesDeleted +// Called when one or more images have been deleted +// --------------------------------------------------------- +// +void CCamBurstThumbnailGrid::ImagesDeleted() + { + // Check if scrollbar frame exists, and if it's currently visible, and + // we now have only enough elements for one screen, then hide the bar + if ( iScrollFrame && + iScrollFrame->ScrollBarVisibility( CEikScrollBar::EVertical ) == CEikScrollBarFrame::EOn ) + { + if ( iModel.NoOfValidCells() <= iGridSize ) + { + DeleteScrollBar(); + } + else // Check if need to adjust scrollbar proportions + { + // This will adjust the proportions + TRAPD( ignore, SetupScrollbarL() ); + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + } + } + + if ( iModel.NoOfValidCells() <= KBurstGridMaxVisibleThumbnails ) + { + UpdateLayout(); + // draw parent because size of the control might have been changed + Parent()->DrawDeferred(); + } + DrawDeferred(); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGrid::OfferKeyEventL +// Handles key events +// ----------------------------------------------------------------------------- +// +TKeyResponse CCamBurstThumbnailGrid::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) + { + TInt startTopIndex = iModel.TopLeftGridIndex(); + + if ( aType == EEventKey ) + { + TBool changed = EFalse; + switch ( aKeyEvent.iScanCode ) + { + case EStdKeyUpArrow: + { + if ( iModel.MoveHighlight( CCamBurstThumbnailGridModel::EMoveSelectUp ) ) + { + changed = ETrue; + } + break; + } + + case EStdKeyDownArrow: + { + if ( iModel.MoveHighlight( CCamBurstThumbnailGridModel::EMoveSelectDown ) ) + { + changed = ETrue; + } + + break; + } + + case EStdKeyLeftArrow: + { + CCamBurstThumbnailGridModel::TMoveSelect direction; + if ( !AknLayoutUtils::LayoutMirrored() ) + { + direction = CCamBurstThumbnailGridModel::EMoveSelectLeft; + } + else + { + direction = CCamBurstThumbnailGridModel::EMoveSelectRight; + } + + if ( iModel.MoveHighlight( direction ) ) + { + changed = ETrue; + } + break; + } + + case EStdKeyRightArrow: + { + CCamBurstThumbnailGridModel::TMoveSelect direction; + if ( !AknLayoutUtils::LayoutMirrored() ) + { + direction = CCamBurstThumbnailGridModel::EMoveSelectRight; + } + else + { + direction = CCamBurstThumbnailGridModel::EMoveSelectLeft; + } + + if ( iModel.MoveHighlight( direction ) ) + { + changed = ETrue; + } + break; + } + + default: + { + break; + } + + } // end of switch + + // Update scroll bar if visible screen proportions changed + if ( iScrollFrame ) + { + // Work out whether the 3x2 view has moved + TInt endTopIndex = iModel.TopLeftGridIndex(); + TInt indexDiff = endTopIndex - startTopIndex; + + if ( indexDiff != 0 ) + { + iScrollFrame->MoveVertThumbTo( endTopIndex / KGridWidth ); + } + } + + // If a change was made, update the display + if ( changed ) + { + DrawDeferred(); + } + } + return EKeyWasNotConsumed; + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGrid::SetupScrollbarL +// Checks if a scroll bar is needed, and if so, creates one. +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGrid::SetupScrollbarL() + { + PRINT(_L("Camera => CCamBurstThumbnailGrid::SetupScrollbarL()") ); + __ASSERT_DEBUG( iScrollFrame, CamPanic( ECamPanicNullPointer ) ); + + + // Work out the number of scrollable rows we need. Take into account + // the rounding errors with integer maths with a modulus check too. + TInt numOfRows = ( iModel.NoOfValidCells() / KGridWidth ) ; + if ( iModel.NoOfValidCells() % KGridWidth != 0 ) + { + numOfRows ++; + } + + TInt startRow = ( iModel.TopLeftGridIndex() / KGridWidth ); + if ( iModel.TopLeftGridIndex() % KGridWidth != 0 ) + { + startRow ++; + } + iScrollFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn ); + + + // Set up the model accordingly + ivModel.SetScrollSpan( numOfRows ); + ivModel.SetFocusPosition( startRow ); + ivModel.SetWindowSize( iModel.GridHeight() ); + iScrollFrame->CreateDoubleSpanScrollBarsL( ETrue, EFalse ); // was true, false + + TRect rect = iScrollLayout.Rect(); + iScrollFrame->Tile( &ivModel, rect ); + iScrollFrame->MoveVertThumbTo( startRow ); + + + PRINT(_L("Camera <= CCamBurstThumbnailGrid::SetupScrollbarL()") ); + } + + + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::DeleteScrollBar +// Hides and deletes the scrollbar frame +// --------------------------------------------------------- +// +void CCamBurstThumbnailGrid::DeleteScrollBar() + { + if ( iScrollFrame ) + { + // Hide the scrollbar + TRAPD( ignore, iScrollFrame->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EOff ) ); + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + } + + // Delete the frame + delete iScrollFrame; + iScrollFrame = NULL; + } + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::CreateScrollBarL +// Creates the scrollbar frame object +// --------------------------------------------------------- +// +void CCamBurstThumbnailGrid::CreateScrollBarL() + { + // Create scrollbar frame + iScrollFrame = new ( ELeave ) CEikScrollBarFrame( this, this, ETrue ); + } + + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::GridSize +// Returns the height of the thumbnail grid, in cells +// --------------------------------------------------------- +// +TInt CCamBurstThumbnailGrid::GridSize() const + { + return iGridSize; + } + +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::UpdateLayout() +// Updates layouts. Used to reload layouts when images are deleted. +// --------------------------------------------------------- +// +void CCamBurstThumbnailGrid::UpdateLayout() + { + TInt gridSize = iModel.NoOfValidCells(); + + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect ); + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, + statusPaneRect ); + + // layout area rectangle contains the area, where components need to be + // drawn to. the container size is the whole screen, but the layouts are + // for the client area. aRect is the container size that might include or + // might not include statuspane area. calculating area self will + // go around the problem + TRect layoutAreaRect; + layoutAreaRect = mainPaneRect; + layoutAreaRect.BoundingRect( statusPaneRect ); + + // CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + TAknLayoutRect burstPaneRect; + if ( CamUtility::IsNhdDevice() ) + { + // use layoutAreaRect for nhd (contains the statuspane) + burstPaneRect.LayoutRect( layoutAreaRect, AknLayoutScalable_Apps::main_cam4_burst_pane() ); + // SetRect( layoutAreaRect ); + } + else + { + // use mainpane for vga + burstPaneRect.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_cam4_burst_pane() ); + // SetRect( mainPaneRect ); + } + + + TRect rect; + if ( gridSize <= KBurstGridDefaultThumbnails) + { + AknLayoutUtils::LayoutControl( this, + burstPaneRect.Rect(), + AknLayoutScalable_Apps::grid_cam4_burst_pane(1) ); + } + else if ( gridSize <= KBurstGridMaxVisibleThumbnails ) + { + AknLayoutUtils::LayoutControl( this, + burstPaneRect.Rect(), + AknLayoutScalable_Apps::grid_cam4_burst_pane(3) ); + } + else + { + AknLayoutUtils::LayoutControl( this, + burstPaneRect.Rect(), + AknLayoutScalable_Apps::grid_cam4_burst_pane(5) ); + } + + + // set scrollbar layout + iScrollLayout.LayoutRect( burstPaneRect.Rect(), + AknLayoutScalable_Apps::scroll_pane_cp30(1) ); + + + ReadLayout(); + + // set the new thumbnail size for gridmodel (to be used with thumbnail scaling) + // use layout for the first cell (all thumbnails are same size) + iModel.SetThumbnailSize( iGridCellLayout[0].iThmbRect.Rect().Size() ); + + AknIconUtils::SetSize( iBitmapMark, iGridCellLayout[0].iMarkRect.Rect().Size() ); + AknIconUtils::SetSize( iBitmapMarkMask, iGridCellLayout[0].iMarkRect.Rect().Size() ); + } +// --------------------------------------------------------- +// CCamBurstThumbnailGrid::HitTestGridItems( TPoint aPosition ) +// returns the grid item index that the position corresponds +// if position does not match to any grid item return value is negative +// --------------------------------------------------------- +TInt CCamBurstThumbnailGrid::HitTestGridItems( const TPoint aPosition ) + { + + TInt retVal = -1; + + for ( TInt i = 0; i < KGridSize; i++ ) + { + if ( iGridCellLayout[i].iCellRect.Rect().Contains( aPosition ) ) + { + retVal = i; + break; + } + } // end for + + // check if the scrollbar position affects to the grid item index + if ( iScrollFrame ) + { + retVal = retVal + iScrollFrame->VerticalScrollBar()->ThumbPosition()*KGridWidth; + } + + return retVal < iModel.NoOfValidCells() ? retVal : -1; + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGrid::HighlightChanged +// Sets the grid to be redrawn +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGrid::HighlightChanged() + { + // does nothing at the moment + } + +// --------------------------------------------------------- +// TCamBurstGridCellLayout::ConstructFromResource +// Constructs the layout entries from the specified resource +// --------------------------------------------------------- +// +void TCamBurstGridCellLayout::ConstructFromResource( TResourceReader& aReader, TRect& aRect ) + { + iCellRect.LayoutRect( aRect, aReader ); + iHighRect.LayoutRect( aRect, aReader ); + iMarkRect.LayoutRect( aRect, aReader ); + iThmbRect.LayoutRect( aRect, aReader ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamBurstThumbnailGridModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamBurstThumbnailGridModel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1327 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class to model the contents of the burst post-capture view* +*/ + + + +// INCLUDE FILES +#include +#include +#include + +#include +#include +#include +#include + + +#include "CamBurstThumbnailGridModel.h" +#include "CamBurstThumbnailGrid.h" +#include "CamBurstCaptureArray.h" +#include "camlogging.h" +#include "CamPanic.h" + +// Uncommenting the define below will allow wrapping of the grid from the first +// element of the grid to the very last, and vice-versa. +#define ALLOW_GRID_WRAPPING + + +// ============================= LOCAL FUNCTIONS =============================== + + +// ============================ MEMBER FUNCTIONS =============================== + +CCamBurstThumbnailGridModel::CCamBurstThumbnailGridModel() + { + } + + +// ----------------------------------------------------------------------------- +// CCamBurstCaptureItem::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamBurstThumbnailGridModel* CCamBurstThumbnailGridModel::NewL() + { + CCamBurstThumbnailGridModel* self = new( ELeave ) CCamBurstThumbnailGridModel(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::ConstructL() + { + iThumbSize.iWidth = 0; + iThumbSize.iHeight = 0; + + iGridSizer = CCamThumbnailGridSizer::NewL( this, iThumbSize ); + iTopLeftIndex = 0; + } + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::GridItem +// Returns pointer to the requested item, or NULL if index is invalid +// ----------------------------------------------------------------------------- +// +CThumbnailGridItem* CCamBurstThumbnailGridModel::GridItem( TInt aIndex ) + { + if ( aIndex >= iValidThumbGrid.Count() ) + { + return NULL; + } + else + { + return iValidThumbGrid[ aIndex ]; + } + } + +// Note: Returns ONLY non-deleted cells +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::Snapshot +// Returns pointer to the requested item, or NULL if index is invalid +// ----------------------------------------------------------------------------- +// +const CFbsBitmap* CCamBurstThumbnailGridModel::Snapshot( TInt aIndex ) + { + if ( aIndex >= iValidThumbGrid.Count() ) + { + return NULL; + } + else + { + TInt ind = ConvertFromValidToGlobalIndex( aIndex ); + if ( ind != KErrNotFound ) + { + return iBurstArray->Snapshot( ind ); + } + else + { + return NULL; + } + } + } + +// Destructor +CCamBurstThumbnailGridModel::~CCamBurstThumbnailGridModel() + { + PRINT( _L("Camera => ~CCamBurstThumbnailGridModel") ); + + if ( iGridSizer ) + { + iGridSizer->Cancel(); + } + delete iGridSizer; + + // Delete the array and the objects pointed to + iAllThumbGrid.ResetAndDestroy(); + + // Note: As this points to the same thing as the array above, just + // delete the array, not the objects + iValidThumbGrid.Reset(); + + // Do NOT destroy the objects pointed to, just the list. + iThumbObserver.Reset(); + iHighlightObserver.Reset(); + iDeleteObserver.Reset(); + PRINT( _L("Camera <= ~CCamBurstThumbnailGridModel") ); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::AddCellL +// Adds the cell to the internal structures. Takes ownership of the cell. +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::AddCellL( CThumbnailGridItem* aCell ) + { + // Add to the master list of grid items + User::LeaveIfError( iAllThumbGrid.Append( aCell ) ); + + // Add to the list of VALID (non deleted) grid items + User::LeaveIfError( iValidThumbGrid.Append( aCell ) ); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::StartThumbnailL +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::StartThumbnailL( TInt aIndex ) + { + // Burst array may be released by the app when swicthing + // views so do a check that it is still valid + if ( iBurstArray ) + { + const CFbsBitmap* source = iBurstArray->Snapshot( aIndex ); + if ( source ) + { + iGridSizer->StartScaleL( *source, iThumbSize, aIndex ); + } + } + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::CancelThumbnails +// Cancels any outstanding thumbnail generation operation +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::CancelThumbnails() + { + if ( iGridSizer->IsActive() ) + { + iGridSizer->Cancel(); + } + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::ImageFilesDeletedL +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::ImageFilesDeleted() + { + + TBool highlightDeleted = EFalse; + + TInt highlightIndex = ConvertFromValidToGlobalIndex( iCurrHighlight ); + + for ( TInt i = 0; i < iBurstArray->Count(); i++ ) + { + if ( iBurstArray->IsDeleted( i ) ) + { + if ( highlightIndex == i ) + { + highlightDeleted = ETrue; + } + + TRAPD( error, DeleteItemL( i ) ); + + // DeleteItemL() leaves only when file can't be deleted and that should never + // happen here as the files are already deleted + __ASSERT_DEBUG( error == KErrNone, CamPanic( ECamPanicUi ) ); + error++; // remove compile warnings + } + } + + DoPostDeleteGridCheck( highlightDeleted ); + } + +// ----------------------------------------------------------------------------- +// CCamThumbnailGridSizer::SetThumbnailSize +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::SetThumbnailSize( const TSize aThumbSize ) + { + + if ( aThumbSize != iThumbSize ) + { + iThumbSize = aThumbSize; + iGridSizer->SetSize( iThumbSize ); + // delete all thumbs because size has changed and they need to be regenerated + TInt imagesRemaining = iBurstArray->ImagesRemaining(); + for ( TInt i = 0; i < imagesRemaining; i++ ) + { + // delete display thumbnail + delete iValidThumbGrid[i]->iDisplayThumb; + iValidThumbGrid[i]->iDisplayThumb = NULL; + } + + // recalculate needed thumbs + RecalculateThumbs(); + + } + } + + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::BitmapScaleCompleteL +// Callback called when a bitmap scaling operation has completed. +// We take ownership of the 'aBitmap' object +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::BitmapScaleCompleteL( TInt aErr, CFbsBitmap* aBitmap, TInt32 aInfo ) + { + if ( aErr == KErrNone ) + { + // Update internal structure + CThumbnailGridItem* item = iAllThumbGrid[aInfo]; + item->iDisplayThumb = aBitmap; + + // Inform observer(s) to ensure the screen is updated + NotifyModelObserver( EModelEventThumb ); + } + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::RecalculateThumbs +// Called to check which thumbnails need creating, and start the procedure +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::RecalculateThumbs() + { + // If in the grid below, items 3-8 were visible in the screen grid, + // items 0-2 and 9-11 would also have thumbnails generated to attempt + // to reduce visible artifacts from calculating on the fly. + // [ 0 ][ 1 ][ 2 ] <= Row above (not visible) + // [ 3 ][ 4 ][ 5 ] <= First visible row + // [ 6 ][ 7 ][ 8 ] <= Second visible row + // [ 9 ][ 10][ 11] <= Row below (not visible) + // + + // If we get to recalculate thumbnails, we need to cancel any outstanding + // rescale operation + CancelThumbnails(); + + // Work out the top left index. This is the top-left cell of the VIEWABLE + // grid, less one row (which serves as a thumbnail cache) + TInt topLeftIndex = iTopLeftIndex - KGridWidth; + if ( topLeftIndex < 0 ) + { + topLeftIndex = 0; + } + + // Work out the bottom right index. This is the bottom-right cell of the + // VIEWABLE grid, plus one row (which serves as a thumbnail cache) + TInt botRightIndex = iTopLeftIndex + ( KGridWidth * iGridHeight ) - 1 + KGridWidth; + if ( botRightIndex > iValidThumbGrid.Count() - 1 ) + { + botRightIndex = iValidThumbGrid.Count() - 1; + } + + // Delete the thumbnails for cells that are not immediately visible, and are + // not in the next or last row. + TInt i; + TInt imagesRemaining = iBurstArray->ImagesRemaining(); + for ( i = 0; i < imagesRemaining; i++ ) + { + if ( ( i < topLeftIndex || i > botRightIndex ) && + iValidThumbGrid[i]->iDisplayThumb ) + { + // delete display thumbnail + delete iValidThumbGrid[i]->iDisplayThumb; + iValidThumbGrid[i]->iDisplayThumb = NULL; + } + } + + // Queue up the thumbnails that need to be resized + TRAPD( ignore, QueueThumbnailsL() ); + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + } + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::QueueThumbnailsL +// Queues the thumbnails to be resized as needed +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::QueueThumbnailsL() + { + // [ 0 ][ 1 ][ 2 ] <= Row above (not visible) + // [ 3 ][ 4 ][ 5 ] <= First visible row + // [ 6 ][ 7 ][ 8 ] <= Second visible row + // [ 9 ][ 10][ 11] <= Row below (not visible) + // + TInt start = iTopLeftIndex; + TInt index = KErrNotFound; + TInt max = iTopLeftIndex + KGridSize; + if ( max > iValidThumbGrid.Count() ) + { + max = iValidThumbGrid.Count(); + } + + // Top priority is the set of thumbs visible AT THIS MOMENT + TInt i; + for ( i = start; i < max ; i++ ) + { + if ( !iValidThumbGrid[i]->iDisplayThumb ) + { + // If we get here, then 'i' is the index to the VALID set of items. + // Need to convert this to the index in the GLOBAL set of items + index = ConvertFromValidToGlobalIndex( i ); + StartThumbnailL( index ); + } + } + + // SECOND top priority is the set of thumbs BELOW the visible set + if ( iValidThumbGrid.Count() >= iTopLeftIndex + KGridSize ) + { + start = iTopLeftIndex+KGridSize; + max = i + KGridWidth; + if ( max > iValidThumbGrid.Count() ) + { + max = iValidThumbGrid.Count(); + } + + // If we have got here, we can cache the row *below* the 2nd visible row + for ( i = start; i < max; i++ ) + { + if ( !iValidThumbGrid[i]->iDisplayThumb ) + { + // If we get here, then 'i' is the index to the VALID set of items. + // Need to convert this to the index in the GLOBAL set of items + index = ConvertFromValidToGlobalIndex( i ); + StartThumbnailL( index ); + } + } + } + + // THIRD priority is the set of thumbs ABOVE the visible set + if ( iTopLeftIndex >= KGridWidth ) // ONLY if there IS a previous row + { + start = iTopLeftIndex - KGridWidth; + max = iTopLeftIndex; + // If we have got here, we can cache the row *above* this one. + for ( i = start; i < max; i++ ) + { + if ( !iValidThumbGrid[i]->iDisplayThumb ) + { + // If we get here, then 'i' is the index to the VALID set of items. + // Need to convert this to the index in the GLOBAL set of items + index = ConvertFromValidToGlobalIndex( i ); + StartThumbnailL( index ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::ConvertFromValidToGlobalIndex +// Converts from a valid-index (non-deleted only) to global (del & non-del) index +// ----------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailGridModel::ConvertFromValidToGlobalIndex( TInt aValidIndex ) + { + if ( aValidIndex < iValidThumbGrid.Count() ) + { + CThumbnailGridItem* item = iValidThumbGrid[aValidIndex]; + return iAllThumbGrid.Find( item ); + } + else + { + return KErrNotFound; + } + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::SetBurstArrayL +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::SetBurstArrayL( CCamBurstCaptureArray* aArray ) + { + PRINT( _L("Camera => CCamBurstThumbnailGridModel::SetBurstArrayL") ); + + // If we've not been initialised yet, and have no data, then use the array + // just passed in. + if ( iAllThumbGrid.Count() == 0 ) + { + iBurstArray = aArray; + + // Build up model to match burst array + if ( iBurstArray ) + { + TInt i; + TInt count = iBurstArray->Count(); + PRINT1( _L("Camera <> got %d thumbnails"), count ); + + // Create a set of items to match the number in the burst array + for ( i = 0; i < count; i++ ) + { + CThumbnailGridItem* item = new ( ELeave ) CThumbnailGridItem(); + + CleanupStack::PushL( item ); + item->iDisplayThumb = NULL; + item->iMarked = EFalse; + AddCellL( item ); + CleanupStack::Pop( item ); + + if ( !iBurstArray->Snapshot( i ) ) + { + DeleteItemL( i ); + } + } + + // Setup the base grid height based on the number of items + if ( NoOfValidCells() <= KSmallGridCellCount ) + { + iGridHeight = KSmallGridHeight; + } + else + { + iGridHeight = KLargeGridHeight; + } + + // Start the generation of thumbnails + RecalculateThumbs(); + } + } + PRINT( _L("Camera <= CCamBurstThumbnailGridModel::SetBurstArrayL") ); + } + + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::AddModelObserverL +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::AddModelObserverL( MThumbModelObserver* aObserver, TInt aMask ) + { + if ( aMask & EModelEventHighlight ) + { + User::LeaveIfError( iHighlightObserver.Append( aObserver ) ); + } + + if ( aMask & EModelEventDeleted ) + { + User::LeaveIfError( iDeleteObserver.Append( aObserver ) ); + } + + if ( aMask & EModelEventThumb ) + { + User::LeaveIfError( iThumbObserver.Append( aObserver ) ); + } + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::RemoveModelObserver +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::RemoveModelObserver( MThumbModelObserver* aObserver, TInt aMask ) + { + TInt pos; + if ( aMask & EModelEventHighlight ) + { + pos = iHighlightObserver.Find( aObserver ); + if ( pos != KErrNotFound ) + { + iHighlightObserver.Remove( pos ); + } + } + if ( aMask & EModelEventDeleted ) + { + pos = iDeleteObserver.Find( aObserver ); + if ( pos != KErrNotFound ) + { + iDeleteObserver.Remove( pos ); + } + } + if ( aMask & EModelEventThumb ) + { + pos = iThumbObserver.Find( aObserver ); + if ( pos != KErrNotFound ) + { + iThumbObserver.Remove( pos ); + } + } + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::NotifyModelObserver +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::NotifyModelObserver( TModelEvent aEvent, TInt /*aParam*/ ) + { + TInt i; + TInt count; + + switch ( aEvent ) + { + case EModelEventHighlight: + { + count = iHighlightObserver.Count(); + for ( i = 0; i < count; i++ ) + { + iHighlightObserver[i]->HighlightChanged(); + } + break; + } + + case EModelEventDeleted: + { + count = iDeleteObserver.Count(); + for ( i = 0; i < count; i++ ) + { + iDeleteObserver[i]->ImagesDeleted(); + } + break; + } + + case EModelEventThumb: + { + count = iThumbObserver.Count(); + for ( i = 0; i < count; i++ ) + { + iThumbObserver[i]->ThumbnailGenerated(); + } + break; + } + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::NoOfValidCells +// ----------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailGridModel::NoOfValidCells() + { + //return iBurstArray->ImagesRemaining(); + return iValidThumbGrid.Count(); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::MoveHighlight +// Tries to move the selection. If no change is made, returns EFalse. +// If change is made, returns ETrue (to inform of a redraw) +// ----------------------------------------------------------------------------- +// +TBool CCamBurstThumbnailGridModel::MoveHighlight( TMoveSelect aDir ) + { + TInt oldTopLeft = iTopLeftIndex; + TInt oldHighlight = iCurrHighlight; + + // cellX and cellY store the cell position in the X and Y axis as seen on + // the screen + TInt cellX = ( iCurrHighlight - iTopLeftIndex ) % KGridWidth; // 0 - 2 + TInt cellY = ( iCurrHighlight - iTopLeftIndex ) / KGridWidth; // 0 - 1 + + switch ( aDir ) + { + case EMoveSelectLeft: + { + if ( iCurrHighlight > 0 ) + { + iCurrHighlight --; + + if ( cellX == 0 && cellY == 0 ) // At top left entry + { + iTopLeftIndex -= KGridWidth; + } + } +#ifdef ALLOW_GRID_WRAPPING + else + { + TInt cells = iValidThumbGrid.Count(); + TInt bottomX = ( cells ) % KGridWidth; + TInt bottomY = ( cells ) / KGridWidth; + // If over the allowed number of rows, and bottom row is full + if ( bottomY >= iGridHeight && bottomX == 0 ) + { + iTopLeftIndex = ( bottomY - iGridHeight ) * KGridWidth; // + } + else if ( bottomY >= ( iGridHeight - 1 ) ) // Over 1 row, + { + iTopLeftIndex = ( bottomY - ( iGridHeight - 1 ) ) * KGridWidth; + } + else // Only one (incomplete) row + { + iTopLeftIndex = ( bottomY ) * KGridWidth; + } + + iCurrHighlight = cells - 1; // Last entry + } +#endif // ALLOW_GRID_WRAPPING + break; + } + + case EMoveSelectRight: + { + if ( iCurrHighlight < ( iBurstArray->ImagesRemaining() - 1 ) ) + { + iCurrHighlight ++; + + if ( cellX == ( KGridWidth - 1 ) && cellY == ( iGridHeight - 1 ) ) + { + iTopLeftIndex += KGridWidth; + } + } +#ifdef ALLOW_GRID_WRAPPING + else + { + iCurrHighlight = 0; // Top left entry + iTopLeftIndex = 0; + } +#endif // ALLOW_GRID_WRAPPING + + break; + } + + case EMoveSelectUp: + { + if ( iCurrHighlight >= KGridWidth ) + { + iCurrHighlight -= KGridWidth; + + // if in TOP row, and we CAN move up, shift viewpoint up + if ( cellY == 0 ) + { + iTopLeftIndex -= KGridWidth; + } + } +#ifdef ALLOW_GRID_WRAPPING + else // Then we need to wrap to the bottom of the previous grid + { + TInt cells = iValidThumbGrid.Count(); + + // startX holds the "x" value of initial selection + TInt startX = ( iCurrHighlight ) % KGridWidth; + TInt bottomY = ( cells ) / KGridWidth; + + // If not in left-most grid, we'll be moving left and to bottom + if ( startX > 0 ) + { + startX --; + } + else // Else in left most grid, so "jump" to right most. + { + if ( cells < KGridWidth ) + { + startX = cells - 1; + } + else + { + startX = KGridWidth - 1; + } + } + + // If all rows are full (so modulus is 0) bottomY division will + // be one too great, so compensate + if ( cells % KGridWidth == 0 ) + { + bottomY -- ; + } + iCurrHighlight = ( bottomY * KGridWidth ) + startX; + + // Check this item is filled in, if not, move "up" a row + if ( iCurrHighlight >= cells ) + { + // If more than one rows worth of items, can move to second to last row + if ( cells > KGridWidth ) + { + bottomY --; + } + else // If only one row (or less) + { + startX = cells % KGridWidth; + } + + // Will need to recalculate curr highlight following changes + iCurrHighlight = ( bottomY * KGridWidth ) + startX; + } + UpdateViewableGrid( EFalse ); + } +#endif // ALLOW_GRID_WRAPPING + break; + } + + case EMoveSelectDown: + { + if ( ( iCurrHighlight + KGridWidth ) <= ( iBurstArray->ImagesRemaining() - 1 ) ) + { + iCurrHighlight += KGridWidth; + + if ( cellY == ( iGridHeight-1 ) ) // if in BOTTOM row, and we CAN move down, shift viewpoint down + { + iTopLeftIndex += KGridWidth; + } + } +#ifdef ALLOW_GRID_WRAPPING + else // Then we need to wrap to the top of the next grid + { + TInt startX = ( iCurrHighlight ) % KGridWidth; + TInt cells = iValidThumbGrid.Count(); + TInt rightMostGrid; + + if ( cells < KGridWidth ) + { + rightMostGrid = cells; + } + else + { + rightMostGrid = KGridWidth; + } + + // If not in left-most grid, we'll be moving left and to bottom + if ( startX < ( rightMostGrid - 1 ) ) + { + // Check we don't have less-than-a-row of cells left + if ( startX < ( cells - 1 ) ) + { + startX ++; + } + else // If that is the case, move to the last one. + { + startX = cells - 1; + } + + } + else // Else in left most grid, so "jump" to right most. + { + startX = 0; + } + + // Calculate new highlight poisition. + iCurrHighlight = startX; + + UpdateViewableGrid( ETrue ); + } +#endif // ALLOW_GRID_WRAPPING + break; + } + } + + // Work out if the viewed items has changed. If so, check whether we need + // to calculate any new thumbnails for display. + if ( oldTopLeft != iTopLeftIndex ) + { + RecalculateThumbs(); + } + + // Notify observers of the change + NotifyModelObserver( EModelEventHighlight ); + + if ( iCurrHighlight != oldHighlight ) + { + return ETrue; // Highlight HAS changed + } + else + { + return EFalse; // No change + } + } + +// Sets the higlighted burst item +// informs model observer about the change +// returns ETrue if highlight changed +// returns EFalse if highlight was not changed +TBool CCamBurstThumbnailGridModel::SetHighlight( TInt aIndex ) + { + PRINT1( _L("Camera => CCamBurstThumbnailGridModel::SetHighlight( %d )"), aIndex ); + + TInt oldHighlight = iCurrHighlight; + iCurrHighlight = aIndex; + + PRINT( _L("Camera <= CCamBurstThumbnailGridModel::SetHighlight()") ); + + if ( iCurrHighlight != oldHighlight ) + { + return ETrue; // Highlight HAS changed + } + else + { + return EFalse; // No change + } + + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::UpdateViewableGrid +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::UpdateViewableGrid( TBool aMovingUp ) + { + if ( NoOfValidCells() <= KBurstGridMaxVisibleThumbnails ) + { + // no need to update if there are less cells than fit to screen at once + return; + } + + TInt posY = iCurrHighlight / KGridWidth; + + // If moving up, when adjust the viewable area, the highlighted grid is + // in the top-most row. + if ( aMovingUp ) + { + if ( posY >= ( iGridHeight - 1 ) ) + { + iTopLeftIndex = ( posY - ( iGridHeight - 1 ) ) * KGridWidth; + } + else // Only one (incomplete) row + { + iTopLeftIndex = ( posY ) * KGridWidth; + } + } + // If moving down, when adjust the viewable area, the highlighted grid item + // is in the bottom-most row + else + { + if ( posY >= ( iGridHeight - 1 ) ) + { + iTopLeftIndex = ( posY - ( iGridHeight - 1 ) ) * KGridWidth; + } + else // Only one (incomplete) row + { + iTopLeftIndex = ( posY ) * KGridWidth; + } + } + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::HighlightedGridIndex +// ----------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailGridModel::HighlightedGridIndex() + { + return iCurrHighlight; + } + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::TopLeftGridIndex +// ----------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailGridModel::TopLeftGridIndex() + { + return iTopLeftIndex; + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::HighlightedBurstIndex +// As used for getting the index in the CONTROLLER's array, which contains +// both non-deleted AND DELETED items in the array. +// ----------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailGridModel::HighlightedBurstIndex() + { + TInt index = -1; + if ( iCurrHighlight != KErrNotFound ) + { + // The "Current Highlight" is the index to the VALID array (non-deleted only) + // Need to find the equivalent index in the GLOBAL array (del and non-del) + index = ConvertFromValidToGlobalIndex( iCurrHighlight ); + } + + return index; + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::HighlightedImageName +// ----------------------------------------------------------------------------- +// +TPtrC CCamBurstThumbnailGridModel::HighlightedImageName() + { + if ( iCurrHighlight != KErrNotFound ) + { + // The "Current Highlight" is the index to the VALID array (non-deleted only) + // Need to find the equivalent index in the GLOBAL array (del and non-del) + TInt index = ConvertFromValidToGlobalIndex( iCurrHighlight ); + if ( index != KErrNotFound ) + { + return iBurstArray->ImageName( index ); + } + } + return TPtrC(); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::ImageName +// Returns the image name (no path or extension) of an item. +// ----------------------------------------------------------------------------- +// +TPtrC CCamBurstThumbnailGridModel::ImageName( TInt aIndex ) + { + // The "Current Highlight" is the index to the VALID array (non-deleted only) + // Need to find the equivalent index in the GLOBAL array (del and non-del) + TInt index = ConvertFromValidToGlobalIndex( aIndex ); + if ( index != KErrNotFound ) + { + return iBurstArray->ImageName( index ); + } + return TPtrC(); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::ImageFullName +// Returns the image name (with path and extension) of an item. +// ----------------------------------------------------------------------------- +// +TPtrC CCamBurstThumbnailGridModel::ImageFileName( TInt aIndex ) const + { + return iBurstArray->FileName( aIndex ); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::RefreshL +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::RefreshL() + { + // If this function is called, it is to check whether the currently + // highlighted image has not been deleted yet. This may occur if it has + // been viewed and deleted in the post-capture view. + + // Get the global index for the highlighted item + TInt index = ConvertFromValidToGlobalIndex( iCurrHighlight ); + + // Check it's deleted state + TBool deleted = iBurstArray->IsDeleted( index ); + + // If the item has been deleted from the BurstArray, we need to update + // our state, so run the delete highlight code for the GridModel + if ( deleted ) + { + // Update internal state accordingly + DeleteHighlightL(); + } + } + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::SetCurrentMark +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::SetCurrentMark( TBool aSet ) + { + if ( aSet ) // Setting the mark ON + { + iValidThumbGrid[iCurrHighlight]->iMarked = ETrue; + iImagesMarked++; + } + else // Setting the mark OFF + { + iValidThumbGrid[iCurrHighlight]->iMarked = EFalse; + iImagesMarked--; + } + NotifyModelObserver( EModelEventThumb ); // Force thumbnail redraw + } + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::MarkAll +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::MarkAll( TBool aMark ) + { + TInt count = iValidThumbGrid.Count(); + TInt i; + + // Go through each valid (non-deleted) item + for ( i = 0; i < count; i++ ) + { + // If it's not already in the required state (marked or unmarked) + if ( !( iValidThumbGrid[i]->iMarked == aMark ) ) + { + // ...change the state of the item + iValidThumbGrid[i]->iMarked = aMark; + + // ...and update the internal count + if ( aMark ) + { + iImagesMarked++; + } + else + { + iImagesMarked--; + } + } + } + NotifyModelObserver( EModelEventThumb ); // Force thumbnail redraw + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::NoOfMarkedImages +// ----------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailGridModel::NoOfMarkedImages() const + { + return iImagesMarked; + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::NoOfImages +// ----------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailGridModel::NoOfImages() const + { + return iAllThumbGrid.Count(); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::IsMarkedL +// ----------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailGridModel::IsMarkedL( TInt aIndex ) + { + if ( aIndex < 0 || aIndex >= iValidThumbGrid.Count() ) + { + User::Leave( KErrArgument ); + } + return iValidThumbGrid[aIndex]->iMarked; + } + + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::DeleteMarkedL +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::DeleteMarkedL() + { + // Keep track of if we've just deleted the highlighted item. + // If so, we'll need to inform the view, later. + TBool highlightDeleted = iValidThumbGrid[iCurrHighlight]->iMarked ; + + TInt i; + TInt count = iAllThumbGrid.Count(); + TInt error = KErrNone; + for ( i = 0; i < count; i++ ) + { + if ( iAllThumbGrid[i]->iMarked ) + { + TRAP( error, DeleteItemL( i ) ); + if ( error ) + { + break; + } + } + } + + // Do the recalculation required to adjust the positioning of items and + // the hightlight + DoPostDeleteGridCheck( highlightDeleted ); + + if ( error && error != KErrInUse ) + { + User::Leave( error ); + } + } + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::DeleteHighlightL +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::DeleteHighlightL() + { + // Gets the global index of the currently highlighted item + TInt globalIndex = ConvertFromValidToGlobalIndex( iCurrHighlight ); + + // Delete that item + + TRAPD( error, DeleteItemL( globalIndex ) ); + + + // Check the internal state for any adjustments of visible items, new + // highlight position etc. + DoPostDeleteGridCheck( ETrue ); + + if ( error && error != KErrInUse ) + { + User::Leave( error ); + } + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::DeleteItemL +// Internal function for deleting a particular item +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::DeleteItemL( TInt aGlobalIndex ) + { + PRINT( _L("Camera => CCamBurstThumbnailGridModel::DeleteItemL") ); + // If this item was marked, clear the mark and adjust internal state + TInt err = KErrNone; + if ( !iBurstArray->IsDeleted( aGlobalIndex ) ) + { + PRINT( _L("Camera <> iBurstArray->IsDeleted" )) + err = iBurstArray->SetDeleted( aGlobalIndex, ETrue ); + PRINT1( _L("Camera <> CCamBurstThumbnailGridModel::DeleteItemL: First SetDelete returned %d"), err ); + } + if ( err ) + { + err = iBurstArray->SetDeleted( aGlobalIndex, ETrue ); + PRINT1( _L("Camera <> CCamBurstThumbnailGridModel::DeleteItemL: Second SetDelete returned %d"), err ); + if ( err ) + { + if ( err == KErrInUse ) + { + // set error note text + const TDesC& fullPath = iBurstArray->FileName( aGlobalIndex ); + TInt pos = fullPath.LocateReverse( '\\' ); + TPtrC fileName = fullPath.Right( fullPath.Length() - pos - 1 ); + HBufC* text = StringLoader::LoadLC( R_QTN_FLDR_CANT_DELETE_FILE_OPEN, fileName ); + // show error note + CAknInformationNote* dlg = new (ELeave) CAknInformationNote(ETrue); + dlg->ExecuteLD(text->Des()); + CleanupStack::PopAndDestroy( text ); + } + User::Leave( err ); + //return; + } + } + if ( iAllThumbGrid[aGlobalIndex]->iMarked ) + { + iAllThumbGrid[aGlobalIndex]->iMarked = EFalse; + iImagesMarked--; // No of marked items + } + + // Delete the display thumbnail + delete iAllThumbGrid[aGlobalIndex]->iDisplayThumb; + iAllThumbGrid[aGlobalIndex]->iDisplayThumb = NULL; + + // Remove from VALID thumb list. + CThumbnailGridItem* item = iAllThumbGrid[aGlobalIndex]; + TInt index = iValidThumbGrid.Find( item ); + + if ( index != KErrNotFound ) + { + iValidThumbGrid.Remove( index ); + } + PRINT( _L("Camera <= CCamBurstThumbnailGridModel::DeleteItem") ); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::DoPostDeleteGridCheck +// Internal function called after an item has been deleted, to ensure the +// correct items are visible, the highlight is valid etc. +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::DoPostDeleteGridCheck( TBool /*aHighlightDeleted*/ ) + { + // Check the "highlighted" item. If it's now out of range, move the + // index to be the last valid entry. + if ( iCurrHighlight >= iValidThumbGrid.Count() ) + { + iCurrHighlight = iValidThumbGrid.Count() - 1; + + // Required to update the title pane with a new filename + NotifyModelObserver( EModelEventHighlight ); + } + + // Else the highlight after a delete is still within range, so + // just inform the observers, so they can update the title pane with the + // correct filename + else + { + NotifyModelObserver( EModelEventHighlight ); + } + + + TInt imagesRemaining = iBurstArray->ImagesRemaining(); + // Check whether the highlighted item is now visible... it may not be. + if ( iTopLeftIndex >= imagesRemaining || + imagesRemaining <= KGridWidth * iGridHeight ) + { + // If this has happened it's because the highlighted cell was one of + // a large number of cells that has been deleted. The "top left" + // visible cell therefore needs to be updated to be the row above the + + // If over a screens worth of items remaining, move "top left" to show + // the bottom two rows + if ( imagesRemaining > ( KGridWidth * iGridHeight ) ) + { + // = [ Total number of rows available ] - [ two rows ] * [Width] + iTopLeftIndex = ( ( ( iCurrHighlight + 1 ) / KGridWidth ) - iGridHeight ) * KGridWidth; + } + else // Less than a screen's worth of items left, so set the first row as top left + { + iTopLeftIndex = 0; + } + } + + // Notify observers of a deletion. + NotifyModelObserver( EModelEventDeleted ); + + // Check the thumbnails to see if any need remaking + RecalculateThumbs(); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::ScrollGrid( TBool aScrollDown ) +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailGridModel::ScrollGrid( TBool aScrollDown, TInt aNewScrollPos ) + { + + // scrollPosition tells where the scroll is (new starting row?) + + // calculate the new iTopLeftIndex + + iTopLeftIndex = aNewScrollPos * KGridWidth; + + PRINT1( _L("Camera <> CCamBurstThumbnailGridModel::ScrollGrid - new postition %d"), iTopLeftIndex ); + + + } + + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailGridModel::GridHeight +// Returns the height of the visible grid, typically 2 or 3 cells high. +// ----------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailGridModel::GridHeight() + { + return iGridHeight; + } +// ----------------------------------------------------------------------------- +// MThumbModelObserver::HighlightChanged +// Default implementation of the function +// ----------------------------------------------------------------------------- +// +void MThumbModelObserver::HighlightChanged() + { + // intentionally doing nothing + } + +// ----------------------------------------------------------------------------- +// MThumbModelObserver::ImagesDeleted +// Default implementation of the function +// ----------------------------------------------------------------------------- +// +void MThumbModelObserver::ImagesDeleted() + { + // intentionally doing nothing + } + +// ----------------------------------------------------------------------------- +// MThumbModelObserver::ThumbnailGenerated +// Default implementation of the function; does nothing. +// ----------------------------------------------------------------------------- +// +void MThumbModelObserver::ThumbnailGenerated() + { + // intentionally doing nothing + } + +// ----------------------------------------------------------------------------- +// CThumbnailGridItem::CThumbnailGridItem +// ----------------------------------------------------------------------------- +// +CThumbnailGridItem::CThumbnailGridItem() + { + // intentionally doing nothing + } + +// ----------------------------------------------------------------------------- +// CThumbnailGridItem::~CThumbnailGridItem +// ----------------------------------------------------------------------------- +// +CThumbnailGridItem::~CThumbnailGridItem() + { + delete iDisplayThumb; + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamBurstThumbnailGridSizer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamBurstThumbnailGridSizer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,332 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class used to for resizing burst mode thumbnails* +*/ + + + +// INCLUDE FILES +#include +#include + +#include "CamBurstThumbnailGridSizer.h" +#include "camlogging.h" + + + + + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Symbian 2 phase constructor <> +// ----------------------------------------------------------------------------- +// +CScaleTask* +CScaleTask::NewL( const CFbsBitmap& aBitmap, + const TSize& aSize, + TInt32 aInfo ) + { + CScaleTask* self = new (ELeave) CScaleTask( aSize, aInfo ); + CleanupStack::PushL( self ); + self->ConstructL( aBitmap ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CScaleTask destructor <> +// ----------------------------------------------------------------------------- +// +CScaleTask::~CScaleTask() + { + delete iSrc; + iSrc = NULL; + } + +// ----------------------------------------------------------------------------- +// CScaleTask constructor <> +// ----------------------------------------------------------------------------- +// +CScaleTask::CScaleTask( const TSize& aSize, + TInt32 aInfo ) + : iSize ( aSize ), + iInfo ( aInfo ) + { + } + +// ----------------------------------------------------------------------------- +// CScaleTask::ConstructL +// ----------------------------------------------------------------------------- +// +void +CScaleTask::ConstructL( const CFbsBitmap& aBitmap ) + { + iSrc = new (ELeave) CFbsBitmap; + User::LeaveIfError( iSrc->Duplicate( aBitmap.Handle() ) ); + } + + + +// ----------------------------------------------------------------------------- +// CCamThumbnailGridSizer::CCamThumbnailGridSizer +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamThumbnailGridSizer::CCamThumbnailGridSizer( MBitmapScaler* aObserver, TSize& aSize ) + : CActive( EPriorityStandard ), + iThumbSize( aSize ) + { + iObserver = aObserver; + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// CCamThumbnailGridSizer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamThumbnailGridSizer::ConstructL() + { + iScaler = CBitmapScaler::NewL(); + } + +// ----------------------------------------------------------------------------- +// CCamThumbnailGridSizer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamThumbnailGridSizer* CCamThumbnailGridSizer::NewL( MBitmapScaler* aObserver, TSize& aSize ) + { + CCamThumbnailGridSizer* self = new( ELeave ) CCamThumbnailGridSizer( aObserver, aSize ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CCamThumbnailGridSizer::~CCamThumbnailGridSizer() + { + PRINT( _L("Camera => ~CCamThumbnailGridSizer") ); + Cancel(); + delete iScaler; + + // Delete any intermediate temporary bitmap + delete iTmpBitmap; + + // Cancel all pending scaling operations + iScaleTaskArray.ResetAndDestroy(); + PRINT( _L("Camera <= ~CCamThumbnailGridSizer") ); + } + +// ----------------------------------------------------------------------------- +// CCamThumbnailGridSizer::SetSize +// ----------------------------------------------------------------------------- +// +void CCamThumbnailGridSizer::SetSize( const TSize aThumbSize ) + { + PRINT2( _L("Camera == CCamThumbnailGridSizer::SetSize width = %d, height = %d"), aThumbSize.iWidth, aThumbSize.iHeight ); + iThumbSize.iWidth = aThumbSize.iWidth; + iThumbSize.iHeight = aThumbSize.iHeight; + } + +// ----------------------------------------------------------------------------- +// CCamThumbnailGridSizer::StartScaleL +// ----------------------------------------------------------------------------- +// +void CCamThumbnailGridSizer::StartScaleL( const CFbsBitmap& aSrc ) + { + PRINT( _L("Camera == CCamThumbnailGridSizer::StartScaleL") ); + // Forward request on with default destination size + StartScaleL( aSrc, iThumbSize, 0 ); + } + + +// ----------------------------------------------------------------------------- +// CCamThumbnailGridSizer::StartScaleL +// Allows specifying of specific size to go to where required. +// ----------------------------------------------------------------------------- +// +void CCamThumbnailGridSizer::StartScaleL( const CFbsBitmap& aSrc, TSize& aSize, TInt32 aInfo ) + { + PRINT3(_L("Camera => CCamThumbnailGridSizer::StartScaleL size %d x %d info 0x%x"), aSize.iWidth, aSize.iHeight, aInfo ); + + // Add it to the queue of things to scale + CScaleTask* task = CScaleTask::NewL( aSrc, aSize, aInfo ); + CleanupStack::PushL( task ); + User::LeaveIfError( iScaleTaskArray.Append( task ) ); // takes ownership of "task" + CleanupStack::Pop( task ); + + StartScaleL( task ); + PRINT ( _L("Camera <= CCamThumbnailGridSizer::StartScaleL") ); + } + +// ----------------------------------------------------------------------------- +// CCamThumbnailGridSizer::StartScaleL +// Allows specifying of specific sizing task to start +// ----------------------------------------------------------------------------- +// +void CCamThumbnailGridSizer::StartScaleL( CScaleTask* aTask ) + { + PRINT( _L("Camera => CCamThumbnailGridSizer::StartScaleL task") ); + // If scaling not currently underway, start it. + // If scaler is busy, it will be started when current operation completes. + if ( !IsActive() ) + { + // Check that we don't have any temporary images floating around + if ( iTmpBitmap ) + { + delete iTmpBitmap; + iTmpBitmap = NULL; + } + + TSize trgSize( aTask->Size() ); + const TSize& bmpSize( aTask->Bitmap()->SizeInPixels() ); + TRect srcRect( bmpSize ); + + TReal bmpRatio( TReal( bmpSize.iWidth ) / TReal( bmpSize.iHeight ) ); + TReal trgRatio( TReal( trgSize.iWidth ) / TReal( trgSize.iHeight ) ); + + PRINT2( _L("Camera <> CCamThumbnailGridSizer - source size(%d,%d)"), + bmpSize.iWidth, bmpSize.iHeight ); + + PRINT2( _L("Camera <> CCamThumbnailGridSizer - target size(%d,%d)"), + trgSize.iWidth, trgSize.iHeight ); + + if( bmpRatio > trgRatio ) + { + // Thumbnail aspect ratio is wider than the target size. + // Scale initially to a size wider than target and then crop. + trgSize.iWidth = Max( trgSize.iHeight * bmpRatio, 1 ); + } + if( bmpRatio < trgRatio ) + { + // Thumbnail aspect ratio is wider than the target size. + // Scale initially to a size higher than target and then crop. + trgSize.iHeight = Max( trgSize.iWidth * bmpRatio, 1 ); + } + + PRINT2( _L("Camera <> CCamThumbnailGridSizer - intermediate size(%d,%d)"), + trgSize.iWidth, trgSize.iHeight ); + + + // Create a temporary bitmap + iTmpBitmap = new ( ELeave ) CFbsBitmap(); + iTmpBitmap->Create( trgSize, aTask->Bitmap()->DisplayMode() ); + + + // Start the scaling operation + iScaler->Scale( &iStatus, + const_cast(*aTask->Bitmap()), + *iTmpBitmap, + ETrue ); + SetActive(); + } + PRINT( _L("Camera <= CCamThumbnailGridSizer::StartScaleL task") ); + } + +// ----------------------------------------------------------------------------- +// CCamThumbnailGridSizer::DoCancel +// ----------------------------------------------------------------------------- +// +void CCamThumbnailGridSizer::DoCancel() + { + PRINT( _L("Camera => CCamThumbnailGridSizer::DoCancel") ); + iScaler->Cancel(); + + // Delete any intermediate temporary bitmap + if ( iTmpBitmap ) + { + delete iTmpBitmap; + iTmpBitmap = NULL; + } + + // Cancel all pending scaling operations + iScaleTaskArray.ResetAndDestroy(); + PRINT( _L("Camera <= CCamThumbnailGridSizer::DoCancel") ); + } + +// ----------------------------------------------------------------------------- +// CCamThumbnailGridSizer::RunL +// ----------------------------------------------------------------------------- +// +void CCamThumbnailGridSizer::RunL() + { + PRINT2( _L("Camera => CCamThumbnailGridSizer::RunL .. observer 0x%x err %d"), iObserver, iStatus.Int() ); + // If there is an observer, notify them of the scaling completion + if ( iObserver ) + { + PRINT1( _L("Camera <> CCamThumbnailGridSizer::RunL .. scale array count %d"), iScaleTaskArray.Count() ); + // Note; passing iTmpBitmap in this call is passing ownership of the + // bitmap to the observer. This also places the restriction that there + // can only be one observer to an implementation of the GridSizer, which + // is fine for our requirements + iObserver->BitmapScaleCompleteL( iStatus.Int(), iTmpBitmap, iScaleTaskArray[0]->Info() ); + iTmpBitmap = NULL; + } + + CScaleTask* task = NULL; + if ( iScaleTaskArray.Count() > 0 ) + { + // Remove from the array and delete this (completed) task + task = iScaleTaskArray[0]; + iScaleTaskArray.Remove(0); + delete task; + task = NULL; + } + + // If completed successfully... + // ... and there are more tasks on the queue... + // ... and the task is valid, then do next task + if ( iStatus.Int() == KErrNone && + iScaleTaskArray.Count() > 0 ) + { + task = iScaleTaskArray[0]; + if ( task ) + { + StartScaleL( task ); + } + } + PRINT ( _L("Camera <= CCamThumbnailGridSizer::RunL") ); + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamBurstThumbnailView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamBurstThumbnailView.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1160 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View class to display a thumbnail grid after burst capture* +*/ + + +// INCLUDE FILES + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // AknLayoutScalable_Apps +//#include +#include // CAknInformationNote +#include // CAknToolbar +#include +#include // EikSoftkeyPostingTransparency + +#include "CamAppUi.h" +#include "CamUtility.h" +//#include "camproductvariant.h" +#include "CamBurstThumbnailView.h" +#include "CamAppUiBase.h" +#include "CamBurstThumbnailContainer.h" +#include "Cam.hrh" +#include "CamBurstThumbnailGridModel.h" +#include "CamBurstThumbnailGrid.h" +#include "CamBurstCaptureArray.h" +#include "camoneclickuploadutility.h" +#include "CameraUiConfigManager.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamBurstThumbnailViewTraces.h" +#endif + + + +//CONSTANTS +_LIT( KCamImageMimeType, "image/jpeg" ); + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamBurstThumbnailView* CCamBurstThumbnailView::NewLC( CCamAppController& aController ) + { + CCamBurstThumbnailView* self = + new( ELeave ) CCamBurstThumbnailView( aController ); + + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView destructor +// +// --------------------------------------------------------------------------- +// +CCamBurstThumbnailView::~CCamBurstThumbnailView() + { + PRINT( _L("Camera => ~CCamBurstThumbnailView") ); + // Free some space by deleting the model + delete iGridModel; + + // NOTE: iAiwServiceHandler owned and deleted by base class + PRINT( _L("Camera <= ~CCamBurstThumbnailView") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::Id +// Returns UID of view +// --------------------------------------------------------------------------- +// +TUid CCamBurstThumbnailView::Id() const + { + return TUid::Uid( ECamViewIdBurstThumbnail ); + } + + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::DynInitMenuPaneL +// Changes MenuPane dynamically +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) + { + PRINT( _L("Camera => CCamBurstThumbnailView::DynInitMenuPaneL")) + + // initializes the aiw service parameters for aiw commands + DynInitAiwMenuPaneL( aResourceId, aMenuPane ); + + if ( iAiwServiceHandler ) + { + // handle any AIW menu cascades + if ( iAiwServiceHandler->HandleSubmenuL( *aMenuPane ) ) + { + return; + } + } + + if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU ) + { + // If there are >1 images marked remove the + // open image item. + if ( iGridModel->NoOfMarkedImages() > 1 ) + { + aMenuPane->SetItemDimmed( ECamCmdOpenPhoto, ETrue ); + TInt itemPos = 0; + if( aMenuPane->MenuItemExists( KAiwCmdUpload, itemPos ) ) + { + PRINT( _L("Camera => CCamBurstThumbnailView::DynInitMenuPaneL SetItemDimmed: KAiwCmdUpload")) + aMenuPane->SetItemDimmed( + KAiwCmdUpload, ETrue ); + } + if( aMenuPane->MenuItemExists( ECamCmdShareOnOvi, itemPos ) ) + { + PRINT( _L("Camera => CCamBurstThumbnailView::DynInitMenuPaneL SetItemDimmed: ECamCmdShareOnOvi")) + aMenuPane->SetItemDimmed( + ECamCmdShareOnOvi, ETrue ); + } + } + + // In touch ui the delete option is available on the fixed toolbar + // there is no need to display it in the options menu + if ( iController.IsTouchScreenSupported() ) + { + TInt itemPos = 0; + if ( aMenuPane->MenuItemExists( ECamCmdDelete, itemPos ) ) + { + aMenuPane->SetItemDimmed( ECamCmdDelete, ETrue ); + } + } + } // ends: if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU ) + + + // ------------------------------------------------------------------ + if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU || + aResourceId == R_CAM_BURST_THUMBNAIL_OK_MENU ) + { + TBool showSend = ETrue; + TBool showSendToCaller = EFalse; + +/*#ifndef __WINS__ + if ( iSFIUtils->IsCLIValidL() ) + { + showSend = EFalse; + showSendToCaller = ETrue; + + if ( iGridModel->NoOfMarkedImages() > 1 ) + { + // Send to caller is disabled if multiple images + // have been marked. + showSendToCaller = EFalse; + } + } +#endif*/ + + if ( iController.IsTouchScreenSupported() && + !iOneClickUploadUtility->OneClickUploadSupported() && + aResourceId == R_CAM_BURST_THUMBNAIL_MENU ) + { + // In touch UI, when one click upload is not supported, + // there will be a Send button in the fixed toolbar. Options + // menu items are not needed. Send is kept in the context menu. + showSend = EFalse; + showSendToCaller = EFalse; + } + + TInt itemPos = 0; + if( aMenuPane->MenuItemExists( ECamCmdSendToCallerMultimedia, itemPos ) ) + { + aMenuPane->SetItemDimmed( + ECamCmdSendToCallerMultimedia, !showSendToCaller ); + } + + if( aMenuPane->MenuItemExists( ECamCmdSend, itemPos ) ) + { + aMenuPane->SetItemDimmed( + ECamCmdSend, !showSend ); + } + } + + if ( aResourceId == R_AVKON_MENUPANE_MARKABLE_LIST_IMPLEMENTATION ) + { + if ( iGridModel->IsMarkedL( iGridModel->HighlightedGridIndex() ) ) + { + // If marked, hide the MARK option + aMenuPane->SetItemDimmed( EAknCmdMark, ETrue ); + } + else + { + // If unmarked, hide the UNMARK option + aMenuPane->SetItemDimmed( EAknCmdUnmark, ETrue ); + } + + if ( iGridModel->NoOfMarkedImages() == 0 ) + { + // If NO marked cells, hide the UNMARK ALL option + aMenuPane->SetItemDimmed( EAknUnmarkAll, ETrue ); + } + + if ( iGridModel->NoOfMarkedImages() == iGridModel->NoOfValidCells() ) + { + // If ALL cells are marked, hide the MARKALL option + aMenuPane->SetItemDimmed( EAknMarkAll, ETrue ); + } + } + + PRINT( _L("Camera <= CCamBurstThumbnailView::DynInitMenuPaneL")) + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailView::HandleCommandL +// Handle commands +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::HandleCommandL( TInt aCommand ) + { + + PRINT1( _L("Camera => CCamBurstThumbnailView::HandleCommandL (aCommand: %d)"), aCommand ) + + // sometimes commands come even after DoDeactivate() has been called. + // this makes sure that those are ignored. + if ( iGridModel == NULL ) + { + return; + } + + switch ( aCommand ) + { + case ECamCmdOneClickUpload: + { + TInt markedItems = iGridModel->NoOfMarkedImages(); + // If there are no images marked use the highlighted image + // set it now for safety just in case no marked images are found + iController.SetAsCurrentImage( + iGridModel->HighlightedBurstIndex() ); + + if ( markedItems > 0 ) + { + // Upload marked images + + CDesC16ArrayFlat* fileNames = + new ( ELeave ) CDesC16ArrayFlat( markedItems ); + CleanupStack::PushL( fileNames ); + + for ( TInt i = 0; i < iGridModel->NoOfImages(); i++ ) + { + if ( iGridModel->IsMarkedL( i ) ) + { + fileNames->AppendL( iGridModel->ImageFileName( i ) ); + } + } + iOneClickUploadUtility->UploadL( + *fileNames ); + CleanupStack::PopAndDestroy( fileNames ); + } + else + { + // Upload highlighted image + iOneClickUploadUtility->UploadL( + iController.CurrentFullFileName() ); + } + break; + } + case ECamCmdRenameImage: + { + iController.SetAsCurrentImage( + iGridModel->ConvertFromValidToGlobalIndex ( + SingleSelectionGridIndexL() ) ); + QueryRenameL( ECamControllerImage ); + break; + } + + case ECamCmdDelete: + { + if ( DisplayDeleteNoteL() ) + { + DoDeleteL(); + } + + break; + } + + case ECamCmdNewPhoto: + { + // the thumbnail scaling needs to be stopped in + // preparation for the app ui switching the view + iGridModel->CancelThumbnails(); + CCamViewBase::HandleCommandL( aCommand ); // Pass on to AppUi + break; + } + + case ECamCmdToolbarMarkUnmark: + { + TBool mark = iGridModel->IsMarkedL( iGridModel->HighlightedGridIndex() ); + iGridModel->SetCurrentMark( !mark ); + // UpdateOneClickUploadButton(); + break; + } + + case EAknCmdMark: + { + iGridModel->SetCurrentMark( ETrue ); + // UpdateOneClickUploadButton(); + break; + } + + case EAknCmdUnmark: + { + iGridModel->SetCurrentMark( EFalse ); + // UpdateOneClickUploadButton(); + break; + } + + case EAknMarkAll: + { + iGridModel->MarkAll( ETrue ); + // UpdateOneClickUploadButton(); + break; + } + + case EAknUnmarkAll: + { + iGridModel->MarkAll( EFalse ); + // UpdateOneClickUploadButton(); + break; + } + + case EAknSoftkeyBack: + { + // the thumbnail scaling needs to be stopped in + // preparation for the app ui switching the view + iGridModel->CancelThumbnails(); + // About to be closed by user, so will want to delete the model + // on deactivation + if ( IsForeground() ) + { + iResetModelOnDeactivate = ETrue; + } + CCamViewBase::HandleCommandL( aCommand ); // Pass on to AppUi + break; + } + case ECamMSKCmdAppChange: + case EAknSoftkeySelect: + { + if ( iGridModel->NoOfMarkedImages() == 0 ) + { + // select the focused item and open it to still postcapture + iResetModelOnDeactivate = EFalse; + + // This selects the highlighted image + iController.SetAsCurrentImage( iGridModel->HighlightedGridIndex() ); + // ConvertFromValidToGlobalIndex used so that appropriate images are displayed + iController.SetAsCurrentImage( iGridModel->ConvertFromValidToGlobalIndex( iGridModel->HighlightedGridIndex() ) ); + CCamViewBase::HandleCommandL( ECamCmdOpenPhoto ); + } + else + { + // If at least one image is marked, open context sensitive menu + CEikMenuBar* menuBar = MenuBar(); + if ( menuBar ) + { + menuBar->SetMenuTitleResourceId( R_CAM_BURST_THUMBNAIL_OK_MENUBAR); + menuBar->SetMenuType( CEikMenuBar::EMenuContext ); + menuBar->TryDisplayMenuBarL(); + // Here we again set back the type of menu to "Options" when pressed LSK + menuBar->SetMenuType( CEikMenuBar::EMenuOptions ); + menuBar->SetMenuTitleResourceId( R_CAM_BURST_THUMBNAIL_MENUBAR); + } + } + break; + } + + case EAknSoftkeyOptions: + { + // do nothing - handled by the framework + break; + } + + case EAknSoftkeyCancel: + { + // do nothing - handled by framework + break; + } + + case ECamCmdSend: + { + CCamPostCaptureViewBase::HandleCommandL( aCommand ); + break; + } + + case ECamCmdSendToCallerMultimedia: + { +/*#ifndef __WINS__ + DoInCallSendL(); +#endif*/ + } + break; + + case ECamCmdQuickSend: + { +/*#ifndef __WINS__ + if( iSFIUtils->IsCLIValidL() ) + { + // only do send to caller if no images are marked + // or one image is marked + if ( iGridModel->NoOfMarkedImages() < 2 ) + { + DoInCallSendL(); + } + } + else +#endif // __WINS__*/ + //{ + DoSendAsL(); + //} + } + break; + + case ECamCmdExitStandby: + { + PRINT( _L("Camera :: CCamBurstThumbnailView::HandleCommandL ECamCmdExitStandby in") ) + CCamViewBase::ExitStandbyModeL(); + PRINT( _L("Camera :: CCamBurstThumbnailView::HandleCommandL ECamCmdExitStandby out") ) + break; + } + + case ECamCmdOpenPhoto: + { + iResetModelOnDeactivate = EFalse; + TInt markedItems = iGridModel->NoOfMarkedImages(); + // If there are no images marked use the highlighted image + // set it now for safety just in case no marked images are found + iController.SetAsCurrentImage( iGridModel->HighlightedBurstIndex() ); + + if ( markedItems != 0 ) // this command should never be available if there is >1 marked item + { + TInt totalItems = iGridModel->NoOfImages(); + TInt index = 0; + TBool found = EFalse; + while ( index < totalItems && !found ) + { + if ( iGridModel->IsMarkedL( index ) ) + { + found = ETrue; + iController.SetAsCurrentImage( index ); + } + index++; + } + } + } + //lint -fallthrough + default: + { + // Handle AIW commands + TInt aiwServiceCmd = iAiwServiceHandler->ServiceCmdByMenuCmd( aCommand ); + if ( aiwServiceCmd != KAiwCmdNone ) + { + CAiwGenericParamList& inParams = iAiwServiceHandler->InParamListL(); + CAiwGenericParamList& outParams = iAiwServiceHandler->OutParamListL(); + // Add file path/s to AIW parameters + TInt markedItems = iGridModel->NoOfMarkedImages(); + // If there are no images marked use the highlighted image + if ( markedItems == 0 ) + { + TAiwVariant variant( iGridModel->ImageFileName( + iGridModel->HighlightedBurstIndex() ) ); + TAiwGenericParam param( EGenericParamFile, variant ); + inParams.AppendL( param ); + + // Set as contact call iamge needs image MIME type as AIW param + // Set as wall paper requires MIME type also. + TAiwVariant variant2( KCamImageMimeType ); + TAiwGenericParam param2( EGenericParamMIMEType, variant2 ); + inParams.AppendL( param2 ); + + } + else // there are marked items, add them to the list + { + TInt totalItems = iGridModel->NoOfImages(); + TInt index = 0; + TInt found = 0; + while ( index < totalItems && found < markedItems ) + { + if ( iGridModel->IsMarkedL( index ) ) + { + found++; + TAiwVariant variant( iGridModel->ImageFileName( index ) ); + TAiwGenericParam param( EGenericParamFile, variant ); + inParams.AppendL( param ); + + // Set as contact call iamge needs image MIME type as AIW param + // Set as wall paper requires MIME type also. + TAiwVariant variant2( KCamImageMimeType ); + TAiwGenericParam param2( EGenericParamMIMEType, variant2 ); + inParams.AppendL( param2 ); + } + index++; + } + } + + iAiwServiceHandler->ExecuteMenuCmdL( aCommand, inParams, outParams, 0, this ); + } + else + { + CCamViewBase::HandleCommandL( aCommand ); + } + break; + } + } + + PRINT1( _L("Camera <= CCamBurstThumbnailView::HandleCommandL (aCommand: %d)"), aCommand ) + } + + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::HandleNotifyL +// Handles any notification caused by asynchronous ExecuteCommandL +// or event. +// --------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailView::HandleNotifyL( + TInt /*aCmdId*/, + TInt aEventId, + CAiwGenericParamList& /*aEventParamList*/, + const CAiwGenericParamList& /*aInParamList*/ ) + { + //AIW fails to assign. eg. the contact is locked for being used now. + if ( aEventId == KAiwEventError && iController.IsAppUiAvailable() ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + TRAP_IGNORE( appUi->HandleCameraErrorL( KErrInUse ) ); + } + + return 0; + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailView::DisplayDeleteNoteL() +// Display confirmation note for deletion of images +// ----------------------------------------------------------------------------- +// +TBool CCamBurstThumbnailView::DisplayDeleteNoteL() + { + // Display the delete confirmation note + HBufC* confirmationText; + + // Find the number of images marked, to work out which note to display. + TInt noteText = 0; + TInt noteDlg = 0; + TInt noOfMarkedImages = iGridModel->NoOfMarkedImages(); + + // Check if no of marked images is zero (if we are to delete the current + // highlighted object) or one (if we are to delete a single marked item). + if ( noOfMarkedImages <= 1) + { + noteText = R_CAM_STILL_POST_CAPTURE_DELETE_NOTE_TEXT; + noteDlg = R_CAM_STILL_POST_CAPTURE_DELETE_NOTE; + confirmationText = StringLoader::LoadLC( noteText ); + } + else // noOfMarkedImages > 1 + { + noteText = R_CAM_BURST_DELETE_MULTIPLE_NOTE_TEXT; + noteDlg = R_CAM_BURST_DELETE_MULTIPLE_NOTE; + confirmationText = StringLoader::LoadLC( noteText, noOfMarkedImages ); + } + + // Create the dialog with the text, and show it to the user + CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText ); + CleanupStack::PopAndDestroy( confirmationText ); + + return confirmationDialog->ExecuteLD( noteDlg ); + } + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailView::DoDeleteL +// Marks the required files for deletion +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::DoDeleteL() + { + if ( iGridModel->NoOfMarkedImages() > 0 ) + { + // Confirmation; mark the files for deletion. + iGridModel->DeleteMarkedL(); + } + else + { + // Confirmation; mark the highlighted item + iGridModel->DeleteHighlightL(); + } + // UpdateOneClickUploadButton(); + } + + + +// ----------------------------------------------------------------------------- +// CCamBurstThumbnailView::HandleForegroundEventL +// Handle foreground event +// ----------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::HandleForegroundEventL( TBool aForeground ) + { + PRINT( _L("Camera => CCamBurstThumbnailView::HandleForegroundEventL") ); + + if ( aForeground ) + { + CCamAppUiBase* appui = static_cast( AppUi() ); + if ( !appui->IsInPretendExit() ) + { + IncrementCameraUsers(); + iController.DeepSleepTimerStart(); + } + } + else + { + // Only decrements if we have incremented. + DecrementCameraUsers(); + } + + PRINT( _L("Camera <= CCamBurstThumbnailView::HandleForegroundEventL") ); + } + + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::DoActivateL +// Activate this view +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMBURSTTHUMBNAILVIEW_DOACTIVATEL, "e_CCamBurstThumbnailView_DoActivateL 1" ); + PRINT( _L( "Camera => CCamBurstThumbnailView::DoActivateL" ) ); + PERF_EVENT_START_L2( EPerfEventBurstThumbnailViewActivation ); + if ( aPrevViewId.iViewUid.iUid == ECamViewIdStillPreCapture || !iGridModel ) + { + iResetModelOnDeactivate = EFalse; + + // Precautionary tidyup, though should never happen. + if ( iGridModel ) + { + delete iGridModel; + iGridModel = NULL; + } + + // If we've come from Pre-Capture view, we shouldn't have an active model. + // Create a new one and register with it. + iGridModel = CCamBurstThumbnailGridModel::NewL(); + iGridModel->AddModelObserverL( this, + CCamBurstThumbnailGridModel::EModelEventDeleted | + CCamBurstThumbnailGridModel::EModelEventHighlight ); + + // Guaranteed to only be called right after a burst capture + iGridModel->SetBurstArrayL( iController.BurstCaptureArray() ); + } + else + { + // We still need to re-register for model events, else if we return to + // grid view from post-capture, we won't receive delete/highlight events + // any more. + iGridModel->AddModelObserverL( this, + CCamBurstThumbnailGridModel::EModelEventDeleted | + CCamBurstThumbnailGridModel::EModelEventHighlight ); + + iGridModel->RefreshL(); + } + + if ( iController.IsTouchScreenSupported() ) + { + // set toolbar + if ( iOneClickUploadUtility->OneClickUploadSupported() ) + { + CreateAndSetToolbarL( R_CAM_BURST_POSTCAPTURE_TOOLBAR_UPLOAD ); + UpdateToolbarIconsL(); + } + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarObserver( this ); + fixedToolbar->SetToolbarVisibility( ETrue ); + } + } + + + + CCamPostCaptureViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + + iAiwServiceHandler->Reset(); + + // initialise AIW services for touch menu + iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU, + R_CAM_MOVE_TO_STILL_IMAGE_SEQUENCE_INTEREST ); + iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU, + R_CAM_SET_AS_CALL_IMAGE_INTEREST ); + iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU, + R_CAM_SHARE_ON_OVI_INTEREST ); + + + static_cast( AppUi() )->PushDefaultNaviPaneL(); + PERF_EVENT_END_L2( EPerfEventBurstThumbnailViewActivation ); + PRINT( _L( "Camera <= CCamBurstThumbnailView::DoActivateL" ) ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMBURSTTHUMBNAILVIEW_DOACTIVATEL, "e_CCamBurstThumbnailView_DoActivateL 0" ); + } + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::DoDeactivate() + { + PRINT( _L( "Camera => CCamBurstThumbnailView::DoDeactivateL" ) ); + iGridModel->RemoveModelObserver( this, CCamBurstThumbnailGridModel::EModelEventDeleted | + CCamBurstThumbnailGridModel::EModelEventHighlight ); + + CCamPostCaptureViewBase::DoDeactivate(); + + // Must delete this last (after everything had a chance to de-register) + // also delete model if all images have been deleted + if ( iResetModelOnDeactivate || iController.BurstCaptureArray()->ImagesRemaining() == 0 ) + { + PRINT( _L( "Camera: CCamBurstThumbnailView::DoDeactivateL resetting model on deactivate" ) ); + delete iGridModel; + iGridModel = NULL; + } + PRINT( _L( "Camera <= CCamBurstThumbnailView::DoDeactivateL" ) ); + } + + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::HighlightChanged +// Called when the highlighted item in the grid view changes +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::HighlightChanged() + { + // Check title is correct as highlight may have changed + TRAPD( ignore, SetTitlePaneTextL() ); + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + } + + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::ImagesDeleted +// Called when images have been deleted from the grid view +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::ImagesDeleted() + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + // inform the media gallery + TRAPD( ignore, appUi->HandleControllerEventL( ECamEventMediaFileChanged, KErrNone ) ); + // Check there is still at least one image + if ( iGridModel->NoOfValidCells() == 0 ) + { + iResetModelOnDeactivate = ETrue; + + CAknToolbar* toolbar = Toolbar(); + if (toolbar) + { + toolbar->SetToolbarVisibility( EFalse ); + } + // Close thumbnail view, go back to Burst PreCapture + TRAP( ignore, HandleCommandL( EAknSoftkeyBack ) ); + } + else + { + iGridModel->UpdateViewableGrid( EFalse ); + } + } + +// --------------------------------------------------------------------------- +// CCamViewBase::IsNewNameValidL +// Check if renaming to the given name is valid. +// --------------------------------------------------------------------------- +// +TBool +CCamBurstThumbnailView::IsNewNameValidL( const TDesC& aFilename ) + { + TInt currentIndex = iGridModel->HighlightedGridIndex(); + + TInt i = 0; + TInt burstItemsCount = iGridModel->NoOfValidCells(); + for ( i = 0; i < burstItemsCount; ++i ) + { + TPtrC imageName = iGridModel->ImageName( i ); + + if ( i != currentIndex ) + { + if ( CamUtility::CompareIgnoreCase( aFilename, + imageName ) ) + { + // New name already exists on grid + return EFalse; + } + } + + } + return ETrue; + } + + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::CCamBurstThumbnailView +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamBurstThumbnailView::CCamBurstThumbnailView( CCamAppController& aController ) + : CCamPostCaptureViewBase( aController ) + { + } + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::ConstructL() + { + PRINT( _L("Camera => CCamBurstThumbnailView::ConstructL") ); + + BaseConstructL( R_CAM_BURST_THUMBNAIL_VIEW ); + CCamPostCaptureViewBase::ConstructL(); + + PRINT( _L("Camera <= CCamBurstThumbnailView::ConstructL") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::CreateContainerL +// Create container control +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::CreateContainerL() + { + PRINT( _L("Camera => CCamBurstThumbnailView::CreateContainerL") ); + CCamBurstThumbnailContainer* cont = new (ELeave) CCamBurstThumbnailContainer( + iController, + *this, + *iGridModel ); + CleanupStack::PushL( cont ); + cont->SetMopParent( this ); + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + cont->ConstructL( screen ); + CleanupStack::Pop( cont ); + iContainer = cont; + PRINT( _L("Camera <= CCamBurstThumbnailView::CreateContainerL") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::SetTitlePaneTextL +// Set the view's title text +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::SetTitlePaneTextL() + { + PRINT( _L("Camera => CCamBurstThumbnailView::SetTitlePaneTextL") ); + // Do not want to set the title to the filename if it's shown in the application pane + _LIT(KSpaces, " "); + static_cast( iEikonEnv->AppUi() )->SetTitleL( KSpaces ); + PRINT( _L("Camera <= CCamBurstThumbnailView::SetTitlePaneTextL") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::DoSendAsL +// Use SendUI to create a message containing burst thumbnails +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::DoSendAsL() const + { + PRINT( _L("Camera => CCamBurstThumbnailView::DoSendAsL") ); + CCamAppUiBase* appUi = static_cast( AppUi() ); + + if ( !appUi->SendAsInProgress() ) + { + appUi->SetSendAsInProgressL( ETrue ); + CMessageData* messageData = CMessageData::NewLC(); + + TInt totalItems = iGridModel->NoOfImages(); + TInt markedItems = iGridModel->NoOfMarkedImages(); + + if ( markedItems == 0 ) + { + // if no images are marked use the highlighted item instead + messageData->AppendAttachmentL( iGridModel->ImageFileName( + iGridModel->HighlightedBurstIndex() ) ); + } + else + { + // attach all marked items + TInt index = 0; + TInt found = 0; + while ( index < totalItems && found < markedItems ) + { + if ( iGridModel->IsMarkedL( index ) ) + { + found++; + messageData->AppendAttachmentL( iGridModel->ImageFileName( index ) ); + } + index++; + } + } + + TRAP_IGNORE( iSendAppUi->ShowQueryAndSendL( messageData, iSendingCapabilities ) ) + + appUi->SetSendAsInProgressL( EFalse ); + CleanupStack::PopAndDestroy( messageData ); + } + + + PRINT( _L("Camera <= CCamBurstThumbnailView::DoSendAsL") ); + } + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::SingleSelectionGridIndexL() +// Returns the array index of the first marked item, +// or highlighted item if none marked. +// --------------------------------------------------------------------------- +// +TInt CCamBurstThumbnailView::SingleSelectionGridIndexL() const + { + TInt ret = KErrNotFound; + + if( iGridModel->NoOfMarkedImages() == 0 ) + { + ret = iGridModel->HighlightedGridIndex(); + } + else + { + TInt totalItems = iGridModel->NoOfImages(); + for( TInt index = 0; index < totalItems; index++ ) + { + if ( iGridModel->IsMarkedL( index ) ) + { + ret = index; + break; + } + } + } + + return ret; + } + +// --------------------------------------------------------------------------- +// CCamViewBase::IsBurstPostCapture +// Returns whether the view is a burst mode postcapture view +// --------------------------------------------------------------------------- +// +TBool CCamBurstThumbnailView::IsBurstPostCapture() + { + return ETrue; + } + +// --------------------------------------------------------------------------- +// CCamViewBase::ImageFilesDeleted +// Notifies view that images files have been deleted outside of camera +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::ImageFilesDeleted() + { + PRINT( _L("Camera => CCamBurstThumbnailView::ImageFilesDeleted") ) + if ( iGridModel ) + { + iGridModel->ImageFilesDeleted(); + } + PRINT( _L("Camera <= CCamBurstThumbnailView::ImageFilesDeleted") ) + } + + +/*#ifndef __WINS__ +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::DoInCallSendL +// Handle send to caller functionality +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::DoInCallSendL() const + { + // Ignore if more than one item marked + if( iGridModel->NoOfMarkedImages() < 2 ) + { + TInt index = SingleSelectionGridIndexL(); + if ( iSFIUtils && iSFIUtils->IsCLIValidL() && index >=0 ) + { + iSFIUtils->SendMediaFileL( iGridModel->ImageFileName( index ) ); + } + } + } +#endif // __WINS__*/ + +// --------------------------------------------------------------------------- +// CCamBurstThumbnailView::CalculateThumbnailSize +// Calculates the size of a single thumbnail based on the infromation +// how many images are alltogether shown on the burst grid +// --------------------------------------------------------------------------- +// +TSize CCamBurstThumbnailView::CalculateThumbnailSize( TInt aNumberOfBurstImages ) + { + TSize thumb; + TAknLayoutRect gridLayout; + TAknLayoutRect cellLayout; + TAknLayoutRect thumbLayout; + + thumb.iHeight = 0; + thumb.iWidth = 0; + + if ( aNumberOfBurstImages <= KBurstGridDefaultThumbnails ) + { + gridLayout.LayoutRect( ClientRect(), AknLayoutScalable_Apps::grid_cam4_burst_pane( 1 ) ); + cellLayout.LayoutRect( gridLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane( 1, 0, 0 ) ); + thumbLayout.LayoutRect( cellLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane_g1( 0, 0, 0 ) ); + } + else if ( aNumberOfBurstImages <= KBurstGridMaxVisibleThumbnails ) + { + gridLayout.LayoutRect( ClientRect(), AknLayoutScalable_Apps::grid_cam4_burst_pane( 3 ) ); + cellLayout.LayoutRect( gridLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane( 3, 0, 0 ) ); + thumbLayout.LayoutRect( cellLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane_g1( 1, 0, 0 ) ); + } + else + { + gridLayout.LayoutRect( ClientRect(), AknLayoutScalable_Apps::grid_cam4_burst_pane( 5 ) ); + cellLayout.LayoutRect( gridLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane( 5, 0, 0 ) ); + thumbLayout.LayoutRect( cellLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane_g1( 2, 0, 0 ) ); + } + + thumb.iHeight = thumbLayout.Rect().Height(); + thumb.iWidth = thumbLayout.Rect().Width(); + + return thumb; + } + + +void CCamBurstThumbnailView::DynInitAiwMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) + { + + if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU ) + { + if ( iAiwServiceHandler && iAiwServiceHandler->IsAiwMenu( aResourceId ) ) + { + + CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL(); + TInt markedItems = iGridModel->NoOfMarkedImages(); + // If there are no images marked use the highlighted image + + TCamOrientation orientation = static_cast( AppUi() )->CamOrientation(); + + if ( markedItems == 0 ) + { + TAiwVariant variant( iGridModel->ImageFileName( + iGridModel->HighlightedBurstIndex() ) ); + TAiwGenericParam param( EGenericParamFile, variant ); + paramList.AppendL( param ); + + // Set as contact call image needs image MIME type as AIW param + //if ( orientation == ECamOrientationCamcorder || orientation == ECamOrientationCamcorderLeft ) + { + TAiwVariant variant2( KCamImageMimeType ); + TAiwGenericParam param2( EGenericParamMIMEType, variant2 ); + paramList.AppendL( param2 ); + } + + } + else if ( markedItems == 1 ) + { + TInt totalItems = iGridModel->NoOfImages(); + TInt index = 0; + while ( index < totalItems ) + { + if ( iGridModel->IsMarkedL( index ) ) + { + + TAiwVariant variant( iGridModel->ImageFileName( index ) ); + TAiwGenericParam param( EGenericParamFile, variant ); + paramList.AppendL( param ); + + //if ( orientation == ECamOrientationCamcorder || orientation == ECamOrientationCamcorderLeft ) + { + TAiwVariant variant2( KCamImageMimeType ); + TAiwGenericParam param2( EGenericParamMIMEType, variant2 ); + paramList.AppendL( param2 ); + } + + break; + } + index++; + } + } + else // there are more than on marked item + { + // removing lint warning + } + + iAiwServiceHandler->InitializeMenuPaneL( + *aMenuPane, + aResourceId, + ECamCmdAIWCommands, + paramList ); + } + + } + + } + +// --------------------------------------------------------------------------- +// Dim 1-click upload button if more than one image is marked +// --------------------------------------------------------------------------- +// +void CCamBurstThumbnailView::UpdateOneClickUploadButton() + { + CAknToolbar* toolbar = Toolbar(); + if( toolbar && iGridModel ) + { + TBool shouldBeDimmed = ( iGridModel->NoOfMarkedImages() > 1 ); + + CAknButton* button = static_cast( + toolbar->ControlOrNull( ECamCmdOneClickUpload ) ); + + if ( button ) + { + TBool isDimmed = button->IsDimmed(); + if ( ( shouldBeDimmed && !isDimmed ) || + ( !shouldBeDimmed && isDimmed ) ) + { + button->SetDimmed( shouldBeDimmed ); + button->DrawDeferred(); + } + } + } + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCallStateAo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCallStateAo.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Listens for changes to phone call state* +*/ + + + +// INCLUDE FILES +#include +#include +#include + +#include "CamUtility.h" +#include "CamCallStateAo.h" +#include "CamPanic.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================ MEMBER FUNCTIONS =============================== +#ifdef _DEBUG +void ExpandStateDebug( TPSCTsyCallState aVal ) + { + switch ( aVal ) + { + case EPSCTsyCallStateUninitialized: + PRINT(_L("Camera CCamCallStateAo::RunL NEW STATUS => Uninit") ); + break; + case EPSCTsyCallStateNone: + PRINT(_L("Camera CCamCallStateAo::RunL NEW STATUS => NONE") ); + break; + case EPSCTsyCallStateAlerting: + PRINT(_L("Camera CCamCallStateAo::RunL NEW STATUS => ALERTING") ); + break; + case EPSCTsyCallStateRinging: + PRINT(_L("Camera CCamCallStateAo::RunL NEW STATUS => RINGING") ); + break; + case EPSCTsyCallStateDialling: + PRINT(_L("Camera CCamCallStateAo::RunL NEW STATUS => DIALLING") ); + break; + case EPSCTsyCallStateAnswering: + PRINT(_L("Camera CCamCallStateAo::RunL NEW STATUS => ANSWERING") ); + break; + case EPSCTsyCallStateDisconnecting: + PRINT(_L("Camera CCamCallStateAo::RunL NEW STATUS => DISCONNECTING") ); + break; + case EPSCTsyCallStateConnected: + PRINT(_L("Camera CCamCallStateAo::RunL NEW STATUS => CONNECTED") ); + break; + case EPSCTsyCallStateHold: + PRINT(_L("Camera CCamCallStateAo::RunL NEW STATUS => HOLD") ); + break; + } + } +#endif // _DEBUG + + +// ----------------------------------------------------------------------------- +// CCamCallStateAo::CCamCallStateAo +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CCamCallStateAo::CCamCallStateAo( MCamCallStateObserver* aObserver ) : CActive( EPriorityStandard ) + { + PRINT( _L("Camera => CCamCallStateAo::CCamCallStateAo") ); + __ASSERT_DEBUG( aObserver != NULL, CamPanic(ECamPanicNullImage) ); + CActiveScheduler::Add( this ); + + iObserver = aObserver; + } + + +// ----------------------------------------------------------------------------- +// CCamCallStateAo::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamCallStateAo* CCamCallStateAo::NewL( MCamCallStateObserver* aObserver ) + { + CCamCallStateAo* self = new( ELeave ) CCamCallStateAo( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamCallStateAo::ConstructL() + { + PRINT( _L("Camera => CCamCallStateAo::ConstructL") ); + + TInt ret = iProperty.Attach( KPSUidCtsyCallInformation, KCTsyCallState ); + PRINT1( _L("CCamCallStateAo::ConstructL attaching property ret %d"), ret ); + + if ( ret == KErrNone ) + { + // Will subscribe to the attribute required + RunL(); + } + else + { + // If an error occurred, we can't get call state info which we really need + // so leave + User::Leave( ret ); + } + + PRINT( _L("Camera <= CCamCallStateAo::ConstructL") ); + } + +// ----------------------------------------------------------------------------- +// CCamCallStateAo::~CCamCallStateAo +// Destructor +// ----------------------------------------------------------------------------- +// +CCamCallStateAo::~CCamCallStateAo() + { + PRINT( _L("Camera => ~CCamCallStateAo") ); + Cancel(); + PRINT( _L("Camera <= ~CCamCallStateAo") ); + } + + +// ----------------------------------------------------------------------------- +// CCamCallStateAo::DoCancel +// Cancels an outstanding request +// ----------------------------------------------------------------------------- +// +void CCamCallStateAo::DoCancel() + { + iProperty.Close(); + } + + +// ----------------------------------------------------------------------------- +// CCamCallStateAo::RunL +// Called when a request has completed. +// ----------------------------------------------------------------------------- +// +void CCamCallStateAo::RunL() + { + PRINT(_L("Camera => CCamCallStateAo::RunL") ); + iProperty.Subscribe( iStatus ); + PRINT(_L("Camera CCamCallStateAo::RunL subscribed") ); + + SetActive(); + PRINT(_L("Camera CCamCallStateAo::RunL set active") ); + + TInt val = KErrNotFound; + TInt ret = iProperty.Get( val ); + + if ( val != KErrNotFound && ret != KErrNotFound ) + { + TPSCTsyCallState callState = static_cast( val ); +#ifdef _DEBUG + ExpandStateDebug( callState ); +#endif + PRINT(_L("Camera CCamCallStateAo::RunL calling callback") ); + iObserver->CallStateChanged( callState, ret ); + PRINT(_L("Camera CCamCallStateAo::RunL returned from callback") ); + } + else + { + iObserver->CallStateChanged( EPSCTsyCallStateUninitialized, ret ); + } + PRINT(_L("Camera <= CCamCallStateAo::RunL") ); + } + + +// ----------------------------------------------------------------------------- +// CCamCallStateAo::RunError +// Called when an error has occurred. +// ----------------------------------------------------------------------------- +// +TInt CCamCallStateAo::RunError( TInt aError ) + { + iObserver->CallStateChanged( EPSCTsyCallStateUninitialized, aError ); + return KErrNone; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCaptureSetupContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCaptureSetupContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,776 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This implements a control which acts as a container for the* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "CamCaptureSetupContainer.h" +#include "CamAppController.h" +#include "CamCaptureSetupControlHandler.h" +#include "CamUtility.h" +#include "CamCaptureSetupListBox.h" + + +#include +#include + +#include "CamAppUi.h" + +#include "camcameraevents.h" +#include "mcamlistboxmodel.h" + +// =========================================================================== +// CONSTANTS + +const TUint KCameraEventInterest = ECamCameraEventClassVfData; + +// =========================================================================== +// MEMBER FUNCTIONS + +// --------------------------------------------------------------------------- +// CCamCaptureSetupContainer::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamCaptureSetupContainer* CCamCaptureSetupContainer::NewL( + CCamAppController& aController, + CAknView& aView, + CCamCaptureSetupControlHandler& aControlHandler, + const TRect& aRect ) + { + CCamCaptureSetupContainer* self = new( ELeave ) CCamCaptureSetupContainer( + aController, + aView, + aControlHandler ); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + CleanupStack::Pop( self ); + // return newly created CCamCaptureSetupContainer instance + return self; + } + +// --------------------------------------------------------- +// CCamCaptureSetupContainer::~CCamCaptureSetupContainer +// Destructor +// --------------------------------------------------------- +// +CCamCaptureSetupContainer::~CCamCaptureSetupContainer() + { + PRINT( _L("Camera => ~CCamCaptureSetupContainer") ); + // + + iController.ViewfinderWindowDeleted( &Window() ); + + iController.RemoveCameraObserver( this ); + if ( iFeedback ) + { + iFeedback->RemoveFeedbackForControl( iCaptureSetupControl ); + } + delete iCaptureSetupControl; + delete iTitleText; + PRINT( _L("Camera <= ~CCamCaptureSetupContainer") ); + } + +// --------------------------------------------------------- +// CCamCaptureSetupContainer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamCaptureSetupContainer::ConstructL( const TRect& aRect ) + { + PRINT( _L("Camera => CCamCaptureSetupContainer::ConstructL ") ); + + CCamContainerBase::BaseConstructL( aRect ); + if ( iController.IsTouchScreenSupported() ) + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar(); + if ( fixedToolbar ) + { + // Remove toolbar from the settings view, before drawing VF, + // in order to avoid flickering + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + + iCaptureSetupControl = iControlHandler.CreateCaptureSetupControlL( this ); + iCaptureSetupControl->SetContainerWindowL( *this ); + iViewFinding = iControlHandler.ControlUsesViewFinder(); + + // If the control requires a viewfinder then add it + if ( iViewFinding ) + { + // + iController.AddCameraObserverL( this, KCameraEventInterest ); + // iController.AddViewFinderObserverL( this ); + // + } + + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + iLayoutAreaRect ); + + // layout area rectangle contains the area, where components need to be + // drawn to. the container size is the whole screen, but the layouts are + // for the client area. aRect is the container size that might include or + // might not include statuspane area. calculating area self will + // go around the problem + + TRect listboxRect; + if ( CamUtility::IsNhdDevice() ) + { + listboxRect = TouchLayout(); + } + else + { + listboxRect = NonTouchLayout(); + } + + if ( iControlHandler.ControlIsListBox() ) + { + CCamCaptureSetupListBox* listbox = + static_cast(iCaptureSetupControl); + + // Determine the height of the listbox; Either the height based on the + // number of items, or the maximum allowed listbox height. + CEikScrollBarFrame::TScrollBarVisibility visibility = + CEikScrollBarFrame::EOff; + TInt maxListBoxHeight = listboxRect.Height(); + TInt listBoxHeight = listbox->CalcHeightBasedOnNumOfItems( + listbox->Model()->NumberOfItems() ); + if ( maxListBoxHeight < listBoxHeight ) + { + listBoxHeight = maxListBoxHeight; + visibility = CEikScrollBarFrame::EOn; + } + + const AknLayoutUtils::SAknLayoutControl listboxLayout = + { ELayoutEmpty, listboxRect.iTl.iX, listboxRect.iTl.iY, + ELayoutEmpty, ELayoutEmpty, listboxRect.Width(), listBoxHeight }; + + AknLayoutUtils::LayoutControl( iCaptureSetupControl, iLayoutAreaRect, + listboxLayout); + + listbox->CreateScrollBarFrameL( ETrue ); + listbox->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, visibility ); + listbox->MakeVisible( ETrue ); + listbox->SetFocus( EFalse, ENoDrawNow ); + listbox->UpdateScrollBarsL(); + listbox->ScrollBarFrame()->DrawScrollBarsNow(); + listbox->SetListBoxObserver(this); + } + + iFeedback = MTouchFeedback::Instance(); + if ( iFeedback ) + { + iFeedback->SetFeedbackArea( iCaptureSetupControl, 0, + iCaptureSetupControl->Rect(), + ETouchFeedbackBasic, + ETouchEventStylusDown ); + } + + iCaptureSetupControl->MakeVisible( ETrue ); + iCaptureSetupControl->SetFocus( EFalse, EDrawNow ); + iTitleText = iEikonEnv->AllocReadResourceL( + iControlHandler.ControlTitleResourceId() ); + iController.SetViewfinderWindowHandle( &Window() ); + + PRINT( _L("Camera <= CCamCaptureSetupContainer::ConstructL") ); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupContainer::ControlPositionL +// Return the top left position for the control +// --------------------------------------------------------------------------- +// +TPoint CCamCaptureSetupContainer::ControlPositionL() const + { + TPoint pos; + + // If the viewfinder preview is showing + if ( iViewFinding ) + { + /* + // Get the control pos from resource + TResourceReader reader; + TInt resource = iControlHandler.ControlPositionResourceId(); + iEikonEnv->CreateResourceReaderLC( reader, resource ); + + pos.iX = reader.ReadInt16( ); + pos.iY = reader.ReadInt16( ); + iCaptureSetupControl->SetPosition( pos ); + + // Cleanup the resource reader. + CleanupStack::PopAndDestroy(); // resource reader + */ + + } + else // The control should be centered horizontally + { + + /* + pos.iX = ( Rect().Width() - iListBoxWidth ) /2; + pos.iY = ( Rect().Height() - + iCaptureSetupControl->MinimumSize().iHeight ) /2; + */ + + + } + return pos; + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupContainer::CCamCaptureSetupContainer +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamCaptureSetupContainer::CCamCaptureSetupContainer( + CCamAppController& aController, + CAknView& aView, + CCamCaptureSetupControlHandler& aControlHandler ) +: CCamContainerBase( aController, aView ), +iControlHandler( aControlHandler ), +iActivateOnTouchRelease(EFalse) + { + } + +// --------------------------------------------------------- +// CCamCaptureSetupContainer::CountComponentControls +// Returns the number of controls owned +// --------------------------------------------------------- +// +TInt CCamCaptureSetupContainer::CountComponentControls() const + { + return 1; // Return the number of controls inside this container + } + +// --------------------------------------------------------- +// CCamCaptureSetupContainer::ComponentControl +// --------------------------------------------------------- +// +CCoeControl* CCamCaptureSetupContainer::ComponentControl(TInt /*aIndex*/) const + { + return iCaptureSetupControl; + } + +// --------------------------------------------------------- +// CCamCaptureSetupContainer::Draw +// Draw control +// --------------------------------------------------------- +// +void CCamCaptureSetupContainer::Draw( const TRect& aRect ) const + { + PRINT( _L("Camera => CCamCaptureSetupContainer::Draw")) + CWindowGc& gc = SystemGc(); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsDrawUtils::Background( skin, iBgContext, gc, aRect/*Rect()*/ ); + + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + PRINT( _L("Camera => CCamCaptureSetupContainer::Draw direct VF")) + + if( appUi->IsDirectViewfinderActive() && + iViewFinding ) + { + // Fill control with transparency bg colour + gc.SetPenStyle( CGraphicsContext::ENullPen ); + + gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); + gc.SetBrushColor( TRgb::Color16MA( 0 ) ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.DrawRect( iViewFinderRectLayout.Rect() ); + + // Reset the brush after use (otherwise anything drawn + // after the viewfinder will also show viewfinder frames) + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); + } + + // draw the title text + TRgb color; + AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + if ( CamUtility::IsNhdDevice() ) + { + iTitleTextRectLayout.DrawText( gc, *iTitleText, ETrue, color ); + } + else + { + TRAP_IGNORE( appUi->SetTitleL( *iTitleText )); + } + PRINT( _L("Camera <= CCamCaptureSetupContainer::Draw")) + } + +// ---------------------------------------------------- +// CCamCaptureSetupContainer::OfferKeyEventL +// ---------------------------------------------------- +// +TKeyResponse CCamCaptureSetupContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if( iController.CurrentMode() == ECamControllerIdle || + iController.CurrentMode() == ECamControllerShutdown ) + { + if( !iController.IsViewFinding() && iViewFinding + && IsCaptureKeyL( aKeyEvent, aType ) ) + { + PRINT( _L("Camera <> CCamCaptureSetupContainer::OfferKeyEventL coming back from standby" )) + ReserveAndStartVF(); + } + return EKeyWasNotConsumed; + } + + PRINT( _L("Camera => CCamCaptureSetupContainer::OfferKeyEventL" )) + iController.StartIdleTimer(); + + if( !iController.IsViewFinding() && iViewFinding + && IsCaptureKeyL( aKeyEvent, aType ) ) + { + // If VF was stopped by stand-by-timer, restart VF here + ReserveAndStartVF(); + } + + // If the Ok button is pressed, select the current item + if ( aKeyEvent.iCode == EKeyOK && aKeyEvent.iRepeats == 0 && aType == EEventKey ) + { + TKeyResponse response = iCaptureSetupControl->OfferKeyEventL( aKeyEvent, aType ); + iView.HandleCommandL( EAknSoftkeyOk ); + return response; + } + return iCaptureSetupControl->OfferKeyEventL( aKeyEvent, aType ); + } + +// +// =========================================================================== +// From MCamCameraObserver + +// --------------------------------------------------------------------------- +// virtual HandleCameraEventL +// --------------------------------------------------------------------------- +// +void +CCamCaptureSetupContainer::HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData /*= NULL*/ ) + { + if ( iViewFinding + && ECamCameraEventVfFrameReady == aEventId + && KErrNone == aStatus ) + { + CFbsBitmap* frame = static_cast( aEventData ); + if( frame ) + { + // Draw a portion of the viewfinder + CWindowGc& gc = SystemGc(); + gc.Activate( *DrawableWindow() ); + TRect rect = iViewFinderRectLayout.Rect(); + RWindow window = Window(); + window.Invalidate( rect ); + window.BeginRedraw( rect ); + TRect bitmapPortion = rect; + TSize bitmapSize = frame->SizeInPixels(); + // if the bitmap is too short to offset vertically + // display from its top edge + if ( bitmapSize.iHeight - rect.iTl.iY < rect.Height() ) + { + bitmapPortion.Move( 0, 0 - rect.iTl.iY ); + } + // if the bitmap is too narrow to offset horizontally + // display from its left edge + if ( bitmapSize.iWidth - rect.iTl.iX < rect.Width() ) + { + bitmapPortion.Move( 0 - rect.iTl.iX, 0 ); + } + gc.BitBlt( rect.iTl, frame, bitmapPortion ); + + window.EndRedraw(); + gc.Deactivate(); + } + } + } + +// --------------------------------------------------------- +// CCamCaptureSetupContainer::HandlePointerEventL +// --------------------------------------------------------- +// +void CCamCaptureSetupContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + + RDebug::Print(_L("CCamCaptureSetupContainer::HandlePointerEventL iType=%d iPosition=(%d, %d)"), + aPointerEvent.iType, + aPointerEvent.iPosition.iX, + aPointerEvent.iPosition.iY ); + if( !iController.IsViewFinding() && iViewFinding ) + { + PRINT ( _L("Camera <> CCamCaptureSetupContainer::HandlePointerEventL start viewfinder") ); + ReserveAndStartVF(); + } + + /*if( iController.CurrentMode() == ECamControllerIdle || + iController.CurrentMode() == ECamControllerShutdown ) + { + return; + } + + if( !iController.IsViewFinding() && iViewFinding ) + { + // First tap just starts viewfinder + iController.StartViewFinder(); + iController.StartIdleTimer(); + return; + } + + if ( iControlHandler.ControlIsListBox() && iCaptureSetupControl ) + { + + TInt oldListItemIndex = -1; + TInt newListItemIndex = -1; + TBool handleItemActivation = EFalse; + + CCamCaptureSetupListBox* listbox = static_cast(iCaptureSetupControl); + + if ( listbox ) + { + oldListItemIndex = listbox->CurrentItemIndex(); + } + + CCoeControl::HandlePointerEventL( aPointerEvent ); + + if ( listbox ) + { + newListItemIndex = listbox->CurrentItemIndex(); + } + + if ( oldListItemIndex != -1 && newListItemIndex != -1 ) + { + + // figure out if item was activated by touch down + release combination on same item + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + if ( newListItemIndex != oldListItemIndex ) + { + iActivateOnTouchRelease = EFalse; + } + else + { + // set the current item to be activated on touch release + iActivateOnTouchRelease = ETrue; + } + } + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + if ( iActivateOnTouchRelease && ( newListItemIndex == oldListItemIndex ) ) + { + TInt pointedItemIndex; + TBool focusableItemPointed = listbox->View()->XYPosToItemIndex(aPointerEvent.iPosition, pointedItemIndex ); + // check that pointer is in focusable area + if ( focusableItemPointed ) + { + // only if list item index has not changed during event and iActivateOnTouchRelease is true + handleItemActivation = ETrue; + iActivateOnTouchRelease = EFalse; + } + else + { + iActivateOnTouchRelease = EFalse; + } + } + } + else + { + // aPointerEvent.iType == TPointerEvent::EDrag + + if ( newListItemIndex != oldListItemIndex ) + { + // change only when drag event changes the listitem index + iActivateOnTouchRelease = EFalse; + } + + } + + } // end if ( oldListItemIndex != -1 && newListItemIndex != -1 ) + + if ( handleItemActivation ) + { + iView.HandleCommandL( EAknSoftkeyOk ); + } + + } // end if ( iControlHandler.ControlIsListBox() && iCaptureSetupControl ) + else + { + // make sure that base class functionality is called even if + // container has some other control than listbox + CCoeControl::HandlePointerEventL( aPointerEvent ); + }*/ + iCaptureSetupControl->HandlePointerEventL( aPointerEvent ); + } + +// --------------------------------------------------------- +// CCamCaptureSetupContainer::TouchLayout +// --------------------------------------------------------- +// +TRect CCamCaptureSetupContainer::TouchLayout() + { + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, + statusPaneRect ); + iLayoutAreaRect.BoundingRect( statusPaneRect ); + + if ( iControlHandler.ControlIsListBox() ) + { + TAknLayoutRect listboxLayoutRect; + if ( iViewFinding ) + { + listboxLayoutRect.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset_listscroll_pane( 2 ) ); + } + else + { + listboxLayoutRect.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset_listscroll_pane( 3 ) ); + } + iViewFinderRectLayout.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cam_set_pane_g2( 2 ) ); + iTitleTextRectLayout.LayoutText( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cam_set_pane_t1( 3 ) ); + return listboxLayoutRect.Rect(); + } + else // slider + { + TAknLayoutRect settingLayout; + settingLayout.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cam_set_pane( 0 ) ); + TRect settingRect( settingLayout.Rect() ); + AknLayoutUtils::LayoutControl( iCaptureSetupControl, settingRect, + AknLayoutScalable_Apps::main_cset_slider_pane( 1 ) ); + + iViewFinderRectLayout.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cam_set_pane_g2( 3 ) ); + iTitleTextRectLayout.LayoutText( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cam_set_pane_t1( 5 ) ); + return settingRect; + } + } + +// --------------------------------------------------------- +// CCamCaptureSetupContainer::NonTouchLayout +// --------------------------------------------------------- +// +TRect CCamCaptureSetupContainer::NonTouchLayout() + { + // Non-touch has a visible title & status panes + TRect titlePaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::ETitlePane, + titlePaneRect ); + iLayoutAreaRect.Move( 0, -titlePaneRect.Height() ); + + if ( iControlHandler.ControlIsListBox() ) + { + TAknLayoutRect listboxLayoutRect; + if ( iViewFinding ) + { + listboxLayoutRect.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset6_listscroll_pane( 2 ) ); + } + else + { + listboxLayoutRect.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset6_listscroll_pane( 3 ) ); + } + iViewFinderRectLayout.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cam6_set_pane_g2( 2 ) ); + return listboxLayoutRect.Rect(); + } + else // slider + { + TAknLayoutRect settingLayout; + settingLayout.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cam6_set_pane() ); + TRect settingRect( settingLayout.Rect() ); + AknLayoutUtils::LayoutControl( iCaptureSetupControl, settingRect, + AknLayoutScalable_Apps::main_cset6_slider_pane( 1 ) ); + iViewFinderRectLayout.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cam6_set_pane_g2( 3 ) ); + return settingRect; + } + } + +// ---------------------------------------------------- +// CCamContainerBase::HandleForegroundEvent +// Called to notify of change of app fore/background state +// ---------------------------------------------------- +// +void CCamCaptureSetupContainer::HandleForegroundEventL( TBool aForeground ) + { + + if ( aForeground ) + { + DrawDeferred(); + } + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupContainer::HandleListBoxEventL +// Handles Listbox events +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupContainer::HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ) + { + if( iController.CurrentMode() == ECamControllerIdle || + iController.CurrentMode() == ECamControllerShutdown ) + { + return; + } + + if( !iController.IsViewFinding() && iViewFinding ) + { + PRINT( _L("Camera <> CCamCaptureSetupContainer::HandleListBoxEventL start viewfinder") ); + ReserveAndStartVF(); + return; + } + + switch( aEventType ) + { + + case EEventEnterKeyPressed: + case EEventItemDoubleClicked: + { + iView.HandleCommandL(EAknSoftkeyOk); + } + break; + + case EEventItemClicked: + { + MCamListboxModel* model = static_cast( aListBox->Model() ); + iControlHandler.HandleSettingValueUpdateL( model->ItemValue( aListBox->CurrentItemIndex() ) ); + } + break; + case EEventItemSingleClicked: + { + MCamListboxModel* model = static_cast( aListBox->Model() ); //Warning: downcasting + iControlHandler.HandleSettingValueUpdateL( model->ItemValue( aListBox->CurrentItemIndex() ) ); + iView.HandleCommandL(EAknSoftkeyOk); + } + break; + default: + break; + } + } +/* +// --------------------------------------------------------- +// CCamCaptureSetupContainer::ShowViewFinderFrame +// Receives new viewfinder frame when one is available +// --------------------------------------------------------- +// +void CCamCaptureSetupContainer::ShowViewFinderFrame( const CFbsBitmap* aFrame, TBool /aFrozen/ ) + { + // If a bitmap pointer was passed + if ( aFrame && iViewFinding ) + { + // draw a portion of the viewfinder + // temporary values used, waiting for specification + CWindowGc& gc = SystemGc(); + gc.Activate( *DrawableWindow() ); + TRect rect = iViewFinderRectLayout.Rect(); + RWindow window = Window(); + window.Invalidate( rect ); + window.BeginRedraw( rect ); + TRect bitmapPortion = rect; + TSize bitmapSize = aFrame->SizeInPixels(); + // if the bitmap is too short to offset vertically + // display from its top edge + if ( bitmapSize.iHeight - rect.iTl.iY < rect.Height() ) + { + bitmapPortion.Move( 0, 0 - rect.iTl.iY ); + } + // if the bitmap is too narrow to offset horizontally + // display from its left edge + if ( bitmapSize.iWidth - rect.iTl.iX < rect.Width() ) + { + bitmapPortion.Move( 0 - rect.iTl.iX, 0 ); + } + gc.BitBlt( rect.iTl, aFrame, bitmapPortion ); + window.EndRedraw(); + gc.Deactivate(); + } + else // otherwise a null bitmap pointer was passed + { + + } + } +*/ + +// --------------------------------------------------------- +// CCamCaptureSetupContainer::ReserveAndStartVF +// --------------------------------------------------------- +// +void CCamCaptureSetupContainer::ReserveAndStartVF() + { + PRINT ( _L("Camera => CCamCaptureSetupContainer::ReserveAndStartVF") ); + TCamCameraMode mode = iController.CurrentMode(); + if(iController.IsAppUiAvailable()) + { + TVwsViewId currentViewId; + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + appUi->GetActiveViewId( currentViewId ); + switch ( currentViewId.iViewUid.iUid ) + { + case ECamViewIdPhotoUserSceneSetup: + case ECamViewIdStillPreCapture: + { + mode = ECamControllerImage; + } + break; + case ECamViewIdVideoPreCapture: + { + mode = ECamControllerVideo; + } + break; + default: + { + //Assume imagemode if view cannot be determined. + if(mode==ECamControllerIdle) + { + mode = ECamControllerImage; + } + } + break; + } + } + //Don't reserve camera and start viewfinder if shutting down. + if(mode!=ECamControllerShutdown) + { + iController.EnterViewfinderMode( mode ); + iController.StartIdleTimer(); + } + PRINT ( _L("Camera <= CCamCaptureSetupContainer::ReserveAndStartVF") ); + } +// + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCaptureSetupControlHandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCaptureSetupControlHandler.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,449 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for creating, initializing and observing* +*/ + + + +// INCLUDE FILES + +#include "CamCaptureSetupControlHandler.h" +#include "CamAppController.h" +#include "CamLogger.h" + +#include "CamCaptureSetupListBox.h" +#include +#include +#include "CamCaptureSetupSlider.h" + +#include "CamUtility.h" +#include "CameraUiConfigManager.h" + +#include + +// CONSTANTS + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::CCamCaptureSetupControlHandler +// Constructor +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupControlHandler::CCamCaptureSetupControlHandler( + CCamAppController& aController, + TCamSettingItemIds aSettingType ) +: iController( aController ), iSettingType( aSettingType) + { + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler Destructor +// +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupControlHandler::~CCamCaptureSetupControlHandler() + { + PRINT( _L("Camera => ~CCamCaptureSetupControlHandler") ); + PRINT( _L("Camera <= ~CCamCaptureSetupControlHandler") ); + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::CreateCaptureSetupControlL +// Create a new capture setup control with self as observer. +// Ownership is transferred to the calling class. +// ----------------------------------------------------------------------------- +// +CCoeControl* CCamCaptureSetupControlHandler::CreateCaptureSetupControlL( const CCoeControl* aParent ) + { + // create a new control determined by iSettingType. + // set self as observer + switch( iSettingType ) + { + case ECamSettingItemDynamicPhotoExposure: + case ECamSettingItemUserSceneExposure: + case ECamSettingItemDynamicPhotoBrightness: + case ECamSettingItemDynamicPhotoContrast: + case ECamSettingItemDynamicVideoBrightness: + case ECamSettingItemDynamicVideoContrast: + case ECamSettingItemUserSceneBrightness: + case ECamSettingItemUserSceneContrast: + { + // create and return a slider control + CCamCaptureSetupSlider* captureSetupControl = + CCamCaptureSetupSlider::NewL( aParent, this, iSettingType, 0 ); + CleanupStack::PushL( captureSetupControl ); + captureSetupControl->InitializeL + ( iController.IntegerSettingValue( iSettingType ) ); + CleanupStack::Pop( captureSetupControl ); + + // pass ownership of the control to the calling class + return captureSetupControl; + } + default: + { + TInt resourceId = ResourceForControl(); + if ( resourceId != 0 ) + { + // create and return a radio-button listbox + CCamCaptureSetupListBox* captureSetupControl = + new( ELeave ) CCamCaptureSetupListBox( this, + iController ); + + CleanupStack::PushL( captureSetupControl ); + captureSetupControl->ConstructL( aParent, resourceId, iSettingType ); + captureSetupControl->InitializeL + ( iController.IntegerSettingValue( iSettingType ) ); + CleanupStack::Pop( captureSetupControl ); + if( iSettingType == ECamSettingItemDynamicPhotoColourFilter || + iSettingType == ECamSettingItemDynamicPhotoWhiteBalance || + iSettingType == ECamSettingItemDynamicPhotoFlash || + iSettingType == ECamSettingItemDynamicPhotoImageSharpness || + + iSettingType == ECamSettingItemDynamicVideoColourFilter || + iSettingType == ECamSettingItemDynamicVideoWhiteBalance || + iSettingType == ECamSettingItemDynamicVideoFlash || + iSettingType == ECamSettingItemDynamicVideoBrightness || + + iSettingType == ECamSettingItemUserSceneImageSharpness || + iSettingType == ECamSettingItemUserSceneFlash || + iSettingType == ECamSettingItemUserSceneWhitebalance || + iSettingType == ECamSettingItemUserSceneColourFilter ) + { + captureSetupControl->DisableSingleClick( ETrue ); + } + // pass ownership of the control to the calling class + return captureSetupControl; + } + } + break; + } + return NULL; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::HandleSettingValueUpdateL +// Update the camera setting to the new value +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupControlHandler::HandleSettingValueUpdateL( TInt aNewValue ) + { + PRINT( _L("Camera => CCamCaptureSetupControlHandler::HandleSettingValueUpdateL" )) + iController.PreviewSettingChangeL( iSettingType, aNewValue ); + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::ControlTitleResourceId +// Return the resource id of the text to display in the title pane +// ----------------------------------------------------------------------------- +// +TInt CCamCaptureSetupControlHandler::ControlTitleResourceId() const + { + TInt resourceId = 0; + switch ( iSettingType ) + { + case ECamSettingItemDynamicPhotoWhiteBalance: // fallthrough + case ECamSettingItemDynamicVideoWhiteBalance: + case ECamSettingItemUserSceneWhitebalance: + { + resourceId = R_CAM_CAPTURE_SETUP_TITLE_NAME_WHITEBALANCE; + } + break; + case ECamSettingItemDynamicVideoColourFilter: // fallthrough + case ECamSettingItemDynamicPhotoColourFilter: + case ECamSettingItemUserSceneColourFilter: + { + resourceId = R_CAM_CAPTURE_SETUP_TITLE_NAME_COLOUREFFECT; + } + break; + + case ECamSettingItemDynamicPhotoExposure: + case ECamSettingItemUserSceneExposure: + { + resourceId = R_CAM_CAPTURE_SETUP_TITLE_NAME_EV; + } + break; + + case ECamSettingItemDynamicPhotoFlash: + case ECamSettingItemUserSceneFlash: + { + resourceId = R_CAM_CAPTURE_SETUP_TITLE_NAME_FLASH; + } + break; + case ECamSettingItemDynamicPhotoBrightness: + case ECamSettingItemDynamicVideoBrightness: + case ECamSettingItemUserSceneBrightness: + { + resourceId = R_CAM_CAPTURE_SETUP_TITLE_NAME_BRIGHTNESS; + } + break; + case ECamSettingItemDynamicPhotoContrast: + case ECamSettingItemDynamicVideoContrast: + case ECamSettingItemUserSceneContrast: + { + resourceId = R_CAM_CAPTURE_SETUP_TITLE_NAME_CONTRAST; + } + break; + case ECamSettingItemDynamicPhotoImageSharpness: + case ECamSettingItemUserSceneImageSharpness: + { + resourceId = R_CAM_CAPTURE_SETUP_TITLE_NAME_IMAGESHARPNESS; + } + break; + case ECamSettingItemDynamicSelfTimer: + { + resourceId = R_CAM_CAPTURE_SETUP_TITLE_NAME_SELF_TIMER; + break; + } + case ECamSettingItemUserSceneLightSensitivity: + case ECamSettingItemDynamicPhotoLightSensitivity: + case ECamSettingItemDynamicVideoLightSensitivity: + { + resourceId = R_CAM_CAPTURE_SETUP_TITLE_NAME_LIGHT_SENSITIVITY; + } + break; + default: + break; + } + return resourceId; + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::ControlPositionResourceId +// Return the resource id for the control's position. +// ----------------------------------------------------------------------------- +// +TInt CCamCaptureSetupControlHandler::ControlPositionResourceId() const + { + TInt resourceId = 0; + switch ( iSettingType ) + { + case ECamSettingItemDynamicPhotoWhiteBalance: // fallthrough + case ECamSettingItemDynamicVideoWhiteBalance: + case ECamSettingItemDynamicVideoColourFilter: + case ECamSettingItemDynamicPhotoColourFilter: + case ECamSettingItemDynamicPhotoFlash: + case ECamSettingItemDynamicSelfTimer: + case ECamSettingItemUserSceneWhitebalance: + case ECamSettingItemUserSceneColourFilter: + case ECamSettingItemUserSceneFlash: + case ECamSettingItemDynamicPhotoImageSharpness: + case ECamSettingItemUserSceneImageSharpness: + case ECamSettingItemUserSceneLightSensitivity: + case ECamSettingItemDynamicPhotoLightSensitivity: + case ECamSettingItemDynamicVideoLightSensitivity: + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + resourceId = ROID(R_CAM_CAPTURE_SETUP_CONTROL_POSITION_ID); + } + else + { + resourceId = ROID(R_CAM_CAPTURE_SETUP_CONTROL_POSITION_AH_ID); + } + } + break; + + case ECamSettingItemDynamicPhotoExposure: // fallthrough + case ECamSettingItemUserSceneExposure: + + case ECamSettingItemDynamicPhotoBrightness: + case ECamSettingItemDynamicVideoBrightness: + case ECamSettingItemDynamicPhotoContrast: + case ECamSettingItemDynamicVideoContrast: + case ECamSettingItemUserSceneBrightness: + case ECamSettingItemUserSceneContrast: + + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + resourceId = ROID(R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION_ID); + } + else + { + resourceId = ROID(R_CAM_CAPTURE_SETUP_SLIDER_CONTROL_POSITION_AH_ID); + } + break; + } + default: + break; + } + return resourceId; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::ControlUsesViewFinder +// Whether or not the control requires a viewfinder preview pane +// ----------------------------------------------------------------------------- +// +TBool CCamCaptureSetupControlHandler::ControlUsesViewFinder() const + { + return ( ( iSettingType != ECamSettingItemDynamicPhotoFlash ) && + ( iSettingType != ECamSettingItemUserSceneFlash ) && + ( iSettingType != ECamSettingItemDynamicSelfTimer )); + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::ControlIsListBox +// Whether or not the control is of listbox type +// ----------------------------------------------------------------------------- +// +TBool CCamCaptureSetupControlHandler::ControlIsListBox() const + { + return ( ( iSettingType != ECamSettingItemDynamicPhotoExposure ) + && ( iSettingType != ECamSettingItemUserSceneExposure ) + && ( iSettingType != ECamSettingItemDynamicPhotoBrightness ) + && ( iSettingType != ECamSettingItemDynamicPhotoContrast ) + && ( iSettingType != ECamSettingItemDynamicVideoBrightness ) + && ( iSettingType != ECamSettingItemDynamicVideoContrast ) + && ( iSettingType != ECamSettingItemUserSceneBrightness ) + && ( iSettingType != ECamSettingItemUserSceneContrast ) + ); + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::ControlIsSlider +// Whether or not the control is of slider type +// ----------------------------------------------------------------------------- +// +TBool CCamCaptureSetupControlHandler::ControlIsSlider() const + { + return ( ( iSettingType == ECamSettingItemDynamicPhotoExposure ) + || ( iSettingType == ECamSettingItemUserSceneExposure ) + || ( iSettingType == ECamSettingItemDynamicPhotoBrightness ) + || ( iSettingType == ECamSettingItemDynamicPhotoContrast ) + || ( iSettingType == ECamSettingItemDynamicVideoBrightness ) + || ( iSettingType == ECamSettingItemDynamicVideoContrast ) + || ( iSettingType == ECamSettingItemUserSceneBrightness ) + || ( iSettingType == ECamSettingItemUserSceneContrast ) + ); + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::ResourceForControl +// Return the resource for list population +// ----------------------------------------------------------------------------- +// +TInt CCamCaptureSetupControlHandler::ResourceForControl() const + { + TInt resourceId = 0; + switch ( iSettingType ) + { + case ECamSettingItemDynamicPhotoWhiteBalance:// fallthrough + case ECamSettingItemUserSceneWhitebalance: + resourceId = ROID(R_CAM_CAPTURE_SETUP_LIST_STILL_WHITEBALANCE_ID); + break; + case ECamSettingItemDynamicPhotoColourFilter:// fallthrough + case ECamSettingItemUserSceneColourFilter: + resourceId = ROID(R_CAM_CAPTURE_SETUP_LIST_STILL_COLOUREFFECT_ID); + break; + case ECamSettingItemDynamicPhotoFlash:// fallthrough + case ECamSettingItemUserSceneFlash: + resourceId = ROID(R_CAM_CAPTURE_SETUP_LIST_STILL_FLASH_ID); + break; + case ECamSettingItemDynamicVideoWhiteBalance: + resourceId = ROID(R_CAM_CAPTURE_SETUP_LIST_VIDEO_WHITEBALANCE_ID); + break; + case ECamSettingItemDynamicVideoColourFilter: + resourceId = ROID(R_CAM_CAPTURE_SETUP_LIST_VIDEO_COLOUREFFECT_ID); + break; + case ECamSettingItemDynamicPhotoImageSharpness: + case ECamSettingItemUserSceneImageSharpness: + resourceId = ROID(R_CAM_CAPTURE_SETUP_LIST_PHOTO_IMAGESHARPNESS_ID); + break; + case ECamSettingItemDynamicSelfTimer: + resourceId = ROID(R_CAM_CAPTURE_SETUP_SELF_TIMER_ID); + break; + case ECamSettingItemUserSceneLightSensitivity: + case ECamSettingItemDynamicPhotoLightSensitivity: + case ECamSettingItemDynamicVideoLightSensitivity: + if ( iController.UiConfigManagerPtr()->IsExtendedLightSensitivitySupported()) + { + resourceId = R_CAM_CAPTURE_SETUP_STILL_EXTENDED_LIGHT_SENSITIVITY; + } + else + { + resourceId = R_CAM_CAPTURE_SETUP_STILL_LIGHT_SENSITIVITY; + } + break; + default: + break; + } + return resourceId; + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::ViewfinderResourceId +// Return the viewfinder resource to use for the appropriate control +// ----------------------------------------------------------------------------- +// +TInt CCamCaptureSetupControlHandler::ViewfinderResourceId() const + { + TInt resourceId = 0; + switch ( iSettingType ) + { + case ECamSettingItemDynamicPhotoBrightness: + case ECamSettingItemDynamicVideoBrightness: + case ECamSettingItemDynamicPhotoContrast: + case ECamSettingItemDynamicVideoContrast: + case ECamSettingItemUserSceneBrightness: + case ECamSettingItemUserSceneContrast: + case ECamSettingItemDynamicPhotoExposure: + case ECamSettingItemDynamicVideoExposure: + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + resourceId = ROID(R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT_ID); + } + else + { + resourceId = ROID(R_CAM_CAPTURE_SETUP_SLIDER_CONTVF_RECT_AH_ID); + } + } + break; + default: + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + resourceId = ROID(R_CAM_CAPTURE_SETUP_CONTVF_RECT_ID); + } + else + { + resourceId = ROID(R_CAM_CAPTURE_SETUP_CONTVF_RECT_AH_ID); + } + } + break; + } + return resourceId; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupControlHandler::SettingType +// Identifies which setting is being edited +// ----------------------------------------------------------------------------- +// +TCamSettingItemIds CCamCaptureSetupControlHandler::SettingType() const + { + return iSettingType; + } + + +// End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCaptureSetupMenu.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCaptureSetupMenu.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,337 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for the capture setup menu list box.* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include + +#include +#include + +#include "CamCaptureSetupMenu.h" +#include "CamCaptureSetupMenuListBox.h" +#include "CamAppController.h" +#include "CamPanic.h" +#include "CamSettings.hrh" +#include "Cam.hrh" +#include "camlogging.h" + +const TInt KNumComponentComtrols = 1; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCamCaptureSetupMenu::NewL +// Two-phased constructor. +// --------------------------------------------------------- +// +CCamCaptureSetupMenu* CCamCaptureSetupMenu::NewL( + CCamAppController& aController, + CAknView& aView, + const TRect& aRect, + TInt aResourceId, + TInt aSelectedItemIndex ) + { + CCamCaptureSetupMenu* self = new( ELeave ) CCamCaptureSetupMenu + ( aController, aView ); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aResourceId, aSelectedItemIndex ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// Destructor +// --------------------------------------------------------- +// +CCamCaptureSetupMenu::~CCamCaptureSetupMenu() + { + PRINT( _L("Camera => ~CCamCaptureSetupMenu") ); + delete iCaptureSetupListBox; + // iBgContext is deleted in base class + PRINT( _L("Camera <= ~CCamCaptureSetupMenu") ); + } + +// --------------------------------------------------------- +// Returns the list index of the currently selected item. +// --------------------------------------------------------- +// +TInt CCamCaptureSetupMenu::CurrentItemIndex() const + { + return iCaptureSetupListBox->CurrentItemIndex(); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupMenu::FadeBehind +// Fades everything behind this menu. +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupMenu::FadeBehind( TBool aFade ) + { + iPopupFader.FadeBehindPopup( this, this, aFade ); + } + + +// --------------------------------------------------------------------------- +// CCamCaptureSetupMenu::CountFadedComponents +// Returns the number of components that are not faded +// when the fader object is active. +// --------------------------------------------------------------------------- +// +TInt CCamCaptureSetupMenu::CountFadedComponents() + { + return KNumComponentComtrols; + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupMenu::FadedComponent +// Returns a pointer to a non-faded component. +// --------------------------------------------------------------------------- +// +CCoeControl* CCamCaptureSetupMenu::FadedComponent(TInt aIndex) + { + switch (aIndex) + { + case 0: + return this; + default: + return NULL; + } + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupMenu::HandleCommandL +// Handle commands +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupMenu::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case EAknSoftkeySelect: + { + HandleSelectionL(); + break; + } + default: + { + CamPanic( ECamPanicUnhandledCommand ); + break; + } + } + } + + + +// --------------------------------------------------------- +// C++ constructor +// --------------------------------------------------------- +// +CCamCaptureSetupMenu::CCamCaptureSetupMenu( CCamAppController& aController, + CAknView& aView ) +: CCamContainerBase( aController, aView ) + { + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenu::ConstructL() +// 2nd phase constructor +// --------------------------------------------------------- +// +void CCamCaptureSetupMenu::ConstructL( const TRect& aRect, TInt aResourceId, TInt aSelectedItemIndex ) + { + CreateWindowL(); + TRect listBoxRect = aRect; + CreateCaptureSetupListBoxL( listBoxRect, aResourceId, aSelectedItemIndex ); + SetRect( listBoxRect ); + // set up the skin background context + iBgContext = CAknsFrameBackgroundControlContext::NewL( + KAknsIIDQsnFrPopup, Rect(), Rect(), EFalse ); + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenu::CountComponentControls() const +// --------------------------------------------------------- +// +TInt CCamCaptureSetupMenu::CountComponentControls() const + { + // this control contains a listbox + return 1; + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenu::ComponentControl(TInt aIndex) const +// --------------------------------------------------------- +// +CCoeControl* CCamCaptureSetupMenu::ComponentControl(TInt /*aIndex*/) const + { + return iCaptureSetupListBox; + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenu::Draw(const TRect& aRect) const +// --------------------------------------------------------- +// +void CCamCaptureSetupMenu::Draw(const TRect& /*aRect*/) const + { + } + +// ---------------------------------------------------- +// CCamCaptureSetupMenu::OfferKeyEventL +// Handles this application view's command keys. Forwards +// other keys to child control(s). +// ---------------------------------------------------- +// +TKeyResponse CCamCaptureSetupMenu::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // now it's iListBox's job to process the key event + TKeyResponse response = iCaptureSetupListBox->OfferKeyEventL( aKeyEvent, aType ); + // If it hasn't been processed pass up to the base class. + if ( response == EKeyWasNotConsumed ) + { + return CCamContainerBase::OfferKeyEventL( aKeyEvent, aType ); + } + + iController.StartIdleTimer(); + return response; + } + +// ---------------------------------------------------- +// CCamCaptureSetupMenu::CreateCaptureSetupListBoxL +// Creates the list box control. +// ---------------------------------------------------- +// +void +CCamCaptureSetupMenu::CreateCaptureSetupListBoxL( TRect& aRect, TInt aResourceId, TInt aSelectedItemIndex ) + { + PRINT( _L("Camera => CCamCaptureSetupMenu::CreateCaptureSetupListBoxL") ); + // Determine the complete drawing rectangle. + TRect appUiRect = aRect; + appUiRect.iTl.iX = 0; + appUiRect.iTl.iY = 0; + + // Create the resource reader for this list box. + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResourceId ); + + // Read the layout for the list box. + TAknLayoutRect listBoxLayoutRect; + listBoxLayoutRect.LayoutRect( aRect, reader ); + + // Create the listbox. + iCaptureSetupListBox = CCamCaptureSetupMenuListBox::NewL + ( this, reader, iController, aSelectedItemIndex ); + + aRect = listBoxLayoutRect.Rect(); + + // Set the layout for the list box control. + const AknLayoutUtils::SAknLayoutControl listboxLayout = + { ELayoutEmpty, 0, 0, ELayoutEmpty, ELayoutEmpty, aRect.Width(), aRect.Height() }; + AknLayoutUtils::LayoutControl( iCaptureSetupListBox, appUiRect, listboxLayout ); + + // Set the height of a list item + TInt listItemHeight = reader.ReadInt16(); + iCaptureSetupListBox->SetItemHeightL( listItemHeight ); + + iCaptureSetupListBox->MakeVisible( ETrue ); + iCaptureSetupListBox->SetFocus( EFalse, EDrawNow ); + + CleanupStack::PopAndDestroy(); // reader + PRINT( _L("Camera <= CCamCaptureSetupMenu::CreateCaptureSetupListBoxL") ); + } + +// ---------------------------------------------------- +// CCamCaptureSetupMenu::CommandIdForActivatingCurrentItemControl +// Returns the command id for activating the current list item control. +// ---------------------------------------------------- +// +TInt CCamCaptureSetupMenu::CommandIdForActivatingCurrentItemControl() + { + // Get the index of the currently selected item. + TInt selectedItemIndex = iCaptureSetupListBox->CurrentItemIndex(); + // Get the setting model id for the currently selected item. + TInt selectedItemSettingsId = iCaptureSetupListBox->ItemSettingsId( selectedItemIndex ); + // Convert settings model id to command id that activates the + // control for the selected item. + TInt commandId = -1; + switch ( selectedItemSettingsId ) + { + case ECamSettingItemDynamicPhotoScene: + commandId = ECamCmdCaptureSetupSceneStill; + break; + case ECamSettingItemDynamicPhotoWhiteBalance: + commandId = ECamCmdCaptureSetupWhiteBalanceStill; + break; + + case ECamSettingItemDynamicPhotoExposure: + commandId = ECamCmdCaptureSetupExposureStill; + break; + + case ECamSettingItemDynamicPhotoColourFilter: + commandId = ECamCmdCaptureSetupColourFilterStill; + break; + case ECamSettingItemDynamicPhotoFlash: + commandId = ECamCmdCaptureSetupFlashStill; + break; + case ECamSettingItemDynamicVideoScene: + commandId = ECamCmdCaptureSetupSceneVideo; + break; + case ECamSettingItemDynamicVideoWhiteBalance: + commandId = ECamCmdCaptureSetupWhiteBalanceVideo; + break; + case ECamSettingItemDynamicVideoColourFilter: + commandId = ECamCmdCaptureSetupColourFilterVideo; + break; + case ECamSettingItemDynamicPhotoBrightness: + commandId = ECamCmdCaptureSetupBrightnessStill; + break; + case ECamSettingItemDynamicPhotoContrast: + commandId = ECamCmdCaptureSetupContrastStill; + break; + case ECamSettingItemDynamicVideoBrightness: + commandId = ECamCmdCaptureSetupBrightnessVideo; + break; + case ECamSettingItemDynamicVideoContrast: + commandId = ECamCmdCaptureSetupContrastVideo; + break; + case ECamSettingItemDynamicPhotoImageSharpness: + commandId = ECamCmdCaptureSetupImageSharpnessStill; + break; + default: + CamPanic( ECamPanicCaptureSetupMenuUnknownItem ); + } + return commandId; + } + +// ---------------------------------------------------- +// CCamCaptureSetupMenu::HandleSelectionL +// Handles the pressing of the softkey selection. +// ---------------------------------------------------- +// +void CCamCaptureSetupMenu::HandleSelectionL() + { + TInt CommandId = CommandIdForActivatingCurrentItemControl(); + iView.HandleCommandL( CommandId ); + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCaptureSetupMenuListBox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCaptureSetupMenuListBox.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Encapsulates the capture setup menu list box.* +*/ + + +// INCLUDE FILES +#include +#include + +#include +#include + +#include "CamCaptureSetupMenuListBox.h" +#include "CamCaptureSetupMenuListBoxModel.h" +#include "CamCaptureSetupMenuListItemDrawer.h" +#include "camlogging.h" + + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// NewL +// Two-phased constructor. +// Returns: CCamCaptureSetupMenuListBox*: Pointer to the created list item. +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupMenuListBox* CCamCaptureSetupMenuListBox::NewL( + const CCoeControl* aParent, // container for this list box + TResourceReader& aReader, // used to populate the list box + CCamAppController& aController, // used by the list box model to get list item values + TInt aSelectedItemIndex ) + { + CCamCaptureSetupMenuListBox* self = new( ELeave ) CCamCaptureSetupMenuListBox; + CleanupStack::PushL( self ); + self->ConstructL( aParent, aReader, aController,aSelectedItemIndex ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupMenuListBox::~CCamCaptureSetupMenuListBox() + { + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBox::ItemSettingsId() +// Returns the settings model id that corresponds with the +// specified list item index. +// --------------------------------------------------------- +// +TInt CCamCaptureSetupMenuListBox::ItemSettingsId( TInt aItemIndex ) + { + return static_cast( iModel ) + ->SettingsModelIdAssociatedWithItem( aItemIndex ); + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBox::MakeViewClassInstanceL() +// This method creates instance of CCamCaptureSetupMenuListBoxView +// --------------------------------------------------------- +// +CListBoxView* CCamCaptureSetupMenuListBox::MakeViewClassInstanceL() + { + return new( ELeave ) CListBoxView; + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBox::OfferKeyEventL +// Handles a user pressing the key. +// --------------------------------------------------------- +// +TKeyResponse CCamCaptureSetupMenuListBox::OfferKeyEventL( + const TKeyEvent& aKeyEvent, // The key event + TEventCode aType) // The type of key event + { + // If the navikey select has been pressed don't process it. + if ( aType == EEventKey && aKeyEvent.iCode == EKeyOK ) + { + return EKeyWasNotConsumed; // indicate that not been processed. + } + + return CEikListBox::OfferKeyEventL( aKeyEvent, aType ); + } + +// --------------------------------------------------------- +// Constructor +// --------------------------------------------------------- +// +CCamCaptureSetupMenuListBox::CCamCaptureSetupMenuListBox( ) + { + } + +// --------------------------------------------------------- +// 2nd phase constructor +// --------------------------------------------------------- +// +void CCamCaptureSetupMenuListBox::ConstructL( + const CCoeControl* aParent, // container for this list box + TResourceReader& aReader, // resource reader that will be used to populate the list box + CCamAppController& aController, // used by the list box model to get list item values + TInt aSelectedItemIndex ) + { + // Set the container window to be the parent. + CEikListBox::SetContainerWindowL( *aParent ); + + // Create the model for the list box. + CCamCaptureSetupMenuListBoxModel* model = + CCamCaptureSetupMenuListBoxModel::NewLC( aController, aReader ); + + // Create the item drawer for the list box. + CCamCaptureSetupMenuListItemDrawer* itemDrawer = + CCamCaptureSetupMenuListItemDrawer::NewL( model, aReader ); + itemDrawer->SetParentControl( aParent ); + + // Transfering ownership to CEikListBox. + // Do not need the model or drawer on the cleanup stack when call ConstructL, + // because CEikListBox assigns objects as member variables before + // ConstructL calls any leaving functions. + CleanupStack::Pop( model ); + CEikListBox::ConstructL( model, itemDrawer, aParent, EAknListBoxMarkableList ); + + // Set the border style. + iBorder = TGulBorder::EDeepRaised; + + // Set the selected item index + iView->SetCurrentItemIndex( aSelectedItemIndex ); + } + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCaptureSetupMenuListBoxModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCaptureSetupMenuListBoxModel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,191 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model class of capture setup menu list box.* +*/ + + +// INCLUDE FILES +#include +#include +#include "CamCaptureSetupMenuListBoxModel.h" +#include "CamAppController.h" +#include "CamCaptureSetupMenuListItem.h" +#include "CamPanic.h" +#include "camlogging.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBoxModel::NewLC +// Returns CCamCaptureSetupMenuListBoxModel*: Pointer to the created model. +// --------------------------------------------------------- +// +CCamCaptureSetupMenuListBoxModel* CCamCaptureSetupMenuListBoxModel::NewLC( + CCamAppController& aController, + TResourceReader& aReader ) + { + CCamCaptureSetupMenuListBoxModel* self = + new( ELeave ) CCamCaptureSetupMenuListBoxModel( aController ); + CleanupStack::PushL( self ); + self->ConstructFromResourceL( aReader ); + return self; + } + +// --------------------------------------------------------- +// Destructor +// --------------------------------------------------------- +// +CCamCaptureSetupMenuListBoxModel::~CCamCaptureSetupMenuListBoxModel() + { + PRINT( _L("Camera => ~CCamCaptureSetupMenuListBoxModel") ); + iListItemPtrArray.ResetAndDestroy(); + iListItemPtrArray.Close(); + PRINT( _L("Camera <= ~CCamCaptureSetupMenuListBoxModel") ); + } + +// ----------------------------------------------------------------------------- +// ItemHasIconText +// Returns whether the current item has icon text. +// ----------------------------------------------------------------------------- +// +TBool CCamCaptureSetupMenuListBoxModel::ItemHasIconText( TInt aItemIndex ) const + { + const TInt settingVal = iController.IntegerSettingValue( + iListItemPtrArray[aItemIndex]->SettingsModelItemId() ); + return iListItemPtrArray[aItemIndex]->IconText( settingVal ).Length() > 0; + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBoxModel::BitmapForItem() +// Returns a pointer to the bitmap associated with a specific list item. +// --------------------------------------------------------- +// +CFbsBitmap* CCamCaptureSetupMenuListBoxModel::BitmapForItem( + TInt aItemIndex, TBool aMask ) + { + // If the value in the settings model for this list item has changed + // since the last time we asked for a bitmap, then let list item know + // what it has changed to. + TInt itemCurrentValue = iListItemPtrArray[aItemIndex]->CurrentValue(); + TInt itemSettingsModelItemId = + iListItemPtrArray[aItemIndex]->SettingsModelItemId(); + TInt itemNewValue = iController.IntegerSettingValue( + itemSettingsModelItemId ); + if ( itemCurrentValue != itemNewValue ) + { + iListItemPtrArray[aItemIndex]->SetValueTo( itemNewValue ); + } + // Return the bitmap that represents the list item value. + if ( aMask ) + { + return iListItemPtrArray[aItemIndex]->Mask(); + } + else + { + return iListItemPtrArray[aItemIndex]->Bitmap(); + } + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBoxModel::TextForItem() const +// Returns the text associated with a specific list item. +// --------------------------------------------------------- +// +const TDesC& CCamCaptureSetupMenuListBoxModel::TextForItem( + TInt aItemIndex ) const + { + return iListItemPtrArray[aItemIndex]->Text(); + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBoxModel::IconTextForItem() const +// Returns the text to be used in place of an icon for a particular list item. +// --------------------------------------------------------- +// +const TDesC& CCamCaptureSetupMenuListBoxModel::IconTextForItem( + TInt aItemIndex ) const + { + const TInt settingVal = iController.IntegerSettingValue( + iListItemPtrArray[aItemIndex]->SettingsModelItemId() ); + return iListItemPtrArray[aItemIndex]->IconText( settingVal ); + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBoxModel::SettingsModelIdAssociatedWithItem() const +// Returns the settings model id associated with a particular list item. +// --------------------------------------------------------- +// +TInt CCamCaptureSetupMenuListBoxModel::SettingsModelIdAssociatedWithItem +( TInt aItemIndex ) const + { + return iListItemPtrArray[aItemIndex]->SettingsModelItemId(); + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBoxModel::NumberOfItems() const +// Returns number of items that are in array +// --------------------------------------------------------- +// +TInt CCamCaptureSetupMenuListBoxModel::NumberOfItems() const + { + return iListItemPtrArray.Count(); + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBoxModel::MatchableTextArray() const +// Returns pointer to MDesCArray +// --------------------------------------------------------- +// +const MDesCArray* CCamCaptureSetupMenuListBoxModel::MatchableTextArray() const + { + return iMatchableTextArray; + } + +// --------------------------------------------------------- +// Constructor +// --------------------------------------------------------- +// +CCamCaptureSetupMenuListBoxModel::CCamCaptureSetupMenuListBoxModel +( CCamAppController& aController ) +: iController( aController ) + { + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListBoxModel::ConstructFromResourceL() +// 2nd phase constructor. +// --------------------------------------------------------- +// +void CCamCaptureSetupMenuListBoxModel::ConstructFromResourceL( + TResourceReader& aReader ) + { + // Create all list items from the resource reader. + TInt itemCount = aReader.ReadInt16(); + TInt i; + for ( i = 0; i < itemCount; ++i ) + { + // Create a list item from the resource at current reading position. + CCamCaptureSetupMenuListItem* newListItem = + CCamCaptureSetupMenuListItem::NewL( aReader ); + + // Add it to the array of list items. + CleanupStack::PushL( newListItem ); + User::LeaveIfError( iListItemPtrArray.Append( newListItem ) ); + CleanupStack::Pop( newListItem ); + } + } + + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCaptureSetupMenuListItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCaptureSetupMenuListItem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,288 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Encapsulates the data for a particular Capture Setup Menu item.* +*/ + + + +// INCLUDE FILES +#include "CamCaptureSetupMenuListItem.h" +#include "CamUtility.h" +#include +#include // For CCoeAppUiBase +#include // For CEikApplication +#include +#include + +const TInt KIconTextGranularity = 2; + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// NewL +// Two-phased constructor. +// Returns: CCamCaptureSetupMenuListItem*: Pointer to the created list item. +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupMenuListItem* CCamCaptureSetupMenuListItem::NewL( + TResourceReader& aReader ) // Used to read/construct data for this list item. + { + CCamCaptureSetupMenuListItem* self = + new (ELeave ) CCamCaptureSetupMenuListItem(); + CleanupStack::PushL( self ); + self->ConstructFromResourceL( aReader ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::~CCamCaptureSetupMenuListItem +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupMenuListItem::~CCamCaptureSetupMenuListItem() + { + PRINT( _L("Camera => ~CCamCaptureSetupMenuListItem") ); + + delete iIconTexts; + iIconTexts = NULL; + + // Destroy bitmap array. + iBitmaps.ResetAndDestroy(); + iBitmaps.Close(); + iMasks.ResetAndDestroy(); + iMasks.Close(); + PRINT( _L("Camera <= ~CCamCaptureSetupMenuListItem") ); + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::Bitmap +// Returns the bitmap that represents the current settings model +// value for this list item. +// Returns: CFbsBitmap*: Pointer to the bitmap. +// ----------------------------------------------------------------------------- +// +CFbsBitmap* CCamCaptureSetupMenuListItem::Bitmap() const + { + return iBitmaps[iCurrentSettingItemValueId]; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::Mask +// Returns the bitmap that represents the current settings model +// value for this list item. +// Returns: CFbsBitmap*: Pointer to the bitmap. +// ----------------------------------------------------------------------------- +// +CFbsBitmap* CCamCaptureSetupMenuListItem::Mask() const + { + return iMasks[iCurrentSettingItemValueId]; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::IconText +// Returns text used in place of an icon for this list item. +// Returns: Ref to the icon text. +// ----------------------------------------------------------------------------- +// +const TDesC& CCamCaptureSetupMenuListItem::IconText( TInt aSettingVal ) const + { + if ( iSettingsModelItemId == ECamSettingItemDynamicPhotoBrightness || + iSettingsModelItemId == ECamSettingItemDynamicVideoBrightness || + iSettingsModelItemId == ECamSettingItemDynamicPhotoContrast || + iSettingsModelItemId == ECamSettingItemDynamicVideoContrast ) + { + // get the array index if this item is brightness or contrast + GetBrightnessContrastArrayIndex( aSettingVal ); + } + + return (*iIconTexts)[aSettingVal]; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::Text +// Returns text that describes the setting represented by this list item. +// Returns: Ref to the item text. +// ----------------------------------------------------------------------------- +// +const TDesC& CCamCaptureSetupMenuListItem::Text() const + { + return iText; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::CurrentValue +// Returns the cached settings model value that the current bitmap represents. +// Returns: TInt: The current value. +// ----------------------------------------------------------------------------- +// +TInt CCamCaptureSetupMenuListItem::CurrentValue() const + { + return iCurrentSettingItemValueId; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::SettingsModelItemId +// Returns the id of the settings model item that this list item represents. +// Returns: TInt: The settings model item id. +// ----------------------------------------------------------------------------- +// +TInt CCamCaptureSetupMenuListItem::SettingsModelItemId() const + { + return iSettingsModelItemId; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::SetValueTo +// Changes the cached settings model value and the bitmap that represents it. +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupMenuListItem::SetValueTo( + TInt aNewValueId ) // the new cached settings model value. + { + if ( iSettingsModelItemId == ECamSettingItemDynamicPhotoBrightness || + iSettingsModelItemId == ECamSettingItemDynamicVideoBrightness || + iSettingsModelItemId == ECamSettingItemDynamicPhotoContrast || + iSettingsModelItemId == ECamSettingItemDynamicVideoContrast ) + { + // get the array index if this item is brightness or contrast + GetBrightnessContrastArrayIndex( aNewValueId ); + } + + iCurrentSettingItemValueId = aNewValueId; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::CCamCaptureSetupMenuListItem +// C++ default constructor. +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupMenuListItem::CCamCaptureSetupMenuListItem() + { + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::ConstructFromResourceL +// 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void +CCamCaptureSetupMenuListItem::ConstructFromResourceL( + TResourceReader& aReader ) // reader that is used to construct the data + { + PRINT( _L("Camera => CCamCaptureSetupMenuListItem::ConstructFromResourceL") ); + delete iIconTexts; + iIconTexts = NULL; + iIconTexts = new (ELeave) CArrayFixFlat( KIconTextGranularity ); + + // Get the full path for the mbm file + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + + // Create a resource reader for reading only this list items data. + TInt resourceID = aReader.ReadInt32(); + TResourceReader localReader; + CEikonEnv::Static()->CreateResourceReaderLC( localReader, resourceID ); + + // Read the data for this list item from resource. + // ...get setting model item id for associated with this list item. + iSettingsModelItemId = localReader.ReadInt16(); + // ...get the text description of this list item. + iText = localReader.ReadTPtrC(); + // ...get the count of all possible values (bitmaps) + // ...that this list item can have, and repeatedly get the values. + TInt valuesCount = localReader.ReadInt16(); + TInt i; + for ( i = 0; i < valuesCount; ++i ) + { + // ...read the current value's settings model id. + TInt settingsModelId = localReader.ReadInt16(); + // ...read associated bitmap id for current value. + TInt bitmapId = localReader.ReadInt16(); + CFbsBitmap* newBitmap = NULL; + CFbsBitmap* mask = NULL; + if ( bitmapId != -1 ) + { + AknIconUtils::CreateIconLC( newBitmap, mask, resFileName, bitmapId, bitmapId ); + // ...add the bitmap to the array of bitmaps for this list item. + iBitmaps.InsertL( newBitmap, settingsModelId ); + iMasks.InsertL( mask, settingsModelId ); + // newBitmap, mask. Don't know the order of pushing so pop anonymously. + CleanupStack::Pop( 2 ); + } + else + { + // Add NULL bitmaps: + iBitmaps.InsertL( newBitmap, settingsModelId ); + iMasks.InsertL( mask, settingsModelId ); + } + + iIconTexts->InsertL( settingsModelId, localReader.ReadTPtrC() ); + } + + // Pop local resource reader. + CleanupStack::PopAndDestroy(); + PRINT( _L("Camera <= CCamCaptureSetupMenuListItem::ConstructFromResourceL") ) + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupMenuListItem::GetBrightnessContrastArrayIndex +// Returns the array position for brightness and contrast, as these controls +// can have negative values, so this maps to an index in the text/bitmaps arrays +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupMenuListItem::GetBrightnessContrastArrayIndex( TInt& aValue ) const + { + // if brightness or contrast settings - only display either + // the plus or negative icon. There isn't going to be an icon + // for each setting value as the values can range from -10 to +10 + if ( iSettingsModelItemId == ECamSettingItemDynamicPhotoBrightness || + iSettingsModelItemId == ECamSettingItemDynamicVideoBrightness ) + { + if ( aValue > 0 ) + { + aValue = ECamBrightnessPlus; + } + else if ( aValue < 0 ) + { + aValue = ECamBrightnessNeg; + } + else + { + aValue = ECamBrightnessNorm; + } + } + else if ( iSettingsModelItemId == ECamSettingItemDynamicPhotoContrast || + iSettingsModelItemId == ECamSettingItemDynamicVideoContrast ) + { + if ( aValue > 0 ) + { + aValue = ECamContrastPlus; + } + else if ( aValue < 0 ) + { + aValue = ECamContrastNeg; + } + else + { + aValue = ECamBrightnessNorm; + } + } + else // lint + { + } + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCaptureSetupMenuListItemDrawer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCaptureSetupMenuListItemDrawer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,240 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Draws a list item.* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include + +#include +#include + +#include "CamCaptureSetupMenuListItemDrawer.h" +#include "CamCaptureSetupMenuListBoxModel.h" + +#include "camlogging.h" + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// NewL +// Two-phased constructor. +// Returns: CCamCaptureSetupMenuListItemDrawer*: Pointer to the created list item drawer. +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupMenuListItemDrawer* CCamCaptureSetupMenuListItemDrawer::NewL( + CCamCaptureSetupMenuListBoxModel* aListBoxModel, // used to get content information about list item being drawn. + TResourceReader& aReader ) // used to read layout information about list items to be drawn. + { + CCamCaptureSetupMenuListItemDrawer* self = + new (ELeave) CCamCaptureSetupMenuListItemDrawer( aListBoxModel ); + CleanupStack::PushL( self ); + self->ConstructFromResourceL( aReader ); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListItemDrawer::DrawActualItem +// Draws item and highlights if needed +// --------------------------------------------------------- +// +void CCamCaptureSetupMenuListItemDrawer::DrawActualItem( + TInt aItemIndex, // index of item + const TRect& aActualItemRect, // rectangular area of item + TBool aItemIsCurrent, // ETrue if current item + TBool /*aViewIsEmphasized*/, // ETrue if emphasized + TBool /*aViewIsDimmed*/, // ETrue if dimmed + TBool /*aItemIsSelected*/ ) const // ETrue if selected + { + // Draw unhighlighted rectangle that encapsulates the item text and bitmap. + DrawItemRect( aActualItemRect ); + + // ...if the item is the current item highlight it. + if ( aItemIsCurrent ) + { + DrawHighlightedItemRect( aActualItemRect ); + } + + // Draw the text. + // ...Create a text layout object for drawing the text + // ...inside of the list item's rectangle. + TAknLayoutText layoutText; + layoutText.LayoutText( aActualItemRect, iLayoutDataForText ); + // get the text color from the skin + TRgb textColor; + MAknsSkinInstance *skin = AknsUtils::SkinInstance(); + // default is list item text colour + TAknsQsnTextColorsIndex index = EAknsCIQsnTextColorsCG7; + if( Flags() & CListItemDrawer::ESingleClickDisabledHighlight ) + { + aItemIsCurrent = EFalse; + } + if ( aItemIsCurrent ) + { + index = EAknsCIQsnTextColorsCG10; // list highlight text + } + AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, index ); + // ...Pass the text to be drawn, into the text layout object + // ...and draw it. + const TDesC& itemText = iModel->TextForItem( aItemIndex ); + layoutText.DrawText( *iGc, itemText, ETrue, textColor ); + + if ( !iModel->ItemHasIconText( aItemIndex ) ) + { + // Draw the bitmap. + // Create a rect layout object for drawing the bitmap + // inside of the list item's rectangle. + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( aActualItemRect, iLayoutDataForBitmap ); + // Pass the bitmap to be drawn, into the rect layout object and draw it. + CFbsBitmap* bitmap = iModel->BitmapForItem( aItemIndex, EFalse ); + CFbsBitmap* mask = iModel->BitmapForItem( aItemIndex, ETrue ); + + AknIconUtils::SetSize( bitmap, TSize( iLayoutDataForBitmap.iW, + iLayoutDataForBitmap.iH ), + EAspectRatioPreserved ); + + layoutRect.DrawImage( *iGc, bitmap, mask ); + } + else + { + const TDesC& iconText = iModel->IconTextForItem( aItemIndex ); + layoutText.LayoutText( aActualItemRect, iLayoutDataForIconText ); + layoutText.DrawText( *iGc, iconText, ETrue, textColor ); + } + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListItemDrawer::CCamCaptureSetupMenuListItemDrawer +// Constructor +// --------------------------------------------------------- +// +CCamCaptureSetupMenuListItemDrawer::CCamCaptureSetupMenuListItemDrawer( + CCamCaptureSetupMenuListBoxModel* aListBoxModel ) // used to get information about item that drawing. + :iModel( aListBoxModel ) + { + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListItemDrawer::~CCamCaptureSetupMenuListItemDrawer +// Destructor +// --------------------------------------------------------- +// +CCamCaptureSetupMenuListItemDrawer::~CCamCaptureSetupMenuListItemDrawer() + { + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListItemDrawer::ConstructL +// 2nd phase constructor +// --------------------------------------------------------- +// +void CCamCaptureSetupMenuListItemDrawer::ConstructFromResourceL +( TResourceReader& aReader ) + { + // Read the text layout from resource. + iLayoutDataForText.iFont = aReader.ReadInt16(); + iLayoutDataForText.iC = aReader.ReadInt16(); + iLayoutDataForText.iL = aReader.ReadInt16(); + iLayoutDataForText.iR = aReader.ReadInt16(); + iLayoutDataForText.iB = aReader.ReadInt16(); + iLayoutDataForText.iW = aReader.ReadInt16(); + iLayoutDataForText.iJ = aReader.ReadInt16(); + + // Read the text layout from resource. + iLayoutDataForBitmap.iC = aReader.ReadInt16(); + iLayoutDataForBitmap.iL = aReader.ReadInt16(); + iLayoutDataForBitmap.iT = aReader.ReadInt16(); + iLayoutDataForBitmap.iR = aReader.ReadInt16(); + iLayoutDataForBitmap.iB = aReader.ReadInt16(); + iLayoutDataForBitmap.iW = aReader.ReadInt16(); + iLayoutDataForBitmap.iH = aReader.ReadInt16(); + + // Read the icon text layout from resource. + iLayoutDataForIconText.iFont = aReader.ReadInt16(); + iLayoutDataForIconText.iC = aReader.ReadInt16(); + iLayoutDataForIconText.iL = aReader.ReadInt16(); + iLayoutDataForIconText.iR = aReader.ReadInt16(); + iLayoutDataForIconText.iB = aReader.ReadInt16(); + iLayoutDataForIconText.iW = aReader.ReadInt16(); + iLayoutDataForIconText.iJ = aReader.ReadInt16(); + + // Read the highlight offset amount from resource. + iHighlightOffset = aReader.ReadInt16(); + } + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListItemDrawer::DrawHighlightedRect +// Draws a highlighted rectangle +// --------------------------------------------------------- +// +void CCamCaptureSetupMenuListItemDrawer::DrawHighlightedItemRect( + const TRect& aActualItemRect ) // the rectangular area to be highlighted + const + { + if( Flags() & CListItemDrawer::ESingleClickDisabledHighlight ) + { + return; + } + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + TRect innerRect( aActualItemRect ); + innerRect.Shrink( iHighlightOffset, iHighlightOffset ); + AknsDrawUtils::DrawFrame( skin, *iGc, aActualItemRect, innerRect, + KAknsIIDQsnFrList, KAknsIIDDefault ); + } + + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListItemDrawer::DrawItemRect +// Draws a rectangle for an item. +// --------------------------------------------------------- +// +void CCamCaptureSetupMenuListItemDrawer::DrawItemRect( + const TRect& aActualItemRect ) // the rectangular area to be drawn + const + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext *cc = AknsDrawUtils::ControlContext( iParentControl ); + AknsDrawUtils::Background( skin, cc, iParentControl, *iGc, aActualItemRect ); +#if 0 + iGc->SetBrushColor( KRgbRed ); + iGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + iGc->SetPenStyle( CGraphicsContext::ENullPen ); // shadow drawn later + iGc->DrawRect( aActualItemRect ); +#endif + } + + +// --------------------------------------------------------- +// CCamCaptureSetupMenuListItemDrawer::SetControl +// Sets the parent control of the listbox +// --------------------------------------------------------- +// +void CCamCaptureSetupMenuListItemDrawer::SetParentControl( + const CCoeControl* aControl ) + { + iParentControl = aControl; + } + +//End of file + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCaptureSetupSlider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCaptureSetupSlider.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1023 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for showing the EV slider* +*/ + + + +// INCLUDE FILES +#include "CamCaptureSetupSlider.h" +#include "CamPanic.h" // Panic codes +#include "CamUtility.h" +#include "CamAppUi.h" +#include "CamPSI.h" +#include "camconfiguration.h" +#include "CameraUiConfigManager.h" + +#include +#include +#include +#include +#include +#include // For CCoeAppUiBase +#include // For CEikApplication +#include // resource reader +#include +#include +#include + +#include +#include +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +const TInt KDivisorFactor = 1024; // Avoids using TReal maths, use factor of 2 + +// Contrast slider value indexes +const TInt KContrastPlusInd = 0; +const TInt KContrastMinusInd = 1; +const TInt KContrastIconInd = 2; + +// EV slider value indexes +const TInt KEVPlus20Ind = 0; +const TInt KEVPlus15Ind = 1; +const TInt KEVPlus10Ind = 2; +const TInt KEVPlus05Ind = 3; +const TInt KEV0Ind = 4; +const TInt KEVMinus05Ind = 5; +const TInt KEVMinus10Ind = 6; +const TInt KEVMinus15Ind = 7; +const TInt KEVMinus20Ind = 8; + + + + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------- +// CCamSliderLegend::~CCamSliderLegend +// destructor +// --------------------------------------------------------- +// +CCamSliderLegend::~CCamSliderLegend() + { + PRINT( _L("Camera => ~CCamSliderLegend") ); + delete iText; + delete iBitmap; + delete iMask; + PRINT( _L("Camera <= ~CCamSliderLegend") ); + } + +// --------------------------------------------------------- +// CCamSliderLegend::Draw +// Draws the legend +// --------------------------------------------------------- +// +void CCamSliderLegend::Draw( CWindowGc& aGc ) const + { + if ( iItem == ECamSliderLegendItemText ) + { + TRgb color; + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + + iPosition.DrawText( aGc, iText->Des(), ETrue, color ); + } + else + { + iIconRect.DrawImage( aGc, iBitmap, iMask ); + } + } + +// --------------------------------------------------------- +// CCamSliderLegend::Rect +// Returns the legend rect +// --------------------------------------------------------- +// +TRect CCamSliderLegend::Rect() const + { + if ( iItem == ECamSliderLegendItemText ) + { + return iPosition.TextRect(); + } + else + { + return iIconRect.Rect(); + } + } + + +// --------------------------------------------------------- +// CCamSliderLegend::ConstructTextL +// Constructs a text element from resources with given layout +// --------------------------------------------------------- +// +void CCamSliderLegend::ConstructTextL( + TResourceReader& aReader, + const TRect& aRect, + const TAknTextComponentLayout& aLayout ) + { + iItem = static_cast( aReader.ReadInt16() ); + if ( iItem == ECamSliderLegendItemText ) + { // must be a text + iPosition.LayoutText( aRect, aLayout ); + iText = aReader.ReadHBufC16L(); + aReader.ReadInt32(); // bitmap + aReader.ReadInt32(); // mask + } + } + +// --------------------------------------------------------- +// CCamSliderLegend::ConstructIconL +// Constructs an icon from resources with given layout +// --------------------------------------------------------- +// +void CCamSliderLegend::ConstructIconL( + TResourceReader& aReader, + const TRect& aRect, + const TAknWindowComponentLayout& aLayout ) + { + iItem = static_cast( aReader.ReadInt16() ); + if ( iItem == ECamSliderLegendItemIcon ) + { // must be an icon + iIconRect.LayoutRect( aRect, aLayout ); + iText = aReader.ReadHBufC16L(); + TInt bitmap = aReader.ReadInt32(); + TInt mask = aReader.ReadInt32(); + + // Create component bitmaps + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + AknIconUtils::CreateIconL( iBitmap, iMask, resname, bitmap, mask ); + AknIconUtils::SetSize( iBitmap, iIconRect.Rect().Size() ); + } + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::CCamCaptureSetupSlider +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupSlider::CCamCaptureSetupSlider( MCamSettingValueObserver* aObserver, + TCamSettingItemIds aSettingType, + TInt aSteps ) +: iSettingObserver( aObserver ), iSettingType( aSettingType ), iSteps( aSteps ) + { + } + + +/* + * CCamCaptureSetupSlider::InitializeSliderValuesL + */ + +void CCamCaptureSetupSlider::InitializeSliderValuesL() + { + CCameraUiConfigManager* configManager = static_cast + ( iCoeEnv->AppUi() )->AppController().UiConfigManagerPtr(); + TBool configureRunTime = EFalse; + RArray range; + CleanupClosePushL( range ); + + switch ( iSettingType ) + { + case ECamSettingItemDynamicPhotoBrightness: + case ECamSettingItemDynamicVideoBrightness: + case ECamSettingItemUserSceneBrightness: + { + if ( configManager && configManager->IsBrightnessSupported() ) + { + configManager->SupportedBrightnessRangeL( range ); + configureRunTime = ETrue; + } + break; + } + case ECamSettingItemDynamicPhotoContrast: + case ECamSettingItemDynamicVideoContrast: + case ECamSettingItemUserSceneContrast: + { + if ( configManager && configManager->IsContrastSupported() ) + { + configManager->SupportedContrastRangeL( range ); + configureRunTime = ETrue; + } + } + break; + + case ECamSettingItemDynamicPhotoExposure: + case ECamSettingItemDynamicVideoExposure: + case ECamSettingItemUserSceneExposure: + { + // get range of EV values from product specific utility + TCamEvCompRange evRange = + static_cast( + iCoeEnv->AppUi() )->AppController().EvRange(); + + iMaxSliderValue = evRange.iMaxValue * evRange.iStepsPerUnit; + iMinSliderValue = evRange.iMinValue * evRange.iStepsPerUnit; + iNumSliderValues = iMaxSliderValue - iMinSliderValue; + } + break; + + default: + { + } + break; + } + + if ( configureRunTime ) + { + if ( range.Count() > 0 ) + { + iMinSliderValue = range[0]; //min value + iMaxSliderValue = range[1]; // max value + iNumSliderValues = range[range.Count()-1]; // steps + } + } + + CleanupStack::PopAndDestroy( &range ); + + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupSlider::ConstructL( const CCoeControl* aParent ) + { + __ASSERT_DEBUG( aParent!=NULL, CamPanic( ECamPanicNullPointer ) ); + + InitializeSliderValuesL(); + + iParentControl = aParent; + SetContainerWindowL( *iParentControl ); + + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + + // Create component bitmaps + AknIconUtils::CreateIconL( iBitmapShaft, + iBitmapShaftMask, + resname, + EMbmCameraappQgn_graf_nslider_cam4_empty, + EMbmCameraappQgn_graf_nslider_cam4_empty_mask ); + + AknIconUtils::CreateIconL( iBitmapThumb, + iBitmapThumbMask, + resname, + EMbmCameraappQgn_graf_nslider_cam4_marker, + EMbmCameraappQgn_graf_nslider_cam4_marker_mask ); + + AknIconUtils::CreateIconL( iBitmapThumbSelected, + iBitmapThumbSelectedMask, + resname, + EMbmCameraappQgn_graf_nslider_cam4_marker_selected, + EMbmCameraappQgn_graf_nslider_cam4_marker_selected_mask ); + iBitmapThumbCurrent = iBitmapThumb; + iBitmapThumbCurrentMask = iBitmapThumbMask; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupSlider* CCamCaptureSetupSlider::NewL( const CCoeControl* aParent, + MCamSettingValueObserver* aObserver, + TCamSettingItemIds aSettingItem, + TInt aSteps ) + { + CCamCaptureSetupSlider* self = + new( ELeave ) CCamCaptureSetupSlider( aObserver, aSettingItem, aSteps ); + CleanupStack::PushL( self ); + self->ConstructL( aParent ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::~CCamCaptureSetupSlider +// Destructor +// ----------------------------------------------------------------------------- +// +CCamCaptureSetupSlider::~CCamCaptureSetupSlider() + { + PRINT( _L("Camera => ~CCamCaptureSetupSlider") ); + + // Destroy legend strings + iLegendArray.ResetAndDestroy(); + + delete iBitmapShaft; + delete iBitmapShaftMask; + delete iBitmapThumb; + delete iBitmapThumbMask; + delete iBitmapThumbSelected; + delete iBitmapThumbSelectedMask; + PRINT( _L("Camera <= ~CCamCaptureSetupSlider") ); + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::InitializeL +// Sets up the slider with the initial value +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupSlider::InitializeL( TInt aValue ) + { + // Check the initial value is valid. If no, leave. + if ( aValue < iMinSliderValue || + aValue > iMaxSliderValue ) + { + User::Leave( KErrArgument ); + } + + iValue = aValue; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::MinValue +// Returns the minimum slider value +// ----------------------------------------------------------------------------- +// +TInt CCamCaptureSetupSlider::MinValue() const + { + return iMinSliderValue; + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::MaxValue +// Returns the maximum slider value +// ----------------------------------------------------------------------------- +// +TInt CCamCaptureSetupSlider::MaxValue() const + { + return iMaxSliderValue; + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::SetRange +// Sets the minimum and maximum values of the slider control +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupSlider::SetRange( TInt aMin, TInt aMax ) + { + ASSERT( aMin < aMax ); + iMinSliderValue = aMin; + iMaxSliderValue = aMax; + iNumSliderValues = iMaxSliderValue; + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::Draw +// Draws the slider +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupSlider::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc = SystemGc(); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext *cc = AknsDrawUtils::ControlContext( iParentControl ); + AknsDrawUtils::Background( skin, cc, iParentControl, gc, Rect() ); + + // STEP 1: Draw the legend text + TInt count = iLegendArray.Count(); + TInt i = 0; + for ( i = 0; i < count; i++ ) + { + iLegendArray[i]->Draw( gc ); + } + + CFbsBitmap* shaft = iBitmapShaft; + CFbsBitmap* shaftMask = iBitmapShaftMask; + + // Step 2: Draw the shaft bitmap + if ( shaft ) + { + iShaftLayout.DrawImage( gc, shaft, shaftMask ); + } + + // Step 3: Work out the position of the thumb + TPoint thumbPoint = iThumbPoint; + + // This is the max bitmap offset from the top of the shaft that the thumb can be + TInt maxVOffset = iShaftLayout.Rect().Size().iHeight - iBitmapThumb->SizeInPixels().iHeight; + + // This is the no. of pixels for a "step" + TInt stepInPixels = ( maxVOffset * KDivisorFactor ) / iNumSliderValues; + + // Thumb position = top of shaft + delta + TInt nbrSteps = iMaxSliderValue - iValue; + thumbPoint.iY = iShaftLayout.Rect().iTl.iY + stepInPixels * nbrSteps / KDivisorFactor; + + // Step 4: Blit the thumb bitmap + gc.BitBltMasked( thumbPoint, iBitmapThumbCurrent, iBitmapThumb->SizeInPixels(), iBitmapThumbCurrentMask, ETrue ); + } + + +// --------------------------------------------------------- +// CCamCaptureSetupSlider::SizeChanged +// Calculates the new minimum size +// --------------------------------------------------------- +// +void CCamCaptureSetupSlider::SizeChanged() + { + TRAPD( ignore, ReadLayoutL() ); + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + + // Work out the minimum size + TInt count = iLegendArray.Count(); + + TRect minimumRect; + + // Start min rect as first legend text + if ( count > 0 ) + { + minimumRect = iLegendArray[0]->Rect(); + } + + // Take into account the other legend texts + TInt i; + for ( i = 1; i < count; i++ ) + { + minimumRect.BoundingRect( iLegendArray[i]->Rect() ); + } + + // Take into account the shaft bitmap + minimumRect.BoundingRect( iShaftLayout.Rect() ); + + iMinimumSize = minimumRect.Size(); + } + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::OfferKeyEventL +// Allows the user to change the current EV value via key presses. +// ----------------------------------------------------------------------------- +// +TKeyResponse CCamCaptureSetupSlider::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) + { + PRINT( _L("CCamCaptureSetupSlider::OfferKeyEventL") ); + if ( aType == EEventKey ) + { + if ( aKeyEvent.iScanCode == EStdKeyUpArrow ) + { + if ( iValue < iMaxSliderValue ) + { + iValue ++; + iSettingObserver->HandleSettingValueUpdateL( iValue ); // Tell observer about change + DrawNow(); + } + + return EKeyWasConsumed; + } + else if ( aKeyEvent.iScanCode == EStdKeyDownArrow ) + { + if ( iValue > iMinSliderValue ) + { + iValue --; + iSettingObserver->HandleSettingValueUpdateL( iValue ); // Tell observer about change + DrawNow(); + } + + return EKeyWasConsumed; + } + else if ( aKeyEvent.iCode == EKeyOK && aKeyEvent.iRepeats == 0 ) + { + return EKeyWasConsumed; + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error + } + } + return EKeyWasNotConsumed; + } + +// --------------------------------------------------------- +// CCamCaptureSetupSlider::MinimumSize +// --------------------------------------------------------- +// +TSize CCamCaptureSetupSlider::MinimumSize() + { + TSize zerosize = TSize( 0, 0 ); + if ( iMinimumSize == zerosize ) + { + SizeChanged(); + } + return iMinimumSize; + } + + +// --------------------------------------------------------- +// CCamCaptureSetupSlider::ReadLayoutL +// --------------------------------------------------------- +// +void CCamCaptureSetupSlider::ReadLayoutL() + { + TRect shaftRect; + TSize shaftSize; + + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + iLayoutAreaRect ); + + // layout area rectangle contains the area, where components need to be + // drawn to. the container size is the whole screen, but the layouts are + // for the client area. aRect is the container size that might include or + // might not include statuspane area. calculating area self will + // go around the problem + + // We're starting again from scratch, so delete the old legend layouts + iLegendArray.ResetAndDestroy(); + if ( CamUtility::IsNhdDevice() ) + { + TouchLayoutL(); + } + else + { + NonTouchLayoutL(); + } + + AknIconUtils::SetSize( iBitmapThumb, + iThumbLayout.Rect().Size(), EAspectRatioPreserved ); + AknIconUtils::SetSize( iBitmapThumbSelected, + iThumbLayout.Rect().Size(), EAspectRatioPreserved ); + + // set the shaft icon size + shaftRect = iShaftLayout.Rect(); + shaftSize = shaftRect.Size(); + AknIconUtils::SetSize( iBitmapShaft, shaftSize, EAspectRatioNotPreserved ); + + // calculate initial thumb position + iThumbPoint = TPoint( shaftRect.iTl.iX + shaftSize.iWidth/2 - + iBitmapThumb->SizeInPixels().iWidth/2, + shaftRect.iTl.iY + shaftSize.iHeight/2 - + iBitmapThumb->SizeInPixels().iHeight/2 ); + } + +// --------------------------------------------------------- +// CCamCaptureSetupSlider::TouchLayoutL +// --------------------------------------------------------- +// +void CCamCaptureSetupSlider::TouchLayoutL() + { + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, + statusPaneRect ); + iLayoutAreaRect.BoundingRect( statusPaneRect ); + + // Get the slider layout + TAknLayoutRect sliderLayout; + sliderLayout.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset_slider_pane( 1 ) ); + TRect sliderRect( sliderLayout.Rect() ); + + // Set the thumb layout and icon size + iThumbLayout.LayoutRect( sliderRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g18( 0 ) ); + + if ( iSettingType == ECamSettingItemDynamicPhotoContrast || + iSettingType == ECamSettingItemDynamicVideoContrast || + iSettingType == ECamSettingItemUserSceneContrast ) + { + // Set the shaft layout and icon size for Contrast slider + iShaftLayout.LayoutRect( sliderRect, + AknLayoutScalable_Apps::cset_slider_pane( 5 ) ); + // set Contrast slider legend layouts + TouchContrastLayoutL( sliderRect ); + } + else + { + // Set the shaft layout and icon size for EV slider + iShaftLayout.LayoutRect( sliderRect, + AknLayoutScalable_Apps::cset_slider_pane( 7 ) ); + // set EV slider legend layouts + TouchEVLayoutL( sliderRect ); + } + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::NonTouchLayout +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupSlider::NonTouchLayoutL() + { + // Non-touch has a visible title & status panes + TRect titlePaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::ETitlePane, + titlePaneRect ); + iLayoutAreaRect.Move( 0, -titlePaneRect.Height() ); + + iThumbLayout.LayoutRect( Rect(), + AknLayoutScalable_Apps::main_cset6_slider_pane_g1( 2 ) ); + + if ( iSettingType == ECamSettingItemDynamicPhotoContrast || + iSettingType == ECamSettingItemDynamicVideoContrast || + iSettingType == ECamSettingItemUserSceneContrast ) + { + // Set the shaft layout for Contrast slider + iShaftLayout.LayoutRect( Rect(), + AknLayoutScalable_Apps::cset6_slider_pane( 5 ) ); + // set Contrast slider legend layouts + NonTouchContrastLayoutL( Rect() ); + } + else + { + // Set the shaft layout for EV slider + iShaftLayout.LayoutRect( Rect(), + AknLayoutScalable_Apps::cset6_slider_pane( 6 ) ); + // set EV slider legend layouts + NonTouchEVLayoutL( Rect() ); + } + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::TouchContrastLayoutL +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupSlider::TouchContrastLayoutL( const TRect& aParentRect ) + { + TInt resourceId = ROID(R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY_ID); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, resourceId ); + + const TInt count = reader.ReadInt16(); + + // Read all EV entries from the resource file and construct them with layout + for ( TInt i = 0; i < count; i++ ) + { + CCamSliderLegend* legend = new ( ELeave ) CCamSliderLegend; + CleanupStack::PushL( legend ); + switch ( i ) + { + case KContrastPlusInd : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t14( 5 ) ); + } + break; + case KContrastMinusInd : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t15( 5 ) ); + } + break; + case KContrastIconInd : + { + legend->ConstructIconL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_g15( 2 ) ); + } + break; + default: + { + } + break; + } + User::LeaveIfError( iLegendArray.Append( legend ) ); + CleanupStack::Pop( legend ); + } + + CleanupStack::PopAndDestroy(); // reader + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::NonTouchContrastLayoutL +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupSlider::NonTouchContrastLayoutL( + const TRect& aParentRect ) + { + TInt resourceId = ROID(R_CAM_CAPTURE_SETUP_SLIDER_CONTRAST_ARRAY_ID); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, resourceId ); + + const TInt count = reader.ReadInt16(); + + // Read all EV entries from the resource file + // and construct them with layout + for ( TInt i = 0; i < count; i++ ) + { + CCamSliderLegend* legend = new ( ELeave ) CCamSliderLegend; + CleanupStack::PushL( legend ); + switch ( i ) + { + case KContrastPlusInd : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t14( 5 ) ); + } + break; + case KContrastMinusInd : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t15( 5 ) ); + } + break; + case KContrastIconInd : + { + legend->ConstructIconL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_g15( 2 ) ); + } + break; + default: + { + } + break; + } + User::LeaveIfError( iLegendArray.Append( legend ) ); + CleanupStack::Pop( legend ); + } + + CleanupStack::PopAndDestroy(); // reader + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::TouchEVLayoutL +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupSlider::TouchEVLayoutL( const TRect& aParentRect ) + { + TInt resourceId = ROID(R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY_ID); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, resourceId ); + + const TInt count = reader.ReadInt16(); + + // Read all Contrast entries from the resource file + // and construct them with layout + for ( TInt i = 0; i < count; i++ ) + { + CCamSliderLegend* legend = new ( ELeave ) CCamSliderLegend; + CleanupStack::PushL( legend ); + switch ( i ) + { + case KEVPlus20Ind : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t1( 6 ) ); + } + break; + case KEVPlus15Ind : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t8( 2 ) ); + } + break; + case KEVPlus10Ind : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t2( 3 ) ); + } + break; + case KEVPlus05Ind : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t9( 2 ) ); + } + break; + case KEV0Ind : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t3( 3 ) ); + } + break; + case KEVMinus05Ind : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t10( 2 ) ); + } + break; + case KEVMinus10Ind : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t4( 3 ) ); + } + break; + case KEVMinus15Ind : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t11( 2 ) ); + } + break; + case KEVMinus20Ind : + { + legend->ConstructTextL( + reader, + aParentRect, + AknLayoutScalable_Apps::main_cset_slider_pane_t5( 3 ) ); + } + break; + default: + { + } + break; + } + User::LeaveIfError( iLegendArray.Append( legend ) ); + CleanupStack::Pop( legend ); + } + + CleanupStack::PopAndDestroy(); // reader + } + + + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::NonTouchEVLayoutL +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupSlider::NonTouchEVLayoutL( const TRect& aParentRect ) + { + TInt resourceId = ROID(R_CAM_CAPTURE_SETUP_SLIDER_EV_ARRAY_ID); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, resourceId ); + + const TInt count = reader.ReadInt16(); + + // Read all Contrast entries from the resource file + // and construct them with layout + for ( TInt i = 0; i < count; i++ ) + { + CCamSliderLegend* legend = new ( ELeave ) CCamSliderLegend; + CleanupStack::PushL( legend ); + switch ( i ) + { + case KEVPlus20Ind : + { + legend->ConstructTextL( reader, aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t1( 5 ) ); + } + break; + case KEVPlus15Ind : + { + legend->ConstructTextL( reader, aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t8( 2 ) ); + } + break; + case KEVPlus10Ind : + { + legend->ConstructTextL( reader, aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t2( 3 ) ); + } + break; + case KEVPlus05Ind : + { + legend->ConstructTextL( reader, aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t9( 2 ) ); + } + break; + case KEV0Ind : + { + legend->ConstructTextL( reader, aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t3( 3 ) ); + } + break; + case KEVMinus05Ind : + { + legend->ConstructTextL( reader, aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t10( 2 ) ); + } + break; + case KEVMinus10Ind : + { + legend->ConstructTextL( reader, aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t4( 3 ) ); + } + break; + case KEVMinus15Ind : + { + legend->ConstructTextL( reader, aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t11( 2 ) ); + } + break; + case KEVMinus20Ind : + { + legend->ConstructTextL( reader, aParentRect, + AknLayoutScalable_Apps::main_cset6_slider_pane_t5( 3 ) ); + } + break; + default: + break; + } + User::LeaveIfError( iLegendArray.Append( legend ) ); + CleanupStack::Pop( legend ); + } + + CleanupStack::PopAndDestroy(); // reader + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupSlider::HandlePointerEventL +// Handles slider pointer events +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupSlider::HandlePointerEventL(const TPointerEvent& aPointerEvent) + { + + CCoeControl::HandlePointerEventL( aPointerEvent ); + + // This is the max bitmap offset from the top of the shaft that the thumb can be + TInt maxVOffset = iShaftLayout.Rect().Size().iHeight - iBitmapThumb->SizeInPixels().iHeight; + + // This is the no. of pixels for a "step" + TInt stepInPixels = ( maxVOffset * KDivisorFactor ) / iNumSliderValues; + + // Calculate new setting value + TInt oldValue = iValue; + TInt deltaY = aPointerEvent.iPosition.iY - iShaftLayout.Rect().iTl.iY; + TInt nbrSteps = deltaY / ( stepInPixels / KDivisorFactor ); + iValue = iMaxSliderValue - nbrSteps; + + if ( iValue < iMinSliderValue ) + { + iValue = iMinSliderValue; + } + + if (iValue > iMaxSliderValue) + { + iValue = iMaxSliderValue; + } + + if ( iValue != oldValue && aPointerEvent.iType == TPointerEvent::EDrag ) + { + MTouchFeedback* feedback = MTouchFeedback::Instance(); + if ( feedback ) + { + feedback->InstantFeedback( ETouchFeedbackSensitive ); + } + } + + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + // Change thumb marker to selected + iBitmapThumbCurrent = iBitmapThumbSelected; + iBitmapThumbCurrentMask = iBitmapThumbSelectedMask; + } + + if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + // Change thumb marker to normal + iBitmapThumbCurrent = iBitmapThumb; + iBitmapThumbCurrentMask = iBitmapThumbMask; + } + + iSettingObserver->HandleSettingValueUpdateL( iValue ); // Tell observer about change + DrawNow(); + static_cast( iCoeEnv->AppUi() )-> + AppController().StartIdleTimer(); + } + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCaptureSetupViewBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCaptureSetupViewBase.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1114 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for pre capture views* +*/ + + +// INCLUDE FILES +#include + +#include +#include + +#include "CamCaptureSetupViewBase.h" +#include "CamAppUiBase.h" +#include "CamAppController.h" +#include "CamUtility.h" +#include "CamCaptureSetupControlHandler.h" +#include "CamCaptureSetupContainer.h" +#include "CamShootingModeContainer.h" +#include "CamInfoListBoxContainer.h" +#include "CamPanic.h" +#include "Cam.hrh" +#include "CamZoomPane.h" +#include "CamTimeLapseUtility.h" +#include "camactivepalettehandler.h" +#include "CamAppUi.h" + +#include + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase destructor +// +// --------------------------------------------------------------------------- +// +CCamCaptureSetupViewBase::~CCamCaptureSetupViewBase() + { + PRINT( _L("Camera => ~CCamCaptureSetupViewBase") ); + if( AppUi() ) + { + if ( iCaptureSetupContainer ) + { + AppUi()->RemoveFromStack( iCaptureSetupContainer ); + delete iCaptureSetupContainer; + } + if ( iSceneSettingContainer ) + { + AppUi()->RemoveFromStack( iSceneSettingContainer ); + delete iSceneSettingContainer; + iSceneSettingContainer = NULL; + } + if ( iInfoListBoxContainer ) + { + AppUi()->RemoveFromStack( iInfoListBoxContainer ); + delete iInfoListBoxContainer; + } + } + PRINT( _L("Camera <= ~CCamCaptureSetupViewBase") ); + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::HandleCommandL +// Handle commands +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::HandleCommandL( TInt aCommand ) + { + PRINT( _L("Camera => CCamCaptureSetupViewBase::HandleCommandL") ); + TUid view = Id(); + + TBool userSceneActive = ( view.iUid == ECamViewIdPhotoUserSceneSetup ); + + CCamAppUiBase* appUi = static_cast( AppUi() ); + + switch ( aCommand ) + { + case ECamCmdCaptureSetupWhiteBalanceStill: // fallthrough + case ECamCmdCaptureSetupColourFilterStill: + case ECamCmdCaptureSetupExposureStill: + case ECamCmdCaptureSetupWhiteBalanceVideo: + case ECamCmdCaptureSetupColourFilterVideo: + case ECamCmdCaptureSetupBrightnessStill: + case ECamCmdCaptureSetupContrastStill: + case ECamCmdCaptureSetupBrightnessVideo: + case ECamCmdCaptureSetupContrastVideo: + case ECamCmdCaptureSetupImageSharpnessStill: + { + SwitchToCaptureSetupModeL( aCommand ); + } + break; + case ECamCmdCaptureSetupFlashStill: + case ECamCmdCaptureSetupSelfTimer: + { + iController.ExitViewfinderMode( ECamControllerImage ); + SwitchToCaptureSetupModeL( aCommand ); + } + break; + case ECamCmdCaptureSetupSceneStill: + case ECamCmdCaptureSetupSceneVideo: + { + SwitchToSceneSettingModeL(); + + + } + break; + case EAknSoftkeyBack: + { + if( appUi && appUi->APHandler()->AccessedViaAP() ) + { + if( !userSceneActive) + { + appUi->APHandler()->APOperationComplete(); + } + + if ( iSceneSettingModeActive ) + { + iSceneSettingContainer->SaveSceneSettingIfChangedL(); + } + + iChangeButtonPressed = EFalse; + ExitAllModesL(); + } + else + { + if( iSceneSettingModeActive ) + { + ExitSceneSettingModeL(); + } + else if ( iInfoListBoxActive ) + { + ExitInfoListBoxL(); + } + } + } + break; + case EAknSoftkeyCancel: + { + if ( iCaptureSetupModeActive && iCaptureSetupControlHandler ) + { + TCamSettingItemIds iSettingItemId = iCaptureSetupControlHandler->SettingType(); + + if ( iSettingItemId == ECamSettingItemDynamicSelfTimer ) //judge if current operation selfTimer + { + iController.SetSlideInSelfTimerPreview(EFalse); + TInt iSelfTimerVal = iController.IntegerSettingValueUnfiltered( ECamSettingItemDynamicSelfTimer ); //get the actual selfTimer value, not the focus one + + iController.IntSettingChangedL(iSettingItemId, iSelfTimerVal); //set the actual status to the actual index + } + + iController.CancelPreviewChangesL(); + // fallthrough to exit CaptureSetup mode + } + else if ( iInfoListBoxActive ) + { + ExitAllModesL(); + break; + } + else if ( iSceneSettingModeActive ) + { + iChangeButtonPressed = EFalse; + ExitAllModesL(); + break; + } + else + { + // do nothing, the command is handled by the framework + break; + } + } + //lint -fallthrough + case EAknSoftkeyOk: + { + if ( iCaptureSetupModeActive && iCaptureSetupControlHandler ) + { + TCamSettingItemIds iSettingItemId = iCaptureSetupControlHandler->SettingType(); + if ( iSettingItemId == ECamSettingItemDynamicSelfTimer ) + { + iController.SetSlideInSelfTimerPreview(EFalse); + } + + iController.CommitPreviewChanges(); + // fallthrough to exit CaptureSetup mode + } + if( appUi && appUi->APHandler()->AccessedViaAP() ) + { + if( !userSceneActive) + { + appUi->APHandler()->APOperationComplete(); + } + ExitAllModesL(); + } + } + break; + case ECamMSKCmdAppChange: + case EAknSoftkeySelect: + { + if ( iSceneSettingContainer ) + { + + if ( iSceneSettingContainer->UserSceneHighlighted() ) + { + // use context specific ok options menu if user scene is highlighted + CEikMenuBar* menuBar = MenuBar(); + if ( menuBar ) + { + menuBar->SetMenuTitleResourceId( R_CAM_SCENE_SETTING_OK_MENUBAR ); + MenuBar()->SetMenuType( CEikMenuBar::EMenuContext ); + menuBar->TryDisplayMenuBarL(); + menuBar->SetMenuTitleResourceId( R_CAM_SCENE_SETTING_MENUBAR ); + //Here we again set back the type of menu to "Options" when pressed LSK + menuBar->SetMenuType( CEikMenuBar::EMenuOptions ); + } + break; + } + + } + } + //lint -fallthrough + case ECamCmdSelect: + { + if ( iSceneSettingContainer ) + { + // If successfully saved the scene change to the settings model + // then exit the scene setting mode. + if ( iSceneSettingContainer->SaveSceneSettingL() ) + { + if( appUi && appUi->APHandler()->AccessedViaAP() ) + { + if( !userSceneActive) + { + appUi->APHandler()->APOperationComplete(); + } + + ExitAllModesL(); + } + else + { + ExitSceneSettingModeL(); + } + } + } + else if( iInfoListBoxContainer ) + { + HandleInfoListBoxSelectionL(); + } + } + break; + case ECamCmdEdit: + { + // If 'change' user scene selected from scene list, exit all + // modes in the precapture view and switch view to user scene. + if ( iSceneSettingModeActive ) + { + iChangeButtonPressed = ETrue; + AppUi()->HandleCommandL( ECamCmdUserScene ); + AppUi()->StatusPane()->MakeVisible( ETrue ); + } + + } + break; + case ECamCmdUserSceneSelected: + { + // check as a precaution that there is a container and userscene is highlighted + if ( iSceneSettingContainer && iSceneSettingContainer->UserSceneHighlighted() ) + { + + // use context specific ok options menu if user scene is highlighted + CEikMenuBar* menuBar = MenuBar(); + if ( menuBar ) + { + MenuBar()->SetMenuType( CEikMenuBar::EMenuContext ); + menuBar->SetMenuTitleResourceId( R_CAM_SCENE_SETTING_OK_MENUBAR ); + menuBar->TryDisplayMenuBarL(); + menuBar->SetMenuType( CEikMenuBar::EMenuOptions ); + menuBar->SetMenuTitleResourceId( R_CAM_SCENE_SETTING_MENUBAR ); + } + } + + break; + } + case ECamCmdInternalExit: + { + if ( appUi ) + { + if ( !appUi->ZoomPane()->IsZoomAtMinimum() ) + { + appUi->ZoomPane()->ResetZoomTo1x(); + } + } + ExitAllModesL(); + CCamViewBase::HandleCommandL( aCommand ); + } + break; + case ECamCmdRedrawScreen: + { + if( iCaptureSetupContainer ) + { + iCaptureSetupContainer->DrawDeferred(); + } + CCamViewBase::HandleCommandL( aCommand ); + } + break; + default: + { + CCamViewBase::HandleCommandL( aCommand ); + break; + } + } + PRINT( _L("Camera <= CCamCaptureSetupViewBase::HandleCommandL") ); + } + +// ----------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::HandleFocusLossL +// Handle focus loss +// ----------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::HandleFocusLossL() + { + // We dont exit any of the modes when we loose focus + // we do it when we gain focus. + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::DoDeactivate +// From CAknView deactivates the view +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::DoDeactivate() + { + if ( iSceneSettingContainer ) + { + AppUi()->RemoveFromStack( iSceneSettingContainer ); + + delete iSceneSettingContainer; + iSceneSettingContainer = NULL; + } + CCamViewBase::DoDeactivate(); + } + + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::CCamCaptureSetupViewBase +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamCaptureSetupViewBase::CCamCaptureSetupViewBase( CCamAppController& aController ) + : CCamViewBase( aController ) + { + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::CreateCaptureSetupControlHandlerL +// Create a control handler for the correct capture setup item +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::CreateCaptureSetupControlHandlerL( TInt aSetupCommand ) + { + __ASSERT_DEBUG( !iCaptureSetupControlHandler, CamPanic( ECamPanicInvalidState ) ); + TCamSettingItemIds settingItemId = ECamSettingItemDynamicPhotoWhiteBalance; + switch ( aSetupCommand ) + { + case ECamCmdCaptureSetupWhiteBalanceStill: + { + settingItemId = ECamSettingItemDynamicPhotoWhiteBalance; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL; + } + break; + case ECamCmdCaptureSetupColourFilterStill: + { + settingItemId = ECamSettingItemDynamicPhotoColourFilter; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL; + } + break; + + case ECamCmdCaptureSetupExposureStill: + { + settingItemId = ECamSettingItemDynamicPhotoExposure; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL; + } + break; + + case ECamCmdCaptureSetupFlashStill: + { + settingItemId = ECamSettingItemDynamicPhotoFlash; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL; + } + break; + case ECamCmdCaptureSetupSelfTimer: + { + settingItemId = ECamSettingItemDynamicSelfTimer; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL; + } + break; + + case ECamCmdCaptureSetupWhiteBalanceVideo: + { + settingItemId = ECamSettingItemDynamicVideoWhiteBalance; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_VIDEO; + } + break; + case ECamCmdCaptureSetupColourFilterVideo: + { + settingItemId = ECamSettingItemDynamicVideoColourFilter; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_VIDEO; + } + break; + + // User scene settings pages. + case ECamCmdCaptureSetupWhiteBalanceUser: + { + settingItemId = ECamSettingItemUserSceneWhitebalance; + iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE; + } + break; + case ECamCmdCaptureSetupColourFilterUser: + { + settingItemId = ECamSettingItemUserSceneColourFilter; + iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE; + } + break; + case ECamCmdCaptureSetupExposureUser: + { + settingItemId = ECamSettingItemUserSceneExposure; + iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE; + } + break; + case ECamCmdCaptureSetupFlashUser: + { + settingItemId = ECamSettingItemUserSceneFlash; + iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE; + } + break; + + case ECamCmdCaptureSetupBrightnessStill: + { + settingItemId = ECamSettingItemDynamicPhotoBrightness; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL; + } + break; + case ECamCmdCaptureSetupContrastStill: + { + settingItemId = ECamSettingItemDynamicPhotoContrast; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL; + } + break; + case ECamCmdCaptureSetupBrightnessVideo: + { + settingItemId = ECamSettingItemDynamicVideoBrightness; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_VIDEO; + } + break; + case ECamCmdCaptureSetupContrastVideo: + { + settingItemId = ECamSettingItemDynamicVideoContrast; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_VIDEO; + } + break; + case ECamCmdCaptureSetupBrightnessUser: + { + settingItemId = ECamSettingItemUserSceneBrightness; + iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE; + } + break; + case ECamCmdCaptureSetupContrastUser: + { + settingItemId = ECamSettingItemUserSceneContrast; + iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE; + } + break; + + case ECamCmdCaptureSetupImageSharpnessStill: + { + settingItemId = ECamSettingItemDynamicPhotoImageSharpness; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL; + } + break; + case ECamCmdCaptureSetupImageSharpnessUser: + { + settingItemId = ECamSettingItemUserSceneImageSharpness; + iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE; + } + break; + + case ECamCmdCaptureSetupLightSensitivityStill: + { + settingItemId = ECamSettingItemDynamicPhotoLightSensitivity; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_STILL; + } + break; + case ECamCmdCaptureSetupLightSensitivityVideo: + { + settingItemId = ECamSettingItemDynamicVideoLightSensitivity; + iSettingModeTitleResourceId = R_CAM_CAPTURE_SETUP_TITLE_VIDEO; + } + break; + case ECamCmdCaptureSetupLightSensitivityUser: + { + settingItemId = ECamSettingItemUserSceneLightSensitivity; + iSettingModeTitleResourceId = R_CAM_USER_SCENE_SETUP_TITLE; + } + break; + default: + { + User::Leave( KErrNotSupported ); + } + break; + } + + iCaptureSetupControlHandler = new( ELeave ) + CCamCaptureSetupControlHandler( iController, settingItemId ); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::CleanupCaptureSetupContainer +// Cleanup the capture setup controls if a leave occurs +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::CleanupCaptureSetupContainer( TAny* aAny ) + { + CCamCaptureSetupViewBase* view = static_cast( aAny ); + delete view->iCaptureSetupControlHandler; + view->iCaptureSetupControlHandler = NULL; + + if ( view->iCaptureSetupContainer ) + { + view->AppUi()->RemoveFromStack( view->iCaptureSetupContainer ); + delete view->iCaptureSetupContainer; + view->iCaptureSetupContainer = NULL; + } + // reset the active flag + view->SetCaptureSetupModeActive(EFalse); + + CCamAppUiBase* appUi = static_cast( view->AppUi() ); + appUi->SetPreCaptureMode(ECamPreCapViewfinder); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::SwitchToCaptureSetupModeL +// Enter capture setup mode +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::SwitchToCaptureSetupModeL( TInt aSetupCommand ) + { + __ASSERT_DEBUG( !iCaptureSetupControlHandler && !iCaptureSetupContainer, CamPanic( ECamPanicResourceLeak ) ); + + CreateCaptureSetupControlHandlerL( aSetupCommand ); + // Cleanup the view correctly if a leave occurs + CleanupStack::PushL( TCleanupItem( CleanupCaptureSetupContainer, this ) ); + CCamAppUiBase* appUi = static_cast( AppUi() ); + + TRect rect = appUi->ApplicationRect(); + if ( !CamUtility::IsNhdDevice() ) + { + // Space for visible statuspane for non-touch device + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); + } + iCaptureSetupContainer = CCamCaptureSetupContainer::NewL( iController, + *this, *iCaptureSetupControlHandler, rect ); + iCaptureSetupContainer->SetMopParent( this ); + appUi->AddToStackL( *this, iCaptureSetupContainer ); + iCaptureSetupContainer->ActivateL(); + iCaptureSetupContainer->DrawNow(); + + // UpdateCbaL need this boolean to be set in order + // to return the correct CBA + SetCaptureSetupModeActive(ETrue); + + iCaptureSetupContainer->DrawableWindow()->SetOrdinalPosition( + KCamPreCaptureWindowOrdinalPos ); + + UpdateCbaL(); + SetTitlePaneTextL(); + appUi->PushDefaultNaviPaneL(); + CleanupStack::Pop(); // CleanupCaptureSetupContainer + // after all leaving functions have completed + // remove the container from the stack + appUi->RemoveFromStack( iContainer ); + iContainer->MakeVisible( EFalse ); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::ExitCaptureSetupModeL +// Exit capture setup mode +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::ExitCaptureSetupModeL() + { + PRINT( _L("Camera => CCamCaptureSetupViewBase::ExitCaptureSetupModeL()") ); + if ( !iController.InVideocallOrRinging() ) + { + iController.CancelPreviewChangesL(); + } + if ( !iCaptureSetupModeActive ) + { + return; + } + + // Cleanup the view correctly if a leave occurs + CleanupStack::PushL( TCleanupItem( CleanupExit, this ) ); + AppUi()->AddToStackL( *this, iContainer ); + iContainer->MakeVisible( ETrue ); + //Draw already here to prevent the activepalette showing briefly before it is updated + if ( !iController.IsTouchScreenSupported() ) + { + iContainer->DrawNow(); + } + SetCaptureSetupModeActive(EFalse); + + UpdateCbaL(); + SetTitlePaneTextL(); + CleanupStack::Pop(); // CleanupExit + + // delete the capture setup controls when all + // leaving functions have completed + AppUi()->RemoveFromStack( iCaptureSetupContainer ); + delete iCaptureSetupContainer; + iCaptureSetupContainer = NULL; + delete iCaptureSetupControlHandler; + iCaptureSetupControlHandler = NULL; + PRINT( _L("Camera <= CCamCaptureSetupViewBase::ExitCaptureSetupModeL()") ); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::CleanupSceneSettingContainer +// Cleanup the capture setup controls if a leave occurs +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::CleanupSceneSettingContainer( TAny* aAny ) + { + CCamCaptureSetupViewBase* view = static_cast( aAny ); + if ( view->iSceneSettingContainer ) + { + view->AppUi()->RemoveFromStack( view->iSceneSettingContainer ); + delete view->iSceneSettingContainer; + view->iSceneSettingContainer = NULL; + } + // reset the active mode + view->SetSceneSettingMode(EFalse); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::CleanupInfoListBox +// Cleanup the InfoListBox controls if a leave occurs +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::CleanupInfoListBox( TAny* aAny ) + { + CCamCaptureSetupViewBase* view = static_cast( aAny ); + if ( view->iInfoListBoxContainer ) + { + view->AppUi()->RemoveFromStack( view->iInfoListBoxContainer ); + delete view->iInfoListBoxContainer; + view->iInfoListBoxContainer = NULL; + } + // reset the active mode + view->SetInfoListBoxMode(EFalse); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::SwitchToSceneSettingModeL +// Enter scene setup mode +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::SwitchToSceneSettingModeL() + { + // Cleanup the view correctly if a leave occurs + CleanupStack::PushL( TCleanupItem( CleanupSceneSettingContainer, this ) ); + CCamAppUi* appUi = static_cast( AppUi() ); + iSceneSettingContainer->SetMopParent( this ); + appUi->AddToStackL( *this, iSceneSettingContainer ); + iSceneSettingContainer->ActivateL(); + + if ( iChangeButtonPressed && iSceneSettingContainer ) + { + iSceneSettingContainer->SelectItem( iSceneSettingContainer->IndexForValueId( ECamSceneUser ) ); + // iChangeButtonPressed is set to EFalse in SetSceneSettingMode method + } + + // UpdateCbaL need this boolean to be set in + // order to return the correct CBA + SetSceneSettingMode(ETrue); + + appUi->SetToolbarVisibility(); + + UpdateCbaL(); + SetTitlePaneTextL(); + appUi->PushDefaultNaviPaneL(); + CleanupStack::Pop(); // CleanupSceneSettingContainer + // after all leaving functions have completed + // remove the container from the stack and + // set the capture setup mode active + appUi->RemoveFromStack( iContainer ); + iContainer->MakeVisible( EFalse ); + + CEikMenuBar* menuBar = MenuBar(); + // if menuBar exists + if ( menuBar ) + { + menuBar->SetMenuTitleResourceId( ROID(R_CAM_SCENE_SETTING_MENUBAR_ID)); + } + + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::SwitchToInfoListBoxL +// Show InfoListBox +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::SwitchToInfoListBoxL( TCamInfoListBoxMode /* aMode */ ) + { + // Cleanup the view correctly if a leave occurs + CleanupStack::PushL( TCleanupItem( CleanupInfoListBox, this ) ); + CCamAppUiBase* appUi = static_cast( AppUi() ); + iInfoListBoxContainer->SetMopParent( this ); + appUi->AddToStackL( *this, iInfoListBoxContainer ); + iInfoListBoxContainer->ActivateL(); + // UpdateCbaL need this boolean to be set in + // order to return the correct CBA + SetInfoListBoxMode(ETrue); + UpdateCbaL(); + SetTitlePaneTextL(); + appUi->PushDefaultNaviPaneL(); + CleanupStack::Pop(); // CleanupSceneSettingContainer + + // after all leaving functions have completed + // remove the container from the stack and + // set the capture setup mode active + appUi->RemoveFromStack( iContainer ); + iContainer->MakeVisible( EFalse ); + + CEikMenuBar* menuBar = MenuBar(); + // if menuBar exists + if ( menuBar ) + { + // Use same menu resource as scene setting + menuBar->SetMenuTitleResourceId( R_CAM_INFOLISTBOX_MENUBAR ); + } + } + + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::HandleInfoListBoxSelectionL() +// Handle selection events from InfoListBox +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::HandleInfoListBoxSelectionL() + { + CCamAppUiBase* appUi = static_cast( AppUi() ); + + TUid view = Id(); + TBool userSceneActive = ( view.iUid == ECamViewIdPhotoUserSceneSetup ); + + if( iInfoListBoxContainer->SettingValueChanged() ) + { + // Store the selected setting + switch( iInfoListBoxMode ) + { + case EInfoListBoxModeTimeLapse: + { + TCamTimeLapse settingValue = static_cast( iInfoListBoxContainer->CurrentSettingItemValue() ); + TInt command = CamTimeLapseUtility::EnumToCommand( settingValue ); + TTimeIntervalMicroSeconds interval = CamTimeLapseUtility::EnumToInterval( settingValue ); + + // Update the current mode (single/burst/timelapse) + if( appUi ) + { + TRAP_IGNORE( appUi->HandleCommandL( command ) ); + } + + // Update timelapse interval + iController.SetTimeLapseInterval( interval ); + } + break; + + case EInfoListBoxModeISO: + { + TInt settingValue = iInfoListBoxContainer->CurrentSettingItemValue(); + + // For the light sensitivity setting, PreviewSettingChangeL and CommitPreviewChanges + // must be used, instead of UpdateEngineWithSettingL, in order to actually change + // the setting value. + iController.PreviewSettingChangeL( ECamSettingItemDynamicPhotoLightSensitivity, settingValue ); + iController.CommitPreviewChanges(); + } + break; + + default: + break; + } + } + + + if( appUi && appUi->APHandler()->AccessedViaAP() ) + { + if( !userSceneActive) + { + // If user scene is active, we aren't yet done + appUi->APHandler()->APOperationComplete(); + } + + ExitAllModesL(); + } + else + { + ExitInfoListBoxL(); + } + + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::CleanupExit +// Stop the scene setting mode from exiting if a leave occurs +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::CleanupExit( TAny* aAny ) + { + CCamCaptureSetupViewBase* view = static_cast( aAny ); + view->AppUi()->RemoveFromStack( view->iContainer ); + view->iContainer->MakeVisible( EFalse ); + if ( view->iSceneSettingContainer ) + { + // reset the active mode + view->SetSceneSettingMode(ETrue); + } + if ( view->iCaptureSetupContainer ) + { + // reset the active mode + view->SetCaptureSetupModeActive(ETrue); + } + if ( view->iInfoListBoxContainer ) + { + // reset the active mode + view->SetInfoListBoxMode(ETrue); + } + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::ExitSceneSettingModeL +// Exit scene setup mode +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::ExitSceneSettingModeL() + { + PRINT( _L( "Camera => CCamCaptureSetupViewBase::ExitSceneSettingModeL" ) ); + + if ( !iSceneSettingModeActive ) + { + AppUi()->RemoveFromStack( iSceneSettingContainer ); + + if ( iSceneSettingContainer ) + { + delete iSceneSettingContainer; + iSceneSettingContainer = NULL; + } + return; + } + + // Cleanup the view correctly if a leave occurs + CleanupStack::PushL( TCleanupItem( CleanupExit, this ) ); + AppUi()->AddToStackL( *this, iContainer ); + + if ( iChangeButtonPressed == EFalse ) + { + AppUi()->RemoveFromStack( iSceneSettingContainer ); + if ( iSceneSettingContainer ) + { + delete iSceneSettingContainer; + iSceneSettingContainer = NULL; + } + iContainer->MakeVisible( ETrue ); + //Draw already here to prevent the activepalette showing briefly before it is updated + if ( !iController.IsTouchScreenSupported() ) + { + iContainer->DrawNow(); + } + SetSceneSettingMode(EFalse); + UpdateCbaL(); + SetTitlePaneTextL(); + CleanupStack::Pop(); // CleanupExit + + + + } + else // iChangeButtonPressed == ETrue + { + iContainer->MakeVisible( EFalse ); + SetSceneSettingMode(EFalse); + SetTitlePaneTextL(); + CleanupStack::Pop(); // CleanupExit + } + + + CEikMenuBar* menuBar = MenuBar(); + // if menuBar exists + if ( menuBar ) + { + menuBar->SetMenuTitleResourceId( iPreviousMenuResourceId ); + } + PRINT( _L( "Camera <= CCamCaptureSetupViewBase::ExitSceneSettingModeL" ) ); + } + + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::ExitInfoListBoxL +// Exit scene setup mode +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::ExitInfoListBoxL() + { + PRINT( _L( "Camera => CCamCaptureSetupViewBase::ExitInfoListBoxL" ) ); + + if ( !iInfoListBoxActive ) + { + return; + } + + // Cleanup the view correctly if a leave occurs + CleanupStack::PushL( TCleanupItem( CleanupExit, this ) ); + AppUi()->AddToStackL( *this, iContainer ); + PRINT( _L( "Camera => CCamCaptureSetupViewBase::ExitInfoListBoxL removing iInfoListBoxContainer" ) ); + AppUi()->RemoveFromStack( iInfoListBoxContainer ); + delete iInfoListBoxContainer; + iInfoListBoxContainer = NULL; + PRINT( _L( "Camera => CCamCaptureSetupViewBase::ExitInfoListBoxL removed iInfoListBoxContainer" ) ); + + iContainer->MakeVisible( ETrue ); + //Draw already here to prevent the activepalette showing briefly before it is updated + if ( !iController.IsTouchScreenSupported() ) + { + iContainer->DrawNow(); + } + SetInfoListBoxMode(EFalse); + UpdateCbaL(); + SetTitlePaneTextL(); + CleanupStack::Pop(); // CleanupExit + + CEikMenuBar* menuBar = MenuBar(); + // if menuBar exists + if ( menuBar ) + { + menuBar->SetMenuTitleResourceId( iPreviousMenuResourceId ); + } + + iInfoListBoxActive = EFalse; + + // StartViewFinderL(); + PRINT( _L( "Camera <= CCamCaptureSetupViewBase::ExitInfoListBoxL" ) ); + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::SetupModeTitlePaneResourceId +// Return the resource id for the title pane text while in setup mode +// --------------------------------------------------------------------------- +// +TInt CCamCaptureSetupViewBase::SetupModeTitlePaneResourceId() + { + return iSettingModeTitleResourceId; + } + + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::DynInitMenuPaneL +// Dynamically initialise the options menu +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) + { + PRINT( _L("Camera => CCamCaptureSetupViewBase::DynInitMenuPaneL")) + iController.StartIdleTimer(); + if( iSceneSettingModeActive && aResourceId == ROID(R_CAM_SCENE_SETTING_MENU_ID)) + { + if ( iSceneSettingContainer && !iSceneSettingContainer->UserSceneHighlighted() ) + { + aMenuPane->SetItemDimmed( ECamCmdEdit, ETrue ); + } + else + { + // do nothing + } + } + else + { + // do nothing + } + PRINT( _L("Camera <= CCamCaptureSetupViewBase::DynInitMenuPaneL")) + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::ExitAllModesL +// Revert to normal mode +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::ExitAllModesL() + { + // intentionally doing nothing + PRINT( _L("Camera =><= CCamCaptureSetupViewBase::ExitAllModesL empty impl.")) + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::SetSceneSettingMode +// Sets the iSceneSettingModeActive flag +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::SetSceneSettingMode(TBool aActive) + { + // This should be the only place iSceneSettingModeActive is set! + // We need to inform the AppUi + iSceneSettingModeActive = aActive; + + CCamAppUi* appUi = static_cast(AppUi()); //static_cast( AppUi() ); + + if ( appUi ) + { + if ( aActive ) + { + appUi->SetPreCaptureMode(ECamPreCapSceneSetting); + iChangeButtonPressed = EFalse; + } + else if ( iChangeButtonPressed ) + { + // transfering to user scene setup view + appUi->SetPreCaptureMode(ECamPreCapSceneSetting); + } + else + { + appUi->SetPreCaptureMode(ECamPreCapViewfinder); + } + } + + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::SetInfoListBoxMode +// Sets the iInfoListBoxActive flag +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::SetInfoListBoxMode( TBool aActive ) + { + // We need to inform the AppUi + iInfoListBoxActive = aActive; + + CCamAppUiBase* appUi = static_cast( AppUi() ); + + if ( appUi) + { + if ( aActive ) + { + appUi->SetPreCaptureMode(ECamPreCapGenericSetting); + } + else + { + appUi->SetPreCaptureMode(ECamPreCapViewfinder); + } + } + } + +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::SetCaptureSetupModeActive +// Sets the iSceneSettingModeActive flag +// --------------------------------------------------------------------------- +// +void CCamCaptureSetupViewBase::SetCaptureSetupModeActive(TBool aActive) + { + // This should be the only place iCaptureSetupModeActive is set! + // We need to inform the AppUi + iCaptureSetupModeActive = aActive; + + CCamAppUiBase* appUi = static_cast( AppUi() ); + + if ( appUi) + { + if ( aActive ) + { + appUi->SetPreCaptureMode(ECamPreCapCaptureSetup); + } + else + { + appUi->SetPreCaptureMode(ECamPreCapViewfinder); + } + } + } +// --------------------------------------------------------------------------- +// CCamCaptureSetupViewBase::HandleForegroundEventL +// Called to notify of change of app fore/background state +// --------------------------------------------------------------------------- +// + void CCamCaptureSetupViewBase::HandleForegroundEventL( TBool aForeground ) + { + + PRINT1( _L("Camera => CCamCaptureSetupViewBase::HandleForegroundEventL foreground:%d"), aForeground ); + + if( aForeground ) + { + + if ( iCaptureSetupModeActive && iCaptureSetupContainer ) + { + iCaptureSetupContainer->HandleForegroundEventL( aForeground ); + } + } + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamCommandHandlerAo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamCommandHandlerAo.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,163 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object for handling toolbar commands +* +*/ + + +// INCLUDE FILES +#include "CamCommandHandlerAo.h" +#include "camlogging.h" +#include + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamCommandHandlerAo::CCamCommandHandlerAo +// C++ constructor +// ----------------------------------------------------------------------------- +// +CCamCommandHandlerAo::CCamCommandHandlerAo( CAknView* aView ) + :CActive( CActive::EPriorityStandard ), iView( aView ) + { + } + +// ----------------------------------------------------------------------------- +// CCamCommandHandlerAo::~CCamCommandHandlerAo +// Destructor +// ----------------------------------------------------------------------------- +// +CCamCommandHandlerAo::~CCamCommandHandlerAo() + { + Cancel(); + iCommandQueue.Close(); + } + +// ----------------------------------------------------------------------------- +// CCamCommandHandlerAo::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamCommandHandlerAo* CCamCommandHandlerAo::NewL( CAknView* aView ) + { + CCamCommandHandlerAo* self = new( ELeave ) CCamCommandHandlerAo( aView ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CCamCommandHandlerAo::ConstructL +// 2nd phase construction +// ----------------------------------------------------------------------------- +// +void CCamCommandHandlerAo::ConstructL() + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CCamCommandHandlerAo::DoCancel +// Cancels the active object +// ----------------------------------------------------------------------------- +// +void CCamCommandHandlerAo::DoCancel() + { + iCommandQueue.Close(); + PRINT( _L("Camera => CCamCommandHandlerAo::DoCancel()") ); + } + +// ----------------------------------------------------------------------------- +// CCamCommandHandlerAo::RunL +// Checks the command from command queue and sends it to view +// ----------------------------------------------------------------------------- +// +void CCamCommandHandlerAo::RunL() + { + if ( iCommandQueue.Count() ) + { + TInt command = iCommandQueue[ 0 ]; + iCommandQueue.Remove( 0 ); + iView->HandleCommandL( command ); + } + } + +// ----------------------------------------------------------------------------- +// CCamCommandHandlerAo::RunError +// Called when an error has occurred. +// ----------------------------------------------------------------------------- +// +TInt CCamCommandHandlerAo::RunError( TInt aError ) + { + PRINT1( _L("Camera => CCamCommandHandlerAo::RunError( %d )"), aError ); + (void)aError; // remove compiler warning + + iCommandQueue.Close(); + + PRINT( _L("Camera <= CCamCommandHandlerAo::RunError()")); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCamCommandHandlerAo::HandleCommandL +// Adds the command to queue and sets active +// ----------------------------------------------------------------------------- +// +void CCamCommandHandlerAo::HandleCommandL( TInt aCommandId ) + { + PRINT( _L("Camera => CCamCommandHandlerAo::HandleCommandL()")); + + TInt count = iCommandQueue.Count(); + + if( count < 1 || iCommandQueue[ count - 1 ] != aCommandId ) + { + iCommandQueue.AppendL( aCommandId ); + } + + if ( !IsActive() ) + { + TRequestStatus* statusPtr = &iStatus; + User::RequestComplete( statusPtr, KErrNone ); + SetActive(); + } + + PRINT( _L("Camera <= CCamCommandHandlerAo::HandleCommandL()")); + } + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamContainerBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamContainerBase.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,895 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for all camera application containers* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +// System includes for changing the orientation. +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "CamContainerBase.h" +#include "CamAppController.h" +#include "CamLogger.h" +#include "CamUtility.h" +#include "CamAppUi.h" +#include "CamNaviCounterControl.h" +#include "CamNaviProgressBarControl.h" +#include "CamZoomPane.h" +#include "camactivepalettehandler.h" +#include "CameraUiConfigManager.h" +#include "CamViewBase.h" +#include "cambackupcontainer.h" + + static const TInt KCamBurstCounterLength = 2; + _LIT(KCamBurstCounterFormat, "%02d"); + +// ================= STATIC MEMBER VARIABLES ================ + +MActivePalette2UI* CCamContainerBase::iActivePalette = NULL; + +// ================= MEMBER FUNCTIONS ======================= + +// Destructor +CCamContainerBase::~CCamContainerBase() + { + PRINT( _L("Camera => ~CCamContainerBase") ); + delete iBgContext; + + + iPrimaryZoomInKeys.Close(); + iPrimaryZoomOutKeys.Close(); + iSecondaryZoomInKeys.Close(); + iSecondaryZoomOutKeys.Close(); + + iPrimaryCameraCaptureKeys.Close(); + iSecondaryCameraCaptureKeys.Close(); + + iPrimaryCameraAFKeys.Close(); + + delete iProcessingText; + delete iBurstProcessingText; + if(iBackupContainer) + { + delete iBackupContainer; + iBackupContainer = NULL; + } + + PRINT( _L("Camera <= ~CCamContainerBase") ); + } + +// --------------------------------------------------------------------------- +// CCamContainerBase::CCamContainerBase +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamContainerBase::CCamContainerBase( CCamAppController& aController, + CAknView& aView ) + : iView( aView ), + iController( aController ) + { + } + +// --------------------------------------------------------- +// CCamContainerBase::BaseConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamContainerBase::BaseConstructL( const TRect& aRect ) + { + CreateWindowL(); + SetRect( aRect ); + EnableDragEvents(); + + CCamAppUiBase* appUi = static_cast( iEikonEnv->EikAppUi() ); + iCamOrientation = appUi->CamOrientation(); + + // set up the skin background context + CreateBackgroundContextL(); + + iBackupContainer = CCamBackupContainer::NewL(iController,iView,*this); + + // zoom keys + iPrimaryZoomInKeys.Reset(); + iPrimaryZoomOutKeys.Reset(); + iSecondaryZoomInKeys.Reset(); + iSecondaryZoomOutKeys.Reset(); + + // capture keys + iPrimaryCameraCaptureKeys.Reset(); + iSecondaryCameraCaptureKeys.Reset(); + + // AF keys + iPrimaryCameraAFKeys.Reset(); + + if ( iController.UiConfigManagerPtr() ) + { + // Reading the zoom keys for primary and secondary camera + iController.UiConfigManagerPtr()-> + SupportedPrimaryCameraZoomInKeysL( iPrimaryZoomInKeys ); + iController.UiConfigManagerPtr()-> + SupportedPrimaryCameraZoomOutKeysL( iPrimaryZoomOutKeys ); + + // secondary camera zoom-in/out keys + iController.UiConfigManagerPtr()-> + SupportedSecondaryCameraZoomInKeysL( iSecondaryZoomInKeys ); + iController.UiConfigManagerPtr()-> + SupportedSecondaryCameraZoomOutKeysL( iSecondaryZoomOutKeys ); + + // Reading the capture keys for primary and secondary camera + iController.UiConfigManagerPtr()-> + SupportedPrimaryCameraCaptureKeyL( iPrimaryCameraCaptureKeys ); + + iController.UiConfigManagerPtr()-> + SupportedSecondaryCameraCaptureKeyL( iSecondaryCameraCaptureKeys ); + + // Reading AF or half capture key press Keys + iController.UiConfigManagerPtr()->SupportedPrimaryCameraAutoFocusKeyL( + iPrimaryCameraAFKeys ); + } + if ( iPrimaryZoomInKeys.Count() <= 0 || iPrimaryZoomOutKeys.Count() <= 0 || + iSecondaryZoomInKeys.Count() <= 0 || iSecondaryZoomOutKeys.Count() <= 0 || + iPrimaryCameraCaptureKeys.Count() <= 0 || iSecondaryCameraCaptureKeys.Count() <= 0 || + iPrimaryCameraAFKeys.Count() <= 0 + ) + { + // Leave here, if there are no configured items so that we dont panic + //in any container classes derived from this base class + User::Leave( KErrNotSupported ); + } + } + + +// --------------------------------------------------------- +// CCamContainerBase::IsCaptureKeyL +// Whether or not this key is considered to be a capture key +// in the current context +// --------------------------------------------------------- +// +TBool CCamContainerBase::IsCaptureKeyL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + PRINT1( _L( "Camera => CCamContainerBase::IsCaptureKey event type (%d)" ), aType ); + + // Find out if this key is a capture key + TBool isCaptureKey( EFalse) ; + + // Repeat events are not classed as capture keys + if ( aKeyEvent.iRepeats != 0 ) + { + PRINT( _L( "IsCaptureKey returning false (repeat)" ) ); + return isCaptureKey; + } + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi && appUi->AppInBackground( ETrue ) ) + { + PRINT( _L("IsCaptureKey returning false (AppInBackground() = true") ); + return isCaptureKey; + } + + if ( ECamActiveCameraPrimary == iController.ActiveCamera() ) + { + isCaptureKey = IsPrimaryCameraCaptureKey( aKeyEvent ); + } + else // secondary camera + { + isCaptureKey = IsSecondaryCameraCaptureKey( aKeyEvent ); + } + + // Each product defines which key/s are treated as capture keys. + // Different keys can be mapped for each active camera. + // Look for capture event or key up event (note that capture + // event is on the EEventKey for navi-key select press) + if ( isCaptureKey ) + { + if ( aType == EEventKeyDown || aType == EEventKey || aType == EEventKeyUp || aType == EEventKeyUp ) + { + if ( isCaptureKey && + ( iController.UiConfigManagerPtr()->IsKeyLockWatcherSupported() && iController.IsKeyLockOn() ) ) + { + isCaptureKey = !iController.IsKeyLockOn(); + } + } + else + { + // key types doesnt match so dont consider as capture key press. + isCaptureKey = EFalse; + } + } + PRINT1( _L( "IsCaptureKey returning %d" ), isCaptureKey ); + return isCaptureKey; + } + +// --------------------------------------------------------- +// CCamContainerBase::IsShutterKeyL +// Whether or not this key is considered to be a shutter key +// in the current context +// --------------------------------------------------------- +// +TBool CCamContainerBase::IsShutterKeyL( const TKeyEvent& aKeyEvent, TEventCode /* aType */ ) + { + PRINT1( _L( "Camera => CCamContainerBase::IsShutterKeyL scancode (%d)" ), aKeyEvent.iScanCode ); + + if ( iController.UiConfigManagerPtr() + && iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { +#ifndef __WINS__ + if ( aKeyEvent.iScanCode == iPrimaryCameraAFKeys[0] ) +#else + if ( aKeyEvent.iScanCode == EProductKeyCaptureHalf ) +#endif + { + return ETrue; + } + } + return EFalse; + } + + +// +// CCamZoomPane::CheckForZoomKey +// +TBool CCamContainerBase::CheckForZoomKey( const TKeyEvent& aKeyEvent ) + { + return CheckInZoomKeyArray( aKeyEvent ); + } + + +// +// +// +TBool CCamContainerBase::CheckInZoomKeyArray( const TKeyEvent& aKeyEvent ) + { + TCamActiveCamera camera = iController.ActiveCamera(); + TBool zoomKeyFound ( EFalse ); + + if ( camera == ECamActiveCameraPrimary ) + { + zoomKeyFound = ( KErrNotFound != + iPrimaryZoomInKeys.Find( aKeyEvent.iScanCode ) ); + if ( !zoomKeyFound ) + { + // Its not zoom-in key, check if its zoom out key + zoomKeyFound = ( KErrNotFound != + iPrimaryZoomOutKeys.Find( aKeyEvent.iScanCode ) ); + } + } + else if ( camera == ECamActiveCameraSecondary ) + { + zoomKeyFound = ( KErrNotFound != + iSecondaryZoomInKeys.Find( aKeyEvent.iScanCode ) ); + if ( !zoomKeyFound ) + { + // Its not zoom-in key, check if its zoom out key + zoomKeyFound = ( KErrNotFound != + iSecondaryZoomOutKeys.Find( aKeyEvent.iScanCode ) ); + } + } + else + { + // when we reach here, it means we have no zoom keys set, we return back. + } + return zoomKeyFound; + } + + +// --------------------------------------------------------- +// CCamContainerBase::IsZoomKeyL +// Whether or not this key is considered to be a shutter key +// in the current context +// --------------------------------------------------------- +// +TBool CCamContainerBase::IsZoomKeyL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + PRINT1( _L( "Camera => CCamContainerBase::IsZoomKeyL event type (%d)" ), aType ); + + CCamZoomPane* zoom = static_cast( iEikonEnv->EikAppUi() )->ZoomPane(); + + // + if( !ZoomAvailable() ) + { + return EFalse; + } + + PRINT( _L( "Camera => CCamContainerBase::IsZoomKeyL " ) ); + + // It's a possible zoom key if it's an up OR down event, OR + // if it's a key event AND we're currently zooming + if ( aType == EEventKeyUp || aType == EEventKeyDown || aType == EEventUser || + ( aType == EEventKey && + zoom && + zoom->IsCurrentlyZooming() ) ) + { + PRINT( _L( "Camera => CCamContainerBase::IsZoomKeyL A" ) ) + return CheckForZoomKey( aKeyEvent ); + } + + PRINT( _L( "Camera => CCamContainerBase::IsZoomKeyL no" ) ) + return EFalse; + } + + +// +// CCamContainerBase::ZoomAvailable() +// +TBool CCamContainerBase::ZoomAvailable() + { + PRINT( _L("Camera => CCamContainerBase::ZoomAvailable")) + + // Ignore any zoom keys that come when either capturing a burst or still + if ( iController.SequenceCaptureInProgress() + || ( ECamControllerImage == iController.CurrentMode() + && ECamCapturing == iController.CurrentOperation() ) + || ECamCompleting == iController.CurrentOperation() ) + { + PRINT( _L("Camera => CCamContainerBase::ZoomAvailable A false")) + return EFalse; + } + PRINT( _L("Camera => CCamContainerBase::ZoomAvailable yes")) + return ETrue; + } + +// --------------------------------------------------------------------------- +// Window +// --------------------------------------------------------------------------- +// +RWindow& +CCamContainerBase::Window() const + { + return CCoeControl::Window(); + } + + +// ---------------------------------------------------- +// CCamContainerBase::OfferKeyEventL +// Handles this application view's command keys. Forwards other +// keys to child control(s). +// ---------------------------------------------------- +// +TKeyResponse +CCamContainerBase::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + PRINT1( _L("Camera => CCamContainerBase::OfferKeyEventL scan code (%d)"), aKeyEvent.iScanCode ) + // if the cancel softkey is pressed + if ( aKeyEvent.iScanCode == EStdKeyDevice1 ) + { + iView.HandleCommandL( EAknSoftkeyCancel ); + } + // or if the select (OK) key is pressed + // + // (Note: intentionally ignoring repeat key presses here - this is a + // work-around as the framework is passing navi-key select repeats + // which we have to ignore) + else if ( aType == EEventKey && + aKeyEvent.iCode == EKeyOK && + aKeyEvent.iRepeats == 0 ) + { + iView.HandleCommandL( EAknSoftkeySelect ); + return EKeyWasConsumed; // indicate key press was processed + } + // stop video or sequence if get applications key press (short or long) + // in touch also send key stops + else if( aKeyEvent.iCode == EKeyApplication || + ( iController.IsTouchScreenSupported() && + aKeyEvent.iScanCode == EStdKeyYes ) ) + { + if ( ECamControllerVideo == iController.CurrentMode() ) + { + TCamCaptureOperation operation = iController.CurrentOperation(); + if( ECamCapturing == operation + || ECamPaused == operation ) + { + // Stop video + iController.StopVideoRecording(); + } + } + else if ( iController.SequenceCaptureInProgress() ) + { + // Stop sequence capture + iController.StopSequenceCaptureL(); + } + else + { + // empty statement to remove Lint error, MISRA required rule 60 + } + } + else + { + // empty statement to remove Lint error, MISRA required rule 60 + } + + return EKeyWasNotConsumed; // indicate key press was not processed + } + +// ---------------------------------------------------- +// CCamContainerBase::HandleForegroundEventL +// Called to notify of change of app fore/background state +// ---------------------------------------------------- +// +void CCamContainerBase::HandleForegroundEventL( TBool /*aForeground*/ ) + { + } + +// --------------------------------------------------------------------------- +// CCamContainerBase::MopSupplyObject +// Gets an object whose type is encapsulated by the specified TTypeUid object +// Supplies the skin context to child controls using the MObjectProvider chain +// --------------------------------------------------------------------------- +// +TTypeUid::Ptr CCamContainerBase::MopSupplyObject( TTypeUid aId ) + { + if ( aId.iUid == MAknsControlContext::ETypeId ) + { + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + return CCoeControl::MopSupplyObject( aId ); + } + +// ---------------------------------------------------- +// CCamContainerBase::HandleResourceChange +// Change Client Rect and redraw when resolution changes +// ---------------------------------------------------- +// +void CCamContainerBase::HandleResourceChange( TInt aType ) + { + PRINT( _L("Camera => CCamContainerBase::HandleResourceChange" )) + + CCamAppUi* appUi = static_cast( iEikonEnv->EikAppUi() ); + if ( KEikDynamicLayoutVariantSwitch == aType ) + { + TCamOrientation orientation = appUi->CamOrientation(); + + if( iCamOrientation != orientation ) + { + iCamOrientation = orientation; + if( orientation == ECamOrientationCamcorder || orientation == ECamOrientationCamcorderLeft ) + { + PRINT( _L("Camera => CCamContainerBase::HandleResourceChange camcorder" )) + SetRect( appUi->ApplicationRect() ); + } + else + { + PRINT( _L("Camera => CCamContainerBase::HandleResourceChange not camcorder" )) + SetRect( appUi->ClientRect() ); + } + } + } + + CCoeControl::HandleResourceChange( aType ); + if ( iController.IsTouchScreenSupported() ) + { + // Update toolbar because HandleResourceChange might reload the default version + // Only update toolbaricons if in precaptureview. + if( appUi->CurrentViewState() != ECamViewStatePostCapture ) + { + TRAP_IGNORE( static_cast( iView ).UpdateToolbarIconsL() ); + } + } + } + + +// virtual +void +CCamContainerBase::HandleAppEvent( const TCamAppEvent& /*aEvent*/ ) + { + // No action + } + + +// --------------------------------------------------------------------------- +// CCamContainerBase::SetPreviousViewId +// Sets the ID of the previous view +// --------------------------------------------------------------------------- +// +void CCamContainerBase::SetPreviousViewId( TCamAppViewIds aId ) + { + iPrevViewId = aId; + } + + +// --------------------------------------------------------- +// CCamContainerBase::SetupNaviPanesL +// Set up navi-pane and progress bar if required +// --------------------------------------------------------- +// +void CCamContainerBase::SetupNaviPanesL( TCamActiveNaviPane aNaviPane ) + { + PRINT( _L("Camera => CCamContainerBase::SetupNaviPanesL" )) + TRect rect( Rect() ); + + if( aNaviPane == ECamPaneCounter ) + { + iNaviCounterControl = + static_cast( CEikonEnv::Static()->AppUi() )->NaviCounterControl(); + iNaviCounterControl->SetMopParent( this ); + iNaviCounterControl->SetContainerWindowL( *this ); + iNaviCounterControl->SetRect( Rect() ); + iNaviCounterControl->MakeVisible( ETrue ); + if ( iNaviProgressBarControl ) + { + iNaviProgressBarControl->MakeVisible( EFalse ); + } + + iPaneInUse = ECamPaneCounter; + } + else if( aNaviPane == ECamPaneProgress ) + { + PRINT( _L("Camera => CCamContainerBase::SetupNaviPanesL progress" )) + iNaviProgressBarControl = + static_cast( CEikonEnv::Static()->AppUi() )->NaviProgressBarControl(); + iNaviProgressBarControl->SetMopParent( this ); + iNaviProgressBarControl->SetContainerWindowL( *this ); + iNaviProgressBarControl->SetRect( Rect() ); + iNaviProgressBarControl->MakeVisible( ETrue ); + if ( iNaviCounterControl ) + { + iNaviCounterControl->MakeVisible( EFalse ); + } + + iPaneInUse = ECamPaneProgress; + } + else + { + iPaneInUse = ECamPaneUndefined; + } + PRINT( _L("Camera <= CCamContainerBase::SetupNaviPanesL" )) + } + +// --------------------------------------------------------------------------- +// CCamContainerBase::ShowZoomPaneWithTimer +// Makes Zoom Pane visible for the period of the pane timer. +// --------------------------------------------------------------------------- +// +void CCamContainerBase::ShowZoomPaneWithTimer() + { + // No implementation: only meaningful in pre-capture modes + PRINT(_L("Camera => CCamContainerBase::ShowZoomPaneWithTimer() - No implementation!")); + } + +// --------------------------------------------------------------------------- +// CCamContainerBase::CreateActivePaletteL +// Creates the Active Palette control +// --------------------------------------------------------------------------- +// +void CCamContainerBase::CreateActivePaletteL() + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + appUi->APHandler()->CreateActivePaletteL( *this, this ); + iActivePalette = appUi->ActivePalette(); + } + +// --------------------------------------------------------------------------- +// CCamContainerBase::DestroyActivePaletteL +// Destroys the Active Palette control +// --------------------------------------------------------------------------- +// +void CCamContainerBase::DestroyActivePalette() + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + appUi->APHandler()->DestroyActivePalette(); + iActivePalette = NULL; + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::Redraw +// ----------------------------------------------------------------------------- +void CCamContainerBase::Redraw(const TRect& /*aArea*/) + { + // Do nothing by default; may be overridden + } + + + +// ----------------------------------------------------------------------------- +// CCamContainerBase::PrepareProcessingTextL +// ----------------------------------------------------------------------------- +// +void CCamContainerBase::PrepareProcessingTextL( TBool aStillMode ) + { + TAknLayoutRect vidProgressPane; + + TInt cba = AknLayoutUtils::CbaLocation() == + AknLayoutUtils::EAknCbaLocationLeft? + AknLayoutUtils::EAknCbaLocationLeft : 0; + + if ( CamUtility::IsNhdDevice() ) + { + vidProgressPane.LayoutRect( Rect(), + AknLayoutScalable_Apps::vid4_progress_pane( + Layout_Meta_Data::IsLandscapeOrientation() ) ); + + iProcessingTextLayout.LayoutText( vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_t3()); + } + else + { + vidProgressPane.LayoutRect( Rect(), + AknLayoutScalable_Apps::vid6_indi_pane( cba ) ); + + iProcessingTextLayout.LayoutText( vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 )); + } + + // Delete old text + if( iProcessingText ) + { + delete iProcessingText; + iProcessingText = NULL; + } + if( aStillMode ) + { + iProcessingText = StringLoader::LoadL( R_QTN_PROCESSING_IMAGE_TEXT ); + } +/* + else + { + iProcessingText = StringLoader::LoadL( R_QTN_PROCESSING_VIDEO_TEXT ); + } +*/ + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::DismissProcessingTextL +// ----------------------------------------------------------------------------- +// +void CCamContainerBase::DismissProcessingText() + { + delete iProcessingText; + iProcessingText = NULL; + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::PrepareBurstProcessingTextL +// ----------------------------------------------------------------------------- +// +void CCamContainerBase::PrepareBurstProcessingTextL() + { + PRINT( _L("Camera => CCamContainerBase::PrepareBurstProcessingTextL" )) + TAknLayoutRect vidProgressPane; + + TInt cba = AknLayoutUtils::CbaLocation() == + AknLayoutUtils::EAknCbaLocationLeft? + AknLayoutUtils::EAknCbaLocationLeft : 0; + + + if ( CamUtility::IsNhdDevice() ) + { + vidProgressPane.LayoutRect( + Rect(), + AknLayoutScalable_Apps::vid4_progress_pane( + Layout_Meta_Data::IsLandscapeOrientation() ) ); + + iBurstProcessingTextLayout.LayoutText( + vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_t3() ); + } + else + { + + vidProgressPane.LayoutRect( + Rect(), + AknLayoutScalable_Apps::vid6_indi_pane( cba ) ); + + iBurstProcessingTextLayout.LayoutText( + vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); + + } + + // Delete old text + if( iBurstProcessingText ) + { + delete iBurstProcessingText; + iBurstProcessingText = NULL; + } + iBurstProcessingText = StringLoader::LoadL( + R_QTN_PROCESSING_IMAGE_TEXT ); + PRINT( _L("Camera <= CCamContainerBase::PrepareBurstProcessingTextL" )) + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::UpdateBurstProcessingTextL +// ----------------------------------------------------------------------------- +// +void CCamContainerBase::UpdateBurstProcessingTextL( TInt aHandled, TInt aTotal ) + { + PRINT( _L("Camera => CCamContainerBase::UpdateBurstProcessingTextL" )) + + // Delete old text + if( iBurstProcessingText ) + { + delete iBurstProcessingText; + iBurstProcessingText = NULL; + } + CDesCArrayFlat* values + = new (ELeave) CDesCArrayFlat( 2 ); + + CleanupStack::PushL( values ); + + TBuf handled; + TBuf total; + handled.Format( KCamBurstCounterFormat, aHandled ); + total.Format( KCamBurstCounterFormat, aTotal ); + + values->AppendL( handled ); + values->AppendL( total ); + +#ifndef __WINS__ + iBurstProcessingText = StringLoader::LoadL( + R_QTN_PROCESSING_BURST_IMAGE_TEXT, *values ); +#endif + + CleanupStack::PopAndDestroy( values ); + PRINT( _L("Camera <= CCamContainerBase::UpdateBurstProcessingTextL" )) + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::DismissBurstProcessingText +// ----------------------------------------------------------------------------- +// +void CCamContainerBase::DismissBurstProcessingText() + { + delete iBurstProcessingText; + iBurstProcessingText = NULL; + } + +// ---------------------------------------------------- +// CCamContainerBase::CheckForFileName +// +// ---------------------------------------------------- +// +void CCamContainerBase::CheckForFileName( TBool aDoCheck ) + { + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::CreateBackgroundContextL +// ----------------------------------------------------------------------------- +// +void CCamContainerBase::CreateBackgroundContextL() + { + if( iCamOrientation == ECamOrientationCamcorder || + iCamOrientation == ECamOrientationCamcorderLeft ) + { + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgScreen, Rect(), EFalse ); + } + else + { + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgAreaMain, Rect(), EFalse ); + } + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::ViewFinderFrameRect +// ----------------------------------------------------------------------------- +// +TRect +CCamContainerBase::ViewFinderFrameRect(TCamCameraMode aTargetMode) const + { + PRINT( _L("Camera => CCamContainerBase::ViewFinderFrameRect") ); + const TCamAppViewIds viewId = static_cast( iView.Id().iUid ); + + TCamCameraMode cameraMode = (aTargetMode != ECamControllerIdle) + ? aTargetMode + : iController.CurrentMode(); + + // In post capture view both target and current mode can be in idle mode, which + // would cause the use of invalid viewfinder layouts + if ( viewId == ECamViewIdVideoPostCapture && cameraMode == ECamControllerIdle ) + { + cameraMode = ECamControllerVideo; + } + else if ( viewId == ECamViewIdStillPostCapture && cameraMode == ECamControllerIdle ) + { + cameraMode = ECamControllerImage; + } + + const TInt resolution = (cameraMode == ECamControllerVideo) + ? iController.GetCurrentVideoResolution() + : iController.GetCurrentImageResolution(); + + TRect rect = CamUtility::ViewfinderLayout( cameraMode, resolution ); + PRINT( _L("Camera <= CCamContainerBase::ViewFinderFrameRect") ); + return rect; + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::IsPrimaryCameraCaptureKey +// ----------------------------------------------------------------------------- +// +TBool CCamContainerBase::IsPrimaryCameraCaptureKey( const TKeyEvent& aKeyEvent ) const + { + TBool isCapturekey( KErrNotFound != iPrimaryCameraCaptureKeys.Find( aKeyEvent.iScanCode ) ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi + && ( !appUi->IsToolBarVisible() || !appUi->DrawPreCaptureCourtesyUI() ) + && ( aKeyEvent.iScanCode == EStdKeyDevice3 + || aKeyEvent.iScanCode == EStdKeyEnter ) + && !static_cast(&iView)->IsPostCapture() ) { + isCapturekey = ETrue; + } + return isCapturekey; + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::IsSecondaryCameraCaptureKey +// ----------------------------------------------------------------------------- +// +TBool CCamContainerBase::IsSecondaryCameraCaptureKey( const TKeyEvent& aKeyEvent ) const + { + TBool isCapturekey( KErrNotFound != iSecondaryCameraCaptureKeys.Find( aKeyEvent.iScanCode ) ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi + && !appUi->IsToolBarVisible() + && ( aKeyEvent.iScanCode == EStdKeyDevice3 + || aKeyEvent.iScanCode == EStdKeyEnter ) + && !static_cast(&iView)->IsPostCapture() ) { + isCapturekey = ETrue; + } + return isCapturekey; + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::CountComponentControls +// ----------------------------------------------------------------------------- +// +TInt CCamContainerBase::CountComponentControls() const + { + TInt index = 0; + if(iBackupContainer) + index++; + return index; + } + +// ----------------------------------------------------------------------------- +// CCamContainerBase::ComponentControl +// ----------------------------------------------------------------------------- +// +CCoeControl* CCamContainerBase::ComponentControl(TInt aIndex) const + { + CCoeControl* control = NULL; + switch(aIndex) + { + case 0: + { + control = iBackupContainer; + } + break; + default: + break; + } + return control; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamContextAwareSettingItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamContextAwareSettingItem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item type for CAknEnumeratedItems.* +*/ + + + +// INCLUDE FILES +#include + +#include +#include + +#include "CamContextAwareSettingItem.h" +#include "CamAppController.h" +#include "CamContextAwareSettingPage.h" +#include "camlogging.h" + +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// CCamContextAwareSettingItem::CCamContextAwareSettingItem +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamContextAwareSettingItem::CCamContextAwareSettingItem( CCamAppController& aController, + TInt aSettingItemId, + TInt& aValue ) +: CAknEnumeratedTextPopupSettingItem( aSettingItemId, aValue ), iController( aController ) + { + } + +// --------------------------------------------------------------------------- +// CCamContextAwareSettingItem::CreateSettingPageL +// Creates setting page that switches cba depending on setting value +// that user navigates to. +// --------------------------------------------------------------------------- +// +CAknSettingPage* CCamContextAwareSettingItem::CreateSettingPageL() + { + TPtrC settingName = SettingName(); + TInt editorControlType = EAknCtPopupSettingList; + return new ( ELeave ) CCamContextAwareSettingPage( + &settingName, SettingNumber(), editorControlType, + SettingEditorResourceId(), SettingPageResourceId(), + *QueryValue(), *this, iController ); + } + +// --------------------------------------------------------------------------- +// CCamContextAwareSettingItem::CompleteConstructionL +// Determines whether or not the value list is to be limited (visually) +// and replaces the popup text array with a new array created from the +// revised resource id. +// --------------------------------------------------------------------------- +// +void CCamContextAwareSettingItem::CompleteConstructionL() + { + const TInt KSettingItemArrayGranularity = 5; + + CAknEnumeratedTextPopupSettingItem::CompleteConstructionL(); + // Check if limitation applies + TInt aRevisedResourceId; + if ( !iController.AllOptionsVisibleForSettingItem( Identifier(), aRevisedResourceId ) ) + { + // Construct the array + CArrayPtr* enumeratedTextArray; + enumeratedTextArray = new( ELeave ) CArrayPtrFlat( KSettingItemArrayGranularity ); + CleanupStack::PushL( enumeratedTextArray ); + + // Construct a dummy array for popup text, needed to avoid a panic + CArrayPtr* popupTextArray; + popupTextArray = new( ELeave ) CArrayPtrFlat( KSettingItemArrayGranularity ); + CleanupStack::PushL( popupTextArray ); + + // Read in the texts to be used in the setting item list + TResourceReader reader; + CEikonEnv::Static()->CreateResourceReaderLC( reader, aRevisedResourceId ); + TInt numberOfItems = reader.ReadInt16(); // item count + + TInt index = 0; + // Loop through all the texts + for ( index = 0; index < numberOfItems ; ++index ) + { + TInt value = reader.ReadInt16(); + TPtrC text = reader.ReadTPtrC(); // LTEXT name; + HBufC* thisText = text.AllocLC(); + TPtr thisTextDes = thisText->Des(); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( thisTextDes ); + CAknEnumeratedText* enumeratedText = new( ELeave ) CAknEnumeratedText( value, thisText ); + CleanupStack::Pop( thisText ); + CleanupStack::PushL( enumeratedText ); + enumeratedTextArray->AppendL( enumeratedText ); + CleanupStack::Pop( enumeratedText ); + } + + CleanupStack::PopAndDestroy(); // reader + SetEnumeratedTextArrays( enumeratedTextArray, popupTextArray ); + CleanupStack::Pop( popupTextArray ); + CleanupStack::Pop( enumeratedTextArray ); + } + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamContextAwareSettingPage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamContextAwareSettingPage.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for CAknEnumeratedItems.* +*/ + + + +// INCLUDE FILES +#include +#include "CamContextAwareSettingPage.h" +#include "CamAppController.h" +#include "CamAppUiBase.h" +#include "camlogging.h" + +// CONSTANTS + + +// ============================ MEMBER FUNCTIONS =============================== +// --------------------------------------------------------------------------- +// CCamContextAwareSettingPage::CCamContextAwareSettingPage +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamContextAwareSettingPage::CCamContextAwareSettingPage( + const TDesC* aSettingText, + TInt aSettingNumber, + TInt aControlType, + TInt aEditorResourceId, + TInt aSettingPageResourceId, + MAknQueryValue& aQueryValue, + CAknEnumeratedTextPopupSettingItem& aParent, + CCamAppController& aController ) + : CAknPopupSettingPage( aSettingText, aSettingNumber, aControlType, + aEditorResourceId, aSettingPageResourceId, aQueryValue ), + iParent( aParent ), iController( aController ) + { + } + +/** +* Destructor +*/ +CCamContextAwareSettingPage::~CCamContextAwareSettingPage() + { + PRINT( _L("Camera => ~CCamContextAwareSettingPage") ); + if ( iTimer ) + { + iTimer->Cancel(); + delete iTimer; + } + + TRAP_IGNORE( iController.CancelPreviewChangesL() ); + PRINT( _L("Camera <= ~CCamContextAwareSettingPage") ); + } + +// --------------------------------------------------------------------------- +// CCamContextAwareSettingPage::ConstructL +// Construct the setting page +// --------------------------------------------------------------------------- +// +void CCamContextAwareSettingPage::ConstructL() + { + CAknPopupSettingPage::ConstructL(); + // create the timer used for callbacks + iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + } + +// --------------------------------------------------------------------------- +// CCamContextAwareSettingPage::PostDisplayCheckL +// Pushes the navicounter onto the navipane, and then calls the base class +// PostDisplayCheckL() +// --------------------------------------------------------------------------- +// +TBool CCamContextAwareSettingPage::PostDisplayCheckL() + { + // This appears to be the best place to push the navicounter, + // so that it overwrites the navipane created by the + // CAknSettinPage::ExecuteLD() + CCamAppUiBase* appUi = (CCamAppUiBase*)iEikonEnv->EikAppUi(); + appUi->PushNaviPaneCounterL(); + + return CAknPopupSettingPage::PostDisplayCheckL(); + } + +// --------------------------------------------------------------------------- +// CCamContextAwareSettingPage::UpdateSettingL +// Called when the state of the list box changes. +// --------------------------------------------------------------------------- +// +void CCamContextAwareSettingPage::UpdateSettingL() + { + // Determine whether the currently highlighted list item + // is enabled or not, and update the cba. + // ...Get the current list item index. + TInt currentIndex = ListBoxControl()->View()->CurrentItemIndex(); + // ...Dertemine the settings model id associated with the current + // ...list item. + iCurrentVal = iParent.EnumeratedTextArray()-> + At( currentIndex )->EnumerationValue(); + // ...Determine whether the settings model value is enabled or disabled. + TBool settingValueEnabled = + iController.SettingValueEnabled( iParent.Identifier(), iCurrentVal ); + // ...Inform the base setting page class, and update the cba + SetDataValidity( settingValueEnabled ); + UpdateCbaL(); + + // If the list item is enabled update the navi-pane to + // let the user know how this item would affect the available photo + // counter. + if ( settingValueEnabled ) + { + if ( iTimer->IsActive() ) + { + iTimer->Cancel(); + } + iTimer->Start( 0, 0, TCallBack( PreviewSettingChange, this ) ); + } + } + +// --------------------------------------------------------------------------- +// CCamContextAwareSettingPage::ProcessCommandL +// Processes events from the softkeys. +// --------------------------------------------------------------------------- +// +void CCamContextAwareSettingPage::ProcessCommandL(TInt aCommandId) + { + HideMenu(); + + // Respond to softkey events + switch (aCommandId) + { + case EAknSoftkeyOk: + case EAknSoftkeySelect: + SelectCurrentItemL(); // has non-trivial implementations in listbox type + // controls to put the selection on the current item + AttemptExitL( ETrue ); + iController.CommitPreviewChanges(); + break; + case EAknSoftkeyCancel: + AttemptExitL( EFalse ); + iController.CancelPreviewChangesL(); + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CCamContextAwareSettingPage::PreviewSettingChangeL +// Previews the setting value +// --------------------------------------------------------------------------- +// +TInt CCamContextAwareSettingPage::PreviewSettingChange( TAny* aAny ) + { + CCamContextAwareSettingPage* settingPage = + static_cast( aAny ); + + // preview the setting value - will + // update the engine and the navi couner + TRAPD( ignore, settingPage->iController.PreviewSettingChangeL( + settingPage->iParent.Identifier(), settingPage->iCurrentVal ) ); + + if(ignore) + { + // Lint error removal + } + + // cancel the timer + settingPage->iTimer->Cancel(); + + return KErrNone; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamDecorator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamDecorator.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,301 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera UI decorator* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Cam.hrh" +#include "CamAppController.h" +#include "CamAppUi.h" +#include "CamObservable.h" +#include "CamRecordingIconDecoration.h" +#include "CamDecorator.h" +#include "camlogging.h" +#include "CameraUiConfigManager.h" +#include "CamUtility.h" + +// ----------------------------------------------------------------------------- +// CCamDecorator::CCamDecorator() +// Default constructor +// ----------------------------------------------------------------------------- +// +CCamDecorator::CCamDecorator( CCamAppController& aController ) + : iController( aController ) + { + } + +// ----------------------------------------------------------------------------- +// CCamDecorator::NewL +// Factory method to safely create a new instance +// ----------------------------------------------------------------------------- +// +CCamDecorator* +CCamDecorator::NewL( CCamAppController& aController, + TInt aResourceId, + MCamObserver* aObserver /*=NULL*/ ) + { + CCamDecorator* me = + new (ELeave) CCamDecorator( aController ); + + CleanupStack::PushL( me ); + me->ConstructL( aResourceId, aObserver ); + CleanupStack::Pop( me ); + + return me; + } + +// ----------------------------------------------------------------------------- +// CCamDecorator::ConstructL +// Initializes a new instance +// ----------------------------------------------------------------------------- +// +void CCamDecorator::ConstructL(TInt aResourceId, MCamObserver* aObserver) + { + if ( aResourceId ) + { + iPossibleObserver = aObserver; + + TResourceReader reader; + CEikonEnv::Static()->CreateResourceReaderLC( reader, aResourceId ); + + TInt numDecorations = reader.ReadInt16(); + + TInt currentDecoration = 0; + TScreenDecorationType decorationType; + for ( currentDecoration = 0; currentDecoration < numDecorations; currentDecoration++ ) + { + decorationType = static_cast(reader.ReadInt16()); + + switch(decorationType) + { + case ECamScreenDecorationBlendedBackground: + CreateBlendedBackgroundL(reader); + break; + + case ECamScreenDecorationDVFBlanker: + CreateDVFBlankerL(reader); + break; + + case ECamScreenDecorationRecordingIcon: + CreateRecordingIconL(reader); + break; + + default: + break; + } + } + + CleanupStack::PopAndDestroy(); + + } + else + { + iDrawNothing = ETrue; + } + } + +// ----------------------------------------------------------------------------- +// CCamDecorator::~CCamDecorator() +// Destructor +// ----------------------------------------------------------------------------- +// +CCamDecorator::~CCamDecorator() + { + PRINT( _L("Camera => ~CCamDecorator") ); + iDVFBlankers.Reset(); + iRecordingIcons.ResetAndDestroy(); + PRINT( _L("Camera <= ~CCamDecorator") ); + } + +// ----------------------------------------------------------------------------- +// CCamDecorator::Draw +// Draws all the decorations +// ----------------------------------------------------------------------------- +// +void CCamDecorator::Draw( CBitmapContext& aGc, const TRect& aDrawRect, const TBool aForceBlankers ) + { + if ( !iDrawNothing ) + { + TInt element = 0; + TInt count = 0; + + // Draw the blankers + count = iDVFBlankers.Count(); + + if ( count > 0 ) + { + TRgb blankerColour( KRgbWhite ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi && appUi->IsDirectViewfinderActive()) + { + blankerColour = KRgbWhite; + + aGc.SetPenStyle( CGraphicsContext::ENullPen ); + aGc.SetBrushColor( blankerColour ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + + for ( element = 0; element < count; element++ ) + { + aGc.DrawRect( iDVFBlankers[element] ); + } + + aGc.Reset(); + } + } + + if ( aForceBlankers ) + { + count = iDVFBlankers.Count(); + if ( count > 0 ) + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + CWindowGc& gc = CCoeEnv::Static()->SystemGc(); + for ( element = 0; element < count; element++ ) + { + AknsDrawUtils::Background( skin, NULL, gc, iDVFBlankers[element] ); + } + } + } + + // Draw the recording icons + count = iRecordingIcons.Count(); + for ( element = 0; element < count; element++ ) + { + iRecordingIcons[element]->Draw( aGc, aDrawRect ); + } + } + } + +// ----------------------------------------------------------------------------- +// CCamDecorator::CreateBlendedBackgroundL +// Create a new blended background decoration based on resource +// ----------------------------------------------------------------------------- +// +void CCamDecorator::CreateBlendedBackgroundL(TResourceReader& aResourceReader) + { + PRINT( _L("Camera => CCamDecorator::CreateBlendedBackgroundL") ); + aResourceReader.ReadInt16(); // tl_x + aResourceReader.ReadInt16(); // tl_y + aResourceReader.ReadInt16(); // width + + /* + CBlendedBackground* blendedBackground = CBlendedBackground::NewL( TPoint(tl_x, tl_y), width, KBlendedBackgroundDisplayMode ); + + CleanupStack::PushL( blendedBackground ); + + User::LeaveIfError(iBlendedBackgrounds.Append(blendedBackground)); + + CleanupStack::Pop( blendedBackground ); + */ + + PRINT( _L("Camera <= CCamDecorator::CreateBlendedBackgroundL") ); + } + +// ----------------------------------------------------------------------------- +// CCamDecorator::CreateDVFBlankerL +// Create a new dvf blanker decoration based on resource +// ----------------------------------------------------------------------------- +// +void CCamDecorator::CreateDVFBlankerL(TResourceReader& aResourceReader) + { + PRINT( _L("Camera => CCamDecorator::CreateDVFBlankerL") ); + TInt tl_x = aResourceReader.ReadInt16(); + TInt tl_y = aResourceReader.ReadInt16(); + TInt width = aResourceReader.ReadInt16(); + TInt height = aResourceReader.ReadInt16(); + + TRect blanker(TPoint(tl_x, tl_y), TSize(width, height)); + + User::LeaveIfError(iDVFBlankers.Append(blanker)); + PRINT( _L("Camera <= CCamDecorator::CreateDVFBlankerL") ); + } + +// ----------------------------------------------------------------------------- +// CCamDecorator::CreateRecordingIconL +// Create a new recording icon decoration based on resource +// ----------------------------------------------------------------------------- +// +void CCamDecorator::CreateRecordingIconL(TResourceReader& /* aResourceReader */) + { + PRINT( _L("Camera => CCamDecorator::CreateRecordingIconL") ); + + TRect screenRect; + if ( Layout_Meta_Data::IsLandscapeOrientation() || CamUtility::IsNhdDevice() ) + { + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); + } + else + { + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); + } + + TAknLayoutRect progressPaneLayout; + TAknLayoutRect recIconLayout; + TInt vari = Layout_Meta_Data::IsLandscapeOrientation(); + if ( CamUtility::IsNhdDevice() ) + { + progressPaneLayout.LayoutRect( screenRect, + AknLayoutScalable_Apps::vid4_progress_pane( vari ) ); + + recIconLayout.LayoutRect( progressPaneLayout.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_g3( !vari ) ); + } + else + { + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + progressPaneLayout.LayoutRect( screenRect, + AknLayoutScalable_Apps::vid6_indi_pane( !vari ) ); + recIconLayout.LayoutRect( progressPaneLayout.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g5( vari ) ); + + } + else + { + progressPaneLayout.LayoutRect( screenRect, + AknLayoutScalable_Apps::vid6_indi_pane( 3 ) ); + recIconLayout.LayoutRect( progressPaneLayout.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g5( 2 ) ); + } + } + + TRect location = recIconLayout.Rect(); + + CCamRecordingIconDecoration* recIcon = + CCamRecordingIconDecoration::NewL( location, iController ); + + CleanupStack::PushL( recIcon ); + + if ( iPossibleObserver ) + { + recIcon->RegisterObserverL(iPossibleObserver); + } + + User::LeaveIfError(iRecordingIcons.Append(recIcon)); + + CleanupStack::Pop( recIcon ); + PRINT( _L("Camera <= CCamDecorator::CreateRecordingIconL") ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamDefaultNameSettingItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamDefaultNameSettingItem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item type for CAknEnumeratedItems.* +*/ + + + +// INCLUDE FILES +#include "CamDefaultNameSettingItem.h" +#include "Camdefaultnamesettingpage.h" + +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== +// --------------------------------------------------------------------------- +// CCamDefaultNameSettingItem::CCamDefaultNameSettingItem +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamDefaultNameSettingItem::CCamDefaultNameSettingItem( + TDes& aNameBase, + TCamCameraMode aMode, + TInt aIdentifier, + TInt& aValue ) +: CAknEnumeratedTextPopupSettingItem( aIdentifier, aValue ), + iNameBase( aNameBase ), + iMode( aMode ) + { + } + + +// --------------------------------------------------------------------------- +// CCamDefaultNameSettingItem::~CCamDefaultNameSettingItem +// Destructor. +// --------------------------------------------------------------------------- +// +CCamDefaultNameSettingItem::~CCamDefaultNameSettingItem() + { + } + + +// --------------------------------------------------------------------------- +// CCamDefaultNameSettingItem::CreateSettingPageL +// Framework method for constructing the launching setting page. +// --------------------------------------------------------------------------- +// +CAknSettingPage* CCamDefaultNameSettingItem::CreateSettingPageL() + { + // Create an instance of our customized setting page. + + TPtrC settingName = SettingName(); + return new( ELeave )CCamDefaultNameSettingPage( + iNameBase, + iMode, + &settingName, + SettingNumber(), + EAknCtPopupSettingList, + SettingEditorResourceId(), + SettingPageResourceId(), + *QueryValue() ); + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamDocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamDocument.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1095 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Document class for Camera Application* +*/ + +#include "camlogging.h" +#include "CamLogger.h" + +#ifdef _DEBUG +#include + + +//#define _AO_TRACKING +#ifdef _AO_TRACKING + +static void ReplaceCurrentASL(); +static void RestoreCurrentAS(); + +class CFilterScheduler; + +class CFilterInfo : public CBase + { + friend class CFilterScheduler; + +public: + static CFilterInfo* NewL(); + +protected: + struct CFilterStruct + { + CFilterStruct(CActive* aActiveAddPointer, char* aActiveLogInfo, + CFilterStruct* aLink); + CActive *iActiveAddPointer; + char *iActiveLogInfo; + CFilterStruct *iLink; + }; + +protected: + CFilterInfo(); + void ConstructL(); + void AddInfoL(CActive* aActiveAddPointer, char* aActiveLogInfo, + CFilterStruct * &aLink); + char* FindInfo(CActive *); + ~CFilterInfo(); +protected: + struct CFilterStruct *iFiSHead; + + }; + +class CFilterScheduler : public CActiveScheduler + { + friend void ReplaceCurrentASL(); + friend void RestoreCurrentAS(); + +public: + static CFilterScheduler* NewL(); +private: + static CActiveScheduler* iSavedFS; +public: + using CActiveScheduler::Start; + // It is used as a hook, which makes possible to collect meaningful + // information about every active object + virtual TInt Extension_(TUint aUid, TAny*& a0, TAny* a1); +protected: + void ConstructL(); + CFilterScheduler(); + ~CFilterScheduler(); + + void DebugPrint(); + char* FindInfo(CActive *); + // it has to default to CActiveScheduler implementations + virtual void WaitForAnyRequest(); + // it has to default to CActiveScheduler implementations + virtual void Error(TInt aError) const; + // It has to be implemented since this is a concrete class + virtual void OnStarting() + { + } + virtual void OnStopping() + { + } + virtual void Reserved_1() + { + } + virtual void Reserved_2() + { + } +private: + CFilterInfo *iFilterInfo; + }; + +CActiveScheduler* CFilterScheduler::iSavedFS= NULL; + +CFilterInfo* CFilterInfo::NewL() + { + CFilterInfo* self = new( ELeave ) CFilterInfo(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +void CFilterInfo::AddInfoL(CActive* aActiveAddPointer, char* aActiveLogInfo, + CFilterInfo::CFilterStruct* &aLink) + { + PRINT( _L("Camera => CFilterInfo::AddInfoL") ); + CFilterStruct *pFiS = new( ELeave ) CFilterStruct( aActiveAddPointer, + aActiveLogInfo, aLink ); + pFiS->iLink = aLink; + aLink = pFiS; + } + +char* CFilterInfo::FindInfo(CActive *aActive) + { + char *pInfo = (char *)NULL; + CFilterStruct *pFiS = iFiSHead; + while (pFiS != NULL) + { + if (pFiS->iActiveAddPointer == aActive) + { + pInfo = pFiS->iActiveLogInfo; + break; + } + pFiS = pFiS->iLink; + } + return pInfo; + } + +CFilterInfo::CFilterStruct::CFilterStruct(CActive* aActiveAddPointer, + char* aActiveLogInfo, CFilterInfo::CFilterStruct* aLink) + { + iActiveAddPointer = aActiveAddPointer; + iActiveLogInfo = aActiveLogInfo; + iLink = aLink; + } + +void CFilterInfo::ConstructL() + { + } + +CFilterInfo::CFilterInfo() + { + iFiSHead = NULL; + } + +CFilterInfo::~CFilterInfo() + { + } + +CFilterScheduler* CFilterScheduler::NewL() + { + CFilterScheduler* self = new( ELeave ) CFilterScheduler(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +void ReplaceCurrentASL() + { + CFilterScheduler *fSH = CFilterScheduler::NewL(); + //if (fSH != NULL) + CFilterScheduler::iSavedFS = CActiveScheduler::Replace(fSH); + } + +void RestoreCurrentAS() + { + + if (CFilterScheduler::iSavedFS != NULL) + { + CActiveScheduler *iFS = + CActiveScheduler::Replace(CFilterScheduler::iSavedFS); + delete iFS; + } + + } + +TInt CFilterScheduler::Extension_(TUint aUid, TAny*& a0, TAny* a1) + { + if (aUid == 0) + { + TRAPD( rr, iFilterInfo->AddInfoL( (CActive *)a0, (char *)a1, + iFilterInfo->iFiSHead ) ); + return rr; + } + return KErrExtensionNotSupported;; + } + +void CFilterScheduler::WaitForAnyRequest() + { + // Here is the printout at every wait + DebugPrint(); + if (iSavedFS) + iSavedFS->WaitForAnyRequest(); + else + User::WaitForAnyRequest(); + } + +void CFilterScheduler::Error(TInt aError) const + { + if (iSavedFS) + iSavedFS->Error(aError); + } + +CFilterScheduler::CFilterScheduler() + { + } + +CFilterScheduler::~CFilterScheduler() + { + iSavedFS = NULL; + } + +void CFilterScheduler::ConstructL() + { + /* iActive = CFilterActive::NewL( this ); */ + iFilterInfo = CFilterInfo::NewL(); + } + +char* CFilterScheduler::FindInfo(CActive * aA) + { + char *pFI= NULL; + if (iFilterInfo) + pFI = iFilterInfo->FindInfo(aA); + return pFI; + } + +void CFilterScheduler::DebugPrint() + { + RDebug::Print( _L( " Camera => CFilterScheduler::DebugPrint" )); + TDblQueIter q(iActiveQ); + q.SetToFirst(); + while (q != NULL) + { + CActive *pR = q++; + /* TInt pri = pR->iLink.iPriority; */ + TInt pri = pR->Priority(); + TInt stat = pR->iStatus.Int(); // TRequestStatus + // find active objects identification string otherwise + // print it's address + char *pText = FindInfo(pR); + + if (pR->IsActive() ) + { + if (stat == KRequestPending) + { + // active, pending + if (pText) + RDebug::Printf( + "Camera: CFilterScheduler::DebugPrint: %s - active/pending - priority: %d - req status: %d", + pText, pri, stat); + else + RDebug::Printf( + "Camera: CFilterScheduler::DebugPrint: %x - active/pending - priority: %d - req status: %d", + (TInt)pR, pri, stat); + } + else + { + // active, not pending + if (pText) + RDebug::Printf( + "Camera: CFilterScheduler::DebugPrint: %s - active/not pending - priority: %d - req status: %d", + pText, pri, stat); + else + RDebug::Printf( + "Camera: CFilterScheduler::DebugPrint: %x - active/not pending - priority: %d - req status: %d", + (TInt)pR, pri, stat); + } + } + else + { + // not active + if (pText) + RDebug::Printf( + "Camera: CFilterScheduler::DebugPrint: %s - not active: priority: %d - req status: %x", + pText, pri, stat); + else + RDebug::Printf( + "Camera: CFilterScheduler::DebugPrint: %x - not active: priority: %d - req status: %x", + (TInt)pR, pri, stat); + } + } + RDebug::Print( _L( "Camera <= CFilterScheduler::DebugPrint" )); + } +#endif // _AO_TRACKING +#endif // _DEBUG +// INCLUDE FILES +#include "CamAppUi.h" +#include "CamDocument.h" +#include "CamPerformance.h" +#include "CamAppController.h" + +#ifdef _DEBUG +// These are used for memory allocation tracing. +#undef _MEMORY_TRACKING +//#define _MEMORY_TRACKING +#ifdef _MEMORY_TRACKING +#include + + +// stores the last RDebug::Print or RDebug::Printf calls +// string from cameraapp code if SInUse was ETrue +static char *sLastHeapContext = NULL; +// controls the context taking if it is EFalse sLastHeapContext is not updated +// used also by RTraceAllocator::Alloc, Free, Realloc etc. +static TBool sInUse = EFalse; + +// forward declaration for friend statements. +class PtrAssocArray; +class RTraceAllocator; + + +// class which stores heap context info +// per allocation +// every allocation will have one entry in the hash table +class AllocHeapContext + { + // added as friend for writing less set/get methods + friend class PtrAssocArray; +public: + AllocHeapContext(TAny* aPtr, TInt aSize, char* aText1, + AllocHeapContext *aNext = NULL); + ~AllocHeapContext(); +protected: + // stored pointer of the allocation + TAny* iPtr; + // stored size of the allocation + TInt iSize; + // context string of the allocation, collected from + // RDebug::Print, RDebug::Printf calls + char* iText1; + // link field to the next context if they are more with same hash value + // in PtrAssocArray then they can be linked into a single linked list + AllocHeapContext *iNext; + }; + +// class which stores the hash table +class PtrAssocArray + { +public: + // constructor takes a Heap to use for allocations and deallocations done by + // this class, + // Note: For not perturbing normal allocation/deallocation a separate heap is + // used for internal needs. + PtrAssocArray(RHeap *aHeap); + ~PtrAssocArray(); + // insert an element into the list + // return KErrArgument if aAHC == NULL + // otherwise KErrNone + TInt Insert(AllocHeapContext* aAHC); + // find an element in the list + // return NULL pointer if cannot find, this means + // also the case if aPtr == NULL + AllocHeapContext *Find(TAny *aPtr); + // removes an element from the list + // if aPtr == NULL does nothing and returns KErrArgument. + // Returns KErrNotFound and does nothnig if cannot find it. + // In normal case return KErrNone. + TInt Remove(TAny *aPtr); + // Prints the elements in the list + void PrintLeaks(); + // cleans the list. It could be used if implemented for restarting + // leak search from a certain point onward. + // Note: only the list elements are cleaned, for real deallocation purposes + // it cannot be used as this system doesn't offers a reference counting of + // the pointer. It still can be used even that idea for debugging. + void CleanTables(); +protected: + // the hash function itself, + // simply takes the middle 2 bytes of a 4 byte unsigned, + // to which the pointer is converted + TUint Hash(TAny *aPtr); + // internal structures for has array entries + // iInfo points + struct AssocHashTbl + { + AllocHeapContext* iInfo; + }; + // the hash array + AssocHashTbl iAHT[65536]; + // pointer to iOwnHeap of + RHeap *iHeap; + }; + +// the allocator class +class RTraceAllocator : public RAllocator + { +public: + // return current heap, just utility + static RTraceAllocator* OwnAllocator() + { + RTraceAllocator& currentHeap = (RTraceAllocator &)User::Heap(); + return ¤tHeap; + } + // Simple utility function for getting a size of a char* + // User::StringLength looks similar, + // but this return 0 if aStr == NULL. + static TUint StrSize(char * aStr); + // stores the current heap for calls forwarding to that ones + // implementation + RTraceAllocator(RHeap *aCurrentHeap); + // destructor sets sInUse to EFalse as iOwnHeap is not available any + // more + ~RTraceAllocator() + { + iOwnHeap->Close(); + sInUse = EFalse; + } + + // These virtuals needs to be overwritten + // there functionality is documented by Symbian + virtual TAny* Alloc(TInt aSize); + virtual void Free(TAny* aPtr); + virtual TAny* ReAlloc(TAny* aPtr, TInt aSize, TInt aMode = 0); + virtual TInt AllocLen(const TAny* aCell) const; + virtual TInt Compress(); + virtual void Reset(); + virtual TInt AllocSize(TInt& aTotalAllocSize) const; + virtual TInt Available(TInt& aBiggestBlock) const; + virtual TInt DebugFunction(TInt aFunc, TAny* a1=NULL, TAny* a2=NULL); + // print entries in hash table, it is just a proxy method + void PrintLeaks() + { + iAHM->PrintLeaks(); + } + // clean the tables it is just a proxy + void CleanTables() + { + iAHM->CleanTables(); + } + // frees memory from own heap + void FreeOwn(TAny* aPtr) + { + iOwnHeap->Free(aPtr); + } + // allocates from own heap and fills with 0 + TAny* AllocZOwn(TInt aSize) + { + return iOwnHeap->AllocZ(aSize); + } + // returns the saved heap + RHeap* SavedHeap() + { + return iHeap; + } + +protected: + // the original heap of the application, which does the real + // allocation. All allocations are deferred to it + RHeap* iHeap; + // A heap for own allocations, different than the one used by + // cameraapp process + RHeap* iOwnHeap; + // pointer to the hash table + PtrAssocArray* iAHM; + }; + + +#if defined( _UNICODE ) + +// just, because they are needed +class TestOverflowTruncate : public TDes16Overflow + { +public: + virtual void Overflow(TDes16& /* aDes */) + { + } + ; + }; + +#else + +class TestOverflowTruncate : public TDes8Overflow + { +public: + virtual void Overflow(TDes8 &aDes) + {}; + }; + +#endif + +// just, because they are needed +class TestOverflowTruncate8 : public TDes8Overflow + { +public: + virtual void Overflow(TDes8& /*aDes*/) + { + } + }; + + +// RDebug::Print is overwritten, because it is used +EXPORT_C TInt RDebug::Print( TRefByValue aFmt,... ) + { + TestOverflowTruncate overflow; + VA_LIST list; + VA_START(list,aFmt); + TBuf<0x100> buf; + buf.AppendFormatList( aFmt, list, &overflow ); +#ifdef _UNICODE + TPtr8 p( buf.Collapse() ); + + // remember it + char *context = ( char *)p.Ptr(); + if( sInUse ) + { + if( sLastHeapContext ) + { + //free it + RTraceAllocator::OwnAllocator()->FreeOwn( sLastHeapContext ); + sLastHeapContext = NULL; + } + + sLastHeapContext = (char *)RTraceAllocator::OwnAllocator()->AllocZOwn( 0x100 ); + memcpy( sLastHeapContext, context, 0x100 ); + } + // instead of Exec::DebugPrint((TAny*)&p, 0); + // RawPrint is used + // it could have been this hacked to, but it is not seen necessary + // as recording context from Printf/Print seen as enough + RDebug::RawPrint( p ); +#else + TPtr8 p( buf ); + // rember it + sLastHeapContext = ( char *)p; + RDebug::RawPrint( p ); +#endif + return 0; + } + +EXPORT_C void RDebug::Printf( const char* aFmt, ... ) + { + TestOverflowTruncate8 overflow; + VA_LIST list; + VA_START( list,aFmt ); + TPtrC8 fmt( (const TText8*)aFmt ); + TBuf8<0x100> buf; + buf.AppendFormatList(fmt, list, &overflow ); + TPtrC8 p( buf /* (TUint8 *)(buf.Ptr()), 0x100 */); + + // rember it + char *context = ( char *)p.Ptr(); + if( sInUse ) + { + if( sLastHeapContext ) + { + //free it + RTraceAllocator::OwnAllocator()->FreeOwn( sLastHeapContext ); + sLastHeapContext = NULL; + } + sLastHeapContext = (char *)RTraceAllocator::OwnAllocator()->AllocZOwn( 0x100 ); + memcpy( sLastHeapContext, context, 0x100 ); + } + + RDebug::RawPrint( p ); + } + +// If some custom print wanted RawPrint could be hacked, +// just added for completness +#if 0 +EXPORT_C void RDebug::RawPrint( const TDesC8& aDes ) + { + // Exec::DebugPrint( ( TAny* )&aDes, 1 ); + // above should be replaced by custom print + } + +EXPORT_C void RDebug::RawPrint( const TDesC16& aDes ) + { + TBuf8<0x100> aDes8; + if( aDes.Length()>0x100 ) + { + TPtrC ptr( aDes.Ptr(), 0x100 ); + aDes8.Copy( ptr ); + } + else + aDes8.Copy(aDes); + // Exec::DebugPrint((TAny*)&aDes8, 1); + // above should be replaced by custom print + } +#endif + +AllocHeapContext::AllocHeapContext(TAny* aPtr, TInt aSize, char* aText1, + AllocHeapContext *aNext) + { + iPtr = aPtr; + iSize = aSize; + + // but we need to copy here + if (aText1 == NULL) + { + iText1 = NULL; + } + else + { + iText1 = (char *)RTraceAllocator::OwnAllocator()->AllocZOwn( 0x100); + if (iText1 != NULL) + memcpy(iText1, aText1, 0x100); + else + { + // just for testing + // in this case + // there is no space to store additional info + iText1 = iText1; + } + } + + iNext = aNext; + } + +AllocHeapContext::~AllocHeapContext() + { + if (iText1) + { + RTraceAllocator::OwnAllocator()->FreeOwn(iText1); + iText1 = NULL; + } + } + +PtrAssocArray::PtrAssocArray(RHeap *aHeap) + { + iHeap = aHeap; //points to in Traceallocator iOwnHeap + // not necessary to fill with NULL pointers, as RHeap::Allocz + // does the job already + for (TUint i = 0; i < 65535; i++) + { + iAHT[i].iInfo = NULL; + } + } + +PtrAssocArray::~PtrAssocArray() + { + } + +// insert an element into the list +TInt PtrAssocArray::Insert(AllocHeapContext* aAHC) + { + if ( !aAHC) + { + return KErrArgument; + } + + TUint hashVal = Hash(aAHC->iPtr); + // no collision, add to the table + if (iAHT[hashVal].iInfo == NULL) + { + iAHT[hashVal].iInfo = aAHC; + } + // collision, insert at the beginning of linked list. + else + { + aAHC->iNext = iAHT[hashVal].iInfo; + iAHT[hashVal].iInfo = aAHC; + } + return KErrNone; + } + +TUint PtrAssocArray::Hash(TAny *aPtr) + { + TUint val = (TUint)aPtr; + // take the middle part as hash value 65536 + // different values + val = (val & 0x00FFFF00 ) >> 8; + return val; + } + +// find an element in the list +AllocHeapContext *PtrAssocArray::Find(TAny *aPtr) + { + if ( !aPtr) + return NULL; + TUint hashVal = Hash(aPtr); + AllocHeapContext *ptr = iAHT[hashVal].iInfo; + if (ptr != NULL) + { + do + { + if (ptr->iPtr != aPtr) + { + ptr = ptr->iNext; + continue; + } + else + { + return ptr; + } + } + while (ptr); + } + return NULL; + } + +// remove an element from the list +TInt PtrAssocArray::Remove(TAny *aPtr) + { + if ( !aPtr) + return KErrArgument; + TUint hashVal = Hash(aPtr); + AllocHeapContext *ptr = iAHT[hashVal].iInfo; + if (ptr != NULL) + { + AllocHeapContext *prevPtr= NULL; + do + { + if (ptr->iPtr != aPtr) + { + prevPtr = ptr; + ptr = ptr->iNext; + continue; + } + else + { + // found, we should unlink and free memory + if (prevPtr) + { + prevPtr->iNext = ptr->iNext; + } + else + { + //This is first element in linked list. + if (ptr->iNext==NULL) + { + //List should cleared only if this is last element + iAHT[hashVal].iInfo = NULL; + } + else + { + iAHT[hashVal].iInfo = ptr->iNext; + } + } + // call destructor + ptr->AllocHeapContext::~AllocHeapContext(); + // deallocate + iHeap->Free(ptr); + + return KErrNone; + } + } + while (ptr); + } + return KErrNotFound; + } + +void PtrAssocArray::PrintLeaks() + { + for (TUint i = 0; i < 65536; i++) + { + AllocHeapContext *ptr = iAHT[i].iInfo; + if ( !ptr) + continue; + do + { + if (ptr->iText1 != NULL) + RDebug::Printf( + "Camera:PrintLeaks ptr: %x, size: %d, context: %s", + ptr->iPtr, ptr->iSize, ptr->iText1); + else + RDebug::Printf( + "Camera:PrintLeaks ptr: %x, size: %d, context: <>", + ptr->iPtr, ptr->iSize); + ptr = ptr->iNext; + } + while (ptr); + } + } + +void PtrAssocArray::CleanTables() + { + // Not really necessary to implement + + // disable code below + // by replacing #if 1 by #if 0 +#if 1 + for (TUint i = 0; i < 65536; i++) + { + AllocHeapContext *ptr = iAHT[i].iInfo; + if ( !ptr) + { + //Don't continue... + continue; + } + // deallocate the list + AllocHeapContext *nextPtr= NULL; + while (ptr) //Is this ever true? + { + nextPtr = ptr->iNext; + // call destructor + ptr->AllocHeapContext::~AllocHeapContext(); + // deallocate + iHeap->Free(ptr); + ptr = nextPtr; + } + } +#endif + } + + + +RTraceAllocator::RTraceAllocator(RHeap *aCurrentHeap) + { + iHeap = aCurrentHeap; + iOwnHeap = UserHeap::ChunkHeap( NULL, 1024 * 64, 1024*1024 * 2); + iAHM = (PtrAssocArray *)iOwnHeap->AllocZ(sizeof(PtrAssocArray)); + ::new(iAHM) PtrAssocArray( iOwnHeap ); + sInUse = ETrue; + } + +TAny* RTraceAllocator::Alloc(TInt aSize) + { + TAny *tmp = iHeap->Alloc(aSize); + + sInUse = EFalse; + RDebug::Printf("Camera: RTraceAllocator::Alloc %x, %d", ( TUint32 )tmp, + aSize); + sInUse = ETrue; + + if (tmp) + { + + AllocHeapContext* ahc = (AllocHeapContext*) ( iOwnHeap->AllocZ(sizeof(AllocHeapContext)) ); + // text from last debug print is added + // it can be extended to add more. Timing information for example. + ::new(ahc) AllocHeapContext( tmp, aSize, sLastHeapContext ); + iAHM->Insert(ahc); + } + else + { + // can be commented out this, if failed allocations are not interesting + // RDebug::Printf("M:Alloc %x, %d", (TUint32) tmp, aSize); + } + return tmp; + } + + +void RTraceAllocator::Free(TAny* aPtr) + { + if (aPtr) + { + iAHM->Remove(aPtr); + sInUse = EFalse; + RDebug::Printf("RTraceAllocator::Free %x", ( TUint32 ) aPtr ); + sInUse = ETrue; + iHeap->Free(aPtr); + } + } + + +TAny* RTraceAllocator::ReAlloc(TAny* aPtr, TInt aSize, TInt aMode) + { + TAny *tmp= NULL; + + if (aPtr == NULL) + { + if (aMode != ENeverMove) + { + tmp = RTraceAllocator::Alloc(aSize); + + sInUse = EFalse; + RDebug::Printf("M:Realloc %x %x %d %x", (TUint32) tmp, aPtr, + aSize, aMode); + sInUse = ETrue; + return tmp; + } + else + { + // Now we are allocating a block which should never move... + // Call below could panic USER:42 + tmp = iHeap->ReAlloc(aPtr, aSize, aMode); + + sInUse = EFalse; + RDebug::Printf("M:Realloc %x %x %d %x", (TUint32) tmp, aPtr, + aSize, aMode); + sInUse = ETrue; + + if (tmp) + { + AllocHeapContext *ahc = (AllocHeapContext*) ( iOwnHeap->AllocZ(sizeof(AllocHeapContext)) ); + // not yet handled if this kind of allocation above fails ! + // Add last debug print... + ::new(ahc) AllocHeapContext( tmp, aSize, sLastHeapContext ); + iAHM->Insert(ahc); + } + return tmp; + } + } + + //aPtr is not NULL. So it is real reallocation or accidentally + //pointing a cell -> PANIC + tmp = iHeap->ReAlloc(aPtr, aSize, aMode); + + sInUse = EFalse; + RDebug::Printf("M:Realloc %x %x %d %x", (TUint32) tmp, aPtr, aSize, aMode); + sInUse = ETrue; + + if (tmp) + { + // Check if information of old allocation has been stored. + if (iAHM->Find(aPtr) != NULL) + { + // remove the info + iAHM->Remove(aPtr); + } + // store new information + AllocHeapContext *ahc = (AllocHeapContext*) ( iOwnHeap->AllocZ(sizeof(AllocHeapContext)) ); + // not yet handled if this kind of allocation above fails ! + ::new(ahc) AllocHeapContext( tmp, aSize, sLastHeapContext ); + iAHM->Insert(ahc); + } + + return tmp; + } + +TInt RTraceAllocator::AllocLen(const TAny* aCell) const + { + // Printing commented out because it cause big delay + // when exiting application. + /* + sInUse = EFalse; + RDebug::Printf( "Camera: RTraceAllocator::AllocLen" ); + sInUse = ETrue; + */ + return iHeap->AllocLen(aCell); + } + +TInt RTraceAllocator::Compress() + { + sInUse = EFalse; + RDebug::Printf("Camera: RTraceAllocator::Compress"); + sInUse = ETrue; + //This doesn't require AllocHeapContext or iAHM because + //Compress doesn't affect sizes of allocated area. + return iHeap->Compress(); + } + +void RTraceAllocator::Reset() + { + sInUse = EFalse; + RDebug::Printf("Camera: RTraceAllocator::Reset"); + sInUse = ETrue; + //This should also sync iAHM because otherwise iAHM is showing + //freed cells as allocated. Currently not implemented. + return iHeap->Reset(); + } + +TInt RTraceAllocator::AllocSize(TInt& aTotalAllocSize) const + { + sInUse = EFalse; + RDebug::Printf("Camera: RTraceAllocator::AllocSize %d", aTotalAllocSize); + sInUse = ETrue; + return iHeap->AllocSize(aTotalAllocSize); + } + +TInt RTraceAllocator::Available(TInt& aBiggestBlock) const + { + TInt t = iHeap->Available(aBiggestBlock); + sInUse = EFalse; + RDebug::Printf("Camera: RTraceAllocator::Available %d %d", aBiggestBlock, + t); + sInUse = ETrue; + return t; + } + +TInt RTraceAllocator::DebugFunction(TInt /* aFunc */, TAny* /* a1 */, TAny* /* a2 */) + { + sInUse = EFalse; + RDebug::Printf("Camera: RTraceAllocator::DebugFunction"); + sInUse = ETrue; + return 0; + } + +#endif //_MEMORY_TRACKING +#endif //_DEBUG + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamDocument::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamDocument* CCamDocument::NewL( CEikApplication& aApp ) + { + CCamDocument* self = NewLC( aApp ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCamDocument::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamDocument* CCamDocument::NewLC( CEikApplication& aApp ) + { + CCamDocument* self = new( ELeave ) CCamDocument( aApp ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// Destructor +CCamDocument::~CCamDocument() + { + PRINT( _L("Camera => ~CCamDocument") ); +#ifdef CAMERAAPP_PERF_LOG_TRACES + // Shutdown end event cannot be logged to memory logger + PERF_EVENT_END_TRACE( EPerfEventApplicationShutdown ); +#endif + + delete iController; + + // print leaks info + +#ifdef _DEBUG + +#ifdef _MEMORY_TRACKING + RTraceAllocator& alloc = (RTraceAllocator &)User::Heap(); + alloc.PrintLeaks(); + alloc.CleanTables(); + User::SwitchHeap(alloc.SavedHeap() ); + alloc.Close(); + delete &alloc; +#endif //_MEMORY_TRACKING +#ifdef _AO_TRACKING + // restoring the original scheduler + RestoreCurrentAS(); +#endif // _AO_TRACKING +#endif //_DEBUG + PRINT( _L("Camera <= ~CCamDocument") ); + } + +// ----------------------------------------------------------------------------- +// CCamDocument::CreateAppUiL +// Create the application user interface, and return a pointer to it +// the framework takes ownership of this object +// ----------------------------------------------------------------------------- +// +CEikAppUi* CCamDocument::CreateAppUiL() + { +#ifdef _DEBUG +#ifdef _AO_TRACKING + // replacing the scheduler + ReplaceCurrentASL(); +#endif // _AO_TRACKING +#endif // _DEBUG + return new( ELeave ) CCamAppUi( *iController ); + } + +// ----------------------------------------------------------------------------- +// CCamDocument::CCamDocument +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamDocument::CCamDocument( CEikApplication& aApp ) + : CAknDocument( aApp ) + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// CCamDocument::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamDocument::ConstructL() + { +#ifdef _DEBUG +#ifdef _MEMORY_TRACKING + // New heap for memory leak information. + RHeap& currentHeap = User::Heap(); + RTraceAllocator *alloc = new RTraceAllocator( ¤tHeap ); + if( alloc ) + User::SwitchHeap( alloc ); + //End of memoryleak heap replacer. +#endif //_MEMORY_TRACKING +#endif //_DEBUG + + PERF_EVENT_START_L1( EPerfEventAppFirstStartup ); + // Create the controller. + iController = CCamAppController::NewL(); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamDriveChangeNotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamDriveChangeNotifier.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,264 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +// INCLUDE FILES +#include + +#include "CamDriveChangeNotifier.h" +#include "camlogging.h" +#include "CamUtility.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::CCamDiskChangeListener::NewL +// ----------------------------------------------------------------------------- +// +CCamDriveChangeNotifier::CCamDiskChangeListener* + CCamDriveChangeNotifier::CCamDiskChangeListener::NewLC( + RFs& aFs, + TDriveNumber aDrive, + MCamDriveChangeNotifierObserver::TCamDriveChangeType aType, + CCamDriveChangeNotifier& aObserver ) + { + PRINT( _L( "Camera => CCamDiskChangeListener::NewLC" ) ); + + CCamDiskChangeListener* self = + new( ELeave ) CCamDiskChangeListener( aFs, aDrive, aType, aObserver ); + CleanupStack::PushL( self ); + + PRINT( _L( "Camera <= CCamDiskChangeListener::NewLC" ) ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::CCamDiskChangeListener::~CCamDiskChangeListener +// ----------------------------------------------------------------------------- +// +CCamDriveChangeNotifier::CCamDiskChangeListener::~CCamDiskChangeListener() + { + PRINT( _L( "Camera => CCamDiskChangeListener::~CCamDiskChangeListener" ) ); + Cancel(); + PRINT( _L( "Camera <= CCamDiskChangeListener::~CCamDiskChangeListener" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::CCamDiskChangeListener::CCamDiskChangeListener +// ----------------------------------------------------------------------------- +// +CCamDriveChangeNotifier::CCamDiskChangeListener::CCamDiskChangeListener( + RFs& aFs, + TDriveNumber aDrive, + MCamDriveChangeNotifierObserver::TCamDriveChangeType aType, + CCamDriveChangeNotifier& aObserver ) + : CActive( CActive::EPriorityIdle ), + iFs( aFs ), + iDrive( aDrive ), + iType( aType ), + iObserver( aObserver ) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::CCamDiskChangeListener::Start +// ----------------------------------------------------------------------------- +// +void CCamDriveChangeNotifier::CCamDiskChangeListener::Start() + { + PRINT( _L( "Camera => CCamDiskChangeListener::Start" ) ); + if ( !IsActive() ) + { + PRINT( _L( "Camera <> CCamDiskChangeListener::Start SetActive()" ) ); + + // Start listening for change events + iFs.NotifyChange( ENotifyDisk, iStatus ); + SetActive(); + } + PRINT( _L( "Camera <= CCamDiskChangeListener::Start" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::CCamDiskChangeListener::Stop +// ----------------------------------------------------------------------------- +// +void CCamDriveChangeNotifier::CCamDiskChangeListener::Stop() + { + PRINT( _L( "Camera => CCamDiskChangeListener::Stop" ) ); + Cancel(); + PRINT( _L( "Camera <= CCamDiskChangeListener::Stop" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier:::CCamDiskChangeListener::DoCancel +// ----------------------------------------------------------------------------- +// +void CCamDriveChangeNotifier::CCamDiskChangeListener::DoCancel() + { + PRINT( _L( "Camera => CCamDiskChangeListener::DoCancel" ) ); + iFs.NotifyChangeCancel(); + PRINT( _L( "Camera <= CCamDiskChangeListener::DoCancel" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::CCamDiskChangeListener::RunL +// ----------------------------------------------------------------------------- +// +void CCamDriveChangeNotifier::CCamDiskChangeListener::RunL() + { + PRINT2( _L( "Camera => CCamDiskChangeListener::RunL iType: %d, iStatus: %d" ), iType, iStatus.Int() ); + TInt ret = KErrNone; + + if ( iStatus == KErrNone ) + { + ret = iObserver.NotifyChangeL( iType ); + + if( ret == KErrNone ) + { + Start(); + } + } + else if ( iStatus == KErrNotReady ) + { + // Give other threads chance to run + User::After( 0 ); + Start(); + } + + PRINT( _L( "Camera <= CCamDiskChangeListener::RunL" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::CCamDriveChangeNotifier +// ----------------------------------------------------------------------------- +// +CCamDriveChangeNotifier::CCamDriveChangeNotifier( + RFs& aFs, + MCamDriveChangeNotifierObserver& aObserver ) + : iObserver( aObserver ), + iFs( aFs ) + { + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::NewL +// ----------------------------------------------------------------------------- +// +CCamDriveChangeNotifier* CCamDriveChangeNotifier::NewL( + RFs& aFs, + MCamDriveChangeNotifierObserver& aObserver ) + { + PRINT( _L( "Camera => CCamDriveChangeNotifier::NewL" ) ); + + CCamDriveChangeNotifier* self = + new( ELeave ) CCamDriveChangeNotifier( aFs, aObserver ); + + self->iListeners.AppendL( CCamDiskChangeListener::NewLC( self->iFs, EDriveE, + MCamDriveChangeNotifierObserver::EDriveMount, *self ) ); + + self->iListeners.AppendL( CCamDiskChangeListener::NewLC( self->iFs, EDriveD, + MCamDriveChangeNotifierObserver::EDriveMount, *self ) ); + + CleanupStack::Pop(); // listener + CleanupStack::Pop(); // listener 2 + + self->StartMonitoring(); + + PRINT( _L( "Camera <= CCamDriveChangeNotifier::NewL" ) ); + return self; + } + + +// Destructor +CCamDriveChangeNotifier::~CCamDriveChangeNotifier() + { + PRINT( _L( "Camera => CCamDriveChangeNotifier::~CCamDriveChangeNotifier" ) ); + CancelMonitoring(); + iListeners.ResetAndDestroy(); + PRINT( _L( "Camera <= CCamDriveChangeNotifier::~CCamDriveChangeNotifier" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::StartMonitoring +// ----------------------------------------------------------------------------- +// +void CCamDriveChangeNotifier::StartMonitoring() + { + PRINT( _L( "Camera => CCamDriveChangeNotifier::StartMonitoring" ) ); + + for ( TInt i = iListeners.Count(); --i >= 0; ) + { + iListeners[i]->Start(); + } + + PRINT( _L( "Camera <= CCamDriveChangeNotifier::StartMonitoring" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::CancelMonitoring +// ----------------------------------------------------------------------------- +// +void CCamDriveChangeNotifier::CancelMonitoring() + { + PRINT( _L( "Camera => CCamDriveChangeNotifier::CancelMonitoring" ) ); + + for ( TInt i = iListeners.Count(); --i >= 0; ) + { + iListeners[i]->Stop(); + } + + PRINT( _L( "Camera <= CCamDriveChangeNotifier::CancelMonitoring" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::NotifyChangeL +// ----------------------------------------------------------------------------- +// +TInt CCamDriveChangeNotifier::NotifyChangeL( + MCamDriveChangeNotifierObserver::TCamDriveChangeType aType ) + { + PRINT( _L( "Camera => CCamDriveChangeNotifier::NotifyChangeL" ) ); + TInt ret = iObserver.DriveChangeL( aType ); + if ( ret == KErrNone && aType == + MCamDriveChangeNotifierObserver::EDriveDismount ) + { + PRINT( _L("Camera <> iFs.AllowDismount( EDriveE )") ) + iFs.AllowDismount( EDriveE ); + PRINT( _L("Camera <> iFs.AllowDismount( EDriveD )") ) + iFs.AllowDismount( EDriveD ); + } + + PRINT( _L( "Camera <= CCamDriveChangeNotifier::NotifyChangeL" ) ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CCamDriveChangeNotifier::SendAllowDismount +// ----------------------------------------------------------------------------- +// +void CCamDriveChangeNotifier::SendAllowDismount() + { + PRINT( _L( "Camera => CCamDriveChangeNotifier::SendAllowDismount" ) ); + iFs.AllowDismount( EDriveE ); + iFs.AllowDismount( EDriveD ); + StartMonitoring(); + PRINT( _L( "Camera <= CCamDriveChangeNotifier::SendAllowDismount" ) ); + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamFileCheckAo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamFileCheckAo.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object that checks if files have been deleted outside camera +* +*/ + + +// INCLUDE FILES +#include "CamFileCheckAo.h" +#include "camlogging.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamFileCheckAo::CCamFileCheckAo +// C++ constructor +// ----------------------------------------------------------------------------- +// +CCamFileCheckAo::CCamFileCheckAo( CCamAppController& aController, MCamFileCheckObserver& aObserver ) + :CActive( EPriorityStandard ), iController( aController ), iObserver( aObserver ) + { + } + +// ----------------------------------------------------------------------------- +// CCamFileCheckAo::~CCamFileCheckAo +// Destructor +// ----------------------------------------------------------------------------- +// +CCamFileCheckAo::~CCamFileCheckAo() + { + PRINT( _L("Camera => CCamFileCheckAo::~CCamFileCheckAo()") ); + Cancel(); + PRINT( _L("Camera <= CCamFileCheckAo::~CCamFileCheckAo()") ); + } + + +// ----------------------------------------------------------------------------- +// CCamFileCheckAo::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamFileCheckAo* CCamFileCheckAo::NewL( CCamAppController& aController, MCamFileCheckObserver& aObserver ) + { + CCamFileCheckAo* self = new( ELeave ) CCamFileCheckAo( aController, aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CCamFileCheckAo::ConstructL +// 2nd phase construction +// ----------------------------------------------------------------------------- +// +void CCamFileCheckAo::ConstructL() + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CCamFileCheckAo::DoCancel +// Cancels the active object +// ----------------------------------------------------------------------------- +// +void CCamFileCheckAo::DoCancel() + { + PRINT( _L("Camera => CCamFileCheckAo::DoCancel()") ); + } + +// ----------------------------------------------------------------------------- +// CCamFileCheckAo::RunL +// Check existance of next file in burstcapturearray. +// ----------------------------------------------------------------------------- +// +void CCamFileCheckAo::RunL() + { + PRINT1( _L("Camera => CCamFileCheckAo::RunL() findex=%d"), iFileIndex ) + + //Check to prevent crash. Some items from array might have been deleted + //before this object have been activated...Or by different thread, active object and so on... + if ( iFileIndex < iArray->Count() && iFileIndex >= 0 ) + { + if ( !BaflUtils::FileExists( iFs, iArray->FileName( iFileIndex ) ) + && iArray->FileName( iFileIndex ) != KNullDesC ) + { + PRINT1( _L("Camera <> CCamFileCheckAo::RunL: File %s didn't exist"),iArray->FileName( iFileIndex ).Ptr() ) + iArray->SetDeleted( iFileIndex, ETrue ); + iFileCount--; + } + } + else + { + PRINT( _L("Camera <> CCamFileCheckAo::RunL emptyrun") ) + iFileIndex = iArray->Count(); + iFileCount = iFileIndex; + iEmptyRun=ETrue; + } + + if( iFileIndex > 0 && iFileCount > 0 ) + { + if( iEmptyRun ) + { + if( iFileIndex > iFileCount) + { + iFileIndex = iFileCount; + } + else + { + iFileIndex--; + } + } + else + { + iFileIndex--; + } + PRINT( _L("Camera <> CCamFileCheckAo::RunL: Set active again.") ) + StartRequest(); + } + else + { + //File check is complete. Don't set active anymore. + //Inform observer about result. + TRAPD( err, iObserver.FileCheckingCompleteL( iFileCount, KErrNone ) ); + if( err != KErrNone ) + { + User::Leave( err ); + } + } + } + + + +// ----------------------------------------------------------------------------- +// CCamFileCheckAo::Start +// Initializes starting index and set active.. +// ----------------------------------------------------------------------------- +// +void CCamFileCheckAo::Start() + { + PRINT( _L("Camera => CCamFileCheckAo::Start()") ); + iArray = iController.BurstCaptureArray(); + iFileCount = iArray->Count(); + iFileIndex = iFileCount; + iFs = CEikonEnv::Static()->FsSession(); + + StartRequest(); + PRINT( _L("Camera <= CCamFileCheckAo::Start()") ); + } + +// ----------------------------------------------------------------------------- +// CCamFileCheckAo::StartRequest +// Set active and starts new request immediately +// ----------------------------------------------------------------------------- +// +void CCamFileCheckAo::StartRequest() + { + iEmptyRun = EFalse; + SetActive(); + TRequestStatus* statusPtr = &iStatus; + User::RequestComplete( statusPtr, KErrNone ); + } + +// ----------------------------------------------------------------------------- +// CCamFileCheckAo::RunError +// Called when an error has occurred. +// ----------------------------------------------------------------------------- +// +TInt CCamFileCheckAo::RunError( TInt aError ) + { + PRINT( _L("Camera => CCamFileCheckAo::RunError()") ); + + TRAP_IGNORE( iObserver.FileCheckingCompleteL( 0, aError ) ) + PRINT( _L("Camera <= CCamFileCheckAo::RunError()") ); + return KErrNone; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamImageSaveActive.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamImageSaveActive.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1151 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object that manages saving and deletion of images* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include + +// includes to allow reporting to LifeBlog via publish and subscribe API +#include + +#include +#include + +#include "CamImageSaveActive.h" +#include "CamPanic.h" +#include "CamUtility.h" +#include "CamPerformance.h" +#include "cambuffershare.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamImageSaveActiveTraces.h" +#endif +#include "camuidconstants.h" // KPSUidCamcorderNotifier + +#include "CameraappPrivateCRKeys.h" + +#include "CamAppController.h" +#include "CameraUiConfigManager.h" +#include "CamBurstCaptureArray.h" + +const TUint32 KCamLatestFilePath = 0x00000001; +const TInt KArrayGranularity = 2; +const TInt KCapturedAlbumId = 2; + +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamImageSaveActive* CCamImageSaveActive::NewL( MCamImageSaveObserver& aObserver, + CCamAppController& aController ) + { + PRINT( _L("Camera => CCamImageSaveActive::NewL") ); + + CCamImageSaveActive* self = new( ELeave ) CCamImageSaveActive( aObserver, + aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + PRINT( _L("Camera <= CCamImageSaveActive::NewL") ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::~CCamImageSaveActive +// Destructor +// ----------------------------------------------------------------------------- +// +CCamImageSaveActive::~CCamImageSaveActive() + { + PRINT( _L("Camera => ~CCamImageSaveActive") ); + delete iSaveArray; + + delete iNameArray; + iSnapArray.ResetAndDestroy(); + delete iManager; + + ReleaseAllAndDestroy( iImageArray ); + iImageArray.Close(); + + iThumbnailRequests.Close(); + DoDismissProgressNote(); + +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + DeRegisterHarverterClientEvents(); + iHarvesterClient.Close(); +#endif // defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + + PRINT( _L("Camera <= ~CCamImageSaveActive") ); + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::Cancel +// Cancel any current or pending actions +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::Cancel() + { + PRINT( _L( "Camera => CCamImageSaveActive::Cancel" ) ); + + TBool storageOk( ETrue ); + if ( iController.SequenceCaptureInProgress() ) + { + TCamMediaStorage storageLocation = static_cast ( + iController.IntegerSettingValueUnfiltered( + ECamSettingItemPhotoMediaStorage ) ); + if ( storageLocation == ECamMediaStorageCard ) + { + // Avoid deleting and saving to drive which does not exist + storageOk = CamUtility::MemoryCardStatus() == ECamMemoryCardInserted; + PRINT1( _L( "Camera => CCamImageSaveActive::Cancel storageOk=%d" ), storageOk); + } + } + + // Since this function may be called in the destructor, we need to check + // that iSaveArray is not null. + if(iSaveArray) + { + TInt count = iSaveArray->Count() - 1; + TInt lowest = 0; + if ( iSaveCurrent ) + { + lowest = 1; + } + TInt i; + + // Delete all dummy files except any currently saving one + for ( i = count; i >= lowest; i-- ) + { + PRINT1( _L( "Camera Deleting file index %d" ), i ); + if( storageOk ) + { + DeleteFile( iSaveArray->MdcaPoint( i ), ETrue ); + } + } + } + // if a file is currently saving, delay cleanup till save completes + // if ( iSaveCurrent ) + if ( IsActive() && storageOk ) + { + PRINT( _L( "Camera File currently saving delay cleanup" ) ); + iDoCancel = ETrue; + if ( !iWait.IsStarted() ) + { + iWait.Start(); + } + } + // otherwise, complete cleanup now + else + { + PRINT( _L( "Camera No file saving cleanup now" ) ); + DoDismissProgressNote(); + CActive::Cancel(); + if(iSaveArray) + { + iSaveArray->Reset(); + } + ReleaseAllAndDestroy( iImageArray ); + } + PRINT( _L( "Camera <= CCamImageSaveActive::Cancel" ) ); + } + +void CCamImageSaveActive::ForceCancel() +{ + CActive::Cancel(); +} +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::AddToSave +// Add an image to the list of required saves, activate if needed +// ----------------------------------------------------------------------------- +// +TBool CCamImageSaveActive::AddToSave( const TDesC& aFilename, + CCamBufferShare* aImageData ) + { + PRINT( _L("Camera => CCamImageSaveActive::AddToSave") ); + if( aImageData ) + { + aImageData->Reserve(); + } + + // Keep note of how many items exist before we try to add a new one + TInt count = iSaveArray->Count(); + TRAPD( err, iSaveArray->AppendL( aFilename ) ); + if ( !err ) + { + TRAP( err, iImageArray.AppendL( aImageData ) ); + } + // if any of the appends failed then clean out the partial item + if ( err ) + { + if ( iSaveArray->Count() > count ) + { + iSaveArray->Delete( count ); + } + if ( iImageArray.Count() > count ) + { + iImageArray.Remove( count ); + if( aImageData ) + { + aImageData->Release(); + } + } + PRINT( _L("Camera <= CCamImageSaveActive::AddToSave, error!") ); + return EFalse; + } + // the item is successfully added, start the save now if not currently saving + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + + PRINT( _L("Camera <= CCamImageSaveActive::AddToSave, ok") ); + return ETrue; + } + + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::FileSize +// Returns the size of the data for the specified file +// ----------------------------------------------------------------------------- +// +TInt CCamImageSaveActive::FileSize( const TDesC& aFilename ) const + { + TInt size = KErrNotFound; + TInt count = iSaveArray->Count(); + TInt i; + + // Check to see if it is in the "to be saved" array + for ( i = 0; i < count ; i++ ) + { + TPtrC ptr = (*iSaveArray)[i]; + if ( aFilename.Compare( ptr ) == 0 ) + { + TRAP_IGNORE( size = iImageArray[i]->SharedBuffer()->DataL( 0 )->Size() ); + // size = iImageArray[i]->Size(); + return size; + } + } + + // If we have got here, the requested file is NOT in the array + // Check the file system to see if we have already saved it. + RFs& fs = CEikonEnv::Static()->FsSession(); + RFile file; + TInt ret = file.Open( fs, aFilename, EFileShareAny | EFileRead ); + if ( ret == KErrNone ) + { + file.Size( size ); + } + file.Close(); + return size; + } + + + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::DeleteFile +// Delete a file, cancelling any pending save +// ----------------------------------------------------------------------------- +// +TInt CCamImageSaveActive::DeleteFile( const TDesC& aFilename, + TBool aSaveRequested ) + { + RFs& fs = CEikonEnv::Static()->FsSession(); + if ( aSaveRequested ) + { + TInt index; + if ( iSaveArray->Find( aFilename, index ) == 0 ) + { + // if the file is currently being saved + if ( index == 0 && iSaveCurrent ) + { + iDeleteCurrent = ETrue; + return ETrue; + } + else + { + iSaveArray->Delete( index ); + iSaveArray->Compress(); + + CCamBufferShare* item = iImageArray[index]; + iImageArray.Remove( index ); + if( item ) + { + item->Release(); + item = NULL; + } + + iImageArray.Compress(); + } + } + } + + // Dummy files are read only for protection, make sure the file is writable + fs.SetAtt( aFilename, 0, KEntryAttReadOnly ); + TInt ret = fs.Delete( aFilename ); + ReportToObserver( ECamSaveEventDeleted ); + + return ret; + } + +// --------------------------------------------------------------------------- +// CCamImageSaveActive::AlreadySavedFile +// Returns whether a particular file has already been saved. +// --------------------------------------------------------------------------- +// +TBool CCamImageSaveActive::AlreadySavedFile( const TDesC& aFilename ) const + { + TInt index; + return iSaveArray->Find( aFilename, index ); + } + +// --------------------------------------------------------------------------- +// CCamImageSaveActive::CurrentlySavingFile +// Returns whether a particular file is in the process of being saved. +// --------------------------------------------------------------------------- +// +TBool CCamImageSaveActive::CurrentlySavingFile( const TDesC& aFilename ) const + { + TInt index; + if ( iSaveCurrent && ( iSaveArray->Find( aFilename, index ) == 0 ) && + ( index == 0 ) ) + { + return ETrue; + } + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::DisplayProgressNote +// Display the saving progress note until cancelled or completed +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::DisplayProgressNote( TInt aExpectedImages ) + { + __ASSERT_DEBUG( !iDismissNote, CamPanic( ECamPanicInvalidState ) ); + // Initialise for a new burst set + iSaveProgressCount = 0; + iExpectedImages = aExpectedImages; + iShowNote = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::DismissProgressNote +// Dismiss the saving progress note when completed +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::DismissProgressNote() + { + // if the progress note is still pending + if ( iShowNote ) + { + // the burst has completed already + iShowNote = EFalse; + ReportToObserver( ECamSaveEventBurstComplete ); + } + + // No saves are pending, dismiss the note now + if ( !IsActive() ) + { + DoDismissProgressNote(); + } + else // otherwise, wait till all the saves complete + { + iDismissNote = ETrue; + } + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::SetAddImageToAlbum +// Set the "Add to album" feature on or off for photos +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::SetAddImageToAlbum( const TBool aAdding, + const TUint32 aDefaultAlbumId ) + { + iAddImageToAlbum = aAdding; + iDefaultAlbumId = aDefaultAlbumId; + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::AddToAlbum +// Add the specified photo or video to the default capture album +// ----------------------------------------------------------------------------- +// +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) +void CCamImageSaveActive::AddToAlbum( const TDesC& aFilename, + const TBool aAddToAlbum, + const TUint32 aDefaultAlbumId ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMIMAGESAVEACTIVE_ADDTOALBUM, "e_CCamImageSaveActive_AddToAlbum 1" ); + PRINT( _L("Camera => CCamImageSaveActive::AddToAlbum") ); + + TInt err = KErrNone; + RArray harvestAlbumIds; + TUint32 harvestAlbumId; + err = harvestAlbumIds.Append( KCapturedAlbumId ); + + /* + * NOTE: The default value of album Id defined as per CenRep key is 0, so + * we add the any other album other than the default one as above + * Secondly, if there is no album set as default album from the + * precapture settings views then we pass empty array to the harvester + * and MDS harvests the file to camera album directly i.e. captured. + */ + + if ( aAddToAlbum && aDefaultAlbumId > 0 ) + { + harvestAlbumId = aDefaultAlbumId; + err = harvestAlbumIds.Append( harvestAlbumId ); + } + + if ( !iHarvesterClientConnected ) + { + PRINT( _L("Camera <> calling iHarvesterClient.Connect") ); + err = iHarvesterClient.Connect(); + if ( !err ) + { + iHarvesterClientConnected = ETrue; + } + PRINT1( _L("Camera <> iHarvesterClient.Connect returned %d"), err ); + } + + if ( KErrNone == err ) + { + RegisterForHarvesterEvents(); + + PRINT( _L("Camera <> calling iHarvesterClient.HarvestFile") ); + +#ifdef RD_MDS_2_5 + if ( iController.UiConfigManagerPtr() && iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + TBool location ; + //Never save location information in second camera + if(iController.ActiveCamera() == ECamActiveCameraSecondary) + { + location = EFalse; + } + else + { + location = iController.IntegerSettingValue( ECamSettingItemRecLocation ); + } + iHarvesterClient.HarvestFile( aFilename, + harvestAlbumIds, + location ); + } + else + { + iHarvesterClient.HarvestFile( aFilename, + harvestAlbumIds, + EFalse ); + } +#else // RD_MDS_2_5 + iHarvesterClient.HarvestFile( aFilename, + harvestAlbumIds ); +#endif // RD_MDS_2_5 + + PRINT( _L("Camera <> iHarvesterClient.HarvestFile returned") ); + } + harvestAlbumIds.Close(); + + PRINT( _L("Camera <= CCamImageSaveActive::AddToAlbum") ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMIMAGESAVEACTIVE_ADDTOALBUM, "e_CCamImageSaveActive_AddToAlbum 0" ); + } +#else // defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) +void CCamImageSaveActive::AddToAlbum( const TDesC& /*aFilename*/, + const TBool /*aAddToAlbum*/, + const TUint32 /*aDefaultAlbumId*/ ) + { + } +#endif // defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::Count +// The number of items in the saving array +// ----------------------------------------------------------------------------- +// +TInt CCamImageSaveActive::Count() const + { + return iSaveArray->Count(); + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::CCamImageSaveActive +// C++ constructor +// ----------------------------------------------------------------------------- +// +CCamImageSaveActive::CCamImageSaveActive( MCamImageSaveObserver& aObserver, + CCamAppController& aController ) + : CActive( EPriorityStandard ), iObserver( aObserver ), + iController( aController ), + iFlushing( EFalse ) + { + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::ConstructL +// 2nd phase construction +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::ConstructL() + { + PRINT( _L("Camera => CCamImageSaveActive::ConstructL") ); + + iSaveArray = new( ELeave ) CDesCArraySeg( KArrayGranularity ); + iNameArray = new( ELeave ) CDesCArraySeg( KArrayGranularity ); + CActiveScheduler::Add( this ); + + PRINT( _L("Camera <= CCamImageSaveActive::ConstructL") ); + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::SetActiveAndCompleteRequest +// Schedule to run immediately +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::SetActiveAndCompleteRequest() + { + SetActive(); + TRequestStatus* statusPtr = &iStatus; + User::RequestComplete( statusPtr, KErrNone ); + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::DoCancel +// Cancels the active object +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::DoCancel() + { + PRINT( _L( "Camera => CCamImageSaveActive::DoCancel" ) ); + iDismissNote = ETrue; + if ( iWait.IsStarted() ) + { + iWait.AsyncStop(); + } + iDoCancel = EFalse; + // if no new saves have been requested since the cancellation + if ( iSaveArray->Count() == 0 ) + { + CActive::Cancel(); + iSaveArray->Reset(); + + ReleaseAllAndDestroy( iImageArray ); + } + PRINT( _L( "Camera <= CCamImageSaveActive::DoCancel" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::RunL +// Clean up after any previous save, then run the next pending save +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::RunL() + { + PRINT( _L( "Camera => CCamImageSaveActive::RunL" ) ); + + if( !iFlushing ) + { + // if the progress note has been requested + if ( iShowNote ) + { + iShowNote = EFalse; + DoDisplayProgressNoteL(); + } + // if a save has just completed + if ( iSaveCurrent ) + { + CompleteSaveOperation( ETrue ); + //ReportToObserver( ECamSaveEventComplete ); + } + else + { + // If cancellation has been requested + if ( iDoCancel ) + { + DoCancel(); + } + } + } + else + { + iFlushing = EFalse; + CompleteSaveOperation( EFalse ); + ReportToObserver( ECamSaveEventComplete ); + } + + if ( !iSaveCurrent ) + { + // if there are more images to save + if ( iSaveArray->Count() > 0 ) + { + DoSaveL(); + } + // if all saves are complete and the progress note needs to be dismissed + else if ( iDismissNote ) + { + DoDismissProgressNote(); + } + else if ( iNameArray->Count() > 0 ) + { + DoCreateThumbnailL(); + } + else // Do nothing + { + } + } + PRINT( _L( "Camera <= CCamImageSaveActive::RunL" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::RunError +// +// ----------------------------------------------------------------------------- +// +TInt +CCamImageSaveActive::RunError( TInt aError ) + { + PRINT1( _L( "Camera => CCamImageSaveActive::RunError, error(%d)"), aError ); + Cancel(); + + if( aError == KErrDiskFull || aError == KErrNotReady ) + { + if( aError == KErrNotReady ) + { + iController.SetCaptureStoppedForUsb( ETrue ); + } + + ReportToObserver( ECamSaveEventSaveError ); + } + else + { + ReportToObserver( ECamSaveEventCriticalError ); + } + + PRINT ( _L( "Camera <= CCamImageSaveActive::RunError") ); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::CompleteSaveOperation +// Clean up after the previous save +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::CompleteSaveOperation( TBool aDoFlush ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMIMAGESAVEACTIVE_COMPLETESAVEOPERATION, "e_CCamImageSaveActive_CompleteSaveOperation 1" ); + PRINT( _L( "Camera => CCamImageSaveActive::CompleteSaveOperation" ) ); + if( aDoFlush ) + { + iFile.Flush(iStatus); + iFlushing = ETrue; + SetActive(); + } + else + { + iSaveProgressCount++; + // if the saving progress note is open + if ( iSaveProgressDialog && iSaveProgressInfo ) + { + // Reset inactivity timer. Need to call this periodically + // to keep the backlight on + User::ResetInactivityTime(); + // Increment the progress in the progress bar + iSaveProgressInfo->IncrementAndDraw( 1 ); + } + iSaveCurrent = EFalse; + iFile.Close(); + // If there is an error or a pending request for deletion + if ( iDeleteCurrent || iStatus != KErrNone ) + { + RFs fs = CEikonEnv::Static()->FsSession(); + fs.Delete( iSaveArray->MdcaPoint( 0 ) ); + ReportToObserver( ECamSaveEventDeleted ); + } + else // the save is successful, add to album if required + { + PERF_EVENT_END_L2( EPerfEventSaveImage ); + + AddToAlbum( iSaveArray->MdcaPoint( 0 ), + iAddImageToAlbum, + iDefaultAlbumId ); + + // report to LifeBlog + RProperty::Set( KPSUidCamcorderNotifier, KCamLatestFilePath, iSaveArray->MdcaPoint( 0 ) ); + } + + iDeleteCurrent = EFalse; + + // Delete the item from the saving arrays + iSaveArray->Delete( 0 ); + iSaveArray->Compress(); + + CCamBufferShare* share = iImageArray[0]; + iImageArray.Remove( 0 ); + if( share ) + { + share->Release(); + share = NULL; + } + iImageArray.Compress(); + + // If cancellation has been requested + if ( iDoCancel ) + { + DoCancel(); + } + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMIMAGESAVEACTIVE_COMPLETESAVEOPERATION, "e_CAM_APP_SAVE 0" ); + } + PRINT1( _L("Camera <> CCamImageSaveActive .. After this file saving, total shared buffers in use: %d"), CCamBufferShare::TotalBufferShareCount() ); + PRINT( _L( "Camera <= CCamImageSaveActive::CompleteSaveOperation" ) ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP2_CCAMIMAGESAVEACTIVE_COMPLETESAVEOPERATION, "e_CCamImageSaveActive_CompleteSaveOperation 0" ); + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::DoSaveL +// Start a saving operation +// ----------------------------------------------------------------------------- +// +void +CCamImageSaveActive::DoSaveL() + { + PERF_EVENT_START_L2( EPerfEventSaveImage ); + PRINT( _L( "Camera => CCamImageSaveActive::DoSaveL" ) ); + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMIMAGESAVEACTIVE_DOSAVEL, "e_CAM_APP_SAVE 1" ); //CCORAPP_SAVE_START + + TPtrC filename = iSaveArray->MdcaPoint( 0 ); + + PRINT1( _L( "Camera <> CCamImageSaveActive: trying to save file:[%S]"), &filename ); + + // Check disk space + TInt drive = 0; + __ASSERT_ALWAYS( !RFs::CharToDrive( filename[0], drive ), + CamPanic( ECamPanicFileSystemError ) ); + + RFs& fs = CEikonEnv::Static()->FsSession(); + + TDesC8* data = iImageArray[0]->SharedBuffer()->DataL( 0 ); + TBool noSpace = SysUtil::DiskSpaceBelowCriticalLevelL( &fs, + data->Length(), + drive ); + if( noSpace ) + { + Cancel(); + PRINT( _L( "Camera <> CCamImageSaveActive::DoSaveL .. [WARNING] Disk space below critical, LEAVE!" ) ); + User::Leave( KErrDiskFull ); + } + + // The dummy file is read only for protection, make it writable now + // Also unhide it so that media gallery can detect it + fs.SetAtt( filename, 0, KEntryAttReadOnly|KEntryAttHidden ); + + // Open the file + TInt err = iFile.Open( fs, filename, EFileWrite ); + + // if the file does not exist, create a new one + if ( err == KErrNotFound ) + { + User::LeaveIfError( iFile.Create( fs, filename, EFileWrite ) ); + } + // if there was any other problem then leave + else if ( err != KErrNone ) + { + User::Leave( err ); + } + // the file exists + else + { + // Make sure the file is at the start + TInt seek = 0; + User::LeaveIfError( iFile.Seek( ESeekStart, seek ) ); + } + + if( iController.CurrentMode() == ECamControllerVideo ) + { + // set size + User::LeaveIfError( iFile.SetSize( data->Size() ) ); + } + // Write the image data to file + PRINT( _L( "Camera call iFile.Write" ) ); + iFile.Write( *(data), iStatus ); + iSaveCurrent = ETrue; + SetActive(); + PRINT( _L( "Camera <= CCamImageSaveActive::DoSaveL" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::DoDisplayProgressNoteL +// Display the saving progress note +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::DoDisplayProgressNoteL() + { + PRINT( _L("Camera => CCamImageSaveActive::DoDisplayProgressNoteL") ) + __ASSERT_DEBUG( iSaveProgressDialog == NULL , CamPanic( ECamPanicUi ) ); + TBool reportOnExit = ETrue; + // if there are images left to save in this burst set + if ( iExpectedImages > iSaveProgressCount ) + { + iSaveProgressDialog = new( ELeave ) CAknProgressDialog( + reinterpret_cast( &iSaveProgressDialog ), ETrue ); + iSaveProgressDialog->PrepareLC( R_CAM_SAVING_IMAGES_PROGRESS_NOTE ); + iSaveProgressInfo = iSaveProgressDialog->GetProgressInfoL(); + iSaveProgressInfo->SetFinalValue( iExpectedImages ); + TInt i; + for ( i = 0; i < iSaveProgressCount; i++ ) + { + // Increment the progress in the bar for previous saves + iSaveProgressInfo->IncrementAndDraw( 1 ); + } + // display the dialog and wait until it is dismissed + TInt exit = iSaveProgressDialog->RunLD(); + // the dialog has exited and deleted itself + iSaveProgressDialog = NULL; + iSaveProgressInfo = NULL; + // if the dialog was cancelled by the user + if ( exit == 0 ) + { + reportOnExit = EFalse; + iCompletedBurst = ETrue; + } + } + // if the burst has now completed + if ( reportOnExit ) + { + ReportToObserver( ECamSaveEventBurstComplete ); + } + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::DoDismissProgressNote +// Dismiss the progress note, if it is still open +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::DoDismissProgressNote() + { + iDismissNote = EFalse; + if ( iSaveProgressDialog ) + { + // Delete the dialog and end its RunLD() + TRAPD( error, iSaveProgressDialog->ProcessFinishedL() ) + if (error != KErrNone) + { + delete iSaveProgressDialog; + iSaveProgressDialog = NULL; + iSaveProgressInfo = NULL; + } + } + // if the progress note is still pending + if ( iShowNote ) + { + // report that the burst has completed + iShowNote = EFalse; + ReportToObserver( ECamSaveEventBurstComplete ); + } + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::ReportToObserver +// Indicate to the observer that saving has finished +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::ReportToObserver( TCamSaveEvent aEvent ) + { + if ( aEvent == ECamSaveEventComplete && iCompletedBurst ) + { + aEvent = ECamSaveEventBurstComplete; + iCompletedBurst = EFalse; + } + iObserver.HandleSaveEvent( aEvent ); + } + + +// ----------------------------------------------------------------------------- +// ReleaseAllAndDestroy +// +// ----------------------------------------------------------------------------- +// +void +CCamImageSaveActive::ReleaseAllAndDestroy( RPointerArray& aArray ) + { + PRINT( _L("Camera => CCamImageSaveActive::ReleaseAllAndDestroy") ); + + for( TInt i = aArray.Count()-1; i >= 0; i-- ) + { + CCamBufferShare* share = aArray[i]; + aArray.Remove( i ); + if( share ) + { + share->Release(); + share = NULL; + } + } + + __ASSERT_DEBUG( aArray.Count() == 0, User::Invariant() ); + + // All the data is released. + // CCamBufferShare destructor is not public, so cannot call ResetAndDestroy. + aArray.Reset(); + + PRINT( _L("Camera <= CCamImageSaveActive::ReleaseAllAndDestroy") ); + } + +#if defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) +// ----------------------------------------------------------------------------- +// HarvestingComplete +// +// Call Back method from the harvesting client once the harvesting is complete +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::HarvestingComplete( TDesC& aURI +#ifdef RD_MDS_2_5 + , TInt aError +#endif // RD_MDS_2_5 + ) + { + PRINT( _L("Camera => CCamImageSaveActive::HarvestingComplete") ); +#ifdef RD_MDS_2_5 + PRINT1( _L("Camera <> aError = %d"), aError ); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsThumbnailManagerAPISupported() && + iSnapArray.Count() && + iNameArray->Count() ) + { + TRAP_IGNORE( DoCreateThumbnailL() ); + } + +#endif // RD_MDS_2_5 + iObserver.HandleFileHarvestingComplete(); + PRINT( _L("Camera <= CCamImageSaveActive::HarvestingComplete") ); + } + +// +//CCamImageSaveActive::DeRegisterHarverterClientEvents +// +void CCamImageSaveActive::DeRegisterHarverterClientEvents() + { + PRINT( _L("Camera => CCamImageSaveActive::DeRegisterHarverterClientEvents") ); + + if ( iRegisteredForHarvesterEvents && iHarvesterClientConnected ) + { + iHarvesterClient.RemoveObserver( this ); + iRegisteredForHarvesterEvents = EFalse; + } + else + { + // do nothing + } + + PRINT( _L("Camera <= CCamImageSaveActive::DeRegisterHarverterClientEvents") ); + } + + +// +//CCamImageSaveActive::RegisterForHarvesterEvents +// +void CCamImageSaveActive::RegisterForHarvesterEvents() + { + PRINT( _L("Camera => CCamImageSaveActive::RegisterForHarvesterEvents") ); + + if ( !iRegisteredForHarvesterEvents && iHarvesterClientConnected ) + { + iHarvesterClient.SetObserver( this ); + iRegisteredForHarvesterEvents = ETrue; + } + else + { + // do nothing + } + + PRINT( _L("Camera <= CCamImageSaveActive::RegisterForHarvesterEvents") ); + } + +#endif // defined(RD_MDS_2_5) && !defined(__WINSCW__) && !defined(__WINS__) + +// ----------------------------------------------------------------------------- +// CreateThumbnailsL +// +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::CreateThumbnailsL( const CCamBurstCaptureArray& aArray ) + { + PRINT( _L("Camera => CCamImageSaveActive::CreateThumbnailsL") ); + TInt arrayCount = aArray.Count(); + if ( !iSnapArray.Count() ) + { + iThumbnailRequests.Reset(); + iThumbnailRequests.ReserveL( arrayCount ); + } + TInt count(0); + TInt err(0); + + for ( TInt i=0; i < arrayCount; i++ ) + { + count = iNameArray->Count(); + + CFbsBitmap* snapshot = new( ELeave ) CFbsBitmap(); + if ( aArray.Snapshot( i ) ) + { + err = snapshot->Duplicate( aArray.Snapshot( i )->Handle() ); + } + // in case the snapshot is missing, the newly created empty bitmap indicates + // the thumbnail is created using the imagefile + if ( !err ) + { + snapshot->SetDisplayMode( EColor64K ); + TRAP( err, iSnapArray.AppendL( snapshot ) ); + if ( !err ) + { + //append filename (includes full path) + PRINT1( _L("Camera <> CCamImageSaveActive::CreateThumbnails append file:%S"), &aArray.FileName( i ) ); + TRAP( err, iNameArray->AppendL( aArray.FileName( i ) ) ); + if ( !err ) + { + TRAP( err, iThumbnailRequests.AppendL( KErrNotFound ) ); + } + } + if ( err ) + { + if ( iNameArray->Count() > count ) + { + iNameArray->Delete( count ); + } + if ( iSnapArray.Count() > count ) + { + iSnapArray.Remove( count ); + } + if ( iThumbnailRequests.Count() > count ) + { + iThumbnailRequests.Remove( count ); + } + } + } + } + PRINT( _L("Camera <= CCamImageSaveActive::CreateThumbnailsL") ); + } + +// ----------------------------------------------------------------------------- +// CCamImageSaveActive::DoCreateThumbnail +// Add images to album +// ----------------------------------------------------------------------------- +// +void CCamImageSaveActive::DoCreateThumbnailL() + { + PRINT( _L( "Camera => CCamImageSaveActive::DoCreateThumbnailL" ) ); + if( !iManager ) + { + PRINT( _L( "Camera <> CCamImageSaveActive::DoCreateThumbnail create manager" ) ); + iManager = CThumbnailManager::NewL( *this ); + } + // create object and call thumbnailmanager + TSize size = iSnapArray[ 0 ]->SizeInPixels(); + CThumbnailObjectSource* source; + if ( size.iHeight == 0 || size.iWidth == 0 ) + { + PRINT( _L( "Camera <> CCamImageSaveActive::DoCreateThumbnail only URI" ) ); + source = CThumbnailObjectSource::NewL( iNameArray->MdcaPoint( 0 ), + KNullDesC ); + } + else + { + PRINT( _L( "Camera <> CCamImageSaveActive::DoCreateThumbnail URI and bitmap" ) ); + source = CThumbnailObjectSource::NewL( iSnapArray[ 0 ], + iNameArray->MdcaPoint( 0 ) ); + } + PRINT1( _L("Camera <> CCamImageSaveActive::DoCreateThumbnailL filename:%S"), &iNameArray->MdcaPoint( 0 ) ); + CleanupStack::PushL( source ); + TThumbnailRequestId requestId = iManager->CreateThumbnails( *source ); + TInt index = iThumbnailRequests.Count() - iSnapArray.Count(); + PRINT2( _L( "Camera <> CCamImageSaveActive::DoCreateThumbnailL array index=%d, request id=%d" ), index, requestId ); + iThumbnailRequests[index] = requestId; + CleanupStack::PopAndDestroy( source ); + + iNameArray->Delete( 0 ); + iNameArray->Compress(); + + iSnapArray.Remove( 0 ); + iSnapArray.Compress(); + + if ( !IsActive() && iNameArray->Count() > 0 ) + { + SetActiveAndCompleteRequest(); + } + PRINT( _L( "Camera <= CCamImageSaveActive::DoCreateThumbnailL" ) ); + } + +void CCamImageSaveActive::CancelThumbnail( TInt aSnapshotIndex ) + { + PRINT1( _L( "Camera => CCamImageSaveActive::CancelThumbnail - aSnapshotIndex=%d" ), aSnapshotIndex ); + if ( aSnapshotIndex >= iThumbnailRequests.Count() ) + { + PRINT( _L( "Camera <= CCamImageSaveActive::CancelThumbnail request array not initialized yet" ) ); + return; + } + TThumbnailRequestId requestId = iThumbnailRequests[aSnapshotIndex]; + if ( requestId != KErrNotFound ) + { + if ( iManager ) + { + PRINT1( _L( "Camera <> CCamImageSaveActive::CancelThumbnail canceling request %d"), requestId ); + TInt err = iManager->CancelRequest( requestId ); + PRINT1( _L( "Camera <> CCamImageSaveActive::CancelThumbnail CancelRequest() returned %d"), err ); + iThumbnailRequests[aSnapshotIndex] = KErrNotFound; + } + } + PRINT( _L( "Camera <= CCamImageSaveActive::CancelThumbnail" ) ); + } +void CCamImageSaveActive::ThumbnailPreviewReady( MThumbnailData& aThumbnail, + TThumbnailRequestId aId ) + { + // empty implementation + } + +void CCamImageSaveActive::ThumbnailReady( TInt aError, + MThumbnailData& aThumbnail, + TThumbnailRequestId aId ) + { + PRINT1( _L( "Camera => CCamImageSaveActive::ThumbnailReady aId=%d" ), aId ); + for ( TInt i = 0; i < iThumbnailRequests.Count(); i++ ) + { + if ( iThumbnailRequests[i] == aId ) + { + PRINT1( _L( "Camera <> CCamImageSaveActive::ThumbnailReady thumbnail for snapshot %d ready" ), i ); + iThumbnailRequests[i] = KErrNotFound; + } + } + PRINT( _L( "Camera <= CCamImageSaveActive::ThumbnailReady" ) ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamIndicator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamIndicator.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,223 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera Indicator control* +*/ + + + +// INCLUDE FILES +#include +#include "CamIndicator.h" +#include "CamUtility.h" +#include "cambitmapitem.h" +#include +#include // For CCoeAppUiBase +#include // For CEikApplication +#include + +// CONSTANTS + +// ================= MEMBER FUNCTIONS ======================= +// --------------------------------------------------------------------------- +// CCamIndicator::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamIndicator* CCamIndicator::NewL( const TRect& aRect ) + { + return new ( ELeave ) CCamIndicator( aRect ); + } + + +// Destructor +CCamIndicator::~CCamIndicator() + { + PRINT( _L("Camera => ~CCamIndicator") ); + iIcons.ResetAndDestroy(); + PRINT( _L("Camera <= ~CCamIndicator") ); + } + +// --------------------------------------------------------------------------- +// CCamIndicator::CCamIndicator +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamIndicator::CCamIndicator( const TRect& aRect ) +: iRect( aRect ), + iDefaultRect( aRect ) + { + } + +// ----------------------------------------------------------------------------- +// CCamIndicator::CCamIndicator +// C++ default constructor. +// ----------------------------------------------------------------------------- +// +CCamIndicator::CCamIndicator() + { + } + +// --------------------------------------------------------- +// CCamIndicator::Draw +// Draw control +// --------------------------------------------------------- +// +void CCamIndicator::Draw( CBitmapContext& aGc ) const + { + if ( !iClear ) + { + iIcons[ iCurrentIcon ]->Draw( aGc ); + } + } + +// --------------------------------------------------------- +// CCamIndicator::AddIconL +// Add a bitmap icon to array of available icons +// --------------------------------------------------------- +// +void CCamIndicator::AddIconL( TInt32 aBitmapId, TInt32 aMaskId ) + { + CCamBitmapItem* item = CCamBitmapItem::NewL( aBitmapId, aMaskId ); + CleanupStack::PushL( item ); + User::LeaveIfError( iIcons.Append( item ) ); + CleanupStack::Pop( item ); + item = NULL; + + // Unused (used to be mask). Just here to make sure the indexing + // system remains the same + item = CCamBitmapItem::NewL( aBitmapId, aMaskId ); + CleanupStack::PushL( item ); + User::LeaveIfError( iIcons.Append( item ) ); + CleanupStack::Pop( item ); + item = NULL; + } + +// --------------------------------------------------------- +// CCamIndicator::UpdateRect +// Update the indicator coords +// --------------------------------------------------------- +// +void CCamIndicator::UpdateRect( TRect& aRect ) + { + iRect = aRect; + iDefaultRect = iRect; + } + +// --------------------------------------------------------- +// CCamIndicator::SetIcon +// Set index for current icon (from array of loaded bitmaps) +// --------------------------------------------------------- +// +void CCamIndicator::SetIcon( TInt aIndex ) + { + // Mask is used from index (aIndex + 1), + // make sure also mask index is in bounds + if ( aIndex + 1 < iIcons.Count() ) + { + iClear = EFalse; + iCurrentIcon = aIndex; + } + else + { + iClear = ETrue; + PRINT1( _L("Camera <> CCamIndicator::SetIcon index out of bounds:%d"), aIndex ); + } + } + +// --------------------------------------------------------- +// CCamIndicator::ClearIcon +// Request for indicator to clear bitmap icon +// - indicator will clear itself on redraw +// --------------------------------------------------------- +// +void CCamIndicator::ClearIcon() + { + iClear = ETrue; + } + +// --------------------------------------------------------- +// CCamIndicator::DisplayIcon +// Request for indicator to draw current bitmap icon +// --------------------------------------------------------- +// +void CCamIndicator::DisplayIcon() + { + iClear = EFalse; + } + +// --------------------------------------------------------- +// CCamIndicator::SetFlashing +// set flashing state of indicator +// --------------------------------------------------------- +// +void CCamIndicator::SetFlashing( TBool aFlashing ) + { + iFlashing = aFlashing; + } + +// --------------------------------------------------------- +// CCamIndicator::IsFlashing +// return flashing state of indicator +// --------------------------------------------------------- +// +TBool CCamIndicator::IsFlashing() const + { + return iFlashing; + } + +// --------------------------------------------------------- +// CCamIndicator::OverridePosition +// Allows a new position to be temporarialy specified +// --------------------------------------------------------- +// +void CCamIndicator::OverridePosition( const TPoint& aPos ) + { + iRect.iTl = aPos; + } + +// --------------------------------------------------------- +// CCamIndicator::CancelOverridePosition +// Cancels the position set by OverridePosition +// --------------------------------------------------------- +// +void CCamIndicator::CancelOverridePosition() + { + iRect = iDefaultRect; + } + +// --------------------------------------------------------- +// CCamIndicator::SetRect +// +// --------------------------------------------------------- +// +void CCamIndicator::SetRect( const TRect& aRect ) + { + iRect = aRect; + + for ( TInt i = 0; i < iIcons.Count(); i++ ) + { + TRAP_IGNORE( iIcons[i]->SetLayoutL( aRect ) ); + } + } + +// --------------------------------------------------------- +// CCamIndicator::Rect +// Indicator layout rect +// --------------------------------------------------------- +// +TRect CCamIndicator::LayoutRect() + { + return iRect; + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamIndicatorData.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamIndicatorData.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera Indicator control* +*/ + + +// INCLUDE FILES +#include +#include +#include "CamIndicatorResourceReader.h" +#include "CamIndicatorData.h" +#include "camlogging.h" + + +// CONSTANTS + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamIndicatorData::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamIndicatorData* CCamIndicatorData::NewLC( TResourceReader& aReader ) + { + CCamIndicatorData* self = new( ELeave ) CCamIndicatorData(); + CleanupStack::PushL( self ); + self->ConstructL( aReader ); + return self; + } + +// Destructor +CCamIndicatorData::~CCamIndicatorData() + { + PRINT( _L("Camera => ~CCamIndicatorData") ); + iBitmapIdArray.Reset(); + iBitmapIdArray.Close(); + PRINT( _L("Camera <= ~CCamIndicatorData") ); + } + +// --------------------------------------------------------- +// CCamIndicatorData::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamIndicatorData::ConstructL( TResourceReader& aReader ) + { + // first integer (TInt16) represent indicator id + iIndicatorId = aReader.ReadInt16(); + + // next 4 integers (TInt16) represent TRect cordinates + iRect.iTl.iX = aReader.ReadInt16(); + iRect.iTl.iY = aReader.ReadInt16(); + iRect.iBr.iX = aReader.ReadInt16(); + iRect.iBr.iY = aReader.ReadInt16(); + + // next integer (TInt16) represents the number of bitmaps + iIndicatorBitmapCount = aReader.ReadInt16(); + + // bitmap ids are TInt32 + TInt32 bmpid; + TInt ii; + for ( ii = 0; ii < iIndicatorBitmapCount; ii++ ) + { + bmpid=aReader.ReadInt32(); + User::LeaveIfError( iBitmapIdArray.Append( bmpid ) ); + } + } + +// --------------------------------------------------------------------------- +// CCamIndicatorData::CCamIndicatorData +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamIndicatorData::CCamIndicatorData() + { + } + +// --------------------------------------------------------------------------- +// CCamIndicatorData::IndicatorId +// returns the camera indicator identifier +// --------------------------------------------------------------------------- +// +TInt CCamIndicatorData::IndicatorId() const + { + return iIndicatorId; + } + +// --------------------------------------------------------------------------- +// CCamIndicatorData::IndicatorRect +// returns the indicator rectangle cooords +// --------------------------------------------------------------------------- +// +TRect CCamIndicatorData::IndicatorRect() const + { + return iRect; + } + +// --------------------------------------------------------------------------- +// CCamIndicatorData::IndicatorBitmapCount +// returns the number of available bitmaps for the indicator +// --------------------------------------------------------------------------- +// +TInt CCamIndicatorData::IndicatorBitmapCount() const + { + return iIndicatorBitmapCount; + } + +// --------------------------------------------------------------------------- +// CCamIndicatorData::IndicatorBitmapId +// returns the bitmap id for the specified index +// --------------------------------------------------------------------------- +// +TInt32 CCamIndicatorData::IndicatorBitmapId( TInt aIndex ) const + { + return iBitmapIdArray[ aIndex ]; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamIndicatorResourceReader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamIndicatorResourceReader.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +// INCLUDE FILES +#include +#include + +#include "CamIndicatorResourceReader.h" +#include "CamIndicatorData.h" +#include "camlogging.h" + +// CONSTANTS + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamIndicatorResourceReader::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamIndicatorResourceReader* CCamIndicatorResourceReader::NewLC( TResourceReader& aReader ) + { + CCamIndicatorResourceReader* self = new ( ELeave) CCamIndicatorResourceReader(); + CleanupStack::PushL( self ); + self->ConstructL( aReader ); + return self; + } + +// Destructor +CCamIndicatorResourceReader::~CCamIndicatorResourceReader() + { + PRINT( _L("Camera => ~CCamIndicatorResourceReader") ); + if ( iIndicatorArray ) + { + iIndicatorArray->ResetAndDestroy(); + delete iIndicatorArray; + } + PRINT( _L("Camera <= ~CCamIndicatorResourceReader") ); + } + +// --------------------------------------------------------- +// CCamIndicatorResourceReader::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamIndicatorResourceReader::ConstructL( TResourceReader& aReader ) + { + iIndicatorArray = new ( ELeave ) CArrayPtrFlat ( 3 ); + + TInt ii; + TInt numindicators = aReader.ReadInt16(); + for ( ii = 0; ii < numindicators; ii++ ) + { + CCamIndicatorData* data = CCamIndicatorData::NewLC( aReader ); + iIndicatorArray->AppendL( data ); + CleanupStack::Pop( data ); + } + } + +// --------------------------------------------------------------------------- +// CCamIndicatorResourceReader::CCamIndicatorResourceReader +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamIndicatorResourceReader::CCamIndicatorResourceReader() + { + } + +// --------------------------------------------------------------------------- +// CCamIndicatorResourceReader::IndicatorData +// return indicator data +// --------------------------------------------------------------------------- +// +CArrayPtrFlat& CCamIndicatorResourceReader::IndicatorData() + { + return *iIndicatorArray; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamInfoListBox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamInfoListBox.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Listbox used by CamInfoListBoxContainer* +*/ + + + +// INCLUDE FILES +#include "CamInfoListBox.h" +#include "CamInfoListBoxModel.h" + +#include "CamCaptureSetupListItemDrawer.h" +#include "CamCaptureSetupControlHandler.h" + +#include "CamUtility.h" + +// ============================ MEMBER FUNCTIONS =============================== + +CCamInfoListBox::~CCamInfoListBox() + { + + } + +/** +* C++ default constructor. +*/ +CCamInfoListBox::CCamInfoListBox( MCamSettingValueObserver* aObserver, + CCamAppController& aController ) +:CCamCaptureSetupListBox( aObserver, aController ) + { + + } + +/** +* By default Symbian 2nd phase constructor is private. +*/ +void CCamInfoListBox::ConstructL( CCamAppController& aController, + const CCoeControl* aParent, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray, + TInt aResourceId ) + { + iBorder = TGulBorder::ENone; + + //Constructing model + CCamInfoListBoxModel* model = + CCamInfoListBoxModel::NewLC( aController, aSummaryTitleTextArray, + aSummaryDescriptionTextArray, aResourceId, Rect() ); + + CCamCaptureSetupListItemDrawer* itemDrawer = + CCamCaptureSetupListItemDrawer::NewL( *model ); + + + itemDrawer->SetParentControl( aParent ); + + // CEikListBox takes ownership before anything can leave. + // Do not need the model or drawer on the stack when call ConstructL, + // because CEikListBox assigns objects as member variables before + // ConstructL calls any leaving functions. + CleanupStack::Pop( model ); + CEikListBox::ConstructL( model, itemDrawer, aParent, 0/*aFlags*/ ); + // The number of items is fixed after the list box has been constructed + const TInt KMaxListItems = 5; // This value should come from the LAF + // Find the number of items to be displayed in the list box + iRequiredHeightInNumOfItems = Min( Model()->NumberOfItems(), KMaxListItems ); + SetItemHeightL( iItemDrawer->MinimumCellSize().iHeight ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamInfoListBoxContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamInfoListBoxContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,746 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for Image/Video quality.* +*/ + +#include "CamInfoListBoxContainer.h" +#include "CamUtility.h" +#include +#include +#include +#include +#include // resource reader +#include +#include +#include +#include + + +#include "CamAppUi.h" + +#include "CamInfoListBox.h" +#include "CamInfoListBoxModel.h" +#include "CamPanic.h" +#include // CAknInfoPopupNoteController + +#include +#include + +// CONSTANTS +const TInt KInfoTooltipDelay = 0; // time (milliseconds) delay when showing the tooltip +const TInt KInfoTooltipDisplayTime = 5000; // maximum time (milliseconds) the tooltip is displayed +const TInt KExplTxtGranularity = 6; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamInfoListBoxContainer::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamInfoListBoxContainer* CCamInfoListBoxContainer::NewL( const TRect& aRect, + CAknView& aView, + CCamAppController& aController, + TInt aListBoxResource, + TInt aSummaryResource, + TInt aSettingValue, + TInt aTitleResource ) + { + CCamInfoListBoxContainer* self = + new( ELeave ) CCamInfoListBoxContainer( aController, + aView, + aSettingValue ); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aListBoxResource, aSummaryResource, aTitleResource); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamInfoListBoxContainer::~CCamInfoListBoxContainer +// Destructor +// --------------------------------------------------------------------------- +// +CCamInfoListBoxContainer::~CCamInfoListBoxContainer() + { + PRINT( _L( "Camera => ~CCamInfoListBoxContainer" ) ); + + iSummaryBitmapArray.ResetAndDestroy(); + iTitleArray.ResetAndDestroy(); + iDescArray.ResetAndDestroy(); + iExplTxtLinesLayout.Close(); + + if ( iFeedback ) + { + iFeedback->RemoveFeedbackForControl( iListBox ); + } + + delete iListBox; + + if ( iTooltipController ) + { + delete iTooltipController; + iTooltipController = NULL; + } + + if ( iListboxTitle ) + { + delete iListboxTitle; + iListboxTitle = NULL; + } + + if ( iCurrentDescLineArray ) + { + iCurrentDescLineArray->Reset(); + delete iCurrentDescLineArray; + } + + PRINT( _L( "Camera <= ~CCamInfoListBoxContainer" ) ); + } + +// --------------------------------------------------------- +// CCamInfoListBoxContainer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamInfoListBoxContainer::ConstructL( const TRect& aRect, TInt aListBoxResource, TInt aSummaryResource, TInt aTitleResource ) + { + PRINT(_L("Camera => CCamInfoListBoxContainer::ConstructL") ) + + CCamContainerBase::BaseConstructL( aRect ); + + if ( iController.IsTouchScreenSupported() ) + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar(); + if ( fixedToolbar ) + { + // Hide toolbar from Light sensitivity etc. settings view + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + iLayoutAreaRect ); + + // layout area rectangle contains the area, where components need to be + // drawn to. the container size is the whole screen, but the layouts are + // for the client area. aRect is the container size that might include or + // might not include statuspane area. calculating area self will + // go around the problem + + // Construct the listbox + iListBox = new( ELeave ) CCamInfoListBox( this, iController ); + iListBox->ConstructL( iController, this, iTitleArray, iDescArray, aListBoxResource ); + iListBox->DisableSingleClick( ETrue ); + + // Highlight the currently active setting value + iListBox->InitializeL( iSettingValue ); + + iListBox->SetContainerWindowL( *this ); + iListBox->CreateScrollBarFrameL( ETrue ); + + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + TRect listboxRect; + if ( CamUtility::IsNhdDevice() ) + { + listboxRect = TouchLayout(); + } + else + { + iCurrentDescLineArray = + new( ELeave ) CArrayFixFlat( KExplTxtGranularity ); + appUi->StatusPane()->MakeVisible( ETrue ); + SetRect( appUi->ClientRect() ); + listboxRect = NonTouchLayout(); + } + ConstructSummaryDetailsFromResourceL( aSummaryResource ); + + // Determine the height of the listbox; + // Height needs to be based on the number of items, because the layout + // height (maxListBoxHeight )might be different + // than combined height of the max visible listbox items + + CEikScrollBarFrame::TScrollBarVisibility visibility = + CEikScrollBarFrame::EOff; + TInt listBoxHeight = iListBox->CalcHeightBasedOnNumOfItems( + iListBox->Model()->NumberOfItems() ); + if ( listboxRect.Height() < listBoxHeight ) + { + // there are more items than would fit to the listbox rectangle + + // the maximum height is the total height of items + // that can fit to the maxlistboxheight + TInt itemHeight = iListBox->ItemHeight(); + TInt itemsVisible = listboxRect.Height() / itemHeight; + listBoxHeight = itemsVisible * itemHeight; + + // the scrollbar needs to be turned on + visibility = CEikScrollBarFrame::EOn; + } + + // calculate the layout for the listbox with changed height + const AknLayoutUtils::SAknLayoutControl listboxLayout = + { ELayoutEmpty, listboxRect.iTl.iX, listboxRect.iTl.iY, + ELayoutEmpty, ELayoutEmpty, + iListboxLayoutRect.Rect().Width(), listBoxHeight }; + + AknLayoutUtils::LayoutControl( iListBox, iLayoutAreaRect, listboxLayout); + + // set scrollbars for the listbox + iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, + visibility ); + iListBox->MakeVisible( ETrue ); + iListBox->SetFocus( EFalse, ENoDrawNow ); + iListBox->UpdateScrollBarsL(); + iListBox->ScrollBarFrame()->DrawScrollBarsNow(); + iListBox->SetListBoxObserver(this); + appUi->SetActivePaletteVisibility( EFalse ); + + // Prevents the system filling invalidated areas with the background colour - + // helps reduce flicker. + Window().SetBackgroundColor(); + + ConstructContainerTitleFromResourceL( aTitleResource ); + + if ( !iTooltipController ) + { + iTooltipController = CAknInfoPopupNoteController::NewL(); + } + + iTooltipController->SetTimeDelayBeforeShow( KInfoTooltipDelay ); + iTooltipController->SetTimePopupInView( KInfoTooltipDisplayTime ); + + // Position the tooltip + TPoint position; + if ( AknsUtils::GetControlPosition( this, position ) != KErrNone ) + { + position = PositionRelativeToScreen(); + } + TRect rect( position, Size() ); + TPoint center = rect.Center(); + iTooltipController->SetPositionAndAlignment( TPoint( center.iX, rect.iTl.iY ), EHLeftVBottom ); + + iTooltipController->SetTimeDelayBeforeShow( KInfoTooltipDelay ); + iTooltipController->SetTimePopupInView( KInfoTooltipDisplayTime ); + + iFeedback = MTouchFeedback::Instance(); + if ( iFeedback ) + { + iFeedback->SetFeedbackArea( iListBox, 0, iListBox->Rect(), + ETouchFeedbackBasic, ETouchEventStylusDown ); + } + + PRINT(_L("Camera <= CCamInfoListBoxContainer::ConstructL") ) + } + +// --------------------------------------------------------------------------- +// CCamInfoListBoxContainer::CCamInfoListBoxContainer +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamInfoListBoxContainer::CCamInfoListBoxContainer( CCamAppController& aController, + CAknView& aView, + TInt aSettingValue ) +: CCamContainerBase( aController, aView ), iSettingValue( aSettingValue ), +iTooltipController(NULL), +iShowTooltip(EFalse), +iTooltipIndex(-1), +iActivateOnTouchRelease(EFalse) + + { + } + + +// ----------------------------------------------------------------------------- +// CCamInfoListBoxContainer::CurrentSettingItemValue +// Returns the Current item's setting value ID +// ----------------------------------------------------------------------------- +TInt CCamInfoListBoxContainer::CurrentSettingItemValue() const + { + return static_cast(iListBox->Model())->ItemValue(iListBox->CurrentItemIndex()); + } + + +TBool CCamInfoListBoxContainer::SettingValueChanged() const + { + return CurrentSettingItemValue() != iSettingValue; + } + +// ----------------------------------------------------------------------------- +// CCamInfoListBoxContainer::IndexForValueId() const +// Returns the index of the item in the array with the specified ValueId +// ----------------------------------------------------------------------------- +TInt +CCamInfoListBoxContainer::IndexForValueId( TInt aValueId ) const + { + return static_cast( iListBox->Model() )->ValueIndex( aValueId ); + } + +// ----------------------------------------------------------------------------- +// CCamInfoListBoxContainer::HandleSettingValueUpdateL +// Handles a change to the setting value of the slider +// ----------------------------------------------------------------------------- +// +void CCamInfoListBoxContainer::HandleSettingValueUpdateL( TInt /*aNewValue*/ ) + { + } + +// --------------------------------------------------------- +// CCamInfoListBoxContainer::CountComponentControls +// Returns the number of controls owned +// --------------------------------------------------------- +// +TInt CCamInfoListBoxContainer::CountComponentControls() const + { + return 1; + } + +// --------------------------------------------------------- +// CCamInfoListBoxContainer::ComponentControl +// Returns the requested component control +// --------------------------------------------------------- +// +CCoeControl* CCamInfoListBoxContainer::ComponentControl( TInt /*aIndex*/ ) const + { + return iListBox; + } + +// --------------------------------------------------------- +// CCamInfoListBoxContainer::Draw +// Draw control +// ---------------------------------------------------------- +// +void CCamInfoListBoxContainer::Draw( const TRect& aRect ) const + { + PRINT(_L("Camera => CCamInfoListBoxContainer::Draw") ) + + CWindowGc& gc = SystemGc(); + if ( CamUtility::IsNhdDevice() ) + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsDrawUtils::Background( skin, iBgContext, gc, aRect ); + // draw the title text + TRgb color; + AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + iTitleTextRectLayout.DrawText( gc, *iListboxTitle, ETrue, color ); + } + else + { + TRAP_IGNORE( DrawSummaryTextL( gc ) ); + } + + PRINT(_L("Camera <= CCamInfoListBoxContainer::Draw") ) + } + +// ---------------------------------------------------------------- +// CCamInfoListBoxContainer::OfferKeyEventL +// Handles this application view's command keys. Forwards other +// keys to child control(s). +// ---------------------------------------------------------------- +// +TKeyResponse CCamInfoListBoxContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + iController.StartIdleTimer(); + + // If the Ok button is pressed, select the current item + if ( aKeyEvent.iCode == EKeyOK && aKeyEvent.iRepeats == 0 && aType == EEventKey ) + { + TKeyResponse response = iListBox->OfferKeyEventL( aKeyEvent, aType ); + iView.HandleCommandL( EAknSoftkeySelect ); + return response; + } + + TKeyResponse returnvalue = iListBox->OfferKeyEventL( aKeyEvent, aType ); + + if ( CamUtility::IsNhdDevice() ) + { + // for non touch, we use key presses to scroll thru the scene modes + // for touch with keyboard, key pressing can also scroll thru the scene modes + // after every up and down key presses we display the tool tip + if ( EStdKeyUpArrow == aKeyEvent.iScanCode || + EStdKeyDownArrow == aKeyEvent.iScanCode ) + { + ShowTooltipL(); + } + } + else // No tooltip + { + DrawDeferred(); // Update explanation text + } + + return returnvalue; + } + +// ----------------------------------------------------------------- +// CCamInfoListBoxContainer::ConstructSummaryDetailsFromResourceL +// Sets up the layouts of the summary items +// ----------------------------------------------------------------- +void CCamInfoListBoxContainer::ConstructSummaryDetailsFromResourceL(TInt aResourceId) + { + // Find the name and path of the MBM file for bitmaps + TFileName mbmFileName; + CamUtility::ResourceFileName( mbmFileName ); + + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResourceId ); + const TInt count = reader.ReadInt16(); + + TInt i; + TInt bitmapId; + + // Read all of the summary entries from the resource file + for ( i = 0; i < count; i++ ) + { + reader.ReadInt16(); // The current item enum is not needed + bitmapId = reader.ReadInt32(); + User::LeaveIfError( iSummaryBitmapArray.Append( AknIconUtils::CreateIconL( mbmFileName, bitmapId ) ) ); + + User::LeaveIfError( iTitleArray.Append( reader.ReadHBufC16L() ) ); + User::LeaveIfError( iDescArray.Append( reader.ReadHBufC16L() ) ); + } + + CleanupStack::PopAndDestroy(); + } + + +// -------------------------------------------------------------------------- +// CCamInfoListBoxContainer::HandlePointerEventL +// -------------------------------------------------------------------------- +// +void CCamInfoListBoxContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + + RDebug::Print(_L("CCamInfoListBoxContainer::HandlePointerEventL iType=%d iPosition=(%d, %d)"), + aPointerEvent.iType, + aPointerEvent.iPosition.iX, + aPointerEvent.iPosition.iY ); + iListBox->HandlePointerEventL(aPointerEvent); + /*TInt oldListItemIndex = -1; + TInt newListItemIndex = -1; + TBool handleItemActivation = EFalse; + + if ( iListBox ) + { + oldListItemIndex = iListBox->CurrentItemIndex(); + } + + // send to coecontrol -> will inform controls in this container about pointer events + // (listbox will handle focus changes and scrolling) + CCoeControl::HandlePointerEventL( aPointerEvent ); + + if ( iListBox ) + { + newListItemIndex = iListBox->CurrentItemIndex(); + } + + // figure out if item was activated by touch down + release combination on same item + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + + if ( iListBox->Rect().Contains( aPointerEvent.iPosition ) ) + { + if ( newListItemIndex != oldListItemIndex ) + { + iActivateOnTouchRelease = EFalse; + } + else + { + // set the current item to be activated on touch release + iActivateOnTouchRelease = ETrue; + } + + // show tooltip always when touch event down happens inside listbox + ShowTooltipL(); + } + else + { + iActivateOnTouchRelease = EFalse; + } + + + } + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + if ( iActivateOnTouchRelease && ( newListItemIndex == oldListItemIndex ) ) + { + // only if list item index has not changed during event + // and iActivateOnTouchRelease is true + TInt pointedItemIndex = 0; + TBool focusableItemPointed = + iListBox->View()->XYPosToItemIndex( aPointerEvent.iPosition, + pointedItemIndex ); + // check that pointer is in focusable area + if ( focusableItemPointed ) + { + handleItemActivation = ETrue; + iActivateOnTouchRelease = EFalse; + } + else + { + iActivateOnTouchRelease = EFalse; + } + } + } + else + { + // aPointerEvent.iType == TPointerEvent::EDrag + + if ( newListItemIndex != oldListItemIndex ) + { + // change only when drag event changes the listitem index + iActivateOnTouchRelease = EFalse; + + // with drag always update the tooltip + ShowTooltipL(); + } + + } + + + if ( handleItemActivation ) + { + iView.HandleCommandL( EAknSoftkeySelect ); + }*/ + } + +// -------------------------------------------------------------------------- +// CCamInfoListBoxContainer::HandleListBoxEventL +// Handles Listbox events +// -------------------------------------------------------------------------- +// + +void CCamInfoListBoxContainer::HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ) + { + switch( aEventType ) + { + case EEventEnterKeyPressed: + case EEventItemDoubleClicked: + { + iView.HandleCommandL( EAknSoftkeySelect ); + } + break; + + case EEventItemClicked: + case EEventItemSingleClicked: + { + ShowTooltipL(); + } + break; + default: + break; + } + } + +// -------------------------------------------------------------------------- +// CCamInfoListBoxContainer::ShowTooltipL +// -------------------------------------------------------------------------- +// +void CCamInfoListBoxContainer::ShowTooltipL() + { + + if ( !iTooltipController || ( iDescArray[iListBox->CurrentItemIndex()]->Length() <= 0 ) ) + { + return; + } + + if ( iTooltipIndex != iListBox->CurrentItemIndex() ) + { + // make sure that possible already open tooltip is hidden + iTooltipController->HideInfoPopupNote(); + + iTooltipController->SetTextL( *iDescArray[iListBox->CurrentItemIndex()] ); + iTooltipController->SetPositionByHighlight( iListBox->HighlightRect() ); + + iTooltipIndex = iListBox->CurrentItemIndex(); + } + + + iTooltipController->ShowInfoPopupNote(); + + } + + +// -------------------------------------------------------------------------- +// CCamInfoListBoxContainer::ConstructContainerTitleFromResourceL +// -------------------------------------------------------------------------- +// +void CCamInfoListBoxContainer::ConstructContainerTitleFromResourceL( TInt aResourceId ) + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResourceId ); // cleanupstack + + iListboxTitle = reader.ReadHBufC16L(); + + CleanupStack::PopAndDestroy(); // reader + } + + +// ----------------------------------------------------------------- +// CCamInfoListBoxContainer::DrawSummaryText (ISO setting) +// Draws summary title and description text +// ----------------------------------------------------------------- + +void CCamInfoListBoxContainer::DrawSummaryTextL( CWindowGc& aGc ) const + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + appUi->SetTitleL( *iListboxTitle ); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsDrawUtils::Background( skin, iBgContext, aGc, Rect() ); + + // Draw summary frame + TRect explTxtRect = iExplanationRect; + TInt border = iExplIconLayout.Rect().iTl.iX - iExplanationRect.iTl.iX; + explTxtRect.Shrink( border/2 , border/2 ); + AknsDrawUtils::DrawFrame( skin, aGc, iExplanationRect, explTxtRect, + KAknsIIDQsnFrInput, KAknsIIDNone ); //frame + + AknIconUtils::SetSize( iSummaryBitmapArray[iListBox->CurrentItemIndex()], + iExplIconLayout.Rect().Size() ); + iExplIconLayout.DrawImage( aGc, + iSummaryBitmapArray[ iListBox->CurrentItemIndex() ], NULL ); + + TRgb explTitleTxtColor; // same as list highlight text + TRgb explTxtColor; // same as main area text + AknsUtils::GetCachedColor( skin, explTitleTxtColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG10 ); + AknsUtils::GetCachedColor( skin, explTxtColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + iExplTitleLayout.DrawText( aGc, + iTitleArray[ iListBox->CurrentItemIndex() ]->Des(), + ETrue, explTitleTxtColor ); + AknTextUtils::WrapToArrayL( *iDescArray[iListBox->CurrentItemIndex()], + iExplTxtLinesLayout[0].TextRect().Width(), + *iExplTxtLinesLayout[0].Font(), + *iCurrentDescLineArray ); + TInt lCount = Min( iExplLineCount, iCurrentDescLineArray->Count() ); + for ( TInt i = 0; i < lCount; i++ ) + { + iExplTxtLinesLayout[i].DrawText( aGc, (*iCurrentDescLineArray)[i], + ETrue, explTxtColor ); + } + } + +// -------------------------------------------------------------------------- +// CCamInfoListBoxContainer::TouchLayout +// -------------------------------------------------------------------------- +// +TRect CCamInfoListBoxContainer::TouchLayout() + { + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, + statusPaneRect ); + iLayoutAreaRect.BoundingRect( statusPaneRect ); + // get the rect size for listbox in the layout + TAknLayoutRect wholeListboxLayoutRect; + wholeListboxLayoutRect.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset_listscroll_pane( 3 ) ); + TInt listBoxHeight = iListBox->CalcHeightBasedOnNumOfItems( + iListBox->Model()->NumberOfItems() ); + // get layout for the listbox rect + if ( wholeListboxLayoutRect.Rect().Height() < listBoxHeight ) + { + // if scrollbars are used, use scrollbar layout + iListboxLayoutRect.LayoutRect( wholeListboxLayoutRect.Rect(), + AknLayoutScalable_Apps::main_cset_list_pane( 0 ) ); + } + else + { + iListboxLayoutRect.LayoutRect( wholeListboxLayoutRect.Rect(), + AknLayoutScalable_Apps::main_cset_list_pane( 1 ) ); + } + + iTitleTextRectLayout.LayoutText( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cam_set_pane_t1( 3 ) ); + + return wholeListboxLayoutRect.Rect(); + } + +// -------------------------------------------------------------------------- +// CCamInfoListBoxContainer::NonTouchLayout +// -------------------------------------------------------------------------- +// +TRect CCamInfoListBoxContainer::NonTouchLayout() + { + TAknLayoutRect wholeListboxLayoutRect; + wholeListboxLayoutRect.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset6_listscroll_pane( 3 ) ); + TAknLayoutRect listLayoutRect; + listLayoutRect.LayoutRect( iLayoutAreaRect, //1 + AknLayoutScalable_Apps::main_cset6_listscroll_pane( 4 ) ); + TInt listBoxHeight = iListBox->CalcHeightBasedOnNumOfItems( + iListBox->Model()->NumberOfItems() ); + if ( wholeListboxLayoutRect.Rect().Height() < listBoxHeight ) + { + // if scrollbars are used, use scrollbar layout + iListboxLayoutRect.LayoutRect( listLayoutRect.Rect(), + AknLayoutScalable_Apps::main_cset_list_pane_copy1( 0 ) ); + AknLayoutUtils::LayoutVerticalScrollBar( iListBox->ScrollBarFrame(), + listLayoutRect.Rect(), + AknLayoutScalable_Apps::scroll_pane_cp028_copy1( 0 ) ); + } + else + { + iListboxLayoutRect.LayoutRect( listLayoutRect.Rect(), + AknLayoutScalable_Apps::main_cset_list_pane_copy1( 1 ) ); + } + + // Explanation ikon, title, and text layout + TAknLayoutRect explParent; + explParent.LayoutRect( iLayoutAreaRect,//2 + AknLayoutScalable_Apps::main_cset6_text2_pane( 0 ) ); + TAknLayoutRect explLayoutRect; + explLayoutRect.LayoutRect( explParent.Rect(), + AknLayoutScalable_Apps::bg_popup_preview_window_pane_cp03( 0 ) ); + iExplanationRect = explLayoutRect.Rect(); + + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, + statusPaneRect ); + iExplanationRect.Move( 0, -statusPaneRect.Height() ); + + iExplIconLayout.LayoutRect( iExplanationRect, + AknLayoutScalable_Apps::main_cset6_text2_pane_g1( 0 ) ); + iExplTitleLayout.LayoutText( iExplanationRect, + AknLayoutScalable_Apps::main_cset6_text2_pane_t1( 0 ) ); + iExplTitleLayout.LayoutText( iExplanationRect, + AknLayoutScalable_Apps::main_cset6_text2_pane_t1( 0 ) ); + + TAknLayoutRect explTxtParent; + explTxtParent.LayoutRect( iExplanationRect, + AknLayoutScalable_Apps::list_cset_text2_pane(0) ); + TAknLayoutScalableParameterLimits listLimits = + AknLayoutScalable_Apps::list_cset_text2_pane_t1_ParamLimits( 0 ); + iExplLineCount = listLimits.LastRow() + 1; + for ( TInt i = 0; i < iExplLineCount; i++ ) + { + TAknLayoutText layoutText; + layoutText.LayoutText( explTxtParent.Rect(), + AknLayoutScalable_Apps::list_cset_text2_pane_t1( 0, 0, i ) ); + (void) iExplTxtLinesLayout.Append( layoutText ); // Errors are ignored + } + + TRect ret = wholeListboxLayoutRect.Rect(); + // Non-touch has a visible title & status panes + TRect titlePaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::ETitlePane, + titlePaneRect ); + ret.Move( 0, -titlePaneRect.Height() - statusPaneRect.Height() ); + return ret; + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamInfoListBoxModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamInfoListBoxModel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Model for CamInfoListBox* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include "CamInfoListBoxModel.h" +#include "CamCaptureSetupListItem.h" +#include "camlogging.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamInfoListBoxModel::CCamInfoListBoxModel +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamInfoListBoxModel::CCamInfoListBoxModel( CCamAppController& aController, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray ) +: CCamCaptureSetupListBoxModel( aController, ETrue ), + iSummaryTitleTextArray( aSummaryTitleTextArray ), + iSummaryDescriptionTextArray( aSummaryDescriptionTextArray ) + { + } + +// ----------------------------------------------------------------------------- +// CCamInfoListBoxModel::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamInfoListBoxModel::ConstructL( TInt aResourceId, TRect aListBoxRect ) + { + // read layout data + ReadLayoutData( aListBoxRect ); + GetListboxDataL( aResourceId ); + } + +// ----------------------------------------------------------------------------- +// CCamInfoListBoxModel::GetListboxDataL +// ----------------------------------------------------------------------------- +// +void CCamInfoListBoxModel::GetListboxDataL( TInt aArrayResourceId ) + { + + + // create array from resource + TResourceReader reader; + CEikonEnv::Static()->CreateResourceReaderLC( reader, aArrayResourceId ); + const TInt count = reader.ReadInt16(); + + // for each entry in the resource array, create a new list item + TInt i; + for ( i = 0; i < count; i++ ) + { + CCamCaptureSetupListItem* listItem = CCamCaptureSetupListItem:: + NewLC( reader, iIconLayoutData ); + + iItemArray.AppendL( listItem ); + CleanupStack::Pop( listItem ); + } + CleanupStack::PopAndDestroy(); // reader + } + + + +// ----------------------------------------------------------------------------- +// CCamInfoListBoxModel::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamInfoListBoxModel* CCamInfoListBoxModel::NewLC( CCamAppController& aController, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray, + TInt aResourceId, + TRect aListBoxRect ) + { + CCamInfoListBoxModel* self = new( ELeave ) CCamInfoListBoxModel( aController, + aSummaryTitleTextArray, + aSummaryDescriptionTextArray ); + + CleanupStack::PushL( self ); + self->ConstructL( aResourceId, aListBoxRect ); + return self; + } + + +// Destructor +CCamInfoListBoxModel::~CCamInfoListBoxModel() + { + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamLocationIconController.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamLocationIconController.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,521 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implemantation for CCamLocationIconController class. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#include "CamLocationIconController.h" + +#include +#include // RProperty +#ifndef __WINSCW__ + #include // P&S keys +#endif +#include // KAknsMessageSkinChange +#include +#include +#include + +#include "CamAppController.h" +#include "CamIndicator.h" +#include "CamIndicatorResourceReader.h" +#include "CamIndicatorData.h" + +#include "CamPropertyWatcher.h" +#include "CamUtility.h" +#include "CamSettingsInternal.hrh" + +#include "CamControllerObservers.h" + +// --------------------------------------------------------------------------- +// CCamLocationIconController::CCamLocationIconController +// --------------------------------------------------------------------------- +// +CCamLocationIconController::CCamLocationIconController( CCamAppController& aController, + MCamLocationIconObserver& aObserver, + TBool aCallbackActive ) : + iController( aController ), iObserver( aObserver ), iCallbackActive( aCallbackActive ) + { + } + +// --------------------------------------------------------------------------- +// CCamLocationIconController::~CCamLocationIconController +// --------------------------------------------------------------------------- +// +CCamLocationIconController::~CCamLocationIconController() + { + PRINT ( _L("Camera => CCamLocationIconController::~CCamLocationIconController") ); + + iLocationIndicators.ResetAndDestroy(); + iLocationIndicators.Close(); + delete iLocationStateWatcher; + + iController.RemoveControllerObserver( this ); + + PRINT ( _L("Camera <= CCamLocationIconController::~CCamLocationIconController") ); + } + +// --------------------------------------------------------------------------- +// CCamLocationIconController::NewL +// --------------------------------------------------------------------------- +// +CCamLocationIconController* CCamLocationIconController::NewL( CCamAppController& aController, + MCamLocationIconObserver& aObserver, + TBool aCallbackActive, TRect& aRect ) + { + PRINT ( _L("Camera => CCamLocationIconController::NewL") ); + + CCamLocationIconController* self = + new (ELeave) CCamLocationIconController( aController, aObserver, aCallbackActive ); + CleanupStack::PushL( self ); + self->ConstructL(aRect); + CleanupStack::Pop(); // self + PRINT ( _L("Camera <= CCamLocationIconController::NewL") ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamLocationIconController::ConstructL +// --------------------------------------------------------------------------- +// +void CCamLocationIconController::ConstructL(TRect& aRect) + { + PRINT ( _L("Camera => CCamLocationIconController::ConstructL") ); + iEnv = CEikonEnv::Static(); + iRect.SetRect(aRect.iTl, aRect.Size()); + //Change this later when the location active object has been finished!! + iLocationState = KLocationSettingStateOff; + CreateLocationIndicatorL(); + +#ifndef __WINSCW__ + // Construct property watchers for location indicator status + iLocationStateWatcher = CCamPropertyWatcher::NewL( *this, KPSUidLocationTrail, KLocationTrailState ); + + // Subscribe to the properties + iLocationStateWatcher->Subscribe(); +#endif + + // Read initial values for location status + ReadCurrentState(); + + iController.AddControllerObserverL( this ); + + PRINT ( _L( "Camera <= CCamLocationIconController::ConstructL" ) ); + } + + +//---------------------------------------------------------- +// CCamLocationIconController::CreateLocationIndicatorL +//---------------------------------------------------------- +void CCamLocationIconController::CreateLocationIndicatorL() + { + RArray icons; + CleanupClosePushL( icons ); + User::LeaveIfError( icons.Append( EMbmCameraappQgn_indi_cam4_geotag_off ) ); + User::LeaveIfError( icons.Append( EMbmCameraappQgn_indi_cam4_geotag_off_mask ) ); + User::LeaveIfError( icons.Append( EMbmCameraappQgn_indi_cam4_geotag_on ) ); + User::LeaveIfError( icons.Append( EMbmCameraappQgn_indi_cam4_geotag_on_mask ) ); + TInt count = icons.Count(); + // Get the icon rect + TRect iconRect = Rect(); + + CCamIndicator* indicator; + for( TInt i = 0; i < count; i+=2 ) + { + indicator = CCamIndicator::NewL( iconRect ); + CleanupStack::PushL( indicator ); + indicator->AddIconL( icons[i], icons[i+1] ); // Bitmap & mask. + indicator->SetRect( iconRect ); + + User::LeaveIfError( iLocationIndicators.Append( indicator ) ); + CleanupStack::Pop( indicator ); + } + + CleanupStack::PopAndDestroy( &icons ); + + } + + +// --------------------------------------------------------------------------- +// CCamLocationIconController::SetCallbackActive +// --------------------------------------------------------------------------- +// +void CCamLocationIconController::SetCallbackActive( TBool aActive ) + { + iCallbackActive = aActive; + } + + +// --------------------------------------------------------------------------- +// CCamLocationIconController::UpdateRect +// --------------------------------------------------------------------------- +// +void CCamLocationIconController::UpdateRect() + { + TInt i; + TRect newRect = Rect(); + TInt count = iLocationIndicators.Count(); + + const TCamCameraMode mode = iController.CurrentMode(); + const TCamCameraMode targetmode = iController.TargetMode(); + TBool ShowIcon = ETrue; + if ( (targetmode != mode) + || (( ECamControllerImage != targetmode ) + && ( ECamControllerVideo != targetmode )) ) + { + ShowIcon = EFalse; + } + + for ( i = 0; i < count; i++ ) + { + + if ( ShowIcon ) + { + iLocationIndicators[i]->DisplayIcon(); + } + else + { + iLocationIndicators[i]->ClearIcon(); + } + iLocationIndicators[i]->SetRect( newRect ); + } + NotifyObserver(); + } + +// --------------------------------------------------------------------------- +// CCamLocationIconController::SetLocationState +// --------------------------------------------------------------------------- +// +void CCamLocationIconController::SetLocationState( TInt aState ) + { + PRINT( _L("Camera => CCamLocationIconController::SetLocationState") ); + + // Possible location trail states are 0,1,2 and 3 + // but the GPS data is available only with the state 3 + // so that is when the icon is changed to on state. + // Possible values + // - TrailStopped (value 0 - off-icon) + // - TrailStarted - No valid GPS data (value 1 - off-icon) + // - TrailStarted - Searching GPS device (value 2 - off-icon) + // - TrailStarted - GPS data available (value 3 - on-icon) + if ( KCamLocationTrailGPSDataAvail == aState ) + { + iLocationState = KLocationSettingStateOn; + } + else + { + iLocationState = KLocationSettingStateOff; + } + + NotifyObserver(); + + PRINT( _L("Camera <= CCamLocationIconController::SetLocationState") ); + } + +// --------------------------------------------------------------------------- +// CCamLocationIconController::Rect +// Returns the rectangle defining the position and size +// of the location icon +// ---------------------------------------------------- +// +TRect CCamLocationIconController::Rect() const + { + TAknLayoutRect camIndicatorPane; + TAknLayoutRect layoutRect; + + TSize screenSize; + AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, screenSize ); + TRect extent = TRect( TPoint(), screenSize ); + + const TCamCameraMode targetmode = iController.TargetMode(); + const TCamCaptureOperation operation = iController.CurrentVideoOperation(); + if ( ECamControllerVideo == targetmode ) + { + if ( ( ECamCapturing == operation )|| + ( ECamPausing == operation ) || + ( ECamPaused == operation ) || + ( ECamResuming == operation )) + { + if ( CamUtility::IsNhdDevice() ) + { + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::vid4_progress_pane( 1 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_g5( 0 ) ); + } + else // portrait + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::vid4_progress_pane( 0 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_g5( 1 ) ); + } + } + else + { + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::vid6_indi_pane( 0 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g4( 1 ) ); + } + else // portrait + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::vid6_indi_pane( 3 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g4( 3 ) ); + } + } + } + else + { + if ( CamUtility::IsNhdDevice() ) + { + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::vid4_indicators_pane( 1 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid4_indicators_pane_g5( 0 ) ); + } + else // portrait + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::vid4_indicators_pane( 0 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid4_indicators_pane_g5( 1 ) ); + } + } + else + { + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::vid6_indi_pane( 0 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g4( 0 ) ); + } + else // portrait + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::vid6_indi_pane( 3 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g4( 2 ) ); + } + } + } + } + else + { + if ( CamUtility::IsNhdDevice() ) + { + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::cam4_indicators_pane( 1 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::cam4_indicators_pane_g3( 0 ) ); + } + else // portrait + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::cam4_indicators_pane( 0 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::cam4_indicators_pane_g3( 1 ) ); + } + } + else + { + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::cam6_indi_pane( 0 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::cam6_indi_pane_g3( 0 ) ); + } + else // portrait + { + camIndicatorPane.LayoutRect( + extent, + AknLayoutScalable_Apps::cam6_indi_pane( 3 ) ); + layoutRect.LayoutRect( + camIndicatorPane.Rect(), + AknLayoutScalable_Apps::cam6_indi_pane_g3( 2 ) ); + } + } + } + return layoutRect.Rect(); + } + +// --------------------------------------------------------------------------- +// CCamLocationIconController::Draw +// --------------------------------------------------------------------------- +// +void CCamLocationIconController::Draw( CBitmapContext& aGc ) const + { + PRINT( _L("Camera => CCamLocationIconController::Draw") ); + + // draw location indicator icon only for main camera + if ( iController.ActiveCamera() == ECamActiveCameraPrimary ) + { + // Make sure no brush is being used + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + iLocationIndicators[iLocationState]->Draw( aGc ); + } + + PRINT( _L("Camera <= CCamLocationIconController::Draw") ); + } + + +// --------------------------------------------------------------------------- +// CCamLocationIconController::NotifyObserver +// --------------------------------------------------------------------------- +// +void CCamLocationIconController::NotifyObserver() + { + if( iCallbackActive ) + { + iObserver.LocationIconUpdated(); + } + } + +// --------------------------------------------------------------------------- +// CCamLocationIconController::ReadCurrentState +// --------------------------------------------------------------------------- +// +void CCamLocationIconController::ReadCurrentState() + { + PRINT( _L("Camera => CCamLocationIconController::ReadCurrentState") ); + + TInt locationState = KLocationSettingStateOff; +#ifndef __WINSCW__ + TInt err = KErrNone; + + // Get the location state + err = iLocationStateWatcher->Get( locationState ); + if( KErrNone == err && -1 != locationState && KCamLocationTrailStopped <= locationState && KCamLocationTrailGPSDataAvail >= locationState ) + { + // We got an acceptable value + SetLocationState( locationState ); + } + else + { + // Default to off value + SetLocationState( KLocationSettingStateOff ); + } +#endif // __WINSCW__ + + NotifyObserver(); + + PRINT( _L("Camera <= CCamLocationIconController::ReadCurrentState") ); + } + +// --------------------------------------------------------------------------- +// CCamLocationIconController::HandlePropertyChangedL +// --------------------------------------------------------------------------- +// +#ifndef __WINSCW__ +void CCamLocationIconController::HandlePropertyChangedL( const TUid& aCategory, const TUint aKey ) + { + PRINT( _L("Camera => CCamLocationIconController::HandlePropertyChangedL") ); + + TInt value = KLocationSettingStateOff; + if( KPSUidLocationTrail == aCategory && KLocationTrailState == aKey ) + { + TInt err = iLocationStateWatcher->Get( value ); + if( KErrNone == err && -1 != value && KCamLocationTrailStopped <= value && KCamLocationTrailGPSDataAvail >= value ) + { + SetLocationState( value ); + } + } + else + { + // Do nothing. For Lint. + } + + PRINT( _L("Camera <= CCamLocationIconController::HandlePropertyChangedL") ); + } +#else +void CCamLocationIconController::HandlePropertyChangedL( const TUid& /*aCategory*/, const TUint /*aKey*/ ) + { + // Empty + } +#endif // __WINSCW__ + + +// --------------------------------------------------------------------------- +// HandleControllerEventL +// +// Update the rect for any controller event +// --------------------------------------------------------------------------- +// +void +CCamLocationIconController::HandleControllerEventL( TCamControllerEvent aEvent, + TInt /*aError*/ ) + { + PRINT( _L("Camera => CCamLocationIconController::HandleControllerEventL") ); + if ( ECamEventExitRequested != aEvent ) + { + TBool locIconVisible( EFalse ); + locIconVisible = + iController.IntegerSettingValue( ECamSettingItemRecLocation ) == ECamLocationOn; + + if ( locIconVisible ) + { + PRINT( _L("Camera => UpdateRect()") ); + UpdateRect(); + PRINT( _L("Camera <= UpdateRect()") ); + } + } + PRINT( _L("Camera <= CCamLocationIconController::HandleControllerEventL") ); + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamLogger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamLogger.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,298 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements logging of test data.* +*/ + + + +// INCLUDE FILES +#include "CamLogger.h" +#include +#include + +// CONSTANTS +const TInt KMaxFileNameLength = 50; + +// FORWARD DECLARATIONS +//#ifdef CAMERAAPP_TEST + +#ifdef CAMERAAPP_UNIT_TEST_SETTINGS_LIST_TESTER +_LIT( KDirectory, "Unit Tests\\Output" ); +#endif // CAMERAAPP_UNIT_TEST_SETTINGS_LIST_TESTER + +#ifdef CAMERAAPP_UNIT_TEST +_LIT( KDirectory, "Unit Tests\\Output" ); +#endif // CAMERAAPP_UNIT_TEST + +#ifdef CAPTURESETUP_UNIT_TEST +_LIT( KDirectory, "Unit Tests\\Output" ); +#endif // CAMERAAPP_UNIT_TEST + +#ifdef CAMERAAPP_INTEGRATION_TEST +_LIT( KDirectory, "Integration Tests\\Output" ); +#endif // CAMERAAPP_INTEGRATION_TEST + +#ifdef CAMERAAPP_FRAMEWORK_UNIT_TEST +_LIT( KDirectory, "Unit Tests\\Output" ); +#endif // CAMERAAPP_FRAMEWORK_UNIT_TEST + +#ifdef CAPTURE_SETUP_MENU_UNIT_TEST +_LIT( KDirectory, "Unit Tests\\Output" ); +#endif // CAPTURE_SETUP_MENU_UNIT_TEST + +#ifdef SETUP_PANE_UNIT_TEST +_LIT( KDirectory, "Unit Tests\\Output" ); +#endif // SETUP_PANE_UNIT_TEST + +#ifdef CAMERAAPP_BURST_UNIT_TEST +_LIT( KDirectory, "Unit Tests\\Output" ); +#endif // CAMERAAPP_BURST_UNIT_TEST + +#ifdef CAMERAAPP_UNIT_TEST_USER_SCENE_SETUP +_LIT( KDirectory, "Unit Tests\\Output" ); +#endif // CAMERAAPP_UNIT_TEST_USER_SCENE_SETUP + +// ============================ STATIC FUNCTIONS =============================== + +// --------------------------------------------------------- +// CamLogger::InitialiseLogs +// Initialises the files for writing to. +// Necessary, otherwise previous output will remain in logs. +// --------------------------------------------------------- +// +void CamLogger::InitialiseLogsL( const TDesC& aIdentifier, TBool aIgnore ) + { + if ( !aIgnore ) + { + // Create the directory for log files, if not already created. + _LIT( KUnitTestsLogPath, "C:\\Logs\\Unit Tests\\Output\\" ); + RFs rfs; + User::LeaveIfError( rfs.Connect() ); + CleanupClosePushL( rfs ); + TInt err = rfs.MkDirAll( KUnitTestsLogPath ); + // If there was an error and it wasn't that the directory already exists + // then leave. + if ( ( err != KErrNone ) && ( err != KErrAlreadyExists ) ) + { + User::Leave( err ); + } + CleanupStack::PopAndDestroy( &rfs ); + + // Overwrite contents of passed file. + TBuf passedFileName; + GetPassedFileName( aIdentifier, passedFileName ); + RFileLogger::Write( KDirectory, passedFileName, EFileLoggingModeOverwrite, KNullDesC ); + + // Overwrite contents of failed file. + TBuf failedFileName; + GetFailedFileName( aIdentifier, failedFileName ); + RFileLogger::Write( KDirectory, failedFileName, EFileLoggingModeOverwrite, KNullDesC ); + + // Overwrite contents of log file. + TBuf logFileName; + GetLogFileName( aIdentifier, logFileName ); + RFileLogger::Write( KDirectory, logFileName, EFileLoggingModeOverwrite, KNullDesC ); + } + } + +// --------------------------------------------------------- +// CamLogger::LogHeader +// Writes header info to all files identified by aIdentifier. +// --------------------------------------------------------- +// +void CamLogger::LogHeader( const TDesC& aIdentifier, const TDesC& aHeader ) + { + // Header divider to be written under the header content. + _LIT( KHeaderDivider, "=====================================================" ); + + // Write header to passed file. + TBuf passedFileName; + GetPassedFileName( aIdentifier, passedFileName ); + RFileLogger::Write( KDirectory, passedFileName, EFileLoggingModeAppend, aHeader ); + RFileLogger::Write( KDirectory, passedFileName, EFileLoggingModeAppend, KHeaderDivider ); + + // Write header to failed file. + TBuf failedFileName; + GetFailedFileName( aIdentifier, failedFileName ); + RFileLogger::Write( KDirectory, failedFileName, EFileLoggingModeAppend, aHeader ); + RFileLogger::Write( KDirectory, failedFileName, EFileLoggingModeAppend, KHeaderDivider ); + + // Write header to log file. + TBuf logFileName; + GetLogFileName( aIdentifier, logFileName ); + RFileLogger::Write( KDirectory, logFileName, EFileLoggingModeAppend, aHeader ); + RFileLogger::Write( KDirectory, logFileName, EFileLoggingModeAppend, KHeaderDivider ); + } + +// --------------------------------------------------------- +// CamLogger::LogTestResult +// Writes results of a test to either the passed, failed or log file. +// --------------------------------------------------------- +// +void CamLogger::LogTestResult( const TDesC& aIdentifier, + TTestFileType aExpr, const TDesC& aTestDesc ) + { + const TInt KMaxTestDescLength = 256; + // Evaluate expression (aExpr), and write the test description to either the + // passed.txt or failed.txt or log.txt file, depending on result. + if ( aExpr == ETestFilePassed ) + { + // Create text + _LIT( KPassedTest, "Test passed: " ); + TBuf desc( KPassedTest ); + desc.Append( aTestDesc ); + + // Write text to passed file. + TBuf passedFileName; + GetPassedFileName( aIdentifier, passedFileName ); + RFileLogger::Write( KDirectory, passedFileName, EFileLoggingModeAppend, desc ); + } + else if ( aExpr == ETestFileFailed ) + { + // Create text + _LIT( KFailedTest, "Test failed: " ); + TBuf desc( KFailedTest ); + desc.Append( aTestDesc ); + + // Write text to failed file. + TBuf failedFileName; + GetFailedFileName( aIdentifier, failedFileName ); + RFileLogger::Write( KDirectory, failedFileName, EFileLoggingModeAppend, desc ); + } + else + { + // Write text to log file. + TBuf logFileName; + GetLogFileName( aIdentifier, logFileName ); + RFileLogger::Write( KDirectory, logFileName, EFileLoggingModeAppend, aTestDesc ); + } + } + +void CamLogger::LogDetail( const TDesC& aIdentifier, + const TDesC& aUnitTestId, + TInt aTestId, + TTestResult aResult, + const TDesC& aDetail ) + { + // Write detail to log file. + const TInt KMaxTestDescLength = 256; + TBuf logFileName; + GetLogFileName( aIdentifier, logFileName ); + + TBuf LogString; + + TBuf Result; + switch (aResult) + { + case UTStarted: + { + _LIT(KUTStarted, "Started"); + Result = KUTStarted; + LogString.Format(_L("UT:%S,T%03d,%S,%S"), + &aUnitTestId, + static_cast(aTestId), + &Result, + &aDetail); + } + break; + case UTFinished: + { + _LIT(KUTFinished, "Finished"); + Result = KUTFinished; + LogString.Format(_L("UT:%S,T%03d,%S,%S"), + &aUnitTestId, + static_cast(aTestId), + &Result, + &aDetail); + } + break; + case UTFailed: + { + _LIT(KUTFailed, "Failed"); + Result = KUTFailed; + LogString.Format(_L("UT:%S,T%03d,%S,%S"), + &aUnitTestId, + static_cast(aTestId), + &Result, + &aDetail); + } + break; + case UTNumberOfTests: + { + _LIT(KUTNumberOfTests, "NoOfTests"); + Result = KUTNumberOfTests; + LogString.Format(_L("UT:%S,%S,%d"), + &aUnitTestId, + &Result, + static_cast(aTestId)); + } + break; + case UTAllTestsFinished: + { + _LIT(KUTAllTestsFinished, "AllTestsFinished"); + Result = KUTAllTestsFinished; + LogString.Format(_L("UT:%S,%S"), + &aUnitTestId, + &Result); + } + break; + default: + { + LogString.Format(_L("UT:Invalid Log")); + } + break; + } + + RFileLogger::Write( KDirectory, logFileName, EFileLoggingModeAppend, LogString ); + } + +// --------------------------------------------------------- +// CamLogger::GetFailedFileName +// Returns the file name of failed test results, for a specific identifer. +// --------------------------------------------------------- +// +void CamLogger::GetFailedFileName( const TDesC& aIdentifier, TDes& aFileName ) + { + _LIT( KFailedPostfix, "Failed.txt" ); + aFileName = aIdentifier; + aFileName.Append( KFailedPostfix ); + } + +// --------------------------------------------------------- +// CamLogger::GetPassedFileName +// Returns the file name of passed test results, for a specific identifer. +// --------------------------------------------------------- +// +void CamLogger::GetPassedFileName( const TDesC& aIdentifier, TDes& aFileName ) + { + _LIT( KPassedPostfix, "Passed.txt" ); + aFileName = aIdentifier; + aFileName.Append( KPassedPostfix ); + } + +// --------------------------------------------------------- +// CamLogger::GetLogFileName +// Returns the file name of log test results, for a specific identifer. +// --------------------------------------------------------- +// +void CamLogger::GetLogFileName( const TDesC& aIdentifier, TDes& aFileName ) + { + _LIT( KLogPostfix, "Log.txt" ); + aFileName = aIdentifier; + aFileName.Append( KLogPostfix ); + } + + +//#endif // __CAM_TEST_MODE__ +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamMemoryMonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamMemoryMonitor.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,288 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 free memory and attempts to free it if necessary +* +*/ + +#include "CamMemoryMonitor.h" + + +#include +#include +#include +#include +#include +#include "CamAppUi.h" +#include "CamAppController.h" +#include "camlogging.h" + + +const static TInt KMemoryCheckInterval = 10*1000*1000; +const static TInt KNeededMemoryLevel = 20*1024*1024; +const static TInt KCriticalMemoryLevel = 18*1024*1024; + + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::NewL +// --------------------------------------------------------------------------- +// +CCamMemoryMonitor* CCamMemoryMonitor::NewL(CCamAppUi* aAppUi, CCamAppController* aController) + { + CCamMemoryMonitor* self = new (ELeave) CCamMemoryMonitor( aAppUi, aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self; + return self; + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::~CCamMemoryMonitor +// --------------------------------------------------------------------------- +// +CCamMemoryMonitor::~CCamMemoryMonitor() + { + PRINT( _L("Camera => CCamMemoryMonitor::~CCamMemoryMonitor") ) + if ( iMemoryCheckTimer ) + { + iMemoryCheckTimer->Cancel(); + delete iMemoryCheckTimer; + } + PRINT( _L("Camera <= CCamMemoryMonitor::~CCamMemoryMonitor") ) + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::StartMonitoring +// --------------------------------------------------------------------------- +// +void CCamMemoryMonitor::StartMonitoring( TInt aLimit, TInt aRequestAmount ) + { + PRINT( _L("Camera => CCamMemoryMonitor::StartMonitoring") ) + if ( !iMemoryCheckTimer->IsActive() ) + { + iLimit = aLimit; + iRequestAmount = aRequestAmount; + iMemoryCheckTimer->Start( KMemoryCheckInterval, KMemoryCheckInterval, + TCallBack( MemoryCheck, this ) ); + } + PRINT( _L("Camera <= CCamMemoryMonitor::StartMonitoring") ) + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::StartMonitoring +// --------------------------------------------------------------------------- +// +void CCamMemoryMonitor::StartMonitoring() + { + PRINT( _L("Camera => CCamMemoryMonitor::StartMonitoring") ) + if ( !iMemoryCheckTimer->IsActive() ) + { + iMemoryCheckTimer->Start( KMemoryCheckInterval, KMemoryCheckInterval, + TCallBack( MemoryCheck, this ) ); + } + PRINT( _L("Camera <= CCamMemoryMonitor::StartMonitoring") ) + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::StopMonitoring +// --------------------------------------------------------------------------- +// +void CCamMemoryMonitor::StopMonitoring() + { + PRINT( _L("Camera => CCamMemoryMonitor::StopMonitoring") ) + iMemoryCheckTimer->Cancel(); + PRINT( _L("Camera <= CCamMemoryMonitor::StopMonitoring") ) + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::CheckAndRequestMemoryL +// --------------------------------------------------------------------------- +// +TInt CCamMemoryMonitor::CheckAndRequestMemoryL( TInt aLimit, TInt aRequestAmount, TBool aShowNote ) + { + + PRINT( _L("Camera => CCamMemoryMonitor::CheckAndRequestMemoryL") ) + if ( IsActive() ) + { + return KErrNone; + } + + TInt memoryLeft = 0; + TInt errorCode = KErrNone; + HAL::Get( HALData::EMemoryRAMFree, memoryLeft ); + if ( memoryLeft < aLimit ) + { + PRINT( _L("Camera <> CCamMemoryMonitor::CheckAndRequestMemoryL memory below limit, requesting") ) + HBufC* freeMemText = NULL; + CAknGlobalNote* note = NULL; + TInt noteId = 0; + if ( aShowNote ) + { + + freeMemText = StringLoader::LoadL( R_NOTE_TEXT_FREE_MEMORY ); + CleanupStack::PushL( freeMemText ); + // show error note + note = CAknGlobalNote::NewL(); + CleanupStack::PushL( note ); + + note->SetTextProcessing( ETrue ); + note->SetPriority(CActive::EPriorityHigh); + noteId = note->ShowNoteL(EAknGlobalWaitNote, *freeMemText); + } + + User::LeaveIfError( iOomMonitor.Connect() ); + + errorCode = iOomMonitor.RequestFreeMemory( aRequestAmount ); + if ( errorCode != KErrNone ) + { + // try one more time + PRINT( _L("Camera <> CCamMemoryMonitor::CheckAndRequestMemoryL request returned with error, let's try one more time") ) + errorCode = iOomMonitor.RequestFreeMemory( aRequestAmount ); + } + iOomMonitor.Close(); + + + if ( aShowNote ) + { + note->CancelNoteL(noteId); + CleanupStack::PopAndDestroy( 2 ); // freeMemText & note + } + } + + PRINT1( _L("Camera <= CCamMemoryMonitor::CheckAndRequestMemoryL returning %d"), errorCode ) + return errorCode; + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::CheckAndRequestMemoryL +// --------------------------------------------------------------------------- +// +TInt CCamMemoryMonitor::CheckAndRequestMemoryL( TBool aShowNote ) + { + return CheckAndRequestMemoryL( KCriticalMemoryLevel, KNeededMemoryLevel, aShowNote ); + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::RunL +// --------------------------------------------------------------------------- +// +void CCamMemoryMonitor::RunL() + { + PRINT( _L("Camera => CCamMemoryMonitor::RunL") ) + iOomMonitor.Close(); + PRINT( _L("Camera <= CCamMemoryMonitor::RunL") ) + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::DoCancel +// --------------------------------------------------------------------------- +// +void CCamMemoryMonitor::DoCancel() + { + PRINT( _L("Camera => CCamMemoryMonitor::DoCancel") ) + if ( IsActive() ) + { + iOomMonitor.CancelRequestFreeMemory(); + iOomMonitor.Close(); + } + PRINT( _L("Camera <= CCamMemoryMonitor::DoCancel") ) + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::CCamMemoryMonitor +// --------------------------------------------------------------------------- +// +CCamMemoryMonitor::CCamMemoryMonitor(CCamAppUi* aAppUi, CCamAppController* aController) +: CActive( CActive::EPriorityIdle ), + iLimit( KCriticalMemoryLevel ), iRequestAmount( KNeededMemoryLevel ), + iAppUi( aAppUi ), iController( aController ) + + { + PRINT( _L("Camera => CCamMemoryMonitor::CCamMemoryMonitor") ) + CActiveScheduler::Add(this); + PRINT( _L("Camera <= CCamMemoryMonitor::CCamMemoryMonitor") ) + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::ConstructL +// --------------------------------------------------------------------------- +// +void CCamMemoryMonitor::ConstructL() + { + PRINT( _L("Camera => CCamMemoryMonitor::ConstructL") ) + iMemoryCheckTimer = CPeriodic::New( CActive::EPriorityIdle ); + PRINT( _L("Camera <= CCamMemoryMonitor::ConstructL") ) + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::MemoryCheck +// --------------------------------------------------------------------------- +// +TInt CCamMemoryMonitor::MemoryCheck( TAny* aPtr ) + { + + PRINT( _L("Camera => CCamMemoryMonitor::MemoryCheck") ) + CCamMemoryMonitor* self = static_cast( aPtr ); + + self->CheckMemory(); + + PRINT( _L("Camera <= CCamMemoryMonitor::MemoryCheck") ) + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CCamMemoryMonitor::CheckMemory +// --------------------------------------------------------------------------- +// +void CCamMemoryMonitor::CheckMemory() + { + PRINT( _L("Camera => CCamMemoryMonitor::CheckMemory") ) + if ( IsActive() ) + { + PRINT( _L("Camera <= CCamMemoryMonitor::CheckMemory already requesting memory") ) + return; + } + + if ( iAppUi->CurrentViewState() == ECamViewStatePreCapture && + iController->CurrentOperation() == ECamNoOperation && + !iAppUi->AppInBackground( EFalse ) ) + { + PRINT( _L("Camera <> CCamMemoryMonitor::CheckMemory checking memory") ) + TInt memoryLeft = 0; + HAL::Get( HALData::EMemoryRAMFree, memoryLeft ); + if ( memoryLeft < iLimit ) + { + TInt err = iOomMonitor.Connect(); + if ( !err ) + { + PRINT( _L("Camera <> CCamMemoryMonitor::CheckMemory requesting memory") ) + iOomMonitor.RequestFreeMemory( iRequestAmount, iStatus ); + SetActive(); + } + else + { + PRINT1( _L("Camera <> CCamMemoryMonitor::CheckMemory failed to connect to OoMMonitor err=%d"), err ) + } + } + else + { + PRINT( _L("Camera <> CCamMemoryMonitor::CheckMemory no need for memory request") ) + } + } + else + { + PRINT( _L("Camera <> CCamMemoryMonitor::CheckMemory not in correct state, not checking memory") ) + } + + PRINT( _L("Camera <= CCamMemoryMonitor::CheckMemory") ) + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamModeSetupPaneHandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamModeSetupPaneHandler.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,878 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of the mode setup pane handler class. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#include +#include +#include +#include "CamModeSetupPaneHandler.h" +#include "CamSetupPaneItemArray.h" +#include "CamSetupPane.h" +#include "CamSetupPaneItem.h" +#include "CamPreCaptureContainerBase.h" +#include "CamAppUi.h" +#include +#include + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::NewLC +// Part of the two-phase class construction. +// ----------------------------------------------------------------------------- +// +CCamModeSetupPaneHandler* CCamModeSetupPaneHandler::NewLC( CCamAppController& aController ) + { + CCamModeSetupPaneHandler* self = new( ELeave ) CCamModeSetupPaneHandler(aController); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::NewL +// Part of the two-phase class construction. +// ----------------------------------------------------------------------------- +// +CCamModeSetupPaneHandler* CCamModeSetupPaneHandler::NewL( CCamAppController& aController ) + { + CCamModeSetupPaneHandler* self = CCamModeSetupPaneHandler::NewLC( aController ); + CleanupStack::Pop(self); + return self; + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::CCamModeSetupPaneHandler +// C++ class constructor. +// ----------------------------------------------------------------------------- +// +CCamModeSetupPaneHandler::CCamModeSetupPaneHandler( CCamAppController& aController ) + : iController( aController ), + iPaneLevel( EMenuLevel ) + { + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::ConstructL +// Carries out two-phase class construction. +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::ConstructL() + { + // Setup helper context + iLastCaptureHelper = iController.LastCaptureHelper(); + iLastCaptureHelper->SetPaneModel( this ); // register + + iCurrentSettingsArrayIndex = KErrNotFound; // Invalidate. + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::~CCamModeSetupPaneHandler +// C++ destructor. +// ----------------------------------------------------------------------------- +// +CCamModeSetupPaneHandler::~CCamModeSetupPaneHandler() + { + PRINT( _L("Camera => ~CCamModeSetupPaneHandler") ); + ResetArray(); + + iPaneControl = NULL; // Not owned. + + if ( iLastCaptureHelper ) + { + iLastCaptureHelper->SetPaneModel( NULL ); // de-register + iLastCaptureHelper = NULL; // Not owned + } + + delete iLastCapTitle; + PRINT( _L("Camera <= ~CCamModeSetupPaneHandler") ); + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::ResetArray +// Deletes the contents of the settings item array +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::ResetArray() + { + TInt i; + for ( i = 0; i < iNoOfSettingsItems; i++ ) + { + delete iSettingItems[i]; + iSettingItems[i] = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::HandleEvent +// +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::HandleEvent( TEvent aEvent ) + { + switch ( aEvent ) + { + case EEventSelect: + { + // ASSERT(iPaneLevel == EItemLevel); // Should only get this event for item-level selections. + // Eventually need to handle commands from captureViewBase to open menu items. + // Let OK button open them for now... + if ( iPaneLevel == EItemLevel ) + { + HandlePaneItemLevelSelection(); + } + else + { + if ( iPaneLevel == EMenuLevel && + IconIsThumbnail( iHighlightedItemIndex ) ) + { + HandleLastCaptureSelection(); + } + else + { + HandlePaneMenuLevelSelection( iController.IntegerSettingValue( HighlightedItemId() ) ); + } + } + break; + } + case EEventCancel: + { + HandlePaneCancel(); + break; + } + case EEventLeft: + { + MoveToPreviousItem(); + break; + } + case EEventRight: + { + MoveToNextItem(); + break; + } + case EEventEditUser: + { + SwitchToUserSceneView(); + break; + } + default: + { + break; + } + + } + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::MoveToPreviousItem +// Changes the highlighted item to the previous one. +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::MoveToPreviousItem() + { + iPaneControl->ScrollToPreviousItem(); + iHighlightedItemIndex--; + if ( iHighlightedItemIndex < 0 ) + { + iHighlightedItemIndex = NumberOfItems() - 1; + } + HandlePaneItemChanged(); + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::MoveToNextItem +// Changes the highlighted item to the next one. +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::MoveToNextItem() + { + iPaneControl->ScrollToNextItem(); + iHighlightedItemIndex++; + if ( iHighlightedItemIndex >= NumberOfItems() ) + { + iHighlightedItemIndex = 0; + } + HandlePaneItemChanged(); + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::HighlightedItemId +// Returns the id of the currently highlighted item. +// ----------------------------------------------------------------------------- +// +TInt CCamModeSetupPaneHandler::HighlightedItemId() const + { + if ( iPaneLevel == EMenuLevel ) + { + return iMenuItemIds[iHighlightedItemIndex]; + } + else + { + ASSERT( iPaneLevel == EItemLevel ); + ASSERT( iCurrentSettingsArrayIndex != KErrNotFound ); + return iSettingItems[iCurrentSettingsArrayIndex]->At( HighlightedItemIndex() )->Id(); + } + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::NumberOfItems +// Returns the number of items in the current pane model. +// ----------------------------------------------------------------------------- +// +TInt CCamModeSetupPaneHandler::NumberOfItems() const + { + if ( iPaneLevel == EMenuLevel ) + { + TInt items = iNoOfSettingsItems; + // Check if there is a "last capture" dynamic item to add + if ( iLastCaptureHelper->IsThumbValid() ) + { + items ++; // +1 for dynamic 'last picture taken' item + } + return items; + } + else + { + ASSERT( iPaneLevel == EItemLevel ); + ASSERT( iCurrentSettingsArrayIndex != KErrNotFound ); + return iSettingItems[iCurrentSettingsArrayIndex]->Count(); + } + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::TitleText +// Returns the current pane title text (for the highlighted pane item). +// ----------------------------------------------------------------------------- +// +const TDesC& CCamModeSetupPaneHandler::TitleText() const + { + if ( iPaneLevel == EMenuLevel ) + { + return iMenuTitles[iHighlightedItemIndex]; + } + else + { + ASSERT( iPaneLevel == EItemLevel ); + ASSERT( iCurrentSettingsArrayIndex != KErrNotFound ); + return iMenuTitles[iCurrentSettingsArrayIndex]; + } + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::DescriptorText +// Returns the current pane descriptor text (for the highlighted pane item). +// ----------------------------------------------------------------------------- +// +const TDesC& CCamModeSetupPaneHandler::DescriptorText() const + { + if ( iPaneLevel == EMenuLevel ) + { + if ( iHighlightedItemIndex < iNoOfSettingsItems ) + { + const TInt settingVal = iController.IntegerSettingValue( HighlightedItemId() ); + const TInt index = iSettingItems[iHighlightedItemIndex]->ItemIndexFromItemId( settingVal ); + if ( index != KErrNotFound ) + { + return iSettingItems[iHighlightedItemIndex]->At( index )->Text(); + } + } + else + { + ASSERT( iHighlightedItemIndex == iNoOfSettingsItems ); + + // Return filename of last taken picture. + return iLastCapName; + } + } + else + { + ASSERT( iPaneLevel == EItemLevel ); + ASSERT( iCurrentSettingsArrayIndex != KErrNotFound ); + return iSettingItems[iCurrentSettingsArrayIndex]->At( iHighlightedItemIndex )->Text(); + } + + return KNullDesC; // All else failed. + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::Icon +// Returns the icon for the given pane item index. +// ----------------------------------------------------------------------------- +// +CGulIcon& CCamModeSetupPaneHandler::Icon( TInt aItemIndex ) + { + ASSERT( aItemIndex >= 0 && aItemIndex < NumberOfItems() ); + + if ( iPaneLevel == EMenuLevel ) + { + if ( aItemIndex < iNoOfSettingsItems ) + { + const TInt settingVal = iController.IntegerSettingValue( iMenuItemIds[aItemIndex] ); + const TInt index = iSettingItems[aItemIndex]->ItemIndexFromItemId( settingVal ); + if ( index != KErrNotFound ) + { + return iSettingItems[aItemIndex]->At( index )->Icon(); + } + } + } + else + { + ASSERT( iPaneLevel == EItemLevel ); + ASSERT( iCurrentSettingsArrayIndex != KErrNotFound ); + return iSettingItems[iCurrentSettingsArrayIndex]->At( aItemIndex )->Icon(); + } + + // Must return something. + return iSettingItems[aItemIndex]->At( 0 )->Icon(); + } + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::Thumbnail +// Get the thumbnail (of specified size) for last captured icon +// ----------------------------------------------------------------------------- +// +CGulIcon& CCamModeSetupPaneHandler::Thumbnail( TBool aSmall ) + { + return *iLastCaptureHelper->Thumbnail( aSmall ); + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::IconIsThumbnail +// Returns whether item indicated by aItemIndex is the last captured thumbnail +// ----------------------------------------------------------------------------- +// +TBool CCamModeSetupPaneHandler::IconIsThumbnail( TInt aItemIndex ) const + { + // Thumbnail is always the last item so check the specified index is the + // last item. Also check that the thumbnail is valid. + if ( aItemIndex == iNoOfSettingsItems && + iPaneLevel == EMenuLevel && + iLastCaptureHelper->IsThumbValid() ) + { + return ETrue; + } + else + { + return EFalse; + } + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::HighlightedItemIndex +// Returns the currently highlighted pane item. +// ----------------------------------------------------------------------------- +// +TInt CCamModeSetupPaneHandler::HighlightedItemIndex() const + { + return iHighlightedItemIndex; + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::HandlePaneItemChanged +// Handles a change of the currently highlighted pane item. +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::HandlePaneItemChanged() + { + if ( iPaneLevel == EItemLevel ) + { + HandlePaneItemLevelItemChanged(); + } + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::HandlePaneItemLevelItemChanged +// Handles a change of the current item at the 'item' level. +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::HandlePaneItemLevelItemChanged() + { + ASSERT( iPaneLevel == EItemLevel ); + ASSERT( iCurrentSettingsArrayIndex != KErrNotFound ); + + // Showing a Scene item requires the Options menu, and setting of the current highlighted item + if ( ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicPhotoScene ) || + ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicVideoScene ) + || ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemUserSceneBasedOnScene ) ) + { + CCamPreCaptureContainerBase* parent = static_cast( iParent ); + parent->SetCurrentSetupPaneItem( HighlightedItemId() ); + } + + else + { + // Set the controller to preview the new setting. + // This will either be comitted by a "Select" or reverted by a "Cancel" + TRAPD( ignore, iController.PreviewSettingChangeL( iMenuItemIds[iCurrentSettingsArrayIndex], HighlightedItemId() ); ) + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + } + + + + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::HandlePaneMenuLevelSelection +// Handles pane selections made at the 'menu' level. +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::HandlePaneMenuLevelSelection( TInt aValueToBeHighlighted ) + { + ASSERT( iPaneLevel == EMenuLevel ); + + if ( iHighlightedItemIndex < iNoOfSettingsItems ) + { + iCurrentSettingsArrayIndex = iHighlightedItemIndex; + iHighlightedItemIndex = iSettingItems[iCurrentSettingsArrayIndex]->ItemIndexFromItemId( aValueToBeHighlighted ); + iPaneLevel = EItemLevel; + iPaneControl->HandleModelChanged(); + + // Showing a Scene item requires the Options menu, and setting of the current highlighted item + if ( ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicPhotoScene ) || + ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicVideoScene ) || + ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemUserSceneBasedOnScene ) ) + { + CCamPreCaptureContainerBase* parent = static_cast( iParent ); + parent->SetUseSetupPaneOptions( ETrue ); + parent->SetCurrentSetupPaneItem( HighlightedItemId() ); + } + + // Check whether the viewfinder should be active but masked to + // preview some settings values + if ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicPhotoWhiteBalance || + iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicPhotoColourFilter || + iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicPhotoBrightness || + iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicPhotoContrast || + iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicVideoWhiteBalance || + iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicVideoColourFilter || + iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicVideoBrightness || + iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicVideoContrast || + iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemUserSceneWhitebalance || + iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemUserSceneColourFilter + + ) + { + CCamPreCaptureContainerBase* parent = static_cast( iParent ); + parent->SetViewFinderState( CCamPreCaptureContainerBase::EVfStateActiveMasked ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::HandleLastCaptureSelection +// Handles user selection of the "LastCapture" thumbnail where available +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::HandleLastCaptureSelection() + { + // Check we have a valid thumbnail + if ( IconIsThumbnail( iHighlightedItemIndex ) ) + { + // Need to fire off post capture view with the snapshot. + TRAPD( err, iLastCaptureHelper->ShowPostCaptureViewL() ); + if ( err == KErrNoMemory ) + { + TRAPD( ignore, static_cast( CEikonEnv::Static()->AppUi() )->ShowOOMNoteL() ); + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + } + } + } + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::ActivateMenuItem +// Activates a particular sub-menu. +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::ActivateMenuItem( TInt aItemId ) +{ + // Set the current item in the main menu to the item that is to be activated. + iHighlightedItemIndex = iNoOfSettingsItems; + TInt i; + for ( i = 0; i < iNoOfSettingsItems; ++i ) + { + if ( iMenuItemIds[i] == aItemId ) + { + iHighlightedItemIndex = i; + break; + } + } + ASSERT( iHighlightedItemIndex != iNoOfSettingsItems ); + + // If the user has just exited the User scene setup, and entered scene pane, + // ensure that the user scene is the highlighted scene. + if ( aItemId == ECamSettingItemDynamicPhotoScene ) + { + HandlePaneMenuLevelSelection( ECamSceneUser ); + } + // Otherwise, ensure that the current setting value is highlighted. + else + { + HandlePaneMenuLevelSelection( iController.IntegerSettingValue( HighlightedItemId() ) ); + } +} + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::HandlePaneItemLevelSelection +// Handles pane selections made at the 'item' level. +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::HandlePaneItemLevelSelection() + { + ASSERT( iPaneLevel == EItemLevel ); // Should only receive 'item' level IDs, not top level 'menu' IDs. + ASSERT( iCurrentSettingsArrayIndex != KErrNotFound ); + + // If current Item was a photo-scene item, the new (cancelled) state will not + // need the "options" menu or the current Item information, and the viewfinder + // can be activated. + if ( ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicPhotoScene ) || + ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicVideoScene ) ) + + { + TRAPD( ignore, iController.SetIntegerSettingValueL( iMenuItemIds[iCurrentSettingsArrayIndex], HighlightedItemId() ); ) + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + CCamPreCaptureContainerBase* parent = static_cast( iParent ); + parent->SetUseSetupPaneOptions( EFalse ); + parent->SetCurrentSetupPaneItem( KErrNotFound ); // Invalidate + parent->SetViewFinderState( CCamPreCaptureContainerBase::EVfStateActive ); // Ensure reverted viewfinder + } + // else if current item is user scene base on scene item, the new (cancelled) state will not + // need the "options" menu or the current Item information. + else if ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemUserSceneBasedOnScene ) + { + TRAPD( ignore, iController.SetIntegerSettingValueL( iMenuItemIds[iCurrentSettingsArrayIndex], HighlightedItemId() ); ) + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + CCamPreCaptureContainerBase* parent = static_cast( iParent ); + parent->SetUseSetupPaneOptions( EFalse ); + parent->SetCurrentSetupPaneItem( KErrNotFound ); // Invalidate + } + else + { + // User has selected the highlighted item, so tell controller to commit this setting + iController.CommitPreviewChanges(); + } + + iHighlightedItemIndex = iCurrentSettingsArrayIndex; + iCurrentSettingsArrayIndex = KErrNotFound; // Invalidate. + + // If in user scene mode revert back to the user scene setup list. + if ( iUserSceneSetupMode ) + { + SwitchToUserSceneView(); + } + + // else revert back to menu level, and remove focus from setup pane. + else + { + iPaneLevel = EMenuLevel; + iPaneControl->HandleModelChanged(); + + // Select-key focus goes back to viewfinder + CCamPreCaptureContainerBase* parent = static_cast( iParent ); + parent->FocusToSetupPane( EFalse ); + } + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::SwitchToUserSceneView +// Switches view to the user scene view. +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::SwitchToUserSceneView() + { + CCamAppUiBase* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + TRAPD( ignore, appUi->HandleCommandL( ECamCmdUserScene ) ) + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::HandlePaneCancel +// Handles the user Cancelling from the setup pane. Will revert to last selected +// menu level and force a redraw +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::HandlePaneCancel() + { + if ( iPaneLevel == EItemLevel ) + { + ASSERT( iCurrentSettingsArrayIndex != KErrNotFound ); + // If current Item was a photo-scene item, the new (cancelled) state will not + // need the "options" menu or the current Item information, and the viewfinder + // can be activated. + if ( ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicPhotoScene ) || + ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemDynamicVideoScene ) ) + { + CCamPreCaptureContainerBase* parent = static_cast( iParent ); + parent->SetUseSetupPaneOptions( EFalse ); + parent->SetCurrentSetupPaneItem( KErrNotFound ); // Invalidate + parent->SetViewFinderState( CCamPreCaptureContainerBase::EVfStateActive ); // Ensure reverted viewfinder + } + + // else if current item is user scene base on scene item, the new (cancelled) state will not + // need the "options" menu or the current Item information. + else if ( iMenuItemIds[iCurrentSettingsArrayIndex] == ECamSettingItemUserSceneBasedOnScene ) + { + CCamPreCaptureContainerBase* parent = static_cast( iParent ); + parent->SetUseSetupPaneOptions( EFalse ); + parent->SetCurrentSetupPaneItem( KErrNotFound ); // Invalidate + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error. + } + + iHighlightedItemIndex = iCurrentSettingsArrayIndex; + iCurrentSettingsArrayIndex = KErrNotFound; // Invalidate. + + // User has cancelled the highlighted item, so tell controller to cancel this change + TRAPD( ignore, iController.CancelPreviewChangesL() ); + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + } + + // If in user scene mode revert back to the user scene setup list. + if ( iUserSceneSetupMode ) + { + SwitchToUserSceneView(); + } + + // else revert back to menu level, and remove focus from setup pane. + else + { + iPaneLevel = EMenuLevel; + iPaneControl->HandleModelChanged(); + + // Select-key focus goes back to viewfinder + CCamPreCaptureContainerBase* parent = static_cast( iParent ); + parent->FocusToSetupPane( EFalse ); + } + } + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::CreatePaneControlL +// Creates and returns a pointer to a new pane control. Used by the control container. +// Keeps a pointer to the pane control, but gives ownership to caller. +// ----------------------------------------------------------------------------- +// +CCoeControl* CCamModeSetupPaneHandler::CreatePaneControlL( CCoeControl* aParent, const TRect& aRect ) + { + iPaneControl = CCamSetupPane::NewL( *aParent, aRect, *this, *this ); + iParent = aParent; + return iPaneControl; + } + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::UpdateFromResourceL +// Updates the contents of the setup pane based on the supplied resource +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::UpdateFromResourceL( TInt aResource ) + { + TResourceReader reader; + + ResetArray(); + + CCoeEnv::Static()->CreateResourceReaderLC( reader, aResource ); + + const TInt menuItemCount = reader.ReadInt16(); + + TInt i; + for ( i = 0 ; i < menuItemCount ; i++ ) + { + iMenuItemIds[i] = reader.ReadInt16(); + iMenuTitles[i] = reader.ReadTPtrC().Left( KMaxTitleCharLength ); + TInt itemsId = reader.ReadInt32(); + iSettingItems[i] = new( ELeave ) CCamSetupPaneItemArray( KItemArrayGranularity ); + iSettingItems[i]->ConstructFromResourceL( itemsId ); + ASSERT( iSettingItems[i]->Count() > 0 ); + } + + iNoOfSettingsItems = menuItemCount; + + CleanupStack::PopAndDestroy(); // reader + + if ( iLastCapTitle ) + { + iMenuItemIds[i] = 0; + iMenuTitles[i] = iLastCapTitle->Des(); + } + + iCurrentSettingsArrayIndex = KErrNotFound; // Invalidate. + + // Given mode change, set highlight back to start of items list + iHighlightedItemIndex = 0; + iPaneControl->HandleModelChanged(); + } + + + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::Refresh +// Forces a refresh of the SetupPane control +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::Refresh() + { + TParse parse; + parse.Set( iLastCaptureHelper->FileName(), NULL, NULL ); + iLastCapName = parse.Name(); + + // Only refresh the control if we are in the foreground + if ( iForeground ) + { + iPaneControl->DrawNow(); + } + } + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::SetForeground +// Sets whether SetupPane is in foreground or background +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::SetForeground( TBool aForeground ) + { + iForeground = aForeground; + } + +// ----------------------------------------------------------------------------- +// CCamModeSetupPaneHandler::SetMenuContextL +// Used to change the contents of the Setup Pane depending on which camera and +// mode is to be used. +// ----------------------------------------------------------------------------- +// +void CCamModeSetupPaneHandler::SetMenuContextL( TBool aFirstCamera, TBool aPhoto, TBool aUserSceneSetup ) + { + TInt resource = KErrNotFound; + iPhotoMode = aPhoto; + + // Identify which resource to use + + // ...User scene setup mode + if ( aUserSceneSetup ) + { + resource = ROID(R_CAM_USER_SCENE_SETUP_PANE_MENU_ITEM_ARRAY_ID); + iUserSceneSetupMode = ETrue; + } + // ...Non-user scene setup mode. + else + { + iUserSceneSetupMode = EFalse; + + if ( aFirstCamera ) + { + if ( aPhoto ) + { + resource = ROID(R_CAM_IMAGE_MODE_SETUP_PANE_MENU_ITEM_ARRAY_ID); + } + else + { + resource = ROID(R_CAM_VIDEO_MODE_SETUP_PANE_MENU_ITEM_ARRAY_ID); + } + } + else + { + if ( aPhoto ) + { + resource = ROID(R_CAM_SECONDARY_IMAGE_MODE_SETUP_PANE_MENU_ITEM_ARRAY_ID); + } + else + { + resource = ROID(R_CAM_SECONDARY_VIDEO_MODE_SETUP_PANE_MENU_ITEM_ARRAY_ID); + } + } + } + + iLastCaptureHelper->SetPhotoMode( aPhoto ); + + // Load the string for the last captured item title + if ( iLastCapTitle ) + { + delete iLastCapTitle; + iLastCapTitle = NULL; + } + TInt lastCapRes = 0; + if ( aPhoto ) + { + lastCapRes = ROID(R_CAM_SETUP_LASTCAP_PHOTO_TITLE_ID); + } + else + { + lastCapRes = ROID(R_CAM_SETUP_LASTCAP_VIDEO_TITLE_ID); + } + iLastCapTitle = StringLoader::LoadLC( lastCapRes ); + CleanupStack::Pop( iLastCapTitle ); + + TParse parse; + parse.Set( iLastCaptureHelper->FileName(), NULL, NULL ); + iLastCapName = parse.Name(); + + + // Make the change + if ( resource != KErrNotFound ) + { + UpdateFromResourceL( resource ); + } + } + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamNaviCounterControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamNaviCounterControl.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Control for displaying remaining images/videos in Navi Pane +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +// INCLUDE FILES +#include +#include +#include "CamNaviCounterControl.h" +#include "CamNaviCounterModel.h" +#include "CamAppUi.h" +#include "CamUtility.h" + +// CONSTANTS + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------- +// CCamNaviCounterControl::NewL +// Factory construction function +// --------------------------------------------------------- +// +CCamNaviCounterControl* CCamNaviCounterControl::NewL( CCamNaviCounterModel& aModel ) + { + CCamNaviCounterControl* self = new( ELeave ) CCamNaviCounterControl( aModel ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// Destructor +CCamNaviCounterControl::~CCamNaviCounterControl() + { + iModel.DeregisterObserver( this ); + } + +// --------------------------------------------------------- +// CCamNaviCounterControl::CCamNaviCounterControl +// C++ constructor +// --------------------------------------------------------- +// +CCamNaviCounterControl::CCamNaviCounterControl(CCamNaviCounterModel& aModel ) + : iModel ( aModel ) + { + } + +// --------------------------------------------------------- +// CCamNaviCounterControl::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamNaviCounterControl::ConstructL() + { + iModel.RegisterObserverL( this ); + } + +// --------------------------------------------------------- +// CCamNaviCounterControl::SizeChanged +// Called by framework when the view size is changed +// --------------------------------------------------------- +// +void CCamNaviCounterControl::SizeChanged() + { + // if the rectangle has width or height + if ( Rect().Size() != TSize( 0, 0 ) && iActive ) + { + TRAP_IGNORE(iModel.SetExtentL( Rect() )); + TRAP_IGNORE(iModel.ReloadResourceDataL()); + } + +// AknsUtils::RegisterControlPosition( this ); + } + +// --------------------------------------------------------- +// CCamNaviCounterControl::DrawNaviCtr +// Draw the control +// --------------------------------------------------------- +// +void CCamNaviCounterControl::DrawNaviCtr( CBitmapContext& aGc ) const + { + if ( iActive ) + { + iModel.DrawNaviCtr( aGc, this ); + } + } + +// --------------------------------------------------------- +// CCamNaviCounterControl::Draw +// Draw the control +// --------------------------------------------------------- +// +void CCamNaviCounterControl::Draw( const TRect& /* aRect */ ) const + { + PRINT( _L("Camera => CCamNaviCounterControl::Draw" )) + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi->CurrentViewState() != ECamViewStatePostCapture ) + { + CWindowGc& gc=SystemGc(); + DrawNaviCtr( gc ); + } + + PRINT( _L("Camera <= CCamNaviCounterControl::Draw" )) + } + +// --------------------------------------------------------- +// CCamNaviCounterControl::ForceNaviPaneUpdate +// Force update of navi-pane (i.e after dismissal of MMC removed error note) +// --------------------------------------------------------- +// +void CCamNaviCounterControl::ForceNaviPaneUpdate() + { + iModel.ForceNaviPaneUpdate(); + + // redraw + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + if ( appUi && appUi->IsDirectViewfinderActive() ) + { + TRAP_IGNORE(appUi->HandleCommandL( ECamCmdRedrawScreen )); + } + else + { + DrawDeferred(); + } + } + +// --------------------------------------------------------- +// CCamNaviCounterControl::SetActiveL +// Set's whether this control is currently active or not +// --------------------------------------------------------- +// +void CCamNaviCounterControl::SetActiveL( TBool aActive ) + { + iActive = aActive; + if ( iActive ) + { + ActivateL(); + iModel.SetExtentL( Rect() ); + } + } + +// --------------------------------------------------------- +// CCamNaviCounterControl::HandleObservedEvent +// Gets events from observed model +// --------------------------------------------------------- +// +void CCamNaviCounterControl::HandleObservedEvent(TCamObserverEvent aEvent) + { + PRINT( _L("Camera => CCamNaviCounterControl::HandleObservedEvent" )); + if ( ECamObserverEventNaviModelUpdated == aEvent ) + { + if ( iActive ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi && appUi->IsDirectViewfinderActive() ) + { + TRAP_IGNORE(appUi->HandleCommandL( ECamCmdRedrawScreen )); + } + else + { +#ifndef __WINS__ + if( appUi && appUi->ReadyToDraw() && appUi->IsBurstEnabled() + && !appUi->SettingsLaunchedFromCamera() ) + { + PRINT( _L("Camera <> CCamNaviCounterControl::HandleObservedEvent - draw deferred") ); + DrawDeferred(); + } + +#endif + } + } + } + PRINT( _L("Camera <= CCamNaviCounterControl::HandleObservedEvent" )); + } + +// End of File + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamNaviCounterModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamNaviCounterModel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,2077 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Control for displaying remaining images/videos in Navi Pane +* +* Copyright © 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +// INCLUDE FILES +#include +#include // For CEikApplication +#include +#include +#include +#include +#include // StringLoader +#include +#include // TResourceReader +#include +#include +#include +#include +#include +#include +#include + +#include "CamNaviCounterModel.h" +#include "CamAppUi.h" +#include "CamUtility.h" +#include "CamSelfTimer.h" + +#include +#include + +#include "CamLogger.h" +#include "CamDecorator.h" +#include "camtextitem.h" +#include "CameraUiConfigManager.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamNaviCounterModelTraces.h" +#endif + + +// CONSTANTS +const TInt KMaxRemainingImagesShown = 9999; +const TInt KCamDefaultCapturedImagesTextLen = 30; +_LIT( KNumberFormat, "%04d" ); +_LIT( KTimeLapseImageFormat, "%04d/%04d" ); + +const TAknsItemID KNaviPaneMajorColour = KAknsIIDQsnComponentColors; +const TInt KNaviPaneMinorColour = EAknsCIQsnComponentColorsCG2; + +// Sequence mode related constants that define the amount of pictures taken +// with sequence mode. +const TInt KShortBurstCount = 18; // number of images captured during burst + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------- +// CCamNaviCounterModel::NewL +// Factory construction function +// --------------------------------------------------------- +// +CCamNaviCounterModel* +CCamNaviCounterModel::NewL( CCamAppController& aController ) + { + CCamNaviCounterModel* self = + new( ELeave ) CCamNaviCounterModel( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// Destructor +CCamNaviCounterModel::~CCamNaviCounterModel() + { + iController.RemoveControllerObserver( this ); + + delete iVideoTextItem; + delete iPhotoTextItem; + + delete iSequenceImageTextItem; + delete iSequenceCapturedTextItem; + delete iTimeLapseCountdownTextItem; + + CCamNaviCounterModel::UnloadResourceData(); + + delete iMpeg4Icon; + delete iMpeg4IconMask; + delete i3GPIcon; + delete i3GPIconMask; + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi()); + if ( appUi ) + { + if ( !iController.IsInShutdownMode() ) + { + appUi->RemoveBurstModeObserver( this ); + } + delete iSequenceIcon; + delete iSequenceMask; + } + + delete iSelfTimerIcon; + delete iSelfTimerMask; + + // If not shutting down, deregister from SelfTimer observers. + // If we try to deregister when shutting down, the object has already been + // deleted + if ( !iController.IsInShutdownMode() && appUi ) + { + // ...Remove self as an observer of the self timer. + CCamSelfTimer* selftimer = appUi->SelfTimer(); + if ( selftimer ) + { + selftimer->RemoveObserver( this ); + } + } + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + delete iGenericIcon; + delete iGenericMask; +#endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + + delete iAudioMuteIcon; + delete iAudioMuteMask; + + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + delete iSubtitlePhotoIcon; + delete iSubtitlePhotoMask; + delete iSubtitleVideoIcon; + delete iSubtitleVideoMask; +#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + + delete iTimeFormat; + delete iCountDownText; + delete iObserverHandler; + } + +// ----------------------------------------------------------------------------- +// CCamNaviCounterModel::LoadResourceDataL() +// Reads in all information needed from resources +// ----------------------------------------------------------------------------- +// +void CCamNaviCounterModel::LoadResourceDataL() + { +OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMNAVICOUNTERMODEL_LOADRESOURCEDATAL, "e_CCamNaviCounterModel_LoadResourceDataL 1" ); + + PRINT( _L("Camera => CCamNaviCounterModel::LoadResourceDataL") ); + + // Read the time format resource + PRINT( _L("Camera <> construct timeformat..") ); + delete iTimeFormat; + iTimeFormat = NULL; + if ( !Layout_Meta_Data::IsLandscapeOrientation() ) + { + iTimeFormat = CEikonEnv::Static()->AllocReadResourceL( R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO ); + } + else + { + iTimeFormat = CEikonEnv::Static()->AllocReadResourceL( R_QTN_TIME_DURAT_LONG ); + } + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + delete iPhotoTextItem; + iPhotoTextItem = NULL; + iPhotoTextItem = CCamTextItem::NewL(); + + delete iVideoTextItem; + iVideoTextItem = NULL; + iVideoTextItem = CCamTextItem::NewL(); + + delete iSequenceImageTextItem; + iSequenceImageTextItem = NULL; + iSequenceImageTextItem = CCamTextItem::NewL(); + + delete iTimeLapseCountdownTextItem; + iTimeLapseCountdownTextItem = NULL; + iTimeLapseCountdownTextItem = CCamTextItem::NewL(); + + delete iSequenceCapturedTextItem; + iSequenceCapturedTextItem = NULL; + iSequenceCapturedTextItem = CCamTextItem::NewL(); + + iCamOrientation = appUi->CamOrientation(); + + if ( Layout_Meta_Data::IsLandscapeOrientation() || CamUtility::IsNhdDevice() ) + { + TSize screenSize; + AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, screenSize ); + iExtent = TRect( TPoint(), screenSize ); + } + else + { + TRect screenRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); + iExtent = screenRect; + } + + if ( CamUtility::IsNhdDevice() ) + { + TouchLayoutL(); + } + else + { + if ( !Layout_Meta_Data::IsLandscapeOrientation() ) + { + NonTouchLayoutSecondaryL(); + } + else + { + NonTouchLayoutL(); + } + } + + iVidPostStorageIconRect = iVidPreStorageIconRect; + + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + iLocationIconVisible = (/*TCamLocationId::ECamLocationOn*/1 == iController.IntegerSettingValue( ECamSettingItemRecLocation )); + // If location setting is on, then the decoration should be wider to fit the location icon + if ( iLocationIconVisible ) + { + iPhotoPrecapDecorator = CCamDecorator::NewL( iController, R_CAM_STILL_PRECAP_NAVICOUNTER_DECORATIONS_CAMCORDER_LOCATION ); + } + else + { + iPhotoPrecapDecorator = CCamDecorator::NewL( iController, R_CAM_STILL_PRECAP_NAVICOUNTER_DECORATIONS_CAMCORDER ); + } + } + else + { + iPhotoPrecapDecorator = CCamDecorator::NewL( iController, R_CAM_STILL_PRECAP_NAVICOUNTER_DECORATIONS_CAMCORDER ); + } + + iVideoPrecapDecorator = CCamDecorator::NewL( iController, R_CAM_VIDEO_PRECAP_NAVICOUNTER_DECORATIONS_CAMCORDER ); + + iPhotoPostcapDecorator = CCamDecorator::NewL( iController, R_CAM_STILL_POSTCAP_NAVICOUNTER_DECORATIONS_CAMCORDER ); + iVideoPostcapDecorator = CCamDecorator::NewL( iController, R_CAM_VIDEO_POSTCAP_NAVICOUNTER_DECORATIONS_CAMCORDER ); + + iSequenceInCaptureDecorator = CCamDecorator::NewL( iController, R_CAM_TIMELAPSE_IN_CAPTURE_NAVICOUNTER_DECORATIONS ); + iTimeLapsePostCaptureDecorator = CCamDecorator::NewL( iController, R_CAM_TIMELAPSE_POST_CAPTURE_NAVICOUNTER_DECORATIONS ); + + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + + // Create component bitmaps + TSize size = iVidPostStorageIconRect.Rect().Size(); + TCamOrientation orientation = appUi->CamOrientation(); + + AknIconUtils::CreateIconL( iPhoneIcon, + iPhoneIconMask, + resname, + EMbmCameraappQgn_indi_cam4_memory_phone, + EMbmCameraappQgn_indi_cam4_memory_phone_mask ); + + AknIconUtils::SetSize( iPhoneIcon, size ); + + AknIconUtils::CreateIconL( iMMCIcon, + iMMCIconMask, + resname, + EMbmCameraappQgn_indi_cam4_memory_mmc, + EMbmCameraappQgn_indi_cam4_memory_mmc_mask ); + + AknIconUtils::SetSize( iMMCIcon, size ); + + if ( orientation != ECamOrientationCamcorder && orientation != ECamOrientationCamcorderLeft ) + { + AknIconUtils::CreateIconL( iMassStorageIcon, + iMassStorageIconMask, + resname, + EMbmCameraappQgn_indi_cam4_memory_mass, + EMbmCameraappQgn_indi_cam4_memory_mass_mask ); + } + else + { + AknIconUtils::CreateIconL( iMassStorageIcon, + iMassStorageIconMask, + resname, + EMbmCameraappQgn_indi_cam4_memory_mass, + EMbmCameraappQgn_indi_cam4_memory_mass_mask ); + } + + AknIconUtils::SetSize( iMassStorageIcon, size ); + PRINT( _L("Camera <= CCamNaviCounterModel::LoadResourceDataL") ); +OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMNAVICOUNTERMODEL_LOADRESOURCEDATAL, "e_CCamNaviCounterModel_LoadResourceDataL 0" ); + + } + +// ----------------------------------------------------------------------------- +// CCamNaviCounterModel::UnloadResourceData() +// Frees all dynamic resources allocated in LoadResourceDataL +// ----------------------------------------------------------------------------- +// +void CCamNaviCounterModel::UnloadResourceData() + { +#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + delete iSubtitleVideoText; + iSubtitleVideoText = NULL; + delete iSubtitlePhotoText; + iSubtitlePhotoText = NULL; +#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + + delete iPhotoPrecapDecorator; + iPhotoPrecapDecorator = NULL; + delete iVideoPrecapDecorator; + iVideoPrecapDecorator = NULL; + delete iPhotoPostcapDecorator; + iPhotoPostcapDecorator = NULL; + delete iVideoPostcapDecorator; + iVideoPostcapDecorator = NULL; + delete iSequenceInCaptureDecorator; + iSequenceInCaptureDecorator = NULL; + delete iTimeLapsePostCaptureDecorator; + iTimeLapsePostCaptureDecorator = NULL; + + delete iPhoneIcon; + iPhoneIcon = NULL; + delete iPhoneIconMask; + iPhoneIconMask = NULL; + delete iMMCIcon; + iMMCIcon = NULL; + delete iMMCIconMask; + iMMCIconMask = NULL; + delete iMassStorageIcon; + iMassStorageIcon = NULL; + delete iMassStorageIconMask; + iMassStorageIconMask = NULL; + } + +// ----------------------------------------------------------------------------- +// CCamNaviCounterModel::ReloadResourceDataL() +// Refreshes all resource-based information stored in the class +// ----------------------------------------------------------------------------- +// +void CCamNaviCounterModel::ReloadResourceDataL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMNAVICOUNTERMODEL_RELOADRESOURCEDATAL, "e_CCamNaviCounterModel_ReloadResourceDataL 1" ); + UnloadResourceData(); + LoadResourceDataL(); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMNAVICOUNTERMODEL_RELOADRESOURCEDATAL, "e_CCamNaviCounterModel_ReloadResourceDataL 0" ); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::UpdateCounter +// Update counter +// --------------------------------------------------------- +// +void CCamNaviCounterModel::UpdateCounter() + { + PRINT( _L("Camera => CCamNaviCounterModel::UpdateCounter") ); + + const TInt imagesLeft = Min( + iController.ImagesRemaining( ECamMediaStorageCurrent, iBurstActive ), + KMaxRemainingImagesShown ); + iCounterText.Format( KNumberFormat, imagesLeft ); + + if ( iPhotoTextItem ) + { + TRAP_IGNORE( iPhotoTextItem->SetTextL( iCounterText ) ); + } + + PRINT( _L("Camera <= CCamNaviCounterModel::UpdateCounter") ); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::UpdateTimeLapseCountdownL +// Update the counter for remaining time until the next capture +// --------------------------------------------------------- +// +void CCamNaviCounterModel::UpdateTimeLapseCountdownL() + { + // Get the actual remaining time till next capture + TTime time ( iController.TimeLapseCountdown().Int64() ); + // The format function always rounds down to the next whole number of seconds + // so add on 0.5 secs to force round up if closer to the next higher whole number of seconds + // This gives a countdown from max to 1, to get a countdown from max-1 to 0 remove this + const TTimeIntervalMicroSeconds KHalfSecInMicroSecs = TInt64( 500000 ); + time += KHalfSecInMicroSecs; + + TBuf<15> timebuf; + // use 00:00 format as normal in secondary cam + // but long format for primary cam. 2nd cam uses sharing quality. With primary cam sharing + // we just use the same layout for sharing and other qualities. + HBufC* timeFormat; + if ( ECamActiveCameraSecondary == iController.ActiveCamera() ) + { + timeFormat = CEikonEnv::Static()->AllocReadResourceLC( R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO ); + } + else + { + timeFormat = CEikonEnv::Static()->AllocReadResourceLC( R_QTN_TIME_DURAT_LONG ); + } + time.FormatL( timebuf, *timeFormat ); + CleanupStack::PopAndDestroy( timeFormat ); + + delete iCountDownText; + iCountDownText = NULL; + iCountDownText = StringLoader::LoadL( R_CAM_TIMELAPSE_COUNTDOWN_TIME, timebuf ); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::UpdateSequenceImageCount +// Update the counter of captured and remaining images for +// timelapse and burst during capture +// --------------------------------------------------------- +// +void CCamNaviCounterModel::UpdateSequenceImageCount() + { + PRINT( _L("Camera => CCamNaviCounterModel::UpdateSequenceImageCount" ) ) + TInt imagesLeft = iController.ImagesRemaining( ECamMediaStorageCurrent, iBurstActive ); + TInt showLeft = Min( imagesLeft, KMaxRemainingImagesShown ); + TInt showCaptured = 0; + + if ( ECamImageCaptureTimeLapse == iImageMode ) + { + // Use the count of captured images + showCaptured = iController.TimeLapseImageCount(); + } + else if ( ECamImageCaptureBurst == iImageMode ) + { + // Use the count of burst capture moments + showCaptured = iController.CurrentCapturedCount(); + // The images have not been saved yet so the remaining count does not account + // for the ones already captured. Reduce the remaining count by the captured count. + // Commented out - The burst images are saved immediately after capturing. + // However, we cannot know if all the previous images have already been saved + // so this number is not 100% accurate. + // showLeft -= showCaptured; + if( ( iOriginalValueForEachBurst > 0 ) && ( iCounterNeedUpdate ) ) + { + iOriginalValueForEachBurst--; + } + if( ( iController.SequenceCaptureInProgress() ) ) + { + if( !iController.IsRemainingImageStored() ) + { + iOriginalValueForEachBurst = showLeft; + iController.SetRemainingImageStored(); + } + iCounterText.Format( KNumberFormat, iOriginalValueForEachBurst ); + } + else + iCounterText.Format( KNumberFormat, iController.ImagesRemaining( ECamMediaStorageCurrent, iBurstActive ) ); + showLeft = iOriginalValueForEachBurst; + } + else + { + // no action + } + + // show only the KShortBurstCount value if there is enough space to take all + // pictures, otherwise display the number of images that can be shown + TInt showSequenceMax = Min( showLeft, KShortBurstCount ); + iSequenceImageText.Format( KTimeLapseImageFormat, showCaptured, showSequenceMax ); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::UpdateRecordTimeAvailableL +// Update record time remaining +// --------------------------------------------------------- +// +void CCamNaviCounterModel::UpdateRecordTimeAvailableL() + { + PRINT( _L("Camera => CCamNaviCounterModel::UpdateRecordTimeAvailableL" ) ) + // Get the total remaining record time from the controller + TTime time ( iController.RecordTimeRemaining().Int64() ); + HBufC* timeFormat; + + // Use 00:00 format in secondary cam + if ( ECamActiveCameraSecondary == iController.ActiveCamera() ) + { + timeFormat = CEikonEnv::Static()->AllocReadResourceLC( R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO ); + } + // Use 0:00:00 format in primary cam + else + { + timeFormat = CEikonEnv::Static()->AllocReadResourceLC( R_QTN_TIME_DURAT_LONG ); + } + + time.FormatL( iRemainingTimeText, *timeFormat ); + if ( iVideoTextItem ) + { + iVideoTextItem->SetTextL( iRemainingTimeText ); + } + CleanupStack::PopAndDestroy( timeFormat ); + PRINT( _L("Camera <= CCamNaviCounterModel::UpdateRecordTimeAvailableL" ) ) + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::SetCaptureModeL +// Set capture mode (defines which counter to use) +// --------------------------------------------------------- +// +void +CCamNaviCounterModel::SetCaptureModeL( TCamCameraMode aMode, + TCamImageCaptureMode aImageMode ) + { + iMode = aMode; + iImageMode = aImageMode; + + TInt key = ( ECamControllerVideo == iMode ) + ? ECamSettingItemVideoMediaStorage + : ECamSettingItemPhotoMediaStorage; + + // Get the total remaining record time from the controller + iStorageLocation = + static_cast( iController.IntegerSettingValue( key ) ); + + if (ECamMediaStorageMassStorage ==iStorageLocation) + { + iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:ECamMediaStoragePhone; + } + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::HandleSelfTimerEvent +// Handle an event from CCamSelfTimer. +// --------------------------------------------------------- +// +void CCamNaviCounterModel::HandleSelfTimerEvent( TCamSelfTimerEvent aEvent, TInt aCountDown ) + { + switch ( aEvent ) + { + case ECamSelfTimerEventTimerOn: + { + iSelfTimerText.Num( TInt64( aCountDown ) ); + iDrawSelfTimer = ETrue; + } + break; + case ECamSelfTimerEventTimerOff: + { + iDrawSelfTimer = EFalse; + } + break; + default: + break; + } + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::CCamNaviCounterModel +// C++ constructor +// --------------------------------------------------------- +// +CCamNaviCounterModel::CCamNaviCounterModel( CCamAppController& aController ) + : iController( aController ) + { + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamNaviCounterModel::ConstructL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMNAVICOUNTERMODEL_CONSTRUCTL, "e_CCamNaviCounterModel_ConstructL 1" ); + PRINT( _L("Camera => CCamNaviCounterModel::ConstructL") ); + iExtent = TRect(0, 0, 0, 0); + + UpdateCounter(); + iController.AddControllerObserverL( this ); + + PRINT( _L("Camera <> Load resource data..") ); + + LoadResourceDataL(); + + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + +#ifdef PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS + AknIconUtils::CreateIconL( iMpeg4Icon, + iMpeg4IconMask, + resname, + EMbmCameraappQgn_prop_cam4_codec_mp4, + EMbmCameraappQgn_prop_cam4_codec_mp4_mask ); + + AknIconUtils::CreateIconL( i3GPIcon, + i3GPIconMask, + resname, + EMbmCameraappQgn_prop_cam4_codec_3gp, + EMbmCameraappQgn_prop_cam4_codec_3gp_mask ); +#endif + + // wait for engine to initialise video recorder + iVideoInitialised = EFalse; + + PRINT( _L("Camera <> construct navi self timer..") ); + ConstructNaviSelfTimerL( resname ); + + + PRINT( _L("Camera <> construct navi sequence..") ); + ConstructNaviSequenceL( resname ); + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + PRINT( _L("Camera <> construct generic setup..") ); + ConstructNaviGenericSetupL( resname ); +#endif + + PRINT( _L("Camera <> construct navi audio mute..") ); + ConstructNaviAudioMuteL( resname ); + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + PRINT( _L("Camera <> construct navi subtitle..") ); + ConstructNaviModeSubtitleL( resname ); +#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + iBurstActive = appUi->IsBurstEnabled(); +#if defined( PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE ) + iDrawSequence = iBurstActive; +#endif // PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + + PRINT( _L("Camera <> construct observer handler..") ); + iObserverHandler = CCamObserverHandler::NewL(); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + iLocationIconVisible = (/*TCamLocationId::ECamLocationOn*/1 == iController.IntegerSettingValue( ECamSettingItemRecLocation )); + } + PRINT( _L("Camera <= CCamNaviCounterModel::ConstructL") ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMNAVICOUNTERMODEL_CONSTRUCTL, "e_CCamNaviCounterModel_ConstructL 0" ); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::Draw +// Draw the control +// --------------------------------------------------------- +// +void +CCamNaviCounterModel::DrawNaviCtr( CBitmapContext& aGc, + const CCoeControl* aControl ) const + { + DrawCounter( aGc, aControl ); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawCounter +// Draw the control +// --------------------------------------------------------- +// +void +CCamNaviCounterModel::DrawCounter( CBitmapContext& aGc, + const CCoeControl* /*aControl*/ ) const + { + PRINT_FRQ( _L("Camera => CCamNaviCounterModel::DrawCounter" )) + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + const TCamViewState& viewState( appUi->CurrentViewState() ); + + + // ------------------------------------------------------- + // Precapture state + if ( ECamViewStatePreCapture == viewState ) + { + TBool inSequence = iController.SequenceCaptureInProgress(); + TBool inTimeLapse = inSequence && (ECamImageCaptureTimeLapse == iImageMode); + TBool inBurst = inSequence && (ECamImageCaptureBurst == iImageMode); + + TBool stillCapturing = ECamImageCaptureSingle == iImageMode + && iController.IsProcessingCapture(); + + + // Audio mute icon should be drawn even though courtesy UI applies. + if ( iMode == ECamControllerVideo ) + { + DrawNaviAudioMute( aGc ); + } + // these are drawn when sequence capture is in progress and + // should be drawn even when courtesy stuff is off + if ( inTimeLapse || inBurst ) + { + iSequenceInCaptureDecorator->Draw( aGc, iExtent ); + } + else + { + // To prevent Lint warning + } + // Draw the navipane sequence icon if current performing a timelapse or burst capture + if ( inTimeLapse || inBurst ) + { + DrawNaviSequence( aGc ); + } + if ( inTimeLapse && iController.TimeLapseSupported() ) + { + // Draw the captured images and captured remaining text + DrawSequenceImageText( skin, aGc ); + // Draw the timelapse countdown counter + DrawTimeLapseCountdown( skin, aGc ); + } + else if ( inBurst ) + { + // Draw the captured images and captured remaining text + DrawSequenceImageText( skin, aGc ); + } + + if ( appUi && ( appUi->DrawPreCaptureCourtesyUI() || + ( !appUi->DrawPreCaptureCourtesyUI() && appUi->IsSecondCameraEnabled() ) ) ) + { + + if ( !inTimeLapse && !inBurst && !iController.IsProcessingCapture() ) + { + // Draw the icon for storage location (Phone/MediaCard) + DrawStorageIcon( aGc ); + } + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + if ( iDrawSequence ) + { + DrawNaviSequence( aGc ); + } +#endif // PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + DrawNaviGenericSetup( aGc ); +#endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + + if ( iMode == ECamControllerVideo ) + { + // only draw remaining time when engine has initialised video + if ( iVideoInitialised && iVideoTextItem && !iController.IsProcessingCapture() ) + { + iVideoTextItem->Draw( aGc ); + } + } + else if ( !stillCapturing && iPhotoTextItem && !inBurst) + { + iPhotoTextItem->Draw( aGc ); + } + else + { + // To prevent Lint warning + } + } + } + + // ------------------------------------------------------- + // Post capture state + else if ( ECamViewStatePostCapture == viewState + || ECamViewStateBurstThumbnail == viewState ) + { + if ( appUi->DrawPostCaptureCourtesyUI() ) + { + + TRAP_IGNORE( DrawCurrentFileSizeL( skin, aGc ) ); + +#ifdef PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS + // Draw the icon for storage location (Phone/MediaCard) + DrawStorageIcon( aGc ); + + if ( iMode == ECamControllerVideo ) + { + // Draw the video file type indicator + DrawVideoFileTypeIndicator( aGc ); + } +#endif // PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS + + if ( appUi->CurrentBurstMode() == ECamImageCaptureTimeLapse ) + { + // Draw images captured text background + PRINT( _L("Camera <> Drawing timelapse postcapture decorator.. #######################") ); + iTimeLapsePostCaptureDecorator->Draw( aGc, iExtent ); + // Draw images capture text + TRAP_IGNORE( DrawImagesCapturedTextL( skin, aGc ) ); + } + + } + } + // ------------------------------------------------------- + // otherwise, do nothing + else + { + // empty statement to remove Lint error, MISRA required rule 60 + } + // ------------------------------------------------------- + + DrawNaviSelfTimer( aGc, skin ); + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + DrawNaviModeSubtitle( aGc, skin ); +#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + + PRINT_FRQ( _L("Camera <= CCamNaviCounterModel::DrawCounter" )) + } + + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawCounter +// Draw the control +// --------------------------------------------------------- +// +void +CCamNaviCounterModel::DrawCounterToBitmaps( CFbsBitGc& aBmpGc, + CFbsBitGc& aBmpMaskGc ) const + { + PRINT( _L("Camera => CCamNaviCounterModel::DrawCounterToBitmaps" )) + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + // Draw bitmaps to use in the real navi pane in the settings views + if ( appUi->CurrentViewState() == ECamViewStateSettings ) + { + DrawStorageIconToBitmap( aBmpGc, aBmpMaskGc ); + const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont); + // TRgb color = layoutText.Color(); + TRgb color = KRgbWhite; + // Color is not updated if it not found from the skin + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor( skin, color, KNaviPaneMajorColour, KNaviPaneMinorColour ); + aBmpGc.SetPenColor(color); + aBmpGc.UseFont(font); + if ( iMode == ECamControllerVideo ) + { + + TBufC buf( iRemainingTimeText ); + TPtr pointer = buf.Des(); + AknTextUtils::LanguageSpecificNumberConversion( pointer ); + aBmpGc.DrawText( buf, TPoint( 35, font->HeightInPixels()) ); + } + else + { + TBufC buf( iCounterText ); + TPtr pointer = buf.Des(); + AknTextUtils::LanguageSpecificNumberConversion( pointer ); + aBmpGc.DrawText( buf, TPoint( 35, font->HeightInPixels()) ); + } + aBmpGc.DiscardFont(); + + aBmpMaskGc.SetPenColor(KRgbBlack); + aBmpMaskGc.UseFont(font); + if ( iMode == ECamControllerVideo ) + { + TBufC buf( iRemainingTimeText ); + TPtr pointer = buf.Des(); + AknTextUtils::LanguageSpecificNumberConversion( pointer ); + aBmpMaskGc.DrawText( buf, TPoint( 35,font->HeightInPixels()) ); + + } + else + { + + TBufC buf( iCounterText ); + TPtr pointer = buf.Des(); + AknTextUtils::LanguageSpecificNumberConversion( pointer ); + aBmpMaskGc.DrawText( buf, TPoint( 35,font->HeightInPixels()) ); + + } + aBmpMaskGc.DiscardFont(); + } + PRINT( _L("Camera <= CCamNaviCounterModel::DrawCounterToBitmaps" )) + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawStorageIconToBitmap +// Draw the icon for the media storage location +// --------------------------------------------------------- +// +void +CCamNaviCounterModel::DrawStorageIconToBitmap( CFbsBitGc& aBmpGc, + CFbsBitGc& aBmpMaskGc ) const + { + CFbsBitmap* icon = NULL; + CFbsBitmap* mask = NULL; + if ( iStorageLocation == ECamMediaStoragePhone ) + { + icon = iPhoneIcon; + mask = iPhoneIconMask; + } + else if ( iStorageLocation == ECamMediaStorageMassStorage ) + { + icon = iMassStorageIcon; + mask = iMassStorageIconMask; + } + else + { + icon = iMMCIcon; + mask = iMMCIconMask; + } + // Should use layout + aBmpGc.BitBlt(TPoint(0,0), icon); + aBmpMaskGc.BitBlt(TPoint(0,0), mask); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawStorageIcon +// Draw the icon for the media storage location +// --------------------------------------------------------- +// +void +CCamNaviCounterModel::DrawStorageIcon( CBitmapContext& aGc ) const + { + CFbsBitmap* icon = NULL; + CFbsBitmap* mask = NULL; + if ( iStorageLocation == ECamMediaStoragePhone ) + { + icon = iPhoneIcon; + mask = iPhoneIconMask; + } + else if ( iStorageLocation == ECamMediaStorageMassStorage ) + { + icon = iMassStorageIcon; + mask = iMassStorageIconMask; + } + else + { + icon = iMMCIcon; + mask = iMMCIconMask; + } + + if ( iMode == ECamControllerVideo ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + // Postcapture state + if ( appUi->CurrentViewState() == ECamViewStatePostCapture ) + { + aGc.BitBltMasked( iVidPostStorageIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); + } + else + { + aGc.BitBltMasked( iVidPreStorageIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); + } + } + else + { + aGc.BitBltMasked( iImgStorageIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); + } + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawVideoFileTypeIndicator +// Draw the icon for the video file type indicator +// --------------------------------------------------------- +// +void CCamNaviCounterModel::DrawVideoFileTypeIndicator( CBitmapContext& aGc ) const + { + CFbsBitmap* icon = NULL; + CFbsBitmap* mask = NULL; + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi && appUi->DrawPreCaptureCourtesyUI() ) + { + TCamVideoFileType fileType = static_cast< TCamVideoFileType > + ( iController.IntegerSettingValue( ECamSettingItemVideoFileType ) ); + + if ( fileType == ECamVideoMpeg4 ) + { + icon = iMpeg4Icon; + mask = iMpeg4IconMask; + } + + // Otherwise display the H263 icon. + else + { + icon = i3GPIcon; + mask = i3GPIconMask; + } + + aGc.BitBltMasked( iVideoFileTypeIconRect.Rect().iTl, icon, icon->SizeInPixels(), mask, ETrue ); + } + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawText +// Draw the counter text (photo mode) +// --------------------------------------------------------- +// +void +CCamNaviCounterModel::DrawText( MAknsSkinInstance* /* aSkin */, + const TDesC& /* aText */, + CBitmapContext& /* aGc */ ) const + { + PRINT( _L("camera <> CCamNaviCounterModel::DrawText() not implemented" ) ); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawTimeLapseCountdown +// Draw the timelapse image counter text (captured and remaining images) +// --------------------------------------------------------- +// +void CCamNaviCounterModel::DrawTimeLapseCountdown( MAknsSkinInstance* /*aSkin*/, + CBitmapContext& aGc ) const + { + PRINT( _L("Camera => CCamNaviCounterModel::DrawTimeLapseCountdown") ); + if( iCountDownText ) + { + TBufC<32> buf( *iCountDownText ); // 00:00:00 as Unicode, 32 should be enough + TPtr pointer = buf.Des(); + AknTextUtils::LanguageSpecificNumberConversion( pointer ); + if ( iTimeLapseCountdownTextItem ) + { + TRAP_IGNORE( iTimeLapseCountdownTextItem->SetTextL( buf ) ); + iTimeLapseCountdownTextItem->Draw( aGc ); + } + } + else + { + PRINT( _L("Camera <> CCamNaviCounterModel::DrawTimeLapseCountdown .. [WARNING] no countdown text!") ); + } + PRINT( _L("Camera <= CCamNaviCounterModel::DrawTimeLapseCountdown") ); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawSequenceImageText +// Draw the captured and remaining image count during timelapse capture +// --------------------------------------------------------- +// +void CCamNaviCounterModel::DrawSequenceImageText( MAknsSkinInstance* /*aSkin*/, + CBitmapContext& aGc ) const + { + PRINT1( _L("CCamNaviCounterModel::DrawSequenceImageText %S" ), &iSequenceImageText ) + + if ( iSequenceImageTextItem ) + { + TRAP_IGNORE( iSequenceImageTextItem->SetTextL( iSequenceImageText ) ); + iSequenceImageTextItem->Draw( aGc ); + } + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawImagesCapturedTextL +// Draw the count of images captured in timelapse postcapture view +// --------------------------------------------------------- +// +void CCamNaviCounterModel::DrawImagesCapturedTextL( + MAknsSkinInstance* /*aSkin*/, + CBitmapContext& aGc ) const + { + // Draw count of captured images + const TInt imagesCaptured = iController.TimeLapseImageCount(); + HBufC* capturedImagesText = StringLoader::LoadLC( R_CAM_TIMELAPSE_IMAGES_CAPTURED, imagesCaptured ); + + HBufC* buf = HBufC::NewLC( KCamDefaultCapturedImagesTextLen ); + if ( capturedImagesText->Length() > buf->Length() ) + { + buf->ReAlloc( capturedImagesText->Length() ); + } + + buf = capturedImagesText; + TPtr pointer = buf->Des(); + AknTextUtils::LanguageSpecificNumberConversion( pointer ); + + if ( iSequenceCapturedTextItem ) + { + iSequenceCapturedTextItem->SetTextL( *buf ); + iSequenceCapturedTextItem->Draw( aGc ); + } + + CleanupStack::PopAndDestroy( buf ); + CleanupStack::PopAndDestroy( capturedImagesText ); + } + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_FILENAME +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawCurrentFileName +// Draw the file name +// --------------------------------------------------------- +// +void +CCamNaviCounterModel::DrawCurrentFileName( MAknsSkinInstance* aSkin, + CBitmapContext& aGc ) const + { + TAknLayoutText layoutText; + if ( iMode == ECamControllerVideo ) + { + layoutText = iVideoNameLayout; + } + else + { + layoutText = iPhotoNameLayout; + } + // Draw counter text + TRgb color = layoutText.Color(); + + // Color is not updated if it not found from the skin + AknsUtils::GetCachedColor( aSkin, color, + KNaviPaneMajorColour, KNaviPaneMinorColour ); + + + layoutText.DrawText( aGc, iController.CurrentImageName() , ETrue, KRgbWhite ); + } +#endif // PRODUCT_SUPPORTS_NAVIPANE_FILENAME + + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawCurrentFileSizeL +// Draw the file size +// --------------------------------------------------------- +// + +void +CCamNaviCounterModel::DrawCurrentFileSizeL( MAknsSkinInstance* aSkin, + CBitmapContext& aGc ) const + { + TAknLayoutText layoutText; + if ( iMode == ECamControllerVideo ) + { + layoutText = iVideoSizeLayout; + } + else + { + layoutText = iPhotoSizeLayout; + } + // Draw counter text + TRgb color = layoutText.Color(); + + // Color is not updated if it not found from the skin + AknsUtils::GetCachedColor( aSkin, color, + KNaviPaneMajorColour, KNaviPaneMinorColour ); + + // Show the filename or burst name (if burst mode) + + //START: NOT DISPLAYING FILESIZE + /* + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + TInt size = 0; + + // Get the filesize + if ( appUi->CurrentViewState() == ECamViewStatePostCapture ) + { + TPtrC filename = iController.CurrentFullFileName(); + size = iController.FileSize( filename ); + } + else if ( appUi->CurrentViewState() == ECamViewStateBurstThumbnail ) + { + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error, MISRA required rule 60 + } + */ + //END: NOT DISPLAYING FILESIZE + + if ( iMode == ECamControllerVideo ) + { + // Draw the file size string + TBuf <15> timebuf; + TBuf <30> fullbuf; + + // Generate the string for video length (time) + TTimeIntervalMicroSeconds interval = iController.RecordTimeElapsed(); + TTime time( interval.Int64() ); + time.FormatL( timebuf, *iTimeFormat ); + aGc.SetBrushColor( KRgbWhite ); + TBufC buf( timebuf ); + TPtr pointer = buf.Des(); + AknTextUtils::LanguageSpecificNumberConversion( pointer ); + layoutText.DrawText( aGc, pointer, EFalse, KRgbBlack ); + } + + // START: NOT DISPLAYING FILESIZE + /* + else + { + if ( size > 0 ) + { + // Draw the file size string + HBufC* fileSizeStr = StringLoader::LoadLC( R_QTN_SIZE_KB, size / KKilo ); + layoutText.DrawText( aGc, fileSizeStr->Des() , ETrue, KRgbWhite ); + CleanupStack::PopAndDestroy( fileSizeStr ); + } + } + */ + // END: NOT DISPLAYING FILESIZE + + } + + +// ---------------------------------------------------- +// CCamNaviCounterModel::BurstModeActiveL +// Notification that the burst mode has been activated/deactivated +// ---------------------------------------------------- +// +// burst mode icon is displayed in either the navipane or sidepane +void CCamNaviCounterModel::BurstModeActiveL( TBool aActive, TBool /*aStillModeActive*/ ) + { +#ifdef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + // Update internal state, and trigger a redraw + iDrawSequence = aActive; + DrawDeferred(); +#endif // PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + + // update remaining images + iBurstActive = aActive; + UpdateCounter(); + } + + +// --------------------------------------------------------- +// CCamNaviCounterModel::ForceNaviPaneUpdate +// Force update of navi-pane (i.e after dismissal of MMC removed error note) +// --------------------------------------------------------- +// +void CCamNaviCounterModel::ForceNaviPaneUpdate() + { + PRINT( _L("Camera => CCamNaviCounterModel::ForceNaviPaneUpdate" )) + // update counters + // get current storage location + TInt key = ( ECamControllerVideo == iMode ) + ? ECamSettingItemVideoMediaStorage + : ECamSettingItemPhotoMediaStorage; + + if ( static_cast( CEikonEnv::Static()->AppUi() )->IsMMCRemovedNotePending() ) + { + PRINT( _L("Camera <> CCamNaviCounterModel::ForceNaviPaneUpdate pend") ) + iStorageLocation = + static_cast( + iController.IntegerSettingValueUnfiltered( key ) ); + } + else + { + PRINT( _L("Camera <> CCamNaviCounterModel::ForceNaviPaneUpdate yyy") ) + iStorageLocation = + static_cast( + iController.IntegerSettingValue( key ) ); + } + + if (ECamMediaStorageMassStorage ==iStorageLocation) + { + iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:ECamMediaStoragePhone; + } + UpdateCounter(); + + TRAP_IGNORE( UpdateRecordTimeAvailableL() ); + PRINT( _L("Camera <= CCamNaviCounterModel::ForceNaviPaneUpdate" )) + } + + +// --------------------------------------------------------- +// CCamNaviCounterModel::HandleControllerEventL +// Handle an event from CCamAppController. +// --------------------------------------------------------- +// +void +CCamNaviCounterModel::HandleControllerEventL( TCamControllerEvent aEvent, + TInt /* aError */ ) + { + PRINT1( _L("Camera => CCamNaviCounterModel::HandleControllerEventL %d" ), aEvent ) + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + iCounterNeedUpdate = EFalse; + + switch( aEvent ) + { + // ----------------------------------------------------- + // If this is a capture complete event, or the image quality or save + // location has changed... +// case ECamEventCaptureComplete: + case ECamEventVideoQualityChanged: + case ECamEventImageQualityChanged: + case ECamEventSaveLocationChanged: + { + if( iMode == ECamControllerVideo ) + { + UpdateRecordTimeAvailableL(); + } + else + { + UpdateCounter(); + } + + if ( ECamEventSaveLocationChanged == aEvent ) + { + TCamSettingItemIds storageId = (ECamControllerVideo == iMode) + ? ECamSettingItemVideoMediaStorage + : ECamSettingItemPhotoMediaStorage; + + // update location + if ( appUi->IsMMCRemovedNotePending() ) + { + iStorageLocation = static_cast< TCamMediaStorage > + ( iController.IntegerSettingValueUnfiltered( storageId ) ); + } + else + { + iStorageLocation = static_cast< TCamMediaStorage > + ( iController.IntegerSettingValue( storageId ) ); + } + //CreateNaviBitmapsL( ETrue ); + + if (ECamMediaStorageMassStorage ==iStorageLocation) + { + iStorageLocation = iController.ExistMassStorage()?ECamMediaStorageMassStorage:ECamMediaStoragePhone; + } + } + BroadcastEvent( ECamObserverEventNaviModelUpdated ); + break; + } + // ----------------------------------------------------- + case ECamEventLocationSettingChanged: + { + iLocationIconVisible = (/*TCamLocationId::ECamLocationOn*/1 == iController.IntegerSettingValue( ECamSettingItemRecLocation )); + // We reload the resource data so that the control is drawn correctly + ReloadResourceDataL(); + //BroadcastEvent( ECamObserverEventNaviModelUpdated ); + break; + } + // ----------------------------------------------------- + case ECamEventEngineStateChanged: + { + if( ECamControllerVideo == iMode ) + { + // wait until engine has initialised video before updating time remaining + if ( !iVideoInitialised ) + { + // + // if ( iController.EngineState() == ECamEngineVideoCapturePrepared ) + if ( iController.CameraState() == ECamCameraPreparedVideo ) + { + iVideoInitialised = ETrue; + } + } + if ( iVideoInitialised ) + { + UpdateRecordTimeAvailableL(); + if ( iController.IsViewFinding() ) + { + BroadcastEvent( ECamObserverEventNaviModelUpdated ); + } + } + } + else + { + // exited from video mode + iVideoInitialised = EFalse; + } + break; + } + + // ----------------------------------------------------- + case ECamEventSaveComplete: + case ECamEventRecordComplete: + { + if( ECamControllerVideo == iMode ) + { + UpdateRecordTimeAvailableL(); + } + else + { + switch( iImageMode ) + { + case ECamImageCaptureBurst: + case ECamImageCaptureTimeLapse: + // Sequence: captured / remaining + UpdateSequenceImageCount(); + break; + default: + // Remaining images + UpdateCounter(); + break; + } + } + // no broadcast if in burst and all snapshots have not been received + if( !( iMode == ECamControllerImage && + iImageMode == ECamImageCaptureBurst && + !iController.AllSnapshotsReceived()) ) + { + BroadcastEvent( ECamObserverEventNaviModelUpdated ); + } + break; + } + case ECamEventAudioMuteStateChanged: + { + if ( appUi->IsDirectViewfinderActive() ) + { + appUi->HandleCommandL( ECamCmdRedrawScreen ); + } + //Remaining Recording time is updated before drawing + //CreateNaviBitmapsL( ETrue ); + break; + } + // ----------------------------------------------------- + case ECamEventCounterUpdated: + { + if( iController.SequenceCaptureInProgress() + && ( ECamImageCaptureTimeLapse == iImageMode + || ECamImageCaptureBurst == iImageMode ) ) + { + // UpdateCounter; + iCounterNeedUpdate = ETrue; + UpdateSequenceImageCount(); + if ( ECamImageCaptureTimeLapse == iImageMode ) + { + // Update remaining time till next capture + UpdateTimeLapseCountdownL(); + } + if( iController.AllSnapshotsReceived() ) + { + PRINT( _L("CCamNaviCounterModel BroadcastEvent( ECamObserverEventNaviModelUpdated )" ) ) + BroadcastEvent( ECamObserverEventNaviModelUpdated ); + } + } + break; + } + // ----------------------------------------------------- + default: + { + break; + } + // ----------------------------------------------------- + } + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::ConstructNaviSelfTimerL +// Creating the member variables required for showing the +// self timer state in the navipane +// --------------------------------------------------------- +// +void CCamNaviCounterModel::ConstructNaviSelfTimerL( TPtrC& aResname ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + // Setup self timer icon. + // ...Create the icon + TSize size = iSelfTimerIconRect.Rect().Size(); + AknIconUtils::CreateIconL( iSelfTimerIcon, + iSelfTimerMask, + aResname, + EMbmCameraappQgn_indi_cam4_selftimer, + EMbmCameraappQgn_indi_cam4_selftimer_mask ); + AknIconUtils::SetSize( iSelfTimerIcon, size ); + + // ...Add self as an observer of the self timer. + CCamSelfTimer* selftimer = appUi->SelfTimer(); + if ( selftimer ) + { + selftimer->AddObserverL( this ); + } + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawNaviSelfTimer +// Draw the self timer icon +// --------------------------------------------------------- +// +void +CCamNaviCounterModel::DrawNaviSelfTimer( CBitmapContext& aGc, + MAknsSkinInstance* /*aSkin*/ ) const + { + // Draw self timer icons, if set to on. + if ( iDrawSelfTimer ) + { + if ( CamUtility::IsNhdDevice() ) + { + aGc.SetBrushColor( KRgbWhite ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + iSelfTimerTextLayout.DrawText( aGc, iSelfTimerText, EFalse, KRgbBlack ); + + aGc.BitBltMasked( iSelfTimerIconRect.Rect().iTl, iSelfTimerIcon, + iSelfTimerIcon->SizeInPixels(), iSelfTimerMask, ETrue ); + } + else + { + aGc.SetBrushColor( KRgbBlack ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + iSelfTimerTextLayout.DrawText( aGc, iSelfTimerText, EFalse, KRgbWhite ); + + aGc.BitBltMasked( iSelfTimerIconRect.Rect().iTl, iSelfTimerIcon, + iSelfTimerIcon->SizeInPixels(), iSelfTimerMask, ETrue ); + } + } + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::ConstructNaviSequenceL +// Creating the member variables required for showing the +// sequence capture state in the navipane +// --------------------------------------------------------- +// +void CCamNaviCounterModel::ConstructNaviSequenceL( TPtrC& aResname ) + { + // Setup sequence icon. + // ...Create the icon + TSize size = iSequenceIconRect.Rect().Size(); + AknIconUtils::CreateIconL( iSequenceIcon, + iSequenceMask, + aResname, + EMbmCameraappQgn_indi_cam4_sequence_burst, + EMbmCameraappQgn_indi_cam4_sequence_burst_mask ); + AknIconUtils::SetSize( iSequenceIcon, size ); + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + // ...Add self as an observer of burst mode + appUi->AddBurstModeObserverL( this ); + } + + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawNaviSequence +// Draw the sequence capture icon +// --------------------------------------------------------- +// +void CCamNaviCounterModel::DrawNaviSequence( CBitmapContext& aGc ) const + { + aGc.BitBltMasked( iSequenceIconRect.Rect().iTl, iSequenceIcon, + iSequenceIcon->SizeInPixels(), iSequenceMask, ETrue); + } + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR +// --------------------------------------------------------- +// CCamNaviCounterModel::ConstructNaviGenericSetupL +// Creating the member variables required for showing the +// generic setup state in the navipane +// --------------------------------------------------------- +// +void CCamNaviCounterModel::ConstructNaviGenericSetupL( TPtrC& aResname ) + { + // Setup generic setup icon. + // ...Create the icon + TSize size = iGenericIconRect.Rect().Size(); + AknIconUtils::CreateIconL( iGenericIcon, + iGenericMask, + aResname, + EMbmCameraappQgn_indi_lcam_generic, + EMbmCameraappQgn_indi_lcam_generic_mask ); + AknIconUtils::SetSize( iGenericIcon, size ); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawNaviGenericSetup +// Draw the generic setup icon +// --------------------------------------------------------- +// +void CCamNaviCounterModel::DrawNaviGenericSetup( CBitmapContext& aGc ) const + { + if ( ( iMode == ECamControllerVideo && !iController.VideoSceneDefaultsAreSet() ) || + ( iMode != ECamControllerVideo && !iController.PhotoSceneDefaultsAreSet() ) ) + { + aGc.BitBltMasked( iGenericIconRect.Rect().iTl, iGenericIcon, + iGenericIcon->SizeInPixels(), iGenericMask, ETrue); + } + } +#endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + + + + +// --------------------------------------------------------- +// CCamNaviCounterModel::ConstructNaviAudioMuteL +// Creating the member variables required for showing the +// audio mute state in the navipane +// --------------------------------------------------------- +// +void CCamNaviCounterModel::ConstructNaviAudioMuteL( TPtrC& aResname ) + { + // Setup generic setup icon. + + // ...Create the icon + TSize size = iAudioMuteIconRect.Rect().Size(); + AknIconUtils::CreateIconL( iAudioMuteIcon, + iAudioMuteMask, + aResname, + EMbmCameraappQgn_indi_vid4_audio_mute, + EMbmCameraappQgn_indi_vid4_audio_mute_mask ); + AknIconUtils::SetSize( iAudioMuteIcon, size ); + } + + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawNaviAudioMute +// Draw the audio mute icon +// --------------------------------------------------------- +// +void CCamNaviCounterModel::DrawNaviAudioMute( CBitmapContext& aGc ) const + { + TCamSettingsOnOff audio = static_cast< TCamSettingsOnOff > + ( iController.IntegerSettingValue( ECamSettingItemVideoAudioRec ) ); + + // If the current mode is in video and the audio has been + // muted, display the audio mute indicator. + if ( ( ECamSettOff == audio ) && ( iMode == ECamControllerVideo ) ) + { + // Draw icon + aGc.BitBltMasked( iAudioMuteIconRect.Rect().iTl, iAudioMuteIcon, + iAudioMuteIcon->SizeInPixels(), iAudioMuteMask, ETrue); + } + } + + + + +#ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE +// --------------------------------------------------------- +// CCamNaviCounterModel::ConstructNaviModeSubtitleL +// Creating the member variables required for showing the +// current mode in the navipane +// --------------------------------------------------------- +// +void CCamNaviCounterModel::ConstructNaviModeSubtitleL( TPtrC& aResname ) + { + // Setup generic setup icon. + + // ...Create the icon (photo icon) + TSize size = iSubtitlePhotoRect.Rect().Size(); + AknIconUtils::CreateIconL( iSubtitlePhotoIcon, + iSubtitlePhotoMask, + aResname, + EMbmCameraappQgn_indi_cam_photomode, + EMbmCameraappQgn_indi_cam_photomode_mask ); + AknIconUtils::SetSize( iSubtitlePhotoIcon, size ); + + // ...Create the icon (video icon) + size = iSubtitlePhotoRect.Rect().Size(); + AknIconUtils::CreateIconL( iSubtitleVideoIcon, + iSubtitleVideoMask, + aResname, + EMbmCameraappQgn_indi_cam_videomode, + EMbmCameraappQgn_indi_cam_videomode_mask ); + AknIconUtils::SetSize( iSubtitleVideoIcon, size ); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DrawNaviModeSubtitle +// Draw the subtitle text and icon +// --------------------------------------------------------- +// +void CCamNaviCounterModel::DrawNaviModeSubtitle( CBitmapContext& aGc, MAknsSkinInstance* aSkin ) const + { + CWindowGc& gc = SystemGc(); + // Set drawing colour + TRgb color = iSelfTimerTextLayout.Color(); + // ...Color is not updated if it not found from the skin + AknsUtils::GetCachedColor( aSkin, color, + KNaviPaneMajorColour, KNaviPaneMinorColour ); + + if ( iMode == ECamControllerVideo ) + { + + iSubtitleVideoTextLayout.DrawText( gc, iSubtitleVideoText->Des(), ETrue, KRgbWhite ); + aGc.BitBltMasked( iSubtitleVideoRect.Rect().iTl, iSubtitleVideoIcon, + iSubtitleVideoIcon->SizeInPixels(), iSubtitleVideoMask, ETrue); + } + else + { + + iSubtitlePhotoTextLayout.DrawText( gc, iSubtitlePhotoText->Des(), ETrue, KRgbWhite ); + aGc.BitBltMasked( iSubtitlePhotoRect.Rect().iTl, iSubtitlePhotoIcon, + iSubtitlePhotoIcon->SizeInPixels(), iSubtitlePhotoMask, ETrue); + } + } +#endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + + + +// --------------------------------------------------------- +// CCamNaviCounterModel::SetExtentL +// Sets where the navicounter should be rendered +// --------------------------------------------------------- +// +void CCamNaviCounterModel::SetExtentL( TRect aExtent ) + { + if ( aExtent != iExtent ) + { + iExtent = aExtent; + } + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::RegisterObserverL +// Registers an observer +// --------------------------------------------------------- +// +void CCamNaviCounterModel::RegisterObserverL(MCamObserver* aObserver) + { + iObserverHandler->RegisterObserverL(aObserver); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::DeregisterObserver +// Deregisters an observer +// --------------------------------------------------------- +// +void CCamNaviCounterModel::DeregisterObserver(MCamObserver* aObserver) + { + iObserverHandler->DeregisterObserver(aObserver); + } + +// --------------------------------------------------------- +// CCamNaviCounterModel::BroadcastEvent +// Broadcasts an event code to all observers +// --------------------------------------------------------- +// +void CCamNaviCounterModel::BroadcastEvent(TCamObserverEvent aEvent) + { + iObserverHandler->BroadcastEvent(aEvent); + } + +// --------------------------------------------------------------------------- +// CCamNaviCounterModel::CreateNaviBitmapsL +// Set up the memory icon and counter in the navipane +// --------------------------------------------------------------------------- +// +void CCamNaviCounterModel::CreateNaviBitmapsL( const TBool aDrawIcons ) + { + PRINT( _L("Camera => CCamNaviCounterModel::CreateNaviBitmapsL") ); + CCamAppUi* camAppUi = ( CCamAppUi* )iAvkonAppUiBase; + if ( camAppUi && camAppUi->SettingsLaunchedFromCamera() ) + { + CEikStatusPane* sp = camAppUi->StatusPane(); + + TUid npUid ; + npUid.iUid = EEikStatusPaneUidNavi; + CAknNavigationControlContainer* naviPane = + ( CAknNavigationControlContainer* )sp->ControlL( npUid ); + + // dispose of old decorator and bitmaps + if( iNaviDec ) + { + // do we need to pop it off the navi pane stack first? + delete iNaviDec; + iNaviDec = NULL; + iNaviBitmap = NULL; + iNaviBitmapMask = NULL; + } + + if( iNaviBitmap ) + { + delete iNaviBitmap; + iNaviBitmap = NULL; + } + + iNaviBitmap = new ( ELeave ) CFbsBitmap(); + User::LeaveIfError( iNaviBitmap->Create( TSize(250,20), EColor64K ) ); + CFbsBitmapDevice* bmpDevice = NULL; + bmpDevice = CFbsBitmapDevice::NewL( iNaviBitmap ); + CleanupStack::PushL( bmpDevice ); + CFbsBitGc* bmpGc = NULL; + User::LeaveIfError( bmpDevice->CreateContext( bmpGc ) ); + CleanupStack::PushL( bmpGc ); + + if( iNaviBitmapMask ) + { + delete iNaviBitmapMask; + iNaviBitmapMask = NULL; + } + iNaviBitmapMask = new ( ELeave ) CFbsBitmap(); + User::LeaveIfError( iNaviBitmapMask->Create( TSize(250,20), EColor64K ) ); + CFbsBitmapDevice* bmpMaskDevice = NULL; + bmpMaskDevice = CFbsBitmapDevice::NewL( iNaviBitmapMask ); + CleanupStack::PushL( bmpMaskDevice ); + CFbsBitGc* bmpMaskGc = NULL; + User::LeaveIfError( bmpMaskDevice->CreateContext( bmpMaskGc ) ); + CleanupStack::PushL( bmpMaskGc ); + + if ( aDrawIcons ) + { + if ( iMode == ECamControllerVideo ) + { + UpdateRecordTimeAvailableL(); + } + DrawCounterToBitmaps( *bmpGc, *bmpMaskGc ); + } + // Create the new decorator and push on to navi stack + iNaviDec = naviPane->CreateNavigationImageL( iNaviBitmap, + iNaviBitmapMask ); + CleanupStack::PopAndDestroy( bmpMaskGc ); + CleanupStack::PopAndDestroy( bmpMaskDevice ); + CleanupStack::PopAndDestroy( bmpGc ); + CleanupStack::PopAndDestroy( bmpDevice ); + naviPane->PushL( *iNaviDec ); + } + PRINT( _L("Camera <= CCamNaviCounterModel::CreateNaviBitmapsL") ); + } + +// --------------------------------------------------------------------------- +// CCamNaviCounterModel::NonTouchLayoutL +// --------------------------------------------------------------------------- +void CCamNaviCounterModel::NonTouchLayoutL() + { + TInt variant = 0; + + TInt cba = AknLayoutUtils::CbaLocation() == + AknLayoutUtils::EAknCbaLocationLeft? + AknLayoutUtils::EAknCbaLocationLeft : 0; + + TAknLayoutRect camIndicatorPane; + camIndicatorPane.LayoutRect( iExtent, + AknLayoutScalable_Apps::cam6_indi_pane( variant )); + + iImgStorageIconRect.LayoutRect( camIndicatorPane.Rect(), + AknLayoutScalable_Apps::cam6_indi_pane_g2( cba ) ); + + iPhotoTextItem->SetLayoutL( camIndicatorPane.Rect(), + AknLayoutScalable_Apps::cam6_indi_pane_t1( cba ) ); + + TAknLayoutRect vidIndicatorPane; + vidIndicatorPane.LayoutRect( iExtent, + AknLayoutScalable_Apps::vid6_indi_pane( cba ) ); + + iVidPreStorageIconRect.LayoutRect( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g3( cba ) ); + + iVideoTextLayout.LayoutText( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t1( cba ) ); + + iVideoTextItem->SetLayoutL( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t1( cba ) ); + + TAknLayoutRect vidProgressPane; + vidProgressPane.LayoutRect( iExtent, + AknLayoutScalable_Apps::vid6_indi_pane( cba ) ); + + iSequenceImageTextItem->SetLayoutL( + vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); + + iTimeLapseCountdownTextItem->SetLayoutL( + vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); + + iSequenceCapturedTextItem->SetLayoutL( + vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); + + + // ...Load layout rect for self timer image. + TAknLayoutRect timerParent; + timerParent.LayoutRect( iExtent, + AknLayoutScalable_Apps::cam6_timer_pane( cba ) ); + iSelfTimerIconRect.LayoutRect( timerParent.Rect(), + AknLayoutScalable_Apps::cam6_timer_pane_g1( cba ) ); + iSelfTimerTextLayout.LayoutText( timerParent.Rect(), + AknLayoutScalable_Apps::cam6_timer_pane_t1( cba ) ); + + iVideoSizeLayout.LayoutText( vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t4( 2 ) ); // Magic: layout Opt2 + iPhotoSizeLayout = iVideoSizeLayout; + + // ...Load layout rect for sequence image. + iSequenceIconRect.LayoutRect( iExtent, + AknLayoutScalable_Apps::cam6_mode_pane_g2( cba ) ); + + iAudioMuteIconRect.LayoutRect( iExtent, + AknLayoutScalable_Apps::cam6_mode_pane_g2( cba ) ); + + } + +// --------------------------------------------------------------------------- +// CCamNaviCounterModel::NonTouchLayoutSecondaryL +// --------------------------------------------------------------------------- +void CCamNaviCounterModel::NonTouchLayoutSecondaryL() + { + // Magic numbers used for layout variation + TAknLayoutRect camIndicatorPane; + camIndicatorPane.LayoutRect( iExtent, + AknLayoutScalable_Apps::cam6_indi_pane( 3 )); + + iImgStorageIconRect.LayoutRect( camIndicatorPane.Rect(), + AknLayoutScalable_Apps::cam6_indi_pane_g2( 2 ) ); + + iPhotoTextItem->SetLayoutL( camIndicatorPane.Rect(), + AknLayoutScalable_Apps::cam6_indi_pane_t1( 4 ) ); + + TAknLayoutRect vidIndicatorPane; + vidIndicatorPane.LayoutRect( iExtent, + AknLayoutScalable_Apps::vid6_indi_pane( 3 ) ); + + iVidPreStorageIconRect.LayoutRect( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g3( 2 ) ); + + iVideoTextLayout.LayoutText( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t1( 1 ) ); + + iVideoTextItem->SetLayoutL( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t1( 1 ) ); + + iVideoSizeLayout.LayoutText( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_t1( 1 ) ); + iPhotoSizeLayout = iVideoSizeLayout; + + iAudioMuteIconRect.LayoutRect( iExtent, + AknLayoutScalable_Apps::cam6_mode_pane_g1( 0 ) ); + + } + +// --------------------------------------------------------------------------- +// CCamNaviCounterModel::TouchLayoutL +// --------------------------------------------------------------------------- +void CCamNaviCounterModel::TouchLayoutL() + { + TInt variant = 0; // portrait + TInt indicatorVariant = 1; + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + // Landscape layout variant + variant = 1; // landscape + indicatorVariant = 0; + } + + TAknLayoutRect camIndicatorPane; + camIndicatorPane.LayoutRect( iExtent, + AknLayoutScalable_Apps::cam4_indicators_pane( variant ) ); + + iImgStorageIconRect.LayoutRect( camIndicatorPane.Rect(), + AknLayoutScalable_Apps::cam4_indicators_pane_g2( indicatorVariant ) ); + + iPhotoTextItem->SetLayoutL( camIndicatorPane.Rect(), + AknLayoutScalable_Apps::cam4_indicators_pane_t1( indicatorVariant ) ); + + TAknLayoutRect vidIndicatorPane; + vidIndicatorPane.LayoutRect( iExtent, + AknLayoutScalable_Apps::vid4_indicators_pane( variant ) ); + + iVidPreStorageIconRect.LayoutRect( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid4_indicators_pane_g3( indicatorVariant ) ); + + #ifdef PRODUCT_SUPPORTS_POST_CAPTURE_INDICATORS + iVideoFileTypeIconRect.LayoutRect( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid4_indicators_pane_g2( indicatorVariant ) ); + #endif + + iVideoTextLayout.LayoutText( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid4_indicators_pane_t1( indicatorVariant ) ); + + iVideoTextItem->SetLayoutL( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid4_indicators_pane_t1( indicatorVariant ) ); + + + TAknLayoutRect vidProgressPane; + vidProgressPane.LayoutRect( + iExtent, + AknLayoutScalable_Apps::vid4_progress_pane( variant ) ); + + iSequenceImageTextItem->SetLayoutL( + vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_t3() ); + + iTimeLapseCountdownTextItem->SetLayoutL( + vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_t3() ); + + iSequenceCapturedTextItem->SetLayoutL( + vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_t3() ); + + + // ...Load layout rect for self timer image. + iSelfTimerIconRect.LayoutRect( iExtent, + AknLayoutScalable_Apps::main_camera4_pane_g5( variant ) ); + iSelfTimerTextLayout.LayoutText( iExtent, + AknLayoutScalable_Apps::main_camera4_pane_t1( variant ) ); + + #ifdef PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + if ( !AknLayoutUtils::LayoutMirrored() ) + { + iSubtitlePhotoTextLayout.LayoutText( iExtent, + ROID(R_CAM_SUBTITLE_PHOTOMODE_TEXT_LAYOUT_ID)); + iSubtitleVideoTextLayout.LayoutText( iExtent, + ROID(R_CAM_SUBTITLE_VIDEOMODE_TEXT_LAYOUT_ID)); + iSubtitlePhotoRect.LayoutRect( iExtent, + ROID(R_CAM_SUBTITLE_PHOTOMODE_ICON_RECT_ID)); + iSubtitleVideoRect.LayoutRect( iExtent, + ROID(R_CAM_SUBTITLE_VIDEOMODE_ICON_RECT_ID)); + } + else + { + iSubtitlePhotoTextLayout.LayoutText( iExtent, + ROID(R_CAM_SUBTITLE_PHOTOMODE_TEXT_LAYOUT_AH_ID)); + iSubtitleVideoTextLayout.LayoutText( iExtent, + ROID(R_CAM_SUBTITLE_VIDEOMODE_TEXT_LAYOUT_AH_ID)); + iSubtitlePhotoRect.LayoutRect( iExtent, + ROID(R_CAM_SUBTITLE_PHOTOMODE_ICON_RECT_AH_ID)); + iSubtitleVideoRect.LayoutRect( iExtent, + ROID(R_CAM_SUBTITLE_VIDEOMODE_ICON_RECT_AH_ID)); + } + + // ...Read the strings from the resource + iSubtitleVideoText = iCoeEnv->AllocReadResourceAsDes16L( + ROID(R_CAM_STILL_PRE_CAPTURE_SUBTITLE_TEXT_VIDEO_ID)); + iSubtitlePhotoText = iCoeEnv->AllocReadResourceAsDes16L( + ROID(R_CAM_STILL_PRE_CAPTURE_SUBTITLE_TEXT_PHOTO_ID)); + #endif // PRODUCT_SUPPORTS_NAVIPANE_MODE_SUBTITLE + + #ifdef PRODUCT_SUPPORTS_NAVIPANE_FILENAME + if ( !AknLayoutUtils::LayoutMirrored() ) + { + iPhotoNameLayout.LayoutText( iExtent, + ROID(R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_ID)); + iVideoNameLayout.LayoutText( iExtent, + ROID(R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_ID)); + } + else + { + iPhotoNameLayout.LayoutText( iExtent, + ROID(R_CAM_POST_CAPTURE_IMAGE_NAME_LAYOUT_AH_ID)); + iVideoNameLayout.LayoutText( iExtent, + ROID(R_CAM_POST_CAPTURE_VIDEO_NAME_LAYOUT_AH_ID)); + } + + #endif // PRODUCT_SUPPORTS_NAVIPANE_FILENAME + + + iVideoSizeLayout.LayoutText( vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_t3( indicatorVariant )); + + if ( !AknLayoutUtils::LayoutMirrored() ) + { + iPhotoSizeLayout.LayoutText( iExtent, + ROID(R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_ID)); + } + else + { + iPhotoSizeLayout.LayoutText( iExtent, + ROID(R_CAM_POST_CAPTURE_IMAGE_SIZE_LAYOUT_AH_ID)); + } + + // ...Load layout rect for sequence image. + iSequenceIconRect.LayoutRect( iExtent, + AknLayoutScalable_Apps::main_camera4_pane_g2( variant ) ); + + #ifdef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + if ( !AknLayoutUtils::LayoutMirrored() ) + { + iGenericIconRect.LayoutRect( iExtent, + ROID(R_CAM_GENERIC_SETUP_ICON_RECT_ID)); + } + else + { + iGenericIconRect.LayoutRect( iExtent, + ROID(R_CAM_GENERIC_SETUP_ICON_RECT_AH_ID)); + } + #endif // PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi->IsSecondCameraEnabled() && !appUi->IsQwerty2ndCamera() ) + { + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + mainPaneRect ); + iAudioMuteIconRect.LayoutRect( + mainPaneRect, + AknLayoutScalable_Apps::main_video4_pane_g2( variant ) ); + } + else + { + iAudioMuteIconRect.LayoutRect( + iExtent, + AknLayoutScalable_Apps::main_video4_pane_g3( variant ) ); + } + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamNaviProgressBarControl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamNaviProgressBarControl.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Control for displaying remaining images/videos in Navi Pane +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +// INCLUDE FILES +#include +#include +#include "CamNaviProgressBarControl.h" +#include "CamNaviProgressBarModel.h" +#include "CamAppUi.h" +#include "CamUtility.h" + +// CONSTANTS + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------- +// CCamNaviProgressBarControl::NewL +// Factory construction function +// --------------------------------------------------------- +// +CCamNaviProgressBarControl* CCamNaviProgressBarControl::NewL( CCamNaviProgressBarModel& aModel ) + { + CCamNaviProgressBarControl* self = new( ELeave ) CCamNaviProgressBarControl( aModel ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// Destructor +CCamNaviProgressBarControl::~CCamNaviProgressBarControl() + { + iModel.DeregisterObserver( this ); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarControl::CCamNaviProgressBarControl +// C++ constructor +// --------------------------------------------------------- +// +CCamNaviProgressBarControl::CCamNaviProgressBarControl(CCamNaviProgressBarModel& aModel ) + : iModel ( aModel ), + iActive ( EFalse ) + { + } + +// --------------------------------------------------------- +// CCamNaviProgressBarControl::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamNaviProgressBarControl::ConstructL() + { + iModel.RegisterObserverL( this ); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarControl::SizeChanged +// Called by framework when the view size is changed +// --------------------------------------------------------- +// +void CCamNaviProgressBarControl::SizeChanged() + { + // if the rectangle has width or height + if ( Rect().Size() != TSize( 0, 0 ) && iActive ) + { + TRAP_IGNORE(iModel.SetExtentL( Rect() )); + TRAP_IGNORE(iModel.ReloadResourceDataL()); + } + +// AknsUtils::RegisterControlPosition( this ); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarControl::DrawNaviCtr +// Draw the control +// --------------------------------------------------------- +// +void +CCamNaviProgressBarControl::DrawProgressBar( CBitmapContext& aGc ) const + { + if ( iActive ) + { + iModel.DrawProgressBar( aGc, this ); + } + } + +// --------------------------------------------------------- +// CCamNaviProgressBarControl::Draw +// Draw the control +// --------------------------------------------------------- +// +void CCamNaviProgressBarControl::Draw( const TRect& /* aRect */ ) const + { + PRINT( _L("Camera => CCamNaviProgressBarControl::Draw" )) + CWindowGc& gc=SystemGc(); + + DrawProgressBar( gc ); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarControl::SetActive +// Set's whether this control is currently active or not +// --------------------------------------------------------- +// +void CCamNaviProgressBarControl::SetActiveL( TBool aActive ) + { + iActive = aActive; + if ( iActive ) + { + iModel.SetExtentL( Rect() ); + } + } + +// --------------------------------------------------------- +// CCamNaviProgressBarControl::HandleObservedEvent +// Gets events from observed model +// --------------------------------------------------------- +// +void CCamNaviProgressBarControl::HandleObservedEvent(TCamObserverEvent aEvent) + { + if ( ECamObserverEventNaviModelUpdated == aEvent ) + { + if ( iActive ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + if ( appUi && appUi->IsDirectViewfinderActive() ) + { + TRAP_IGNORE(appUi->HandleCommandL( ECamCmdRedrawScreen )); + } + else + { + DrawDeferred(); + } + } + } + } + +// End of File + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamNaviProgressBarModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamNaviProgressBarModel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,787 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Control for displaying elapse/remaining record time +* in Navi Pane +* +* Copyright (c) 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +// INCLUDE FILES +#include +#include +#include // For CEikApplication +#include +#include +#include +#include // StringLoader +#include +#include // TResourceReader +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CamNaviProgressBarModel.h" +#include "CamAppUi.h" +#include "CamLogger.h" +#include "CamUtility.h" +#include "CamDecorator.h" +#include "CamObserverHandler.h" +#include "camcameraevents.h" +#include "camcameracontrollertypes.h" +#include "camtextitem.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamNaviProgressBarModelTraces.h" +#endif + + +// CONSTANTS +const TInt KFlashInterval = 200000; +const TUint KCameraEventInterest = ECamCameraEventClassVideoTimes; + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::NewL +// Factory construction function +// --------------------------------------------------------- +// +CCamNaviProgressBarModel* CCamNaviProgressBarModel::NewL( CCamAppController& aController ) + { + CCamNaviProgressBarModel* self = new( ELeave ) CCamNaviProgressBarModel( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::~CCamNaviProgressBarModel +// Destructor +// --------------------------------------------------------- +// +CCamNaviProgressBarModel::~CCamNaviProgressBarModel() + { + PRINT( _L("Camera => ~CCamNaviProgressBarModel") ); + + delete iElapsedTimeTextItem; + delete iRemainingTimeTextItem; + + UnloadResourceData(); + + iController.RemoveControllerObserver( this ); + iController.RemoveCameraObserver( this ); + + delete iTimeFormat; + delete iObserverHandler; + + if ( iFlashingTimer && iFlashingTimer->IsActive() ) + { + iFlashingTimer->Cancel(); + } + delete iFlashingTimer; + PRINT( _L("Camera <= ~CCamNaviProgressBarModel") ); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::CCamNaviProgressBarModel +// C++ constructor +// --------------------------------------------------------- +// +CCamNaviProgressBarModel::CCamNaviProgressBarModel( + CCamAppController& aController ) +: iController( aController ) + { + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::DrawProgressBar +// Draw Navi-progress +// --------------------------------------------------------- +// +void +CCamNaviProgressBarModel::DrawProgressBar( CBitmapContext& aGc, + const CCoeControl* aControl ) const + { + DrawProgBar( aGc, aControl ); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamNaviProgressBarModel::ConstructL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMNAVIPROGRESSBARMODEL_CONSTRUCTL, "e_CCamNaviProgressBarModel_ConstructL 1" ); + iController.AddControllerObserverL( this ); + iController.AddCameraObserverL( this, KCameraEventInterest ); + + LoadResourceDataL(); + + iObserverHandler = CCamObserverHandler::NewL(); + + iFlashingTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMNAVIPROGRESSBARMODEL_CONSTRUCTL, "e_CCamNaviProgressBarModel_ConstructL 0" ); + } + +// ----------------------------------------------------------------------------- +// CCamNaviProgressBarModel::LoadResourceDataL() +// Reads in all information needed from resources +// ----------------------------------------------------------------------------- +// +void CCamNaviProgressBarModel::LoadResourceDataL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMNAVIPROGRESSBARMODEL_LOADRESOURCEDATAL, "e_CCamNaviProgressBarModel_LoadResourceDataL 1" ); + // Create component bitmaps + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + + AknsUtils::CreateIconL( + skin, + KAknsIIDQgnGrafMup2BarProgress, + iProgressBarBitmap, + iProgressBarMask, + resname, + EMbmCameraappQgn_graf_mup2_bar_progress, + EMbmCameraappQgn_graf_mup2_bar_progress_mask ); + + AknsUtils::CreateIconL( + skin, + KAknsIIDQgnGrafMup2BarFrame, + iProgressBarFrame, + resname, + EMbmCameraappQgn_graf_mup2_bar_frame ); + + delete iElapsedTimeTextItem; + iElapsedTimeTextItem = NULL; + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + iElapsedTimeTextItem = CCamTextItem::NewL(); + + delete iRemainingTimeTextItem; + iRemainingTimeTextItem = NULL; + iRemainingTimeTextItem = CCamTextItem::NewL(); + + iCamOrientation = appUi->CamOrientation(); + + if ( CamUtility::IsNhdDevice() ) + { + TouchLayoutL(); + } + else + { + if ( ECamOrientationPortrait == appUi->CamOrientation() ) + { + NonTouchLayoutSecondaryL(); + } + else + { + NonTouchLayoutL(); + } + } + + // Read the time format resource + // We have to free the memory first if it has been + // allocated already + if ( iTimeFormat ) + { + delete iTimeFormat; + iTimeFormat = NULL; + } + if ( ECamOrientationPortrait == appUi->CamOrientation() ) + { + iTimeFormat = CEikonEnv::Static()->AllocReadResourceL( R_QTN_TIME_DURAT_MIN_SEC_WITH_ZERO ); + } + else + { + iTimeFormat = CEikonEnv::Static()->AllocReadResourceL( R_QTN_TIME_DURAT_LONG ); + } + + TBool progressBarVisible = ETrue; + + if ( progressBarVisible ) + { + iDecorator = CCamDecorator::NewL( iController, + ROID(R_CAM_VIDEO_CAP_LIMIT_RECORDING_ICON_ID), this ); + } + else + { + iDecorator = CCamDecorator::NewL( iController, + ROID(R_CAM_VIDEO_CAP_UNLIMIT_RECORDING_ICON_ID), this ); + } + + AknIconUtils::SetSize( + iProgressBarBitmap, + iProgressBarRect.Rect().Size(), + EAspectRatioNotPreserved ); + + // Progress bar area background + AknIconUtils::SetSize( + iProgressBarFrame, + iProgressBarRect.Rect().Size(), + EAspectRatioNotPreserved); + + // Create component bitmaps + TSize size; + if ( CamUtility::IsNhdDevice() ) + { + size = iProgressIconRect.Rect().Size(); + } + else + { + size = iVidStorageIconRect.Rect().Size(); + } + TCamOrientation orientation = appUi->CamOrientation(); + AknIconUtils::CreateIconL( iPhoneIcon, + iPhoneIconMask, + resname, + EMbmCameraappQgn_indi_cam4_memory_phone, + EMbmCameraappQgn_indi_cam4_memory_phone_mask ); + AknIconUtils::SetSize( iPhoneIcon, size ); + + AknIconUtils::CreateIconL( iMMCIcon, + iMMCIconMask, + resname, + EMbmCameraappQgn_indi_cam4_memory_mmc, + EMbmCameraappQgn_indi_cam4_memory_mmc_mask ); + AknIconUtils::SetSize( iMMCIcon, size ); + + AknIconUtils::CreateIconL( iMassStorageIcon, + iMassStorageIconMask, + resname, + EMbmCameraappQgn_indi_cam4_memory_mass, + EMbmCameraappQgn_indi_cam4_memory_mass_mask ); + + + AknIconUtils::SetSize( iMassStorageIcon, size ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMNAVIPROGRESSBARMODEL_LOADRESOURCEDATAL, "e_CCamNaviProgressBarModel_LoadResourceDataL 0" ); + } + +// ----------------------------------------------------------------------------- +// CCamNaviProgressBarModel::UnloadResourceData() +// Frees all dynamic resources allocated in LoadResourceDataL +// ----------------------------------------------------------------------------- +// +void CCamNaviProgressBarModel::UnloadResourceData() + { + delete iDecorator; + iDecorator = NULL; + + delete iPhoneIcon; + iPhoneIcon = NULL; + delete iPhoneIconMask; + iPhoneIconMask = NULL; + delete iMMCIcon; + iMMCIcon = NULL; + delete iMMCIconMask; + iMMCIconMask = NULL; + delete iMassStorageIcon; + iMassStorageIcon = NULL; + delete iMassStorageIconMask; + iMassStorageIconMask = NULL; + delete iProgressBarBitmap; + iProgressBarBitmap = NULL; + delete iProgressBarMask; + iProgressBarMask = NULL; + delete iProgressBarFrame; + iProgressBarFrame = NULL; + } + +// ----------------------------------------------------------------------------- +// CCamNaviProgressBarModel::ReloadResourceDataL() +// Refreshes all resource-based information stored in the class +// ----------------------------------------------------------------------------- +// +void CCamNaviProgressBarModel::ReloadResourceDataL() + { + UnloadResourceData(); + LoadResourceDataL(); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::DrawProgBar +// Draw the control +// --------------------------------------------------------- +// +void +CCamNaviProgressBarModel::DrawProgBar( CBitmapContext& aGc, + const CCoeControl* /*aControl*/ ) const + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + iDecorator->Draw( aGc, iExtent ); + + CFbsBitmap* icon = NULL; + CFbsBitmap* mask = NULL; + if ( iStorageLocation == ECamMediaStoragePhone ) + { + icon = iPhoneIcon; + mask = iPhoneIconMask; + } + else if ( iStorageLocation == ECamMediaStorageMassStorage ) + { + icon = iMassStorageIcon; + mask = iMassStorageIconMask; + } + else + { + icon = iMMCIcon; + mask = iMMCIconMask; + } + + DrawElapsedTimeText( aGc ); + DrawRemainingTimeText( aGc, skin ); + if ( CamUtility::IsNhdDevice() ) + { + aGc.BitBltMasked( iProgressIconRect.Rect().iTl, + icon, icon->SizeInPixels(), mask, ETrue ); + } + else + { + aGc.BitBltMasked( iVidStorageIconRect.Rect().iTl, + icon, icon->SizeInPixels(), mask, ETrue ); + } + + DrawProgressBar( aGc ); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::HandleControllerEventL +// Handle an event from CCamAppController. +// --------------------------------------------------------- +// +void CCamNaviProgressBarModel::HandleControllerEventL( + TCamControllerEvent aEvent, TInt /* aError */ ) + { + PRINT( _L("Camera => CCamNaviProgressBarModel::HandleControllerEventL")) + + switch( aEvent ) + { + // --------------------------------------------------- + /* Get it from CCameraController now. + // if this is a record counter update event + case ECamEventCounterUpdated: + { + PRINT( _L("Camera => CCamNaviProgressBarModel::HandleControllerEventL update")) + iRecordTimeElapsed = iController.RecordTimeElapsed(); + iRecordTimeRemaining = iController.RecordTimeRemaining(); + FormatTimeL(); + BroadcastEvent( ECamObserverEventNaviModelUpdated ); + + // See if we need to start blinking the elapsed time + TTime time( iRecordTimeElapsed.Int64() ); + TDateTime recordTime = time.DateTime(); + + if ( recordTime.Minute() != 0 && + recordTime.Second() == 0 && + !iFlashingTimer->IsActive() ) + { + iFlashingTimer->Start( KFlashInterval, + KFlashInterval, + TCallBack( FlashCallBack, this ) ); + } + break; + } + */ + // --------------------------------------------------- + case ECamEventEngineStateChanged: + { +// +// if ( iController.EngineState() == ECamEngineVideoCapturePrepared ) + if ( ECamCameraPreparedVideo == iController.CameraState() ) + { + iRecordTimeRemaining = iController.RecordTimeRemaining(); + FormatTimeL(); + BroadcastEvent( ECamObserverEventNaviModelUpdated ); + } + else + { + // empty statement to remove Lint error + } + break; + } + // --------------------------------------------------- + case ECamEventOperationStateChanged: + { + if ( ECamControllerVideo == iController.CurrentMode() + && ECamCapturing == iController.CurrentOperation() ) + { + // get the current media storage + iStorageLocation = static_cast< TCamMediaStorage > + ( iController.IntegerSettingValue( ECamSettingItemVideoMediaStorage ) ); + } + else + { + // empty statement to remove Lint error + } + break; + } + // --------------------------------------------------- + case ECamEventRecordComplete: + { + // reset elapsed recording time + iController.RecordTimeElapsed( iRecordTimeElapsed ); + iRecordTimeElapsed = static_cast(0); + iFlashingTimer->Cancel(); + iFlash = EFalse; + break; + } + // --------------------------------------------------- + default: + { + break; + } + // --------------------------------------------------- + } + PRINT( _L("Camera <= CCamNaviProgressBarModel::HandleControllerEventL")) + } + +// ----------------------------------------------------------------------------- +// HandleCameraEventL +// +// ----------------------------------------------------------------------------- +// +void +CCamNaviProgressBarModel +::HandleCameraEventL( TInt /*aStatus*/, + TCamCameraEventId aEventId, + TAny* aEventData /*= NULL*/ ) + { + PRINT( _L("Camera => CCamNaviProgressBarModel::HandleCameraEventL") ); + switch( aEventId ) + { + // --------------------------------------------------- + case ECamCameraEventVideoTimes: + { + TCamVideoRecordingTimes* times = + static_cast( aEventData ); + if( times ) + { + iRecordTimeElapsed = times->iTimeElapsed; + iRecordTimeRemaining = times->iTimeRemaining; + + // If the time we have is greater than the maximum allowed, return the + // maximum + TTimeIntervalMicroSeconds maxRecordingLength( static_cast(KMaxRecordingLength) ); + + if( iRecordTimeRemaining > maxRecordingLength ) + { + iRecordTimeRemaining = maxRecordingLength; + } + + FormatTimeL(); + BroadcastEvent( ECamObserverEventNaviModelUpdated ); + + // See if we need to start blinking the elapsed time + TTime time( iRecordTimeElapsed.Int64() ); + TDateTime recordTime = time.DateTime(); + + if ( recordTime.Minute() != 0 + && recordTime.Second() == 0 + && !iFlashingTimer->IsActive() ) + { + iFlashingTimer->Start( KFlashInterval, + KFlashInterval, + TCallBack( FlashCallBack, this ) ); + } + } + break; + } + // --------------------------------------------------- + default: + break; + // --------------------------------------------------- + } + PRINT( _L("Camera <= CCamNaviProgressBarModel::HandleCameraEventL") ); + } + + +// ----------------------------------------------------------------------------- +// CCamNaviProgressBarModel::FormatTimeL +// Formats the elapsed/remaining record time +// ----------------------------------------------------------------------------- +// +void CCamNaviProgressBarModel::FormatTimeL() + { + TTime time( iRecordTimeElapsed.Int64() ); + time.FormatL( iElapsedTimeText, *iTimeFormat ); + + time = iRecordTimeRemaining.Int64(); + time.FormatL( iRemainingTimeText, *iTimeFormat ); + + if ( iElapsedTimeTextItem ) + { + iElapsedTimeTextItem->SetTextL( iElapsedTimeText ); + } + + if ( iRemainingTimeTextItem ) + { + iRemainingTimeTextItem->SetTextL( iRemainingTimeText ); + } + } + +// ----------------------------------------------------------------------------- +// CCamNaviProgressBarModel::DrawElapsedTimeText +// Draws the elapsed record time to the navi pane +// ----------------------------------------------------------------------------- +// +void +CCamNaviProgressBarModel::DrawElapsedTimeText( CBitmapContext& aGc ) const + { + if ( !iFlash && iElapsedTimeTextItem ) + { + iElapsedTimeTextItem->Draw( aGc ); + } + } + +// ----------------------------------------------------------------------------- +// CCamNaviProgressBarModel::DrawRemainingTimeText +// Draws the remaining record time to the navi pane +// ----------------------------------------------------------------------------- +// +void +CCamNaviProgressBarModel::DrawRemainingTimeText( CBitmapContext& aGc, + MAknsSkinInstance* /*aSkin*/ ) const + { + if ( iRemainingTimeTextItem ) + { + iRemainingTimeTextItem->Draw( aGc ); + } + } + +// ----------------------------------------------------------------------------- +// CCamNaviProgressBarModel::DrawProgressBar +// Draws the progress bar to the navi pane +// ----------------------------------------------------------------------------- +// +void +CCamNaviProgressBarModel::DrawProgressBar( CBitmapContext& aGc ) const + { + PRINT( _L("Camera => CCamNaviProgressBarModel::DrawProgressBar")) + + // Draw frame + TRect rect = iProgressBarRect.Rect(); + + aGc.BitBlt( rect.iTl, iProgressBarFrame ); + + // Draw the progress bar + + // Define the area of bitmap that is to be drawn + TRect srcRect( 0, 0, 0, iProgressBarBitmap->SizeInPixels().iHeight ); + TInt newWidth = rect.Width(); + + // If remaining record time is zero, do not try to perform the percentage + // calculation, the progress bar will be full + if ( iRecordTimeRemaining.Int64() > 0 ) + { + newWidth = static_cast(( iRecordTimeElapsed.Int64() * rect.Width() ) + / ( iRecordTimeElapsed.Int64() + iRecordTimeRemaining.Int64() )); + } + else + { + // empty statement to remove Lint error. + } + + srcRect.SetWidth( newWidth ); + + aGc.BitBltMasked( rect.iTl, iProgressBarBitmap, srcRect, iProgressBarMask, ETrue ); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::SetExtentL +// Sets the extent +// --------------------------------------------------------- +// +void CCamNaviProgressBarModel::SetExtentL( const TRect& aExtent ) + { + iExtent = aExtent; + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::RegisterObserverL +// Registers an observer +// --------------------------------------------------------- +// +void CCamNaviProgressBarModel::RegisterObserverL(MCamObserver* aObserver) + { + iObserverHandler->RegisterObserverL(aObserver); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::DeregisterObserver +// Deregisters an observer +// --------------------------------------------------------- +// +void CCamNaviProgressBarModel::DeregisterObserver(MCamObserver* aObserver) + { + iObserverHandler->DeregisterObserver(aObserver); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::BroadcastEvent +// Broadcasts an event to all observers +// --------------------------------------------------------- +// +void CCamNaviProgressBarModel::BroadcastEvent(TCamObserverEvent aEvent) + { + iObserverHandler->BroadcastEvent(aEvent); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::HandleObservedEvent +// Handles observed events +// --------------------------------------------------------- +// +void CCamNaviProgressBarModel::HandleObservedEvent(TCamObserverEvent aEvent) + { + if( aEvent == ECamObserverEventRecordingIconUpdated ) + { + BroadcastEvent(ECamObserverEventNaviModelUpdated); + } + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::DoCancel +// Called when the flashing timer elapses +// --------------------------------------------------------- +// +TInt CCamNaviProgressBarModel::FlashCallBack( TAny* aAny ) + { + CCamNaviProgressBarModel* self = static_cast( aAny ); + TTime time( self->iRecordTimeElapsed.Int64() ); + TDateTime recordTime = time.DateTime(); + if ( recordTime.Second() != 0 ) + { + self->iFlashingTimer->Cancel(); + self->iFlash = EFalse; + } + else + { + self->iFlash = !self->iFlash; + self->BroadcastEvent( ECamObserverEventNaviModelUpdated ); + } + return KErrNone; + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::TouchLayoutL +// --------------------------------------------------------- +void CCamNaviProgressBarModel::TouchLayoutL() + { + TInt variant = 0; // portrait + TInt iconVariant = 1; + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + variant = 1; // landscape + iconVariant = 0; + } + + TAknLayoutRect progressPaneLayout; + progressPaneLayout.LayoutRect( iExtent, + AknLayoutScalable_Apps::vid4_progress_pane( variant ) ); + + TRect progressPaneRect = progressPaneLayout.Rect(); + iElapsedTimeTextItem->SetLayoutL( progressPaneRect, + AknLayoutScalable_Apps::vid4_progress_pane_t1( iconVariant ) ); + iRemainingTimeTextItem->SetLayoutL( progressPaneRect, + AknLayoutScalable_Apps::vid4_progress_pane_t2( iconVariant ) ); + iProgressIconRect.LayoutRect( progressPaneRect, + AknLayoutScalable_Apps::vid4_progress_pane_g4( iconVariant ) ); + + // Progress bar + iProgressBarRect.LayoutRect( progressPaneRect, + AknLayoutScalable_Apps::wait_bar_pane_cp07( iconVariant ) ); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::NonTouchLayoutL +// Read nontouch layout for primary camera +// --------------------------------------------------------- +void CCamNaviProgressBarModel::NonTouchLayoutL() + { + TInt variant = 0; // Magic: layout Opt1 + + TInt cba = 1; // Magic: layout Opt1 + + TAknLayoutRect progressPaneLayout; + + progressPaneLayout.LayoutRect( iExtent, + AknLayoutScalable_Apps::vid6_indi_pane( variant ) ); + TRect progressPaneRect = progressPaneLayout.Rect(); + + iVidStorageIconRect.LayoutRect( progressPaneRect, + AknLayoutScalable_Apps::vid6_indi_pane_g3( cba ) ); + iElapsedTimeTextItem->SetLayoutL( progressPaneRect, + AknLayoutScalable_Apps::vid6_indi_pane_t2( cba ) ); + iRemainingTimeTextItem->SetLayoutL( progressPaneRect, + AknLayoutScalable_Apps::vid6_indi_pane_t3( cba ) ); + iProgressIconRect.LayoutRect( progressPaneRect, + AknLayoutScalable_Apps::wait_bar_pane_cp08( 0 ) ); + + // Progress bar + iProgressBarRect.LayoutRect( progressPaneRect, + AknLayoutScalable_Apps::wait_bar_pane_cp08( 0 ) ); + } + +// --------------------------------------------------------- +// CCamNaviProgressBarModel::NonTouchLayoutSecondaryL +// Read nontouch layout for secondary camera +// --------------------------------------------------------- +void CCamNaviProgressBarModel::NonTouchLayoutSecondaryL() + { + TRect screenRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); + iExtent = screenRect; + // Magic numbers used for layout variation + TAknLayoutRect progressPaneLayout; + progressPaneLayout.LayoutRect( iExtent, + AknLayoutScalable_Apps::vid6_indi_pane( 3 ) ); + + iVidStorageIconRect.LayoutRect( progressPaneLayout.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g3( 3 ) ); + + TRect progressPaneRect = progressPaneLayout.Rect(); + iElapsedTimeTextItem->SetLayoutL( progressPaneRect, + AknLayoutScalable_Apps::vid6_indi_pane_t2( 2 ) ); + iRemainingTimeTextItem->SetLayoutL( progressPaneRect, + AknLayoutScalable_Apps::vid6_indi_pane_t3( 2 ) ); + iProgressIconRect.LayoutRect( progressPaneRect, + AknLayoutScalable_Apps::wait_bar_pane_cp08( 1 ) ); + + // Progress bar + iProgressBarRect.LayoutRect( progressPaneRect, + AknLayoutScalable_Apps::wait_bar_pane_cp08( 1 ) ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamNewFileService.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamNewFileService.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for file server service. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +* +*/ + + +// INCLUDE FILES +#include "CamNewFileService.h" +#include "CNewFileServiceBase.h" + +#include "CamSettingsModel.h" +#include +#include +#include +#include +#include + +#include "CamAppUi.h" + +#include "CamUtility.h" +#include "CamAppController.h" + +// FORWARD DECLARATIONS + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CCamNewFileService::NewL +// Constructor +// --------------------------------------------------------------------------- +// +CCamNewFileService* CCamNewFileService::NewL() + { + return new( ELeave ) CCamNewFileService; + } + +// --------------------------------------------------------------------------- +// CCamNewFileService::~CCamNewFileService +// Destructor +// --------------------------------------------------------------------------- +// +CCamNewFileService::~CCamNewFileService() + { + PRINT( _L("Camera => ~CCamNewFileService") ); + if ( !iCompleted && iObserver ) + { + TRAP_IGNORE( iObserver->HandleCompletedNewServiceL( EFalse ) ); + } + PRINT( _L("Camera <= ~CCamNewFileService") ); + } + +// --------------------------------------------------------------------------- +// CCamNewFileService::HandleNewFileL +// Receive message from service to record new files +// --------------------------------------------------------------------------- +// +void CCamNewFileService::HandleNewFileL( MNewFileServiceObserver* /*aObserver*/, + RFile& /*aFile*/, + TNewServiceFileType /*aType*/ ) + { + + + } + +// --------------------------------------------------------------------------- +// CCamNewFileService::HandleNewFileL +// Receive message from service to record new files +// --------------------------------------------------------------------------- +// +void CCamNewFileService::HandleNewFileL( MNewFileServiceObserver* aObserver, + CDesCArray& aFilenameArray, + TNewServiceFileType aType, + TBool /*aMultipleFiles*/ ) + { + PRINT( _L("Camera: CCamNewFileService::HandleNewFileL()") ); + + iCompleted = EFalse; + + if( aType != ENewFileServiceImage && aType != ENewFileServiceVideo ) + { + aObserver->HandleCompletedNewServiceL( EFalse ); + return; + } + + iObserver = aObserver; + + + TInt mode = KErrNone; + + switch ( aType ) + { + case ENewFileServiceImage: + mode = ECamControllerImage; + break; + case ENewFileServiceVideo: + mode = ECamControllerVideo; + break; + default: + break; + } + + iCamFilenameArray = &aFilenameArray; + + CAiwGenericParamList* ParamList = GenericParams(); + TInt resolutionsAvailable = ParamList->Count(EGenericParamResolution); + // set the default requested resolution as 0*0, which is later on + // interpreted as the default embedded quality. + TSize requestedResolution(0,0); + if ( resolutionsAvailable > 0 ) + { + TInt index = 0; + const TAiwGenericParam* firstReso = ParamList->FindFirst( index, EGenericParamResolution ); + if ( KErrNotFound != index ) + { + TPtrC8 resData = firstReso->Value().AsData();//&firstReso->Value().AsData(); + TBuf8 bufRes; + if ( resData.Length() > sizeof(TSize) ) User::Leave( KErrArgument ); + bufRes.Copy(resData); + TDes8& rText = bufRes; + TPckgBuf* ptr = + static_cast*>( &rText ); + if( !ptr ) User::Leave( KErrNotSupported ); + TSize& params( (*ptr)() ); + requestedResolution.SetSize( params.iWidth, params.iHeight ); + PRINT2( _L("Camera: CCamNewFileService::HandleNewFileL() - Requested resolution: %d * %d"), requestedResolution.iWidth, requestedResolution.iHeight ); + } + } + + CCamAppUi * appUi = + static_cast< CCamAppUi* >( CEikonEnv::Static()->EikAppUi() ); + appUi->SetRequestedNewFileResolution(requestedResolution); + appUi->StartAsServerAppL( this, mode ); + } + +// --------------------------------------------------------------------------- +// CCamNewFileService::ServiceCompleteL +// Receive message from service that file service has completed +// and can be closed +// --------------------------------------------------------------------------- +// +void CCamNewFileService::ServiceCompleteL() + { + PRINT( _L("Camcorder: CCamNewFileService::ServiceCompleteL()") ); + iCompleted = ETrue; + + CEikonEnv::Static()->EikAppUi()->HandleCommandL( EEikCmdExit ); + } + +// --------------------------------------------------------------------------- +// CCamNewFileService::FileCompleteL +// Receive command from application that file named aName has been captured. +// (image or video) +// --------------------------------------------------------------------------- +// +void +CCamNewFileService::FileCompleteL( const TDesC& aName ) + { + PRINT( _L("Camcorder: CCamNewFileService::FileCompleteL()") ); + if( iCamFilenameArray != NULL ) + { + iCamFilenameArray->AppendL( aName ); + } + + iCompleted = ETrue; + iObserver->HandleCompletedNewServiceL( ETrue ); + + + } +// --------------------------------------------------------------------------- +// CCamNewFileService::AbortL +// Receive command from application that file service must be aborted +// --------------------------------------------------------------------------- +// +void CCamNewFileService::AbortL() + { + PRINT( _L("Camcorder => CCamNewFileService::AbortL()") ); + if( !iCompleted ) + { + iCompleted = ETrue; + iObserver->HandleCompletedNewServiceL( EFalse ); + } + PRINT( _L("Camcorder <= CCamNewFileService::AbortL()") ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamObserverHandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamObserverHandler.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Generic handler to be used by Observables +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + + +// INCLUDE FILES +#include "CamObservable.h" +#include "CamObserver.h" +#include "CamObserverHandler.h" +#include "camlogging.h" + +// --------------------------------------------------------- +// CCamObserverHandler::CCamObserverHandler +// C++ constructor +// --------------------------------------------------------- +// +CCamObserverHandler::CCamObserverHandler() + { + } + +// --------------------------------------------------------- +// CCamObserverHandler::~CCamObserverHandler +// C++ Destructor +// --------------------------------------------------------- +// +CCamObserverHandler::~CCamObserverHandler() + { + PRINT( _L("Camera => ~CCamObserverHandler") ); + iObservers.Reset(); + PRINT( _L("Camera <= ~CCamObserverHandler") ); + } + +// --------------------------------------------------------- +// CCamObserverHandler::NewL +// Symbian 2-phase constructor +// --------------------------------------------------------- +// +CCamObserverHandler* CCamObserverHandler::NewL() + { + CCamObserverHandler* self = new( ELeave ) CCamObserverHandler(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CCamObserverHandler::ConstructL +// Second phase constructor +// --------------------------------------------------------- +// +void CCamObserverHandler::ConstructL() + { + } + +// --------------------------------------------------------- +// CCamObserverHandler::RegisterObserverL +// Registers observer if not previously registered +// --------------------------------------------------------- +// +void CCamObserverHandler::RegisterObserverL(MCamObserver* aObserver) + { + if ( aObserver ) + { + if ( KErrNotFound == iObservers.Find( aObserver )) + { + User::LeaveIfError(iObservers.Append(aObserver)); + } + } + } + +// --------------------------------------------------------- +// CCamObserverHandler::DeregisterObserver +// Removes observer +// --------------------------------------------------------- +// +void CCamObserverHandler::DeregisterObserver(MCamObserver* aObserver) + { + if ( aObserver ) + { + TInt index = iObservers.Find( aObserver ); + if ( KErrNotFound != index ) + { + iObservers.Remove(index); + } + } + } + +// --------------------------------------------------------- +// CCamObserverHandler::BroadcastEvent +// Broadcasts an event code to all observers +// --------------------------------------------------------- +// +void CCamObserverHandler::BroadcastEvent( TCamObserverEvent aEvent ) + { + TInt count = iObservers.Count(); + TInt i; + for ( i = 0; i < count; i++ ) + { + // Checked to be non-NULL when added to array. + iObservers[i]->HandleObservedEvent( aEvent ); + } + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamPerformanceLogger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamPerformanceLogger.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,477 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for managing intercommunication between Camera UI* +*/ + + +// INCLUDE FILES + +#include +#include // TTime +#include +#include // RFileWriteStream + +#include "CamPerformance.h" +#include "CamAppUid.h" // KCameraappUID + +#ifdef CAMERAAPP_PERF_LOG_MEMORY +// This file needs only be compiled if logging to memory is enabled + +// INTERNAL CONSTANTS, ENUMS AND STRUCTS + +// Constants related to logging in memory +const TInt KPerfLogArrayGranularity = 20; +const TInt KPerfMaxLogItemStringLength = 160; + +// Constants for converting 64-bit system time to milliseconds +// and seconds +const TInt KDividerSystemToMilliseconds = 1000; +const TInt KDividerMillisecondsToSeconds = 1000; + +// Constants for formatting memory log to text +_LIT( KPerfLogItemTab, "\t" ); +_LIT8( KPerfLogItemCrLf8, "\n" ); +_LIT( KPerfLogItemSecondsFormatSpace, "%6d.%03d" ); +_LIT( KPerfLogItemSecondsFormat, "%d.%03d" ); + +// Constants for writing event analysis log +_LIT( KAnalysisEventType, "Event: %d" ); +_LIT( KAnalysisEventStartTime, ", start time: " ); +_LIT( KAnalysisEventEndTime, ", end time: " ); +_LIT( KAnalysisEventDuration, ", duration: " ); +_LIT( KAnalysisEventAlreadyStarted, "Start for event %d, which has already been started, time: " ); +_LIT( KAnalysisEndWithoutStart, "End for event %d without start, time: " ); +_LIT( KAnalysisStartWithoutEnd, "Start for event %d without end, time: " ); + +_LIT( KCamPerformanceLogger, "CamPerformanceLogger" ); + +/** +* Memory log item types +*/ +enum TItemType + { + EItemEventStart, + EItemEventEnd, + EItemMessage, + EItemEngineStateChange, + EItemOperationStateChange + }; + +/** +* TLogitem struct definition. Used for storing log items in memory +* in an array. +*/ +struct TLogItem + { + public: + TLogItem( TItemType aItemType, TInt aIntValue, TInt64 aTime ): + iItemType( aItemType ), iIntValue( aIntValue), iTime( aTime ) {} + + TItemType iItemType; + TInt iIntValue; + TInt64 iTime; + }; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamPerformanceLogger::CCamPerformanceLogger +// C++ default constructor can NOT contain any code, that +// might leave +// ----------------------------------------------------------------------------- +// +CCamPerformanceLogger::CCamPerformanceLogger() : + CCoeStatic( TUid::Uid( KCameraappUID ) ), iLogItems( KPerfLogArrayGranularity ) + { + iStartTime = Time64(); + } + +// ----------------------------------------------------------------------------- +// CCamPerformanceLogger::~CCamPerformanceLogger +// Destructor +// ----------------------------------------------------------------------------- +// +CCamPerformanceLogger::~CCamPerformanceLogger() + { + PRINT( _L("Camera => ~CCamPerformanceLogger") ); + if( iLogItems.Count() > 0 ) + { + // Write files only if there are new log items + // This is to avoid overwriting log already written using SaveAndReset() + TRAP_IGNORE( SaveLogDataL() ); + TRAP_IGNORE( SaveAnalysisL() ); + } + iLogItems.Close(); + PRINT( _L("Camera <= ~CCamPerformanceLogger") ); + } + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::Logger +// Static function, which returns a pointer to the currently active +// CCamPerformanceLogger object or instantiates a new one +// --------------------------------------------------------------------------- +// +CCamPerformanceLogger* CCamPerformanceLogger::Logger() + { + // Get pointer to the current CCamPerformanceLogger object using CCoeEnv.FindStatic() + CCamPerformanceLogger* self = static_cast( CCoeEnv::Static()->FindStatic( TUid::Uid( KCameraappUID ) ) ); + if( self ) + { + return self; + } + else + { + // FindStatic returned null, create a new instance + self = new CCamPerformanceLogger(); + if( !self ) + { + // Not enough memory to instantiate CCamPerfomranceLogger + User::Panic( KCamPerformanceLogger, KErrNoMemory ); + } + return self; + } + } + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::SaveAndReset +// Static function, which saves the recoded log data and clears the log +// --------------------------------------------------------------------------- +// +void CCamPerformanceLogger::SaveAndReset() + { + // Get pointer to the current CCamPerformanceLogger object using CCoeEnv.FindStatic() + CCamPerformanceLogger* self = static_cast( CCoeEnv::Static()->FindStatic( TUid::Uid( KCameraappUID ) ) ); + + if( self && self->iLogItems.Count() > 0 ) + { + TRAP_IGNORE( self->SaveLogDataL() ); + TRAP_IGNORE( self->SaveAnalysisL() ); + + // Clear the logitems array + self->iLogItems.Reset(); + } + } + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::EventStart +// Appends an event start item to the memory log +// --------------------------------------------------------------------------- +// +void CCamPerformanceLogger::EventStart( TCamEvent aEvent ) + { + TLogItem item( EItemEventStart, aEvent, Time64() - iStartTime ); + iLogItems.Append( item ); // Ignore return value + } + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::EventEnd +// Appends an event end item to the memory log +// --------------------------------------------------------------------------- +// +void CCamPerformanceLogger::EventEnd( TCamEvent aEvent ) + { + TLogItem item( EItemEventEnd, aEvent, Time64() - iStartTime ); + iLogItems.Append( item ); // Ignore return value + } + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::Message +// Appends a message to the memory log +// --------------------------------------------------------------------------- +// +void CCamPerformanceLogger::Message( TCamMessage aMessage ) + { + TLogItem item( EItemMessage, aMessage, Time64() - iStartTime ); + iLogItems.Append( item ); // Ignore return value + } + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::EngineState +// Appends an engine state change to the memory log +// --------------------------------------------------------------------------- +// +void CCamPerformanceLogger::EngineState( TInt aState ) + { + TLogItem item( EItemEngineStateChange, aState, Time64() - iStartTime ); + iLogItems.Append( item ); // Ignore return value + } + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::OperationState +// Appends an operation state change to the memory log +// --------------------------------------------------------------------------- +// +void CCamPerformanceLogger::OperationState( TInt aState ) + { + TLogItem item( EItemOperationStateChange, aState, Time64() - iStartTime ); + iLogItems.Append( item ); // Ignore return value + } + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::LogItemToDes +// Converts log item data into LogicAnalyzer compatible string, and stores +// it in aDes +// --------------------------------------------------------------------------- +// +void CCamPerformanceLogger::LogItemToDes( const TLogItem& aItem, TDes& aDes ) + { + // Clear the descriptor contents + aDes.Zero(); + + // Append time of the log item and space + TInt64 time = aItem.iTime; + AppendTime( aDes, time, ETrue ); + aDes.Append( KPerfLogItemTab ); + + // Append item type specific formatted string + switch( aItem.iItemType ) + { + case EItemEventStart: + { + aDes.AppendFormat( KPerfEventStart, aItem.iIntValue ); + } + break; + case EItemEventEnd: + { + aDes.AppendFormat( KPerfEventEnd, aItem.iIntValue ); + } + break; + case EItemMessage: + { + aDes.AppendFormat( KPerfMessage, aItem.iIntValue ); + } + break; + case EItemEngineStateChange: + { + aDes.AppendFormat( KPerfEngineStateChange, aItem.iIntValue ); + } + break; + case EItemOperationStateChange: + { + aDes.AppendFormat( KPerfOperationStateChange, aItem.iIntValue ); + } + break; + default: + { + aDes.AppendFormat( KPerfUnknown, aItem.iIntValue ); + } + break; + } + } + + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::AppendTime +// Appends time represendted by aTime to aDes with format seconds.milliseconds +// --------------------------------------------------------------------------- +// +void CCamPerformanceLogger::AppendTime( TDes& aDes, TInt64 aTime, TBool aSpace ) + { + // Convert system time to milliseconds + TInt64 timeInMillis = aTime / KDividerSystemToMilliseconds; + + // Get seconds and remainder (milliseconds) + TInt seconds = timeInMillis / KDividerMillisecondsToSeconds; + TInt milliseconds = timeInMillis % KDividerMillisecondsToSeconds; + + // Append seconds to the log item, with or without trailing space + if( aSpace ) + { + aDes.AppendFormat( KPerfLogItemSecondsFormatSpace, seconds, milliseconds ); + } + else + { + aDes.AppendFormat( KPerfLogItemSecondsFormat, seconds, milliseconds ); + } + } + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::SaveLogDataL +// Saves all data from memory log to file KPerfLogFilename +// --------------------------------------------------------------------------- +// +void CCamPerformanceLogger::SaveLogDataL() const + { + TBuf itemDes; + + // Connect to file server and create the output stream + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + RFileWriteStream writeStream; + User::LeaveIfError( writeStream.Replace( fs, KPerfLogFilename, EFileWrite ) ); + writeStream.PushL(); + + // Convert each item to Des8 and write to the stream + TInt n = iLogItems.Count(); + for( int i=0; i itemDes; + + TBool eventStatus[ EPerfEventLastEvent ]; + TInt64 startTimes[ EPerfEventLastEvent ]; + + for( int i=0; i des8; + des8.Copy( aDes ); + aStream.WriteL( des8 ); + aStream.WriteL( KPerfLogItemCrLf8 ); + } + +// --------------------------------------------------------------------------- +// CCamPerformanceLogger::Time64 +// Returns system 64-bit representation of the current time +// --------------------------------------------------------------------------- +// +TInt64 CCamPerformanceLogger::Time64() + { + TTime time; + time.HomeTime(); + return time.Int64(); + } + +#endif // CAMERAAPP_PERF_LOG_MEMORY + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamPostCaptureContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamPostCaptureContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,640 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container class for still image and video post-capture views* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CamPanic.h" +#include "CamAppUi.h" +#include "CamPostCaptureContainer.h" +#include "CamAppController.h" +#include "CamLogger.h" +#include "CamUtility.h" +#include "CamNaviCounterControl.h" +#include "CamNaviProgressBarControl.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamPostCaptureContainerTraces.h" +#endif + + + +// CONSTANTS + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamPostCaptureContainer::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamPostCaptureContainer* CCamPostCaptureContainer::NewL( + CCamAppController& aController, + CAknView& aView, + const TRect& aRect ) + { + CCamPostCaptureContainer* self = new( ELeave ) CCamPostCaptureContainer( + aController, aView ); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + CleanupStack::Pop( self ); + // return newly created CCamPostCaptureContainer instance + return self; + } + +// Destructor +CCamPostCaptureContainer::~CCamPostCaptureContainer() + { + PRINT( _L("Camera => ~CCamPostCaptureContainer" )) + + iController.RemoveControllerObserver( this ); + delete iBatteryPaneController; + PRINT( _L("Camera <= ~CCamPostCaptureContainer" )) + } + +// --------------------------------------------------------- +// CCamPostCaptureContainer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamPostCaptureContainer::ConstructL( const TRect& aRect ) + { + CCamContainerBase::BaseConstructL( aRect ); + iController.AddControllerObserverL( this ); + + AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, iScreenSize ); + CCamAppUi* appUi = static_cast(CEikonEnv::Static()->AppUi()); + // Do not construct battery pane controller, if secondary camera is in use + if ( iController.ActiveCamera() != ECamActiveCameraSecondary || + appUi->IsQwerty2ndCamera() ) + { + iBatteryPaneController = CCamBatteryPaneController::NewL( *this, ETrue); + } + + if( ECamControllerImage == iController.CurrentMode() ) + { + // Still mode - processing text needed + PrepareProcessingTextL( ETrue ); + } + + // Make sure fixed toolbar is on top of this window + DrawableWindow()->SetOrdinalPosition( KCamPostCaptureWindowOrdinalPos ); + } + +// --------------------------------------------------------------------------- +// CCamPostCaptureContainer::CCamPostCaptureContainer +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamPostCaptureContainer::CCamPostCaptureContainer( + CCamAppController& aController, + CAknView& aView ) +: CCamContainerBase( aController, aView ), + iCheckForFileNameChange( EFalse ) + { + } + +// --------------------------------------------------------- +// CCamViewFinderContainer::CountComponentControls +// Returns the number of controls owned +// --------------------------------------------------------- +// +TInt CCamPostCaptureContainer::CountComponentControls() const + { + TInt count = 0; + if( ( iPaneInUse == ECamPaneCounter ) || ( iPaneInUse == ECamPaneProgress ) ) + { + count++; + } + + if ( !iController.IsTouchScreenSupported() ) + { + if(iActivePalette && iActivePalette->CoeControl()->IsVisible()) + { + count++; //Active Palette + } + } + + return count; + } + +// ----------------------------------------------------------------------------- +// CCamPostCaptureContainer::ComponentControl +// Return specified control owned by this control +// ----------------------------------------------------------------------------- +// +CCoeControl* CCamPostCaptureContainer::ComponentControl( TInt aIndex ) const + { + CCoeControl* con = NULL; + switch( aIndex ) + { + case ECamPostCaptureSubControlNaviPane: + { + switch( iPaneInUse ) + { + case ECamPaneCounter: + { + con = iNaviCounterControl; + break; + } + case ECamPaneProgress: + { + con = iNaviCounterControl; + break; + } + case ECamPaneUndefined: + { + break; + } + } + break; + } + case ECamPostCaptureActivePalette: + { + if(iActivePalette && iActivePalette->CoeControl()->IsVisible()) + { + con = iActivePalette->CoeControl(); + } + break; + } + + default: + break; + } + return con; + + } + +// --------------------------------------------------------- +// CCamPostCaptureContainer::Draw +// Draw control +// --------------------------------------------------------- +// +void CCamPostCaptureContainer::Draw( const TRect& /*aRect*/ ) const + { + CCamAppUi* appUi = static_cast(CEikonEnv::Static()->AppUi()); + + if ( appUi && appUi->Embedding() && !appUi->ReadyToDraw() && + iController.ActiveCamera() == ECamActiveCameraPrimary ) + { + // Flickering can be reduced if view is not drawn due to 'wrong' + // orientation change. False redraw events may come if device + // orientation is changed - even if camera app is in the background. + // + // Primary camera does not support other than landscape mode, thus we + // must always return to it when embedded application is closed. + return; + } + + if ( appUi && iCheckForFileNameChange ) + { + // whenever we come back from Properties view + // we check if the file name has changed already + appUi->StartFileNameCheck(); + } + // Draw the current image - snapshot or thumbnail + CWindowGc& gc = SystemGc(); + gc.SetFaded( EFalse ); + + gc.SetBrushColor( KRgbBlack ); + gc.Clear(); + + const CFbsBitmap* snapshot = iController.SnapshotImage(); + TRect containerRect = Rect(); + + // If snapshot contains a bitmap + if ( snapshot ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMPOSTCAPTURECONTAINER_DRAW, "e_CAM_APP_SNAPSHOT_DRAW 1" ); //CCORAPP_SNAPSHOT_DRAW_START + + TSize snapshotSize = snapshot->SizeInPixels(); + TRect bmCropRect( snapshotSize ); + + // Get the required snapshot layout rect + TRect vfRect( ViewFinderFrameRect() ); + + + // Standard CIF size snapshot, this could be either a video or + // still image snapshot. Get the size to display and + // crop the bitmap if necessary. + + if ( iView.Id().iUid == ECamViewIdVideoPostCapture ) + { + // This is a video snapshot - work out if it needs cropping + + TInt res = iController.GetCurrentVideoResolution(); + + if ( res != ECamVideoResolutionNHD ) + { + // Work out the rectangle of the viewfinder bitmap to draw + TInt borderX = ( snapshotSize.iWidth - vfRect.Width() ) / 2; + TInt borderY = ( snapshotSize.iHeight - vfRect.Height() ) / 2; + bmCropRect.SetRect( borderX, + borderY, + snapshotSize.iWidth - borderX, + snapshotSize.iHeight - borderY ); + } + } + + gc.BitBlt( vfRect.iTl, snapshot, bmCropRect ); + + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMPOSTCAPTURECONTAINER_DRAW, "e_CAM_APP_SNAPSHOT_DRAW 0" ); //CCORAPP_SNAPSHOT_DRAW_END + } + + TBool lateOperation = ( ECamCapturing == iController.CurrentOperation() + || ECamCompleting == iController.CurrentOperation() ); + + if( iProcessingText && //iProcessingBg && + iController.ActiveCamera() != ECamActiveCameraSecondary && + lateOperation + ) + { + PRINT( _L("Camera <> CCamPostCaptureContainer: draw processing text..") ); + // When iProcessingText exists (and we are in correct state), the processing + // image text needs to be drawn. + //iProcessingBg->Draw( gc, Rect() ); + + gc.SetBrushColor( KRgbWhite ); + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); + iProcessingTextLayout.DrawText( gc, *iProcessingText, ETrue, KRgbBlack ); + } + + if( iBatteryPaneController ) + { + if( iPaneInUse == ECamPaneCounter ) + { + iNaviCounterControl->DrawNaviCtr( gc ); + } + // Draw the battery pane + iBatteryPaneController->Draw( gc ); + } + + if ( iController.ActiveCamera() == ECamActiveCameraSecondary ) + { + if( iPaneInUse == ECamPaneCounter ) + { + iNaviCounterControl->DrawNaviCtr( gc ); + } + } + } + +// ---------------------------------------------------- +// CCamPostCaptureContainer::CheckForFileName +// +// ---------------------------------------------------- +// +void CCamPostCaptureContainer::CheckForFileName( TBool aDoCheck ) + { + iCheckForFileNameChange = aDoCheck; + } + +// ---------------------------------------------------- +// CCamPostCaptureContainer::OfferKeyEventL +// Handles this application view's command keys. Forwards other +// keys to child control(s). +// ---------------------------------------------------- +// +TKeyResponse CCamPostCaptureContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + CCamAppUi* appUi = static_cast(CEikonEnv::Static()->AppUi()); + TBool embedded = appUi->IsEmbedded(); + + if ( appUi && appUi->CheckCourtesyKeyEventL(aKeyEvent, aType, EFalse) == EKeyWasConsumed ) + { + return EKeyWasConsumed; + } + + // only handle the shutter key if not in embedded mode + if ( !embedded ) + { + if( aType == EEventKeyUp ) + { + iController.SetDemandKeyRelease( EFalse ); + } + + TBool captureKey = IsCaptureKeyL( aKeyEvent, aType ); + + // consume the ECameraKey and exit post capture + if ( iView.IsForeground() && + ( ( captureKey ) || + ( IsShutterKeyL( aKeyEvent, aType ) && + ( appUi->CamOrientation() == ECamOrientationCamcorder || + appUi->CamOrientation() == ECamOrientationCamcorderLeft ) ) ) + ) + { + if ( aType == EEventKeyDown ) + { + TInt command = ECamCmdNewPhoto; + + if ( iView.Id().iUid == ECamViewIdVideoPostCapture ) + { + command = ECamCmdNewVideo; + } + iView.HandleCommandL( command ); + // Demand to relese capture key in pre capture view + iController.SetDemandKeyRelease( ETrue ); + } + return EKeyWasConsumed; + } + } + + if ( aType == EEventKey ) + { + TKeyResponse keyResponse = EKeyWasNotConsumed; + // Check for 'C' key, to be taken as a delete event + if ( aKeyEvent.iScanCode == EStdKeyBackspace ) + { + iView.HandleCommandL( ECamCmdDelete ); + keyResponse = EKeyWasConsumed; + } + + else if ( aKeyEvent.iScanCode == EStdKeyYes ) + { + // Only perform the quick send functionality if *not* in + // embedded mode. If we are embedded, we are technically + // already in the process of sending. + // + // In touch UI, the send key launches the dialler application. + if ( !embedded && !AknLayoutUtils::PenEnabled() ) + { + iView.HandleCommandL( ECamCmdQuickSend ); + } + + keyResponse = EKeyWasConsumed; + } + else + { + // do nothing + } + + if ( !iController.IsTouchScreenSupported() ) + { + if(iActivePalette && iActivePalette->CoeControl()->OfferKeyEventL(aKeyEvent,aType)==EKeyWasConsumed) + { + keyResponse = EKeyWasConsumed; + } + } + + if ( keyResponse == EKeyWasConsumed ) + { + return keyResponse; + } + } + return CCamContainerBase::OfferKeyEventL( aKeyEvent, aType ); + } + +// ----------------------------------------------------------------------------- +// CCamPostCaptureContainer::HandleControllerEventL +// Handle user menu selections +// ----------------------------------------------------------------------------- +// +void CCamPostCaptureContainer::HandleControllerEventL( TCamControllerEvent aEvent, + TInt /*aError*/ ) + { + PRINT( _L("Camera => CCamPostCaptureContainer::HandleControllerEventL") ); + // If this is a capture complete event + if ( aEvent == ECamEventCaptureComplete ) + { + DrawNow(); + } + else if ( aEvent == ECamEventSnapshotReady ) + { + DrawNow(); + } + PRINT( _L("Camera <= CCamPostCaptureContainer::HandleControllerEventL") ); + } + +// --------------------------------------------------------------------------- +// CCamContainerBase::ShowZoomPaneWithTimer +// Makes Zoom Pane visible for the period of the pane timer. +// --------------------------------------------------------------------------- +// +void CCamPostCaptureContainer::ShowZoomPaneWithTimer() + { + // No implementation: only meaningful in pre-capture modes + PRINT(_L("Camera => CCamPostCaptureContainer::ShowZoomPaneWithTimer() - No implementation!")); + } + +// ----------------------------------------------------------------------------- +// CCamPostCaptureContainer::Redraw +// ----------------------------------------------------------------------------- +void CCamPostCaptureContainer::Redraw(const TRect& aArea) + { + PRINT( _L("Camera => CCamPostCaptureContainer::Redraw") ); + CWindowGc& gc = SystemGc(); + + const CFbsBitmap* snapshot = iController.SnapshotImage(); + + if( iBatteryPaneController ) + { + if( iPaneInUse == ECamPaneCounter ) + { + iNaviCounterControl->DrawNaviCtr( gc ); + } + } + + // If snapshot contains a bitmap + if ( snapshot ) + { + TRect ssRect( ViewFinderFrameRect() ); + TRect outdatedArea( aArea ); + TSize snapshotSize = snapshot->SizeInPixels(); + // If necessary, the outdated area (aArea) is moved according to the + // cropped bitmap. + if ( iView.Id().iUid == ECamViewIdVideoPostCapture && + iController.GetCurrentVideoResolution() != + ECamVideoResolutionNHD ) + { + // Get the required snapshot layout + // Work out the rectangle of the viewfinder bitmap to draw + TInt borderX = + ( snapshotSize.iWidth - ssRect.Width() ) / 2; + TInt borderY = + ( snapshotSize.iHeight - ssRect.Height() ) / 2; + + if ( borderX < 0 ) //the display zone is reduced + { + if ( iActivePalette && iActivePalette->CoeControl()->IsVisible() ) //active palette is exist + { + gc.SetBrushColor( KRgbBlack ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.Clear( outdatedArea ); //Clear the initial whole zone + } + } + + outdatedArea.Move( borderX, borderY ); //new zone + } + + if ( iController.ActiveCamera() == ECamActiveCameraSecondary ) + { + // Secondary camera snapshot image doesn't fill whole screen. + // Black stripes are handled here. + outdatedArea.Move( 0, -ssRect.iTl.iY ); + } + + if ( outdatedArea.iBr.iX > snapshotSize.iWidth ) + { + // Draw black background for the tooltip. + // Mirrored layout is not supported. + TRect blackRect = outdatedArea; + blackRect.iTl.iX += snapshotSize.iWidth - outdatedArea.iTl.iX; + gc.SetBrushColor( KRgbBlack ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.SetPenStyle( CGraphicsContext::ESolidPen ); + gc.DrawRect( blackRect ); + } + + if ( ssRect.Contains( outdatedArea.iTl ) || !iController.IsTouchScreenSupported() ) + { + PRINT( _L("Camera <> CCamPostCaptureContainer::Redraw snapshot") ); + gc.BitBlt( aArea.iTl, snapshot, outdatedArea); + } + } + + if( iBatteryPaneController ) + { + iBatteryPaneController->Draw( gc ); + } + PRINT( _L("Camera <= CCamPostCaptureContainer::Redraw") ); + } + +// ----------------------------------------------------------------------------- +// CCamPostCaptureContainer::BatteryPaneUpdated +// +// Called by CCamBatteryPaneController when battery pane content has been updated. +// Re-draws background under the battery pane and the battery pane itself. +// ----------------------------------------------------------------------------- +// +void CCamPostCaptureContainer::BatteryPaneUpdated() + { + CCamAppUi* appUi = static_cast(CEikonEnv::Static()->AppUi()); + + // during sequence capture the battery icon is drawn by precapture container + // in sequence postcapture there is not battery icon, so there is no need + // to redraw battery or processing text here while sequence mode is enabled + if ( iBatteryPaneController && appUi && !appUi->IsBurstEnabled() ) + { + // Get the battery pane rectangle + TRect rect = iBatteryPaneController->Rect(); + + // Activate Gc + ActivateGc(); + + // Invalidate the battery pane area + RWindow window = Window(); + window.Invalidate( rect ); + window.BeginRedraw( rect ); + + // Redraw the background in that area + iUpdatingBatteryPane = ETrue; + Redraw( rect ); + iUpdatingBatteryPane = EFalse; + + // Draw the battery pane + CWindowGc& gc = SystemGc(); + + + //Redraw the prosessing text before battery icon + if ( iProcessingText && appUi && + iController.ActiveCamera() != ECamActiveCameraSecondary && + ( ECamCapturing == iController.CurrentOperation() || + ECamCompleting == iController.CurrentOperation() ) ) + { + // When iProcessingText exists (and we are in correct state), the processing + // image text needs to be drawn. + gc.SetBrushColor( KRgbWhite ); + gc.SetBrushStyle( CGraphicsContext::ENullBrush ); + iProcessingTextLayout.DrawText( gc, *iProcessingText, ETrue, KRgbBlack ); + } + + + //iBatteryPaneController->Draw( gc ); + + // Tell the window redraw is finished and deactivate Gc + window.EndRedraw(); + DeactivateGc(); + } + + } + +// ----------------------------------------------------------------------------- +// CCamPostCaptureContainer::HandleResourceChange +// +// Passes resource changes to battery pane controller +// ----------------------------------------------------------------------------- +// +void +CCamPostCaptureContainer::HandleResourceChange( TInt aType ) + { + if( iBatteryPaneController ) + { + // Inform battery pane of the resource change + iBatteryPaneController->HandleResourceChange( aType ); + } + + CCamContainerBase::HandleResourceChange( aType ); + } + + +// --------------------------------------------------------------------------- +// HandleAppEvent <> +// +// --------------------------------------------------------------------------- +// +void +CCamPostCaptureContainer::HandleAppEvent( const TCamAppEvent& aEvent ) + { + PRINT( _L("Camera => CCamPostCaptureContainer::HandleAppEvent") ); + + switch( aEvent ) + { + case ECamAppEventFocusGained: + { + iCheckForFileNameChange = ETrue; + if( iBatteryPaneController ) + iBatteryPaneController->Pause( EFalse ); + break; + } + case ECamAppEventFocusLost: + { + if( iBatteryPaneController ) + iBatteryPaneController->Pause( ETrue ); + break; + } + default: + { + break; + } + } + + PRINT( _L("Camera <= CCamPostCaptureContainer::HandleAppEvent") ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamPostCaptureViewBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamPostCaptureViewBase.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1039 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Post-capture view class for Camera application* +*/ + + +// INCLUDE FILES +#include +#include +#include +#ifndef __WINS__ +// #include +#endif +#include +#include +#include +#include +#include +#include +#include // CAknTitlePane +#include +#include "MCamAddToAlbumObserver.h" +#include "CamCollectionManagerAo.h" +#include +#include +#include +#include +#include + + +#include "Cam.hrh" +#include "CamUtility.h" +#include "CamPostCaptureViewBase.h" +#include "CamAppController.h" +#include "CamAppUi.h" +#include "CamLogger.h" +#include "camactivepalettehandler.h" +#include "CamPostCaptureContainer.h" +#include "camoneclickuploadutility.h" +#include "CameraUiConfigManager.h" + + + +//CONSTANTS + + +const TInt KCamSendUiBodySize = 0; +const TInt KCamSendUiMessageSize = 0; + + +const TUint KCamSendAsArrayGranularity = 1; + + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::~CCamPostCaptureViewBase +// Destructor +// --------------------------------------------------------------------------- +// +CCamPostCaptureViewBase::~CCamPostCaptureViewBase() + { + PRINT( _L("Camera => ~CCamPostCaptureViewBase") ); + delete iSendAppUi; + delete iSendMtmsToDim; + + if ( iAiwServiceHandler ) + { + // unload service provider if any + iAiwServiceHandler->Reset(); + delete iAiwServiceHandler; + } + +#ifndef __WINS__ + iSFIUtils = NULL; // Not owned +#endif // __WINS__ + + + if ( iCollectionManagerCallBack ) + { + delete iCollectionManagerCallBack; + iCollectionManagerCallBack = NULL; + } + delete iOneClickUploadUtility; + + PRINT( _L("Camera <= ~CCamPostCaptureViewBase") ); + } + +// ----------------------------------------------------------------------------- +// CCamPostCaptureViewBase::HandleCommandL +// Handle commands +// ----------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::HandleCommandL( TInt aCommand ) + { + PRINT1( _L("Camera => CCamPostCaptureViewBase::HandleCommandL (%d)"), aCommand ) + CCamAppUi* appUi = static_cast( AppUi() ); + switch ( aCommand ) + { + case ECamCmdOneClickUpload: + { + iOneClickUploadUtility->UploadL( + iController.CurrentFullFileName() ); + break; + } + case ECamCmdToggleActiveToolbar: + { + // If in the Landscape mode, MSK event is mapped + // like a normal selection key so that AP items + // are selected and respective setting pages are launched´ + // refer to @ProcessCommandL, since we get here only from there + TKeyEvent aKeyEvent; + aKeyEvent.iCode = aKeyEvent.iRepeats = aKeyEvent.iModifiers = 0; + aKeyEvent.iScanCode = EStdKeyDevice3; + static_cast + ( Container() )->OfferKeyEventL( aKeyEvent, EEventKey ); + break; + } + case EAknSoftkeyBack: + { + iController.DeepSleepTimerCancel(); + appUi->HandleCommandL( aCommand ); + } + break; + + case ECamCmdSend: + case ECamCmdSendToCallerMultimedia: + case ECamCmdQuickSend: + { +/* TBool inCall = EFalse; +#if !defined(__WINS__) && !defined(__WINSCW__) + inCall = iSFIUtils->IsCLIValidL(); +#endif */ + //use both inCall and InCallOrRinging() conditions to make sure if it is in call state + if ( /*inCall &&*/ iController.InCallOrRinging() ) + { +#ifndef __WINS__ + DoInCallSendL(); +#endif + } + else + { + DoSendAsL(); + } + } + break; + + case ECamCmdExitStandby: + { + // leave standby mode + ExitStandbyModeL(); + } + break; + case ECamCmdToggleCourtesyUI: + { + /* + * EFalse --> We just hide the AP tool bar + * ETrue --> We show the AP tool bar + * In this case, we dont toggle the UI between Show/Hide icons so + * we send EFalse as a parameter to SetAlwaysDrawPostCaptureCourtesyUI method + */ + if ( appUi ) + { + appUi->SetAlwaysDrawPostCaptureCourtesyUI( EFalse ); + } + break; + } + case ECamCmdProperties: + { + // Passing the name of the current file + // Asking the MetadataViewUtility to lauch an view for us + CEikStatusPane* sp = StatusPane(); + CAknTitlePane* title = + static_cast( sp->ControlL( + TUid::Uid( EEikStatusPaneUidTitle ) ) ); + title->SetTextL( KNullDesC ); + sp->MakeVisible( ETrue ); + title->MakeVisible( ETrue ); + iContainer->SetRect( AppUi()->ClientRect() ); + GlxMetadataViewUtility::ActivateViewL( iController.CurrentFullFileName() ); + static_cast(iContainer)->CheckForFileName( ETrue ); + title->MakeVisible( EFalse ); + sp->MakeVisible( EFalse ); + iContainer->SetRect( AppUi()->ApplicationRect() ); + break; + } + // Add Photo/Video to the album + case ECamCmdAddToAlbum: + { + + /* + * Status = 0 ( User confirms add to album operation ) + * Status = 1 ( User cancels add to album operation ) + */ + /*TInt status = ShowAddToAlbumConfirmationQueryL(); + if ( status == 0 ) + { + StartAddToAlbumOperationL(); + } + else + { // Lint warnings + }*/ + StartAddToAlbumOperationL(); + } + break; + default: + { + CCamViewBase::HandleCommandL( aCommand ); + } + } + + PRINT1( _L("Camera <= CCamPostCaptureViewBase::HandleCommandL (%d)"), aCommand ) + } + +// ----------------------------------------------------------------------------- +// CCamPostCaptureViewBase::HandleControllerEventL +// Handle user menu selections +// ----------------------------------------------------------------------------- +// +void +CCamPostCaptureViewBase::HandleControllerEventL( TCamControllerEvent aEvent, + TInt /*aError*/ ) + { + PRINT( _L("Camera => CCamPostCaptureViewBase::HandleControllerEventL") ); + + switch( aEvent ) + { + // ----------------------------------------------------- + case ECamEventCallStateChanged: + { + PRINT( _L("Camera <> case ECamEventCallStateChanged") ); + + CCamAppUiBase* appUi = static_cast( AppUi() ); + + // Reset the Send and Send to caller items in the active toolbar + if ( !iEmbedded ) + { + CCamActivePaletteHandler* apHandler = appUi->APHandler(); + // Hide Send or Send to caller + ResetSendAvailabilityL( apHandler ); + if ( iController.IsTouchScreenSupported() ) + { + UpdateToolbarIconsL(); + } + else + { + UpdateActivePaletteItemsL(); + } + } + break; + } + // ----------------------------------------------------- + case ECamEventSaveComplete: + case ECamEventSnapshotReady: + { + if ( ECamEventSaveComplete == aEvent && + iWaitForImageSave && + !iController.IsTouchScreenSupported() ) + { + UpdateActivePaletteItemsL(); + } + static_cast(iContainer)->CheckForFileName( EFalse ); + // Check that the file that has just completed is the one just taken + if ( iController.SavedCurrentImage() + && iController.IsAppUiAvailable() + )//&& iWaitForImageSave ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + // check whether embedded or not + if ( iEmbedded ) + { + //Do not show postcapture softkeys if we are still capturing or + //saving image + if ( iController.CurrentOperation() != ECamCapturing && + iController.CurrentOperation() != ECamCompleting ) + { + if ( !appUi->IsSecondCameraEnabled() || appUi->IsQwerty2ndCamera() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT_SECONDARY ); + } + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + } + else + { + appUi->RaisePostCaptureCourtesyUI(); + if ( appUi->IsSecondCameraEnabled() && !appUi->IsQwerty2ndCamera() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR_PORTRAIT ); + } + else if ( ECamViewStateBurstThumbnail == appUi ->CurrentViewState() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR_BURST ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR ); + } + + // image processing complete, enable gallery button + if( !iEmbedded ) + { + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetItemDimmed( ECamCmdPhotos, EFalse, ETrue ); + fixedToolbar->SetItemDimmed( ECamCmdDelete, EFalse, ETrue ); + fixedToolbar->SetItemDimmed( ECamCmdOneClickUpload, EFalse, ETrue ); + fixedToolbar->SetItemDimmed( ECamCmdSend, EFalse, ETrue ); + } + } + } + } + iWaitForImageSave = EFalse; + } + break; + } + + case ECamEventSliderClosed: + { + // if embedded and the slider is closed, close the menu + if( iEmbedded ) + { + PRINT( _L("Camera => CCamPostCaptureViewBase -> ECamEventSliderClosed") ); + StopDisplayingMenuBar(); + } + } + + // ----------------------------------------------------- + default: + break; + // ----------------------------------------------------- + } // switch + PRINT( _L("Camera <= CCamPostCaptureViewBase::HandleControllerEventL") ); + } + +// ----------------------------------------------------------------------------- +// CCamPostCaptureViewBase::HandleForegroundEventL +// Handle foreground event +// ----------------------------------------------------------------------------- +// +void +CCamPostCaptureViewBase::HandleForegroundEventL( TBool aForeground ) + { + PRINT( _L("Camera => CCamPostCaptureViewBase::HandleForegroundEventL") ) + CCamAppUi* appUi = static_cast( AppUi() ); + // ------------------------------------------------------- + // Coming to foreground + if ( aForeground) + { + PRINT( _L("Camera <> CCamPostCaptureViewBase::HandleForegroundEventL: to foreground") ) + if ( static_cast( AppUi() )->IsInPretendExit() ) + { + PRINT( _L("Camera <> CCamPostCaptureViewBase::HandleForegroundEventL: app in pretend exit so not grabbing the engine") ) + // The view can get a foreground event while the application is + // actually in a pretend exit situation. This occurs when the view switch + // was called before the exit event, but didn't complete until after the + // exit event. In this case the view should not register an interest in + // the engine as the application is really in the background and the resources + // need to be released + return; + } + + // set embedded flag here + iEmbedded = appUi->IsEmbedded(); + // need to update cba according to whether we are embedded or not + if ( iEmbedded ) + { + PRINT( _L("Camera <> CCamPostCaptureViewBase::HandleForegroundEventL: embedded mode") ); + //Do not show postcapture softkeys if we are still capturing or + //saving image + if ( iController.CurrentOperation() != ECamCapturing && + iController.CurrentOperation() != ECamCompleting ) + { + if ( !appUi->IsSecondCameraEnabled() || appUi->IsQwerty2ndCamera() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT_SECONDARY ); + } + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + } + else + { + // ensure cba is reset if we're not embedded + if ( !iWaitForImageSave ) + { + if ( static_cast( AppUi() )->IsSecondCameraEnabled() && + !static_cast( AppUi() )->IsQwerty2ndCamera() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR_PORTRAIT ); + } + else if ( ECamViewStateBurstThumbnail == appUi ->CurrentViewState() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR_BURST ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK_TOGGLETOOLBAR ); + } + } + else + { + // still image not yet saved + // disable Options softkey and cancel post capture timer + // softkey will be re-enabled when image has been saved + if(appUi->IsSecondCameraEnabled() && !appUi->IsQwerty2ndCamera()) + { + SetSoftKeysL( R_CAM_SOFTKEYS_BACK_SECONDARY ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_BACK ); + } + + + // disable gallery button until image is processed + if( !iEmbedded ) + { + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetItemDimmed( ECamCmdPhotos, ETrue, ETrue ); + fixedToolbar->SetItemDimmed( ECamCmdDelete, ETrue, ETrue ); + fixedToolbar->SetItemDimmed( ECamCmdOneClickUpload, ETrue, ETrue ); + fixedToolbar->SetItemDimmed( ECamCmdSend, ETrue, ETrue ); + } + } + } + } + } + // Register that we still want to use the engine (to receive final snap image) + IncrementCameraUsers(); + + iController.DeepSleepTimerStart(); + CCamAppUi* appUi = static_cast( AppUi() ); + + if ( appUi && !iSuppressAPUntilCameraReady ) + { + if(!iPartialBackground) + { + appUi->RaisePostCaptureCourtesyUI(); + } + } + else if ( iSuppressAPUntilCameraReady ) + { + iSuppressAPUntilCameraReady = EFalse; + } + iPartialBackground = EFalse; + + if ( iController.CameraSwitchQueued() ) + { + appUi->HandleCommandL( ECamCmdSwitchCamera ); + } + } + // ------------------------------------------------------- + // Going to background + else + { + if( iController.IsAppUiAvailable() ) + { + iPartialBackground = ( (appUi->AppInBackground(ETrue) ) && (!appUi->AppInBackground(EFalse) ) ); + } + else + { + iPartialBackground = EFalse; + } + PRINT( _L("Camera <> CCamPostCaptureViewBase::HandleForegroundEventL: to background") ) + iController.DeepSleepTimerCancel(); + // Register that we nolonger need the engine. + // Checks if we incremented the count. + DecrementCameraUsers(); + } + // ------------------------------------------------------- + PRINT( _L("Camera <= CCamPostCaptureViewBase::HandleForegroundEventL") ) + } + + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::DoActivateL +// Activate this view +// --------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + PRINT( _L( "Camera => CCamPostCaptureViewBase::DoActivateL" ) ); + + CCamAppUi* appui = static_cast( AppUi() ); + + CCamViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + + if ( fixedToolbar ) + { + if( iEmbedded ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + else + { + fixedToolbar->SetToolbarObserver( this ); + fixedToolbar->SetToolbarVisibility( ETrue ); + UpdateToolbarIconsL(); + } + } + } + + + // show an empty pane + appui->PushDefaultNaviPaneL(); + + iController.AddControllerObserverL( this ); + + // if we're embedded use ROID(R_CAM_SOFTKEYS_SELECT_DELETE_ID)softkey labels + if ( iEmbedded ) + { + //Do not show postcapture softkeys if we are still capturing or + //saving image + if ( iController.CurrentOperation() != ECamCapturing && + iController.CurrentOperation() != ECamCompleting ) + { + if ( !appui->IsSecondCameraEnabled() || appui->IsQwerty2ndCamera() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT_SECONDARY ); + } + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + } + + iPreviousViewStillPreCapture = ( aPrevViewId.iViewUid.iUid == ECamViewIdStillPreCapture ); + + // set flag for still and timelapse post capture only + // also check if the file has already been saved (possible if, for + // example, MMC removal note is displayed + if ( iPreviousViewStillPreCapture && appui->CurrentBurstMode() != ECamImageCaptureBurst && + !iController.SavedCurrentImage() ) + { + PRINT( _L( "Camera <> CCamPostCaptureViewBase::DoActivateL .. set iWaitForImageSave true" ) ); + iWaitForImageSave = ETrue; + } + else + { + PRINT( _L( "Camera <> CCamPostCaptureViewBase::DoActivateL .. set iWaitForImageSave false" ) ); + iWaitForImageSave = EFalse; + if ( !iController.IsTouchScreenSupported() ) + { + UpdateActivePaletteItemsL(); + } + } + + // Make sure appuis CBA is not visible + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if( cba ) + { + cba->MakeVisible( EFalse ); + } + + PRINT( _L( "Camera <= CCamPostCaptureViewBase::DoActivateL" ) ); + } + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void +CCamPostCaptureViewBase::DoDeactivate() + { + PRINT( _L( "Camera => CCamPostCaptureViewBase::DoDeactivate" ) ); + + CCamViewBase::DoDeactivate(); + + iController.RemoveControllerObserver( this ); + PRINT( _L( "Camera <= CCamPostCaptureViewBase::DoDeactivate" ) ); + } + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::DynInitMenuPaneL +// Called when the menu pane is displayed +// --------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::DynInitMenuPaneL( TInt /*aResourceId*/, + CEikMenuPane* aMenuPane ) + { + TInt itemPos = 0; + + if( !iController.IsTouchScreenSupported() ) + { + if( aMenuPane->MenuItemExists(ECamCmdProperties, itemPos) ) + { + aMenuPane->SetItemDimmed( ECamCmdProperties, ETrue ); + } + if( aMenuPane->MenuItemExists(ECamCmdAddToAlbum, itemPos) ) + { + aMenuPane->SetItemDimmed( ECamCmdAddToAlbum, ETrue ); + } + } + } + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::CCamPostCaptureViewBase +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamPostCaptureViewBase::CCamPostCaptureViewBase( CCamAppController& aController ) + : CCamViewBase( aController ), + iSendingCapabilities( KCamSendUiBodySize, + KCamSendUiMessageSize, + TSendingCapabilities::ESupportsAttachments ) + { + } + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::ConstructL() + { + + // create SendAs + iSendAppUi = CSendUi::NewL(); + + iSendMtmsToDim = new (ELeave) CArrayFixFlat( KCamSendAsArrayGranularity ); + iSendMtmsToDim->AppendL( KSenduiMtmIrUid ); + + iCollectionManagerCallBack = new (ELeave) + CCamCollectionManagerAO( *this ); + iAddToAlbumRequestOngoing = EFalse; + + +/*#ifndef __WINS__ + // Initialize SFIutils + CCamAppUi* appUi = static_cast( AppUi() ); + iSFIUtils = appUi->SFIUtility(); +#endif*/ + + iAiwServiceHandler = CAiwServiceHandler::NewL(); + + // In touch screen devices, hide toolbar initially to prevent it from + // being briefly visible in embedded mode + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + + iOneClickUploadUtility = CCamOneClickUploadUtility::NewL(); + } + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::CreateContainerL +// Create container control +// --------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::CreateContainerL() + { + TRect rect; + + CCamAppUiBase* appUi = static_cast( AppUi() ); + TCamOrientation orientation = appUi->CamOrientation(); + + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + iContainer = CCamPostCaptureContainer::NewL( iController, + *this, + screen ); + + iContainer->SetMopParent( this ); + } + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::DoSendAsL +// Use SendUI to create a message containing current image\video clip +// --------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::DoSendAsL() const + { + PRINT( _L("Camera => CCamPostCaptureViewBase::DoSendAsL") ) + CCamAppUiBase* appUi = static_cast( AppUi() ); + + if( !appUi->SendAsInProgress() ) + { + appUi->SetSendAsInProgressL( ETrue ); + CMessageData* messageData = CMessageData::NewLC(); + TRAP_IGNORE( + messageData->AppendAttachmentL( iController.CurrentFullFileName() ); + iSendAppUi->ShowQueryAndSendL( messageData,iSendingCapabilities ) + ) + PRINT( _L("Camera <> CCamPostCaptureViewBase::DoSendAsL - finished sending") ) + appUi->SetSendAsInProgressL( EFalse ); + CleanupStack::PopAndDestroy( messageData ); + } + + PRINT( _L("Camera <= CCamPostCaptureViewBase::DoSendAsL") ) + } + +#ifndef __WINS__ +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::DoInCallSendL +// Handle send to caller functionality +// --------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::DoInCallSendL() const + { + PRINT( _L("Camera => CCamPostCaptureViewBase::DoInCallSendL()") ) + CCamAppUiBase* appUi = static_cast( AppUi() ); + + if( !appUi->SendAsInProgress() ) + { + appUi->SetSendAsInProgressL( ETrue ); + CMessageData* messageData = CMessageData::NewLC(); + TRAP_IGNORE( + messageData->AppendAttachmentL( iController.CurrentFullFileName() ); + iSendAppUi->CreateAndSendMessageL( KSenduiMtmMmsUid, messageData, KNullUid, ETrue ) + ) + PRINT( _L("Camera <> CCamPostCaptureViewBase::DoInCallSendL() - finished sending") ) + appUi->SetSendAsInProgressL( EFalse ); + CleanupStack::PopAndDestroy( messageData ); + } + + // SFIUtils replaced by using SendUI interface because + // it cannot handle > 600 kB images properly + /*if ( iSFIUtils && iSFIUtils->IsCLIValidL() ) + { + iSFIUtils->SendMediaFileL( iController.CurrentFullFileName() ); + }*/ + PRINT( _L("Camera <= CCamPostCaptureViewBase::DoInCallSendL()") ) + } +#endif + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::IsPostCapture +// Returns whether the view is a postcapture view +// --------------------------------------------------------------------------- +// +TBool CCamPostCaptureViewBase::IsPostCapture() + { + return ETrue; + } + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::ResetSendAvailabilityL +// Hides or shows the 'Send' and 'SendAs' items in the active toolbar + // --------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::ResetSendAvailabilityL( CCamActivePaletteHandler* aApHandler ) + { + PRINT( _L("Camera => CCamPostCaptureViewBase::ResetSendAvailabilityL") ); + // Hide Send or Send to caller +// TBool inCall = EFalse; +/*#if !defined(__WINS__) && !defined(__WINSCW__) + inCall = iSFIUtils->IsCLIValidL(); +#endif */ + if ( aApHandler ) + { + //use both inCall and InCallOrRinging() conditions to make sure if it is in call state + aApHandler->SetItemVisible( ECamCmdSend, !( /*inCall &&*/ iController.InCallOrRinging() ) ); + aApHandler->SetItemVisible( ECamCmdSendToCallerMultimedia, ( /*inCall &&*/ iController.InCallOrRinging() ) ); + + TBool uploadSupported = EFalse; + if ( iOneClickUploadUtility && + iOneClickUploadUtility->OneClickUploadSupported() ) + { + uploadSupported = ETrue; + } + + aApHandler->SetItemVisible( ECamCmdOneClickUpload, uploadSupported ); + } + PRINT( _L("Camera <= CCamPostCaptureViewBase::ResetSendAvailabilityL ") ); + } + + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::StartAddToAlbumOperationL +// +// Starts calls to PostCapIdleCallBack during processor idle time. The calls +// are continued until PostCapIdleCallBack is done. +// +// --------------------------------------------------------------------------- +void CCamPostCaptureViewBase::StartAddToAlbumOperationL() + { + + //Currently we set multiple selection of albums + TBool allowMultipleSelection = ETrue; + RArray selectedAlbumIds; + CleanupClosePushL( selectedAlbumIds ); + // Launching the Pop-up menu with the list of albums + TRAPD( err, TGlxCollectionSelectionPopup::ShowPopupL( + selectedAlbumIds, + KGlxCollectionTypeIdAlbum, + allowMultipleSelection, + ETrue ) ); + /* + * Use Collection Manager to add the albums and + * before that check for the completion of the harvesting + */ + if ( err == KErrNone && selectedAlbumIds.Count() > 0) + { + PRINT( _L("Camera => StartAddToAlbumOperationL: Before CCamCollectionManagerAO( *this ); ") ); + PRINT( _L("Camera => StartAddToAlbumOperationL: After CCamCollectionManagerAO( *this ); and before calling StartCallBackAddToAlbumL()") ); + if ( iCollectionManagerCallBack ) + { + if ( !iAddToAlbumRequestOngoing ) + { + // Checking if only one request is being processed + iAddToAlbumRequestOngoing = ETrue; + iCollectionManagerCallBack->StartCallBackAddToAlbumL( + selectedAlbumIds, + iController.CurrentFullFileName() ); + } + } + PRINT( _L("Camera => StartAddToAlbumOperationL: After StartCallBackAddToAlbumL() ") ); + } + CleanupStack::PopAndDestroy( &selectedAlbumIds ); + } + + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::ShowAddToAlbumConfirmationQueryL +// +// Opens a radiobutton setting page with "Yes" or "No" options +// to actually confirm if we want to add the photo/video +// to the albums +// +// --------------------------------------------------------------------------- +TInt CCamPostCaptureViewBase::ShowAddToAlbumConfirmationQueryL() + { + TInt selectedIndex = 1; // default selection is "No" + // Add to Album setting page "Items" + CDesCArrayFlat* items = + iCoeEnv->ReadDesC16ArrayResourceL( + R_CAM_ADDTOALBUM_SETTING_PAGE_LBX ); + CleanupStack::PushL( items ); + + CAknRadioButtonSettingPage* dlg = new (ELeave) + CAknRadioButtonSettingPage + ( + R_CAM_ADDTOALBUM_SETTING_PAGE, + selectedIndex, + items + ); + + dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); + CleanupStack::PopAndDestroy( items ); + return selectedIndex; + } + +/* +* CCamPostCaptureViewBase::AddToAlbumIdOperationComplete() +*/ +void CCamPostCaptureViewBase::AddToAlbumIdOperationComplete() + { + PRINT( _L("Camera => CCamPostCaptureViewBase::AddToAlbumIdOperationComplete() ... SUCCESS ") ); + iAddToAlbumRequestOngoing = EFalse; + } + + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::UpdateToolbarIconsL +// Update fixed toolbar icons according to current call state +// --------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::UpdateToolbarIconsL() + { + PRINT( _L("Camera => CCamPostCaptureViewBase::UpdateToolbarIconsL") ); + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* toolbar = Toolbar(); + if ( toolbar ) + { + CAknButton* button = dynamic_cast( + toolbar->ControlOrNull( ECamCmdSend ) ); + if ( button ) + { + CAknButtonState* state = button->State(); + if ( state ) + { + HBufC* tooltipText = + StringLoader::LoadLC( R_QTN_LCAM_TT_SEND ); + state->SetHelpTextL( *tooltipText ); + CleanupStack::PopAndDestroy( tooltipText ); + } + } + button = dynamic_cast( + toolbar->ControlOrNull( ECamCmdOneClickUpload ) ); + if ( button ) + { + CAknButtonState* state = button->State(); + if ( state ) + { + state->SetHelpTextL( + iOneClickUploadUtility->ButtonTooltipL() ); + } + } + } + } + PRINT( _L("Camera <= CCamPostCaptureViewBase::UpdateToolbarIconsL") ); + } + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::OfferToolbarEventL +// Handle fixed toolbar events +// --------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::OfferToolbarEventL( TInt aCommand ) + { + User::ResetInactivityTime(); + HandleCommandL( aCommand ); + } + +// --------------------------------------------------------------------------- +// CCamPostCaptureViewBase::UpdateActivePaletteItemsL +// --------------------------------------------------------------------------- +// +void CCamPostCaptureViewBase::UpdateActivePaletteItemsL() + { + PRINT( _L("Camera => CCamPostCaptureViewBase::UpdateActivePaletteItemsL ") ); + CCamAppUi* appUi = static_cast( AppUi() ); + TInt resId = 0; + if ( appUi ) + { + TCamOrientation orientation = appUi->CamOrientation(); + CCamActivePaletteHandler* apHandler = appUi->APHandler(); + if( apHandler && !iEmbedded && ( orientation == ECamOrientationCamcorder || + orientation == ECamOrientationCamcorderLeft || + orientation == ECamOrientationDefault || + orientation == ECamOrientationPortrait ) ) + { + iContainer->CreateActivePaletteL(); + MActivePalette2UI* activePalette = + appUi->APHandler()->ActivePalette(); + + if( activePalette ) + { + activePalette->SetGc(); + } + // Install PostCapture AP items + if ( ECamControllerImage == iController.CurrentMode() || + iPreviousViewStillPreCapture ) + { + PRINT( _L("Camera => ECamControllerImage == iController.CurrentMode() ") ); + if ( appUi->IsSecondCameraEnabled() ) + { + resId = R_CAM_STILL_POST_CAPTURE_AP_ITEMS_SECONDARY; + } + else + { + resId = R_CAM_STILL_POST_CAPTURE_AP_ITEMS; + } + } + else + { + PRINT( _L("Camera => resId = R_CAM_VIDEO_POST_CAPTURE_AP_ITEMS; ") ); + if ( appUi->IsSecondCameraEnabled() ) + { + resId = R_CAM_VIDEO_POST_CAPTURE_AP_ITEMS_SECONDARY; + } + else + { + resId = R_CAM_VIDEO_POST_CAPTURE_AP_ITEMS; + } + } + + if ( iOneClickUploadUtility && + iOneClickUploadUtility->OneClickUploadSupported() ) + { + apHandler->SetOneClickUploadTooltipL( + iOneClickUploadUtility->ButtonTooltipL() ); + } + + apHandler->InstallAPItemsL( resId ); + // Hide Send or Send to caller + ResetSendAvailabilityL( apHandler ); + apHandler->SetView( this ); + + // Make AP visible. + appUi->SetAlwaysDrawPostCaptureCourtesyUI( ETrue ); + + // if coming from background, in video as target mode + if ( iController.CurrentMode() != iController.TargetMode() && + ( ECamControllerVideo == iController.TargetMode() ) ) + { + apHandler->SetVisibility( EFalse ); + iSuppressAPUntilCameraReady = ETrue; + } + } + } + PRINT( _L("Camera <= CCamPostCaptureViewBase::UpdateActivePaletteItemsL ") ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamPreCaptureContainerBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamPreCaptureContainerBase.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,2537 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container base class for pre-capture views* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include // resource reader +#include +#include +#include +#include // For CCoeAppUiBase +#include // For CEikApplication +#include +#include + +#include +#include +#include + + +#include "CamAppUiBase.h" +#include "CamPreCaptureContainerBase.h" +#include "CamLogger.h" +#include "CamSidePane.h" +#include "CamUtility.h" +#include "CamPanic.h" +#include "Cam.hrh" +#include "CamAppUi.h" +#include "CamIndicator.h" +#include "CamIndicatorResourceReader.h" +#include "CamIndicatorData.h" +#include "CamSelfTimer.h" +#include "CamPreCaptureViewBase.h" +#include "CamStillPreCaptureView.h" +#include "CamSettings.hrh" +#include "CamNaviCounterControl.h" +#include "CamNaviProgressBarControl.h" +#include "camuiconstants.h" // KCamDirectColorVal +#include "camactivepalettehandler.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamPreCaptureContainerBaseTraces.h" +#endif +#include "camconfiguration.h" +#include "CameraUiConfigManager.h" + + +// CONSTANTS +const TInt KZoomPanelTimeout = 4000000; // 4s +const TInt KReticuleFlashTimeout = 250000; // Quarter of a second (in microseconds). +const TInt KAFIconCorners = 4; // Hip to be square + +#include "camvfgridinterface.h" +#include "camlinevfgriddrawer.h" + +// Snapshot data is needed in timelapse mode +const TUint KCameraEventInterest = ( ECamCameraEventClassVfControl + | ECamCameraEventClassVfData + | ECamCameraEventClassSsData + ); + + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::~CCamPreCaptureContainerBase +// Destructor +// --------------------------------------------------------- +// +CCamPreCaptureContainerBase::~CCamPreCaptureContainerBase() + { + PRINT( _L("Camera => ~CCamPreCaptureContainerBase" )) + + iController.ViewfinderWindowDeleted( &Window() ); + + iController.RemoveSettingsObserver ( this ); + iController.RemoveCameraObserver ( this ); + iController.RemoveControllerObserver( this ); + + if ( iZoomTimer && iZoomTimer->IsActive() ) + { + iZoomTimer->Cancel(); + } + delete iZoomTimer; + delete iVfGridDrawer; + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + iAfIcons.ResetAndDestroy(); + iLayouts.Close(); + if ( iReticuleTimer && iReticuleTimer->IsActive() ) + { + iReticuleTimer->Cancel(); + } + delete iReticuleTimer; + } + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + iResolutionIndicators.ResetAndDestroy(); + iResolutionIndicators.Close(); + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + PRINT( _L("Camera => ~CCamPreCaptureContainerBase - delete iLocationIconController" )) + delete iLocationIconController; + } + + delete iOffScreenBitmap; + delete iBitmapDevice; + delete iBitmapGc; + + // if shutting down, observers are removed automatically + if ( + iController.IsAppUiAvailable() && + appUi && !iController.IsInShutdownMode() ) + { + // Deregister as burst mode observer + appUi->RemoveBurstModeObserver( this ); + } + + delete iBatteryPaneController; + + delete iViewFinderBackup; + iViewFinderBackup = NULL; + iReceivedVfFrame = EFalse; + + PRINT( _L("Camera <= ~CCamPreCaptureContainerBase" )) + } + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::BaseConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamPreCaptureContainerBase::BaseConstructL( const TRect& aRect ) + { + PRINT( _L("Camera => CCamPreCaptureContainerBase::BaseConstructL ") ); + + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + iZoomPane = appUi->ZoomPane(); + + CCamContainerBase::BaseConstructL( aRect ); + + iViewFinderBackup = NULL; + iReceivedVfFrame = EFalse; + + // Check whether zoom & side pane will be on the left or the right of the screen + TInt handedInt; + User::LeaveIfError( CamUtility::GetPsiInt( ECamPsiSidePanePosition, handedInt ) ); + iHandedness = static_cast< TCamHandedness >( handedInt ); + + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, ROID(R_CAM_ZOOM_PANE_WIDTH_ID)); + iZoomPaneWidth = reader.ReadInt16(); + CleanupStack::PopAndDestroy(); // reader + + // Create Zoom Pane based on Rect passed in on creation + TRect paneRect( Rect() ); + + // if the side pane is on the left + if ( iHandedness == ECamHandLeft ) + { + paneRect.iBr.iX = iZoomPaneWidth; + } + else // the side pane is on the right + { + paneRect.iTl.iX = paneRect.iBr.iX - iZoomPaneWidth; + } + + User::LeaveIfError( CamUtility::GetPsiInt( ECamPsiOverLaySidePane, iOverlayViewFinder ) ); + + iController.AddControllerObserverL( this ); // For zoom state changes + iController.AddCameraObserverL( this, KCameraEventInterest ); + iController.AddSettingsObserverL( this ); + + iZoomPane->MakeVisible( EFalse, EFalse ); // On app startup, it's invisible + + if ( !appUi->IsSecondCameraEnabled() ) + { + iZoomPane->SetZoomKeys( iPrimaryZoomInKeys, iPrimaryZoomOutKeys ); + } + else + { + iZoomPane->SetZoomKeys( iSecondaryZoomInKeys, iSecondaryZoomOutKeys ); + } + + iZoomTimer = CPeriodic::NewL( CActive::EPriorityUserInput ); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() && + !iController.UiConfigManagerPtr()->IsFaceTrackingSupported() ) + { + iReticuleTimer = CPeriodic::NewL( CActive::EPriorityUserInput ); + + // Layout the reticule. + iAfReadyIcon = CreateAfIconL( KRgbWhite ); + iAfFocusIcon = CreateAfIconL( KRgbGreen ); + iAfErrIcon = CreateAfIconL( KRgbRed ); + } + + iSidePane = appUi->SidePane(); + iSidePane->SetRect( paneRect ); + + // Register as burst mode observer + appUi->AddBurstModeObserverL( this ); + + CreateResolutionIndicatorL(); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + TRect Locrect = Rect(); + PRINT( _L("Camera => CCamPreCaptureContainerBase::BaseConstructL - create iLocationIconController") ) + iLocationIconController = CCamLocationIconController::NewL( iController, *this, ETrue, Locrect ); + SetLocationIndicatorVisibility(); + } + + TInt color; + TInt gray; + + TDisplayMode displaymode = + CEikonEnv::Static()->WsSession().GetDefModeMaxNumColors( color, gray ); + + // set up the offscreen bitmap + iOffScreenBitmap = new ( ELeave ) CFbsBitmap(); + + User::LeaveIfError( iOffScreenBitmap->Create( Rect().Size(), EColor16MU/*displaymode*/ ) ); + + PRINT1( _L("Camera => CCamPreCaptureContainerBase::BaseConstructL disp mode (%d)"), displaymode ) + iBitmapDevice = CFbsBitmapDevice::NewL( iOffScreenBitmap ); + User::LeaveIfError( iBitmapDevice->CreateContext( iBitmapGc ) ); + + iRect = ViewFinderFrameRect(); + // if using direct viewfinding pass Rect to control + + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + // Check whether we should be showing the reticule. + // NOTE: This will only be showed in still, not video views + iPhotoSceneUsesReticule = !iController.CurrentSceneHasForcedFocus(); + } + + // Setup viewfinder grid + InitVfGridL( iRect ); + + // Do not construct battery pane controller, if secondary camera is in use + if ( iController.ActiveCamera() != ECamActiveCameraSecondary || + appUi->IsQwerty2ndCamera() ) + { + iBatteryPaneController = CCamBatteryPaneController::NewL( + *this, ETrue); + } + // Make sure fixed toolbar is on top of this window + DrawableWindow()->SetOrdinalPosition( KCamPreCaptureWindowOrdinalPos ); + + iController.SetViewfinderWindowHandle( &Window() ); + appUi->SetViewFinderInTransit(EFalse); + iController.StartIdleTimer(); + + PRINT( _L("Camera <= CCamPreCaptureContainerBase::BaseConstructL ") ); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::CCamPreCaptureContainerBase +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamPreCaptureContainerBase::CCamPreCaptureContainerBase( + CCamAppController& aController, + CAknView& aView ) + : CCamContainerBase( aController, aView ), + iDisableRedraws( EFalse ) + { + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::ZoomTimerCallback +// Callback for Zoom Pane timer +// --------------------------------------------------------------------------- +// +TInt CCamPreCaptureContainerBase::ZoomTimerCallback( TAny* aObject ) + { + CCamPreCaptureContainerBase* cont = static_cast< CCamPreCaptureContainerBase* >( aObject ); + cont->ZoomTimerTick(); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::ReticuleTimerCallback +// Callback for flashing of the focus reticule +// --------------------------------------------------------------------------- +// +TInt CCamPreCaptureContainerBase::ReticuleTimerCallback( TAny* aObject ) + { + CCamPreCaptureContainerBase* cont = static_cast< CCamPreCaptureContainerBase* >( aObject ); + cont->iReticuleFlashOn = !cont->iReticuleFlashOn; + + // This is where we force a redraw of the reticule, if we are using + // Direct Viewfinding. However, if we are in burst mode, we must + // use Bitmap Viewfinding, so only draw reticule if NOT in burst mode + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi && appUi-> IsDirectViewfinderActive() ) + { + cont->DrawDeferred(); + } + return KErrNone; + } + + +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::ShowZoomPaneWithTimer +// Makes Zoom Pane visible for the period of the pane timer. +// --------------------------------------------------------------------------- +// +void CCamPreCaptureContainerBase::ShowZoomPaneWithTimer() + { + __ASSERT_DEBUG( iZoomTimer, CamPanic( ECamPanicNullPointer ) ); + __ASSERT_DEBUG( iZoomPane, CamPanic( ECamPanicNullPointer ) ); + __ASSERT_DEBUG( iSidePane, CamPanic( ECamPanicNullPointer ) ); + + PRINT(_L("Camera => CCamPreCaptureContainerBase::ShowZoomPaneWithTimer")); + + // If already active, cancel the timer + if ( iZoomTimer->IsActive() ) + { + iZoomTimer->Cancel(); + } + + iZoomTimer->Start( KZoomPanelTimeout, KZoomPanelTimeout, TCallBack( ZoomTimerCallback , this) ); + + iZoomPane->MakeVisible( ETrue, ETrue ); + + PRINT(_L("Camera <= CCamPreCaptureContainerBase::ShowZoomPaneWithTimer")); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::ZoomTimerTick +// Called as a result of the Zoom Pane timer expiring, switches side panes +// to hide the Zoom pane. +// --------------------------------------------------------------------------- +// +void CCamPreCaptureContainerBase::ZoomTimerTick() + { + PRINT(_L("Camera => CCamPreCaptureContainerBase::ZoomTimerTick")); + // Cancel the (potentially) recurring timer + iZoomTimer->Cancel(); + + // If zooming is still in progress (this happens if the zoom key has + // been held down longer than the zoom pane timer), keep the pane + // visible + if ( iZoomPane->IsCurrentlyZooming() ) + { + iZoomTimer->Start( KZoomPanelTimeout, + KZoomPanelTimeout, + TCallBack( ZoomTimerCallback , this) ); + } + else + { + // Make Indicator Pane visible again and hide the ZoomPane + iZoomPane->MakeVisible( EFalse, ETrue ); + + // background needs redrawing behind zoom pane + iRedrawPaneBackground = ETrue; + } + PRINT(_L("Camera <= CCamPreCaptureContainerBase::ZoomTimerTick")); + } + +// ---------------------------------------------------- +// CCamPreCaptureContainerBase::OfferKeyEventL +// Handles this application view's command keys. Forwards other +// keys to child control(s). +// ---------------------------------------------------- +// +TKeyResponse +CCamPreCaptureContainerBase::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + PRINT2( _L("Camera => CCamPreCaptureContainerBase::OfferKeyEventL type %d) scan code (%d)"), aType, aKeyEvent.iScanCode ) + +#ifdef CAMERAAPP_PERFORMANCE_MEASUREMENT + // Log event only if this is the first capture key press and we are in correct state + TCamCaptureOperation operation = iController.CurrentOperation(); + + TBool isCaptureKeyForUs = (IsCaptureKeyL( aKeyEvent, aType ) + && ( EEventKeyDown == aType && 0 == aKeyEvent.iRepeats ) ); + + TBool isOperationStateOk = (ECamNoOperation == operation); + if( isCaptureKeyForUs && isOperationStateOk ) + { + PERF_EVENT_START_L1( EPerfEventKeyToCapture ); + } +#endif + + TBool isCaptureKeyForSymbTrace = (IsCaptureKeyL( aKeyEvent, aType ) + && ( EEventKeyDown == aType && 0 == aKeyEvent.iRepeats ) ); + if( isCaptureKeyForSymbTrace ) + { + PRINT( _L("Camera <> CCamPreCaptureContainerBase::OfferKeyEventL Symbian Traces Active") ); + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMPRECAPTURECONTAINERBASE_OFFERKEYEVENTL, "e_CAM_APP_SHOT_TO_SNAPSHOT 1" ); //CCORAPP_SHOT_TO_SNAPSHOT_START + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMPRECAPTURECONTAINERBASE_OFFERKEYEVENTL, "e_CAM_PRI_SHOT_TO_SNAPSHOT 1" ); //CCORAPP_PRI_SHOT_TO_SNAPSHOT_START + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMPRECAPTURECONTAINERBASE_OFFERKEYEVENTL, "e_CAM_PRI_SHOT_TO_SAVE 1" ); //CCORAPP_PRI_SHOT_TO_SAVE_START + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMPRECAPTURECONTAINERBASE_OFFERKEYEVENTL, "e_CAM_PRI_SHOT_TO_SHOT 1" ); //CCORAPP_PRI_SHOT_TO_SHOT_START + OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMPRECAPTURECONTAINERBASE_OFFERKEYEVENTL, "e_CAM_APP_SHOT_TO_STILL 1" ); //CCORAPP_SHOT_TO_STILL_START + OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMPRECAPTURECONTAINERBASE_OFFERKEYEVENTL, "e_CAM_APP_CAPTURE_START 1" ); //CCORAPP_CAPTURE_START_START + OstTrace0( CAMERAAPP_PERFORMANCE, DUP6_CCAMPRECAPTURECONTAINERBASE_OFFERKEYEVENTL, "e_CAM_PRI_SERIAL_SHOOTING 1" ); //CCORAPP_PRI_SERIAL_SHOOTING_START + } + + iController.StartIdleTimer(); + if( aType == EEventKeyUp ) + { + iController.SetDemandKeyRelease( EFalse ); + } + + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + if ( appUi && appUi->CheckCourtesyKeyEventL( aKeyEvent, aType, ETrue ) == EKeyWasConsumed ) + { + PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL courtesy key") ); + return EKeyWasConsumed; + } + + // If a control has the focus, give it the first opportunity to + // process the key event + + if( iActivePalette + && iActivePalette->CoeControl() + && iActivePalette->CoeControl()->OfferKeyEventL(aKeyEvent,aType) == EKeyWasConsumed ) + { + PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL AP consumed") ); + return EKeyWasConsumed; + } + + // The key press has not been handled by a visible control + // so will be processed by the container. + + // Handle Zoom in key if we are not saving video + PRINT( _L("Camera <> CCamPreCaptureContainerBase::OfferKeyEventL B") ) + if ( IsZoomKeyL( aKeyEvent, aType ) + && ECamCompleting != iController.CurrentOperation() + && !iController.CurrentlySavingVideo() + && !appUi->IsSecondCameraEnabled() ) + { + // Offer the key event to the zoom pane/model + TKeyResponse resp = iZoomPane->OfferKeyEventL( aKeyEvent, aType ); + + // If it was consumed, we need to keep the zoom pane visible + if ( resp == EKeyWasConsumed ) + { + ShowZoomPaneWithTimer(); + } + PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL Zoom key") ); + return resp; + } + + else if ( EEventKey == aType + && EKeyOK == aKeyEvent.iCode + && 0 == aKeyEvent.iRepeats ) + { + TBool MSKCapture(EFalse); + if ( appUi && !appUi->IsToolBarVisible() && aKeyEvent.iScanCode == EStdKeyDevice3 ) + { + MSKCapture = ETrue; + } + if( appUi->ActiveCamera() == ECamActiveCameraPrimary + && !MSKCapture ) + { + // AP needs to handle this + PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL Ok key") ); + return EKeyWasNotConsumed; + } + } + + // Handle right and left navi keys. + // Each product defines the behaviour that is mapped to these keys. + else if ( EEventKey == aType + && ( EStdKeyRightArrow == aKeyEvent.iScanCode + || EStdKeyLeftArrow == aKeyEvent.iScanCode ) ) + { + if ( HandleLeftRightNaviKeyL( aKeyEvent, aType ) == EKeyWasConsumed ) + { + PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL left/right navi") ); + return EKeyWasConsumed; + } + } + + else + { + // empty else statement to remove LINT error + } + + TBool captureKey = IsCaptureKeyL( aKeyEvent, aType ); + + // Stop any zooming activity if capture key detected + if ( captureKey ) + { + CCamZoomPane* zoom_pane = appUi->ZoomPane(); + + if ( zoom_pane ) + { + PRINT( _L("Camera <> CCamPreCaptureContainerBase::OfferKeyEventL calling StopZoom()") ); + zoom_pane->StopZoom(); + } + } + TBool viewFinderRunning = iReceivedVfFrame; + if ( iController.UiConfigManagerPtr() && + ( iController.UiConfigManagerPtr()-> + IsDSAViewFinderSupported( ETrue ) && + !appUi->IsSecondCameraEnabled() ) || + ( iController.UiConfigManagerPtr()-> + IsDSAViewFinderSupported( EFalse ) && + appUi->IsSecondCameraEnabled() ) ) + { + viewFinderRunning = appUi->IsDirectViewfinderActive(); + } + + TBool shutterKey = IsShutterKeyL( aKeyEvent, aType ); + TBool interruptKey = captureKey; + if ( !appUi->IsSecondCameraEnabled() && + iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + interruptKey = shutterKey; + } + + if(iController.IsProcessingCapture() + // && appUi->CurrentCaptureMode() == ECamCaptureModeStill + && ECamControllerImage == iController.CurrentMode() + && EEventKeyDown == aType + && interruptKey + && appUi->ShowPostCaptureView() + && !appUi->IsBurstEnabled() + && !appUi->SelfTimerEnabled()) + { + iController.SetCaptureKeyPressedWhileImageSaving(ETrue); + PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL 2nd press of capturekey") ) + return EKeyWasConsumed; + + } + // Check if the key is a shutter key and... + if ( shutterKey && viewFinderRunning ) + { + if ( EKeyWasConsumed == HandleShutterKeyEventL( aKeyEvent, aType ) ) + { + PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL shutter key") ); + return EKeyWasConsumed; + } + } + else if ( captureKey // Capture key event... + && EEventKeyDown == aType // ...it's a key down event and + && viewFinderRunning // ...the viewfinder is running + && !iController.Busy() // CamCameraController is not busy. + && !iController.IsDemandKeyRelease() ) // ...and no need to wait key up + { + PRINT( _L("Camera <> CCamPreCaptureContainerBase::OfferKeyEventL .. [KEYS] capture key down") ) + if ( HandleCaptureKeyEventL( aKeyEvent ) == EKeyWasConsumed ) + { + PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL capture key handled") ) + return EKeyWasConsumed; + } + } + else if ( captureKey && aType == EEventKeyUp ) + { + PRINT( _L("Camera <> CCamPreCaptureContainerBase::OfferKeyEventL .. [KEYS] capture key up") ) + if ( iController.SequenceCaptureInProgress() // actively capturing or + || appUi->IsBurstEnabled() // burst is enabled (for if focusing) + ) + { + if ( appUi->CurrentBurstMode() == ECamImageCaptureTimeLapse ) + { + PRINT( _L("Camera <> CCamPreCaptureContainerBase::OfferKeyEventL .. timelapse mode, update CBA") ) + // if this is a timelapse capture then set the softkeys to blank/cancel. + // The next shutter press will stop the capture. + TRAP_IGNORE( static_cast( &iView )->UpdateCbaL() ); + } + else + { + if ( !appUi->SelfTimerEnabled() ) + { + + if ( !iController.AllSnapshotsReceived() && (iController.CurrentCapturedCount() >= 1) ) + { + PRINT( _L("Camera <> CCamPreCaptureContainerBase::OfferKeyEventL .. burst mode, soft stop burst..") ) + // burst ongoing, still receiving snapshots, end it as soon as possible. + iController.SetKeyUp( ETrue ); + iController.SoftStopBurstL(); + } + else + { + // ignore keypress, all snapshot received and processing image data + // processing only stopped from softkey + } + } + } + + PRINT( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL .. capture key up handled") ) + return EKeyWasConsumed; + } + } + else + { + // remove Lint warning + } + + TKeyResponse response = CCamContainerBase::OfferKeyEventL( aKeyEvent, aType ); + + PRINT1( _L("Camera <= CCamPreCaptureContainerBase::OfferKeyEventL, return %d"), response ) + return response; + } + + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::HandleControllerEventL +// Handles zoom events from the Controller +// --------------------------------------------------------- +// +void +CCamPreCaptureContainerBase +::HandleControllerEventL( TCamControllerEvent aEvent, + TInt /*aError*/ ) + { + PRINT1(_L("Camera => CCamPreCaptureContainerBase::HandleControllerEventL(%d)"), aEvent ); + + __ASSERT_DEBUG( iZoomPane, CamPanic( ECamPanicNullPointer ) ); + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + switch( aEvent ) + { + // --------------------------------------------------- + case ECamEventSaveCancelled: + { + // clear the side pane after saving images dialog is dismissed + ForceSideZoomPaneDraw(); + break; + } + // --------------------------------------------------- + case ECamEventCameraChanged: + { + SetResolutionIndicator(); + break; + } + + // --------------------------------------------------- + case ECamEventCounterUpdated: + { + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsDSAViewFinderSupported() ) + { + if( iPaneInUse == ECamPaneProgress && appUi && appUi->IsDirectViewfinderActive() ) + { + ActivateGc(); + CWindowGc& gc = SystemGc(); + iNaviProgressBarControl->DrawProgressBar( gc ); + DeactivateGc(); + } + else if ( iPaneInUse == ECamPaneCounter && iController.SequenceCaptureInProgress() ) + { + DrawDeferred(); + } + else + { + // Lint + } + } + break; + } + // --------------------------------------------------- + case ECamEventOperationStateChanged: + { + if( iController.IsAppUiAvailable() && iController.UiConfigManagerPtr() + && iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + // ReCheck if we have to draw the reticule. + if ( ECamControllerImage == iController.CurrentMode() ) + { + iPhotoSceneUsesReticule = !iController.CurrentSceneHasForcedFocus(); + HandleOperationStateChangeEventL(); + } + + } + break; + } + // --------------------------------------------------- + case ECamEventExitRequested: + { + iShuttingDown = ETrue; + break; + } + // --------------------------------------------------- + case ECamEventRecordComplete: + { + iResolutionIndicators[iCurrentIndicator]->CancelOverridePosition(); + break; + } + // --------------------------------------------------- + // Scene has changed + case ECamEventSceneStateChanged: + { + PRINT(_L("Camera <> CCamPreCaptureContainerBase::HandleControllerEventL ECamEventSceneStateChanged")); + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + // Scene state has changed, re-check whether we should + // be showing the reticule + iPhotoSceneUsesReticule = !iController.CurrentSceneHasForcedFocus(); + } + ResetVFGridVisibility(); + appUi->APHandler()->UpdateActivePaletteL(); + break; + } + // --------------------------------------------------- + case ECamEventImageData: + { + UpdateBurstProcessingTextL( iController.CapturedImages(), iController.CurrentCapturedCount() ); + break; + } + // --------------------------------------------------- + case ECamEventSliderClosed: + { + //Do nothing + } + break; + // --------------------------------------------------- + case ECamEventCaptureComplete: + { + if ( !appUi->IsSecondCameraEnabled() + && iController.CurrentMode() == ECamControllerImage ) + { + DrawNow(); + } + break; + } + // --------------------------------------------------- + case ECamEventFaceTrackingStateChanged: + { + if( iController.UiConfigManagerPtr() + && iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + // ReCheck if we have to draw the reticule. + if ( ECamControllerImage == iController.CurrentMode() ) + { + iPhotoSceneUsesReticule = + !iController.CurrentSceneHasForcedFocus(); + } + } + } + default: + { + // Other events => no action. + break; + } + // --------------------------------------------------- + } + PRINT(_L("Camera <= CCamPreCaptureContainerBase::HandleControllerEventL")); + } + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::HandleForegroundEvent +// Handles change of app foreground state +// --------------------------------------------------------- +// +void CCamPreCaptureContainerBase::HandleForegroundEventL( TBool aForeground ) + { + PRINT1( _L( "Camera => CCamPreCaptureContainerBase::HandleForegroundEventL %d" ), aForeground ); + if ( aForeground ) + { +/*#ifndef __WINS__ + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + if( appUi->IsInCallSend() ) + { + // force side pane to update + appUi->SidePane()->SetInitialState(); + } +#endif*/ + // Check if we are on a non-standard zoom level. Also checks if previous + // view was PostCapture or settings, if so, we dont want to show the zoom + // pane either + if ( iZoomPane->ZoomValue() != 0 && + !iZoomPane->IsResetPending() && + iPrevViewId != ECamViewIdStillPostCapture && + iPrevViewId != ECamViewIdVideoPostCapture && + iPrevViewId != ECamViewIdPhotoSettings && + iPrevViewId != ECamViewIdVideoSettings ) + { + // If we have moved to the foreground and need to show the zoom level. + ShowZoomPaneWithTimer(); + } + + ResetVFGridVisibility(); + } + else + { + iReceivedVfFrame = EFalse; + + // Cancel timer if we're losing focus + iZoomTimer->Cancel(); + + if ( !iShuttingDown ) + { + iSidePane->MakeVisible( ETrue ); + iZoomPane->MakeVisible( EFalse, EFalse ); + + // Will stop any ongoing zoom + iZoomPane->HandleForegroundEvent( aForeground ); + } + + // Update the view ID for when we come back. + TCamAppViewIds viewId = static_cast( iView.Id().iUid ); + SetPreviousViewId( viewId ); + } + PRINT( _L( "Camera <= CCamPreCaptureContainerBase::HandleForegroundEventL" ) ); + } + + +// ----------------------------------------------------------------------------- +// HandleAppEvent <> +// +// ----------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::HandleAppEvent( const TCamAppEvent& aEvent ) + { + PRINT( _L("Camera => CCamPreCaptureContainerBase::HandleAppEvent") ); + + switch( aEvent ) + { + case ECamAppEventFocusGained: + { + // Clear non-fading flag. It may have been set when showing a note + // in CCamAppUi::ShowErrorNoteL(). + + CEikMenuBar* menuBar = iView.MenuBar(); + TBool menuOpened( EFalse ); + if ( menuBar ) + { + menuOpened = menuBar->IsDisplayed(); + } + + RDrawableWindow* window = DrawableWindow(); + if ( window && !menuOpened ) + { + window->SetNonFading( EFalse ); + } + + if( iBatteryPaneController ) + iBatteryPaneController->Pause( EFalse ); + break; + } + case ECamAppEventFocusLost: + { + if( iBatteryPaneController ) + iBatteryPaneController->Pause( ETrue ); + break; + } + default: + { + break; + } + } + + PRINT( _L("Camera <= CCamPreCaptureContainerBase::HandleAppEvent") ); + } + + +// ---------------------------------------------------- +// CCamPreCaptureContainerBase::MakeVisible +// Handles a change to the controls visibility +// ---------------------------------------------------- +// +void CCamPreCaptureContainerBase::MakeVisible( TBool aVisible ) + { + PRINT1( _L("Camera => CCamPreCaptureContainerBase::MakeVisible, visible:%d"), aVisible ); + + CCamContainerBase::MakeVisible( aVisible ); + + PRINT ( _L("Camera <= CCamPreCaptureContainerBase::MakeVisible") ); + } + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::Draw +// Draw control +// --------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::Draw( const TRect& /*aRect*/ ) const + { + PRINT( _L( "Camera => CCamPreCaptureContainerBase::Draw" ) ); + + CWindowGc& gc = SystemGc(); + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + // Is direct viewfinding active + TBool directVf = appUi ? appUi->IsDirectViewfinderActive() : EFalse; + + // Using bitmap viewfinding and a frame is available + TBool bitmapFrame = !directVf && iReceivedVfFrame && iViewFinderBackup; + + if( iCamOrientation != ECamOrientationCamcorder && + iCamOrientation != ECamOrientationCamcorderLeft && + !( iController.UiConfigManagerPtr() && + iController.IsDirectScreenVFSupported( EFalse ) && + iCamOrientation == ECamOrientationPortrait ) ) + { + // Using secondary camera + } + else if( !bitmapFrame ) + { + // Using primary camera and direct viewfinding is active, there's no bitmap + // viewfinder frame available, or the frame doesn't cover whole screen + // => Paint the background with background color / color key + + gc.SetPenStyle( CGraphicsContext::ENullPen ); + + if( iController.UiConfigManagerPtr() && directVf ) + { + gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); + gc.SetBrushColor( TRgb::Color16MA( 0 ) ); + } + else + { + // Use the background color + gc.SetBrushColor( TRgb( KCamPrecaptureBgColor ) ); + } + + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.DrawRect( Rect() ); + } + else + { + } + if ( bitmapFrame ) + { + // Draw the current bitmap viewfinder frame + DrawFrameNow( gc, iViewFinderBackup ); + } + + gc.Reset(); + if( directVf + && !iController.IsViewFinding() ) + { + return; + } + else + { + //Do nothing + } + DrawScreenFurniture( gc ); + DrawNaviControls( gc ); + PRINT( _L( "Camera <= CCamPreCaptureContainerBase::Draw" ) ); + } + + + + + + +// +// =========================================================================== +// From MCamCameraObserver + +// --------------------------------------------------------------------------- +// virtual HandleCameraEventL +// --------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase +::HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData /*= NULL*/ ) + { + switch( aEventId ) + { + // ----------------------------------------------------- + case ECamCameraEventVfStop: + case ECamCameraEventVfRelease: + // old vf frame being shown when returning from background. + if ( ECamActiveCameraSecondary == iController.ActiveCamera() ) + { + ActivateGc(); + CWindowGc& gc = SystemGc(); + gc.SetBrushColor( KRgbBlack ); + gc.Clear( Rect() ); + DeactivateGc(); + } + iReceivedVfFrame = EFalse; + break; + // ----------------------------------------------------- + case ECamCameraEventVfFrameReady: + { + PRINT_FRQ( _L("Camera => CCamPreCaptureContainerBase::HandleCameraEventL: case ECamCameraEventVfFrameReady") ); + if( KErrNone == aStatus ) + { + // Mark first frame arrived. + iReceivedVfFrame = ETrue; + + // If status is ok, we should always receive a bitmap. + CFbsBitmap* frame = static_cast( aEventData ); + __ASSERT_ALWAYS( frame, CamPanic( ECamPanicNullPointer ) ); + + // Make a duplicate copy of the vfFrame in order to show + // it later on where needed. + if ( iViewFinderBackup ) + { + iViewFinderBackup->Reset(); + } + else + { + TRAP_IGNORE ( iViewFinderBackup = new (ELeave) CFbsBitmap() ); + } + + if ( iViewFinderBackup ) + { + TInt dupeError = iViewFinderBackup->Duplicate(frame->Handle()); + if ( dupeError ) + { + iViewFinderBackup->Reset(); + delete iViewFinderBackup; + iViewFinderBackup = NULL; + } + } + + // Do a redraw. + ActivateGc(); + CWindowGc& gc = SystemGc(); + + PRINT_FRQ4( _L("ECamCameraEventVfFrameReady - rect is %d,%d - %d,%d"), Rect().iTl.iX, Rect().iTl.iY, Rect().iBr.iX, Rect().iBr.iY ) + + if( ECamCapturing == iController.CurrentVideoOperation() ) + { + // ----------------------------------------- + // Draw all content directly to system gc + PRINT_FRQ( _L("Camera <> CCamPreCaptureContainerBase::ShowViewFinderFrame without offscreen bitmap") ) + RWindow window = Window(); + window.Invalidate( Rect() ); + window.BeginRedraw( Rect() ); + DrawToContext(gc, frame); + window.EndRedraw(); + // ----------------------------------------- + } + else + { + if( iBitmapGc ) + { + // ----------------------------------------- + // Draw all content to the offscreen bitmap + DrawToContext( *iBitmapGc, frame ); + + // ----------------------------------------- + // Draw the offscreen bitmap to screen + RWindow window = Window(); + window.Invalidate( Rect() ); + window.BeginRedraw( Rect() ); + gc.BitBlt( TPoint( 0,0 ), iOffScreenBitmap ); + window.EndRedraw(); + // ----------------------------------------- + } + else + { + PRINT_FRQ( _L("Camera <> CCamPreCaptureContainerBase: iBitmapGc == NULL")); + } + } + DeactivateGc(); + PRINT_FRQ( _L("Camera <= CCamPreCaptureContainerBase::HandleCameraEventL") ); + } + break; + } + // ----------------------------------------------------- + case ECamCameraEventSsReady: + { + PRINT( _L( "Camera => CCamPreCaptureContainerBase::HandleCameraEventL: case ECamCameraEventSsReady" ) ); + + CCamAppUi* appUi = static_cast(CEikonEnv::Static()->AppUi()); + + if( KErrNone == aStatus + && ( ECamImageCaptureTimeLapse == appUi->CurrentBurstMode() || + ECamImageCaptureBurst == appUi->CurrentBurstMode() ) ) + { + // In timelapse mode, convert snapshot event to vf frame event + PRINT( _L( "In timelapse mode, converting event to ECamCameraEventVfFrameReady" ) ); + HandleCameraEventL( aStatus, ECamCameraEventVfFrameReady, aEventData ); + } + else if( KErrNone == aStatus && + ECamControllerImage == iController.CurrentMode() && + appUi->ShowPostCaptureView() ) + { + // use mask mode to draw battery pane when showing snapshot + // and hide side pane altogether ( as there is no feasible way to draw + // it properly on top of the snapshot because of the current CCamIndicator implementation) + iSidePane->MakeVisible( EFalse ); + // also hide zoom pane at the same time + iZoomPane->MakeVisible( EFalse, EFalse ); + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMPRECAPTURECONTAINERBASE_HANDLECAMERAEVENTL, "e_CAM_PRI_SHOT_TO_SNAPSHOT 0" ); //CCORAPP_PRI_SHOT_TO_SNAPSHOT_END + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMPRECAPTURECONTAINERBASE_HANDLECAMERAEVENTL, "e_CAM_APP_SNAPSHOT_DRAW 1" ); //CCORAPP_SNAPSHOT_DRAW_START + HandleCameraEventL( aStatus, ECamCameraEventVfFrameReady, aEventData ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMPRECAPTURECONTAINERBASE_HANDLECAMERAEVENTL, "e_CAM_APP_SNAPSHOT_DRAW 0" ); //CCORAPP_SNAPSHOT_DRAW_END + } + + PRINT( _L( "Camera <= CCamPreCaptureContainerBase::HandleCameraEventL" ) ); + break; + } + // ----------------------------------------------------- + default: + { + break; + } + // ----------------------------------------------------- + } + } + + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::DrawToContext +// Draws Screen content to graphics context +// --------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::DrawToContext( CBitmapContext& aGc, + const CFbsBitmap* aFrame ) + { + PRINT( _L( "Camera => CCamPreCaptureContainerBase::DrawToContext" ) ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( !appUi->IsWaitDialog() || !appUi->IsQwerty2ndCamera() ) + { + aGc.SetBrushColor( TRgb( KCamPrecaptureBgColor ) ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetPenColor( TRgb( KCamPrecaptureBgColor ) ); + aGc.SetPenStyle( CGraphicsContext::ESolidPen ); + aGc.DrawRect( Rect() ); + + + DrawFrameNow( aGc, aFrame ); + aGc.SetBrushStyle(CGraphicsContext::ENullBrush ); + DrawScreenFurniture( aGc ); + DrawActivePalette( aGc ); + DrawNaviControls( aGc ); + } + PRINT( _L( "Camera <= CCamPreCaptureContainerBase::DrawToContext" ) ); + } + +// =========================================================================== +// From MCamCameraObserver + +// --------------------------------------------------------------------------- +// IntSettingChangedL <> +// --------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::IntSettingChangedL( + TCamSettingItemIds aSettingItem, + TInt aSettingValue ) + { + switch( aSettingItem ) + { + // ----------------------------------------------------- + case ECamSettingItemViewfinderGrid: + { + PRINT( _L("Camera <> CCamPreCaptureContainerBase::IntSettingChangedL: ECamSettingItemViewfinderGrid") ); + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + if( iVfGridDrawer ) + { + iVfGridDrawer->SetVisible( ECamViewfinderGridOn == aSettingValue ); + if( appUi && appUi->APHandler() ) + { + // Disable the redrawing requested by AP as we do full redraw right after. + // Avoids some unwanted blinking in AP area. + iDisableRedraws = ETrue; + // Not critical if fails. + // Tooltip and icon shown wrong then until next update. + // Cannot leave here, as redraws need to be enabled again. + TRAP_IGNORE( appUi->APHandler()->UpdateActivePaletteL() ); + iDisableRedraws = EFalse; + } + DrawNow(); + } + break; + } + // ----------------------------------------------------- + case ECamSettingItemFaceTracking: + { + PRINT( _L("Camera <> CCamPreCaptureContainerBase::IntSettingChangedL: ECamSettingItemFaceTracking") ); + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + if( appUi && appUi->APHandler() ) + { + // Disable the redrawing requested by AP as we do full redraw right after. + // Avoids some unwanted blinking in AP area. + iDisableRedraws = ETrue; + // Not critical if fails. + // Tooltip and icon shown wrong then until next update. + // Cannot leave here, as redraws need to be enabled again. + TRAP_IGNORE( appUi->APHandler()->UpdateActivePaletteL() ); + iDisableRedraws = EFalse; + } + DrawNow(); + break; + } + // ----------------------------------------------------- + default: + break; + // ----------------------------------------------------- + } + } + +// --------------------------------------------------------------------------- +// TextSettingChangedL <> +// --------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase +::TextSettingChangedL( TCamSettingItemIds /*aSettingItem */, + const TDesC& /*aSettingValue*/ ) + { + /* + switch( aSettingItem ) + { + default: + break; + } + */ + } + + +// =========================================================================== +// + + + + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::DrawFrameNow +// Blit the bitmap +// --------------------------------------------------------- +// +void +CCamPreCaptureContainerBase +::DrawFrameNow( CBitmapContext& aGc, + const CFbsBitmap* aFrame ) const + { +// PRINT( _L("Camera => CCamPreCaptureContainerBase::DrawFrameNow")) + TRect frameRect = ViewFinderFrameRect(); + TSize fsize = aFrame->SizeInPixels(); + + // If the viewfinder bitmap is LARGER than the masked bitmap + // and we should be masked + if ( fsize.iWidth > frameRect.Width() + || fsize.iHeight > frameRect.Height() ) + { + // Work out the rectangle of the viewfinder bitmap to draw + TInt borderX = ( fsize.iWidth - frameRect.Width() ) / 2; + TInt borderY = ( fsize.iHeight - frameRect.Height() ) / 2; + TRect bmCropRect( borderX, borderY, fsize.iWidth - borderX, fsize.iHeight - borderY ); + + // Draw the "crop rect" area of the viewfinder in the cropped frame + aGc.BitBlt( frameRect.iTl, aFrame, bmCropRect ); + } + else if( fsize.iWidth > Rect().Width() + || fsize.iHeight > Rect().Height() ) + { + // Work out the rectangle of the viewfinder bitmap to draw + TInt borderX = ( fsize.iWidth - Rect().Width() ) / 2; + TInt borderY = ( fsize.iHeight - Rect().Height() ) / 2; + TRect bmCropRect( borderX, borderY, fsize.iWidth - borderX, fsize.iHeight - borderY ); + + // Draw the "crop rect" area of the viewfinder in the cropped frame + aGc.BitBlt( frameRect.iTl, aFrame, bmCropRect ); + } + else + { + // Just draw the viewfinder frame in the frame rectangle + aGc.BitBlt( frameRect.iTl, aFrame ); + } +// PRINT( _L("Camera <= CCamPreCaptureContainerBase::DrawFrameNow")) + } + + + + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::DrawReticule +// Draw the reticule +// --------------------------------------------------------- +// +void CCamPreCaptureContainerBase::DrawReticule( CBitmapContext& aGc ) const + { + PRINT_FRQ( _L("Camera => CCamPreCaptureContainerBase::DrawReticule")) + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + ReDrawReticule( iReticuleRect, aGc ); + } + PRINT_FRQ( _L("Camera <= CCamPreCaptureContainerBase::DrawReticule")) + } + +// --------------------------------------------------------- +// ReDrawReticule +// +// Handle partial redraw of reticule. +// NOTE: Could be better optimized for partial redraws. +// --------------------------------------------------------- +// +void +CCamPreCaptureContainerBase +::ReDrawReticule( const TRect& aRect, + CBitmapContext& aGc ) const + { + if( iShowReticule + && iPhotoSceneUsesReticule + && iReticuleRect.Intersects( aRect ) + && iController.IsViewFinding() + && iController.UiConfigManagerPtr() + && iController.UiConfigManagerPtr()->IsAutoFocusSupported() + && !iController.UiConfigManagerPtr()->IsFaceTrackingSupported() + ) + { + aGc.SetClippingRect( aRect ); + + // Overlay reticule (though which bitmap used depends on focus state) + switch ( iFocusState ) + { + case EFocusStateFocusFailed: + DrawAf( aGc, iAfErrIcon ); + break; + case EFocusStateFocusAchieved: + DrawAf( aGc, iAfFocusIcon ); + break; + } + + aGc.CancelClippingRect(); + } + else + { + // Nothing needs to be done. + } + } + + + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::ForceSideZoomPaneDraw +// Force the side-pane or zoom-pane to redraw. +// --------------------------------------------------------- +// +void CCamPreCaptureContainerBase::ForceSideZoomPaneDraw() const + { + if( iSidePane->IsVisible() ) + { + ActivateGc(); + iSidePane->Draw( SystemGc() ); + DeactivateGc(); + } + else + { + ActivateGc(); + iZoomPane->Draw( SystemGc() ); + DeactivateGc(); + } + + } + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::CreateResolutionIndicatorL +// Create the resolution indicator +// --------------------------------------------------------- +// +void CCamPreCaptureContainerBase::CreateResolutionIndicatorL() + { + RArray icons; + CleanupClosePushL( icons ); + + iController.Configuration()->GetPsiIntArrayL( ResolutionIndicatorIconPsiKey(), icons ); + TInt count = icons.Count(); + + // Get the icon rect from the derived class + TRect iconRect = ResolutionIndicatorRect(); + + CCamIndicator* indicator; + for( TInt i = 0; i < count; i+=2 ) + { + indicator = CCamIndicator::NewL( iconRect ); + CleanupStack::PushL( indicator ); + indicator->AddIconL( icons[i], icons[i+1] ); // Bitmap & mask. + indicator->SetRect( iconRect ); + User::LeaveIfError( iResolutionIndicators.Append( indicator ) ); + CleanupStack::Pop( indicator ); + } + + CleanupStack::PopAndDestroy( &icons ); + + // initialise the indicator + SetResolutionIndicator(); + } + +// ---------------------------------------------------- +// CCamPreCaptureContainerBase::BurstModeActiveL +// Notification that the burst mode has been activated/deactivated +// ---------------------------------------------------- +// +void CCamPreCaptureContainerBase::BurstModeActiveL( TBool /*aActive*/, TBool /*aStillModeActive*/ ) + { + SetResolutionIndicator(); + if ( !iController.IsTouchScreenSupported() ) + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + if( appUi && appUi->APHandler() ) + { + // Disable the redrawing requested by AP as we do full redraw right after. + // Avoids some unwanted blinking in AP area. + iDisableRedraws = ETrue; + // Not critical if fails. + // Tooltip and icon shown wrong then until next update. + // Cannot leave here, as redraws need to be enabled again. + TRAP_IGNORE( appUi->APHandler()->UpdateActivePaletteL() ); + iDisableRedraws = EFalse; + } + DrawNow(); + } + } + +// ---------------------------------------------------- +// CCamPreCaptureContainerBase::IncreaseFlashSettingL +// Move up through the flash settings +// ---------------------------------------------------- +// +void CCamPreCaptureContainerBase::IncreaseFlashSettingL() + { + // intentionally doing nothing + } + +// ---------------------------------------------------- +// CCamPreCaptureContainerBase::DecreaseFlashSettingL +// Move down through the flash settings +// ---------------------------------------------------- +// +void CCamPreCaptureContainerBase::DecreaseFlashSettingL() + { + // intentionally doing nothing + } + +// ---------------------------------------------------- +// CCamPreCaptureContainerBase::HandleLeftRightNaviKeyL +// Initiate behaviour in response to a navi key left/right +// arrow press +// ---------------------------------------------------- +// +TKeyResponse CCamPreCaptureContainerBase::HandleLeftRightNaviKeyL( + const TKeyEvent& aKeyEvent, + + TEventCode /*aType*/ ) + { + CCamAppUiBase* appUi = static_cast( iEikonEnv->AppUi() ); + // Find out which behaviour is mapped to the key + TCamPsiKey queryValue = ECamPsiLeftNaviKey; + if ( aKeyEvent.iScanCode == EStdKeyRightArrow ) + { + queryValue = ECamPsiRightNaviKey; + } + else if ( appUi->IsSecondCameraEnabled() ) + { + queryValue = ECamPsiLeftNaviKeyCam2; + } + else + { + // remove lint warning + } + + TInt keyFunction; + User::LeaveIfError( CamUtility::GetPsiInt( queryValue, keyFunction ) ); + + // Handle the key + switch ( keyFunction ) + { + case ECamNaviKeyIncreaseFlashSetting: + { + IncreaseFlashSettingL(); + return EKeyWasConsumed; + } + // No break as unreachable + case ECamNaviKeyDecreaseFlashSetting: + { + DecreaseFlashSettingL(); + return EKeyWasConsumed; + } + // No break as unreachable + + default: + break; + } + return EKeyWasNotConsumed; + } + +// ---------------------------------------------------- +// CCamPreCaptureContainerBase::CountComponentControls +// Return number of child controls owned by this control +// ---------------------------------------------------- +// +TInt CCamPreCaptureContainerBase::CountComponentControls() const + { + TInt count = 0; + if(iActivePalette && iActivePalette->CoeControl()->IsVisible()) + { + count++; //Active Palette + } + + return count; + } + +// ---------------------------------------------------- +// CCamPreCaptureContainerBase::ComponentControl +// Return requested control +// ---------------------------------------------------- +// +CCoeControl* CCamPreCaptureContainerBase::ComponentControl( TInt aIndex ) const + { + CCoeControl* con = NULL; + switch ( aIndex ) + { + + /* + case ECamTimeLapseControl: + { + + if ( iTimeLapseSlider && static_cast( CEikonEnv::Static()->AppUi() )->TimeLapseEnabled() ) + { + con = iTimeLapseSlider; + } + else + + { + con = iNaviCounterControl; + } + break; + } + */ + + case ECamActivePalette: + { + if(iActivePalette && iActivePalette->CoeControl()->IsVisible()) + { + con = iActivePalette->CoeControl(); + } + break; + } + default: + break; + } + return con; + } + + +// ---------------------------------------------------- +// CCamPreCaptureContainerBase::HandleCommand +// Handle CBA key and options menu events for SetupPane +// ---------------------------------------------------- +// + +void CCamPreCaptureContainerBase::HandleCommand( TInt /* aCommand */ ) + { + + } + + +// --------------------------------------------------------- +// CCamPreCaptureContainerBase::GetAutoFocusDelay +// +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::DrawScreenFurniture +// Draw reticule, side or zoom pane and softkeys +// --------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase +::DrawScreenFurniture( CBitmapContext& aGc ) const + { + PRINT_FRQ( _L("Camera => CCamPreCaptureContainerBase::DrawScreenFurniture" )) + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + + TCamOrientation orientation = appUi->CamOrientation(); + if ( iController.ActiveCamera() == ECamActiveCameraPrimary && + ( orientation == ECamOrientationCamcorder || orientation == ECamOrientationCamcorderLeft ) ) + { + // ------------------------------- + // Viewfinder grid + PRINT_FRQ( _L("Camera <> CCamPreCaptureContainerBase: drawing VF grid" ) ); + DrawVfGrid( aGc ); + // ------------------------------- + // Reticule + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + PRINT_FRQ( _L("Camera <> CCamPreCaptureContainerBase: drawing reticule" ) ); + DrawReticule( aGc ); + } + } + else + { + PRINT_FRQ( _L("Camera <> CCamPreCaptureContainerBase: No reticule / grid (as secondary/none camera)") ); + } + + // ------------------------------------------------------- + // Zoom pane +// PRINT( _L("Camera <> CCamPreCaptureContainerBase: condition zoom pane" )) + if ( iZoomPane->IsVisible() && + !iController.SequenceCaptureInProgress() && + iController.ActiveCamera() == ECamActiveCameraPrimary ) + { + PRINT_FRQ( _L("Camera <> CCamPreCaptureContainerBase: drawing zoom pane" )) + iZoomPane->Draw( aGc ); + } + + + // ------------------------------------------------------- + // Side pane indicators + if ( iSidePane->IsVisible() ) + { +// PRINT( _L("Camera <> CCamPreCaptureContainerBase: drawing side pane" )) + iSidePane->Draw( aGc ); + } + +// PRINT( _L("Camera <= CCamPreCaptureContainerBase::DrawScreenFurniture" )) + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::DrawNaviControls +// Draws the navi pane items +// --------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::DrawNaviControls( CBitmapContext& aGc ) const + { +// PRINT( _L("Camera => CCamPreCaptureContainerBase::DrawNaviControls" )) + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + if( appUi ) + { + TCamCameraMode mode = iController.CurrentMode(); + TCamImageCaptureMode imageMode = iController.CurrentImageModeSetup(); + TBool seqCapturing = iController.SequenceCaptureInProgress(); + TBool precaptureUiOn = appUi->DrawPreCaptureCourtesyUI(); + TBool paneVisible = EFalse; + + if( iProcessingText && //iProcessingBg && + iController.ActiveCamera() != ECamActiveCameraSecondary && + // ECamCaptureModeStill == appUi->CurrentCaptureMode() && + ECamControllerImage == iController.CurrentMode() && + // ECamOperationCaptureInProgress == iController.OperationState() + ECamImageCaptureNone == appUi->CurrentBurstMode() && // No text for sequence + ( ECamCapturing == iController.CurrentOperation() || + ECamCompleting == iController.CurrentOperation() ) + ) + { + // When iProcessingText exists (and we are in correct state), the processing + // image text needs to be drawn. + PRINT( _L("Camera <> CCamPreCaptureContainerBase: draw processing text.." ) ); + //iProcessingBg->Draw( aGc, Rect() ); + aGc.SetBrushColor( KRgbWhite ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + iProcessingTextLayout.DrawText( aGc, *iProcessingText, ETrue, KRgbBlack ); + } + else if( iBurstProcessingText && + iController.ActiveCamera() != ECamActiveCameraSecondary && + ECamControllerImage == iController.CurrentMode() && + ( ECamImageCaptureBurst == appUi->CurrentBurstMode() && + ( ECamCapturing == iController.CurrentOperation() || + ECamCompleting == iController.CurrentOperation() ) && + iController.AllSnapshotsReceived() ) ) + { + PRINT( _L("Camera <> CCamPreCaptureContainerBase: draw burst processing text.." ) ); + aGc.SetBrushColor( KRgbWhite ); + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + // localizing numbers in burst processing string + TPtr pointer = iBurstProcessingText->Des(); + AknTextUtils::LanguageSpecificNumberConversion( pointer ); + iBurstProcessingTextLayout.DrawText( aGc, *iBurstProcessingText, ETrue, KRgbBlack ); + } + else if( ECamPaneCounter == iPaneInUse ) + { + TBool showCounter = precaptureUiOn || seqCapturing; + TBool focusStateOk = ETrue; + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + + focusStateOk = + ( EFocusStateNormal == iFocusState && + !iController.SequenceCaptureInProgress() ) || + ( imageMode == ECamImageCaptureBurst && + ( iController.CurrentOperation() == ECamCapturing || + ( iController.CurrentOperation() == ECamCompleting + && !iController.AllSnapshotsReceived() ) ) ); + + } + + if( focusStateOk || + ( showCounter && appUi->IsSecondCameraEnabled() ) ) + { + paneVisible = ETrue; + iNaviCounterControl->DrawNaviCtr( aGc ); + } + } + else if( ECamPaneProgress == iPaneInUse ) + { + paneVisible = ETrue; + iNaviProgressBarControl->DrawProgressBar( aGc ); + iNaviCounterControl->DrawNaviCtr( aGc ); + } + else + { + // Navi pane is not shown + paneVisible = EFalse; + } + + // Do not show if saving / focusing + TCamCaptureOperation operation = iController.CurrentOperation(); + TCamCaptureOperation videoOperation = iController.CurrentVideoOperation(); + + TBool operationOk = ( ECamNoOperation == operation + || ECamCompleting != videoOperation ); + + // In video mode, icon would show without panes when stopping + // if viev state is not checked. + if( appUi->CurrentViewState() == ECamViewStatePreCapture + && precaptureUiOn + && paneVisible + && operationOk + && !seqCapturing + ) + { + // Draw the resolution indicator + if ( appUi->ActiveCamera() == ECamActiveCameraPrimary + && ( CamUtility::IsNhdDevice() + || videoOperation == ECamNoOperation ) ) + { + iResolutionIndicators[iCurrentIndicator]->Draw( aGc ); + } + + DrawAdditionalIcons( aGc ); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + if ( iLocationIndicatorVisible ) + { + // Draw the location indicator + iLocationIconController->Draw( aGc ); + } + } + } + + if( iBatteryPaneController ) + { + iBatteryPaneController->Draw( aGc ); + } + + } + +// PRINT( _L("Camera <= CCamPreCaptureContainerBase::DrawNaviControls" )) + } + + +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::DrawActivePalette +// Draws the active palette +// --------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::DrawActivePalette() const + { + + PRINT( _L("Camera => CCamPreCaptureContainerBase::DrawActivePalette") ); + if ( !iController.IsTouchScreenSupported() ) + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + // draw the active palette if needed + if( iActivePalette && appUi->DrawPreCaptureCourtesyUI() ) + { + PRINT( _L("Camera <> drawing active palette") ); + iActivePalette->RenderActivePalette( Rect() ); + } + } + + PRINT( _L("Camera <= CCamPreCaptureContainerBase::DrawActivePalette") ); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::DrawActivePalette +// Draws the active palette +// --------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::DrawActivePalette( CBitmapContext& aGc ) const + { + PRINT_FRQ( _L("Camera => CCamPreCaptureContainerBase::DrawActivePalette( aGc )") ); + if ( !iController.IsTouchScreenSupported() ) + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + // draw the active palette if needed + if( iActivePalette && appUi->DrawPreCaptureCourtesyUI() ) + { + PRINT_FRQ( _L("Camera <> drawing active palette..") ); + iActivePalette->SetGc( &aGc ); + iActivePalette->RenderActivePalette( Rect() ); + iActivePalette->SetGc(); + } + } + PRINT_FRQ( _L("Camera <= CCamPreCaptureContainerBase::DrawActivePalette") ); + } + + +// ----------------------------------------------------------------------------- +// virtual CCamPreCaptureContainerBase::DrawVfGrid +// ----------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::DrawVfGrid( CBitmapContext& aGc ) const + { + PRINT_FRQ( _L("Camera => CCamPreCaptureContainerBase::DrawVfGrid") ); + // Draws nothing if not set visible. + if( iVfGridDrawer ) + { + iVfGridDrawer->Draw( iRect, aGc ); + } + PRINT_FRQ( _L("Camera <= CCamPreCaptureContainerBase::DrawVfGrid") ); + } + +// ----------------------------------------------------------------------------- +// virtual CCamPreCaptureContainerBase::ReDrawVfGrid +// ----------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::ReDrawVfGrid( const TRect& aRect, + CBitmapContext& aGc ) const + { + PRINT_FRQ( _L("Camera => CCamPreCaptureContainerBase::ReDrawVfGrid") ); + // Draws nothing if not set visible. + if( iVfGridDrawer + && iVfGridRect.Intersects( aRect ) + ) + { + iVfGridDrawer->Draw( aRect, aGc ); + } + PRINT_FRQ( _L("Camera <= CCamPreCaptureContainerBase::ReDrawVfGrid") ); + } + +// ----------------------------------------------------------------------------- +// virtual GetVFGridVisibilitySetting +// +// ----------------------------------------------------------------------------- +// +TBool +CCamPreCaptureContainerBase::GetVFGridVisibilitySetting() const + { + TInt value = iController.IntegerSettingValue( ECamSettingItemViewfinderGrid ); + return (ECamViewfinderGridOn == value); + } + + +// ----------------------------------------------------------------------------- +// virtual ResetVFGridVisibility +// +// ----------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::ResetVFGridVisibility() + { + if( iVfGridDrawer ) + { + iVfGridDrawer->SetVisible( GetVFGridVisibilitySetting() ); + } + } + + +// ----------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::Redraw +// +// Redraw only part of screen. +// Active Palette animations need this to update its background. +// ----------------------------------------------------------------------------- +void CCamPreCaptureContainerBase::Redraw( const TRect& aArea ) + { + PRINT( _L("Camera => CCamPreCaptureContainerBase::Redraw") ); + + if( iDisableRedraws ) + { + PRINT( _L("Camera <= CCamPreCaptureContainerBase: redraw skipped") ); + return; + } + + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + if( appUi && appUi->IsDirectViewfinderActive() ) + { + CWindowGc& gc = SystemGc(); + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); + gc.SetBrushColor( TRgb::Color16MA( 0 ) ); + gc.DrawRect( aArea ); + + // Viewfinder grid and reticule overlap with tooltips + // or Active Palette moving in/out the screen. + ReDrawVfGrid( aArea, gc ); + + if( iController.ActiveCamera() != ECamActiveCameraSecondary + && iController.UiConfigManagerPtr() + && iController.UiConfigManagerPtr()->IsAutoFocusSupported() + && !iTimeLapseVisible ) + { + ReDrawReticule( aArea, gc ); + } + } + else + { + if ( iBitmapGc ) + { + if ( iReceivedVfFrame && iViewFinderBackup ) + { + iBitmapGc->BitBlt( aArea.iTl, iViewFinderBackup, aArea ); + } + else + { + iBitmapGc->SetBrushColor( TRgb( KCamPrecaptureBgColor ) ); + iBitmapGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + iBitmapGc->DrawRect( aArea ); + iBitmapGc->SetBrushStyle( CGraphicsContext::ENullBrush ); + } + ReDrawVfGrid( aArea, *iBitmapGc ); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + ReDrawReticule( aArea, *iBitmapGc ); + } + } + } + PRINT( _L("Camera <= CCamPreCaptureContainerBase::Redraw") ); + } + + + +// ----------------------------------------------------------------------------- +// HandleOperationStateChangeEventL +// +// Helper method to handle case ECamEventOperationStateChanged in +// HandleControllerEventL. +// ----------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::HandleOperationStateChangeEventL() + { + PRINT( _L("Camera => CCamPreCaptureContainerBase::HandleFocusStateChangeEventL") ); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + if( iPhotoSceneUsesReticule ) + { + TBool ftSupported = iController.UiConfigManagerPtr()->IsFaceTrackingSupported(); + switch ( iController.CurrentOperation() ) + { + // --------------------------------------------------- + case ECamFocusing: + { + PRINT(_L("Camera <> CCamPreCaptureContainerBase: FOCUSING")); + // set focusing icon - flashing + iFocusState = EFocusStateFocusing; + if ( !ftSupported ) + { + iReticuleFlashOn = ETrue; + + // Start reticule flashing timer + if ( iReticuleTimer->IsActive() ) + { + iReticuleTimer->Cancel(); + } + iReticuleTimer->Start( KReticuleFlashTimeout, + KReticuleFlashTimeout, + TCallBack(ReticuleTimerCallback , this) ); + } + // Hide the navi counter + iNaviCounterControl->MakeVisible( EFalse ); + + DrawDeferred(); + break; + } + // --------------------------------------------------- + case ECamFocused: + { + PRINT(_L("Camera <> CCamPreCaptureContainerBase: FOCUSED")); + // set focus achieved icon + iFocusState = EFocusStateFocusAchieved; + if ( !ftSupported ) + { + iReticuleTimer->Cancel(); + iReticuleFlashOn = ETrue; + } + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMPRECAPTURECONTAINERBASE_HANDLEOPERATIONSTATECHANGEEVENTL, "e_CAM_APP_OVERLAY_UPD 0" ); //CCORAPP_OVERLAY_UPD_END + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMPRECAPTURECONTAINERBASE_HANDLEOPERATIONSTATECHANGEEVENTL, "e_CAM_APP_AF 0" ); //CCORAPP_AF_END + + DrawDeferred(); + break; + } + // --------------------------------------------------- + case ECamFocusFailed: + { + PRINT(_L("Camera <> CCamPreCaptureContainerBase: FOCUS FAILED")); + // set focus failed icon + iFocusState = EFocusStateFocusFailed; + if ( !ftSupported ) + { + iReticuleTimer->Cancel(); + iReticuleFlashOn = ETrue; + } + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMPRECAPTURECONTAINERBASE_HANDLEOPERATIONSTATECHANGEEVENTL, "e_CAM_APP_OVERLAY_UPD 0" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMPRECAPTURECONTAINERBASE_HANDLEOPERATIONSTATECHANGEEVENTL, "e_CAM_APP_AF 0" ); + + DrawDeferred(); + break; + } + // --------------------------------------------------- + case ECamCapturing: + { + PRINT(_L("Camera <> CCamPreCaptureContainerBase: Capturing")); + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + if( appUi ) + { + // If in burst mode show the navi counter again + if( ECamImageCaptureBurst == appUi->CurrentBurstMode() ) + { + iNaviCounterControl->MakeVisible( ETrue ); + DrawDeferred(); + } + } + break; + } + // --------------------------------------------------- + case ECamNoOperation: + { + PRINT( _L("Camera <> CCamPreCaptureContainerBase:ECamNone")); + // Show the navi counter again + if ( iPaneInUse == ECamPaneCounter + && iController.IsAppUiAvailable() + ) + { + iNaviCounterControl->MakeVisible( ETrue ); + } + } + // lint -fallthrough + // Captured and saving or.. + case ECamCompleting: + { + PRINT1( _L("Camera <> CCamPreCaptureContainerBase: NOT FOCUSED ANY MORE, iFocusState=%d"), iFocusState ); + if ( iFocusState == EFocusStateFocusing ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMPRECAPTURECONTAINERBASE_HANDLEOPERATIONSTATECHANGEEVENTL, "e_CAM_APP_OVERLAY_UPD 0" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMPRECAPTURECONTAINERBASE_HANDLEOPERATIONSTATECHANGEEVENTL, "e_CAM_APP_AF 0" ); + } + + // clear focus indicator + iFocusState = EFocusStateNormal; + if ( !ftSupported ) + { + iReticuleTimer->Cancel(); + iReticuleFlashOn = ETrue; + } + iSidePane->MakeVisible(ETrue); + DrawDeferred(); + break; + } + // --------------------------------------------------- + default: + break; + } // switch + } // if + } + + PRINT( _L("Camera <= CCamPreCaptureContainerBase::HandleFocusStateChangeEventL") ); + } + + + +// ----------------------------------------------------------------------------- +// SetupActivePaletteL +// +// (Re)Initializes Active Palette. This includes: +// 1) Creating Active Palette if needed +// 2) Clearing Active Palette existing items if needed +// - 1+2 done in CCamContainerBase::CreateActivePaletteL() +// 3) Setting Active Palette items from resource +// - resource is selected in GetAPResourceId which is +// implemented in inheriting classes. +// 4) Registering the view for AP +// 5) Setting the focus to the default AP item +// ----------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::SetupActivePaletteL( CCamViewBase* aView ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMPRECAPTURECONTAINERBASE_SETUPACTIVEPALETTEL, "e_CAM_APP_ACTIVEPALETTE_INIT 1" ); + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + if ( !iController.IsTouchScreenSupported() + && ( !appUi->IsSecondCameraEnabled() + || ( !appUi->IsEmbedded() && appUi->IsSecondCameraEnabled() ) ) ) + { + // Creates active palette if needed. + // Clears items if active palette already exists. + CCamContainerBase::CreateActivePaletteL(); + + // Video and still precapture containers implement this method. + TInt resId = GetAPResourceId(); + + CCamActivePaletteHandler* apHandler = + static_cast( iEikonEnv->AppUi() )->APHandler(); + + apHandler->InstallAPItemsL( resId ); + apHandler->SetView( aView ); + + if ( appUi->IsEmbedded() ) + { +/*#ifndef __WINS__ + if ( !appUi->IsInCallSend() ) +#endif*/ + { + // disable still/video mode switching in normal embedded mode + apHandler->SetItemVisible( ECamCmdNewVideo, EFalse ); + apHandler->SetItemVisible( ECamCmdNewPhoto, EFalse ); + } + } + + apHandler->ResetToDefaultItem(); + } + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMPRECAPTURECONTAINERBASE_SETUPACTIVEPALETTEL, "e_CAM_APP_ACTIVEPALETTE_INIT 0" ); + } + + +// ----------------------------------------------------------------------------- +// CCamPostCaptureContainer::BatteryPaneUpdated +// +// Called by CCamBatteryPaneController when battery pane content has been updated. +// Re-draws background under the battery pane and the battery pane itself. +// ----------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::BatteryPaneUpdated() + { + if( !iDisableRedraws && iBatteryPaneController ) + { + // Activate Gc + ActivateGc(); + + // Draw the battery pane + CWindowGc& gc = SystemGc(); + iBatteryPaneController->Draw( gc ); + + DeactivateGc(); + } + + } + +// ----------------------------------------------------------------------------- +// CCamPostCaptureContainer::LocationIconUpdated +// +// Called by CCamLocationIconController when battery pane content has been updated. +// Re-draws background under the location icon and the location icon itself. +// ----------------------------------------------------------------------------- +// +void CCamPreCaptureContainerBase::LocationIconUpdated() + { + PRINT( _L("Camera => CCamPreCaptureContainerBase::LocationIconUpdated()") ); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + if ( !iDisableRedraws && iLocationIconController + && iController.IsViewFinding() + ) + { + // Get the location icon rectangle + TRect rect = iLocationIconController->Rect(); + // Activate Gc + ActivateGc(); + + // Invalidate the location icon area + RWindow window = Window(); + window.Invalidate( rect ); + window.BeginRedraw( rect ); + + // Redraw the background in that area + Redraw( rect ); + + // Draw the location icon + CWindowGc& gc = SystemGc(); + // Other navi controls should be drawn also before drawing location icon + // The drawing is done through DrawNaviControls() function since + // the background decoration should be drawn before the location indicator + DrawNaviControls(gc); + + // Tell the window redraw is finished and deactivate Gc + window.EndRedraw(); + DeactivateGc(); + } + } + PRINT( _L("Camera <= CCamPreCaptureContainerBase::LocationIconUpdated()") ); + } + +// ----------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::HandleResourceChange +// +// Passes resource changes to battery pane controller +// ----------------------------------------------------------------------------- +// +void +CCamPreCaptureContainerBase::HandleResourceChange( TInt aType ) + { + if( iBatteryPaneController ) + { + // Inform battery pane of the resource change + iBatteryPaneController->HandleResourceChange( aType ); + } + + CCamContainerBase::HandleResourceChange( aType ); + } + + +// +// CCamPreCaptureContainerBase::HandlePointerEventL +// +void CCamPreCaptureContainerBase::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + PRINT3( _L("CCamPreCaptureContainerBase::HandlePointerEventL iType=%d iPosition=(%d, %d)"), + aPointerEvent.iType, + aPointerEvent.iPosition.iX, + aPointerEvent.iPosition.iY ); + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + if ( !appUi->IsSecondCameraEnabled() ) + { + // don't let zoom pane be used when capturing image + if ( iController.CurrentMode() != ECamControllerImage || + (iController.CurrentOperation() != ECamCapturing && + iController.CurrentOperation() != ECamCompleting) ) + { + if ( iZoomPane ) + { + if ( iZoomPane->HandlePointerEventL( aPointerEvent ) ) + { + ShowZoomPaneWithTimer(); + return; + } + } + } + + if ( aPointerEvent.iType == TPointerEvent::EButton1Down && + !appUi->DrawPreCaptureCourtesyUI() ) + { + appUi->HandleCommandL( ECamCmdRaiseCourtesyUI ); + } + + CCamContainerBase::HandlePointerEventL( aPointerEvent ); + } + PRINT( _L("Camera <= CCamPreCaptureContainerBase::HandlePointerEventL") ); + } + +// --------------------------------------------------------------------------- +// returns a count, not an error +// --------------------------------------------------------------------------- +// +TInt CCamPreCaptureContainerBase::CreateAfIconL( TRgb aColor ) + { + TInt AFIconCount(0); + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + CreateAfCornerL( aColor, EMbmCameraappQgn_indi_cam4_focus_frame_auto_tl ); + CreateAfCornerL( aColor, EMbmCameraappQgn_indi_cam4_focus_frame_auto_tr ); + CreateAfCornerL( aColor, EMbmCameraappQgn_indi_cam4_focus_frame_auto_bl ); + CreateAfCornerL( aColor, EMbmCameraappQgn_indi_cam4_focus_frame_auto_br ); + + AFIconCount = iAfIcons.Count(); + } + return AFIconCount; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamPreCaptureContainerBase::CreateAfCornerL( TRgb aColor, + TInt aFileBitmapId ) + { + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + TFileName mbmFileName; + CamUtility::ResourceFileName( mbmFileName ); + TPtrC resname = mbmFileName; + + CFbsBitmap* bitmap = NULL; + CFbsBitmap* mask = NULL; + + // Create component bitmaps + AknIconUtils::CreateIconL( bitmap, mask, resname, + aFileBitmapId, aFileBitmapId+1 ); + + AknIconUtils::SetSize( bitmap, iAfIconCornerSize ); + CleanupStack::PushL( bitmap ); + CleanupStack::PushL( mask ); + + // Destroys mask, if doesn't leave + CamUtility::SetAlphaL( bitmap, mask, aColor ); + CleanupStack::Pop(); // (deleted) mask + User::LeaveIfError( iAfIcons.Append( bitmap ) ); + CleanupStack::Pop(); // bitmap + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamPreCaptureContainerBase::SetAfIconSize( TInt aOffset ) + { + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() && + aOffset-- && iAfIcons.Count() > aOffset ) + { + for ( TInt i = aOffset; i > aOffset - KAFIconCorners ; i-- ) + { + AknIconUtils::SetSize( iAfIcons[i], iAfIconCornerSize ); + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamPreCaptureContainerBase::DrawAf( CBitmapContext& aGc, + TInt aOffset ) const + { + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + TInt indx = aOffset - KAFIconCorners; + TInt corners = 0; + if ( aOffset && iAfIcons.Count() >= aOffset ) + { + while ( corners < KAFIconCorners && iLayouts.Count() > corners ) + { + TAknLayoutRect layout = iLayouts[corners]; + + aGc.BitBlt( layout.Rect().iTl, iAfIcons[ indx + corners ]); + corners++; + } + } + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamPreCaptureContainerBase::SizeChanged() + { + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + if ( CamUtility::IsNhdDevice() ) + { + TouchLayout(); + } + else + { + NonTouchLayout(); + } + + if( !iController.UiConfigManagerPtr()->IsFaceTrackingSupported() ) + { + SetAfIconSize( iAfReadyIcon ); + SetAfIconSize( iAfFocusIcon ); + SetAfIconSize( iAfErrIcon ); + } + } + else + { + CCoeControl::SizeChanged(); + } + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::NonTouchLayout +// --------------------------------------------------------------------------- +void CCamPreCaptureContainerBase::NonTouchLayout() + { + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + iLayouts.Reset(); + TAknLayoutRect parent; + TAknLayoutRect tmp; + TBool variant = Layout_Meta_Data::IsLandscapeOrientation(); + TRect vfRect = ViewFinderFrameRect(); + + // Autofocus parent rectangle + parent.LayoutRect( vfRect, + AknLayoutScalable_Apps::cam6_autofocus_pane( variant ).LayoutLine() ); + iReticuleRect = parent.Rect(); + iReticuleRect.Move( vfRect.Center() - parent.Rect().Center() ); + + tmp.LayoutRect( iReticuleRect, AknLayoutScalable_Apps:: + cam6_autofocus_pane_g1().LayoutLine() ); + iAfIconCornerSize = tmp.Rect().Size(); + iLayouts.Append( tmp ); // First corner + tmp.LayoutRect( iReticuleRect, AknLayoutScalable_Apps:: + cam6_autofocus_pane_g2().LayoutLine() ); + iLayouts.Append( tmp ); + tmp.LayoutRect( iReticuleRect, AknLayoutScalable_Apps:: + cam6_autofocus_pane_g3().LayoutLine() ); + iLayouts.Append( tmp ); + tmp.LayoutRect( iReticuleRect, AknLayoutScalable_Apps:: + cam6_autofocus_pane_g4().LayoutLine() ); + iLayouts.Append( tmp ); + } + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureContainerBase::TouchLayout +// --------------------------------------------------------------------------- +void CCamPreCaptureContainerBase::TouchLayout() + { + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + iLayouts.Reset(); + TAknLayoutRect parent; + TAknLayoutRect tmp; + TBool variant = Layout_Meta_Data::IsLandscapeOrientation(); + TRect vfRect = ViewFinderFrameRect(); + + // Autofocus parent rectangle + parent.LayoutRect( vfRect, + AknLayoutScalable_Apps::cam4_autofocus_pane( variant ).LayoutLine() ); + iReticuleRect = parent.Rect(); + iReticuleRect.Move( vfRect.Center() - parent.Rect().Center() ); + + tmp.LayoutRect( iReticuleRect, AknLayoutScalable_Apps:: + cam4_autofocus_pane_g1().LayoutLine() ); + iAfIconCornerSize = tmp.Rect().Size(); + iLayouts.Append( tmp ); // First corner + tmp.LayoutRect( iReticuleRect, AknLayoutScalable_Apps:: + cam4_autofocus_pane_g2().LayoutLine() ); + iLayouts.Append( tmp ); + tmp.LayoutRect( iReticuleRect, AknLayoutScalable_Apps:: + cam4_autofocus_pane_g3().LayoutLine() ); + iLayouts.Append( tmp ); + tmp.LayoutRect( iReticuleRect, AknLayoutScalable_Apps:: + cam4_autofocus_pane_g3_copy1().LayoutLine() ); + iLayouts.Append( tmp ); + } + } + +// ---------------------------------------------------- +// CCamPreCaptureContainerBase::ResolutionIndicatorRect +// Returns the rectangle defining the position and size +// of the resolution icon +// ---------------------------------------------------- +// +TRect CCamPreCaptureContainerBase::ResolutionIndicatorRect() const + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + TAknLayoutRect resolutionIconLayout; + TAknLayoutRect indicatorPane; + if ( CamUtility::IsNhdDevice() ) + { + TInt variant = Layout_Meta_Data::IsLandscapeOrientation(); + indicatorPane.LayoutRect( Rect(), + AknLayoutScalable_Apps::cam4_indicators_pane( variant ) ); + + resolutionIconLayout.LayoutRect( indicatorPane.Rect(), + AknLayoutScalable_Apps::cam4_indicators_pane_g1() ); + } + else + { + TInt cba = AknLayoutUtils::CbaLocation() == + AknLayoutUtils::EAknCbaLocationLeft? + AknLayoutUtils::EAknCbaLocationLeft : 0; + + if ( appUi->TargetMode() == ECamControllerVideo ) + { + indicatorPane.LayoutRect( Rect(), + AknLayoutScalable_Apps::vid6_indi_pane( cba )); + + resolutionIconLayout.LayoutRect( indicatorPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g1( cba ) ); + } + else + { + indicatorPane.LayoutRect( Rect(), + AknLayoutScalable_Apps::cam6_indi_pane( cba )); + + resolutionIconLayout.LayoutRect( indicatorPane.Rect(), + AknLayoutScalable_Apps::cam6_indi_pane_g1( cba ) ); + } + } + return resolutionIconLayout.Rect(); + } + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamPreCaptureViewBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamPreCaptureViewBase.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1748 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for pre capture views* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Cam.hrh" +#include "CamAppUi.h" +#include "CamUtility.h" +#include "CamAppController.h" +#include "CamPreCaptureContainerBase.h" +#include "CamLogger.h" +#include "CamPanic.h" +#include "CamCaptureSetupMenu.h" +#include "CamStandbyContainer.h" +#include "CamSelfTimer.h" +#include "CamTimer.h" +#include "camactivepalettehandler.h" +#include "CamPreCaptureViewBase.h" +#include "CameraUiConfigManager.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamPreCaptureViewBaseTraces.h" +#endif + + +// =========================================================================== +// Constants + + + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase destructor +// +// --------------------------------------------------------------------------- +// +CCamPreCaptureViewBase::~CCamPreCaptureViewBase() + { + PRINT( _L("Camera => ~CCamPreCaptureViewBase") ); + PRINT( _L("Camera <= ~CCamPreCaptureViewBase") ); + } + +// ----------------------------------------------------------------------------- +// CCamPreCaptureViewBase::HandleCommandL +// Handle commands +// ----------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::HandleCommandL( TInt aCommand ) + { + PRINT( _L("Camera => CCamPreCaptureViewBase::HandleCommandL") ); + + switch ( aCommand ) + { + case ECamCmdShootSetup: + { + CCamAppUiBase* appUi = static_cast( AppUi() ); + TBool selfTimerEnabled = appUi->SelfTimerEnabled(); + + if ( selfTimerEnabled ) + { + CCamSelfTimer* selftimer = appUi->SelfTimer(); + + // If self-timer is enabled, we need to check that it is in + // self-timer standby, ie Enabled but not Active (ie not + // counting down) + if ( selftimer && !selftimer->IsActive() ) + { + // In self-timer standby, pressing "select" button starts + // self-timer count down. Pass this event on to AppUi. + appUi->HandleCommandL( ECamCmdSelfTimerActivate ); + } + } + else + { + // we are not in self -timer mode and check we are + // not already in capture setup mode + if ( !iCaptureSetupMenuModeActive ) + { + // Ensure first item is selected in CSM. + iCaptureSetupMenuLastItemIndex = 0; + SwitchToCaptureSetupMenuModeL(); + } + + } + } + break; + + // If an item in the capture setup menu has been selected. + case EAknSoftkeySelect: + { + if ( ActiveSettingMode() == ECamSettingModeCaptureMenu ) + { + iCaptureSetupMenuContainer->HandleCommandL( aCommand ); + } + else + { + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + } + } + break; + + // If capture setup menu is active and user presses softkey back, + // deactivate the menu. This is EEikBidCancel which has the same + // enumeration value as EAknSoftkeyCancel. + case EAknSoftkeyCancel: + { + if ( ActiveSettingMode() == ECamSettingModeCaptureMenu ) + { + ExitCaptureSetupMenuModeL(); + } + else if ( iController.SequenceCaptureInProgress() ) + // Check if currently capturing a burst, if so, cancel it + { + // If already received all the snapshots + if ( iController.AllSnapshotsReceived() ) + { + // stop burst immediately + iController.StopSequenceCaptureL(); + } + else + { + // capture the min images (2), before stopping the burst + iController.SetKeyUp( ETrue ); + iController.SoftStopBurstL( ETrue ); + } + // Update CBA for setup pane usage + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + else + { + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + } + } + break; + case EAknSoftkeyOptions: + { + // do nothing, the command is handled by the framework + } + break; + + // Note: CaptureSetupMenu mode also uses a 'Back' softkey but this has + // the command value EEikBidCancel + case EAknSoftkeyBack: + { + // exit to embedded app if we're embedded and in plain pre-capture + if ( iEmbedded + && ActiveSettingMode() != ECamSettingModeScene + && ActiveSettingMode() != ECamSettingModeInfoListBox ) + { + CCamCaptureSetupViewBase::HandleCommandL( ECamCmdInternalExit ); + } + else + { + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + } + + } + break; + + case EAknSoftkeyOk: + { + // Else pass on to lower levels + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + } + break; + + case ECamCmdToggleCourtesyUI: + { + CCamAppUi* appUi = static_cast( AppUi() ); + + if ( appUi ) + { + appUi->SetAlwaysDrawPreCaptureCourtesyUI( !appUi->AlwaysDrawPreCaptureCourtesyUI() ); + } + } + break; + case ECamCmdPopUpMenuZoom: + { + iContainer->ShowZoomPaneWithTimer(); + } + break; + case ECamCmdCaptureSetupFlashStill: + { + iToolbarExtensionInvisible = ETrue; + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + } + break; + case ECamCmdInternalExit: + { + const TCamCaptureOperation operation( + iController.CurrentOperation() ); + + if ( ECamPaused == operation ) + { + iController.StopVideoRecording(); + iController.SetCaptureKeyPressedWhileImageSaving( ETrue ); + } + StopViewFinder(); + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + CAknToolbarExtension* extension = + fixedToolbar->ToolbarExtension(); + if ( extension ) + { + // Reset toolbar extension button and view to closed state + extension->SetShown( EFalse ); + extension->SetCurrentState( 0, EFalse ); + } + } + } + } + break; + default: + { + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + } + } + PRINT( _L("Camera <= CCamPreCaptureViewBase::HandleCommandL") ); + } + +// ----------------------------------------------------------------------------- +// CCamPreCaptureViewBase::HandleForegroundEventL +// Handle a move to the foreground +// ----------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::HandleForegroundEventL( TBool aForeground ) + { + PRINT1( _L( "Camera => CCamPreCaptureViewBase::HandleForegroundEventL %d" ), aForeground ); + + CCamAppUi* appUi = static_cast( AppUi() ); + __ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer)); + + // ----------------------------------------------------- + // coming to the foreground + if ( aForeground ) + { + // Ignore foregrounding if view switch to postcapture anyway in progress. + if( appUi->TargetViewState() == ECamViewStatePostCapture + || appUi->TargetViewState() == ECamViewStateBurstThumbnail ) { + PRINT( _L( "Camera <= CCamPreCaptureViewBase::HandleForegroundEventL, ignored as going to postcapture") ); + return; + } + + + if ( !( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) ) + { + if ( !iController.IsTouchScreenSupported() ) + { + if ( !appUi->ActivePalette() ) + { + SetupActivePaletteL(); + } + else + { + appUi->APHandler()->UpdateActivePaletteL(); + } + } + } + UpdateCbaL(); + + // restart idle timer in any case + iController.StartIdleTimer(); + + // If capture setup menu is active then ensure background is faded. + if ( iCaptureSetupMenuContainer ) + { + iCaptureSetupMenuContainer->FadeBehind( ETrue ); + } + + // coming to the foreground from an eikon server window + if ( iContinueInBackground ) + { + iContinueInBackground = EFalse; + + if ( !iController.IsViewFinding() && !iSceneSettingModeActive ) + { + iController.StartViewFinder(); + } + else if( iLocationTrailConnecting ) + { + iLocationTrailConnecting = EFalse; + iController.StopViewFinder(); + iController.StartViewFinder(); + } + CCamCaptureSetupViewBase::HandleForegroundEventL( aForeground ); + + UpdateCbaL(); + if ( iController.CameraSwitchQueued() ) + { + appUi->HandleCommandL( ECamCmdSwitchCamera ); + } + PRINT( _L( "Camera <= CCamPreCaptureViewBase::HandleForegroundEventL - continuing in background" ) ); + return; + } + + // This only happens when the app is first launched + if ( !appUi->IsConstructionComplete() && + !iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported()) + { + iActivateToStandby = ETrue; + if ( !iStandbyModeActive ) + { + //iStandbyError = KErrNone; + appUi->SetStandbyStatus( KErrNone ); + PRINT( _L( "Camera <> CCamPreCaptureViewBase::HandleForegroundEventL: sending ECamCmdGoToStandby" ) ); + HandleCommandL( ECamCmdGoToStandby ); + SetTitlePaneTextL(); + } + } + + // Register that we want to use the engine + IncrementCameraUsers(); + + if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() ) + { + if ( iController.CameraSwitchQueued() ) + { + appUi->HandleCommandL( ECamCmdSwitchCamera ); + } + else if ( appUi->TargetViewState() != ECamViewStatePostCapture ) + { + TCamCameraMode mode = iController.CurrentMode(); + if ( mode == ECamControllerVideo ) + { + iController.EnterViewfinderMode( ECamControllerVideo ); + } + else if( mode == ECamControllerImage && !iSceneSettingModeActive ) + { + iController.EnterViewfinderMode( ECamControllerImage ); + } + } + UpdateCbaL(); + } + else + { + // Lens cover is not supported + if ( iController.CameraSwitchQueued() ) + { + appUi->HandleCommandL( ECamCmdSwitchCamera ); + } + } + + + // Start the viewfinder unless the view is activating into standby mode + // in other modes than scene setting mode (there is no VF and this causes problems with DSA VF) + if ( ( !iStandbyModeActive || !iActivateToStandby ) && !iSceneSettingModeActive ) + { + // If in embedded mode and image has been captured but view is not yet in + // postcapture view VF should not be started. + if( !iAssumePostCaptureView ) + { + PRINT( _L("Camera <> CCamPreCaptureViewBase::HandleForegroundEventL start VF")) + StartViewFinder(); + } + } + + + // + // if ( iController.EngineState() == ECamEngineStillCapturePrepared || + // iController.EngineState() == ECamEngineVideoCapturePrepared ) + // if ( ( ECamImageOn|ECamVideoOn )& ( iController.CameraState() ) ) + TCamCameraState state = iController.CameraState(); + if( ECamCameraPreparedImage == state || + ECamCameraPreparedVideo == state ) + { + // Now that the view is initialised, we may need to put up the + // mmc removal note. Perform this is required. + appUi->ShowMMCRemovalNoteIfRequiredL(); + + if ( appUi && !iSceneSettingModeActive && + !( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) ) + { + appUi->RaisePreCaptureCourtesyUI(ETrue); + } + } + } + // ----------------------------------------------------- + // Going to the background + else + { + PRINT( _L( "Camera <> CCamPreCaptureViewBase::HandleForegroundEventL: to background" ) ); + // Not behind an eikon/avkon server window + TBool totalBackground = ETrue; + if ( iController.IsAppUiAvailable() ) + { + totalBackground = appUi->AppInBackground( EFalse ); + } + // Either in foreground (moving to another view of our's) + // or if in background, then not just behind a notifier dialog. + if ( totalBackground ) + { + ReleaseResources(); + // hide the AP to avoid blinking when coming back from bg + if ( iController.UiConfigManagerPtr() && iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) + { + appUi->SetActivePaletteVisibility( EFalse ); + } + } + // Behind a server window + else + { + iContinueInBackground = ETrue; + } + + // reset post capture assumption flag since post capture is not + // used when video is stopped for usb + if ( iController.IsCaptureStoppedForUsb() ) + { + iAssumePostCaptureView = EFalse; + } + } + // ----------------------------------------------------- + + if ( !iStandbyModeActive ) + { + // Inform the container of foreground state change + PRINT( _L( "Camera <> CCamPreCaptureViewBase::HandleForegroundEventL: inform container.." ) ); + iContainer->HandleForegroundEventL( aForeground ); + } + else + { + // if in videocall, don't exit standby + if ( iController.InVideocallOrRinging() ) + { + iActivateToStandby = EFalse; + } + else + { + // If the view has been set to standby at activation then + // the first foreground event should not be used to exit standby + if ( !iActivateToStandby ) + { + // inform standby container + PRINT( _L( "Camera <> CCamPreCaptureViewBase::HandleForegroundEventL: inform standby container.." ) ); + iStandbyContainer->HandleForegroundEventL( aForeground ); + } + else + { + iActivateToStandby = EFalse; + } + } + } + CCamCaptureSetupViewBase::HandleForegroundEventL( aForeground ); + PRINT( _L( "Camera <= CCamPreCaptureViewBase::HandleForegroundEventL" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamPreCaptureViewBase::SetLocationTrailConnecting +// Set iLocationTrailConnecting flag. +// ----------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::SetLocationTrailConnecting() + { + iLocationTrailConnecting = ETrue; + } + +// ----------------------------------------------------------------------------- +// CCamPreCaptureViewBase::SetPostCaptureViewAsumption +// Set iAssumePostCaptureView flag. +// ----------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::SetPostCaptureViewAsumption( TBool aAssumePostCaptureView ) + { + iAssumePostCaptureView = aAssumePostCaptureView; + } + + +// ----------------------------------------------------------------------------- +// CCamPreCaptureViewBase::HandleControllerEventL +// Handle controller events +// ----------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::HandleControllerEventL( TCamControllerEvent aEvent, + TInt /*aError*/ ) + { + PRINT( _L( "Camera => CCamPreCaptureViewBase::HandleControllerEventL" ) ); + CCamAppUi* appUi = static_cast( AppUi() ); + + switch( aEvent ) + { + // --------------------------------------------------- + case ECamEventEngineStateChanged: + { + // Do not do softkey update if we are already exiting + // (AppUi is not available) + if( iController.IsAppUiAvailable() ) + { + PRINT( _L( "Camera <> case ECamEventEngineStateChanged" ) ); + // + // if ( iController.EngineState() == ECamEngineStillCapturePrepared || + // iController.EngineState() == ECamEngineVideoCapturePrepared ) + if ( ECamCameraPreparedVideo == iController.CameraState() || + ECamCameraPreparedImage == iController.CameraState() ) + { + // Now that the view is initialised, we may need to put up the + // mmc removal note. Perform this is required. + PRINT( _L( "Camera <> show mmc note if needed" ) ); + appUi->ShowMMCRemovalNoteIfRequiredL(); + + // Do not update (show) precapture view toolbar if capturing is almost + // finished, otherwise there is flickering and finally inactive toolbar + // when returning to prepactureview after image deletion. + // This will happen only if camera is started directly to portrait + // secondary camera i.e. Lens cover feature is supported + TBool noToolbar = (ECamCompleting == iController.CurrentOperation() ) && appUi->IsSecondCameraEnabled(); + + if ( ECamCameraPreparedImage == iController.CameraState() && + !appUi->IsBurstEnabled() && !noToolbar ) + { + // Also fixed toolbar might need to be enabled. + appUi->SetToolbarVisibility(); + } + } + //Do not update CBA if we are capturing or paused to prevent blinking + //during video capture saving and completing + if ( iController.CurrentVideoOperation() != ECamCapturing + && iController.CurrentVideoOperation() != ECamPaused ) + { + PRINT( _L( "Camera <> Update CBA" ) ); + UpdateCbaL(); + } + } + break; + } + + case ECamEventSliderClosed: + { + // if embedded and the slider is closed, + // the menu items may change, close the menu + if( iEmbedded ) + { + PRINT( _L("Camera <> CCamPreCaptureViewBase: calling StopDisplayingMenuBar") ); + StopDisplayingMenuBar(); + } + break; + } + default: + { + // Other events => no action. + break; + } + } // switch + PRINT( _L( "Camera <= CCamPreCaptureViewBase::HandleControllerEventL" ) ); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::DoActivateL +// Activate this view +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMPRECAPTUREVIEWBASE_DOACTIVATEL, "e_CCamPreCaptureViewBase_DoActivateL 1" ); + PRINT( _L( "Camera => CCamPreCaptureViewBase::DoActivateL" ) ); + iAssumePostCaptureView = EFalse; + + ShowToolbarOnViewActivation( EFalse ); + /*if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + if( ECamLocationOn == iController.IntegerSettingValue( ECamSettingItemRecLocation ) ) + { + if( ECamActiveCameraPrimary == iController.ActiveCamera() && ECamStandby != iController.CurrentOperation() ) + { + PRINT( _L("Camera: CCamPreCaptureViewBase::DoActivateL - primary camera, start location/gps") ) + iController.StartLocationTrailL(); + } + else // Secondary camera + { + PRINT( _L("Camera: CCamPreCaptureViewBase::DoActivateL - secondary camera, stop location trail") ) + iController.StopLocationTrail(); + } + } + }*/ + + CCamAppUi* appUi = static_cast( AppUi() ); + __ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer)); + if(!appUi->DrawPreCaptureCourtesyUI() && !iController.IsTouchScreenSupported()) + { + if ( !appUi->IsSecondCameraEnabled() ) + { + SetCourtesySoftKeysL(); + } + appUi->SetActivePaletteVisibility( EFalse ); + } + else if (appUi->DrawPreCaptureCourtesyUI()) + { + Cba()->MakeVisible( ETrue ); + } + + if ( appUi->SettingsLaunchedFromCamera() ) + { + if ( TUid::Uid( ECamCmdInternalExit ) == aCustomMessageId ) + { + appUi->SettingsPluginExitedL( ECameraInternalExit ); + } + else if ( TUid::Uid ( EAknSoftkeyBack ) == aCustomMessageId ) + { + appUi->SettingsPluginExitedL( ECameraPluginExit ); + } + else + { + // do nothing + } + } + + CCamCaptureSetupViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + + if ( appUi->IsSecondCameraEnabled() && !appUi->IsQwerty2ndCamera() ) + { + StatusPane()->MakeVisible( ETrue ); + } + else + { + StatusPane()->MakeVisible( EFalse ); + } + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + // If video call is active, toolbar is set to dimmed, that user cannot use it + TInt callType( EPSCTsyCallTypeUninitialized ); + RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType ); + if ( callType == EPSCTsyCallTypeH324Multimedia) + { + fixedToolbar->SetDimmed( ETrue ); + } + else + { + fixedToolbar->SetDimmed( EFalse ); + } + fixedToolbar->SetToolbarObserver( this ); + appUi->SetToolbarVisibility( ); + + // Make sure toolbar extension button has no background + CAknToolbarExtension* extension = fixedToolbar->ToolbarExtension(); + if ( extension ) + { + extension->SetButtonFlags( + extension->ButtonFlags() | KAknButtonNoFrame ); + extension->DrawDeferred(); + } + } + } + + appUi->PushNaviPaneCounterL(); + + // Pass on the ID of the previous view to the container + TCamAppViewIds viewId = static_cast( aPrevViewId.iViewUid.iUid ); + iContainer->SetPreviousViewId( viewId ); + + iController.AddControllerObserverL( this ); + + TBool transparentCba = EFalse; + + UpdateCbaL(); + + switch( aCustomMessageId.iUid ) + { + // ------------------------------- + // Standby with or without error + case ECamViewMessageStandby: + PRINT( _L( "Camera <> CCamPreCaptureViewBase::DoActivateL: custom message ECamViewMessageStandby" ) ); + //iStandbyError = KErrNone; + //appUi->SetStandbyStatus( KErrNone ); + SetSceneSettingMode( EFalse ); + iActivateToStandby = ETrue; + HandleCommandL( ECamCmdGoToStandby ); + return; +// break; + // ------------------------------- + // Scene setting mode + case ECamViewMessageSceneSettingList: + PRINT( _L( "Camera <> CCamPreCaptureViewBase::DoActivateL: custom message ECamViewMessageSceneSettingList" ) ); + SwitchToSceneSettingModeL(); + break; + // ------------------------------- + default: + // Other precapture modes have transparent CBA buttons + // except secondary camera + if ( !appUi->IsSecondCameraEnabled() || appUi->IsQwerty2ndCamera() ) + { + transparentCba = ETrue; + } + // don't start VF if faster startup is used when cameraswitch is queued, + // need to switch to maincamera first + if ( !( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && + iController.CameraSwitchQueued() ) ) + { + StartViewFinder(); + } + + break; + // ------------------------------- + } + + // Here we check if the previous view is ViaPlayer play mode + if ( !iSceneSettingModeActive && + ( aPrevViewId.iViewUid.iUid != ECamViewIdViaPlayerPlayBack ) && + !( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) ) + { + appUi->RaisePreCaptureCourtesyUI(ETrue); + } + + // Reset iContinueInBackground flag, which is set when app temporarily + // goes behind a system window and there's no need to free resources. + // Resetting this flag only in ReleaseResources causes problems (at least) + // if power key is pressed during burst capture. + iContinueInBackground = EFalse; + + // Reset iDeactivateToStandby flag, which is used when the PreCapture view + // goes to the Standby mode, at which point the UI should not reactivate the + // viewfinder. + iDeactivateToStandby = EFalse; + + + EikSoftkeyPostingTransparency::MakeTransparent( + *Cba(), transparentCba ); + // Make sure appuis CBA is not visible + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if( cba ) + { + cba->MakeVisible( EFalse ); + } + + PRINT( _L( "Camera <= CCamPreCaptureViewBase::DoActivateL" ) ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMPRECAPTUREVIEWBASE_DOACTIVATEL, "e_CCamPreCaptureViewBase_DoActivateL 0" ); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::DoDeactivate() + { + PRINT( _L( "Camera => CCamPreCaptureViewBase::DoDeactivate" ) ); + CCamCaptureSetupViewBase::DoDeactivate(); + + iController.RemoveControllerObserver( this ); + + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + CAknToolbarExtension* extension = fixedToolbar->ToolbarExtension(); + if ( extension ) + { + // Reset toolbar extension button and view to closed state + extension->SetShown( EFalse ); + extension->SetCurrentState( 0, EFalse ); + } + } + } + ReleaseResources(); + + if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() && + iController.ActiveCamera() == ECamActiveCameraSecondary ) + { + if ( iController.CameraSwitchQueued() ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + // If camera switch fails, main camera is used instead + TRAP_IGNORE( appUi->HandleCommandL( ECamCmdSwitchCamera ) ); + } + } + + PRINT( _L( "Camera <= CCamPreCaptureViewBase::DoDeactivate" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamPreCaptureViewBase::HandleFocusLossL +// Handle change of focus +// ----------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::HandleFocusLossL() + { + PRINT( _L( "Camera => CCamPreCaptureViewBase::HandleFocusLossL" ) ); + // if the application was already in the background, but behind an + // eikon server window, then handle backgrounding properly now. + // Otherwise the backgrounding will be handled in the normal + // HandleForeground() method. + if ( iContinueInBackground ) + { + ReleaseResources(); + // Inform the container of foreground state change + iContainer->HandleForegroundEventL( EFalse ); + } + CCamCaptureSetupViewBase::HandleFocusLossL(); + + // dismiss menu bar if open + StopDisplayingMenuBar(); + PRINT( _L( "Camera <= CCamPreCaptureViewBase::HandleFocusLossL" ) ); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::SwitchToCaptureSetupModeL +// Switches the current mode to capture setup and activates a +// specific control.. +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::SwitchToCaptureSetupModeL( TInt aSetupCommand ) + { + + PRINT( _L("Camera => CCamPreCaptureViewBase::SwitchToCaptureSetupModeL") ); + + // Remove the view's main container, and add the capture setup + // control associated with the input command to the container stack. + CCamCaptureSetupViewBase::SwitchToCaptureSetupModeL( aSetupCommand ); + + // only remove the capture setup menu container after + // the switch completes successfully + RemoveCaptureSetupMenuContainers(); + + SetCaptureSetupModeActive(ETrue); + + PRINT( _L("Camera <= CCamPreCaptureViewBase::SwitchToCaptureSetupModeL") ); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::SwitchToSceneSettingModeL +// Switches the current mode to scene setting and activates a +// specific control. +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::SwitchToSceneSettingModeL() + { + // Remove the view's main container, and add the capture setup + // control associated with the input command to the container stack. + CCamCaptureSetupViewBase::SwitchToSceneSettingModeL(); + + // only remove the capture setup menu container after + // the switch completes successfully + RemoveCaptureSetupMenuContainers(); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::ExitCaptureSetupModeL +// Exits capture setup mode and activates the capture setup menu control. +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::ExitCaptureSetupModeL() + { + PRINT( _L("Camera => CCamPreCaptureViewBase::ExitCaptureSetupModeL") ) + + CCamCaptureSetupViewBase::ExitCaptureSetupModeL(); + + iController.SetViewfinderWindowHandle( &iContainer->Window() ); + + if( !iController.IsViewFinding() && !iController.InVideocallOrRinging() ) + { + TCamCameraMode mode = iController.CurrentMode(); + PRINT1( _L("Camera => CCamPreCaptureViewBase::ExitCaptureSetupModeL - CurrentMode %d"), mode ); + if (mode == ECamControllerVideo ) + { + PRINT( _L("Camera => CCamPreCaptureViewBase::ExitCaptureSetupModeL - ECamControllerVideo") ); + iController.EnterViewfinderMode( ECamControllerVideo ); + } + else + { + PRINT( _L("Camera => CCamPreCaptureViewBase::ExitCaptureSetupModeL - ECamControllerImage") ); + iController.EnterViewfinderMode( ECamControllerImage ); + } + } + + // make sure app is not left in an invalid state if a leave + // occurs after exiting the capture setup + iCaptureSetupMenuModeActive = EFalse; + static_cast( AppUi() )->PushNaviPaneCounterL(); + CCamAppUiBase* appUi = static_cast( AppUi() ); + if( appUi->ActiveCamera() == ECamActiveCameraSecondary ) + { + PRINT( _L("Camera => CCamPreCaptureViewBase::ExitCaptureSetupModeL ###") ) + SwitchToCaptureSetupMenuModeL(); + } + + PRINT( _L("Camera <= CCamPreCaptureViewBase::ExitCaptureSetupModeL") ) + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::ExitSceneSettingModeL +// Exits scene setting mode and activates the capture setup menu control. +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::ExitSceneSettingModeL() + { + CCamCaptureSetupViewBase::ExitSceneSettingModeL(); + // make sure app is not left in an invalid state if a leave + // occurs after exiting the scene setting mode + iCaptureSetupMenuModeActive = EFalse; + static_cast( AppUi() )->PushNaviPaneCounterL(); + + CCamAppUiBase* appUi = static_cast( AppUi() ); + if ( appUi->ActiveCamera() == ECamActiveCameraPrimary ) + { + if ( iDeactivateToStandby || iController.InVideocallOrRinging() ) + { + // don't restart VF if we are going to standby mode + } + else + { + StartViewFinder(); + } + } + else + { + SwitchToCaptureSetupMenuModeL(); + } + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::ExitInfoListBoxL +// Exits InfoListBox +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::ExitInfoListBoxL() + { + CCamCaptureSetupViewBase::ExitInfoListBoxL(); + // make sure app is not left in an invalid state if a leave + // occurs after exiting the scene setting mode + iCaptureSetupMenuModeActive = EFalse; + static_cast( AppUi() )->PushNaviPaneCounterL(); + + CCamAppUiBase* appUi = static_cast( AppUi() ); + if ( appUi->ActiveCamera() == ECamActiveCameraPrimary ) + { + StartViewFinder(); + } + else + { + SwitchToCaptureSetupMenuModeL(); + } + } + + +// ----------------------------------------------------------------------------- +// CCamPreCaptureViewBase::ExitAllModesL +// Revert to normal mode +// ----------------------------------------------------------------------------- +// +void +CCamPreCaptureViewBase::ExitAllModesL() + { + PRINT( _L("Camera => CCamPreCaptureViewBase::ExitAllModesL" ) ); + iController.DeepSleepTimerCancel(); + TCamSettingMode currentMode = ActiveSettingMode(); + + CCamAppUi* appUi = static_cast( AppUi() ); + + switch ( currentMode ) + { + case ECamSettingModeCaptureMenu: + { + PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitAllModesL cap setup menu" )) + ExitCaptureSetupMenuModeL(); + break; + } + case ECamSettingModeCapture: + { + PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitAllModesL capture" )) + + ExitCaptureSetupModeL(); + if( appUi->ActiveCamera() == ECamActiveCameraSecondary ) + { + PRINT( _L("Camera <> CamPreCaptureViewBase::ExitAllModesL ##" )) + ExitCaptureSetupMenuModeL(); + } + break; + } + case ECamSettingModeScene: + { + PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitAllModesL scene" )) + ExitSceneSettingModeL(); + if( appUi->ActiveCamera() == ECamActiveCameraSecondary ) + { + PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitAllModesL ##" )) + ExitCaptureSetupMenuModeL(); + } + if(Id() == TUid::Uid(ECamViewIdVideoPreCapture)) + { + iToolbarExtensionInvisible = ETrue; + } + break; + } + case ECamSettingModeInfoListBox: + { + PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitAllModesL generic" )) + ExitInfoListBoxL(); + if( appUi->ActiveCamera() == ECamActiveCameraSecondary ) + { + PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitAllModesL ##" )) + ExitCaptureSetupMenuModeL(); + } + break; + } + default: + { + iToolbarExtensionInvisible = ETrue; + } + break; + } + + if ( iController.InVideocallOrRinging() ) + { + return; + } + + appUi->HandleCommandL(ECamCmdSwitchToPrecapture); + + if ( !( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) ) + { + TCamOrientation orientation = appUi->CamOrientation(); + if ( orientation == ECamOrientationCamcorder || orientation == ECamOrientationCamcorderLeft ) + { + // force update of active palette + appUi->APHandler()->UpdateActivePaletteL(); + } + + if ( appUi && !iSceneSettingModeActive ) + { + appUi->RaisePreCaptureCourtesyUI(ETrue); + } + } + + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + CAknToolbarExtension* extension = fixedToolbar->ToolbarExtension(); + + //Only active view will set toolbar extension visibility. + + if(this->IsForeground()) + { + if ( extension && iToolbarExtensionInvisible == EFalse ) + { + extension->SetShown( ETrue ); + } + else if( extension ) + { + extension->SetShown( EFalse ); + } + } + + iToolbarExtensionInvisible = EFalse; + } + + PRINT( _L("Camera <= CCamPreCaptureViewBase::ExitAllModesL" ) ); + } + + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::ActiveSettingMode +// Returns the active setting mode +// --------------------------------------------------------------------------- +// +CCamPreCaptureViewBase::TCamSettingMode +CCamPreCaptureViewBase::ActiveSettingMode() + { + if ( iCaptureSetupModeActive ) + { + return ECamSettingModeCapture; + } + else if ( iSceneSettingModeActive ) + { + return ECamSettingModeScene; + } + else if ( iCaptureSetupMenuModeActive ) + { + return ECamSettingModeCaptureMenu; + } + else if ( iInfoListBoxActive ) + { + return ECamSettingModeInfoListBox; + } + else + { + return ECamSettingModeNone; + } + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::CCamPreCaptureViewBase +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamPreCaptureViewBase::CCamPreCaptureViewBase( CCamAppController& aController ) + : CCamCaptureSetupViewBase( aController ) + { + iCaptureSetupMenuModeActive = EFalse; + iAssumePostCaptureView = EFalse; + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::ConstructL() + { + PRINT( _L("Camera => CCamPreCaptureViewBase::ConstructL") ) + /* Use AppUi to get this info. + // Get the id of Eikon Server window group + iEikonServerWindowGroupId = + iCoeEnv->WsSession().FindWindowGroupIdentifier( 0, KEikonServer ); + + iBTServerWindowGroupId = + static_cast( iEikonEnv->AppUi() )->BTServerId(); + */ + UpdateToolbarIconsL(); + PRINT( _L("Camera <= CCamPreCaptureViewBase::ConstructL") ) + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::CleanupCaptureSetupMenu +// Cleanup the capture menu control if a leave occurs +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::CleanupCaptureSetupMenu( TAny* aAny ) + { + CCamPreCaptureViewBase* view = static_cast( aAny ); + if ( view->iCaptureSetupMenuContainer ) + { + view->AppUi()->RemoveFromStack( view->iCaptureSetupMenuContainer ); + delete view->iCaptureSetupMenuContainer; + view->iCaptureSetupMenuContainer = NULL; + } + // reset the active mode + view->iCaptureSetupMenuModeActive = EFalse; + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::SwitchToCaptureSetupMenuModeL +// Switches the current mode to capture setup menu and activates +// the capture setup menu control +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::SwitchToCaptureSetupMenuModeL() + { + PRINT( _L("Camera => CCamPreCaptureViewBase::SwitchToCaptureSetupMenuModeL")) + __ASSERT_DEBUG( !iCaptureSetupMenuContainer, CamPanic( ECamPanicResourceLeak ) ); + + // Create the relevant capture setup menu, e.g. video or photo... + CreateCaptureSetupMenuL(); + + // Cleanup the view correctly if a leave occurs + CleanupStack::PushL( TCleanupItem( CleanupCaptureSetupMenu, this ) ); + + PRINT( _L("Camera => CCamPreCaptureViewBase::SwitchToCaptureSetupMenuModeL start vf")) + StartViewFinder(); + iCaptureSetupMenuContainer->SetMopParent( this ); + // Activate the menu control and mode. + AppUi()->AddToStackL( *this, iCaptureSetupMenuContainer ); + iCaptureSetupMenuContainer->ActivateL(); + // UpdateCbaL need this boolean to be set in + // order for the correct CBA to be returned + iCaptureSetupMenuModeActive = ETrue; + UpdateCbaL(); + CleanupStack::Pop(); // CleanupCaptureSetupMenu + + // Fade the container that is behind. + iCaptureSetupMenuContainer->FadeBehind( ETrue ); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::ExitCaptureSetupMenuModeL +// Exits capture setup menu mode and activates the original precapture +// view container that was active before entering this mode. +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::ExitCaptureSetupMenuModeL() + { + PRINT( _L("Camera => CCamPreCaptureViewBase::ExitCaptureSetupMenuModeL() ") ); + + if ( !iCaptureSetupMenuModeActive ) + { + return; + } + iCaptureSetupMenuModeActive = EFalse; + iContainer->MakeVisible( ETrue ); + + iCaptureSetupMenuContainer->FadeBehind( EFalse ); + AppUi()->RemoveFromStack( iCaptureSetupMenuContainer ); + delete iCaptureSetupMenuContainer; + iCaptureSetupMenuContainer = NULL; + UpdateCbaL(); + SetTitlePaneTextL(); + + PRINT( _L("Camera <= CCamPreCaptureViewBase::ExitCaptureSetupMenuModeL() ") ); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::SwitchToStandbyModeL +// Exits pre capture mode and activates the standby container +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::SwitchToStandbyModeL( TCamAppViewIds aViewId, TInt aError ) + { + iAssumePostCaptureView = EFalse; + iDeactivateToStandby = ETrue; // avoid viewfinder startup + iContinueInBackground = EFalse; + + switch ( ActiveSettingMode() ) + { + case ECamSettingModeCaptureMenu: + { + ExitCaptureSetupMenuModeL(); + } + break; + case ECamSettingModeScene: + { + ExitSceneSettingModeL(); + ExitCaptureSetupMenuModeL(); + } + break; + case ECamSettingModeCapture: + { + ExitCaptureSetupModeL(); + ExitCaptureSetupMenuModeL(); + } + break; + case ECamSettingModeInfoListBox: + { + ExitInfoListBoxL(); + ExitCaptureSetupMenuModeL(); + } + break; + default: + break; + } + + + // Hide the active palette + static_cast( iEikonEnv->AppUi() ) + ->SetActivePaletteVisibility( EFalse ); + + // stop viewfinding + StopViewFinder(); + + CCamViewBase::SwitchToStandbyModeL( aViewId, aError ); + + iDeactivateToStandby = EFalse; + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::ExitStandbyModeL +// Exits standby mode and activates the previous pre-capture container +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::ExitStandbyModeL() + { + PRINT( _L("Camera => CCamPreCaptureViewBase::ExitStandbyModeL" ) ) + // start view finding + iAssumePostCaptureView = EFalse; + CCamAppUi* appUi = static_cast( AppUi() ); + if( appUi->AppInBackground(ETrue )) + { + PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitStandbyModeL: global note in foreground." ) ) + return; + } + if( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && + iController.CurrentMode() != ECamControllerIdle ) + { + PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitStandbyModeL: not in standby, returning without exit" ) ) + return; + } + + if( !appUi->DrawPreCaptureCourtesyUI() && + !iController.IsTouchScreenSupported() && + !appUi->IsSecondCameraEnabled() ) + { + SetCourtesySoftKeysL(); + } + + // In case coming back after dismissing videocall, need + // to register as using engine + if( !appUi->IsInPretendExit() ) + { + IncrementCameraUsers(); + } + + PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitStandbyModeL: start vf" ) ) + StartViewFinder(); + + //static_cast( iEikonEnv->AppUi() ) + // ->APHandler()->UpdateActivePaletteL(); + TBool uiOverride = iController.UiConfigManagerPtr() && iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported(); + if ( !uiOverride ) + { + SetupActivePaletteL(); + } + + // Dimming is set if video call is active, remove dimming if video call is not active any more + TInt callType( EPSCTsyCallTypeUninitialized ); + RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType ); + if ( callType != EPSCTsyCallTypeH324Multimedia + && iController.IsTouchScreenSupported() ) + { + CAknToolbar* toolbar = Toolbar(); + if (toolbar) + { + toolbar->SetDimmed( EFalse ); + } + } + CCamViewBase::ExitStandbyModeL(); + + // Need to update appui viewstate + PRINT( _L("Camera <> CCamPreCaptureViewBase::ExitStandbyModeL: emit ECamCmdSwitchToPrecapture" ) ) + appUi->HandleCommandL( ECamCmdSwitchToPrecapture ); + + if ( uiOverride ) + { + appUi->SetActivePaletteVisibility( EFalse ); + } + else + { + appUi->RaisePreCaptureCourtesyUI(ETrue); + } + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsLocationSupported() ) + { + if( ECamLocationOn == iController.IntegerSettingValue( ECamSettingItemRecLocation ) ) + { + if( ECamActiveCameraPrimary == iController.ActiveCamera() ) + { + PRINT( _L("Camera: CCamPreCaptureViewBase::ExitStandbyModeL - primary camera, start location/gps") ) + iController.StartLocationTrailL(); + } + } + } + PRINT( _L("Camera <= CCamPreCaptureViewBase::ExitStandbyModeL" ) ) + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::IsOkOptionsMenuAllowed +// Checks whether or not the ok aoptions menu should be displayed +// --------------------------------------------------------------------------- +// +#if 0 +TBool CCamPreCaptureViewBase::IsOkOptionsMenuAllowed() + { + CCamAppUiBase* appUi = static_cast( AppUi() ); + // Check if we are in selftimer mode, scene setting mode, + // capture setup menu mode or if a capture mode preparation is + // taking place. If so, do NOT show the menu + if ( ( appUi && !appUi->SelfTimerEnabled() ) && + !iController.CaptureModeTransitionInProgress() && + ActiveSettingMode() == ECamSettingModeNone && !appUi->IsEmbedded() ) + { + return ETrue; + } + else + { + return EFalse; + } + } +#endif // 0 + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::RemoveCaptureSetupMenuContainers +// Removes the capture setup menu and original container from +// the container stack +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::RemoveCaptureSetupMenuContainers() + { + // Store the current item index value for the menu, so that it can + // be reused when the CSM container is reactivated from leaving + // a capture setup control. + if ( iCaptureSetupMenuContainer ) + { + iCaptureSetupMenuLastItemIndex = + iCaptureSetupMenuContainer->CurrentItemIndex(); + iCaptureSetupMenuContainer->FadeBehind( EFalse ); + + // Remove the Capture Setup Menu from the container stack. + AppUi()->RemoveFromStack( iCaptureSetupMenuContainer ); + } + delete iCaptureSetupMenuContainer; + iCaptureSetupMenuContainer = NULL; + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::DynInitSwitchCameraMenuItemL +// Set up the text for switch camera in the options menu +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::DynInitSwitchCameraMenuItemL( CEikMenuPane* aMenuPane ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + // Check if only 1 camera available + if ( !iController.UiConfigManagerPtr()->IsSecondaryCameraSupported() ) + { + aMenuPane->SetItemDimmed( ECamCmdSwitchCamera, ETrue ); + } + else + { + // if secondary camera is enabled + if ( appUi->IsSecondCameraEnabled() ) + { + if( iController.UiConfigManagerPtr()->IsLensCoverSupported() ) + { + TInt slideState = iController.CameraSlideState(); + if ( slideState == CameraPlatPSKeys::EClosed ) + { + aMenuPane->SetItemDimmed( ECamCmdSwitchCamera, ETrue ); + } + else + { + aMenuPane->SetItemTextL( ECamCmdSwitchCamera, + R_CAM_PRE_CAPTURE_MENU_PRIMARY_CAMERA ); + } + } + else + { + aMenuPane->SetItemTextL( ECamCmdSwitchCamera, + R_CAM_PRE_CAPTURE_MENU_PRIMARY_CAMERA ); + } + } + } + } + + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::ReleaseResources +// Stop the viewfinder and inform the controller that this view has finished +// with the engine +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::ReleaseResources() + { + PRINT( _L("Camera => CCamPreCaptureViewBase::ReleaseResources") ); + iContinueInBackground = EFalse; + StopViewFinder(); + + // Make sure that video recording is stopped (if ongoing). + iController.StopVideoRecording(); + + // if the application is not closing then self-timer mode must be disabled. + // otherwise it will be deleted as part of the application shut down process + if ( !iController.IsInShutdownMode() ) + { + // Do not do softkey update if we are already exiting + // (AppUi is not available) + if( iController.IsAppUiAvailable() ) + { + // Ensure AppUi has had self-timer mode disabled + CCamAppUiBase* appUi = static_cast( AppUi() ); + if ( appUi ) + { + TRAP_IGNORE( appUi->SelfTimerEnableL( ECamSelfTimerDisabled ) ); + } + } + } + // Register that we no longer need the engine + // Checks if we incremented the count. + DecrementCameraUsers(); + PRINT( _L("Camera <= CCamPreCaptureViewBase::ReleaseResources") ); + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::IsPreCapture +// Returns whether the view is a precapture view +// --------------------------------------------------------------------------- +// +TBool CCamPreCaptureViewBase::IsPreCapture() + { + return ETrue; + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::OfferToolbarEventL +// Handle fixed toolbar and toolbar extension events +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::OfferToolbarEventL( TInt aCommand ) + { + iController.StartIdleTimer(); + HandleCommandAoL( aCommand ); + + if ( aCommand == ECamCmdSceneSettingList || + aCommand == ECamCmdCaptureSetupFlashStill || + aCommand == ECamCmdCaptureSetupSelfTimer || + aCommand == ECamCmdCaptureSetupSceneStill || + aCommand == ECamCmdCaptureSetupSceneVideo || + aCommand == ECamCmdCaptureSetupColourFilterStill || + aCommand == ECamCmdCaptureSetupColourFilterVideo || + aCommand == ECamCmdCaptureSetupWhiteBalanceStill || + aCommand == ECamCmdCaptureSetupWhiteBalanceVideo || + aCommand == ECamCmdCaptureSetupExposureStill || + aCommand == ECamCmdCaptureSetupLightSensitivityStill || + aCommand == ECamCmdCaptureSetupContrastStill || + aCommand == ECamCmdCaptureSetupImageSharpnessStill ) + { + // These commands imply a container switch. + // iItemAccessedViaAP must be set so that softkeys work correctly. + CCamAppUiBase* appUi = static_cast( AppUi() ); + appUi->APHandler()->iItemAccessedViaAP = ETrue; + iController.DeepSleepTimerStart(); + } + } + + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::SetIconL +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::SetIconL( + CAknButton* aButton, + const TDesC& aIconFilename, + TInt aIconId, + TInt aMaskId, + MAknsSkinInstance* aSkinInstance, + const TAknsItemID& aSkinItemId ) + { + CGulIcon* icon = AknsUtils::CreateGulIconL( + aSkinInstance, + aSkinItemId, + aIconFilename, + aIconId, + aMaskId ); + icon->SetBitmapsOwnedExternally( EFalse ); // CGulIcon owns bitmaps + CAknButtonState* state = aButton->State( 0 ); + if ( state ) + { + state->SetIcon( icon ); + icon = NULL; + } + else + { + delete icon; + icon = NULL; + } + + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::HandleAppEvent <> +// +// --------------------------------------------------------------------------- +// +void +CCamPreCaptureViewBase::HandleAppEvent( const TCamAppEvent& aEvent ) + { + PRINT1( _L("Camera => CCamPreCaptureViewBase::HandleAppEvent, event:%d"), aEvent ); + CCamViewBase::HandleAppEvent( aEvent ); + + if ( aEvent == ECamAppEventFocusGained && iController.InVideocallOrRinging() ) + { + TRAP_IGNORE( BlankSoftkeysL() ); + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* toolbar = Toolbar(); + if ( toolbar ) + { + toolbar->SetToolbarVisibility( EFalse ); + } + } + } + + if ( aEvent == ECamAppEventFocusGained ) + { + if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() && + iController.CameraSwitchQueued() ) // fake exit done + { + iController.CheckSlideStatus(); // Do we still need to change cam? + CCamAppUi* appUi = static_cast( AppUi() ); + // How about portrait/landscape 2nd camera? + if ( !iController.CameraSwitchQueued() && + appUi->IsSecondCameraEnabled() ) + { + TBool landscape2ndCam = appUi->IsQwerty2ndCamera( ETrue ); + if( appUi->CamOrientation() != ECamOrientationPortrait ) + { + if ( !landscape2ndCam ) + { + PRINT( _L("Camera => CCamPreCaptureViewBase::HandleAppEvent, change to portrait 2nd cam.")); + iController.SetCameraSwitchRequired( + ESwitchSecondaryOrientation ); + } + } + else + { + if ( landscape2ndCam ) + { + PRINT( _L("Camera => CCamPreCaptureViewBase::HandleAppEvent, change to landscape 2nd cam.")); + iController.SetCameraSwitchRequired( + ESwitchSecondaryOrientation ); + } + } + } + } + if ( iController.UiConfigManagerPtr()->IsLensCoverSupported() && + iController.ActiveCamera() == ECamActiveCameraPrimary ) + { + if ( iController.CameraSwitchQueued() ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + // If camera switch fails, main camera is used instead + TRAP_IGNORE( appUi->HandleCommandL( ECamCmdSwitchCamera ) ); + } + } + } + + PRINT( _L("Camera <= CCamPreCaptureViewBase::HandleAppEvent") ); + } + +// --------------------------------------------------------------------------- +// SetupActivePaletteL +// +// Helper method to set up the Active Palette. +// If needed, a new instance of AP is created. +// Otherwise the existing AP items are cleared. +// New AP items are setup with resource from GetAPResourceId. +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::SetupActivePaletteL() + { + if( iContainer && !iController.IsTouchScreenSupported() ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + TCamOrientation orientation = appUi->CamOrientation(); + + if( ECamOrientationCamcorder == orientation + || ECamOrientationCamcorderLeft == orientation + || ECamOrientationPortrait == orientation ) + { + // Creates Active Palette, sets items and sets view. + // Only AP2 supported. + static_cast( iContainer ) + ->SetupActivePaletteL( this ); + } + else + { + // No AP + } + } + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::ToolbarButtonById +// +// --------------------------------------------------------------------------- +// + CAknButton* CCamPreCaptureViewBase::ToolbarButtonById(const TCamCmd aCommandId) const + { + CAknButton* button = NULL; + if(iController.IsTouchScreenSupported()) + { + CAknToolbar* toolbar = Toolbar(); + if(toolbar) + { + button = static_cast + (toolbar->ControlOrNull(aCommandId)); + if(NULL == button) + { + CAknToolbarExtension* extension = toolbar->ToolbarExtension(); + if(extension) + { + button = static_cast + (extension->ControlOrNull(aCommandId)); + } + } + } + } + return button; + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::HideButton +// +// --------------------------------------------------------------------------- +// + void CCamPreCaptureViewBase::HideButton(const TCamCmd aCommandId) + { + if(iController.IsTouchScreenSupported()) + { + CAknToolbar* toolbar = Toolbar(); + if(toolbar) + { + if(toolbar->ControlOrNull(aCommandId)) + { + toolbar->HideItem(aCommandId,ETrue,ETrue); + } + else if( toolbar->ToolbarExtension() && + toolbar->ToolbarExtension()->ControlOrNull(aCommandId)) + { + TRAP_IGNORE(toolbar->ToolbarExtension()->HideItemL(aCommandId,ETrue)); + } + else + { + //Do Nothing + } + } + } + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::RedrawToolBar +// +// --------------------------------------------------------------------------- +// +void CCamPreCaptureViewBase::RedrawToolBar() + { + CEikonEnv::Static()->WsSession().ClearAllRedrawStores(); + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamPropertyWatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamPropertyWatcher.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Callback wrapper for Publish and Subscribe* +*/ + + +// INCLUDE FILES + +#include +#include +#include "CamPropertyWatcher.h" +#include "CamPropertyObserver.h" +#include "CamUtility.h" + +// ========================= MEMBER FUNCTIONS ================================ + +// ----------------------------------------------------------------------------- +// CCamPropertyWatcher::NewL +// Two phase construction +// ----------------------------------------------------------------------------- +// +CCamPropertyWatcher* CCamPropertyWatcher::NewL( MPropertyObserver& aPropertyObserver, + const TUid& aCategory, + const TUint aKey ) + { + CCamPropertyWatcher* self = new(ELeave) CCamPropertyWatcher( aPropertyObserver, + aCategory, + aKey ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCamPropertyWatcher::Destructor +// ----------------------------------------------------------------------------- +// +CCamPropertyWatcher::~CCamPropertyWatcher() + { + PRINT( _L("Camera => ~CCamPropertyWatcher") ); + Cancel(); + iProperty.Close(); + PRINT( _L("Camera <= ~CCamPropertyWatcher") ); + } + +// ----------------------------------------------------------------------------- +// CCamPropertyWatcher::Subscribe +// Request notification of change events +// ----------------------------------------------------------------------------- +// +void CCamPropertyWatcher::Subscribe() + { + PRINT( _L( "Camera => CCamPropertyWatcher::Subscribe()" ) ) + iProperty.Subscribe( iStatus ); + SetActive(); + PRINT( _L( "Camera <= CCamPropertyWatcher::Subscribe()" ) ) + } + +// ----------------------------------------------------------------------------- +// CCamPropertyWatcher::Get +// Return the current value +// ----------------------------------------------------------------------------- +// +TInt CCamPropertyWatcher::Get( TInt& aValue ) + { + return iProperty.Get( aValue ); + } + +// ----------------------------------------------------------------------------- +// CCamPropertyWatcher::CCamPropertyWatcher +// Constructor +// ----------------------------------------------------------------------------- +// +CCamPropertyWatcher::CCamPropertyWatcher( MPropertyObserver& aPropertyObserver, + const TUid& aCategory, + const TUint aKey ) : + CActive( EPriorityStandard ), + iPropertyObserver( aPropertyObserver ), + iCategory( aCategory), + iKey( aKey ) + { + } + +// ----------------------------------------------------------------------------- +// CCamPropertyWatcher::ConstructL +// Second phase construction +// ----------------------------------------------------------------------------- +// +void CCamPropertyWatcher::ConstructL() + { + CActiveScheduler::Add( this ); + User::LeaveIfError( iProperty.Attach( iCategory, iKey ) ); + } + +// ----------------------------------------------------------------------------- +// CCamPropertyWatcher::RunL +// Handle notification of value change +// ----------------------------------------------------------------------------- +// +void CCamPropertyWatcher::RunL() + { + PRINT( _L( "Camera => CCamPropertyWatcher::RunL()" ) ) + const TInt error ( iStatus.Int() ); + PRINT1( _L( "Camera CCamPropertyWatcher::RunL() status = %d" ), error ) + Subscribe(); + if ( error == KErrNone ) + { + PRINT( _L( "Camera CCamPropertyWatcher::RunL() calling HandlePropertyChangedL" ) ) + iPropertyObserver.HandlePropertyChangedL( iCategory, iKey ); + } + } + +// ----------------------------------------------------------------------------- +// CCamPropertyWatcher::DoCancel +// Handle cancellation +// ----------------------------------------------------------------------------- +// +void CCamPropertyWatcher::DoCancel() + { + iProperty.Cancel(); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamRecordingIconDecoration.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamRecordingIconDecoration.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,279 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera UI recording icon decoration* +*/ + + + +#include +#include + +#include + +#include "CamRecordingIconDecoration.h" +#include "CamObserverHandler.h" +#include "Cam.hrh" +#include "CamUtility.h" +#include "CamAppController.h" +#include "CamPanic.h" + +const TInt KCamVidPauseFlashInterval = 800000; + +// ----------------------------------------------------------------------------- +// CCamRecordingIconDecoration::CCamRecordingIconDecoration() +// Default constructor +// ----------------------------------------------------------------------------- +// +CCamRecordingIconDecoration +::CCamRecordingIconDecoration( CCamAppController& aController ) + : iController( aController ) + { + } + +// ----------------------------------------------------------------------------- +// CCamRecordingIconDecoration::NewL +// Factory method to safely create a new instance +// ----------------------------------------------------------------------------- +// +CCamRecordingIconDecoration* +CCamRecordingIconDecoration::NewL( const TRect& aPosition, + CCamAppController& aController) + { + CCamRecordingIconDecoration* me = + new (ELeave) CCamRecordingIconDecoration( aController ); + + CleanupStack::PushL( me ); + me->ConstructL( aPosition ); + CleanupStack::Pop( me ); + + return me; + } + +// ----------------------------------------------------------------------------- +// CCamRecordingIconDecoration::ConstructL +// Initializes a new instance +// ----------------------------------------------------------------------------- +// +void +CCamRecordingIconDecoration::ConstructL( const TRect& aPosition ) + { + iPosition = aPosition.iTl; + iSize = TRect( TPoint(0,0), aPosition.Size() ); + + iObserverHandler = CCamObserverHandler::NewL(); + + iPauseFlashPeriodic = CPeriodic::NewL( CActive::EPriorityStandard ); + + // Register as a controller observer + iController.AddControllerObserverL(this); + + // Load in the icons + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + + AknIconUtils::CreateIconL( iRecBitmap, + iRecBitmapMask, + resname, + EMbmCameraappQgn_indi_vid4_record, + EMbmCameraappQgn_indi_vid4_record_mask ); + AknIconUtils::SetSize( iRecBitmap, aPosition.Size() ); + + AknIconUtils::CreateIconL( iRecPauseBitmap, + iRecPauseBitmapMask, + resname, + EMbmCameraappQgn_indi_vid4_pause, + EMbmCameraappQgn_indi_vid4_pause_mask ); + AknIconUtils::SetSize( iRecPauseBitmap, aPosition.Size() ); + + // Set iRecordState to the correct value + switch( iController.CurrentVideoOperation() ) + { + case ECamCapturing: + iRecordState = ECamRecording; + break; + case ECamPaused: + iRecordState = ECamRecordPaused; + break; + default: + iRecordState = ECamNotRecording; + break; + } + } + +// ----------------------------------------------------------------------------- +// CCamRecordingIconDecoration::~CCamRecordingIconDecoration() +// Destructor +// ----------------------------------------------------------------------------- +// +CCamRecordingIconDecoration::~CCamRecordingIconDecoration() + { + PRINT( _L("Camera => ~CCamRecordingIconDecoration") ); + iController.RemoveControllerObserver(this); + + delete iObserverHandler; + + if( iPauseFlashPeriodic ) + { + iPauseFlashPeriodic->Cancel(); + } + delete iPauseFlashPeriodic; + + delete iRecBitmap; + delete iRecBitmapMask; + delete iRecPauseBitmap; + delete iRecPauseBitmapMask; + PRINT( _L("Camera <= ~CCamRecordingIconDecoration") ); + } + +// ----------------------------------------------------------------------------- +// CCamRecordingIconDecoration::Draw() +// Draw the decoration +// ----------------------------------------------------------------------------- +// +void CCamRecordingIconDecoration::Draw(CBitmapContext& aGc, const TRect& /*aDrawRect*/) + { + if ( iRecordState == ECamRecording ) + { + aGc.BitBltMasked(iPosition, iRecBitmap, iSize, iRecBitmapMask, ETrue); + } + else if ( iRecordState == ECamRecordPaused ) + { + if( iShowPaused ) + { + aGc.BitBltMasked(iPosition, iRecPauseBitmap, iSize, iRecPauseBitmapMask, ETrue); + } + } + else + { + } + } + +// --------------------------------------------------------- +// CCamRecordingIconDecoration::HandleControllerEventL +// Listens for controller events +// --------------------------------------------------------- +// +void +CCamRecordingIconDecoration +::HandleControllerEventL( TCamControllerEvent aEvent, TInt /*aError*/ ) + { + if( aEvent == ECamEventOperationStateChanged ) + { + TCamCaptureOperation operation = iController.CurrentOperation(); + + // Update based on new controller state + if( ECamCapturing == operation ) + { + ChangeRecordState(ECamRecording); + } + else if( ECamPaused == operation ) + { + ChangeRecordState(ECamRecordPaused); + iShowPaused = ETrue; + + // Kick off the pause flash timer + if( !iPauseFlashPeriodic->IsActive() ) + { + TCallBack cb( PauseFlashCallBack, this ); + iPauseFlashPeriodic->Start( KCamVidPauseFlashInterval, + KCamVidPauseFlashInterval, + cb ); + } + } + else + { + ChangeRecordState( ECamNotRecording ); + } + + // Cancel the timer if need be + if( iRecordState != ECamRecordPaused ) + { + if( iPauseFlashPeriodic->IsActive() ) + { + iPauseFlashPeriodic->Cancel(); + } + } + } + } + +// --------------------------------------------------------- +// CCamRecordingIconDecoration::ChangeRecordState +// Changes iRecordState, tells observers to update +// --------------------------------------------------------- +// +void CCamRecordingIconDecoration::ChangeRecordState(TCamRecordState aNewState) + { + if ( iRecordState != aNewState ) + { + BroadcastEvent(ECamObserverEventRecordingIconUpdated); + } + iRecordState = aNewState; + } + +// --------------------------------------------------------- +// CCamRecordingIconDecoration::PauseFlashCallBack +// Callback function from periodic timer used to flash paused icon every 0.8 secs +// --------------------------------------------------------- +// +TInt CCamRecordingIconDecoration::PauseFlashCallBack( TAny* aRecordingIconDecoration ) + { + __ASSERT_DEBUG( aRecordingIconDecoration, CamPanic( ECamPanicNullPointer ) ); + static_cast ( aRecordingIconDecoration )-> + TogglePauseIconFlash(); + return KErrNone; + } + +// --------------------------------------------------------- +// CCamRecordingIconDecoration::TogglePauseIconFlash +// Updates paused icon state in response to periodic timer +// --------------------------------------------------------- +// +void CCamRecordingIconDecoration::TogglePauseIconFlash() + { + PRINT(_L("CCamRecordingIconDecoration::TogglePauseIconFlash: broadcasting ECamObserverEventRecordingIconUpdated")); + iShowPaused = !iShowPaused; + BroadcastEvent(ECamObserverEventRecordingIconUpdated); + } + +// --------------------------------------------------------- +// CCamRecordingIconDecoration::RegisterObserverL +// Registers an observer +// --------------------------------------------------------- +// +void CCamRecordingIconDecoration::RegisterObserverL(MCamObserver* aObserver) + { + iObserverHandler->RegisterObserverL(aObserver); + } + +// --------------------------------------------------------- +// CCamRecordingIconDecoration::DeregisterObserver +// Deregisters an observer +// --------------------------------------------------------- +// +void CCamRecordingIconDecoration::DeregisterObserver(MCamObserver* aObserver) + { + iObserverHandler->DeregisterObserver(aObserver); + } + +// --------------------------------------------------------- +// CCamRecordingIconDecoration::BroadcastEvent +// Broadcasts an event code to all observers +// --------------------------------------------------------- +// +void CCamRecordingIconDecoration::BroadcastEvent(TCamObserverEvent aEvent) + { + iObserverHandler->BroadcastEvent(aEvent); + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamSAEventActive.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamSAEventActive.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handler for System Agent events* +*/ + + +// INCLUDE FILES +#include +#include "CamSAEventActive.h" +#include "CamAppController.h" + +// We need to use a large enough priority, so that +// we get system agent events even when incoming call +// occurs during recording. +const TInt EPrioritySuperHigh = 2000; + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------- +// CCamSAEventActive::CCamSAEventActive +// C++ constructor +// --------------------------------------------------------- +// +CCamSAEventActive::CCamSAEventActive( CCamAppController& aController, + const RSystemAgent& aSystemAgent ) + : CActive( EPrioritySuperHigh ), iController( aController ), + iSystemAgent( aSystemAgent ) + { + iRequestIssued = EFalse; + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------- +// Destructor +// --------------------------------------------------------- +// +CCamSAEventActive::~CCamSAEventActive() + { + PRINT( _L("Camera => ~CCamSAEventActive") ); + Cancel(); + PRINT( _L("Camera <= ~CCamSAEventActive") ); + } + +// --------------------------------------------------------- +// CCamSAEventActive::IssueRequest +// Issue a request to receive events from System Agent +// --------------------------------------------------------- +// +void CCamSAEventActive::IssueRequest() + { + iSAEvent.SetRequestStatus( iStatus ); + if ( !iRequestIssued ) + { + iRequestIssued = ETrue; + iSystemAgent.NotifyOnAnyEvent( iSAEvent ); + SetActive() ; + } + } + +// --------------------------------------------------------- +// CCamSAEventActive::DoCancel +// Cancel the request to receive events from System Agent +// --------------------------------------------------------- +// +void CCamSAEventActive::DoCancel() + { + iSystemAgent.NotifyEventCancel(); + iRequestIssued = EFalse; + } + +// --------------------------------------------------------- +// CCamSAEventActive::RunError +// Called when RunL() is trapped by Active Scheduler +// --------------------------------------------------------- +// +TInt CCamSAEventActive::RunError( TInt /*aError*/ ) + { + Cancel(); + IssueRequest(); + return KErrNone; + } + +// --------------------------------------------------------- +// Called when an event comes from System Agent +// --------------------------------------------------------- +// +void CCamSAEventActive::RunL() + { + iRequestIssued = EFalse; + iController.HandleSysAgentEventL( iSAEvent ); + IssueRequest(); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamSceneListBox.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamSceneListBox.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera scenes list-box* +*/ + + + +// INCLUDE FILES +#include "CamSceneListBox.h" +#include "CamSceneListBoxModel.h" + +#include "CamCaptureSetupListItemDrawer.h" +#include "CamCaptureSetupControlHandler.h" + +#include "CamUtility.h" + +// ============================ MEMBER FUNCTIONS =============================== + +CCamSceneListBox::~CCamSceneListBox() + { + + } + +/** +* C++ default constructor. +*/ +CCamSceneListBox::CCamSceneListBox( TCamCameraMode aMode, + MCamSettingValueObserver* aObserver, + CCamAppController& aController ) + : CCamCaptureSetupListBox( aObserver, aController ), + iMode( aMode ) + { + } + +/** +* By default Symbian 2nd phase constructor is private. +*/ +void CCamSceneListBox::ConstructL( + CCamAppController& aController, + const CCoeControl* aParent, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray, + TBool aUserBaseScenes ) + { + iBorder = TGulBorder::ENone; + + //Constructing model + CCamSceneListBoxModel* model = + CCamSceneListBoxModel::NewLC( aController, + iMode, + aSummaryTitleTextArray, + aSummaryDescriptionTextArray, + aUserBaseScenes, + Rect() ); + + CCamCaptureSetupListItemDrawer* itemDrawer = + CCamCaptureSetupListItemDrawer::NewL( *model ); + + + itemDrawer->SetParentControl( aParent ); + + // CEikListBox takes ownership before anything can leave. + // Do not need the model or drawer on the stack when call ConstructL, + // because CEikListBox assigns objects as member variables before + // ConstructL calls any leaving functions. + CleanupStack::Pop( model ); + CEikListBox::ConstructL( model, itemDrawer, aParent, 0/*aFlags*/ ); + // The number of items is fixed after the list box has been constructed + const TInt KMaxListItems = 5; // This value should come from the LAF + // Find the number of items to be displayed in the list box + iRequiredHeightInNumOfItems = Min( Model()->NumberOfItems(), KMaxListItems ); + SetItemHeightL( iItemDrawer->MinimumCellSize().iHeight ); + } + + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamSceneListBoxModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamSceneListBoxModel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,185 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Scene list box model* +*/ + + + +// INCLUDE FILES +#include "CamSceneListBoxModel.h" +#include "CamCaptureSetupListItem.h" +#include "CamUtility.h" +#include +#include + +#include +#include + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamSceneListBoxModel::CCamSceneListBoxModel +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamSceneListBoxModel::CCamSceneListBoxModel( + CCamAppController& aController, + TCamCameraMode aMode, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray, + TBool aUserBaseScenes ) + : CCamCaptureSetupListBoxModel( aController, ETrue ), + iMode( aMode ), + iSummaryTitleTextArray( aSummaryTitleTextArray ), + iSummaryDescriptionTextArray( aSummaryDescriptionTextArray ), + iUserBaseScenes( aUserBaseScenes ), + iController( aController ) + { + } + +// ----------------------------------------------------------------------------- +// CCamSceneListBoxModel::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamSceneListBoxModel::ConstructL( TRect aListBoxRect ) + { + ReadLayoutData( aListBoxRect ); + GetDataFromResourceL(); + } + + +// ----------------------------------------------------------------------------- +// GetDataFromResourceL +// ----------------------------------------------------------------------------- +// +void +CCamSceneListBoxModel::GetDataFromResourceL() + { + TInt resource = KErrNotFound; + + if( ECamControllerVideo == iMode ) + { + resource = R_CAM_CAPTURE_SETUP_LIST_VIDEO_SHOOTING_MODE; + } + else + { + if( iUserBaseScenes ) + resource = R_CAM_CAPTURE_SETUP_LIST_USER_SCENE_SHOOTING_MODE; + else + resource = R_CAM_CAPTURE_SETUP_LIST_PHOTO_SHOOTING_MODE; + } + + if( KErrNotFound != resource ) + { + GetScenesDataL( resource ); + } + } + + +// ----------------------------------------------------------------------------- +// CCamSceneListBoxModel::GetScenesDataL +// Load up data and descriptions for supported +// ----------------------------------------------------------------------------- +// +void CCamSceneListBoxModel::GetScenesDataL( TInt aArrayResourceId ) + { + + // create array from resource + TResourceReader reader; + CEikonEnv::Static()->CreateResourceReaderLC( reader, aArrayResourceId ); + const TInt count = reader.ReadInt16(); + + // for each entry in the resource array, create a new list item + TInt i; + for ( i = 0; i < count; i++ ) + { + CCamCaptureSetupListItem* listItem = + CCamCaptureSetupListItem::NewLC( reader, iIconLayoutData ); + + TInt sceneVal = listItem->ItemValue(); + if( IsSupportedScene( sceneVal ) ) + { + iItemArray.AppendL( listItem ); + CleanupStack::Pop( listItem ); + } + else + { + CleanupStack::PopAndDestroy( listItem ); + } + } + CleanupStack::PopAndDestroy(); // reader + } + +// ----------------------------------------------------------------------------- +// CCamSceneListBoxModel::IsSupportedScene +// Check if a specific scene is supported by current product +// ----------------------------------------------------------------------------- +// +TBool CCamSceneListBoxModel::IsSupportedScene( TInt aItem ) + { + TBool imageMode = (ECamControllerImage == iMode); + + // Scene must be in supported scenes list. + TBool supported = iController.IsSceneSupported( aItem, imageMode ); + + // Still, user scene is never supported in user scene base list. + TBool userException = (ECamSceneUser == aItem && iUserBaseScenes ); + + if( supported && !userException ) + { + return ETrue; + } + else + { + return EFalse; + } + } + +// ----------------------------------------------------------------------------- +// CCamSceneListBoxModel::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamSceneListBoxModel* +CCamSceneListBoxModel::NewLC( + CCamAppController& aController, + TCamCameraMode aMode, + RPointerArray& aSummaryTitleTextArray, + RPointerArray& aSummaryDescriptionTextArray, + TBool aUserBaseScenes, + TRect aListBoxRect ) + { + CCamSceneListBoxModel* self = + new( ELeave ) CCamSceneListBoxModel( aController, + aMode, + aSummaryTitleTextArray, + aSummaryDescriptionTextArray, + aUserBaseScenes ); + + CleanupStack::PushL( self ); + self->ConstructL( aListBoxRect ); + return self; + } + + +// Destructor +CCamSceneListBoxModel::~CCamSceneListBoxModel() + { + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamSceneSettingContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamSceneSettingContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1636 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container class for scene settings view* +*/ + +// INCLUDE FILES +#include "CamSceneSettingContainer.h" +#include "CamUtility.h" +#include "CamPanic.h" + +#include +#include // For CCoeAppUiBase +#include // For CEikApplication +#include +#include +#include +#include +#include +#include +#include +#include +#include // resource reader + +#include +#include + + +// CONSTANTS + +const TInt KStepSize = 4; // Pixels the animation moves each timer event + +const TInt KCornerSize = 3; +const TInt KBorderSize = 1; + +const TReal KNumIconStages = 7; + +#define KRgbGray4 TRgb(0xEEEEEE) +#define KRgbGray3 TRgb(0xDDDDDD) +#define KRgbGray2 TRgb(0xCCCCCC) +#define KRgbGray1 TRgb(0xBBBBBB) + + +#ifdef __WINS__ +static const TInt KTimerPeriod = 10000; +#else +static const TInt KTimerPeriod = 150000; +#endif + +// ================= MEMBER FUNCTIONS ======================= + +// ----------------------------------------------------------------------------- +// TCamAnimationData::Initialise +// Sets up the animation data +// ----------------------------------------------------------------------------- +// +void TCamAnimationData::Initialise( const TRect& aRect ) + { + iDeltaY = KStepSize; + // scrolling needs to be faster (2 times?) than the fade in/out + iScrollingY = iDeltaY * 2; + + iCurrentRect = aRect; + iPreviousRect = iCurrentRect; + iCurrentRectOld = iCurrentRect; + iPreviousRectOld = iCurrentRect; + + iStep = 0; + iPenFadeOut = KRgbBlack; + iPenFadeIn = KRgbWhite; + iScrolling = EFalse; + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingItem::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamSceneSettingItem* CCamSceneSettingItem::NewL( TCamSceneId aSceneId, + const TSize& aLargeBmpSize, + const TSize& aSmallBmpSize ) + { + CCamSceneSettingItem* self = new( ELeave ) CCamSceneSettingItem( aSceneId ); + CleanupStack::PushL( self ); + self->ConstructL( aLargeBmpSize, aSmallBmpSize ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingItem::~CCamSceneSettingItem +// Destructor +// --------------------------------------------------------------------------- +// +CCamSceneSettingItem::~CCamSceneSettingItem() + { + PRINT( _L("Camera => ~CCamSceneSettingItem") ); + delete iBitmapSmall; + delete iBitmap1; + delete iBitmap2; + delete iBitmap3; + delete iBitmap4; + delete iBitmap5; + delete iBitmap6; + delete iBitmapLarge; + delete iTitle; + delete iDescription; + PRINT( _L("Camera <= ~CCamSceneSettingItem") ); + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingItem::SceneId +// Returns the sceneId +// --------------------------------------------------------------------------- +// +TCamSceneId CCamSceneSettingItem::SceneId() const + { + return iSceneId; + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingItem::Icon +// Returns the bitmap specified by aSize +// --------------------------------------------------------------------------- +// +const CFbsBitmap* CCamSceneSettingItem::Icon( TCamIconSize aSize ) const + { + if ( aSize == ECamIconSizeLarge ) + { + return iBitmapLarge; + } + else if ( aSize == ECamIconSizeSmall ) + { + return iBitmapSmall; + } + else if ( aSize == ECamIconSizeOne ) + { + return iBitmap1; + } + else if ( aSize == ECamIconSizeTwo ) + { + return iBitmap2; + } + else if ( aSize == ECamIconSizeThree ) + { + return iBitmap3; + } + else if ( aSize == ECamIconSizeFour ) + { + return iBitmap4; + } + else if ( aSize == ECamIconSizeFive ) + { + return iBitmap5; + } + else if ( aSize == ECamIconSizeSix ) + { + return iBitmap6; + } + else + { + return iBitmapLarge; + } + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingItem::Title +// returns the title text +// --------------------------------------------------------------------------- +// +const HBufC* CCamSceneSettingItem::Title() const + { + return iTitle; + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingItem::Description +// returns the title text +// --------------------------------------------------------------------------- +// +const HBufC* CCamSceneSettingItem::Description() const + { + return iDescription; + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingItem::ConstructL +// Symbian OS second phase constructor +// --------------------------------------------------------------------------- +// +void CCamSceneSettingItem::ConstructL( const TSize& aLargeBmpSize, + const TSize& aSmallBmpSize ) + { + TInt bmpLarge = 0; + TInt bmpSmall = 0; + TInt title = 0; + TInt description = 0; + switch ( iSceneId ) + { + case ECamSceneNight: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_night_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_night_l; + title = R_CAM_SCENE_TITLE_NIGHT; + description = R_CAM_SCENE_DESCRIPTION_NIGHT; + } + break; + case ECamSceneMacro: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_macro_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_macro_l; + title = R_CAM_SCENE_TITLE_MACRO; + description = R_CAM_SCENE_DESCRIPTION_MACRO; + } + break; + case ECamScenePortrait: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_port_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_port_l; + title = R_CAM_SCENE_TITLE_PORTRAIT; + description = R_CAM_SCENE_DESCRIPTION_PORTRAIT; + } + break; + case ECamSceneAuto: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_auto_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_auto_l; + title = R_CAM_SCENE_TITLE_AUTO; + description = R_CAM_SCENE_DESCRIPTION_AUTO; + } + break; + case ECamSceneScenery: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_land_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_land_l; + title = R_CAM_SCENE_TITLE_LANDSCAPE; + description = R_CAM_SCENE_DESCRIPTION_LANDSCAPE; + } + break; + case ECamSceneSports: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_sport_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_sport_l; + title = R_CAM_SCENE_TITLE_SPORTS; + description = R_CAM_SCENE_DESCRIPTION_SPORTS; + } + break; + case ECamSceneUser: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_user_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_user_l; + title = R_CAM_SCENE_TITLE_USER; + description = R_CAM_SCENE_DESCRIPTION_USER; + } + break; + case ECamSceneNormal: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_auto_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_auto_l; + title = R_CAM_SCENE_TITLE_NORMAL; + description = R_CAM_SCENE_DESCRIPTION_NORMAL; + } + break; + case ECamSceneNightScenery: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_nightland_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_nightland_l; + title = R_CAM_SCENE_TITLE_NIGHT_LANDSCAPE; + description = R_CAM_SCENE_DESCRIPTION_NIGHT_LANDSCAPE; + } + break; + case ECamSceneNightPortrait: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_nightport_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_nightport_l; + title = R_CAM_SCENE_TITLE_NIGHT_PORTRAIT; + description = R_CAM_SCENE_DESCRIPTION_NIGHT_PORTRAIT; + } + break; + case ECamSceneCandlelight: + { + bmpSmall = EMbmCameraappQgn_ico_lcam_sce_candle_s; + bmpLarge = EMbmCameraappQgn_ico_lcam_sce_candle_l; + title = R_CAM_SCENE_TITLE_CANDLELIGHT; + description = R_CAM_SCENE_DESCRIPTION_CANDLELIGHT; + } + break; + default: + User::Leave( KErrGeneral ); + break; + } + + // Find the name and path of the MBM file for bitmaps + TFileName mbmFileName; + CamUtility::ResourceFileName( mbmFileName ); + + iBitmapSmall = AknIconUtils::CreateIconL( mbmFileName, bmpSmall ); + AknIconUtils::SetSize( iBitmapSmall, aSmallBmpSize, EAspectRatioNotPreserved ); + + TReal xInc = TReal( aLargeBmpSize.iWidth - aSmallBmpSize.iWidth ) / KNumIconStages; + TReal yInc = TReal( aLargeBmpSize.iHeight - aSmallBmpSize.iHeight ) / KNumIconStages; + + TSize size; + TReal width = aSmallBmpSize.iWidth; + TReal height = aSmallBmpSize.iHeight; + + width += xInc; + height += yInc; + size.SetSize( ( TInt ) width, ( TInt ) height ); + + iBitmap1 = AknIconUtils::CreateIconL( mbmFileName, bmpLarge ); + AknIconUtils::SetSize( iBitmap1, size, EAspectRatioNotPreserved); + + width += xInc; + height += yInc; + size.SetSize( ( TInt ) width, ( TInt ) height ); + + iBitmap2 = AknIconUtils::CreateIconL( mbmFileName, bmpLarge ); + AknIconUtils::SetSize( iBitmap2, size, EAspectRatioNotPreserved ); + + width += xInc; + height += yInc; + size.SetSize( ( TInt ) width, ( TInt ) height ); + + iBitmap3 = AknIconUtils::CreateIconL( mbmFileName, bmpLarge ); + AknIconUtils::SetSize( iBitmap3, size, EAspectRatioNotPreserved ); + + width += xInc; + height += yInc; + size.SetSize( ( TInt ) width, ( TInt ) height ); + + iBitmap4 = AknIconUtils::CreateIconL( mbmFileName, bmpLarge ); + AknIconUtils::SetSize( iBitmap4, size, EAspectRatioNotPreserved ); + + width += xInc; + height += yInc; + size.SetSize( ( TInt ) width, ( TInt ) height ); + + iBitmap5 = AknIconUtils::CreateIconL( mbmFileName, bmpLarge ); + AknIconUtils::SetSize( iBitmap5, size, EAspectRatioNotPreserved ); + + width += xInc; + height += yInc; + size.SetSize( ( TInt ) width, ( TInt ) height ); + + iBitmap6 = AknIconUtils::CreateIconL( mbmFileName, bmpLarge ); + AknIconUtils::SetSize( iBitmap6, size, EAspectRatioNotPreserved ); + + iBitmapLarge = AknIconUtils::CreateIconL( mbmFileName, bmpLarge ); + AknIconUtils::SetSize( iBitmapLarge, aLargeBmpSize, EAspectRatioNotPreserved ); + + iTitle = StringLoader::LoadL( title ); + iDescription = StringLoader::LoadL( description ); + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingItem::CCamSceneSettingContainer +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamSceneSettingItem::CCamSceneSettingItem( TCamSceneId aSceneId ) : + iSceneId( aSceneId ) + { + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamSceneSettingContainer* +CCamSceneSettingContainer::NewL( const TRect& aRect, + CAknView& aView, + TCamCameraMode aMode, + CCamAppController& aController, + TBool aUserBaseScenes ) + { + CCamSceneSettingContainer* self = + new( ELeave ) CCamSceneSettingContainer( aMode, + aController, + aView, + aUserBaseScenes ); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::~CCamSceneSettingContainer +// Destructor +// --------------------------------------------------------------------------- +// +CCamSceneSettingContainer::~CCamSceneSettingContainer() + { + PRINT( _L( "Camera => ~CCamSceneSettingContainer" ) ); + + iSettingItemArray.ResetAndDestroy(); + iSettingItemArray.Close(); + + iHighlightIcons.Close(); + iNormalIcons.Close(); + iDisplacedIcons.Close(); + + iHighlightArray.Close(); + iHighlightTitles.Close(); + iHighlightDescriptions.Close(); + + iNormalTitles.Close(); + iDisplacedTitles.Close(); + + if (iAnimTimer) + { + iAnimTimer->Cancel(); + } + delete iAnimTimer; + delete iScrollFrame; + delete iAnimData.iOffScreenBitmap; + + PRINT( _L( "Camera <= ~CCamSceneSettingContainer" ) ); + } + +// --------------------------------------------------------- +// CCamSceneSettingContainer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamSceneSettingContainer::ConstructL( const TRect& aRect ) + { + PRINT(_L("Camera => CCamSceneSettingContainer::ConstructL") ) + + CCamContainerBase::BaseConstructL( aRect ); + + TBool secondCameraOn = + static_cast( iEikonEnv->AppUi() )->IsSecondCameraEnabled(); + + if( !AknLayoutUtils::LayoutMirrored() ) + { + // get the icon positions from the resource + ReadLayoutL( ROID(R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_ID), iHighlightIcons ); + ReadLayoutL( ROID(R_CAM_SCENE_ICON_DISPLACED_ARRAY_ID), iDisplacedIcons ); + ReadLayoutL( ROID(R_CAM_SCENE_ICON_NORMAL_ARRAY_ID), iNormalIcons ); + + // get the highlight rects + ReadLayoutL( ROID(R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_ID), iHighlightArray ); + + // Check if we require APAC layouts + if( AknLayoutUtils::Variant() == EApacVariant ) + { + // get the layout texts + ReadLayoutL( ROID(R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_APAC_ID), iHighlightTitles ); + ReadLayoutL( ROID(R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_APAC_ID), iHighlightDescriptions ); + + ReadLayoutL( ROID(R_CAM_SCENE_TITLE_NORMAL_ARRAY_APAC_ID), iNormalTitles ); + ReadLayoutL( ROID(R_CAM_SCENE_TITLE_DISPLACED_ARRAY_APAC_ID), iDisplacedTitles ); + } + else + { + // get the layout texts + ReadLayoutL( ROID(R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_ID), iHighlightTitles ); + ReadLayoutL( ROID(R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_ID), iHighlightDescriptions ); + + ReadLayoutL( ROID(R_CAM_SCENE_TITLE_NORMAL_ARRAY_ID), iNormalTitles ); + ReadLayoutL( ROID(R_CAM_SCENE_TITLE_DISPLACED_ARRAY_ID), iDisplacedTitles ); + } + } + else + { + // get the icon positions from the resource + ReadLayoutL( ROID(R_CAM_SCENE_ICON_HIGHLIGHT_ARRAY_AH_ID), iHighlightIcons ); + ReadLayoutL( ROID(R_CAM_SCENE_ICON_DISPLACED_ARRAY_AH_ID), iDisplacedIcons ); + ReadLayoutL( ROID(R_CAM_SCENE_ICON_NORMAL_ARRAY_AH_ID), iNormalIcons ); + + // get the highlight rects + ReadLayoutL( ROID(R_CAM_SCENE_HIGHLIGHT_LAYOUT_ARRAY_AH_ID), iHighlightArray ); + + // get the layout texts + ReadLayoutL( ROID(R_CAM_SCENE_HIGHLIGHT_TITLE_ARRAY_AH_ID), iHighlightTitles ); + ReadLayoutL( ROID(R_CAM_SCENE_HIGHLIGHT_DESCRIPTION_ARRAY_AH_ID), iHighlightDescriptions ); + + ReadLayoutL( ROID(R_CAM_SCENE_TITLE_NORMAL_ARRAY_AH_ID), iNormalTitles ); + ReadLayoutL( ROID(R_CAM_SCENE_TITLE_DISPLACED_ARRAY_AH_ID), iDisplacedTitles ); + } + + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, ROID(R_CAM_SCENE_MAX_ITEMS_TO_DISPLAY_ID)); + iNumberOfIconsToDisplay = reader.ReadInt16(); + CleanupStack::PopAndDestroy(); // reader + + if ( iUserBaseScenes ) + { + CreateSceneArrayL( R_CAM_SCENE_LIST_USER ); + TCamSceneId currentScene = static_cast( + iController.IntegerSettingValue( + ECamSettingItemUserSceneBasedOnScene ) ); + SetCurrentPositionToScene( currentScene ); + SetupScrollbarL(); + } + else if ( ECamControllerImage == iMode ) + { + if ( secondCameraOn ) + { + CreateSceneArrayL( R_CAM_SCENE_LIST_PHOTO_CAM2 ); + } + else + { + CreateSceneArrayL( R_CAM_SCENE_LIST_PHOTO); + SetupScrollbarL(); + } + + TCamSceneId currentScene = static_cast( + iController.IntegerSettingValue( + ECamSettingItemDynamicPhotoScene ) ); + SetCurrentPositionToScene( currentScene ); + } + else + { + if ( secondCameraOn ) + { + CreateSceneArrayL( R_CAM_SCENE_LIST_VIDEO_CAM2); + } + else + { + CreateSceneArrayL( R_CAM_SCENE_LIST_VIDEO ); + } + + TCamSceneId currentScene = static_cast( + iController.IntegerSettingValue( + ECamSettingItemDynamicVideoScene ) ); + SetCurrentPositionToScene( currentScene ); + } + + TInt index = iCurrentArrayPosition - iTopDisplayPosition; + iAnimData.Initialise( iHighlightArray[index].Rect() ); + + // create a bitmap to be used off-screen + iAnimData.iOffScreenBitmap = new ( ELeave ) CFbsBitmap(); + User::LeaveIfError( iAnimData.iOffScreenBitmap->Create( aRect.Size(), EColor256 ) ); + + TInt leftMarginDiff = iNormalIcons[0].Rect().iTl.iX - + iHighlightIcons[0].Rect().iTl.iX; + iAnimData.iIconLeftInc = TReal( leftMarginDiff / KNumIconStages ); + + + // Create the timeout timer + iAnimTimer = CPeriodic::NewL( EPriorityHigh ); + + PRINT(_L("Camera <= CCamSceneSettingContainer::ConstructL") ) + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::ReadLayoutL +// Read the TAknLayoutRect info from the resource file +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::ReadLayoutL( TInt aResourceId, + RArray& aArray) const + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResourceId ); + const TInt count = reader.ReadInt16(); + + TInt i; + // Read all of the layout entries from the resource file + for ( i = 0; i < count; i++ ) + { + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( Rect(), reader ); + User::LeaveIfError( aArray.Append( layoutRect ) ); + } + CleanupStack::PopAndDestroy(); // reader + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::ReadLayoutL +// Read the TAknLayoutText info from the resource file +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::ReadLayoutL( TInt aResourceId, + RArray& aArray) const + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResourceId ); + const TInt count = reader.ReadInt16(); + + TInt i; + // Read all of the layout entries from the resource file + for ( i = 0; i < count; i++ ) + { + TAknLayoutText layoutText; + layoutText.LayoutText( Rect(), reader ); + User::LeaveIfError( aArray.Append( layoutText ) ); + } + CleanupStack::PopAndDestroy(); // reader + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::CCamSceneSettingContainer +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamSceneSettingContainer::CCamSceneSettingContainer( + TCamCameraMode aMode, + CCamAppController& aController, + CAknView& aView, + TBool aUserBaseScenes ) + : CCamContainerBase( aController, aView ), + iMode( aMode ), + iUserBaseScenes( aUserBaseScenes ) + { + } + +// ---------------------------------------------------------------- +// CCamSceneSettingContainer::UserSceneHighlighted +// Returns ETrue if the current selected scene is User +// ---------------------------------------------------------------- +// +TBool CCamSceneSettingContainer::UserSceneHighlighted() + { + return ( iSettingItemArray[iCurrentArrayPosition]->SceneId() == + ECamSceneUser ); + } + +// ---------------------------------------------------------------- +// CCamSceneSettingContainer::SaveSceneSetting +// Stores the currently selected scene in the dynamic settings model +// ---------------------------------------------------------------- +// +TBool CCamSceneSettingContainer::SaveSceneSettingL() + { + TInt scene = 0; + if ( iUserBaseScenes ) + { + scene = ECamSettingItemUserSceneBasedOnScene; + } + else if ( ECamControllerImage == iMode ) + { + scene = ECamSettingItemDynamicPhotoScene; + } + else + { + scene = ECamSettingItemDynamicVideoScene; + } + + iController.SetIntegerSettingValueL( scene, + iSettingItemArray[iCurrentArrayPosition]->SceneId() ); + + // If user selected sports scene from list. + if ( iSettingItemArray[iCurrentArrayPosition]->SceneId() == ECamSceneSports ) + { + // if the selection was for user scene base scene, and user + // scene is active, but request was cancelled, return false. + if ( ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) + == ECamSceneUser ) && + ( iController.IntegerSettingValue( ECamSettingItemUserSceneBasedOnScene ) + != ECamSceneSports ) ) + { + return EFalse; + } + // if the selection was for the photo/video scene, but request was + // cancelled, return false. + if ( ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) + != ECamSceneUser ) && + ( iController.IntegerSettingValue( scene ) != ECamSceneSports ) ) + { + return EFalse; + } + } + // Otherwise, if the user selected user scene from the list, but request + // was cancelled, return false. + else if ( ( iSettingItemArray[iCurrentArrayPosition]->SceneId() + == ECamSceneUser ) && + ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) + != ECamSceneUser ) ) + { + return EFalse; + } + + // Remove lint warning. + else + { + } + + // In all other cases, return true. + return ETrue; + } + + +// --------------------------------------------------------- +// CCamSceneSettingContainer::CountComponentControls +// Returns the number of controls owned +// --------------------------------------------------------- +// +TInt CCamSceneSettingContainer::CountComponentControls() const + { + TInt count = 0; // Return the number of controls inside this container + if ( iScrollFrame ) + { + count = iScrollFrame->CountComponentControls(); + } + return count; + } + +// --------------------------------------------------------- +// CCamSceneSettingContainer::ComponentControl +// Returns the requested component control +// --------------------------------------------------------- +// +CCoeControl* CCamSceneSettingContainer::ComponentControl( TInt aIndex ) const + { + if ( iScrollFrame ) + { + return iScrollFrame->ComponentControl( aIndex ); + } + else + { + return NULL; + } + } + +// --------------------------------------------------------- +// CCamSceneSettingContainer::Draw +// Draw control +// --------------------------------------------------------- +// +void CCamSceneSettingContainer::Draw( const TRect& /*aRect*/ ) const + { + PRINT(_L("Camera => CCamSceneSettingContainer::Draw") ) + + CWindowGc& gc = SystemGc(); + // Draw the background + gc.SetBrushColor( KRgbWhite ); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.SetPenStyle( CGraphicsContext::ENullPen ); + gc.DrawRect( Rect() ); + gc.SetPenStyle( CGraphicsContext::ESolidPen ); + + TBool drawnHighlight = EFalse; + TInt index = 0; + + TInt i; + for ( i = 0; i < iNumberOfIconsToDisplay; i++ ) + { + TInt position = iTopDisplayPosition + i; + CCamSceneSettingItem* item = iSettingItemArray[position]; + const HBufC* title = item->Title(); + const HBufC* description = item->Description(); + + // Drawing currently selected icon and text + if ( position == iCurrentArrayPosition ) + { + // Draw the highlight + gc.DrawRoundRect( iHighlightArray[i].Rect(), + TSize( KCornerSize, KCornerSize ) ); + + // Draw the enlarged icon + iHighlightIcons[i].DrawImage( gc, + const_cast( item->Icon( ECamIconSizeLarge ) ), NULL ); + + // Draw the enlarged header text + iHighlightTitles[i].DrawText( gc, *title ); + + // Draw the description text + iHighlightDescriptions[i].DrawText( gc, *description ); + +#if 0 // debug drawing code + gc.SetPenColor(KRgbRed); + gc.DrawRect( iHighlightTitles[i].TextRect() ); + gc.DrawRect( iHighlightDescriptions[i].TextRect() ); +#endif + drawnHighlight = ETrue; + } + else // Drawing normal items + { + // Draw the highlight box + TAknLayoutRect layoutRect; + TAknLayoutText layoutText; + if ( drawnHighlight ) + { + layoutRect = iNormalIcons[index]; + layoutText = iNormalTitles[index]; + } + else + { + layoutRect = iDisplacedIcons[index]; + layoutText = iDisplacedTitles[index]; + } + + // Draw the standard icon + layoutRect.DrawImage( gc, + const_cast( item->Icon( ECamIconSizeSmall ) ), NULL ); + // Draw the header text + layoutText.DrawText( gc, *title ); + +#if 0 // debug drawing code + gc.SetPenColor(KRgbRed); + gc.DrawRect( layoutText.TextRect() ); +#endif + index++; + } + } + PRINT(_L("Camera <= CCamSceneSettingContainer::Draw") ) + } + +// ---------------------------------------------------------------- +// CCamSceneSettingContainer::OfferKeyEventL +// Handles this application view's command keys. Forwards other +// keys to child control(s). +// ---------------------------------------------------------------- +// +TKeyResponse CCamSceneSettingContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + PRINT( _L( "Camera => CCamSceneSettingContainer::OfferKeyEventL" ) ); + + if ( iAnimTimer->IsActive() ) + { + return EKeyWasNotConsumed; + } + + // Moving down the list + if ( aKeyEvent.iScanCode == EStdKeyDownArrow && aType == EEventKey ) + { + // at the bottom of the list and pressing down key + if ( iCurrentArrayPosition == iSettingItemArray.Count() - 1 ) + { + // wrap to the top of the list and redraw + iCurrentArrayPosition = 0; + iPreviousArrayPosition = 0; + iTopDisplayPosition = 0; + + iAnimData.iCurrentRect = iHighlightArray[0].Rect(); + iAnimData.iPreviousRect = iAnimData.iCurrentRect; + + if ( iScrollFrame ) + { + iScrollFrame->MoveVertThumbTo( 0 ); + } + + DrawDeferred(); + return EKeyWasConsumed; + } + + iAnimData.iMovingDown = ETrue; + iPreviousArrayPosition = iCurrentArrayPosition; + iCurrentArrayPosition++; + + // need to scroll the list + if( iCurrentArrayPosition > iNumberOfIconsToDisplay - 1 ) + { + iAnimData.iScrolling = ETrue; + iScrollFrame->MoveThumbsBy( 0, 1 ); + iTopDisplayPosition++; + DrawListL(); + + // blit the bitmap at above the 2nd displaced icon + TInt yPos = iDisplacedIcons[1].Rect().iTl.iY; + // less the difference between the top of the first icon on + // the off-screen bitmap and the top of the off-screen bitmap + yPos -= iDisplacedIcons[0].Rect().iTl.iY; + // less the scrolling value + yPos -= iAnimData.iScrollingY; + iAnimData.iOffScreenPos.SetXY( 0, yPos ); + + TInt curIndex = iCurrentArrayPosition - iTopDisplayPosition; + TInt defaultIndex = curIndex - 1; + iAnimData.iTitleFadeIn = iNormalTitles[defaultIndex].TextRect(); + + iAnimData.iCurrentRect = iHighlightArray[curIndex].Rect(); + TRect rect = iNormalIcons[defaultIndex].Rect(); + iAnimData.iCurrentRect.iTl.iY = rect.iTl.iY; + iAnimData.iCurrentRect.iBr.iY = iAnimData.iCurrentRect.iTl.iY + rect.Height(); + + // clear the top item from the list + ActivateGc(); + SystemGc().Clear( iHighlightArray[0].Rect() ); + DeactivateGc(); + } + else // just move to the next position + { + MoveHighlight(); + } + + StartAnimation(); + return EKeyWasConsumed; + } + else if ( aKeyEvent.iScanCode == EStdKeyUpArrow && aType == EEventKey ) + { + // At the top of list and pressing the up key + if ( iCurrentArrayPosition == 0 ) + { + // wrap to the bottom of the list and redraw + TInt lastItem = iSettingItemArray.Count() - 1; + iCurrentArrayPosition = lastItem; + iPreviousArrayPosition = lastItem; + iTopDisplayPosition = iSettingItemArray.Count() - iNumberOfIconsToDisplay; + + TInt pos = iCurrentArrayPosition - iTopDisplayPosition; + iAnimData.iCurrentRect = iHighlightArray[pos].Rect(); + iAnimData.iPreviousRect = iAnimData.iCurrentRect; + + if ( iScrollFrame ) + { + iScrollFrame->MoveThumbsBy( 0, iTopDisplayPosition ); + } + + DrawDeferred(); + iController.StartIdleTimer(); + return EKeyWasConsumed; + } + + iAnimData.iMovingDown = EFalse; + iPreviousArrayPosition = iCurrentArrayPosition; + iCurrentArrayPosition--; + + // need to scroll the list + if ( iPreviousArrayPosition > iNumberOfIconsToDisplay - 1 ) + { + iAnimData.iScrolling = ETrue; + iScrollFrame->MoveThumbsBy( 0, -1 ); + // draw the list before decrementing top display pos + DrawListL(); + iTopDisplayPosition--; + + iAnimData.iOffScreenPos.SetXY( 0, iAnimData.iScrollingY ); + + TInt curIndex = iCurrentArrayPosition - iTopDisplayPosition; + TInt defaultIndex = curIndex - 1; + iAnimData.iTitleFadeIn = iNormalTitles[defaultIndex].TextRect(); + + iAnimData.iCurrentRect = iHighlightArray[curIndex].Rect(); + TRect rect = iNormalIcons[defaultIndex].Rect(); + iAnimData.iCurrentRect.iTl.iY = rect.iTl.iY; + iAnimData.iCurrentRect.iBr.iY = iAnimData.iCurrentRect.iTl.iY + rect.Height(); + } + else // just move to the next position + { + MoveHighlight(); + } + + StartAnimation(); + iController.StartIdleTimer(); + return EKeyWasConsumed; + } + else + { + return CCamContainerBase::OfferKeyEventL( aKeyEvent, aType ); + } + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::HandleScrollEventL +// Called when a scroll event is detected +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::HandleScrollEventL( CEikScrollBar* /*aScrollBar*/, + TEikScrollEvent /*aEventType*/ ) + { + } + +// ---------------------------------------------------------------- +// CCamBurstThumbnailGrid::SetupScrollbarL +// Sets up the scrollbar for the list +// ---------------------------------------------------------------- +// +void CCamSceneSettingContainer::SetupScrollbarL() + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + iScrollLayout.LayoutRect( Rect(), ROID(R_CAM_SCENE_SCROLLBAR_POSITION_ID)); + } + else + { + iScrollLayout.LayoutRect( Rect(), ROID(R_CAM_SCENE_SCROLLBAR_POSITION_AH_ID)); + } + + // Create scrollbar frame + iScrollFrame = new (ELeave) CEikScrollBarFrame( this, this, ETrue ); + + // Set up the model accordingly + ivModel.SetScrollSpan( iSettingItemArray.Count() ); + ivModel.SetFocusPosition( 0 ); + ivModel.SetWindowSize( iNumberOfIconsToDisplay ); + + iScrollFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EOn ); + iScrollFrame->CreateDoubleSpanScrollBarsL( ETrue, EFalse ); + + TRect rect = iScrollLayout.Rect(); + iScrollFrame->Tile( &ivModel, rect ); + iScrollFrame->MoveVertThumbTo( iTopDisplayPosition ); + } + +// ---------------------------------------------------------------- +// CCamSceneSettingContainer::CreateSceneArrayL +// Populates the scene array with scenes using a resource +// ---------------------------------------------------------------- +// +void CCamSceneSettingContainer::CreateSceneArrayL( TInt aResourceId ) + { + // Create a resource reader for the scene array resource id. + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResourceId ); + + // Create all scene list items from the resource reader. + TInt sceneCount = reader.ReadInt16(); + + TInt i; + for ( i = 0; i < sceneCount; ++i ) + { + TCamSceneId sceneId = static_cast ( reader.ReadInt16() ); + if ( iController.IsSceneSupported( sceneId ) ) + { + TSize large = iHighlightIcons[0].Rect().Size(); + TSize small = iNormalIcons[0].Rect().Size(); + CCamSceneSettingItem* settingItem = CCamSceneSettingItem::NewL( + sceneId, large, small ); + CleanupStack::PushL( settingItem ); + iSettingItemArray.AppendL( settingItem ); + CleanupStack::Pop( settingItem ); + } + + } + + CleanupStack::PopAndDestroy(); // reader + + // If total number of scenes is less than the current number + // of icons to display on screen then reset the current number of + // icons to display on screen. + if ( sceneCount < iNumberOfIconsToDisplay ) + { + iNumberOfIconsToDisplay = sceneCount; + } + } + +// ---------------------------------------------------------------- +// CCamSceneSettingContainer::SetCurrentPositionToScene +// Sets the current position of the scene array to the element +// associated with a particular scene id. +// ---------------------------------------------------------------- +// +void CCamSceneSettingContainer::SetCurrentPositionToScene +( TCamSceneId aSceneId ) + { + // Find scene in scene array. + TInt count = iSettingItemArray.Count(); + TInt j; + for ( j = 0; j < count; j++ ) + { + if ( aSceneId == iSettingItemArray[j]->SceneId() ) + { + iCurrentArrayPosition = j; + j = count; // stop loop + } + } + + // If scene array position is offscreen, move top display position. + if ( iCurrentArrayPosition >= iNumberOfIconsToDisplay ) + { + iTopDisplayPosition = ( iCurrentArrayPosition - + iNumberOfIconsToDisplay ) + 1; + } + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::StartAnimation +// Called to start the animation +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::StartAnimation() + { +#ifndef _ANIMATION_OFF + iAnimTimer->Start( KTimerPeriod, KTimerPeriod, TCallBack( TimerExpired, this ) ); +#else + DrawDeferred(); +#endif + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::TimerExpired +// Called when the timer expires +// --------------------------------------------------------------------------- +// +TInt CCamSceneSettingContainer::TimerExpired( TAny* aAny ) + { + CCamSceneSettingContainer* container = + static_cast( aAny ); + __ASSERT_DEBUG( container != NULL, CamPanic( ECamPanicNullPointer ) ); + container->Animate(); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::Animate +// Called every time the timer expires to update the animation +// The animation works by changing a single line non-highlighted item +// into a double line highlighted item. +// When a highlighted item comes into focus, the title text remains the same +// size, but its position is moved up to indicate moving from a single to +// double line. +// The description text fades in underneath the title text - the title text +// moves up to make way for the description text. +// When a highlighted item looses the focus, the title text remains the same +// size, but its position moves down to indicate moving from a double line +// to a single line. +// The description text fades out and the title text moves down into the +// position occupied by the description text. +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::Animate() + { + iAnimData.iStep++; + + // update the pen/bitmaps + UpdateAnimationData(); + + // font is the same for all titles + const CAknLayoutFont* layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( + iHighlightTitles[0].Font() ); + __ASSERT_DEBUG( layoutFont != NULL, CamPanic( ECamPanicNullPointer ) ); + TInt baseline = layoutFont->TextPaneTopToBaseline(); + + const CCamSceneSettingItem* previousItem = iSettingItemArray[iPreviousArrayPosition]; + const CCamSceneSettingItem* currentItem = iSettingItemArray[iCurrentArrayPosition]; + + TInt currentPosition = iCurrentArrayPosition - iTopDisplayPosition; + TInt previousPosition = iPreviousArrayPosition - iTopDisplayPosition; + + CWindowGc& gc = SystemGc(); + ActivateGc(); + + TBool animScrolled = ETrue; + TBool animCompleted = ETrue; + if ( iAnimData.iScrolling ) + { + animScrolled = ScrollList(); + + // update the highlight rects + animCompleted = UpdateHighlight(); + + DrawIcon( EFalse ); + + if ( iAnimData.iMovingDown ) + { + // Save the current position, so we can rub it out later + iAnimData.iTitleFadeInOld = iAnimData.iTitleFadeIn; + + TRect rectLimit = iHighlightTitles[currentPosition].TextRect(); + iAnimData.iTitleFadeIn.Move( 0, -iAnimData.iDeltaY ); + if ( iAnimData.iTitleFadeIn.iTl.iY <= rectLimit.iTl.iY ) + { + // finish + iAnimData.iTitleFadeIn.iTl.iY = rectLimit.iTl.iY; + iAnimData.iTitleFadeIn.iBr.iY = rectLimit.iBr.iY; + } + DrawText( *currentItem->Title(), layoutFont, baseline, EFalse ); + } + + // draw the description text + iHighlightDescriptions[currentPosition].DrawText( gc, + *currentItem->Description(), ETrue, iAnimData.iPenFadeIn ); + + // draw the highlighted border + DrawHighlight(); + } + else + { + // update the highlight rects + animCompleted = UpdateHighlight(); + + // draw the highlighted border + DrawHighlight(); + +/**** PREVIOUS ITEM - FADE OUT ****/ + DrawIcon( ETrue ); + + // fade description text out + iHighlightDescriptions[previousPosition].DrawText( gc, + *previousItem->Description(), ETrue, iAnimData.iPenFadeOut ); + + // Save the current position, so we can rub it out later + iAnimData.iTitleFadeOutOld = iAnimData.iTitleFadeOut; + + // Draw the title text if moving down the list + TRect rectLimit; + if ( iAnimData.iMovingDown ) + { + rectLimit = iDisplacedTitles[previousPosition].TextRect(); + } + else // Draw the title text if moving up the list + { + rectLimit = iNormalTitles[previousPosition-1].TextRect(); + } + + iAnimData.iTitleFadeOut.Move( 0, iAnimData.iDeltaY ); + if ( iAnimData.iTitleFadeOut.iTl.iY >= rectLimit.iTl.iY ) + { + // finish + iAnimData.iTitleFadeOut.iTl.iY = rectLimit.iTl.iY; + iAnimData.iTitleFadeOut.iBr.iY = rectLimit.iBr.iY; + } + + DrawText( *previousItem->Title(), layoutFont, baseline, ETrue ); + +/**** NEXT ITEM - FADE IN ****/ + DrawIcon( EFalse ); + + if ( iAnimData.iMovingDown ) + { + iHighlightDescriptions[currentPosition].DrawText( gc, + *currentItem->Description(), ETrue, iAnimData.iPenFadeIn ); + } + else + { + // don't fade in straight away otherwise looks messy + if ( iAnimData.iStep > 3 ) + { + iHighlightDescriptions[currentPosition].DrawText( gc, + *currentItem->Description(), ETrue, iAnimData.iPenFadeIn ); + } + } + + // Save the current position, so we can rub it out later + iAnimData.iTitleFadeInOld = iAnimData.iTitleFadeIn; + + rectLimit = iHighlightTitles[currentPosition].TextRect(); + iAnimData.iTitleFadeIn.Move( 0, -iAnimData.iDeltaY ); + if ( iAnimData.iTitleFadeIn.iTl.iY <= rectLimit.iTl.iY ) + { + // finish + iAnimData.iTitleFadeIn.iTl.iY = rectLimit.iTl.iY; + iAnimData.iTitleFadeIn.iBr.iY = rectLimit.iBr.iY; + } + DrawText( *currentItem->Title(), layoutFont, baseline, EFalse ); + } + + DeactivateGc(); + + if ( animScrolled && animCompleted ) + { + iAnimTimer->Cancel(); + iAnimData.iScrolling = EFalse; + iAnimData.iPenFadeOut = KRgbBlack; + iAnimData.iPenFadeIn = KRgbWhite; + iAnimData.iStep = 0; + iAnimData.iIconLeftOffset = 0; + DrawNow(); + } + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::UpdateHighlight +// Updates the highlight rect each time Animate() is called +// --------------------------------------------------------------------------- +// +TBool CCamSceneSettingContainer::UpdateHighlight() + { + TInt currentPosition = iCurrentArrayPosition - iTopDisplayPosition; + TInt previousPosition = iPreviousArrayPosition - iTopDisplayPosition; + + // Save the current position, so we can rub it out later + iAnimData.iCurrentRectOld = iAnimData.iCurrentRect; + iAnimData.iPreviousRectOld = iAnimData.iPreviousRect; + + TBool completedCurrentTop = EFalse; + TBool completedCurrentBottom = EFalse; + TBool completedPreviousTop = EFalse; + TBool completedPreviousBottom = EFalse; + + TInt currentRectTopLimit = iHighlightArray[currentPosition].Rect().iTl.iY; + TInt currentRectBottomLimit = iHighlightArray[currentPosition].Rect().iBr.iY; + + iAnimData.iCurrentRect.iTl.iY -= iAnimData.iDeltaY; + if ( iAnimData.iCurrentRect.iTl.iY <= currentRectTopLimit ) + { + iAnimData.iCurrentRect.iTl.iY = currentRectTopLimit; + completedCurrentTop = ETrue; + } + iAnimData.iCurrentRect.iBr.iY += iAnimData.iDeltaY; + if ( iAnimData.iCurrentRect.iBr.iY >= currentRectBottomLimit ) + { + iAnimData.iCurrentRect.iBr.iY = currentRectBottomLimit; + completedCurrentBottom = ETrue; + } + + // not scrolling so fade the previous highlight + if ( !iAnimData.iScrolling ) + { + TInt previousRectTopLimit; + TInt previousRectBottomLimit; + if ( iAnimData.iMovingDown ) + { + previousRectTopLimit = iDisplacedIcons[previousPosition].Rect().iTl.iY; + previousRectBottomLimit = iDisplacedIcons[previousPosition].Rect().iBr.iY; + } + else // moving up + { + previousRectTopLimit = iNormalIcons[previousPosition-1].Rect().iTl.iY; + previousRectBottomLimit = iNormalIcons[previousPosition-1].Rect().iBr.iY; + } + + iAnimData.iPreviousRect.iTl.iY += iAnimData.iDeltaY; + if ( iAnimData.iPreviousRect.iTl.iY >= previousRectTopLimit ) + { + iAnimData.iPreviousRect.iTl.iY = previousRectTopLimit; + completedPreviousTop = ETrue; + } + + iAnimData.iPreviousRect.iBr.iY -= iAnimData.iDeltaY; + if ( iAnimData.iPreviousRect.iBr.iY <= previousRectBottomLimit ) + { + iAnimData.iPreviousRect.iBr.iY = previousRectBottomLimit; + completedPreviousBottom = ETrue; + } + } + else // scrolling - don't draw the previous rect + { + completedPreviousTop = ETrue; + completedPreviousBottom = ETrue; + } + + return ( completedCurrentTop && completedCurrentBottom && + completedPreviousTop && completedPreviousBottom ); + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::UpdateAnimationData +// Updates the pen/icons each time Animate() is called +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::UpdateAnimationData() + { + const CCamSceneSettingItem* previousItem = iSettingItemArray[iPreviousArrayPosition]; + const CCamSceneSettingItem* currentItem = iSettingItemArray[iCurrentArrayPosition]; + + if ( iAnimData.iStep == 1 ) + { + iAnimData.iPenFadeOut = KRgbDarkGray; + iAnimData.iPenFadeIn = KRgbGray4; + iAnimData.iIconFadeOut = previousItem->Icon( ECamIconSizeSix ); + iAnimData.iIconFadeIn = currentItem->Icon( ECamIconSizeOne ); + } + else if ( iAnimData.iStep == 2 ) + { + iAnimData.iPenFadeOut = KRgbGray; + iAnimData.iPenFadeIn = KRgbGray3; + iAnimData.iIconFadeOut = previousItem->Icon( ECamIconSizeFive ); + iAnimData.iIconFadeIn = currentItem->Icon( ECamIconSizeTwo ); + } + else if ( iAnimData.iStep == 3 ) + { + iAnimData.iPenFadeOut = KRgbGray1; + iAnimData.iPenFadeIn = KRgbGray2; + iAnimData.iIconFadeOut = previousItem->Icon( ECamIconSizeFour ); + iAnimData.iIconFadeIn = currentItem->Icon( ECamIconSizeThree ); + } + else if ( iAnimData.iStep == 4 ) + { + iAnimData.iPenFadeOut = KRgbGray2; + iAnimData.iPenFadeIn = KRgbGray1; + iAnimData.iIconFadeOut = previousItem->Icon( ECamIconSizeThree ); + iAnimData.iIconFadeIn = currentItem->Icon( ECamIconSizeFour ); + } + else if ( iAnimData.iStep == 5 ) + { + iAnimData.iPenFadeOut = KRgbGray3; + iAnimData.iPenFadeIn = KRgbGray; + iAnimData.iIconFadeOut = previousItem->Icon( ECamIconSizeTwo ); + iAnimData.iIconFadeIn = currentItem->Icon( ECamIconSizeFive ); + } + else if ( iAnimData.iStep == 6 ) + { + iAnimData.iPenFadeOut = KRgbGray4; + iAnimData.iPenFadeIn = KRgbDarkGray; + + iAnimData.iIconFadeOut = previousItem->Icon( ECamIconSizeOne ); + iAnimData.iIconFadeIn = currentItem->Icon( ECamIconSizeSix ); + } + else if ( iAnimData.iStep == 7 ) + { + iAnimData.iPenFadeOut = KRgbWhite; + iAnimData.iPenFadeIn = KRgbBlack; + iAnimData.iIconFadeOut = previousItem->Icon( ECamIconSizeSmall ); + iAnimData.iIconFadeIn = currentItem->Icon( ECamIconSizeLarge ); + } + else + { + + } + iAnimData.iIconLeftOffset += iAnimData.iIconLeftInc; + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::DrawText +// Draws the title text each time Animate() is called +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::DrawText( const TDesC& aText, + const CAknLayoutFont* aFont, + TInt aBaseline, + TBool aFadeOut ) const + { + CWindowGc& gc = SystemGc(); + + TRect oldRect; + TRect rect; + if ( aFadeOut ) + { + rect = iAnimData.iTitleFadeOut; + oldRect = iAnimData.iTitleFadeOutOld; + } + else + { + rect = iAnimData.iTitleFadeIn; + oldRect = iAnimData.iTitleFadeInOld; + } + gc.UseFont( aFont ); + TLogicalRgb backgroundColour( TLogicalRgb::ESystemBackgroundColor ); + gc.SetPenColor( backgroundColour ); + // draw test aligned left or right depending on layout + if( !AknLayoutUtils::LayoutMirrored() ) + { + gc.DrawText( aText, oldRect, aBaseline, CGraphicsContext::ELeft ); + gc.SetPenColor( KRgbBlack ); + gc.DrawText( aText, rect, aBaseline, CGraphicsContext::ELeft ); + } + else + { + gc.DrawText( aText, oldRect, aBaseline, CGraphicsContext::ERight ); + gc.SetPenColor( KRgbBlack ); + gc.DrawText( aText, rect, aBaseline, CGraphicsContext::ERight ); + } + + gc.DiscardFont(); + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::DrawIcon +// Draws the icon each time Animate() is called +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::DrawIcon( TBool aFadeOut ) + { + TRect oldRect; + TRect bmpRect; + const CFbsBitmap* bitmap = NULL; + + TRect largeIcon = iHighlightIcons[0].Rect(); + TRect smallIcon = iNormalIcons[0].Rect(); + + if ( aFadeOut ) + { + bitmap = iAnimData.iIconFadeOut; + TSize bmpSize = bitmap->SizeInPixels(); + + TInt iconYPos = ( iAnimData.iPreviousRect.Height() - bmpSize.iHeight ) / 2; + + TPoint iconPos( ( largeIcon.iTl.iX + (TInt)iAnimData.iIconLeftOffset ), + ( iAnimData.iPreviousRect.iTl.iY + iconYPos ) ); + + iAnimData.iIconRectFadeOutOld = iAnimData.iIconRectFadeOut; + iAnimData.iIconRectFadeOut.SetRect( iconPos, bmpSize ); + + oldRect = iAnimData.iIconRectFadeOutOld; + bmpRect = iAnimData.iIconRectFadeOut; + } + else + { + bitmap = iAnimData.iIconFadeIn; + TSize bmpSize = bitmap->SizeInPixels(); + + TInt iconYPos = ( iAnimData.iCurrentRect.Height() - bmpSize.iHeight ) / 2; + + TPoint iconPos( ( smallIcon.iTl.iX - (TInt)iAnimData.iIconLeftOffset ), + ( iAnimData.iCurrentRect.iTl.iY + iconYPos ) ); + + iAnimData.iIconRectFadeInOld = iAnimData.iIconRectFadeIn; + iAnimData.iIconRectFadeIn.SetRect( iconPos, bmpSize ); + + oldRect = iAnimData.iIconRectFadeInOld; + bmpRect = iAnimData.iIconRectFadeIn; + } + + CWindowGc& gc = SystemGc(); + gc.Clear( oldRect ); + gc.BitBlt( bmpRect.iTl, bitmap ); + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::DrawHighlight +// Draws the highlight rect each time Animate() is called +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::DrawHighlight() const + { + if( Flags() & CListItemDrawer::ESingleClickDisabledHighlight ) + { + return; + } + + CWindowGc& gc = SystemGc(); + + TSize corner( KCornerSize,KCornerSize ); + // Clear the old highlight + gc.SetPenSize( TSize( KBorderSize, KBorderSize ) ); + TLogicalRgb backgroundColour( TLogicalRgb::ESystemBackgroundColor ); + gc.SetPenColor( backgroundColour ); + gc.DrawRoundRect( iAnimData.iCurrentRectOld, corner ); + if ( !iAnimData.iScrolling ) + { + gc.DrawRoundRect( iAnimData.iPreviousRectOld, corner ); + } + // Draw the new highlight + gc.SetPenSize( TSize( KBorderSize, KBorderSize ) ); + gc.SetPenColor( iAnimData.iPenFadeIn ); + gc.DrawRoundRect( iAnimData.iCurrentRect, corner ); + if ( !iAnimData.iScrolling ) + { + gc.SetPenColor( iAnimData.iPenFadeOut ); + gc.DrawRoundRect( iAnimData.iPreviousRect, corner ); + } + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::DrawListL +// Draws the list to an off-screen bitmap +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::DrawListL() + { + // create an off-screen device and context + CFbsBitGc* bitmapGc = NULL; + CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL( iAnimData.iOffScreenBitmap ); + CleanupStack::PushL( bitmapDevice ); + User::LeaveIfError( bitmapDevice->CreateContext( bitmapGc ) ); + CleanupStack::PushL( bitmapGc ); + + bitmapGc->SetPenStyle( CGraphicsContext::ENullPen ); + bitmapGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + bitmapGc->DrawRect( TRect( iAnimData.iOffScreenBitmap->SizeInPixels() ) ); + + TInt i; + // only draw top 4 items in the list + for ( i = 0; i < iNumberOfIconsToDisplay-1; i++ ) + { + TInt position = iTopDisplayPosition + i; + CCamSceneSettingItem* item = iSettingItemArray[position]; + + // Draw the standard icon + iDisplacedIcons[i].DrawImage( *bitmapGc, + const_cast( item->Icon( ECamIconSizeSmall ) ), NULL ); + // Draw the header text + iDisplacedTitles[i].DrawText( *bitmapGc, *item->Title() ); + } + + CleanupStack::PopAndDestroy( bitmapGc ); + CleanupStack::PopAndDestroy( bitmapDevice ); + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::ScrollList +// Scrolls the list +// --------------------------------------------------------------------------- +// +TBool CCamSceneSettingContainer::ScrollList() + { + SystemGc().BitBlt( iAnimData.iOffScreenPos, iAnimData.iOffScreenBitmap ); + if ( iAnimData.iMovingDown ) + { + iAnimData.iOffScreenPos.iY -= iAnimData.iScrollingY; + if ( iAnimData.iOffScreenPos.iY <= 0 ) + { + return ETrue; + } + } + else + { + iAnimData.iOffScreenPos.iY += iAnimData.iScrollingY; + if ( iAnimData.iOffScreenPos.iY >= iDisplacedIcons[1].Rect().iTl.iY ) + { + return ETrue; + } + } + return EFalse; + } + +// --------------------------------------------------------------------------- +// CCamSceneSettingContainer::MoveHighlight +// Moves the highlight to its new position, ready to be animated +// --------------------------------------------------------------------------- +// +void CCamSceneSettingContainer::MoveHighlight() + { + iAnimData.iPreviousRect = iAnimData.iCurrentRect; + + TInt curIndex = iCurrentArrayPosition - iTopDisplayPosition; + TInt prevIndex = iPreviousArrayPosition - iTopDisplayPosition; + + TRect iconRect; + TRect titleRect; + + if ( iAnimData.iMovingDown ) + { + TInt defaultIndex = curIndex - 1; + iconRect = iNormalIcons[defaultIndex].Rect(); + titleRect = iNormalTitles[defaultIndex].TextRect(); + } + else + { + iconRect = iDisplacedIcons[curIndex].Rect(); + titleRect = iDisplacedTitles[curIndex].TextRect(); + } + + iAnimData.iCurrentRect = iHighlightArray[curIndex].Rect(); + iAnimData.iCurrentRect.iTl.iY = iconRect.iTl.iY; + iAnimData.iCurrentRect.iBr.iY = iAnimData.iCurrentRect.iTl.iY + iconRect.Height(); + + iAnimData.iTitleFadeOut = iHighlightTitles[prevIndex].TextRect(); + iAnimData.iTitleFadeIn = titleRect; + + iAnimData.iIconRectFadeOut = iHighlightIcons[prevIndex].Rect(); + iAnimData.iIconRectFadeIn = iconRect; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamSelfTimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamSelfTimer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,535 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Provides the flashing icon/LED & timing capability of the* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include "CamSelfTimer.h" +#include "CamPanic.h" +#include "CamAppUi.h" +#include "CamUtility.h" +#include "Cam.hrh" // For ECamSelfTimerSoundId def +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamSelfTimerTraces.h" +#endif + +// CONSTANTS +const TInt KCamSelfTimerToneHz = 1760; +const TReal32 KCamSelfTimerToneVol = 0.75f; + + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamSelfTimer* CCamSelfTimer::NewL( CCamAppController& aController ) + { + CCamSelfTimer* self = new( ELeave ) CCamSelfTimer( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// Destructor +CCamSelfTimer::~CCamSelfTimer() + { + PRINT( _L("Camera => ~CCamSelfTimer") ); + // If self-timer is active, stop it + if ( IsActive() ) + { + Cancel(); + } + + // close up observers array + iObservers.Close(); + + delete iPeriodicTimer; + PRINT( _L("Camera <= ~CCamSelfTimer") ); + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::StartSelfTimer +// Will be called to start self timer. If self timer is already running, the +// timer is cancelled and the capture operation is run immediately. +// ----------------------------------------------------------------------------- +// +void CCamSelfTimer::StartSelfTimer() + { + // Check it is not already running + if ( ECamSelfTimerStandby == iState ) + { + ChangeState( ECamSelfTimerActive1 ); + } + // If the timer is already running, then we must cancel the timer + // and do the capture operation now! + else + { + // Cancel the timer + Cancel(); + + if( ECamControllerImage == iMode ) + { + switch ( iImageMode ) + { + case ECamImageCaptureBurst: + case ECamImageCaptureTimeLapse: + { + // Start the autofocus operation now, the capture will be queued + // after focus completes + OstTrace0( CAMERAAPP_PERFORMANCE, DUP7_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_APP_AF 1" ); + iController.StartAutoFocus(); + // Softkeys are blank/cancel if doing burst capture + // but cancel means cancel ongoing burst, not cancel self-timer + // replace the buttons with the correct command set + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi ) + { + // blank the softkeys in preparation for capture + TRAP_IGNORE( appUi->SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP ) ); + } + } + //lint -fallthrough + case ECamImageCaptureSingle: + { + // If still Self-Timer is interrupted, take the photo NOW. + // If we were in multi-shot, this capture is queued + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_APP_SHOT_TO_SNAPSHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_PRI_SHOT_TO_SNAPSHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_PRI_SHOT_TO_SAVE 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_PRI_SHOT_TO_SHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_APP_SHOT_TO_STILL 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_APP_CAPTURE_START 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP6_CCAMSELFTIMER_STARTSELFTIMER, "e_CAM_PRI_SERIAL_SHOOTING 1" ); + + iController.Capture(); + break; + } + default: + break; + } + } + else + { + // Start recording now + TRAP_IGNORE( iController.StartVideoRecordingL() ); + } + } + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::SetModeL +// Called when the current capture method (Video or Still) changes. +// Updates the internal state (so correct capture method is called when self +// timer expires) and if timer is already running, cancels the outstanding +// timer (as the view has changed). +// ----------------------------------------------------------------------------- +// +void CCamSelfTimer::SetModeL( TCamCameraMode aMode, + TCamImageCaptureMode aImageMode, + TCamSelfTimerFunctions aFunc ) + { + iMode = aMode; + iImageMode = aImageMode; + + // Based on the supplied selftimer function (specifying periods) load the + // individual data from PSI. + TPckgBuf pckg; + + TInt ret = KErrNone; + switch ( aFunc ) + { + case ECamSelfTimerMode1: + ret = CamUtility::GetPsiAnyL( ECamPsiSelfTimerPeriod1, &pckg ); + break; + case ECamSelfTimerMode2: + ret = CamUtility::GetPsiAnyL( ECamPsiSelfTimerPeriod2, &pckg ); + break; + case ECamSelfTimerMode3: + ret = CamUtility::GetPsiAnyL( ECamPsiSelfTimerPeriod3, &pckg ); + break; + case ECamSelfTimerDisabled: + //Fall-through + default: + break; + } + // Check it is supported. + __ASSERT_ALWAYS( ret == KErrNone, CamPanic( ECamPanicUnhandledCommand ) ); + + iSettings = pckg(); + // Set time remaining and update observers. + iTimeRemaining = iSettings.iThreshold[ECamSelfTimerMode1]; + NotifyObservers( ECamSelfTimerEventTimerOn ); + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::Cancel +// Cancels the timer if already running, and returns the self timer to +// self-timer standby state. +// ----------------------------------------------------------------------------- +// +void CCamSelfTimer::Cancel() + { + ChangeState( ECamSelfTimerStandby ); + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::IsActive +// Returns whether or not the SelfTimer is currently active (counting down) +// ----------------------------------------------------------------------------- +// +TBool CCamSelfTimer::IsActive() + { + if ( iState == ECamSelfTimerStandby ) + { + return EFalse; + } + else + { + return ETrue; + } + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::CCamSelfTimer +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamSelfTimer::CCamSelfTimer( CCamAppController& aController ) : + iState( ECamSelfTimerStandby ), + iController( aController ) + { + iCallback = TCallBack( TimerCallback, this ); + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamSelfTimer::ConstructL() + { + iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityHigh ); + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::ChangeState +// Called to move between the internal self-timer states. +// ----------------------------------------------------------------------------- +// +void CCamSelfTimer::ChangeState( TCamSelfTimer aState ) + { + // if the timer object has not been created + __ASSERT_DEBUG( iPeriodicTimer != NULL, CamPanic( ECamPanicNullPointer ) ); + + // If the state has been changed + iState = aState; + + switch ( iState ) + { + case ECamSelfTimerActive1: + iController.StopIdleTimer(); // no standby mode if time is running + iIndication = ETrue; + //lint -fallthrough + case ECamSelfTimerActive2: + case ECamSelfTimerActive3: + iTimeRemaining = iSettings.iThreshold[iState]; + // Use smallest time period as tick period. This assumes that + // smallest time period is divisble into larger time period. + iTimerTickPeriod = iSettings.iFlashPeriod[iState]; // Need half-periods + if ( iTimerTickPeriod.Int() > iSettings.iBeepPeriod[iState] ) + { + iTimerTickPeriod = iSettings.iBeepPeriod[iState]; + } + + if ( iTimerTickPeriod.Int() == KMaxTInt ) // If state is timer based (always on) + { + iIndication = ETrue; + iPeriodicTimer->Cancel(); + iTimerTickPeriod = iTimeRemaining;// Force period to be time left + + // Reschedule the timer to go off when the remaining time has completed + iPeriodicTimer->Start( iTimeRemaining, iTimeRemaining, iCallback ); + } + else if ( iTimerTickPeriod.Int() == 0 ) // Always off + { + iIndication = EFalse; + iPeriodicTimer->Cancel(); + iTimerTickPeriod = iTimeRemaining;// Force period to be time left + + // Reschedule the timer to go off when the remaining time has completed + iPeriodicTimer->Start( iTimeRemaining, iTimeRemaining, iCallback ); + } + else if ( iTimerTickPeriod.Int() != KErrNotSupported ) // This is a valid period + { + TInt period = iTimerTickPeriod.Int(); + iPeriodicTimer->Cancel(); + iPeriodicTimer->Start( period, period, iCallback ); + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error. + } + + // Check if we need to start autofocus + if ( iSettings.iAutoFocus != KErrNotSupported && + iTimeRemaining.Int() == iSettings.iAutoFocus ) + { + if ( ECamControllerVideo != iMode ) + { + // Start the AutoFocus operation + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSELFTIMER_CHANGESTATE, "e_CAM_APP_AF 1" ); + iController.StartAutoFocus(); + } + } + DoIndication( iIndication ); + break; + + case ECamSelfTimerStandby: + iPeriodicTimer->Cancel(); + if ( !iController.IsSlideInSelfTimerPreview() ) + { + iController.SetDynamicSettingToDefault(ECamSettingItemDynamicSelfTimer); + } + NotifyObservers( ECamSelfTimerEventTimerOff ); + break; + + default: + break; + } + } + +// ----------------------------------------------------------------------------- +// TimerCallback Callback used for self timer class to be informed of periodic +// timer events +// Returns: TInt: KErrNone if successful. +// ----------------------------------------------------------------------------- +// +TInt CCamSelfTimer::TimerCallback( TAny* aPtr ) + { + CCamSelfTimer* timer = static_cast< CCamSelfTimer* >( aPtr ); + __ASSERT_DEBUG( timer != NULL, CamPanic( ECamPanicNullPointer ) ); + + timer->Tick(); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::Tick +// Called when the periodic timer "ticks", used to +// ----------------------------------------------------------------------------- +// +void CCamSelfTimer::Tick() + { + PRINT(_L("Camera => CCamSelfTimer::Tick()")); + // Adjust the time remaining + iTimeRemaining = iTimeRemaining.Int() - iTimerTickPeriod.Int(); + + // Adjust the time elapsed since last beep and indicator state change. + iTimeElapsedSinceIndication += iTimerTickPeriod.Int(); + + // Adjust the indicator state if necessary. + __ASSERT_DEBUG( iState < ECamSelfTimerStandby, CamPanic( ECamPanicUnhandledCreateSettingItem ) ); + if ( iTimeElapsedSinceIndication >= iSettings.iFlashPeriod[iState] ) + { + iIndication = !iIndication; + iTimeElapsedSinceIndication = 0; + } + + // If we have reached the end of the timer period... + if ( iTimeRemaining == TTimeIntervalMicroSeconds32( 0 ) ) + { + // Cancel the timer, reset internal state. + Cancel(); + + // The Controller takes care of the synchronisation of this. + // If AutoFocus is complete, start Capture now + // If AutoFocus still ongoing, it will wait until autofocus is + // complete THEN Capture. + if ( ECamControllerImage == iMode ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( appUi ) + { + // Blank all softkeys if doing still capture + if ( iImageMode == ECamImageCaptureSingle ) + { + // blank the softkeys in preparation for capture + TRAP_IGNORE( appUi->SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ) ); + } + + // Softkeys are blank/cancel if doing burst capture + // but cancel means cancel ongoing burst, not cancel self-timer + else if ( ECamImageCaptureBurst == iImageMode + || ECamImageCaptureTimeLapse == iImageMode ) + { + // blank the softkeys in preparation for capture + TRAP_IGNORE( appUi->SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP ) ) + } + } + + // Ensure everything is OFF + DoIndication( EFalse ); + + // Do capture + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSELFTIMER_TICK, "e_CAM_APP_SHOT_TO_SNAPSHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSELFTIMER_TICK, "e_CAM_PRI_SHOT_TO_SNAPSHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMSELFTIMER_TICK, "e_CAM_PRI_SHOT_TO_SAVE 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMSELFTIMER_TICK, "e_CAM_PRI_SHOT_TO_SHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMSELFTIMER_TICK, "e_CAM_APP_SHOT_TO_STILL 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMSELFTIMER_TICK, "e_CAM_APP_CAPTURE_START 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP6_CCAMSELFTIMER_TICK, "e_CAM_PRI_SERIAL_SHOOTING 1" ); + + iController.Capture(); + } + else // video mode + { + TRAP_IGNORE( iController.StartVideoRecordingL() ) + } + } + + // The timer is ongoing + else + { + TInt remaining = iTimeRemaining.Int(); + // Work out if we need to change period. + if ( remaining == iSettings.iThreshold[ECamSelfTimerActive2] + && KErrNotSupported != iSettings.iThreshold[ECamSelfTimerActive2] ) + { + ChangeState( ECamSelfTimerActive2 ); + } + else if ( remaining == iSettings.iThreshold[ECamSelfTimerActive3] + && KErrNotSupported != iSettings.iThreshold[ECamSelfTimerActive3]) + { + ChangeState( ECamSelfTimerActive3 ); + } + else + { + // Update the indicators (done as part of change state as well) + DoIndication( iIndication ); + } + + // Check if we need to start autofocus + if ( KErrNotFound != iSettings.iAutoFocus + && remaining == iSettings.iAutoFocus ) + { + if ( ECamControllerImage == iMode ) + { + // Start the AutoFocus operation + OstTrace0( CAMERAAPP_PERFORMANCE, DUP7_CCAMSELFTIMER_TICK, "e_CAM_APP_AF 1" ); + iController.StartAutoFocus(); + } + } + } + PRINT(_L("Camera <= CCamSelfTimer::Tick()")); + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::DoIndication +// Send event to self timer observers +// ----------------------------------------------------------------------------- +// +void CCamSelfTimer::DoIndication( TBool aOn ) + { + iIndication = aOn; + + if ( aOn ) + { + NotifyObservers( ECamSelfTimerEventTimerOn ); + iController.PlayTone( KCamSelfTimerToneHz, iTimerTickPeriod.Int()/2, KCamSelfTimerToneVol, EFalse ); + } + else + { + NotifyObservers( ECamSelfTimerEventTimerOff ); + } + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::AddObserverL +// Add a self timer observer +// ----------------------------------------------------------------------------- +// +void CCamSelfTimer::AddObserverL( const MCamSelfTimerObserver* aObserver ) + { + User::LeaveIfError( iObservers.Append( aObserver ) ); + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::RemoveObserver +// Remove a self timer observer +// ----------------------------------------------------------------------------- +// +void CCamSelfTimer::RemoveObserver( const MCamSelfTimerObserver* aObserver ) + { + TInt i; + TInt numobservers = iObservers.Count(); + for ( i = 0; i < numobservers; i++ ) + { + // if the observer is the one to remove + if ( iObservers[i] == aObserver ) + { + iObservers.Remove( i ); + return; + } + } + } + +// ----------------------------------------------------------------------------- +// CCamSelfTimer::NotifyObservers +// Send self timer event to observers +// ----------------------------------------------------------------------------- +// +void CCamSelfTimer::NotifyObservers( TCamSelfTimerEvent aEvent ) + { + const TInt KMicroSecsPerSec = 1000000; + TInt timeRem = iTimeRemaining.Int() / KMicroSecsPerSec; + TInt i; + TInt numobservers = iObservers.Count(); + for ( i = 0; i < numobservers; i++ ) + { + iObservers[i]->HandleSelfTimerEvent( aEvent, timeRem ); + } + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamServer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamServer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Main application server class.* +*/ + + +// INCLUDE FILES +#include "CamServer.h" +#include +#include + +#include +#include +#include "CamNewFileService.h" + +#include "CamUtility.h" + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamAppServer::CreateServiceL +// Creates new file service object. +// --------------------------------------------------------------------------- +// +CApaAppServiceBase* CCamAppServer::CreateServiceL(TUid aServiceType) const + { + if ( aServiceType == TUid::Uid( NEWSERVICEUID ) )// Service UID + { + PRINT( _L( "Camera: CCamAppServer:CreateServiceL()" ) ); + CCamNewFileService* service = CCamNewFileService::NewL(); + iNewFileServiceObserver = service; + return service; + } + else + { + return CAknAppServer::CreateServiceL(aServiceType); + } + } + +// --------------------------------------------------------------------------- +// CCamAppServer::NewFileServiceObserver +// Returns pointer to new file sevice object. +// --------------------------------------------------------------------------- +// +MNewFileServiceObserver* CCamAppServer::NewFileServiceObserver() const + { + return iNewFileServiceObserver; + } + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamSettingsModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamSettingsModel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,2343 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Manages all settings data.* +*/ + + +// =========================================================================== +// Includes +#include +#include +#include +#include +#include // KDC_APP_RESOURCE_DIR + +#include +#include + +#include "CamSettingsModel.h" +#include "CamPanic.h" +#include "mcamsettingsmodelobserver.h" +#include "CamAppUiBase.h" +#include "CamSharedDataKeys.h" +#include "CamUtility.h" +#include "CamVideoQualityLevel.h" + +#include "CameraVariant.hrh" // Variant CR key values +#include "CameraappPrivateCRKeys.h" // CR keys +#include "camactivepalettehandler.h" +#include "CamAppUi.h" +#include "camsettingconversion.h" +#include "camconfiguration.h" +#include "CamStaticSettingsModel.h" +#include "CameraUiConfigManager.h" + +// =========================================================================== +// Constants + +const TInt KDynamicArrayGranularity = 3; +_LIT( KCamNhdResourceFileName, "z:nhdcamsettings.rss" ); +_LIT( KCamVgaResourceFileName, "z:vgacamsettings.rss" ); + + +// =========================================================================== +// Local methods +inline TBool SettingIdMatches( const TInt* aSettingId, + const TIntSetting& aSettingItem ) + { + return (*aSettingId == aSettingItem.iItemId); + }; + +inline TInt FindIndex( const RPointerArray& aSettingArray, + const TInt& aSettingId ) + { + return aSettingArray.Find( aSettingId, SettingIdMatches ); + }; + +inline TInt FindIndex( const RPointerArray& aSettingArray, + const TIntSetting& aSettingItem ) + { + return FindIndex( aSettingArray, aSettingItem.iItemId ); + }; + + +// =========================================================================== +// Class methods + + +// --------------------------------------------------------------------------- +// TCamVariantInfo constructor +// --------------------------------------------------------------------------- +// +TCamVariantInfo::TCamVariantInfo() + : iFlags ( -1 ), + iTimeLapseSupport( ECamSupportUnknown ), + iAlwaysOnSupport ( ECamSupportUnknown ), + iVersion ( -1, 0, 0 ) + { + } + +// =========================================================================== + +// --------------------------------------------------------------------------- +// CCamSettingsModel::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamSettingsModel* CCamSettingsModel::NewL( CCamConfiguration& aConfiguration ) + { + CCamSettingsModel* self = CCamSettingsModel::NewLC( aConfiguration ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamSettingsModel* CCamSettingsModel::NewLC( CCamConfiguration& aConfiguration ) + { + CCamSettingsModel* self = new( ELeave ) CCamSettingsModel( aConfiguration ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::ResetUserSceneWithoutActivatingChangesL +// Resets all user scene settings to their defaults without activating them. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::ResetUserSceneWithoutActivatingChangesL() + { + PRINT( _L("Camera => CCamSettingsModel::ResetUserSceneWithoutActivatingChangesL")) + + // Reset the user scene data in the repository + iStaticModel->ResetSettingItem( KCamCrUserSceneBaseScene ); + iStaticModel->ResetSettingItem( KCamCrUserSceneWhiteBalance ); + iStaticModel->ResetSettingItem( KCamCrUserSceneColourFilter ); + iStaticModel->ResetSettingItem( KCamCrUserSceneFlash ); + iStaticModel->ResetSettingItem( KCamCrUserSceneExposure ); + + if ( iUiConfigManager->IsISOSupported() ) + { + iStaticModel->ResetSettingItem( KCamCrUserSceneLightSensitivity ); + } + iStaticModel->ResetSettingItem( KCamCrUserSceneContrast ); + iStaticModel->ResetSettingItem( KCamCrUserSceneImageSharpness ); + + // Reload the static user scene settings + iUserSceneSettings.ResetAndDestroy(); + iStaticModel->ReadFromCenRepL( + static_cast( ECamSettingItemUserSceneRangeMin ), + static_cast( ECamSettingItemUserSceneRangeMax ), + iUserSceneSettings + ); + PRINT( _L("Camera <= CCamSettingsModel::ResetUserSceneWithoutActivatingChangesL")) + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::ResetUserSceneL +// Resets all user scene settings to their defaults. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::ResetUserSceneL() + { + PRINT( _L("Camera => CCamSettingsModel::ResetUserSceneL")) + // Reset the user scene based on scene in the repository to get the default value + ResetUserSceneWithoutActivatingChangesL(); + TInt scene = IntegerSettingValue( ECamSettingItemDynamicPhotoScene ); + // If current scene is user scene + if ( ECamSceneUser == scene ) + { + // if the user scene is currently the photo scene then + // activate all the default scene settings to the AP + ActivateUserSceneSettingsL(); + } + PRINT( _L("Camera <= CCamSettingsModel::ResetUserSceneL")) + } + + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::IntegerSettingValue +// Returns the current integer value for the specified setting +// --------------------------------------------------------------------------- +// +TInt +CCamSettingsModel::IntegerSettingValue( TInt aSettingItem ) const + { + PRINT2( _L("Camera => CCamSettingsModel::IntegerSettingValue, id:%d [%s]"), + aSettingItem, + KCamSettingItemNames[aSettingItem] ); + + TInt value = KErrNotFound; + // If the requested item is the photo quality value, this must + // be filtered based on the current scene. + if ( aSettingItem == ECamSettingItemPhotoQuality ) + { + value = CurrentPhotoQualityValue(); + } + // If the requested item is the photo size, this must be filtered based on + // the current scene + else if ( aSettingItem == ECamSettingItemPhotoSize ) + { + value = CurrentPhotoResolution(); + } + // If the requested item is the photo compression level, this must + // be filtered based on the current scene, and burst mode. + else if ( aSettingItem == ECamSettingItemPhotoCompression ) + { + value = CurrentPhotoCompression(); + } + else + { + // If we have previews active, check first if requested + // setting is found among them. Settings model must pretend + // that the current value is the one set to preview. + TInt previewIndex( FindIndex( iSettingPreviews, aSettingItem ) ); + if( KErrNotFound != previewIndex ) + { + PRINT( _L("Camera <> Setting item value in previewed currently!") ); + value = iSettingPreviews[previewIndex]->iValueId; + + if (ECamSettingItemDynamicSelfTimer == aSettingItem) //If the current setting Item is selftimer + { + TInt settingIndex = SearchInSettingsListFor( iDynamicPhotoIntSettings, aSettingItem ); + value = iDynamicPhotoIntSettings[settingIndex]->iValueId; //Get the actual selftime setting value but not preview value + } + } + // Otherwise, if setting item is in the dynamic photo settings return it's value. + else if( ECamSettingItemDynamicPhotoRangeMax > aSettingItem + && ECamSettingItemDynamicPhotoRangeMin < aSettingItem ) + { + TInt settingIndex = SearchInSettingsListFor( iDynamicPhotoIntSettings, aSettingItem ); + value = iDynamicPhotoIntSettings[settingIndex]->iValueId; + } + // Otherwise, if setting item is in the dynamic video settings return it's value. + else if( ECamSettingItemDynamicVideoRangeMax > aSettingItem + && ECamSettingItemDynamicVideoRangeMin < aSettingItem ) + { + TInt settingIndex = SearchInSettingsListFor( iDynamicVideoIntSettings, aSettingItem ); + value = iDynamicVideoIntSettings[settingIndex]->iValueId; + } + // Otherwise, if setting item is in the user scene settings return it's value. + else if( ECamSettingItemUserSceneRangeMax > aSettingItem + && ECamSettingItemUserSceneRangeMin < aSettingItem ) + { + TInt settingIndex = SearchInSettingsListFor( iUserSceneSettings, aSettingItem ); + value = iUserSceneSettings[settingIndex]->iValueId; + } + // Otherwise, if setting item is in the static video settings return it's value. + else if( ECamSettingItemVideoClipLength == aSettingItem ) + { + // Video clip length workaround + // PRINT( _L("Camera <> ECamSettingItemVideoClipLength") ); + TInt videoQuality = IntegerSettingValue( ECamSettingItemVideoQuality ); + value = iQualityLevels[videoQuality]->VideoLength(); + } + else + { + value = iStaticModel->IntegerSettingValue( aSettingItem ); + } + } + + PRINT1( _L("Camera <= CCamSettingsModel::IntegerSettingValue, value:%d"), value ); + return value; + } + + + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::SceneSettingValue +// Returns the setting value for a specific field of a scene +// --------------------------------------------------------------------------- +// +TInt +CCamSettingsModel::SceneSettingValue( TInt aSceneId, + TInt aSceneField ) const + { + PRINT2( _L("CCamSettingsModel::SceneSettingValue, scene[%s] setting[%s]"), + KCamSceneNames[aSceneId], + KCamSettingItemNames[aSceneField] ); + + // If setting item is a scene in the photo scene list + TInt sceneIndex = FindSceneInSceneList( aSceneId, iPhotoScenes ); + if ( sceneIndex != KErrNotFound ) + { + // Search for the field in the scene's field list. + const RPointerArray& sceneSettings = + iPhotoScenes[sceneIndex]->iSettings; + TInt fieldCount = sceneSettings.Count(); + for ( TInt i = 0; i < fieldCount; ++i ) + { + if ( sceneSettings[i]->iItemId == aSceneField ) + { + return sceneSettings[i]->iValueId; + } + } + } + + // Otherwise if setting item is a scene in the video scene list + sceneIndex = FindSceneInSceneList( aSceneId, iVideoScenes ); + if ( sceneIndex != KErrNotFound ) + { + // Search for the field in the scene's field list. + const RPointerArray& sceneSettings = + iVideoScenes[sceneIndex]->iSettings; + TInt fieldCount = sceneSettings.Count(); + for ( TInt i = 0; i < fieldCount; ++i ) + { + if ( sceneSettings[i]->iItemId == aSceneField ) + { + return sceneSettings[i]->iValueId; + } + } + } + + else + { + PRINT( _L("Camera => CCamSettingsModel::ECamPanicUnknownSettingItem 3" )) + CamPanic( ECamPanicUnknownSettingItem ); + } + + return sceneIndex; + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::SetIntegerSettingValueL +// Sets a new integer value for the specified setting +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::SetIntegerSettingValueL( TInt aSettingItem, + TInt aSettingValue ) + { + PRINT ( _L("Camera => CCamSettingsModel::SetIntegerSettingValueL") ); + CCamAppUiBase* appUi = static_cast( iEnv->AppUi() ); + TCamSettingItemIds settingId( + static_cast(aSettingItem) ); + + PRINT2( _L("Camera <> Setting item[%s] value:%d"), KCamSettingItemNames[settingId], aSettingValue ); + + // ------------------------------------------------------- + // Dynamic image settings + if( ECamSettingItemDynamicPhotoRangeMin < settingId + && ECamSettingItemDynamicPhotoRangeMax > settingId ) + { + TInt settingIndex = SearchInSettingsListFor( iDynamicPhotoIntSettings, + settingId ); + iDynamicPhotoIntSettings[settingIndex]->iValueId = aSettingValue; + + // Changing scene + if ( ECamSettingItemDynamicPhotoScene == settingId ) + { + if ( ECamActiveCameraNone != appUi->ActiveCamera() || ( ECamActiveCameraNone == appUi->ActiveCamera() && ECamSceneAuto == aSettingValue ) ) + { + PhotoSceneHasChangedL( aSettingValue ); + } + } + } + // ------------------------------------------------------- + // Dynamic video settings + else if( ECamSettingItemDynamicVideoRangeMin < settingId + && ECamSettingItemDynamicVideoRangeMax > settingId ) + { + TInt settingIndex = SearchInSettingsListFor( iDynamicVideoIntSettings, + settingId ); + iDynamicVideoIntSettings[settingIndex]->iValueId = aSettingValue; + if ( settingId == ECamSettingItemDynamicVideoScene ) + { + VideoSceneHasChangedL( aSettingValue ); + } + } + // ------------------------------------------------------- + // User scene settings + else if( ECamSettingItemUserSceneRangeMin < settingId + && ECamSettingItemUserSceneRangeMax > settingId ) + { + TBool userSceneModeSettingChanged = EFalse; + // If the based-on scene has changed + if ( settingId == ECamSettingItemUserSceneBasedOnScene ) + { + TInt scene = IntegerSettingValue( ECamSettingItemDynamicPhotoScene ); + // If current scene is user scene + if ( ECamSceneUser == scene ) + { + // Handle other changes to the settings required by the change in scene. + UserSceneHasChangedL( aSettingValue, ETrue ); + } + // Otherwise the user scene hasn't been selected as the active scene + // - the change option has just been selected in the scene setting list + else + { + // just handle a change in the scene + UserSceneHasChangedL( aSettingValue, EFalse ); + } + userSceneModeSettingChanged = ETrue; + } + // Writing values to CenRep for all the settings. + TInt settingIndex = SearchInSettingsListFor( iUserSceneSettings, settingId ); + iUserSceneSettings[settingIndex]->iValueId = aSettingValue; + SaveStaticSettingL( settingId ); + + // If there is only one setting changed other than scene mode setting + // and if the Dynamic Scene mode is "User Scene" we update the new setting + // value to the camera dynamic settings + if ( !userSceneModeSettingChanged ) + { + TInt scene = IntegerSettingValue( ECamSettingItemDynamicPhotoScene ); + // If user scene is the currently active photo scene then activate the + // new user scene settings. + if ( ECamSceneUser == scene ) + { + CopyUserSceneSettingToCaptureSettingL( settingId ); + } + } + + } + // ------------------------------------------------------- + else + { + // use the static settings model + iStaticModel->SetIntegerSettingValueL( aSettingItem, aSettingValue ); + } + // ------------------------------------------------------- + + NotifyObservers( settingId, aSettingValue ); + + PRINT ( _L("Camera <= CCamSettingsModel::SetIntegerSettingValueL") ); + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::SetTextSettingValueL +// Sets a new text value for the specified setting +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::SetTextSettingValueL( TInt aSettingItem, + const TDesC& aSettingValue ) + { + iStaticModel->SetTextSettingValueL( aSettingItem, aSettingValue ); + NotifyObservers( (TCamSettingItemIds)aSettingItem, aSettingValue ); + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::TextSettingValue +// Returns the current text value for the specified setting +// --------------------------------------------------------------------------- +// +TPtrC +CCamSettingsModel::TextSettingValue( TInt aSettingItem ) const + { + return iStaticModel->TextSettingValue( aSettingItem ); + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::SettingValueEnabled +// Returns ETrue if the setting value is currently enabled +// --------------------------------------------------------------------------- +// +TBool CCamSettingsModel::SettingValueEnabled( TInt aSettingItem, + TInt aSettingValue ) const + { + TCamImageQualitySetting maxPhoto = static_cast( iPhotoQualityLevels[iPhotoQualityLevels.Count() - 1].iPhotoResolution ); + // If the setting value is maximum photo size, and the current + // scene is sports, then this setting value is disabled + if ( ( aSettingItem == ECamSettingItemPhotoQuality ) && + ( aSettingValue == maxPhoto ) ) + { + // If the current scene is sports, disable the option + TCamSceneId scene = static_cast< TCamSceneId > + ( IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) ); + if ( scene == ECamSceneSports ) + { + return EFalse; + } + // Otherwise, if the current scene is the user scene and + // it is based on the 'Sports' scene then disable the option. + else if ( scene == ECamSceneUser ) + { + // ...Get the based on scene. + TCamSceneId baseScene = static_cast< TCamSceneId > + ( IntegerSettingValue( ECamSettingItemUserSceneBasedOnScene ) ); + if ( baseScene == ECamSceneSports ) + { + return EFalse; + } + } + else + { + // Otherwise, the option is enabled + return ETrue; + } + } + // The high quality video setting is not supported if + // the second camera is enabled + else if ( aSettingItem == ECamSettingItemVideoQuality && + aSettingValue == ECamVideoQualityHigh && + static_cast( + iEnv->AppUi() )->IsSecondCameraEnabled() ) + { + return EFalse; + } + // All other setting item values are allowed + else + { + return ETrue; + } + + return ETrue; + } + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel +::AttachObserverL( const MCamSettingsModelObserver* aObserver ) + { + if( aObserver ) + { + TInt index = iObservers.Find( aObserver ); + if( KErrNotFound == index ) + { + iObservers.AppendL( aObserver ); + } + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel +::DetachObserver( const MCamSettingsModelObserver* aObserver ) + { + if( aObserver ) + { + TInt index = iObservers.Find( aObserver ); + if( KErrNotFound != index ) + { + iObservers.Remove( index ); + } + } + } + + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::LoadSettingsL +// Loads the settings from shared data, or if unable to from the resource file. +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::LoadSettingsL() + { + PRINT( _L("Camera => CCamSettingsModel::LoadSettingsL")) + // Remove any previously loaded values. + UnloadSettings(); + + PRINT( _L("Camera => CCamSettingsModel::LoadSettingsL B")) + LoadDynamicSettingsL( R_CAM_PHOTO_DYNAMIC_SETTINGS_DATA, + iDynamicPhotoIntSettings, + iDynamicPhotoIntDefaults ); + + PRINT( _L("Camera => CCamSettingsModel::LoadSettingsL C")) + LoadDynamicSettingsL( R_CAM_VIDEO_DYNAMIC_SETTINGS_DATA, + iDynamicVideoIntSettings, + iDynamicVideoIntDefaults ); + + PRINT( _L("Camera => CCamSettingsModel::LoadSettingsL D")) + // Load image scene data + LoadSceneDataL(); + + // Load video scene data + LoadSceneDataL( EFalse ); + + PRINT( _L("Camera => CCamSettingsModel::LoadSettingsL E")) + //LoadScenesDataL( R_CAM_VIDEO_SCENES_DATA, iVideoScenes ); + + PRINT( _L("Camera <= CCamSettingsModel::LoadSettingsL")) + } + + + + +// --------------------------------------------------------------------------- +// DynamicSettingDefaultValue +// +// --------------------------------------------------------------------------- +// +TInt +CCamSettingsModel::DynamicSettingDefaultValue( TInt aSettingId ) const + { + TInt value = KErrNotFound; + + TInt index = SearchInSettingsListFor( iDynamicPhotoIntSettings, aSettingId ); + if( KErrNotFound != index ) + { + value = iDynamicPhotoIntDefaults[index]; + } + index = SearchInSettingsListFor( iDynamicVideoIntSettings, aSettingId ); + if( KErrNotFound != index ) + { + value = iDynamicVideoIntDefaults[index]; + } + + return value; + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::SetDynamicSettingsToDefaults +// Sets all dynamic settings to their defaults. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::SetDynamicSettingsToDefaults() + { + // Set photo dynamic settings to their defaults. + TInt i; + TInt settingsListCount = iDynamicPhotoIntSettings.Count(); + for ( i = 0; i < settingsListCount; ++i ) + { + iDynamicPhotoIntSettings[i]->iValueId = iDynamicPhotoIntDefaults[i]; + } + // Set video dynamic settings to their defaults. + settingsListCount = iDynamicVideoIntSettings.Count(); + for ( i = 0; i < settingsListCount; ++i ) + { + iDynamicVideoIntSettings[i]->iValueId = iDynamicVideoIntDefaults[i]; + } + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::SetDynamicSettingsToDefault +// Sets a dynamic setting to its default. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::SetDynamicSettingToDefault( TInt aSettingItem ) + { + // Set photo dynamic settings to their defaults. + TInt i; + TBool found = EFalse; + TInt settingsListCount = iDynamicPhotoIntSettings.Count(); + for ( i = 0; i < settingsListCount && !found; ++i ) + { + if ( aSettingItem == iDynamicPhotoIntSettings[i]->iItemId ) + { + iDynamicPhotoIntSettings[i]->iValueId = iDynamicPhotoIntDefaults[i]; + found = ETrue; + } + } + // Set video dynamic settings to their defaults. + settingsListCount = iDynamicVideoIntSettings.Count(); + for ( i = 0; i < settingsListCount && !found; ++i ) + { + if ( aSettingItem == iDynamicVideoIntSettings[i]->iItemId ) + { + iDynamicVideoIntSettings[i]->iValueId = iDynamicVideoIntDefaults[i]; + found = ETrue; + } + } + + // NB no error is reported is it's not found + } + + +// --------------------------------------------------------------------------- +// virtual SetDynamicSettingToSceneDefaultL +// +// Sets a dynamic setting to scene default. +// --------------------------------------------------------------------------- +// +TInt +CCamSettingsModel::SetDynamicSettingToSceneDefaultL( TInt aSceneId, + TInt aSceneField, + TInt aSettingId, + TBool aVideoScene ) + { + PRINT( _L("Camera => CCamSettingsModel::SetDynamicSettingToSceneDefault") ); + + RPointerArray* sceneSettings = NULL; + TInt sceneIndex = KErrNotFound; + + if( !aVideoScene ) + { + sceneIndex = FindSceneInSceneList( aSceneId, iPhotoScenes ); + if( KErrNotFound != sceneIndex ) + { + sceneSettings = &(iPhotoScenes[sceneIndex]->iSettings); + } + } + else + { + sceneIndex = FindSceneInSceneList( aSceneId, iVideoScenes ); + if( KErrNotFound != sceneIndex ) + { + sceneSettings = &(iVideoScenes[sceneIndex]->iSettings); + } + } + + TInt settingIndex = KErrNotFound; + if( sceneSettings ) + { + settingIndex = SearchInSettingsListFor( *sceneSettings, aSceneField ); + if( settingIndex != KErrNotFound ) + { + SetIntegerSettingValueL( aSettingId, + (*sceneSettings)[settingIndex]->iValueId ); + } + } + + PRINT( _L("Camera <= CCamSettingsModel::SetDynamicSettingToSceneDefault") ); + return settingIndex; + } + + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::LoadStaticSettingsL +// Loads the static settings from shared data. Required to update +// the settings whenever get foreground event, incase of external +// changes to the settings. +// Note that static settings cannot be loaded until the AppUi has been created, +// as which settings to use is dependent on if app is embedded or not. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::LoadStaticSettingsL( TBool aIsEmbedded ) + { + PRINT(_L("Camera => CCamSettingsModel::LoadStaticSettingsL" )) + iEmbedded = aIsEmbedded; + + // The model needs to register as an observer of changes in burst mode + // activation, as burst mode limits some settings values. + // The model registers with the AppUi which is created after the model. + // Registration is done here so we can guarantee that the AppUi has + // been created. + CCamAppUiBase* appUi = static_cast + ( iEnv->AppUi() ); + appUi->AddBurstModeObserverL( this ); + + // Free all memory currently used by the static settings. + UnloadStaticSettings(); + + iStaticModel->ReadFromCenRepL( + static_cast( ECamSettingItemUserSceneRangeMin ), + static_cast( ECamSettingItemUserSceneRangeMax ), + iUserSceneSettings + ); + iStaticModel->LoadStaticSettingsL( aIsEmbedded ); + + PRINT(_L("Camera <= CCamSettingsModel::LoadStaticSettingsL" )) + + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::SaveSettingsL +// Saves the static settings to the shared data ini file +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::SaveSettingsL() + { + // This method is removed as we save to the CenRep whenever some setting + // is changed directly .. refer to SaveStaticSettingsL method + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::SaveStaticSettingL( TCamSettingItemIds aSettingId ) + { + PRINT1( _L("Camera => CCamSettingsModel::SaveStaticSettingL, setting:[%s]"), + KCamSettingItemNames[aSettingId] ); + TBool callStaticModel = ETrue; + + { + // All the User Specific Settings are saved here in the CenRep + // and the remaining static settings are handled in the static model + RPointerArray* settingArray = + MapSettingItem2SettingsList( aSettingId ); + + if( settingArray == &iUserSceneSettings ) + { + callStaticModel = EFalse; + TUint32 crKey = CCamStaticSettingsModel::MapSettingItem2CRKey( aSettingId, iEmbedded ); + iStaticModel->SaveCenRepItemL( aSettingId, crKey, *settingArray ); + } + } + if ( callStaticModel ) + { + iStaticModel->SaveStaticSettingL( aSettingId ); + } + PRINT( _L("Camera <= CCamSettingsModel::SaveStaticSettingL") ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +RPointerArray* +CCamSettingsModel::MapSettingItem2SettingsList( TCamSettingItemIds aSettingId ) + { + PRINT( _L("Camera => CCamSettingsModel::MapSettingItem2SettingsList") ); + + RPointerArray* array( NULL ); + + if( ECamSettingItemUserSceneRangeMin < aSettingId + && ECamSettingItemUserSceneRangeMax > aSettingId ) + { + array = &iUserSceneSettings; + } + else if( ECamSettingItemDynamicPhotoRangeMin < aSettingId + && ECamSettingItemDynamicPhotoRangeMax > aSettingId ) + { + array = &iDynamicPhotoIntSettings; + } + else if( ECamSettingItemDynamicVideoRangeMin < aSettingId + && ECamSettingItemDynamicVideoRangeMax > aSettingId ) + { + array = &iDynamicVideoIntSettings; + } + else + { + array = iStaticModel->MapSettingItem2SettingsList( aSettingId ); + } + + PRINT( _L("Camera <= CCamSettingsModel::MapSettingItem2SettingsList") ); + return array; + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::~CCamSettingsModel +// Destructor +// --------------------------------------------------------------------------- +// +CCamSettingsModel::~CCamSettingsModel() + { + PRINT( _L("Camera => ~CCamSettingsModel") ); + + UnLoadResources(); + + iObservers.Reset(); + iObservers.Close(); + + iSettingPreviews.ResetAndDestroy(); + iSettingPreviews.Close(); + + + iUserSceneSettings.ResetAndDestroy(); + iUserSceneSettings.Close(); + + iUserSceneSettingsBackup.ResetAndDestroy(); + iUserSceneSettingsBackup.Close(); + + iDynamicPhotoIntSettings.ResetAndDestroy(); + iDynamicPhotoIntSettings.Close(); + + iDynamicPhotoIntSettingsBackup.ResetAndDestroy(); + iDynamicPhotoIntSettingsBackup.Close(); + + iDynamicPhotoIntDefaults.Close(); + + iDynamicVideoIntSettings.ResetAndDestroy(); + iDynamicVideoIntSettings.Close(); + + iDynamicVideoIntSettingsBackup.ResetAndDestroy(); + iDynamicVideoIntSettingsBackup.Close(); + + iDynamicVideoIntDefaults.Close(); + + iPhotoScenes.ResetAndDestroy(); + iPhotoScenes.Close(); + + iVideoScenes.ResetAndDestroy(); + iVideoScenes.Close(); + + iQualityLevels.ResetAndDestroy(); + iQualityLevels.Close(); + + iVideoResolutions.Close(); + iPhotoQualityLevels.Close(); + iPhotoResolutions.Close(); + + if ( iStaticModel ) + { + delete iStaticModel; + iStaticModel = NULL; + } + + PRINT( _L("Camera <= ~CCamSettingsModel") ); + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::CCamSettingsModel +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamSettingsModel::CCamSettingsModel( CCamConfiguration& aConfiguration ) + : iDynamicPhotoIntDefaults( KDynamicArrayGranularity ), + iDynamicVideoIntDefaults( KDynamicArrayGranularity ), + iEngineReadyForVideoPrepare( ETrue ), + iConfiguration( aConfiguration ) + { + PRINT( _L("Camera => CCamSettingsModel::CCamSettingsModel") ); + + // set up secondary camera defaults + // these values are not stored in the shared data file because + // they do not persist when the camera is changed or the app is closed + + iSecondaryCameraSettings.iVideoQuality + = iConfiguration.SecondaryCameraVideoQuality(); + iSecondaryCameraSettings.iPhotoQuality + = iConfiguration.SecondaryCameraImageQuality(); + + // Check that configuration can provide us secondary camera qualities + // If either of them is unavailable, all we can do is panic + PRINT( _L("Camera <> Checking secondary camera qualities") ); + __ASSERT_ALWAYS( iSecondaryCameraSettings.iVideoQuality > 0, + CamPanic( ECamPanicSecondaryQualityMissing ) ); + + __ASSERT_ALWAYS( iSecondaryCameraSettings.iPhotoQuality > 0, + CamPanic( ECamPanicSecondaryQualityMissing ) ); + + // Check that configuration can provide us a MMS quality. + // If not available, all we can do is panic. MMS quality is + // needed in embedded mode. + PRINT( _L("Camera <> Checking MMS quality") ); + __ASSERT_ALWAYS( iConfiguration.MmsImageQuality() > 0, + CamPanic( ECamPanicMMSQualityMissing ) ); + + + PRINT( _L("Camera <= CCamSettingsModel::CCamSettingsModel") ); + } + + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::ConstructL() + { + PRINT( _L("Camera => CCamSettingsModel::ConstructL")) + // Create reference to the CEikonEnv object, since it is used alot. + iEnv = CEikonEnv::Static(); + + LoadResourcesL(); + + iStaticModel = CCamStaticSettingsModel::NewL( iConfiguration ); + + iUiConfigManager = iStaticModel->UiConfigManagerPtr(); + + if ( !iUiConfigManager )CamPanic( ECamPanicNullPointer ); + + PRINT( _L("Camera => CCamSettingsModel::ConstructL create respository")) + + // Load settings. + LoadSettingsL(); + + // Load the variant flags from the ini file + ReadVariantFlagsL(); + + // Load flag that specifies whether the engine should be updated with + // settings after an engine Prepare..() call. + // Create resource reader for reading photo static settings + TResourceReader reader; + iEnv->CreateResourceReaderLC( reader, R_CAM_ENGINE_UPDATE ); + iUpdateAfterPrepare = reader.ReadInt16(); + // Pop resource reader. + CleanupStack::PopAndDestroy(); + + // read in video quality levels + TInt i; + + const TInt nVidQualities( iConfiguration.NumVideoQualities() ); + for ( i=0; i < nVidQualities; i++ ) + { + TVideoQualitySettings set = iConfiguration.VideoQuality( i ); + CCamVideoQualityLevel* lev = CCamVideoQualityLevel::NewL( set ); + CleanupStack::PushL( lev ); + User::LeaveIfError( iQualityLevels.Append( lev ) ); + CleanupStack::Pop( lev ); + } + + // read in (supported) video resolutions + TResourceReader videoResReader; + iEnv->CreateResourceReaderLC( videoResReader, R_CAM_VIDEO_RESOLUTION_ARRAY ); + + // get array of supported values + RArray supportedVideoRes; + CleanupClosePushL( supportedVideoRes ); + iConfiguration.GetPsiIntArrayL( ECamPsiSupportedVideoResolutions, supportedVideoRes ); + + TInt numLevels = videoResReader.ReadInt16(); + + for( i = 0; i < numLevels; i++ ) + { + TSize videoRes; + videoRes.iWidth = videoResReader.ReadInt16(); + videoRes.iHeight = videoResReader.ReadInt16(); + + User::LeaveIfError( iVideoResolutions.Append( videoRes ) ); + } + + // Close array of support vid resolutions + CleanupStack::PopAndDestroy( &supportedVideoRes ); + + // Pop resource reader. + CleanupStack::PopAndDestroy(); + + + const TInt numQualities( iConfiguration.NumImageQualities() ); + for( i=0; iCreateResourceReaderLC( photoResReader, R_CAM_PHOTO_RESOLUTION_ARRAY ); + numLevels = photoResReader.ReadInt16(); + + // get array of supported values + RArray supportedStillRes; + CleanupClosePushL( supportedStillRes ); + + iConfiguration.GetPsiIntArrayL( ECamPsiSupportedStillResolutions, supportedStillRes ); + + for( i = 0; i < numLevels; i++ ) + { + TSize photoRes; + photoRes.iWidth = photoResReader.ReadInt16(); + photoRes.iHeight = photoResReader.ReadInt16(); + + User::LeaveIfError( iPhotoResolutions.Append( photoRes ) ); + + } + + iPreviousFaceTrack = ECamSettOn; + iPreviousSceneMode = ECamSceneAuto; + // Close array of support photo resolutions + CleanupStack::PopAndDestroy( &supportedStillRes ); + + // Pop resource reader. + CleanupStack::PopAndDestroy(); + + PRINT( _L("Camera <= CCamSettingsModel::ConstructL")) + } + + + + +// --------------------------------------------------------------------------- +// NotifyObservers +// +// Notify setting model observers, that a setting item value has changed. +// Overload for integer setting items. +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::NotifyObservers( TCamSettingItemIds aSettingId, + TInt aSettingValue ) + { + PRINT1( _L("Camera => CCamSettingsModel::NotifyObservers, observers:%d"), iObservers.Count() ); + for( TInt i = 0; i < iObservers.Count(); i++ ) + { + TRAP_IGNORE( iObservers[i]->IntSettingChangedL( aSettingId, + aSettingValue ) ); + } + PRINT ( _L("Camera <= CCamSettingsModel::NotifyObservers") ); + } + +// --------------------------------------------------------------------------- +// NotifyObservers +// +// Notify setting model observers, that a setting item value has changed. +// Overload for text setting items. +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::NotifyObservers( TCamSettingItemIds aSettingId, + const TDesC& aSettingValue ) + { + for( TInt i = 0; i < iObservers.Count(); i++ ) + { + TRAP_IGNORE( iObservers[i]->TextSettingChangedL( aSettingId, + aSettingValue ) ); + } + } + + +// --------------------------------------------------------------------------- +// ReadVariantFlagsL +// +// Read Central Repository key values in KCRUidCameraappVariant repository. +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::ReadVariantFlagsL() + { + TInt crValue( 0 ); + CRepository* cr = CRepository::NewLC( KCRUidCameraappVariant ); + + // Get variant info general flags + User::LeaveIfError( cr->Get( KCamCrVariantFlags, crValue ) ); + iVariantInfo.iFlags = crValue; + + // Get 'time lapse enabled' flag + User::LeaveIfError( cr->Get( KCamCrTimeLapseSupport, crValue ) ); + + iVariantInfo.iTimeLapseSupport = (KCamCrTimeLapseIsSupported == crValue) + ? ECamSupportOn + : ECamSupportOff; + + // Get 'app always running' flag + User::LeaveIfError( cr->Get( KCamCrAppAlwaysRunning, crValue ) ); + iVariantInfo.iAlwaysOnSupport = (KCamCrAppAlwaysRunningIsOn == crValue) + ? ECamSupportOn + : ECamSupportOff; + + + // Get Public Release version + User::LeaveIfError( cr->Get( KCamCrVersionMajor, crValue ) ); + iVariantInfo.iVersion.iMajor = (TInt8) crValue; + + User::LeaveIfError( cr->Get( KCamCrVersionMinor, crValue ) ); + iVariantInfo.iVersion.iMinor = (TInt8) crValue; + + User::LeaveIfError( cr->Get( KCamCrBuildNumber, crValue ) ); + iVariantInfo.iVersion.iBuild = (TInt16) crValue; + + CleanupStack::PopAndDestroy( cr ); + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::SettingIsForEngine +// Returns whether a particular setting is an engine setting, or not. +// --------------------------------------------------------------------------- +// +TBool CCamSettingsModel::SettingIsForEngine( TInt aSettingItem ) + { + if ( ( aSettingItem == ECamSettingItemPhotoQuality ) || + ( aSettingItem == ECamSettingItemVideoAudioRec ) || + ( aSettingItem == ECamSettingItemVideoResolution ) || + ( aSettingItem == ECamSettingItemVideoFileType ) || + ( aSettingItem == ECamSettingItemVideoQuality ) ) + { + return ETrue; + } + else + { + return EFalse; + } + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::SearchInSettingsListFor +// Searches in a settings list for a particular setting item. +// --------------------------------------------------------------------------- +// +TInt CCamSettingsModel::SearchInSettingsListFor +( const RPointerArray& aSettingsList, TInt aSettingItem ) const + { + TInt count = aSettingsList.Count(); + PRINT2( _L("Camera => CCamSettingsModel::SearchInSettingsListFor item (%d) count (%d)"), aSettingItem, count) + TInt i; + for ( i = 0; i < count; ++i ) + { + if ( aSettingsList[i]->iItemId == aSettingItem ) + { + return i; + } + } + + return KErrNotFound; + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::FindSceneInSceneList +// Finds a scene in a particular scene list. +// --------------------------------------------------------------------------- +// +TInt CCamSettingsModel::FindSceneInSceneList +( TInt aSceneItemId, const RPointerArray& aSceneList ) const + { + TInt count = aSceneList.Count(); + TInt i; + for ( i = 0; i < count; ++i ) + { + if ( aSceneList[i]->iSceneId == aSceneItemId ) + { + return i; + } + } + + return KErrNotFound; + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::UserSceneHasChangedL +// Handles a change in the value for the user scene setting. +// That is, it updates the rest of the user setings. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::UserSceneHasChangedL( TInt aSceneId, TBool aActivate ) + { + + // Set the user setup flash setting to that of the new scene. + TInt sceneFlash = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneFlashMode ); + SetIntegerSettingValueL( ECamSettingItemUserSceneFlash, sceneFlash ); + + // Set the user setup whitebalance to that of the new scene + TInt whiteBal = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneAWBMode ); + SetIntegerSettingValueL( ECamSettingItemUserSceneWhitebalance, whiteBal ); + + // Set the user setup sharpness to that of the new scene + TInt sharpness = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneSharpness ); + SetIntegerSettingValueL( ECamSettingItemUserSceneImageSharpness, sharpness ); + + // Set the user setup contrast to that of the new scene + TInt contrast = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneContrast ); + SetIntegerSettingValueL( ECamSettingItemUserSceneContrast, contrast ); + + // Set the scene + TInt settingIndex = SearchInSettingsListFor( iUserSceneSettings, + ECamSettingItemUserSceneBasedOnScene ); + iUserSceneSettings[settingIndex]->iValueId = aSceneId; + + // Save the new values. + SaveSettingsL(); + + if ( aActivate ) + { + // Activate user scene settings. + ActivateUserSceneSettingsL(); + } + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::PhotoSceneHasChangedL +// Handles a change in the value for the photo scene setting. +// That is, it updates the rest of the photo dynamic setings. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::PhotoSceneHasChangedL( TInt aSceneId ) + { + // If the scene has changed to a scene other than the "User" scene + // set capture setup values to defaults and the flash to scene flash. + if ( aSceneId != ECamSceneUser ) + { + // Set all the photo capture setup values to their defaults, except + // for the scene setting. + TInt settingsCount = iDynamicPhotoIntSettings.Count(); + TInt i; + for ( i = 0; i < settingsCount; ++i ) + { + // If the setting item is not the scene change it's value, + // and update the engine + if ( iDynamicPhotoIntSettings[i]->iItemId != ECamSettingItemDynamicPhotoScene ) + { + SetIntegerSettingValueL( iDynamicPhotoIntSettings[i]->iItemId, + iDynamicPhotoIntDefaults[i] ); + } + } + + // Set the capture setup flash setting to that of the new scene. + TInt sceneFlash = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneFlashMode ); + SetIntegerSettingValueL( ECamSettingItemDynamicPhotoFlash, sceneFlash ); + + // Set the user setup whitebalance to that of the new scene + TInt whiteBal = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneAWBMode ); + SetIntegerSettingValueL( ECamSettingItemDynamicPhotoWhiteBalance, whiteBal ); + + // Set the user setup sharpness to that of the new scene + TInt sharpness = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneSharpness ); + SetIntegerSettingValueL( ECamSettingItemDynamicPhotoImageSharpness, sharpness ); + + // Set the user setup contrast to that of the new scene + TInt contrast = DefaultSettingValueForScene( aSceneId, ECamSettingItemSceneContrast ); + SetIntegerSettingValueL( ECamSettingItemDynamicPhotoBrightness, contrast ); + + if ( iUiConfigManager->IsFaceTrackingSupported() ) // FT supported + { + if ( ECamSceneScenery == aSceneId || ECamSceneSports == aSceneId ) + { + if ( ECamSceneScenery != iPreviousSceneMode && ECamSceneSports != iPreviousSceneMode ) // <- DATAMAKE + { + iPreviousFaceTrack = TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) ); + } + SetIntegerSettingValueL( ECamSettingItemFaceTracking, ECamSettOff ); + } + else if ( ( ECamSceneScenery == iPreviousSceneMode || + ECamSceneSports == iPreviousSceneMode ) && + ( ECamSettOff == TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) ) ) ) + { + SetIntegerSettingValueL( ECamSettingItemFaceTracking, iPreviousFaceTrack ); + iPreviousFaceTrack = TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) ); + CCamAppUiBase* appUi = static_cast( iEnv->AppUi() ); + TRAP_IGNORE( appUi->APHandler()->UpdateActivePaletteL() ); + } + } + + // Update the engine with the scene settings. + //UpdateEngineWithSceneSettingsL( iPhotoScenes, aSceneId ); + } + + // Otherwise, activate the user scene settings + else + { + ActivateUserSceneSettingsL(); + } + iPreviousSceneMode = TCamSceneId( aSceneId ); // store scene mode setting + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::CopyUserSceneSettingToCaptureSettingL +// Copies a user scene setting across to the capture setup settings. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::CopyUserSceneSettingToCaptureSettingL( TInt aSettingItem ) + { + // Determine the indexes of the user scene setting and + // the corresponding photo capture setting. + + // ...determine the index of the user scene setting + TInt userIndex = SearchInSettingsListFor( iUserSceneSettings, + aSettingItem ); + + // ...determine the index of the corresponding photo capture setting + TInt capIndex = 0; + switch ( aSettingItem ) + { + case ECamSettingItemUserSceneWhitebalance: + { + capIndex = SearchInSettingsListFor( iDynamicPhotoIntSettings, + ECamSettingItemDynamicPhotoWhiteBalance ); + } + break; + + case ECamSettingItemUserSceneExposure: + { + capIndex = SearchInSettingsListFor( iDynamicPhotoIntSettings, + ECamSettingItemDynamicPhotoExposure ); + } + break; + + case ECamSettingItemUserSceneColourFilter: + { + capIndex = SearchInSettingsListFor( iDynamicPhotoIntSettings, + ECamSettingItemDynamicPhotoColourFilter ); + } + break; + case ECamSettingItemUserSceneFlash: + { + capIndex = SearchInSettingsListFor( iDynamicPhotoIntSettings, + ECamSettingItemDynamicPhotoFlash ); + } + break; + + case ECamSettingItemUserSceneBrightness: + { + capIndex = SearchInSettingsListFor( iDynamicPhotoIntSettings, + ECamSettingItemDynamicPhotoBrightness ); + } + break; + case ECamSettingItemUserSceneContrast: + { + capIndex = SearchInSettingsListFor( iDynamicPhotoIntSettings, + ECamSettingItemDynamicPhotoContrast ); + } + break; + + case ECamSettingItemUserSceneImageSharpness: + { + capIndex = SearchInSettingsListFor( iDynamicPhotoIntSettings, + ECamSettingItemDynamicPhotoImageSharpness ); + } + break; + + case ECamSettingItemUserSceneLightSensitivity: + { + capIndex = SearchInSettingsListFor(iDynamicPhotoIntSettings, + ECamSettingItemDynamicPhotoLightSensitivity ); + } + break; + default: + PRINT( _L("Camera => CCamSettingsModel::ECamPanicUnknownSettingItem 6" )) + CamPanic( ECamPanicUnknownSettingItem ); + break; + } + + // Copy the user scene setting across to the photo capture setting. + iDynamicPhotoIntSettings[capIndex]->iValueId = + iUserSceneSettings[userIndex]->iValueId; + + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::ActivateUserSceneSettings +// Activates the current user scene settings. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::ActivateUserSceneSettingsL() + { + PRINT( _L("Camera => CCamSettingsModel::ActivateUserSceneSettingsL")) + // Copy all the user scene settings to capture settings. + CopyUserSceneSettingToCaptureSettingL( + ECamSettingItemUserSceneWhitebalance ); + CopyUserSceneSettingToCaptureSettingL( + ECamSettingItemUserSceneExposure ); + CopyUserSceneSettingToCaptureSettingL( + ECamSettingItemUserSceneColourFilter ); + CopyUserSceneSettingToCaptureSettingL( + ECamSettingItemUserSceneFlash ); + CopyUserSceneSettingToCaptureSettingL( + ECamSettingItemUserSceneBrightness ); + CopyUserSceneSettingToCaptureSettingL( + ECamSettingItemUserSceneContrast ); + CopyUserSceneSettingToCaptureSettingL( + ECamSettingItemUserSceneImageSharpness ); + + if ( iUiConfigManager->IsISOSupported() ) + { + CopyUserSceneSettingToCaptureSettingL( + ECamSettingItemUserSceneLightSensitivity ); + } + + // Handled in appcontroller + //UpdateEngineWithPhotoCaptureSetupSettingsL(); + PRINT( _L("Camera <= CCamSettingsModel::ActivateUserSceneSettingsL")) + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::VideoSceneHasChangedL +// Handles a change in the value for the video scene setting. +// That is, it updates the rest of the video dynamic setings. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::VideoSceneHasChangedL( TInt /*aSettingValue*/ ) + { + // Set all the video capture setup values to their defaults, + // except for the scene setting. + TInt settingsCount = iDynamicVideoIntSettings.Count(); + TInt i; + for ( i = 0; i < settingsCount; ++i ) + { + // If the setting item is not the scene change it's value. + if ( iDynamicVideoIntSettings[i]->iItemId != ECamSettingItemDynamicVideoScene ) + { + SetIntegerSettingValueL( iDynamicVideoIntSettings[i]->iItemId, + iDynamicVideoIntDefaults[i] ); + } + } + + // Update the engine with the scene settings. + //UpdateEngineWithSceneSettingsL( iVideoScenes, aSettingValue ); + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::PhotoSceneMaximumQuality +// Returns the highest allowed quality for the current photo scene. +// --------------------------------------------------------------------------- +// +TInt CCamSettingsModel::PhotoSceneMaximumQuality( TInt aSceneId ) const + { + // If the scene is the user scene return the maximum amount. + // This is to be changed once user scene has been implemented. + if ( aSceneId == ECamSceneUser ) + { + // Get the scene that the user scene is based on and + // get the maximum resolution for this scene. + TInt settingIndex = SearchInSettingsListFor( + iUserSceneSettings, ECamSettingItemUserSceneBasedOnScene ); + TInt sceneId = iUserSceneSettings[settingIndex]->iValueId; + + return PhotoSceneMaximumQuality( sceneId ); + } + + // Find the index to the scene. + TInt sceneIndex = FindSceneInSceneList( aSceneId, iPhotoScenes ); + // Search for the maximum resolution item in this scene's item list. + TInt settingsCount = iPhotoScenes[sceneIndex]->iSettings.Count(); + TInt i; + for ( i = 0; i < settingsCount; ++i ) + { + if ( iPhotoScenes[sceneIndex]->iSettings[i]->iItemId == ECamSettingItemSceneMaxRes ) + { + return iPhotoScenes[sceneIndex]->iSettings[i]->iValueId; + } + } + PRINT( _L("Camera => CCamSettingsModel::ECamPanicUnknownSettingItem 7" )) + CamPanic( ECamPanicUnknownSettingItem ); + // Remove warning + return KErrNotFound; + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::CurrentPhotoQualityValue +// Returns the current photo quality setting. +// --------------------------------------------------------------------------- +// +TInt CCamSettingsModel::CurrentPhotoQualityValue() const + { + return iStaticModel->IntegerSettingValue( ECamSettingItemPhotoQuality ); + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::PhotoQualityArrayIndex +// Returns the photo quailty array index of a specified photo quality id +// --------------------------------------------------------------------------- +// + +TInt CCamSettingsModel::PhotoQualityArrayIndex(TInt aPhotoQualityId) const + { + for(TInt i=0;i CCamSettingsModel::ECamPanicUnknownSettingItem 10" )) + CamPanic( ECamPanicUnknownSettingItem ); + // Remove warning + return KErrNotFound; + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::CurrentPhotoResolution +// Returns the photo resolution from current Settings +// --------------------------------------------------------------------------- +// +TCamPhotoSizeId CCamSettingsModel::CurrentPhotoResolution() const + { + return PhotoResolution( CurrentPhotoQualityValue() ); + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::PhotoResolution +// Returns the photo resolution for a particular quality index +// --------------------------------------------------------------------------- +// +TCamPhotoSizeId CCamSettingsModel::PhotoResolution( TInt aQualityIndex ) const + { + TInt qualityValue = PhotoQualityArrayIndex( aQualityIndex ); + + if ( qualityValue != KErrNotFound ) + { + TCamPhotoQualitySetting quality = + iPhotoQualityLevels[qualityValue]; + + return iConfiguration.MapResolutionToPhotoSize( quality.iPhotoResolution ); + } + + PRINT( _L("Camera => CCamSettingsModel::ECamPanicUnknownSettingItem 11" )) + CamPanic( ECamPanicUnknownSettingItem ); + // Remove warning + return ECamPhotoSizeVGA; // We can never get here anyway + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::StorePrimaryCameraSettingsL +// Stores the primary camera settings so they can be reapplied when +// changing from front to back camera +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::StorePrimaryCameraSettingsL() + { + PRINT( _L("Camera => CCamSettingsModel::StorePrimaryCameraSettingsL")) + iStaticModel->StorePrimaryCameraSettingsL(); + CopySettingsL(iDynamicPhotoIntSettings, iDynamicPhotoIntSettingsBackup); + CopySettingsL(iDynamicVideoIntSettings, iDynamicVideoIntSettingsBackup); + CopySettingsL(iUserSceneSettings, iUserSceneSettingsBackup); + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::RestorePrimaryCameraSettingsL +// Restores the primary camera settings when +// changing from front to back camera +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::RestorePrimaryCameraSettingsL() + { + // set the stored primary camera settings + iStaticModel->RestorePrimaryCameraSettingsL(); + CopySettingsL(iDynamicPhotoIntSettingsBackup, iDynamicPhotoIntSettings, ETrue); + CopySettingsL(iDynamicVideoIntSettingsBackup, iDynamicVideoIntSettings, ETrue); + CopySettingsL(iUserSceneSettingsBackup, iUserSceneSettings, ETrue); + } + +// --------------------------------------------------------------------------- +// VariantInfo +// --------------------------------------------------------------------------- +// +const TCamVariantInfo& +CCamSettingsModel::VariantInfo() + { + if( 0 > iVariantInfo.iFlags ) + { + TRAP_IGNORE( ReadVariantFlagsL() ); + } + return iVariantInfo; + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::ResetRepository +// Reset Camera central repository file +// --------------------------------------------------------------------------- +// + void CCamSettingsModel::ResetRepository() + { + iStaticModel->ResetRepository(); + } + + + + +// =========================================================================== +// From base class MCamSettingPreviewHandler + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::ActivatePreviewL( const TCamSettingItemIds& aSettingId, + TInt aSettingValue ) + { + TInt index = FindIndex( iSettingPreviews, aSettingId ); + if( KErrNotFound == index ) + { + // Preview for this setting id did not exist yet. + TIntSetting* settingItem = new (ELeave) TIntSetting; + CleanupStack::PushL( settingItem ); + + settingItem->iItemId = aSettingId; + settingItem->iValueId = aSettingValue; + + iSettingPreviews.AppendL( settingItem ); + CleanupStack::Pop( settingItem ); + } + else + { + // If a preview exists, only update the value. + // Only one preview per setting item active at once. + iSettingPreviews[index]->iValueId = aSettingValue; + } + // The preview is considered as current setting value. + // Notify observers as if the setting value had changed. + NotifyObservers( aSettingId, aSettingValue ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::CancelPreview( const TCamSettingItemIds& aSettingId ) + { + TInt index = FindIndex( iSettingPreviews, aSettingId ); + + if( KErrNotFound != index ) + { + TIntSetting* settingItem = iSettingPreviews[index]; + iSettingPreviews.Remove( index ); + delete settingItem; + settingItem = NULL; + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::CancelPreviews( const RArray aSettingIds ) + { + // Check if there is anything to cancel + if( 0 < iSettingPreviews.Count() ) + { + for( TInt i = 0; i < aSettingIds.Count(); i++ ) + { + CancelPreview( aSettingIds[i] ); + } + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::CancelAllPreviews() + { + iSettingPreviews.ResetAndDestroy(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::CommitPreviewL( const TCamSettingItemIds& aSettingId ) + { + TInt index = FindIndex( iSettingPreviews, aSettingId ); + + if( KErrNotFound != index ) + { + TIntSetting* settingItem = iSettingPreviews[index]; + + iSettingPreviews.Remove( index ); + + CleanupStack::PushL( settingItem ); + SetIntegerSettingValueL( settingItem->iItemId, settingItem->iValueId ); + CleanupStack::PopAndDestroy( settingItem ); + } + else + { + User::Leave( KErrNotFound ); + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::CommitPreviewsL( const RArray& aSettingIds ) + { + if( 0 < iSettingPreviews.Count() ) + { + TInt all ( KErrNone ); + TInt single( KErrNone ); + + for( TInt i = 0; i < aSettingIds.Count(); i++ ) + { + TRAP( single, CommitPreviewL( aSettingIds[i] ) ); + + if( KErrNone != single ) + all = single; + } + + // Leave if there was problem with any of the previews. + User::LeaveIfError( all ); + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::CommitAllPreviewsL() + { + TInt all ( KErrNone ); + TInt single( KErrNone ); + for( TInt i = 0; i < iSettingPreviews.Count(); i++ ) + { + TRAP( single, SetIntegerSettingValueL( iSettingPreviews[i]->iItemId, + iSettingPreviews[i]->iValueId ) ); + + if( KErrNone != single ) + all = single; + } + + // Even if all commits are not successful, deactivate all previews. + iSettingPreviews.ResetAndDestroy(); + + // Leave if there was problem with any of the previews. + User::LeaveIfError( all ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel +::ActivePreviewsL( RArray& aSettingIds ) const + { + aSettingIds.Reset(); + aSettingIds.ReserveL( iSettingPreviews.Count() ); + for( TInt i = 0; i < iSettingPreviews.Count(); i++ ) + { + aSettingIds.AppendL( (TCamSettingItemIds)iSettingPreviews[i]->iItemId ); + } + } + +// =========================================================================== + + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::ImageResolutionFromIndex +// Returns the dimensions of the photo (in pixels) based on the size ID passed in +// --------------------------------------------------------------------------- +// +TSize CCamSettingsModel::ImageResolutionFromIndex( TCamPhotoSizeId aIndex ) + { + // TCamImageResolution imageRes = iConfiguration.MapPhotoSizeToResolution( aIndex ); + return iPhotoResolutions[aIndex]; + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::DefaultSettingValueForScene +// Returns the default value of a setting for a particular scene item. +// --------------------------------------------------------------------------- +// +TInt CCamSettingsModel::DefaultSettingValueForScene( TInt aSceneId, TInt aSettingId ) const + { + TInt sceneIndex = FindSceneInSceneList( aSceneId, iPhotoScenes ); + + TInt settingIndex = SearchInSettingsListFor( + iPhotoScenes[sceneIndex]->iSettings, aSettingId ); + + return iPhotoScenes[sceneIndex]->iSettings[settingIndex]->iValueId; + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::LoadDynamicSettingsL +// Loads the dynamic settings from resource file for a +// particular group of settings, and stores their defaults. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::LoadDynamicSettingsL( + TInt aResourceId, + RPointerArray& aSettingsList, + RArray& aDefaultsList ) + { + PRINT( _L("Camera => CCamSettingsModel::LoadDynamicSettingsL" )) + // Create resource reader for reading photo static settings + TResourceReader reader; + iEnv->CreateResourceReaderLC( reader, aResourceId ); + TInt count = reader.ReadInt16(); + + // for each entry in the resource, create a new setting item. + TInt i; + for ( i = 0; i < count; ++i ) + { + + TIntSetting* newSetting = new (ELeave) TIntSetting; + CleanupStack::PushL( newSetting ); + + // Read the data for this setting item from resource. + newSetting->iItemId = reader.ReadInt16(); + newSetting->iValueId = reader.ReadInt16(); + aDefaultsList.AppendL( newSetting->iValueId ); + + // Add the new setting item and its associated key + // to the parallel arrays for static photo settings. + aSettingsList.AppendL( newSetting ); + CleanupStack::Pop( newSetting ); + } + + CleanupStack::PopAndDestroy(); // reader + PRINT( _L("Camera <= CCamSettingsModel::LoadDynamicSettingsL" )) + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::LoadDynamicSettingsL +// Loads the dynamic settings from resource file for a +// particular group of settings. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::LoadDynamicSettingsL( TInt aResourceId, + RPointerArray& aSettingsList ) + { + iStaticModel->LoadSettingsFromResourceL( aResourceId, aSettingsList ); + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::LoadScenesDataL +// Loads the scene data from resource file for a particular group of scenes. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::LoadScenesDataL( TInt aResourceId, + RPointerArray& aSceneDataArray ) + { + // Add array of defaults for static video settings + TResourceReader reader; + // Add array of defaults for static video settings + iEnv->CreateResourceReaderLC( reader, aResourceId ); + TInt sceneCount = reader.ReadInt16(); + + // for each entry in the resource array, create a new scene data item + TInt i; + for ( i = 0; i < sceneCount; i++ ) + { + TSceneData * sceneData = new (ELeave) TSceneData ; + CleanupStack::PushL( sceneData ); + + // Create a resource reader for reading only this scene's data. + TInt resourceID = reader.ReadInt32(); + TResourceReader localReader; + iEnv->CreateResourceReaderLC + ( localReader, resourceID ); + + // Read the data for this list item from resource. + // ...read scene id for the scene data + sceneData->iSceneId = localReader.ReadInt16(); + // ...read settings for the scene data. + TInt settingsCount = localReader.ReadInt16(); + TInt j; + for ( j = 0; j < settingsCount; ++j ) + { + TIntSetting* setting = new (ELeave) TIntSetting; + CleanupStack::PushL( setting ); + sceneData->iSettings.AppendL( setting ); + CleanupStack::Pop( setting ); + sceneData->iSettings[j]->iItemId = localReader.ReadInt16(); + sceneData->iSettings[j]->iValueId = localReader.ReadInt16(); + } + + CleanupStack::PopAndDestroy(); // local reader + + // Add the scene data to the scenes list. + aSceneDataArray.AppendL( sceneData ); + CleanupStack::Pop( sceneData ); + } + + CleanupStack::PopAndDestroy(); // reader + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::LoadSceneDataL +// Loads the scene data from resource file for a particular group of scenes. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::LoadSceneDataL( TBool aPhotoSceneSettings ) + { + RArray supportedSceneSettings; + CleanupClosePushL( supportedSceneSettings ); + + iUiConfigManager->SupportedSceneModesAndSettingsL( supportedSceneSettings, + aPhotoSceneSettings ); + + for ( TInt i = 0; i < supportedSceneSettings.Count(); i++ ) + { + // + TSceneSettings scene = supportedSceneSettings[i]; + if ( scene.iSupported ) // only if scenes are supported its appened to the list + { + TSceneData* sceneData = new ( ELeave ) TSceneData; + CleanupStack::PushL( sceneData ); + + // identifier + sceneData->iSceneId = scene.iIdentifier; + + // exposure mode + TIntSetting* setting = new ( ELeave ) TIntSetting; + CleanupStack::PushL( setting ); + + setting->iItemId = ECamSettingItemSceneAEMode; + setting->iValueId = scene.iExposureMode; + + sceneData->iSettings.AppendL( setting ); + CleanupStack::Pop( setting ); + + // white balance + setting = new ( ELeave ) TIntSetting; + CleanupStack::PushL( setting ); + + setting->iItemId = ECamSettingItemSceneAWBMode; + setting->iValueId = scene.iWhiteBalance; + + sceneData->iSettings.AppendL( setting ); + CleanupStack::Pop( setting ); + + // flash + setting = new ( ELeave ) TIntSetting; + CleanupStack::PushL( setting ); + + setting->iItemId = ECamSettingItemSceneFlashMode; + setting->iValueId = scene.iFlash; + + sceneData->iSettings.AppendL( setting ); + CleanupStack::Pop( setting ); + + // contrast + setting = new ( ELeave ) TIntSetting; + CleanupStack::PushL( setting ); + + setting->iItemId = ECamSettingItemSceneContrast; + setting->iValueId = scene.iContrastMode; + + sceneData->iSettings.AppendL( setting ); + CleanupStack::Pop( setting ); + + // focal distance + setting = new ( ELeave ) TIntSetting; + CleanupStack::PushL( setting ); + + setting->iItemId = ECamSettingItemSceneAFMode; + setting->iValueId = scene.iFocalDistance; + + sceneData->iSettings.AppendL( setting ); + CleanupStack::Pop( setting ); + + + if ( aPhotoSceneSettings ) + { + // load settings which are specific to photo scene + + // sharpness + setting = new ( ELeave ) TIntSetting; + CleanupStack::PushL( setting ); + + setting->iItemId = ECamSettingItemSceneSharpness; + setting->iValueId = scene.iSharpnessMode; + + sceneData->iSettings.AppendL( setting ); + CleanupStack::Pop( setting ); + + + // ISO + setting = new ( ELeave ) TIntSetting; + CleanupStack::PushL( setting ); + + setting->iItemId = ECamSettingItemSceneISO; + setting->iValueId = scene.iLightSensitivityMode; + + sceneData->iSettings.AppendL( setting ); + CleanupStack::Pop( setting ); + + // EV + setting = new ( ELeave ) TIntSetting; + CleanupStack::PushL( setting ); + + setting->iItemId = ECamSettingItemSceneEV; + setting->iValueId = scene.iExposureCompensationValue; + + sceneData->iSettings.AppendL( setting ); + CleanupStack::Pop( setting ); + } + else + { + // settings which are specific to video scene + // framerate + setting = new ( ELeave ) TIntSetting; + CleanupStack::PushL( setting ); + + setting->iItemId = ECamSettingItemSceneFramerate; + setting->iValueId = scene.iFrameRate; + + sceneData->iSettings.AppendL( setting ); + CleanupStack::Pop( setting ); + } + // Add the scene data to the scenes list. + if ( aPhotoSceneSettings ) + { + iPhotoScenes.AppendL( sceneData ); + } + else + { + iVideoScenes.AppendL( sceneData ); + } + CleanupStack::Pop( sceneData ); + } // end if + } // end for + CleanupStack::PopAndDestroy( &supportedSceneSettings ); + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::UnloadSettings +// Remove any previously loaded settings. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::UnloadSettings() + { + PRINT( _L("Camera => CCamSettingsModel::UnloadSettings()" )) + + iDynamicPhotoIntSettings.ResetAndDestroy(); + iDynamicVideoIntSettings.ResetAndDestroy(); + + iPhotoScenes.ResetAndDestroy(); + iVideoScenes.ResetAndDestroy(); + PRINT( _L("Camera <= CCamSettingsModel::UnloadSettings()" )) + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::UnloadStaticSettings +// Remove any previously loaded static settings. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::UnloadStaticSettings() + { + PRINT( _L("Camera => CCamSettingsModel::UnloadStaticSettings()" )) + iUserSceneSettings.ResetAndDestroy(); + PRINT( _L("Camera <= CCamSettingsModel::UnloadStaticSettings()" )) + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::BurstModeActiveL +// Track burst mode activation +// --------------------------------------------------------------------------- +// +void +CCamSettingsModel::BurstModeActiveL( TBool aActive, TBool /*aStillModeActive*/ ) + { + iBurstEnabled = aActive; + } + + +// --------------------------------------------------------------------------- +// CCamSettingsModel::VideoResolutions +// Return ref. to video resolutions array +// --------------------------------------------------------------------------- +// +const RArray& +CCamSettingsModel::VideoResolutions() + { + return iVideoResolutions; + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::VideoQualityArray +// Return ref. to video video quality level array +// --------------------------------------------------------------------------- +// +const RPointerArray& +CCamSettingsModel::VideoQualityArray() + { + return iQualityLevels; + } + +// --------------------------------------------------------------------------- +// StaticSettingsModel +// +// Gets the reference to the settings model +// --------------------------------------------------------------------------- +// +MCamStaticSettings& +CCamSettingsModel::StaticSettingsModel() const + { + return *iStaticModel; + } + +// =========================================================================== +// TSceneData methods + +// --------------------------------------------------------------------------- +// TSceneData::~TSceneData +// Destructor +// --------------------------------------------------------------------------- +// +TSceneData::~TSceneData() + { + iSettings.ResetAndDestroy(); + iSettings.Close(); + } + +/* +* Is Image Scene supported +*/ + TBool CCamSettingsModel::IsImageSceneSupported( const TInt aSceneId ) const + { + if ( ECamSceneMacro == aSceneId && !iUiConfigManager->IsAutoFocusSupported() ) + { + // if the photo scene is macro and if autofocus is not supported + // the macro scene mode is not visible in scene mode settings + return EFalse; + } + return ( KErrNotFound != FindSceneInSceneList( aSceneId, iPhotoScenes ) ); + } + + /* + * Is Image Scene supported + */ + TBool CCamSettingsModel::IsVideoSceneSupported( const TInt aSceneId ) const + { + return ( KErrNotFound != FindSceneInSceneList( aSceneId, iVideoScenes ) ); + } + +/* +* Handle to Camera Ui Config Manager +*/ +CCameraUiConfigManager* CCamSettingsModel::UiConfigManagerPtr() + { + return iUiConfigManager; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::LoadResourcesL() + { + PRINT( _L("Camera => CCamSettingsModel::LoadResourcesL" ) ) + if (iResourceFileOffset == 0) + { + TFileName resourceFile; + TParse parse; + if ( CamUtility::IsNhdDevice() ) + { + parse.Set( KCamNhdResourceFileName, &KDC_APP_RESOURCE_DIR, NULL ); + } + else + { + parse.Set( KCamVgaResourceFileName, &KDC_APP_RESOURCE_DIR, NULL ); + } + resourceFile = parse.FullName(); + BaflUtils::NearestLanguageFile( iEnv->FsSession(), resourceFile ); + iResourceFileOffset = iEnv->AddResourceFileL( resourceFile ); + } + PRINT( _L("Camera <= CCamSettingsModel::LoadResourcesL" ) ) + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::UnLoadResources() + { + if (iResourceFileOffset > 0) + { + iEnv->DeleteResourceFile( iResourceFileOffset ); + iResourceFileOffset = 0; + } + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::StoreFaceTrackingValue +// +// Store user defined FT value outside Sports and Scenery mode that setting +// can be rolled back. +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::StoreFaceTrackingValue() + { + PRINT( _L("Camera => CCamSettingsModel::StoreFaceTrackingValue()" ) ) + + if ( !iUiConfigManager->IsFaceTrackingSupported() ) // FT not supported + { + PRINT( _L("Camera <= CCamSettingsModel::StoreFaceTrackingValue(), FT _not_ supported" ) ) + return; + } + TInt activeScene = IntegerSettingValue( ECamSettingItemDynamicPhotoScene ); + if ( ECamSceneScenery == activeScene || ECamSceneSports == activeScene ) + { + PRINT( _L("Camera <> CCamSettingsModel::StoreFaceTrackingValue(), Scenery or Sports mode" ) ) + if ( iPreviousFaceTrack != TCamSettingsOnOff( IntegerSettingValue( ECamSettingItemFaceTracking ) ) ) + { + PRINT1( _L("Camera <> CCamSettingsModel::StoreFaceTrackingValue(), iPreviousFaceTrack [%d]" ), iPreviousFaceTrack ) + SetIntegerSettingValueL( ECamSettingItemFaceTracking, iPreviousFaceTrack ); + } + } + PRINT( _L("Camera <= CamSettingsModel::StoreFaceTrackingValue()" ) ) + } + +// --------------------------------------------------------------------------- +// CCamSettingsModel::CopySettingsL +// +// Backup and Restore Settings array +// --------------------------------------------------------------------------- +// +void CCamSettingsModel::CopySettingsL(RPointerArray& aSrc, + RPointerArray& aDest, + TBool aRestore) + { + if(aRestore) + { + __ASSERT_DEBUG(aSrc.Count() == aDest.Count(), CamPanic(ECamPanicInvalidState)); + TInt count = aSrc.Count(); + TInt index = 0; + do + { + if(aSrc[index]->iItemId == aDest[index]->iItemId) + { + if(aSrc[index]->iValueId != aDest[index]->iValueId) + { + aDest[index]->iValueId = aSrc[index]->iValueId; + } + } + index++; + }while(index < count); + } + else + { + __ASSERT_DEBUG(aSrc.Count(), CamPanic(ECamPanicInvalidState)); + aDest.ResetAndDestroy(); + TInt count = aSrc.Count(); + TInt index = 0; + do + { + TIntSetting* setting = new(ELeave) TIntSetting(); + CleanupStack::PushL(setting); + setting->iItemId = aSrc[index]->iItemId; + setting->iValueId = aSrc[index]->iValueId; + aDest.AppendL(setting); + CleanupStack::Pop(setting); + index++; + }while(index < count); + } + + } + +// =========================================================================== +// end of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamShootingModeContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamShootingModeContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1061 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page for Image/Video quality.* +*/ + +#include +#include +#include +#include +#include // resource reader +#include +#include +#include + +#include +#include + +#include "CamShootingModeContainer.h" +#include "CamUtility.h" +#include "CamAppUi.h" +#include "CameraUiConfigManager.h" +#include "CamSceneListBox.h" +#include "CamSceneListBoxModel.h" +#include "CamPanic.h" +#include "camactivepalettehandler.h" + +#include +#include "akntoolbar.h" + +// CONSTANTS + +const TInt KInfoTooltipDelay = 0; // time (milliseconds) delay when showing the tooltip +const TInt KInfoTooltipDisplayTime = 5000; // maximum time (milliseconds) the tooltip is displayed +const TInt KExplTxtGranularity = 6; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamShootingModeContainer::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamShootingModeContainer* +CCamShootingModeContainer::NewL( const TRect& aRect, + CAknView& aView, + TCamCameraMode aMode, + CCamAppController& aController, + TBool aUserBaseScenes ) + { + CCamShootingModeContainer* self = + new( ELeave ) CCamShootingModeContainer( aMode, + aController, + aView, + aUserBaseScenes ); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamShootingModeContainer::~CCamShootingModeContainer +// Destructor +// --------------------------------------------------------------------------- +// +CCamShootingModeContainer::~CCamShootingModeContainer() + { + PRINT( _L( "Camera => ~CCamShootingModeContainer" ) ); + + iSummaryBitmapArray.ResetAndDestroy(); + iTitleArray.ResetAndDestroy(); + iDescArray.ResetAndDestroy(); + iExplTxtLinesLayout.Close(); + + if ( iFeedback ) + { + iFeedback->RemoveFeedbackForControl( iListBox ); + } + + if ( iListBox ) + { + delete iListBox; + iListBox = NULL; + } + + if ( iTooltipController ) + { + delete iTooltipController; + iTooltipController = NULL; + } + + if ( iListboxTitle ) + { + delete iListboxTitle; + iListboxTitle = NULL; + } + + if ( iCurrentDescLineArray ) + { + iCurrentDescLineArray->Reset(); + delete iCurrentDescLineArray; + } + + PRINT( _L( "Camera <= ~CCamShootingModeContainer" ) ); + } + +// --------------------------------------------------------- +// CCamShootingModeContainer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void +CCamShootingModeContainer::ConstructL( const TRect& aRect ) + { + PRINT(_L("Camera => CCamShootingModeContainer::ConstructL") ) + + CCamContainerBase::BaseConstructL( aRect ); + + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, + iLayoutAreaRect ); + // layout area rectangle contains the area, where components need to be + // drawn to. the container size is the whole screen, but the layouts are + // for the client area. aRect is the container size that might include or + // might not include statuspane area. calculating area self will + // go around the problem + TInt resource = SelectSummaryResourceL(); + if( 0 <= resource ) + { + ConstructSummaryDetailsFromResourceL( resource ); + } + + TInt scene = 0; + if ( iUserBaseScenes ) + { + scene = ECamSettingItemUserSceneBasedOnScene; + } + else if ( ECamControllerImage == iMode ) + { + scene = ECamSettingItemDynamicPhotoScene; + } + else + { + scene = ECamSettingItemDynamicVideoScene; + } + + // construct the listbox + iListBox = new( ELeave ) CCamSceneListBox( iMode, this, iController ); + iListBox->ConstructL( iController, this, iTitleArray, iDescArray, + iUserBaseScenes ); + iListBox->InitializeL( iController.IntegerSettingValue( scene ) ); + iListBox->SetContainerWindowL( *this ); + iListBox->CreateScrollBarFrameL( ETrue ); + iListBox->DisableSingleClick( ETrue ); + + TRect listboxRect; + if ( CamUtility::IsNhdDevice() ) + { + listboxRect = TouchLayout(); + } + else + { + iCurrentDescLineArray = + new( ELeave ) CArrayFixFlat( KExplTxtGranularity ); + listboxRect = NonTouchLayout(); + } + + // Determine the height of the listbox; + // Height needs to be based on the number of items, because the layout + // height (maxListBoxHeight )might be different + // than combined height of the max visible listbox items + + CEikScrollBarFrame::TScrollBarVisibility visibility = + CEikScrollBarFrame::EOff; + TInt maxListBoxHeight = listboxRect.Height(); + TInt listBoxHeight = iListBox->CalcHeightBasedOnNumOfItems( + iListBox->Model()->NumberOfItems() ); + if ( maxListBoxHeight < listBoxHeight ) + { + // there are more items than would fit to the listbox rectangle + + // the maximum height is the total height of items + // that can fit to the maxlistboxheight + TInt itemHeight = iListBox->ItemHeight(); + TInt itemsVisible = maxListBoxHeight / itemHeight; + listBoxHeight = itemsVisible * itemHeight; + + // the scrollbar needs to be turned on + visibility = CEikScrollBarFrame::EOn; + } + + // calculate the layout for the listbox with changed height + const AknLayoutUtils::SAknLayoutControl listboxLayout = + { ELayoutEmpty, iListboxLayoutRect.Rect().iTl.iX, listboxRect.iTl.iY, + ELayoutEmpty, ELayoutEmpty, + iListboxLayoutRect.Rect().Width(), listBoxHeight }; + + AknLayoutUtils::LayoutControl( iListBox, + iLayoutAreaRect, listboxLayout); + + iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, visibility ); + iListBox->MakeVisible( ETrue ); + iListBox->SetFocus( EFalse, ENoDrawNow ); + iListBox->UpdateScrollBarsL(); + iListBox->ScrollBarFrame()->DrawScrollBarsNow(); + iListBox->SetListBoxObserver(this); + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + appUi->SetActivePaletteVisibility( EFalse ); + + // Prevents the system filling invalidated areas with the background + // colour - helps reduce flicker. + Window().SetBackgroundColor(); + + if ( iMode == ECamControllerImage ) + { + ConstructContainerTitleFromResourceL( R_CAM_STILL_SCENE_SETTING_TITLE ); + } + else + { + ConstructContainerTitleFromResourceL( R_CAM_VIDEO_SCENE_SETTING_TITLE ); + } + + if ( ! iTooltipController ) + { + iTooltipController = CAknInfoPopupNoteController::NewL(); + } + + iTooltipController->SetTimeDelayBeforeShow( KInfoTooltipDelay ); + iTooltipController->SetTimePopupInView( KInfoTooltipDisplayTime ); + + // Position the tooltip + TPoint position; + if ( AknsUtils::GetControlPosition( this, position ) != KErrNone ) + { + position = PositionRelativeToScreen(); + } + TRect rect( position, Size() ); + TPoint center = rect.Center(); + iTooltipController->SetPositionAndAlignment( + TPoint( center.iX, rect.iTl.iY ), EHLeftVBottom ); + + iTooltipController->SetTimeDelayBeforeShow( KInfoTooltipDelay ); + iTooltipController->SetTimePopupInView( KInfoTooltipDisplayTime ); + + iFeedback = MTouchFeedback::Instance(); + if ( iFeedback ) + { + iFeedback->SetFeedbackArea( iListBox, 0, iListBox->Rect(), + ETouchFeedbackBasic, ETouchEventStylusDown ); + } + + PRINT(_L("Camera <= CCamShootingModeContainer::ConstructL") ) + } + + +// --------------------------------------------------------------------------- +// SelectSummaryResourceL +// --------------------------------------------------------------------------- +// +TInt +CCamShootingModeContainer::SelectSummaryResourceL() + { + TInt resourceId = KErrNotSupported; + TBool secondCameraOn = + static_cast( iEikonEnv->AppUi() )->IsSecondCameraEnabled(); + // ------------------------------------------------------- + // Photo mode + if ( ECamControllerImage == iMode ) + { + if ( secondCameraOn ) + { + //Product does not currently support shooting modes for secondary camera photo mode + } + else + { + resourceId = R_CAM_CAPTURE_SETUP_LIST_PHOTO_SHOOTING_MODE_SUMMARY; + } + } + // ------------------------------------------------------- + // Video mode + else + { + if ( secondCameraOn ) + { + //Products do not currently support shooting modes for secondary camera video mode + } + else + { + resourceId = R_CAM_CAPTURE_SETUP_LIST_VIDEO_SHOOTING_MODE_SUMMARY; + } + } + // ------------------------------------------------------- + + return resourceId; + } + + +// --------------------------------------------------------------------------- +// CCamShootingModeContainer::CCamShootingModeContainer +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamShootingModeContainer::CCamShootingModeContainer( + TCamCameraMode aMode, + CCamAppController& aController, + CAknView& aView, + TBool aUserBaseScenes ) +: CCamContainerBase( aController, aView ), + iListBox( NULL ), + iMode( aMode ), + iUserBaseScenes( aUserBaseScenes ), + iTooltipController( NULL ), + iListboxTitle( NULL ), + iTooltipIndex( -1 ), + iActivateOnTouchRelease( EFalse ) + { + } + +// ---------------------------------------------------------------- +// CCamShootingModeContainer::UserSceneHighlighted +// Returns ETrue if the current selected scene is User +// ---------------------------------------------------------------- +// +TBool CCamShootingModeContainer::UserSceneHighlighted() + { + return (CurrentSettingItemValue() == ECamSceneUser ); + } + +// ---------------------------------------------------------------- +// CCamShootingModeContainer::SaveSceneSettingIfChangedL +// Stores the currently selected scene in the dynamic settings model +// if it differs from current scene mode +// ---------------------------------------------------------------- +// +TBool CCamShootingModeContainer::SaveSceneSettingIfChangedL() + { + TInt scene = 0; + if ( iUserBaseScenes ) + { + scene = ECamSettingItemUserSceneBasedOnScene; + } + else if ( ECamControllerImage == iMode ) + { + scene = ECamSettingItemDynamicPhotoScene; + } + else + { + scene = ECamSettingItemDynamicVideoScene; + } + + TInt currentSceneMode = iController.IntegerSettingValue( scene ); + if ( currentSceneMode != CurrentSettingItemValue() ) + { + // The scene mode selection has changed, store new mode + return SaveSceneSettingL(); + } + else + { + // No change, no need to save + return EFalse; + } + } + +// ---------------------------------------------------------------- +// CCamShootingModeContainer::SaveSceneSetting +// Stores the currently selected scene in the dynamic settings model +// ---------------------------------------------------------------- +// +TBool CCamShootingModeContainer::SaveSceneSettingL() + { + TInt scene = 0; + if ( iUserBaseScenes ) + { + scene = ECamSettingItemUserSceneBasedOnScene; + } + else if ( ECamControllerImage == iMode ) + { + scene = ECamSettingItemDynamicPhotoScene; + } + else + { + scene = ECamSettingItemDynamicVideoScene; + } + + iController.SetIntegerSettingValueL( scene, + CurrentSettingItemValue() ); + static_cast( CEikonEnv::Static()->AppUi() )->APHandler()->UpdateActivePaletteL(); + + + // If user selected sports scene from list. + if ( CurrentSettingItemValue() == ECamSceneSports ) + { + // if the selection was for user scene base scene, and user + // scene is active, but request was cancelled, return false. + if ( ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) + == ECamSceneUser ) && + ( iController.IntegerSettingValue( ECamSettingItemUserSceneBasedOnScene ) + != ECamSceneSports ) ) + { + return EFalse; + } + // if the selection was for the photo/video scene, but request was + // cancelled, return false. + if ( ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) + != ECamSceneUser ) && + ( iController.IntegerSettingValue( scene ) != ECamSceneSports ) ) + { + return EFalse; + } + } + // Otherwise, if the user selected user scene from the list, but request + // was cancelled, return false. + else if ( ( CurrentSettingItemValue() + == ECamSceneUser ) && + ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) + != ECamSceneUser ) ) + { + return EFalse; + } + + // Remove lint warning. + else + { + } + + // In all other cases, return true. + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CCamShootingModeContainer::CurrentSettingItemValue +// Returns the Current item's setting value ID +// ----------------------------------------------------------------------------- +TInt CCamShootingModeContainer::CurrentSettingItemValue() const + { + return (static_cast(iListBox->Model())->ItemValue(iListBox->CurrentItemIndex())); + } + +// ----------------------------------------------------------------------------- +// CCamShootingModeContainer::IndexForValueId() const +// Returns the index of the item in the array with the specified ValueId +// ----------------------------------------------------------------------------- +TInt CCamShootingModeContainer::IndexForValueId( TInt aValueId ) const + { + return static_cast( iListBox->Model() )->ValueIndex( aValueId ); + } + +// ----------------------------------------------------------------------------- +// CCamShootingModeContainer::HandleSettingValueUpdateL +// Handles a change to the setting value of the slider +// ----------------------------------------------------------------------------- +// +void CCamShootingModeContainer::HandleSettingValueUpdateL( TInt /*aNewValue*/ ) + { + } + + +// --------------------------------------------------------- +// CCamShootingModeContainer::CountComponentControls +// Returns the number of controls owned +// --------------------------------------------------------- +// +TInt CCamShootingModeContainer::CountComponentControls() const + { + return 1; + } + +// --------------------------------------------------------- +// CCamShootingModeContainer::ComponentControl +// Returns the requested component control +// --------------------------------------------------------- +// +CCoeControl* CCamShootingModeContainer::ComponentControl( TInt /*aIndex*/ ) const + { + return iListBox; + } + +// --------------------------------------------------------- +// CCamShootingModeContainer::Draw +// Draw control +// --------------------------------------------------------- +// +void CCamShootingModeContainer::Draw( const TRect& aRect ) const + { + PRINT(_L("Camera => CCamShootingModeContainer::Draw") ) + + CWindowGc& gc = SystemGc(); + if ( CamUtility::IsNhdDevice() ) + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsDrawUtils::Background( skin, iBgContext, gc, aRect ); + TRgb color; + AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + iTitleTextRectLayout.DrawText( gc, *iListboxTitle, ETrue, color ); + } + else + { + TRAP_IGNORE( DrawSummaryTextL( gc ) ); + } + + + PRINT(_L("Camera <= CCamShootingModeContainer::Draw") ) + } + +// ---------------------------------------------------------------- +// CCamShootingModeContainer::OfferKeyEventL +// Handles this application view's command keys. Forwards other +// keys to child control(s). +// ---------------------------------------------------------------- +// +TKeyResponse CCamShootingModeContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + + iController.StartIdleTimer(); + + // If the Ok button is pressed, select the current item + if ( aKeyEvent.iCode == EKeyOK && aKeyEvent.iRepeats == 0 && aType == EEventKey ) + { + TKeyResponse response = iListBox->OfferKeyEventL( aKeyEvent, aType ); + iView.HandleCommandL( EAknSoftkeySelect ); + return response; + } + TKeyResponse returnvalue = iListBox->OfferKeyEventL( aKeyEvent, aType ); + + // for non touch, we use key presses to scroll thru the scene modes + // for touch with keyboard, key pressing can also scroll thru the scene modes + // after every up and down key presses we display the tool tip + if ( EStdKeyUpArrow == aKeyEvent.iScanCode || + EStdKeyDownArrow == aKeyEvent.iScanCode ) + { + if ( CamUtility::IsNhdDevice() ) + { + ShowTooltipL(); + } + else + { + DrawDeferred(); // Update explanation text + } + } + + return returnvalue; + } + +// ----------------------------------------------------------------- +// CCamShootingModeContainer::ConstructSummaryDetailsFromResourceL +// Sets up the layouts of the summary items +// ----------------------------------------------------------------- +void CCamShootingModeContainer::ConstructSummaryDetailsFromResourceL(TInt aResourceId) + { + // Find the name and path of the MBM file for bitmaps + TFileName mbmFileName; + CamUtility::ResourceFileName( mbmFileName ); + + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResourceId ); + const TInt count = reader.ReadInt16(); + + TInt i = -1; + TInt bitmapId = -1; + TInt summarySceneId = -1; + HBufC16* title = NULL; + HBufC16* descr = NULL; + + // Read all of the summary entries from the resource file + for ( i = 0; i < count; i++ ) + { + summarySceneId = reader.ReadInt16(); + bitmapId = reader.ReadInt32(); + title = reader.ReadHBufC16L(); + descr = reader.ReadHBufC16L(); + + // Only add supported scenes. + if( IsSupportedScene(summarySceneId) ) + { + CFbsBitmap* icon = AknIconUtils::CreateIconL( mbmFileName, bitmapId ); + CleanupStack::PushL( icon ); + User::LeaveIfError( iSummaryBitmapArray.Append( icon ) ); + CleanupStack::Pop( icon ); + + User::LeaveIfError( iTitleArray.Append( title ) ); + if ( summarySceneId == ECamSceneScenery ) + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + if ( appUi && appUi->AppController().UiConfigManagerPtr() + && appUi->AppController().UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + // the description of the icon + HBufC* Description; + TInt description = R_CAM_SCENE_DESCRIPTION_LANDSCAPE_AUTOFOCUS; + Description = StringLoader::LoadL( description ); + User::LeaveIfError( iDescArray.Append( Description ) ); + } + else + { + User::LeaveIfError( iDescArray.Append( descr ) ); + } + } + else + { + User::LeaveIfError( iDescArray.Append( descr ) ); + } + } + else + { + delete title; + title = NULL; + delete descr; + descr = NULL; + } + } + CleanupStack::PopAndDestroy(); // reader + } + + + + + +// ----------------------------------------------------------------- +// IsSupportedScene +// +// Get whether the given scene is supported. +// ----------------------------------------------------------------- +// +TBool +CCamShootingModeContainer::IsSupportedScene( TInt aSceneId ) const + { + // NOTE: + // CamUtility in product changed to return also user scene + // as one of supported scenes. + + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + TBool imageMode = (ECamControllerImage == iMode); + + // Scene must be in supported scenes list. + TBool supported = iController.IsSceneSupported( aSceneId, imageMode ); + + // Still, user scene is never supported in user scene base list. + TBool userException = (ECamSceneUser == aSceneId && iUserBaseScenes ); + + if( supported && !userException ) + { + return ETrue; + } + else + { + return EFalse; + } + } + + // -------------------------------------------------------------------------- +// CCamShootingModeContainer::HandlePointerEventL + // -------------------------------------------------------------------------- + // + void CCamShootingModeContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + + RDebug::Print(_L("CCamShootingModeContainer::HandlePointerEventL iType=%d iPosition=(%d, %d)"), + aPointerEvent.iType, + aPointerEvent.iPosition.iX, + aPointerEvent.iPosition.iY ); + iListBox->HandlePointerEventL(aPointerEvent); + /*TInt oldListItemIndex = -1; + TInt newListItemIndex = -1; + TBool handleItemActivation = EFalse; + + if ( iListBox ) + { + oldListItemIndex = iListBox->CurrentItemIndex(); + } + + // send to coecontrol -> will inform controls in this container about pointer events + // (listbox will handle focus changes and scrolling) + CCoeControl::HandlePointerEventL( aPointerEvent ); + + if ( iListBox ) + { + newListItemIndex = iListBox->CurrentItemIndex(); + } + + // figure out if item was activated by touch down + release combination on same item + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + + if ( iListBox->Rect().Contains( aPointerEvent.iPosition ) ) + { + if ( newListItemIndex != oldListItemIndex ) + { + iActivateOnTouchRelease = EFalse; + } + else + { + // set the current item to be activated on touch release + iActivateOnTouchRelease = ETrue; + } + + // show tooltip always when touch event down happens inside listbox + ShowTooltipL(); + } + else + { + iActivateOnTouchRelease = EFalse; + } + + + } + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + if ( iActivateOnTouchRelease && ( newListItemIndex == oldListItemIndex ) ) + { + // only if list item index has not changed during event + // and iActivateOnTouchRelease is true + TInt pointedItemIndex = 0; + TBool focusableItemPointed = + iListBox->View()->XYPosToItemIndex( aPointerEvent.iPosition, + pointedItemIndex ); + // check that pointer is in focusable area + if ( focusableItemPointed ) + { + handleItemActivation = ETrue; + iActivateOnTouchRelease = EFalse; + } + else + { + iActivateOnTouchRelease = EFalse; + } + } + } + else + { + // aPointerEvent.iType == TPointerEvent::EDrag + + if ( newListItemIndex != oldListItemIndex ) + { + // change only when drag event changes the listitem index + iActivateOnTouchRelease = EFalse; + + // with drag always update the tooltip + ShowTooltipL(); + } + + } + + + if ( handleItemActivation ) + { + + // no need for tooltips anymore + HideCurrentTooltipL(); + + if ( UserSceneHighlighted() ) + { + iView.HandleCommandL( ECamCmdUserSceneSelected ); + } + else + { + iView.HandleCommandL( EAknSoftkeySelect ); + } + } + + */ + } // end of HandlePointerEventL + + +// -------------------------------------------------------------------------- +// CCamShootingModeContainer::ShowTooltipL +// -------------------------------------------------------------------------- +// +void CCamShootingModeContainer::ShowTooltipL() + { + + if ( !iTooltipController || ( iDescArray[iListBox->CurrentItemIndex()]->Length() <= 0 ) ) + { + return; + } + + if ( iTooltipIndex != iListBox->CurrentItemIndex() ) + { + // make sure that possible already open tooltip is hidden + iTooltipController->HideInfoPopupNote(); + iTooltipController->SetTextL( *iDescArray[iListBox->CurrentItemIndex()] ); + iTooltipController->SetPositionByHighlight( iListBox->HighlightRect() ); + + iTooltipIndex = iListBox->CurrentItemIndex(); + } + + iTooltipController->ShowInfoPopupNote(); + } + + +// -------------------------------------------------------------------------- +// CCamShootingModeContainer::HideCurrentTooltipL +// Hides tooltip for the selected listbox item, if one is visible +// -------------------------------------------------------------------------- +// +void CCamShootingModeContainer::HideCurrentTooltipL() + { + + if ( !iTooltipController || ( iDescArray[iListBox->CurrentItemIndex()]->Length() <= 0 ) ) + { + return; + } + + iTooltipController->HideInfoPopupNote(); + + } + + +// -------------------------------------------------------------------------- +// CCamShootingModeContainer::ConstructContainerTitleFromResourceL +// -------------------------------------------------------------------------- +// +void CCamShootingModeContainer::ConstructContainerTitleFromResourceL( TInt aResourceId ) + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResourceId ); // cleanupstack + + iListboxTitle = reader.ReadHBufC16L(); + + CleanupStack::PopAndDestroy(); // reader + } + +// -------------------------------------------------------------------------- +// CCamShootingModeContainer::SelectItem +// -------------------------------------------------------------------------- +// +TBool CCamShootingModeContainer::SelectItem( TInt aItemIndex ) + { + + TInt oldListItemIndex = -1; + TBool returnSelectionSuccess = EFalse; + + if ( iListBox ) + { + oldListItemIndex = iListBox->CurrentItemIndex(); + + if ( oldListItemIndex != aItemIndex ) + { + iListBox->SetCurrentItemIndex( aItemIndex ); + } + else + { + // already selected + returnSelectionSuccess = EFalse; + } + } + else + { + // iListBox == NULL + returnSelectionSuccess = EFalse; + } + + return returnSelectionSuccess; + } + +// ----------------------------------------------------------------- +// CCamShootingModeContainer::DrawSummaryText (Scene settings) +// Draws summary title and description text +// ----------------------------------------------------------------- + +void CCamShootingModeContainer::DrawSummaryTextL( CWindowGc& aGc ) const + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + appUi->SetTitleL( *iListboxTitle ); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsDrawUtils::Background( skin, iBgContext, aGc, Rect() ); + + // Draw summary frame + TRect explTxtRect = iExplanationRect; + TInt border = iExplIconLayout.Rect().iTl.iX - iExplanationRect.iTl.iX; + explTxtRect.Shrink( border/2 , border/2 ); //Magic: half of frame + AknsDrawUtils::DrawFrame( skin, aGc, iExplanationRect, explTxtRect, + KAknsIIDQsnFrInput, KAknsIIDNone ); //frame + + AknIconUtils::SetSize( iSummaryBitmapArray[iListBox->CurrentItemIndex()], + iExplIconLayout.Rect().Size() ); + iExplIconLayout.DrawImage( aGc, + iSummaryBitmapArray[ iListBox->CurrentItemIndex() ], NULL ); + + TRgb explTitleTxtColor; // same as list highlight text + TRgb explTxtColor; // same as main area text + AknsUtils::GetCachedColor( skin, explTitleTxtColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG10 ); + AknsUtils::GetCachedColor( skin, explTxtColor, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + iExplTitleLayout.DrawText( aGc, + iTitleArray[ iListBox->CurrentItemIndex() ]->Des(), + ETrue, explTitleTxtColor ); + AknTextUtils::WrapToArrayL( *iDescArray[iListBox->CurrentItemIndex()], + iExplTxtLinesLayout[0].TextRect().Width(), + *iExplTxtLinesLayout[0].Font(), + *iCurrentDescLineArray ); + TInt lCount = Min( iExplLineCount, iCurrentDescLineArray->Count() ); + for ( TInt i = 0; i < lCount; i++ ) + { + iExplTxtLinesLayout[i].DrawText( aGc, (*iCurrentDescLineArray)[i], + ETrue, explTxtColor ); + } + } + + + +// -------------------------------------------------------------------------- +// CCamShootingModeContainer::TouchLayout +// -------------------------------------------------------------------------- +// +TRect CCamShootingModeContainer::TouchLayout() + { + TRect statusPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, + statusPaneRect ); + iLayoutAreaRect.BoundingRect( statusPaneRect ); + + // get the rect size for listbox in the layout + TAknLayoutRect wholeListboxLayoutRect; + wholeListboxLayoutRect.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset_listscroll_pane( 3 ) ); + + // get layout for the listbox rect + TInt listBoxHeight = iListBox->CalcHeightBasedOnNumOfItems( + iListBox->Model()->NumberOfItems() ); + if ( wholeListboxLayoutRect.Rect().Height() < listBoxHeight ) + { + // if scrollbars are used, use scrollbar layout + iListboxLayoutRect.LayoutRect( wholeListboxLayoutRect.Rect(), + AknLayoutScalable_Apps::main_cset_list_pane( 0 ) ); + AknLayoutUtils::LayoutVerticalScrollBar( iListBox->ScrollBarFrame(), + wholeListboxLayoutRect.Rect(), + AknLayoutScalable_Apps::scroll_pane_cp028( 0 ) ); + } + else + { + iListboxLayoutRect.LayoutRect( wholeListboxLayoutRect.Rect(), + AknLayoutScalable_Apps::main_cset_list_pane( 1 ) ); + } + + // text for the listbox title + iTitleTextRectLayout.LayoutText( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cam_set_pane_t1( 3 ) ); + + return wholeListboxLayoutRect.Rect(); + } + +// -------------------------------------------------------------------------- +// CCamShootingModeContainer::NonTouchLayout (Scene mode) +// -------------------------------------------------------------------------- +// +TRect CCamShootingModeContainer::NonTouchLayout() + { + TAknLayoutRect wholeListboxLayoutRect; + wholeListboxLayoutRect.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset6_listscroll_pane( 3 ) ); + TAknLayoutRect listLayoutRect; + listLayoutRect.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset6_listscroll_pane( 4 ) ); + TInt listBoxHeight = iListBox->CalcHeightBasedOnNumOfItems( + iListBox->Model()->NumberOfItems() ); + if ( wholeListboxLayoutRect.Rect().Height() < listBoxHeight ) + { + // if scrollbars are used, use scrollbar layout + iListboxLayoutRect.LayoutRect( listLayoutRect.Rect(), + AknLayoutScalable_Apps::main_cset_list_pane_copy1( 0 ) ); + AknLayoutUtils::LayoutVerticalScrollBar( iListBox->ScrollBarFrame(), + listLayoutRect.Rect(), + AknLayoutScalable_Apps::scroll_pane_cp028_copy1( 0 ) ); + } + else + { + iListboxLayoutRect.LayoutRect( listLayoutRect.Rect(), + AknLayoutScalable_Apps::main_cset_list_pane_copy1( 1 ) ); + } + + // Explanation ikon, title, and text layout + TAknLayoutRect explParent; + explParent.LayoutRect( iLayoutAreaRect, + AknLayoutScalable_Apps::main_cset6_text2_pane( 0 ) ); + TAknLayoutRect explLayoutRect; + explLayoutRect.LayoutRect( explParent.Rect(), + AknLayoutScalable_Apps::bg_popup_preview_window_pane_cp03( 0 ) ); + iExplanationRect = explLayoutRect.Rect(); + + iExplIconLayout.LayoutRect( iExplanationRect, + AknLayoutScalable_Apps::main_cset6_text2_pane_g1( 0 ) ); + iExplTitleLayout.LayoutText( iExplanationRect, + AknLayoutScalable_Apps::main_cset6_text2_pane_t1( 0 ) ); + iExplTitleLayout.LayoutText( iExplanationRect, + AknLayoutScalable_Apps::main_cset6_text2_pane_t1( 0 ) ); + + TAknLayoutRect explTxtParent; + explTxtParent.LayoutRect( iExplanationRect, + AknLayoutScalable_Apps::list_cset_text2_pane(0) ); + TAknLayoutScalableParameterLimits listLimits = + AknLayoutScalable_Apps::list_cset_text2_pane_t1_ParamLimits( 0 ); + iExplLineCount = listLimits.LastRow() + 1; + for ( TInt i = 0; i < iExplLineCount; i++ ) + { + TAknLayoutText layoutText; + layoutText.LayoutText( explTxtParent.Rect(), + AknLayoutScalable_Apps::list_cset_text2_pane_t1( 0, 0, i ) ); + (void) iExplTxtLinesLayout.Append( layoutText ); // Errors are ignored + } + + TRect ret = wholeListboxLayoutRect.Rect(); + // Non-touch has a visible title & status panes + TRect titlePaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::ETitlePane, + titlePaneRect ); + ret.Move( 0, -titlePaneRect.Height() ); + return ret; + } + +// -------------------------------------------------------------------------- +// CCamShootingModeContainer::HandleListBoxEventL +// Handles Listbox events +// -------------------------------------------------------------------------- +// + +void CCamShootingModeContainer::HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ) + { + switch( aEventType ) + { + case EEventEnterKeyPressed: + case EEventItemDoubleClicked: + case EEventItemSingleClicked: + { + HideCurrentTooltipL(); + if ( UserSceneHighlighted() ) + { + iView.HandleCommandL( ECamCmdUserSceneSelected ); + } + else + { + iView.HandleCommandL( EAknSoftkeySelect ); + } + } + break; + + case EEventItemClicked: + { + ShowTooltipL(); + } + break; + default: + break; + } + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamSidePane.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamSidePane.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1044 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Side Pane control* +*/ + + +// INCLUDE FILES +#include + +#include +#include // For CCoeAppUiBase +#include // For CEikApplication + +#include +#include +#include +#include +#include +#include +#include "CamAppUiBase.h" +#include "CamAppUi.h" + +#include "CamAppController.h" +#include "CamSidePane.h" + +#include "CamIndicator.h" +#include "CamIndicatorData.h" +#include "CamIndicatorResourceReader.h" +#include "CamTimer.h" +#include "CamSelfTimer.h" +#include "CamLogger.h" +#include "CamSettings.hrh" +#include "CamUtility.h" +#include "CameraUiConfigManager.h" +#include "Cam.hrh" + + +// CONSTANTS + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamSidePane::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamSidePane* CCamSidePane::NewL( CCamAppController& aController, + TBool aOverlayViewFinder ) + { + CCamSidePane* self = new( ELeave ) CCamSidePane( aController, + aOverlayViewFinder ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// Destructor +CCamSidePane::~CCamSidePane() + { + PRINT( _L("Camera => ~CCamSidePane") ); + RemoveObservers(); + CCamSidePane::UnloadResourceData(); + PRINT( _L("Camera <= ~CCamSidePane") ); + } + +// --------------------------------------------------------- +// CCamSidePane::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamSidePane::ConstructL() + { + LoadResourceDataL(); + + // side pane is a controller, self timer and burst mode observer + RegisterObserversL(); + iVisible = ETrue; + + UpdateLayout(); + } + +// ----------------------------------------------------------------------------- +// CCamSidePane::LoadResourceDataL() +// Reads in all information needed from resources +// ----------------------------------------------------------------------------- +// +void CCamSidePane::LoadResourceDataL() + { + TResourceReader reader; + CEikonEnv* eikEnv = CEikonEnv::Static(); + eikEnv->CreateResourceReaderLC( reader, ROID(R_CAM_SIDEPANE_ID)); + + // create reader + CCamIndicatorResourceReader* resourceReader = + CCamIndicatorResourceReader::NewLC( reader ); + // get indicator data from reader + CArrayPtrFlat& indArray = resourceReader->IndicatorData(); + + // set up indicator data + TInt numindicators = indArray.Count(); // number of indicators + TInt numbitmaps = 0; + CCamIndicator* indicator = NULL; + + TInt i = 0; + + for ( i = 0; i < ECamIndicatorTotal; i++ ) + { + User::LeaveIfError( iIndicators.Append( static_cast(NULL) ) ); + } + + for ( i = 0; i < numindicators; i++ ) + { + CCamIndicatorData& indData = *( indArray.At( i ) ); + indicator = CCamIndicator::NewL( indData.IndicatorRect() ); + CleanupStack::PushL( indicator ); + numbitmaps = indData.IndicatorBitmapCount(); // no of bitmaps for indicator + TInt j; + for ( j = 0; j < numbitmaps; j++ ) + { + // side pane assumes that mask bitmap is defined after the + // normal one in the resource file + indicator->AddIconL( indData.IndicatorBitmapId( j ), // bitmap + indData.IndicatorBitmapId( j + 1 )); // mask + j++; // increment past the mask + } + iIndicators[indData.IndicatorId()] = indicator; + CleanupStack::Pop( indicator ); + } + + CleanupStack::PopAndDestroy( resourceReader ); + CleanupStack::PopAndDestroy(); // reader + } + +// ----------------------------------------------------------------------------- +// CCamSidePane::ReloadResourceDataL() +// Refreshes all resource-based information stored in the class +// ----------------------------------------------------------------------------- +// +void CCamSidePane::ReloadResourceDataL() + { + UnloadResourceData(); + LoadResourceDataL(); + } + +// ----------------------------------------------------------------------------- +// CCamSidePane::UnloadResourceData() +// Frees all dynamic resources allocated in LoadResourceDataL +// ----------------------------------------------------------------------------- +// +void CCamSidePane::UnloadResourceData() + { + iIndicators.ResetAndDestroy(); + iIndicators.Close(); + } + +// --------------------------------------------------------------------------- +// CCamSidePane::CCamSidePane +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamSidePane::CCamSidePane( CCamAppController& aController, + TBool aOverlayViewFinder ) +: iController( aController ), + iOverlayViewFinder( aOverlayViewFinder ) + { + } + +// --------------------------------------------------------- +// CCamSidePane::HandleControllerEventL +// Handle an event from CCamAppController. +// --------------------------------------------------------- +// +void CCamSidePane::HandleControllerEventL( + TCamControllerEvent aEvent, TInt /* aError */ ) + { + switch ( aEvent ) + { + case ECamEventFlashStateChanged: + { + if ( iIndicators[ECamIndicatorFlash] + && iMode != ECamControllerVideo + && !IsSecondaryCameraEnabled() + ) + { + TCamFlashId flash = static_cast< TCamFlashId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoFlash ) ); + switch ( flash ) + { + case ECamFlashAuto: + { + iIndicators[ECamIndicatorFlash]->SetIcon( 0 ); + } + break; + case ECamFlashOff: + { + iIndicators[ECamIndicatorFlash]->SetIcon( 2 ); + } + break; + case ECamFlashAntiRedEye: + { + iIndicators[ECamIndicatorFlash]->SetIcon( 4 ); + } + break; + case ECamFlashForced: + { + iIndicators[ECamIndicatorFlash]->SetIcon( 6 ); + } + break; + default: + break; + } + iIndicators[ECamIndicatorFlash]->SetFlashing( EFalse ); + } + else + { + // empty statement to remove Lint error. + } + + if ( iController.UiConfigManagerPtr()->IsVideoLightSupported() ) + { + if ( iIndicators[ECamIndicatorVideoFlash] + && iMode == ECamControllerVideo + && !IsSecondaryCameraEnabled() + ) + { + TCamFlashId flash = static_cast< TCamFlashId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicVideoFlash ) ); + switch ( flash ) + { + case ECamFlashOff: + { + iIndicators[ECamIndicatorVideoFlash]->SetIcon( 0 ); + } + break; + case ECamFlashForced: + { + iIndicators[ECamIndicatorVideoFlash]->SetIcon( 2 ); + } + break; + default: + break; + } + iIndicators[ECamIndicatorVideoFlash]->SetFlashing( EFalse ); + } + else + { + // empty statement to remove Lint error. + } + } + } // end case statement + break; + case ECamEventSceneStateChanged: + { + if ( iMode == ECamControllerVideo ) + { + SetVideoSceneIndicator(); + } + else + { + SetPhotoSceneIndicator(); + } + } + break; + + case ECamEventCameraChanged: + { + if ( !IsSecondaryCameraEnabled() ) + { + if ( iMode == ECamControllerVideo ) + { + SetVideoSceneIndicator(); + if ( !iController.UiConfigManagerPtr()->IsVideoLightSupported() ) + { + if ( iIndicators[ECamIndicatorFlash] ) + { + iIndicators[ECamIndicatorFlash]->ClearIcon(); + } + } + } + else + { + SetPhotoSceneIndicator(); + if ( !iController.UiConfigManagerPtr()->IsVideoLightSupported() ) + { + if ( iIndicators[ECamIndicatorFlash] ) + { + iIndicators[ECamIndicatorFlash]->DisplayIcon(); + } + } + } + } + } + break; + +#ifdef PRODUCT_USES_GENERIC_SETUP_INDICATOR +#ifndef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR + case ECamEventSetupStateChanged: + { + SetGenericSetupIndicator(); + } + break; +#endif // !PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR +#endif // PRODUCT_USES_GENERIC_SETUP_INDICATOR + + case ECamEventVideoStabChanged: + { + if ( iController.UiConfigManagerPtr()->IsVideoStabilizationSupported() ) + { + SetVideoStabilisationIndicator(); + } + break; + } + + case ECamEventFaceTrackingStateChanged: + { + if ( iController.UiConfigManagerPtr()->IsFaceTrackingSupported() ) + { + SetFaceTrackingIndicator(); + } + break; + } + + default: + break; + } + } + + +// ----------------------------------------------------------------------------- +// CCamSidePane::IsVisible +// Is the side pane invisible +// ----------------------------------------------------------------------------- +// +TBool CCamSidePane::IsVisible() + { + return iVisible; + } + +// ----------------------------------------------------------------------------- +// CCamSidePane::MakeVisible +// Makes the side pane visible +// ----------------------------------------------------------------------------- +// +void CCamSidePane::MakeVisible( TBool aVisible ) + { + iVisible = aVisible; + } + +// ---------------------------------------------------- +// CCamSidePane::Draw +// Draws side pane indicators +// ---------------------------------------------------- +// +void CCamSidePane::Draw( CBitmapContext& aGc ) const + { + // if not overlaying the viewfinder then + // just clear the side pane area + if ( !iOverlayViewFinder ) + { + aGc.Clear( iRect ); + } + TInt numIndicators = iIndicators.Count(); + TInt i; + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + if ( appUi ) + { + appUi->DrawPreCaptureCourtesyUI(); + } + + for ( i = 0; i < numIndicators; i++ ) + { + if ( iIndicators[i] ) + { + iIndicators[i]->Draw( aGc ); + } + } + } + + +// ---------------------------------------------------- +// CCamSidePane::SetRect +// Sets rect to draw into +// ---------------------------------------------------- +// +void +CCamSidePane::SetRect( TRect& aRect ) + { + iRect.SetRect( aRect.iTl, aRect.iBr ); + } + + +// ---------------------------------------------------- +// CCamSidePane::SetCaptureMode +// Sets rect to draw into +// ---------------------------------------------------- +// +void +CCamSidePane::SetCaptureMode( TCamCameraMode aMode ) + { + iMode = aMode; + SetInitialState(); + } + +// ---------------------------------------------------- +// CCamSidePane::SetInitialState +// Notification that the burst mode has been activated/deactivated +// ---------------------------------------------------- +// +void CCamSidePane::SetInitialState() + { + CCamAppUiBase* appUi = + static_cast( CEikonEnv::Static()->AppUi() ); + + // set up indicator data + TInt numindicators = iIndicators.Count(); // number of indicators + // set initial state for each indicator + for ( TInt i = 0; i < numindicators; i++ ) + { + if ( iIndicators[i] ) + { + switch( i ) + { + // ------------------------------------------------- + // Scene indicator + case ECamIndicatorScene: + { + if( ECamControllerVideo == iMode ) + SetVideoSceneIndicator(); + else + SetPhotoSceneIndicator(); + break; + } + // ------------------------------------------------- + // Flash indicator + case ECamIndicatorFlash: + { + // don't show the icon if in video mode or the second + // camera is active + // second camera doesn't support flash + if ( ECamControllerVideo == iMode + || IsSecondaryCameraEnabled() + ) + { + iIndicators[ECamIndicatorFlash]->ClearIcon(); + } + else + { + TInt iconIndex = GetFlashIconIndex( iMode ); + if( KErrNotFound != iconIndex ) + { + iIndicators[ECamIndicatorFlash]->SetIcon( iconIndex ); + } + } + break; + } + // ------------------------------------------------- + // Video Flash indicator + case ECamIndicatorVideoFlash: + { + // don't show the icon if in video mode or the second + // camera is active + // second camera doesn't support flash + if ( iController.UiConfigManagerPtr()->IsVideoLightSupported() ) + { + if ( ECamControllerVideo != iMode + || IsSecondaryCameraEnabled() + ) + { + iIndicators[ECamIndicatorVideoFlash]->ClearIcon(); + } + else + { + TInt iconIndex = GetFlashIconIndex( iMode ); + if( KErrNotFound != iconIndex ) + { + iIndicators[ECamIndicatorVideoFlash]->SetIcon( iconIndex ); + } + } + } + break; + } + // ------------------------------------------------- + // Burst mode indicator + case ECamIndicatorBurstMode: + { + if ( appUi && appUi->IsBurstEnabled() ) + { + iIndicators[ECamIndicatorBurstMode]->SetIcon( 0 ); + } + else + { + iIndicators[ECamIndicatorBurstMode]->ClearIcon(); + } + break; + } + // ------------------------------------------------- + // Self timer indicator + case ECamIndicatorSelfTimer: + { + iIndicators[ECamIndicatorSelfTimer]->ClearIcon(); + break; + } + // ------------------------------------------------- + case ECamIndicatorVideoStabiliser: + { + if ( iController.UiConfigManagerPtr()->IsVideoStabilizationSupported() ) + { + SetVideoStabilisationIndicator(); + } + else + { + iIndicators[ECamIndicatorVideoStabiliser]->ClearIcon(); + } + break; + } + // ------------------------------------------------- + case ECamIndicatorFaceTracking: + { + if ( iController.UiConfigManagerPtr()->IsFaceTrackingSupported() ) + { + SetFaceTrackingIndicator(); + } + else + { + iIndicators[ECamIndicatorFaceTracking]->ClearIcon(); + } + break; + } + // ------------------------------------------------- + case ECamIndicatorCaptureMode: + { + if( appUi && !appUi->IsSecondCameraEnabled() || + appUi && appUi->IsQwerty2ndCamera() ) + { + if ( ECamControllerVideo == iMode ) + { + iIndicators[ECamIndicatorCaptureMode]->SetIcon( 2 ); + } + else + iIndicators[ECamIndicatorCaptureMode]->SetIcon( 0 ); + } + else + iIndicators[ECamIndicatorCaptureMode]->ClearIcon(); + break; + } + // ------------------------------------------------- + // other indicators + default: + { + iIndicators[i]->ClearIcon(); + break; + } + // ------------------------------------------------- + } // switch + } + } // for + } + + +// --------------------------------------------------------------------------- +// GetFlashIconIndex +// --------------------------------------------------------------------------- +// +TInt +CCamSidePane::GetFlashIconIndex( const TCamCameraMode& aMode ) + { + TInt index( KErrNotFound ); + if( ECamControllerVideo == aMode ) + { + TCamFlashId flashId = + static_cast( + iController.IntegerSettingValue( ECamSettingItemDynamicVideoFlash ) ); + switch ( flashId ) + { + case ECamFlashOff: index = 0; break; + case ECamFlashForced: index = 2; break; + default: break; + } + } + else + { + TCamFlashId flashId = + static_cast ( + iController.IntegerSettingValue( ECamSettingItemDynamicPhotoFlash ) ); + + switch ( flashId ) + { + case ECamFlashAuto: index = 0; break; + case ECamFlashOff: index = 2; break; + case ECamFlashAntiRedEye: index = 4; break; + case ECamFlashForced: index = 6; break; + + default: break; + } + } + return index; + } + + +// ---------------------------------------------------- +// CCamSidePane::RegisterObserversL +// Register with observed classes +// ---------------------------------------------------- +// +void CCamSidePane::RegisterObserversL() + { + CEikonEnv* eikEnv = CEikonEnv::Static(); + CCamAppUi* appUi = static_cast( eikEnv->AppUi() ); + + if ( appUi ) + { +// burst mode icon is displayed in either the navipane or sidepane +#ifndef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + // Register as burst mode observer + appUi->AddBurstModeObserverL( this ); +#endif // !PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + } + // Register as controller observer + iController.AddControllerObserverL( this ); + } + +// ---------------------------------------------------- +// CCamSidePane::RemoveObservers +// Dergister with observed classes +// ---------------------------------------------------- +// +void CCamSidePane::RemoveObservers() + { + iController.RemoveControllerObserver( this ); + // if shutting down then self timer will remove the observer + if ( !iController.IsInShutdownMode() ) + { + CEikonEnv* eikEnv = CEikonEnv::Static(); + CCamAppUi* appUi = static_cast( eikEnv->AppUi() ); + if ( appUi ) + { +// burst mode icon is displayed in either the navipane or sidepane +#ifndef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + // Deregister as burst mode observer + appUi->RemoveBurstModeObserver( this ); +#endif // !PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + } + } + } + +#ifdef PRODUCT_USES_GENERIC_SETUP_INDICATOR +#ifndef PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR +// ---------------------------------------------------- +// CCamSidePane::SetDefaultSetupIndicator +// Sets the default setup indicator depending on the +// current setup settings. +// ---------------------------------------------------- +// +void CCamSidePane::SetGenericSetupIndicator() + { + if ( iIndicators[ECamIndicatorGenericSetup] ) + { + // If the current mode is video and the video setup settings + // are generic to the current video scene then do not show + // the generic setup tampered indicator. + if ( ( iMode == ECamControllerVideo ) && + ( iController.VideoSceneDefaultsAreSet() ) ) + { + iIndicators[ECamIndicatorGenericSetup]->ClearIcon(); + } + // Otherwise, if the current mode is photo and the photo setup settings + // are generic to the current photo scene then do not show + // the generic setup tampered indicator. + else if ( ( iMode != ECamControllerVideo ) && + ( iController.PhotoSceneDefaultsAreSet() ) ) + { + iIndicators[ECamIndicatorGenericSetup]->ClearIcon(); + } + // Otherwise do not show the indicator. + else + { + iIndicators[ECamIndicatorGenericSetup]->SetIcon( 0 ); + } + } + } +#endif // !PRODUCT_SUPPORTS_NAVIPANE_GENERIC_SETUP_INDICATOR +#endif // PRODUCT_USES_GENERIC_SETUP_INDICATOR + + +// ---------------------------------------------------- +// CCamSidePane::SetVideoStabilisationIndicator +// Sets the image stabilisation indicator for video capture mode +// ---------------------------------------------------- +// +void CCamSidePane::SetVideoStabilisationIndicator() + { + if ( iController.UiConfigManagerPtr()->IsVideoStabilizationSupported() ) + { + if ( iIndicators[ECamIndicatorVideoStabiliser] ) + { + TCamSettingsOnOff stabilisation = static_cast< TCamSettingsOnOff > + ( iController.IntegerSettingValue( ECamSettingItemVideoStab ) ); + + // If the current mode is video + if ( stabilisation == ECamSettOn && + iMode == ECamControllerVideo && + !IsSecondaryCameraEnabled() ) + { + iIndicators[ECamIndicatorVideoStabiliser]->SetIcon( 0 ); + } + // Otherwise, draw nothing. + else + { + iIndicators[ECamIndicatorVideoStabiliser]->ClearIcon(); + } + } + } + } + +// ---------------------------------------------------- +// CCamSidePane::SetFaceTrackingIndicator +// Sets the facetracking indicator for video capture mode +// ---------------------------------------------------- +// +void CCamSidePane::SetFaceTrackingIndicator() + { + if ( iController.UiConfigManagerPtr()->IsFaceTrackingSupported() ) + { + if ( iIndicators[ECamIndicatorFaceTracking] ) + { + TCamSettingsOnOff facetracking = static_cast< TCamSettingsOnOff > + ( iController.IntegerSettingValue( ECamSettingItemFaceTracking ) ); + + // If the current mode is still image + if ( facetracking == ECamSettOn && iMode == ECamControllerImage && !IsSecondaryCameraEnabled() ) + { + iIndicators[ECamIndicatorFaceTracking]->SetIcon( 0 ); + } + // Otherwise, draw nothing. + else + { + iIndicators[ECamIndicatorFaceTracking]->ClearIcon(); + } + } + } + } + +// ---------------------------------------------------- +// CCamSidePane::SetVideoSceneIndicator +// Set the scene indicator depending on the current video scene setting +// ---------------------------------------------------- +// +void CCamSidePane::SetVideoSceneIndicator() + { + if ( iIndicators[ECamIndicatorScene] ) + { + TCamSceneId scene = static_cast< TCamSceneId > ( + iController.IntegerSettingValue( ECamSettingItemDynamicVideoScene ) ); + switch ( scene ) + { + case ECamSceneNormal: + { + iIndicators[ECamIndicatorScene]->SetIcon( 0 ); + } + break; + case ECamSceneNight: + { + iIndicators[ECamIndicatorScene]->SetIcon( 2 ); + } + break; + case ECamSceneUser: + { + iIndicators[ECamIndicatorScene]->SetIcon( 4 ); + } + break; + default: + { + iIndicators[ECamIndicatorScene]->ClearIcon(); + } + break; + } + } + } + +// ---------------------------------------------------- +// CCamSidePane::SetPhotoSceneIndicator +// Set the scene indicator depending on the current photo scene setting +// ---------------------------------------------------- +// +void CCamSidePane::SetPhotoSceneIndicator() + { + if ( iIndicators[ECamIndicatorScene] ) + { + TCamSceneId scene = static_cast< TCamSceneId > ( + iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) ); + switch ( scene ) + { + case ECamSceneAuto: + { + iIndicators[ECamIndicatorScene]->SetIcon( 4 ); + } + break; + case ECamSceneUser: + { + iIndicators[ECamIndicatorScene]->SetIcon( 6 ); + } + break; + case ECamSceneMacro: + { + iIndicators[ECamIndicatorScene]->SetIcon( 8 ); + } + break; + case ECamScenePortrait: + { + iIndicators[ECamIndicatorScene]->SetIcon( 10 ); + } + break; + case ECamSceneScenery: + { + iIndicators[ECamIndicatorScene]->SetIcon( 12 ); + } + break; + case ECamSceneNight: + { + iIndicators[ECamIndicatorScene]->SetIcon( 14 ); + } + break; + case ECamSceneSports: + { + iIndicators[ECamIndicatorScene]->SetIcon( 16 ); + } + break; + case ECamSceneNightScenery: + { + iIndicators[ECamIndicatorScene]->SetIcon( 22 ); + } + break; + case ECamSceneNightPortrait: + { + iIndicators[ECamIndicatorScene]->SetIcon( 24 ); + } + break; + case ECamSceneCandlelight: + { + iIndicators[ECamIndicatorScene]->SetIcon( 26 ); + } + break; + default: + { + iIndicators[ECamIndicatorScene]->ClearIcon(); + } + break; + } + } + } + +// ---------------------------------------------------- +// CCamSidePane::BurstModeActiveL +// Notification that the burst mode has been activated/deactivated +// ---------------------------------------------------- +// +// Burst mode icon is displayed in either the navipane or sidepane +#ifndef PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE +void CCamSidePane::BurstModeActiveL( TBool aActive, TBool /*aStillModeActive*/ ) + { + if ( iIndicators[ECamIndicatorBurstMode] ) + { + // If burst mode has been activated + if ( aActive ) + { + iIndicators[ECamIndicatorBurstMode]->SetIcon( 0 ); + } + else // otherwise, burst mode has been deactivated + { + iIndicators[ECamIndicatorBurstMode]->ClearIcon(); + } + } + } +#endif // !PRODUCT_SUPPORTS_NAVIPANE_SEQUENCE + +// ---------------------------------------------------- +// CCamSidePane::IsSecondaryCameraEnabled +// Checks if the secondary camera is enabled +// ---------------------------------------------------- +// +TBool CCamSidePane::IsSecondaryCameraEnabled() const + { + return static_cast( + CEikonEnv::Static()->AppUi() )->IsSecondCameraEnabled(); + } + +// ---------------------------------------------------- +// CCamSidePane::UpdateLayout +// ---------------------------------------------------- +// +void CCamSidePane::UpdateLayout() + { + if ( CamUtility::IsNhdDevice() ) + { + TouchLayout(); + } + else + { + NonTouchLayout(); + } + } + +// ---------------------------------------------------- +// CCamSidePane::NonTouchLayout +// ---------------------------------------------------- +void CCamSidePane::NonTouchLayout() const + { + TRect rect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, rect ); + TInt cba = AknLayoutUtils::CbaLocation() == + AknLayoutUtils::EAknCbaLocationLeft; + TAknLayoutRect parent; + parent.LayoutRect( rect, AknLayoutScalable_Apps::cam6_mode_pane( cba ) ); + + // update coords for each indicator + for ( TInt i = 0; i < iIndicators.Count(); i++ ) + { + TAknLayoutRect l; + if ( iIndicators[i] ) + { + switch ( i ) + { + case ECamIndicatorCaptureMode: + { + l.LayoutRect( parent.Rect(), + AknLayoutScalable_Apps::cam6_mode_pane_g1( cba ) ); + iIndicators[i]->SetRect( l.Rect() ); + break; + } + case ECamIndicatorBurstMode: + { + l.LayoutRect( parent.Rect(), + AknLayoutScalable_Apps::cam6_mode_pane_g2( cba ) ); + iIndicators[i]->SetRect( l.Rect() ); + break; + } + case ECamIndicatorImageShakeWarning: + { + l.LayoutRect( parent.Rect(), + AknLayoutScalable_Apps::cam6_mode_pane_g3( cba ) ); + iIndicators[i]->SetRect( l.Rect() ); + break; + } + case ECamIndicatorVideoStabiliser: + { + l.LayoutRect( parent.Rect(), + AknLayoutScalable_Apps::cam6_mode_pane_g3( cba ) ); + iIndicators[i]->SetRect( l.Rect() ); + break; + } + case ECamIndicatorFaceTracking: + { + l.LayoutRect( parent.Rect(), + AknLayoutScalable_Apps::cam6_mode_pane_g4( cba ) ); + iIndicators[i]->SetRect( l.Rect() ); + break; + } + default: + { + break; + } + } + } + } + } + +// --------------------------------------------------------------------------- +// CCamSidePane::TouchLayout +// --------------------------------------------------------------------------- +void CCamSidePane::TouchLayout() const + { + TSize screenSize; + AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, screenSize ); + TRect rect( TPoint(), screenSize ); + TInt variant = Layout_Meta_Data::IsLandscapeOrientation(); + + // update coords for each indicator + for ( TInt i = 0; i < iIndicators.Count(); i++ ) + { + TAknLayoutRect l; + if ( iIndicators[i] ) + { + switch ( i ) + { + case ECamIndicatorCaptureMode: + { + l.LayoutRect( rect, + AknLayoutScalable_Apps::main_camera4_pane_g1( variant ) ); + iIndicators[i]->SetRect( l.Rect() ); + break; + } + case ECamIndicatorBurstMode: + { + l.LayoutRect( rect, + AknLayoutScalable_Apps::main_camera4_pane_g2( variant ) ); + iIndicators[i]->SetRect( l.Rect() ); + break; + } + case ECamIndicatorImageShakeWarning: + { + l.LayoutRect( rect, + AknLayoutScalable_Apps::main_camera4_pane_g3( variant ) ); + iIndicators[i]->SetRect( l.Rect() ); + break; + } + case ECamIndicatorVideoStabiliser: + { + l.LayoutRect( rect, + AknLayoutScalable_Apps::main_video4_pane_g5( variant ) ); + iIndicators[i]->SetRect( l.Rect() ); + break; + } + case ECamIndicatorFaceTracking: + { + l.LayoutRect( rect, + AknLayoutScalable_Apps::main_camera4_pane_g6( variant ) ); + iIndicators[i]->SetRect( l.Rect() ); + break; + } + default: + { + break; + } + } + } + } + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamSoundPlayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamSoundPlayer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,536 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles the playing of sounds and tones for the Camera App* +*/ + + + +// INCLUDE FILES +#include //CAknKeySoundSystem + +#include +#include + +#include +#include +#include +#include + +#include "CamSoundPlayer.h" +#include "Cam.hrh" +#include "camutility.h" + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +#if 0 // Old constants that may be used again in the future +const TInt KCamInCallToneHz = 1760; +const TInt KCamInCallToneLen= 450000; +_LIT( KCamSelfTimerSoundFile , "z:\\system\\sounds\\simple\\cameraappSelfTimer.rng" ); +#endif + +const TReal32 KCamInCallToneVol = 0.75f; + +_LIT( KCamAutoFocusComplete, "z:\\system\\sounds\\digital\\cameraappFocusSucc.wav" ); +//_LIT( KCamAutoFocusFailed, "c:\\system\\sounds\\digital\\focus2.wav" ); NOT DEFINED YET + + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamSoundPlayer::CCamSoundPlayer +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamSoundPlayer::CCamSoundPlayer( MCamSoundPlayerObserver* aObs ) + { + iObserver = aObs; + } + +// ----------------------------------------------------------------------------- +// CCamSoundPlayer::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamSoundPlayer::ConstructL() + { + iAudioPlayer = CMdaAudioPlayerUtility::NewL( *this, + KAudioPriorityCameraTone, + TMdaPriorityPreference( KAudioPrefCamera ) ); + + iTonePlayer = CMdaAudioToneUtility::NewL( *this, + NULL, + KAudioPriorityVideoRecording, + TMdaPriorityPreference( KAudioPrefCamera ) ); + } + +// ----------------------------------------------------------------------------- +// CCamSoundPlayer::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamSoundPlayer* CCamSoundPlayer::NewL( MCamSoundPlayerObserver* aObs ) + { + CCamSoundPlayer* self = new( ELeave ) CCamSoundPlayer( aObs ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::~CCamSoundPlayer +// Destructor +// --------------------------------------------------------------------------- +// +CCamSoundPlayer::~CCamSoundPlayer() + { + PRINT( _L("Camera => ~CCamSoundPlayer") ); + if ( iAudioPlayer ) + { + iAudioPlayer->Close(); + delete iAudioPlayer; + } + + CancelTonePlayer(); + delete iTonePlayer; + PRINT( _L("Camera <= ~CCamSoundPlayer") ); + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::InitialiseL +// Initialize sound player. +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::InitialiseL() + { + if ( iInitialised ) + { + return; + } + + iKeySoundSystem = static_cast( CEikonEnv::Static()->AppUi() )->KeySounds(); + + if ( !iKeySoundSystem ) + { + return; + } + + TRAPD( error, iKeySoundSystem->AddAppSoundInfoListL( R_CAM_SOUND_LIST ) ); + + if ( error && error != KErrAlreadyExists ) + { + User::Leave( error ); + } + + iInitialised = ETrue; + } + + + +// ----------------------------------------------------------------------------- +// CCamSoundPlayer::PlaySound +// Plays the requested sound +// ----------------------------------------------------------------------------- +// +void CCamSoundPlayer::PlaySound( TCamSoundId aSoundId, + TBool aEnableCallback ) + { + PRINT( _L("Camera => CCamSoundPlayer::PlaySound") ); + + // Get into a known state before we begin + switch( aSoundId ) + { + case ECamVideoStartSoundId: + { + StartPlaySound( KCamVideoStartTone(), aEnableCallback ); + break; + } + + case ECamVideoStopSoundId: + { + StartPlaySound( KCamVideoStopTone(), aEnableCallback ); + break; + } + + case ECamVideoPauseSoundId: + { + StartPlaySound( KCamVideoPauseTone(), aEnableCallback ); + break; + } + + case ECamVideoResumeSoundId: + { + StartPlaySound( KCamVideoStartTone(), aEnableCallback ); + break; + } + + case ECamAutoFocusFailed: + { + PRINT( _L("Camera <> PlaySound - ECamAutoFocusFailed") ); + // Do nothing as no failed WAV sound has been specified + break; + } + + case ECamAutoFocusComplete: + { + PRINT( _L("Camera <> PlaySound - ECamAutoFocusComplete") ); + StartPlaySound( KCamAutoFocusComplete(), aEnableCallback ); + break; + } + + case ECamStillCaptureSoundId1: + { + StartPlaySound( KCamCaptureTone1(), aEnableCallback ); + break; + } + + case ECamStillCaptureSoundId2: + { + StartPlaySound( KCamCaptureTone2(), aEnableCallback ); + break; + } + + case ECamStillCaptureSoundId3: + { + StartPlaySound( KCamCaptureTone3(), aEnableCallback ); + break; + } + + case ECamStillCaptureSoundId4: + { + StartPlaySound( KCamCaptureTone4(), aEnableCallback ); + break; + } +#if 0 + case ECamInCallToneId: + { + PlayTone( KCamInCallToneHz, KCamInCallToneLen, KCamInCallToneVol, aEnableCallback ); + break; + } +#endif + + default: + { + // Other sounds are played using the key sound system +#if !( defined(__WINS__) || defined(__WINSCW__) ) +#if 0 + iKeySoundSystem->PlaySound( aSoundId ); +#endif +#endif + iEnableCallback = EFalse; + break; + } + } + PRINT( _L("Camera <= CCamSoundPlayer::PlaySound") ); + } + +// ----------------------------------------------------------------------------- +// CCamSoundPlayer::PlayTone +// Plays the requested tone +// ----------------------------------------------------------------------------- +// +void CCamSoundPlayer::PlayTone( TInt aToneHz, TInt aLenMicSec, TReal32 aVolume, TBool aEnableCallback ) + { + if ( !iOpenFileInProgress ) + { + iOpenFileInProgress = ETrue; + TInt64 len = aLenMicSec; + iTonePlayer->PrepareToPlayTone( aToneHz, TTimeIntervalMicroSeconds( len ) ); + iTonePlayer->SetVolume( static_cast( aVolume * iTonePlayer->MaxVolume() ) ); + } + else + { + if ( iEnableCallback ) + { + iObserver->PlaySoundComplete(); + iEnableCallback = EFalse; + } + } + + iEnableCallback = aEnableCallback; + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::StartPlaySound +// Starts the opening (and playback) of specified wav file +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::StartPlaySound( const TDesC& aFile, const TBool aEnableCallback ) + { + PRINT(_L("CCamSoundPlayer::StartPlaySound") ) + iAudioPlayer->Stop(); + iAudioPlayer->Close(); + + TInt err = KErrNone; + iEnableCallback = aEnableCallback; + + TRAP( err, iAudioPlayer->OpenFileL( aFile ) ); + if ( !err ) + { + iOpenFileInProgress = ETrue; + } + else + { + // The last OpenFileL call hasn't completed yet. + err = KErrInUse; + } + + PRINT1(_L("CCamSoundPlayer::StartPlaySound err (%d)"), err ) + + if ( err && aEnableCallback ) + { + // Cannot play sound, so notify client. + iObserver->PlaySoundComplete(); + iEnableCallback = EFalse; + } + } + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::StartPlayTone +// Attempts to begin playing the specified tone +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::StartPlayTone( const TDesC& aFile, const TBool aEnableCallback ) + { + // Check if we are already trying to open/play a tone, and stop it + // if so + if ( iOpenFileInProgress ) + { + iTonePlayer->CancelPrepare(); + iOpenFileInProgress = EFalse; + if ( iEnableCallback ) + { + iObserver->PlaySoundComplete(); + iEnableCallback = EFalse; + } + } + else if ( iTonePlayInProgress ) + { + iTonePlayer->CancelPlay(); + iTonePlayInProgress = EFalse; + if ( iEnableCallback ) + { + iObserver->PlaySoundComplete(); + iEnableCallback = EFalse; + } + } + else + { + // empty statement to remove Lint error. + } + + iEnableCallback = aEnableCallback; + + iOpenFileInProgress = ETrue; + iTonePlayer->PrepareToPlayFileSequence( aFile ); + iTonePlayer->SetVolume( static_cast( KCamInCallToneVol * iTonePlayer->MaxVolume() ) ); + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::MapcInitComplete +// CMdaAudioPlayerUtility initialization complete +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::MapcInitComplete( TInt aError, + const TTimeIntervalMicroSeconds& /*aDuration*/ ) + { + iOpenFileInProgress = EFalse; + + if ( !aError ) + { + iAudioPlayer->Play(); + } + else + { + if ( iEnableCallback ) + { + iObserver->PlaySoundComplete(); + iEnableCallback = EFalse; + } + } + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::MapcPlayComplete +// Playback complete, notify observer +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::MapcPlayComplete( TInt /*aError*/ ) + { + if ( iEnableCallback && iObserver) + { + iObserver->PlaySoundComplete(); + iEnableCallback = EFalse; + } + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::MatoPrepareComplete +// Tone prepare complete. +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::MatoPrepareComplete( TInt aError ) + { + iOpenFileInProgress = EFalse; + + if ( !aError ) + { + iTonePlayInProgress = ETrue; + iTonePlayer->Play(); +#ifdef __WINS__ +// The tone player does not give a call back on the emulator so +// we have to force a callback here + MatoPlayComplete( KErrNone ); +#endif // __WINS__ + } + else + { + if ( iEnableCallback ) + { + iObserver->PlaySoundComplete(); + iEnableCallback = EFalse; + } + } + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::MatoPlayComplete +// Tone playback complete. +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::MatoPlayComplete( TInt /*aError*/ ) + { + iTonePlayInProgress = EFalse; + if ( iEnableCallback ) + { + iObserver->PlaySoundComplete(); + iEnableCallback = EFalse; + } + } + + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::DisableSelectionKeySoundL +// Called to disable certain key press clicks +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::DisableSelectionKeySoundL() + { + if ( iKeySoundSystem && !iSelectionKeySilent ) + { + iKeySoundSystem->PushContextL( R_CAM_SILENT_OK_KEY_LIST ); + iSelectionKeySilent = ETrue; + } + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::EnableSelectionKeySound +// Called to enable certain key press clicks +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::EnableSelectionKeySound() + { + if ( iKeySoundSystem && iSelectionKeySilent ) + { + iKeySoundSystem->PopContext(); + iSelectionKeySilent = EFalse; + } + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::DisableAllKeySoundsL +// Called to disable all key sounds, usually when video recording +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::DisableAllKeySoundsL() + { + if ( iKeySoundSystem && !iAllKeysSilent ) + { + iKeySoundSystem->PushContextL( R_AVKON_SILENT_SKEY_LIST ); + iKeySoundSystem->BringToForeground(); + iKeySoundSystem->LockContext(); + iAllKeysSilent = ETrue; + } + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::EnableAllKeySoundsL +// Called to enable all key sounds, usually when video recording +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::EnableAllKeySounds() + { + if ( iKeySoundSystem && iAllKeysSilent ) + { + iKeySoundSystem->ReleaseContext(); + iKeySoundSystem->PopContext(); + iAllKeysSilent = EFalse; + } + } + + +// --------------------------------------------------------------------------- +// CCamSoundPlayer::CancelTonePlayer +// Cancels any outstanding tone player activity +// --------------------------------------------------------------------------- +// +void CCamSoundPlayer::CancelTonePlayer() + { + if ( iOpenFileInProgress && iTonePlayer ) + { + iTonePlayer->CancelPrepare(); + iOpenFileInProgress = EFalse; + + if ( iEnableCallback && iObserver ) + { + iObserver->PlaySoundComplete(); + iEnableCallback = EFalse; + } + } + + if ( iTonePlayInProgress && iTonePlayer ) + { + iTonePlayer->CancelPlay(); + iTonePlayInProgress = EFalse; + + if ( iEnableCallback && iObserver ) + { + iObserver->PlaySoundComplete(); + iEnableCallback = EFalse; + } + } + } + + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamStandbyContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamStandbyContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,397 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container for standby mode* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include "CamStandbyContainer.h" +#include "CamTimer.h" +#include "Cam.hrh" +#include "CamUtility.h" +#include "CamAppUi.h" +#include "CamViewBase.h" +#include +#include +#include + +// CONSTANTS + +const TInt KForegroundDelayTimeout = 500; + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamStandbyContainer::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamStandbyContainer* CCamStandbyContainer::NewL( const TRect& aRect, CAknView& aView, + CCamAppController& aController, + TInt aError ) + + { + CCamStandbyContainer* self = + new( ELeave ) CCamStandbyContainer( aController, aView, aError ); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aError ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamStandbyContainer::~CCamStandbyContainer +// Destructor +// --------------------------------------------------------------------------- +// +CCamStandbyContainer::~CCamStandbyContainer() + { + PRINT( _L("Camera => ~CCamStandbyContainer")) + if( iForegroundTimer ) + { + iForegroundTimer->Cancel(); + delete iForegroundTimer; + } + + delete iText; + delete iWrappedLabelText; + PRINT( _L("Camera => ~CCamStandbyContainer") ); + } + +// --------------------------------------------------------- +// CCamStandbyContainer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamStandbyContainer::ConstructL( const TRect& aRect, TInt aError ) + { + PRINT( _L("Camera => CCamStandbyContainer::ConstructL")) + CCamContainerBase::BaseConstructL( aRect ); + + iText = new ( ELeave ) CEikLabel; + iText->SetContainerWindowL( *this ); + + iText->SetAlignment( EHCenterVCenter ); + iText->SetExtent( TPoint( 0, 0 ), aRect.Size() ); + // tell the CEikLabel that it should not do the visual + // conversion (Arabic right to left) because the app + // will do it via + // AknBidiTextUtils::ConvertToVisualAndWrapToStringL + iText->UseLogicalToVisualConversion( EFalse ); + + // Get label text from resource + HBufC* labelText; + if ( static_cast( iEikonEnv->AppUi() )->IsConstructionComplete() ) + { + switch( aError ) + { + case KErrNone: + labelText = StringLoader::LoadLC( R_CAM_STANDBY_TEXT ); + break; + case KErrInUse: + labelText = StringLoader::LoadLC( R_CAM_STANDBY_CAMERA_IN_USE_TEXT ); + break; + case KErrNoMemory: + labelText = StringLoader::LoadLC( R_CAM_MEMLO_NOT_ENOUGH_MEMORY ); + break; + case KErrPermissionDenied: + labelText = StringLoader::LoadLC( R_CAM_STANDBY_CAMERA_DISABLED_TEXT ); + break; + default: // any other error + labelText = StringLoader::LoadLC( R_CAM_STANDBY_CAMERA_UNAVAILABLE_TEXT ); + break; + } + } + else + { + labelText = StringLoader::LoadLC( R_CAM_STANDBY_EMPTY_TEXT ); + } + + + iText->SetTextL( *labelText ); + // Wrap the text, where it doesn't fit. + // ...Create the line width array necessary for ConvertToVisual..() + const TInt KLabelMaxLines = 5; + CArrayFix* lineWidths = + new ( ELeave ) CArrayFixFlat ( KLabelMaxLines ); + CleanupStack::PushL( lineWidths ); + for (TInt i = 0; i < KLabelMaxLines; ++i ) + { + lineWidths->AppendL( aRect.Width() ); + } + // ...Create the text buffer that will receive the wrapped text. + iWrappedLabelText = HBufC::NewL( + labelText->Length() + KLabelMaxLines * ( KAknBidiExtraSpacePerLine + 1 ) ); + TPtr ptr = iWrappedLabelText->Des(); + // ...Get the wrapped text conversion. + AknBidiTextUtils::ConvertToVisualAndWrapToStringL( + labelText->Des(), + *lineWidths, + *AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont ), + ptr, + ETrue + ); + // ...Cleanup + CleanupStack::PopAndDestroy( lineWidths ); + CleanupStack::PopAndDestroy( labelText ); + + // Set the wrapped text to the label. + iText->SetTextL( *iWrappedLabelText ); + + // Initialise foreground timer - used to delay the exit + // from standby when foreground is gained + iForegroundTimer = CCamTimer::NewL( KForegroundDelayTimeout, + TCallBack( CCamStandbyContainer::ForegroundTimeout, this ) ); + + // Make sure fixed toolbar is on top of this window + DrawableWindow()->SetOrdinalPosition( KCamPreCaptureWindowOrdinalPos ); + } + +// --------------------------------------------------------------------------- +// CCamStandbyContainer::CCamStandbyContainer +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamStandbyContainer::CCamStandbyContainer( CCamAppController& aController, + CAknView& aView, TInt aError ) +: CCamContainerBase( aController, aView ), iStandbyError( aError ) + { + } + +// --------------------------------------------------------- +// CCamStandbyContainer::CountComponentControls +// Returns the number of controls owned +// --------------------------------------------------------- +// +TInt CCamStandbyContainer::CountComponentControls() const + { + TInt count = 1; + return count; // Return the number of controls inside this container + } + +// --------------------------------------------------------- +// CCamStandbyContainer::ComponentControl +// Return pointer to a contained control +// --------------------------------------------------------- +// +CCoeControl* CCamStandbyContainer::ComponentControl( TInt aIndex ) const + { + switch ( aIndex ) + { + case 0: + { + return iText; + } + default: + { + return NULL; + } + } + } + +// --------------------------------------------------------- +// CCamStandbyContainer::Draw +// Draw control +// --------------------------------------------------------- +// +void CCamStandbyContainer::Draw( const TRect& /*aRect*/ ) const + { + PRINT( _L("Camera => CCamStandbyContainer::Draw")) + CWindowGc& gc = SystemGc(); + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsDrawUtils::Background( skin, iBgContext, gc, Rect() ); + + // override the label color + TRgb color; + AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, + EAknsCIQsnTextColorsCG6 ); + TRAPD( ignore, AknLayoutUtils::OverrideControlColorL( *iText, + EColorLabelText, color ) ); + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + } + +// ---------------------------------------------------------------- +// CCamStandbyContainer::OfferKeyEventL +// Handles this application view's command keys +// ---------------------------------------------------------------- +// +TKeyResponse CCamStandbyContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + if ( iStandbyError != KErrNone ) + { + return EKeyWasConsumed; + } + + // if the select (OK) key is pressed + if ( ( aType == EEventKey && aKeyEvent.iCode == EKeyOK ) + // if shutter key is pressed in main camera + || ( aType == EEventKey && + ( aKeyEvent.iScanCode == iPrimaryCameraCaptureKeys[0] || + CCamContainerBase::IsShutterKeyL(aKeyEvent, aType) ) && + !static_cast( iEikonEnv->AppUi() )->IsSecondCameraEnabled() ) + || ( IsCaptureKeyL(aKeyEvent, aType)) ) + { + // in case we receive an enter key or MSK key event in standby mode + // we should not call HandleCommandL function with ECamCmdExitStandby + // because by default application will get a left softkey command id + // when MSK is pressed. In standby mode left softkey command id is + // ECamCmdExitStandby + if ( !( ( aType == EEventKey || + aType == EEventKeyDown || + aType == EEventKeyUp ) && + ( aKeyEvent.iScanCode == EStdKeyDevice3 || + aKeyEvent.iScanCode == EStdKeyEnter ) ) ) + { + iView.HandleCommandL( ECamCmdExitStandby ); + } + return EKeyWasConsumed; + } + // handle navi-key up/down, left/right + else if ( aType == EEventKey && + ( aKeyEvent.iScanCode == EStdKeyDownArrow || + aKeyEvent.iScanCode == EStdKeyUpArrow || + aKeyEvent.iScanCode == EStdKeyLeftArrow || + aKeyEvent.iScanCode == EStdKeyRightArrow ) ) + { + iView.HandleCommandL( ECamCmdExitStandby ); + return EKeyWasConsumed; + } + else if ( ( aType == EEventKeyDown || aType == EEventKeyUp ) && + ( aKeyEvent.iScanCode != EStdKeyYes ) ) + { + if ( aType == EEventKeyDown ) + { + if( IsZoomKeyL(aKeyEvent, aType ) ) + { + iView.HandleCommandL( ECamCmdExitStandby ); + } + } + // consume key up/down presses + return EKeyWasConsumed; + } + else + { + return CCamContainerBase::OfferKeyEventL( aKeyEvent, aType ); + } + } + +// ---------------------------------------------------------------- +// CCamStandbyContainer::HandleForegroundEvent +// Handle foreground event +// ---------------------------------------------------------------- +// +void CCamStandbyContainer::HandleForegroundEventL( TBool aForeground ) + { + if ( aForeground ) + { + // start timer to delay exit from standby + if ( !iForegroundTimer->IsActive() ) + { + iForegroundTimer->StartTimer(); + } + } + else + { + // set text label as blank + TRAP_IGNORE( iText->SetTextL( KNullDesC ) ); + + // cancel timer if active + if ( iForegroundTimer->IsActive() ) + { + iForegroundTimer->Cancel(); + } + } + } + +// ---------------------------------------------------------------- +// CCamStandbyContainer::GetStandbyError +// Returns the current error +// ---------------------------------------------------------------- +// +TInt CCamStandbyContainer::GetStandbyError() const + { + return iStandbyError; + } + +// ---------------------------------------------------------------- +// CCamStandbyContainer::ForegroundTimeout +// static callback function for foreground gain timeout +// ---------------------------------------------------------------- +// +TInt CCamStandbyContainer::ForegroundTimeout( TAny *aPtr ) + { + return static_cast( aPtr )->DoForegroundTimeout(); + } + +// ---------------------------------------------------------------- +// CCamStandbyContainer::DoForegroundTimeout +// Implementation function for foreground gain timeout +// ---------------------------------------------------------------- +// +TInt CCamStandbyContainer::DoForegroundTimeout() + { + TRAPD( ignore, iView.HandleCommandL( ECamCmdExitStandby ) ); + if ( ignore ) + { + // Do nothing ( removes build warning ) + } + + return EFalse; + } + +// ---------------------------------------------------------------- +// CCamStandbyContainer::HandlePointerEventL +// ---------------------------------------------------------------- +// +void CCamStandbyContainer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + RDebug::Print(_L("CCamStandbyContainer::HandlePointerEventL iType=%d iPosition=(%d, %d)"), + aPointerEvent.iType, + aPointerEvent.iPosition.iX, + aPointerEvent.iPosition.iY ); + + TInt callType( EPSCTsyCallTypeUninitialized ); + RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType ); + if ( callType != EPSCTsyCallTypeH324Multimedia) + { + static_cast( iView ).HandleCommandAoL( ECamCmdExitStandby ); + } + else + { + } + } + +// ----------------------------------------------------------------------------- +// CCamStandbyContainer::CreateBackgroundContextL +// ----------------------------------------------------------------------------- +// +void CCamStandbyContainer::CreateBackgroundContextL() + { + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgAreaMain, Rect(), EFalse ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamStillPostCaptureView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamStillPostCaptureView.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,648 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Still image Post-capture view class for Camera application* +*/ + + +// INCLUDE FILES + +#include "CamAppUiBase.h" +#include "CamAppController.h" +#include "CamStillPostCaptureView.h" +#include "CamPostCaptureContainer.h" +#include "CamLogger.h" +#include "CamAppUi.h" +#include +#include +#include +#include +#include +#include "CamUtility.h" + +#include "Cam.hrh" + +#include +#include + +#include +#include +#ifndef __WINS__ +//#include + +#include // CAknInformationNote +#endif + +#include "camactivepalettehandler.h" +#include "camoneclickuploadutility.h" +#include "CameraUiConfigManager.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamStillPostCaptureViewTraces.h" +#endif + + +//CONSTANTS +_LIT( KCamImageMimeType, "image/jpeg" ); + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamStillPostCaptureView* CCamStillPostCaptureView::NewLC( CCamAppController& aController ) + { + CCamStillPostCaptureView* self = + new( ELeave ) CCamStillPostCaptureView( aController ); + + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView destructor +// +// --------------------------------------------------------------------------- +// +CCamStillPostCaptureView::~CCamStillPostCaptureView() + { + } + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView::Id +// Returns UID of view +// --------------------------------------------------------------------------- +// +TUid CCamStillPostCaptureView::Id() const + { + return TUid::Uid( ECamViewIdStillPostCapture ); + } + +// ----------------------------------------------------------------------------- +// CCamStillPostCaptureView::HandleCommandL +// Handle commands +// ----------------------------------------------------------------------------- +// +void CCamStillPostCaptureView::HandleCommandL( TInt aCommand ) + { + PRINT1( _L("Camera => CCamStillPostCaptureView::HandleCommandL (%d)"), aCommand ) + switch ( aCommand ) + { + case EAknSoftkeySelect: + { + CCamAppUiBase* appUi = static_cast( AppUi() ); + if ( ECamImageCaptureTimeLapse == appUi->CurrentBurstMode() ) + { + CCamPostCaptureViewBase::HandleCommandL( aCommand ); + } + // In post-capture select key is disabled when embedded + else if ( !iEmbedded ) + { + CEikMenuBar* menuBar = MenuBar(); + if ( menuBar ) + { + menuBar->SetMenuTitleResourceId( ROID(R_CAM_STILL_POST_CAPTURE_OK_MENUBAR_ID)); + menuBar->TryDisplayMenuBarL(); + menuBar->SetMenuTitleResourceId( ROID(R_CAM_STILL_POST_CAPTURE_MENUBAR_ID)); + } + CCamPostCaptureViewBase::HandleCommandL( aCommand ); + } + else + { + AppUi()->HandleCommandL( ECamCmdSelect ); + } + } + break; + case ECamCmdDeleteSequence: + { + if ( DisplayDeleteSequenceNoteL() ) + { + HandleCommandL( ECamCmdNewPhoto ); + } + } + break; + case ECamCmdSendToCallerMultimedia: + { +#ifndef __WINS__ + DoInCallSendL(); +#endif + } + break; + case ECamCmdQuickSend: + { +/*#ifndef __WINS__ + if( iSFIUtils->IsCLIValidL() ) + { + DoInCallSendL(); + } + else +#endif // __WINS__*/ + //{ + DoSendAsL(); + //} + } + break; + + case ECamCmdRenameImage: + { + CCamAppUi* appUi = static_cast( AppUi() );; + QueryRenameL( ECamControllerImage ); + // inform the Media gallery of name change + TRAPD( ignore, + appUi->HandleControllerEventL( ECamEventMediaFileChanged, KErrNone ) ); + if ( ignore ) + { + // Do nothing (removes build warning) + } + break; + } + + case ECamCmdPrint: + { + PRINT( _L("Camera => CCamStillPostCaptureView::HandleCommandL PRINT")) + + CAiwGenericParamList& inParams = iAiwServiceHandler->InParamListL(); + CAiwGenericParamList& outParams = iAiwServiceHandler->OutParamListL(); + // Add file path to AIW parameters + TAiwVariant variant( iController.CurrentFullFileName() ); + TAiwGenericParam param( EGenericParamFile, variant ); + inParams.AppendL( param ); + + iAiwServiceHandler->ExecuteServiceCmdL( KAiwCmdPrint, inParams, outParams ); + // we are 'embedding' Edit & Print apps + static_cast( AppUi() ) ->SetEmbedding( ETrue ); + } + break; + case ECamCmdPrintPlugin: + { + // we are 'embedding' Edit & Print apps + PRINT( _L("Camera => CCamStillPostCaptureView::HandleCommandL ECamCmdPrintPlugin")) + static_cast( AppUi() ) ->SetEmbedding( ETrue ); + } + break; + + case ECamCmdPrintIntent: + { + // we are 'embedding' Edit & Print apps + PRINT( _L("Camera => CCamStillPostCaptureView::HandleCommandL ECamCmdPrintIntent")) + static_cast( AppUi() ) ->SetEmbedding( ETrue ); + } + break; + + default: + { + // Handle AIW commands + TInt aiwServiceCmd = iAiwServiceHandler->ServiceCmdByMenuCmd( aCommand ); + if ( aiwServiceCmd != KAiwCmdNone ) + { + PRINT( _L("CCamStillPostCaptureView::HandleCommandL AIW command enabling prevention of timeout") ); + + CAiwGenericParamList& inParams = iAiwServiceHandler->InParamListL(); + CAiwGenericParamList& outParams = iAiwServiceHandler->OutParamListL(); + // Add file path to AIW parameters + TAiwVariant variant( iController.CurrentFullFileName() ); + TAiwGenericParam param( EGenericParamFile, variant ); + inParams.AppendL( param ); + + TCamOrientation orientation = static_cast( AppUi() )->CamOrientation(); + + // Don't add the mime type if uploading, since Share client + // will figure it out from the file + if ( aiwServiceCmd != KAiwCmdUpload ) + { + // Set as contact call image needs image MIME type as AIW param + // Set as wall paper requires MIME type also. + TAiwVariant variant2( KCamImageMimeType ); + TAiwGenericParam param2( EGenericParamMIMEType, variant2 ); + inParams.AppendL( param2 ); + } + + iAiwServiceHandler->ExecuteMenuCmdL( aCommand, inParams, outParams, 0, this ); + PRINT( _L("CCamStillPostCaptureView::HandleCommandL AIW command") ); + + // To let camera draw the captured image after assigning an image + // to contact from postcapture view, don't set iEmbedding to ETrue + // when assign an image to contact from postcapture view. + if ( ECamCmdEditVideo != aCommand ) + { + // We are 'embedding' Edit & Print apps + static_cast( AppUi() ) ->SetEmbedding( ETrue ); + } + } + else + { + CCamPostCaptureViewBase::HandleCommandL( aCommand ); + } + } + } + } + + +// ----------------------------------------------------------------------------- +// CCamStillPostCaptureView::DoActivateL +// Activates the view +// ----------------------------------------------------------------------------- +// +void CCamStillPostCaptureView::DoActivateL( + const TVwsViewId& aPreViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPOSTCAPTUREVIEW_DOACTIVATEL, "e_CCamStillPostCaptureView_DoActivateL 1" ); + PRINT( _L("Camera => CCamStillPostCaptureView::DoActivateL")) + PERF_EVENT_START_L2( EPerfEventStillPostCaptureViewActivation ); + CCamAppUi* appUi = static_cast( AppUi() ); + + TBool timeLapseOn = (ECamImageCaptureTimeLapse == appUi->CurrentBurstMode()); + + // Ensure the correct menu is used for the current mode. + CEikMenuBar* menuBar = MenuBar(); + if ( menuBar ) + { + if ( timeLapseOn ) + { + menuBar->SetMenuTitleResourceId( + ROID(R_CAM_TIMELAPSE_POST_CAPTURE_MENUBAR_ID)); + } + else + { + menuBar->SetMenuTitleResourceId( + ROID(R_CAM_STILL_POST_CAPTURE_MENUBAR_ID)); + } + } + if ( iController.IsTouchScreenSupported() ) + { + if ( appUi->IsSecondCameraEnabled() ) + { + if ( iOneClickUploadUtility->OneClickUploadSupported() ) + { + TInt resourceId = appUi->IsQwerty2ndCamera()? + R_CAM_STILL_POSTCAPTURE_TOOLBAR_LANDSCAPE_UPLOAD: + R_CAM_STILL_POSTCAPTURE_TOOLBAR_PORTRAIT_UPLOAD; + CreateAndSetToolbarL( resourceId ); + } + else + { + TInt resourceId = appUi->IsQwerty2ndCamera()? + R_CAM_STILL_POSTCAPTURE_TOOLBAR_LANDSCAPE: + R_CAM_STILL_POSTCAPTURE_TOOLBAR_PORTRAIT; + CreateAndSetToolbarL( resourceId ); + } + } + else + { + if ( iOneClickUploadUtility->OneClickUploadSupported() ) + { + CreateAndSetToolbarL( + R_CAM_STILL_POSTCAPTURE_TOOLBAR_UPLOAD ); + } + else + { + CreateAndSetToolbarL( + R_CAM_STILL_POSTCAPTURE_TOOLBAR ); + } + } + } + + CCamPostCaptureViewBase::DoActivateL( + aPreViewId, aCustomMessageId, aCustomMessage ); + + PERF_EVENT_END_L2( EPerfEventStillPostCaptureViewActivation ); + iAiwServiceHandler->Reset(); + // attach interest for PRINT from Active Toolbar + iAiwServiceHandler->AttachL( R_CAM_MOVE_TO_STILL_IMAGE_INTEREST_AT ); + + iAiwServiceHandler->AttachMenuL( ROID(R_CAM_STILL_POST_CAPTURE_MENU_ID), + R_CAM_MOVE_TO_STILL_IMAGE_INTEREST ); + + iAiwServiceHandler->AttachMenuL( ROID( R_CAM_STILL_POST_CAPTURE_MENU_ID), + R_CAM_SHARE_ON_OVI_INTEREST ); + + iAiwServiceHandler->AttachMenuL( ROID( R_CAM_STILL_POST_CAPTURE_MENU_ID), + R_CAM_SET_AS_CALL_IMAGE_INTEREST ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPOSTCAPTUREVIEW_DOACTIVATEL, "e_CCamStillPostCaptureView_DoActivateL 0" ); + } + + +// ----------------------------------------------------------------------------- +// CCamStillPostCaptureView::DisplayDeleteNoteL() +// Display the delete confirmation note +// ----------------------------------------------------------------------------- +// +TBool CCamStillPostCaptureView::DisplayDeleteNoteL() + { + // Display the delete confirmation note + TInt err = KErrNone; + HBufC* confirmationText; + confirmationText = StringLoader::LoadLC( R_CAM_STILL_POST_CAPTURE_DELETE_NOTE_TEXT ); + CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText ); + CleanupStack::PopAndDestroy( confirmationText ); + if ( confirmationDialog->ExecuteLD( R_CAM_STILL_POST_CAPTURE_DELETE_NOTE ) ) + { + if ( iEmbedded ) + { + //To prevent sofkeys blinking when capturing, we need to blank + //the softkeys here + BlankSoftkeysL(); + Cba()->DrawNow(); + } + err = iController.DeleteCurrentFile(); + if ( err ) + { + User::Leave( err ); + } + return ETrue; + } + else + { + return EFalse; + } + } + +// ----------------------------------------------------------------------------- +// CCamStillPostCaptureView::DisplayDeleteSequenceNoteL() +// Display the delete confirmation note for a sequence of images +// ----------------------------------------------------------------------------- +// +TBool CCamStillPostCaptureView::DisplayDeleteSequenceNoteL() + { + // Display the delete sequence confirmation note + HBufC* confirmationText; + + confirmationText = StringLoader::LoadLC( R_CAM_BURST_DELETE_MULTIPLE_NOTE_TEXT, iController.TimeLapseImageCount() ); + + // Create the dialog with the text, and show it to the user + CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText ); + CleanupStack::PopAndDestroy( confirmationText ); + + if ( confirmationDialog->ExecuteLD( R_CAM_BURST_DELETE_MULTIPLE_NOTE ) ) + { + iController.DeleteTimeLapseFiles(); + return ETrue; + } + else + { + return EFalse; + } + } + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView::CCamStillPostCaptureView +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamStillPostCaptureView::CCamStillPostCaptureView( CCamAppController& aController ) + : CCamPostCaptureViewBase( aController ) + { + } + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamStillPostCaptureView::ConstructL() + { + BaseConstructL( ROID(R_CAM_STILL_POST_CAPTURE_VIEW_ID)); + CCamPostCaptureViewBase::ConstructL(); + + iAiwServiceHandler->AttachMenuL( ROID( R_CAM_STILL_POST_CAPTURE_MENU_ID), R_CAM_SHARE_ON_OVI_INTEREST ); + iRockerKeyPress = EFalse; + } + + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CCamStillPostCaptureView::DoDeactivate() + { + CCamPostCaptureViewBase::DoDeactivate(); + } + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView::SetTitlePaneTextL +// Set the view's title text +// --------------------------------------------------------------------------- +// +void CCamStillPostCaptureView::SetTitlePaneTextL() + { + TBool titleAlwaysShowsFileName = EFalse; + + CCamAppUiBase* appUi = static_cast( AppUi() ); + if ( appUi->CamOrientation() == ECamOrientationViewMode || + titleAlwaysShowsFileName ) + { + appUi->SetTitleL( iController.CurrentImageName() ); + } + } + + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView::ProcessCommandL +// Handling ECamCmdToggleActiveToolbar from any of the PostCaptureView's +// either Image/Video. +// --------------------------------------------------------------------------- +// +void CCamStillPostCaptureView::ProcessCommandL( TInt aCommand ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + TCamOrientation orientation = appUi->CamOrientation(); + if( orientation == ECamOrientationCamcorder || + orientation == ECamOrientationCamcorderLeft || + orientation == ECamOrientationPortrait ) + { + if ( aCommand == ECamCmdToggleActiveToolbar ) + { + CCamPostCaptureViewBase::HandleCommandL( aCommand ); + } + else + { + CAknView::ProcessCommandL( aCommand ); + } + } + else + { + if ( aCommand == EAknSoftkeyContextOptions && !iRockerKeyPress ) + { + iRockerKeyPress = ETrue; + MenuBar()->SetContextMenuTitleResourceId( ROID(R_CAM_STILL_POST_CAPTURE_MENUBAR_ID) ); + // Here we launch the Context Options by Hiding Help and Exit + // Check DynInitMenuPaneL() method and search for iRockerKeyPress for more details + MenuBar()->SetMenuType( CEikMenuBar::EMenuContext ); + MenuBar()->TryDisplayMenuBarL(); + // Here we again set back the type of menu to "Options" when pressed LSK + MenuBar()->SetMenuType( CEikMenuBar::EMenuOptions ); + } + else + { + CAknView::ProcessCommandL( aCommand ); + } + } + // CALL THE BASE CLASS + + } + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView::DynInitMenuPaneL +// Changes MenuPane dynamically +// --------------------------------------------------------------------------- +// +void CCamStillPostCaptureView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) + { + CCamPostCaptureViewBase::DynInitMenuPaneL( aResourceId, aMenuPane ); + + if ( iAiwServiceHandler && iAiwServiceHandler->IsAiwMenu( aResourceId ) ) + { + CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL(); + TAiwVariant variant( iController.CurrentFullFileName() ); + TAiwGenericParam param( EGenericParamFile, variant ); + paramList.AppendL( param ); + + // Set as contact call image needs image MIME type as AIW param + TCamOrientation orientation = static_cast( AppUi() )->CamOrientation(); + + TAiwVariant variant2( KCamImageMimeType ); + TAiwGenericParam param2( EGenericParamMIMEType, variant2 ); + paramList.AppendL( param2 ); + + iAiwServiceHandler->InitializeMenuPaneL( + *aMenuPane, + aResourceId, + ECamCmdAIWCommands, + paramList ); + } + + if ( iAiwServiceHandler ) + { + // handle any AIW menu cascades + if ( iAiwServiceHandler->HandleSubmenuL( *aMenuPane ) ) + { + return; + } + } + + if ( aResourceId == ROID( R_CAM_STILL_POST_CAPTURE_MENU_ID ) || + aResourceId == ROID( R_CAM_STILL_POST_CAPTURE_OK_MENU_ID ) ) + { + TBool showSend = ETrue; + TBool showSendToCaller = EFalse; + +/*#ifndef __WINS__ + if ( iSFIUtils->IsCLIValidL() ) + { + showSend = EFalse; + showSendToCaller = ETrue; + } +#endif*/ + + TCamOrientation orientation = + static_cast( AppUi() )->CamOrientation(); + + if ( orientation == ECamOrientationCamcorder || + orientation == ECamOrientationCamcorderLeft || + orientation == ECamOrientationPortrait ) + { + showSend = EFalse; + showSendToCaller = EFalse; + } + + TInt itemPos = 0; + if ( aMenuPane->MenuItemExists( ECamCmdSendToCallerMultimedia, itemPos ) ) + { + aMenuPane->SetItemDimmed( + ECamCmdSendToCallerMultimedia, !showSendToCaller ); + } + + if ( aMenuPane->MenuItemExists( ECamCmdSend, itemPos ) ) + { + aMenuPane->SetItemDimmed( + ECamCmdSend, !showSend ); + } + + /* + * MSK : ContextOptions --> We just hide Help and Exit from the Options Menu when + * the MSK is pressed in the postcapture still view + * iRockerKeyPress represents MSK key event in still postcapture view + */ + if ( aMenuPane->MenuItemExists( EAknCmdHelp, itemPos ) && + aMenuPane->MenuItemExists( ECamCmdInternalExit, itemPos ) ) + { + if ( iRockerKeyPress ) + { // We hide Help and Exit + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + aMenuPane->SetItemDimmed( ECamCmdInternalExit, ETrue ); + iRockerKeyPress = EFalse; + } + else + { // We show Help and Exit + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + aMenuPane->SetItemDimmed( ECamCmdInternalExit, EFalse ); + } + } + } + } + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView::HandleNotifyL +// Handles any notification caused by asynchronous ExecuteCommandL +// or event. +// --------------------------------------------------------------------------- +// +TInt CCamStillPostCaptureView::HandleNotifyL( + TInt /*aCmdId*/, + TInt aEventId, + CAiwGenericParamList& /*aEventParamList*/, + const CAiwGenericParamList& /*aInParamList*/ ) + { + //AIW fails to assign. eg. the contact is locked for being used now. + if ( aEventId == KAiwEventError && iController.IsAppUiAvailable() ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + TRAP_IGNORE( appUi->HandleCameraErrorL( KErrInUse ) ); + } + return 0; + } + + +// --------------------------------------------------------------------------- +// CCamStillPostCaptureView::DynInitToolbarL +// Dynamically initialize toolbar contents +// --------------------------------------------------------------------------- +// +void CCamStillPostCaptureView::DynInitToolbarL( TInt aResourceId, + CAknToolbar* aToolbar ) + { + PRINT2( _L("Camera => CCamStillPostCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ); + (void)aResourceId; //remove compiler warning + + if( iEmbedded && aToolbar && iController.IsTouchScreenSupported() ) + { + // HideItem will not do anything if a button for the given + // command ID is not found. + aToolbar->HideItem( ECamCmdSend, ETrue, EFalse ); + aToolbar->HideItem( ECamCmdPhotos, ETrue, EFalse ); + aToolbar->HideItem( ECamCmdOneClickUpload, ETrue, EFalse ); + aToolbar->HideItem( ECamCmdDelete, ETrue, EFalse ); + } + + PRINT2( _L("Camera <= CCamStillPostCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamStillPreCaptureContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamStillPreCaptureContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1117 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container class for still image pre-capture view* +*/ + +// INCLUDE FILES +#include +#include + +#include +#include +#include +#include + +#include "CamStillPreCaptureContainer.h" +#include "CamLogger.h" +#include "CamPreCaptureViewBase.h" +#include "CamAppUi.h" +#include "CamSidePane.h" +#include "CamSelfTimer.h" +#include "CamUtility.h" +#include "camactivepalettehandler.h" +#include "CameraUiConfigManager.h" +#include "OstTraceDefinitions.h" +#include "CamIndicator.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamStillPreCaptureContainerTraces.h" +#endif + +#include "camvfgridinterface.h" +#include "camlinevfgriddrawer.h" +#include "campanic.h" + +// Constants +const TUid KGridDrawerUid = { KCamLineDrawVfGridUid }; +const TInt KGridHrzLines = 2; +const TInt KGridVrtLines = 2; +const TInt KGridThickness = 2; +const TRgb KGridColor = KRgbGray; +const CGraphicsContext::TPenStyle KGridStyle = CGraphicsContext::ESolidPen; + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamStillPreCaptureContainer* CCamStillPreCaptureContainer::NewL( + CCamAppController& aController, + CAknView& aView, + const TRect& aRect ) + { + CCamStillPreCaptureContainer* self = new( ELeave ) CCamStillPreCaptureContainer( + aController, aView ); + + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + CleanupStack::Pop( self ); + // Return newly created CCamStillPreCaptureContainer instance + return self; + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::~CCamStillPreCaptureContainer +// Destructor +// --------------------------------------------------------------------------- +// +CCamStillPreCaptureContainer::~CCamStillPreCaptureContainer() + { + PRINT( _L("Camera => ~CCamStillPreCaptureContainer" )) + + if ( iAPCreateAO ) + { + iAPCreateAO->Cancel(); + delete iAPCreateAO; + } + + if ( iXenonFlashSupported ) + { + // Unsubscribe blink events + if( CCamFlashStatus* flashStatus = iController.FlashStatus() ) + flashStatus->Subscribe( NULL ); + + delete iFlashBitmap; + delete iFlashBitmapMask; + } + PRINT( _L("Camera <= ~CCamStillPreCaptureContainer" )) + } + +// --------------------------------------------------------- +// CCamStillPreCaptureContainer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamStillPreCaptureContainer::ConstructL( const TRect& aRect ) + { + PRINT( _L("Camera => CCamStillPreCaptureContainer::ConstructL" )) + BaseConstructL( aRect ); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) + { + iAPCreateAO = CIdle::NewL(CActive::EPriorityStandard); + } + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + if( iController.IntegerSettingValue( ECamSettingItemPhotoShowFocusPoint ) ) + { + iShowReticule = EFalse; + } + else + { + iShowReticule = ETrue; + } + } + + iSidePane->SetCaptureMode( ECamControllerImage ); + + + iXenonFlashSupported = iController.UiConfigManagerPtr()->IsXenonFlashSupported(); + if ( iXenonFlashSupported ) + { + InitFlashIconL(); + LayoutFlashIcon(); + } + + PrepareProcessingTextL( ETrue ); + + if ( !( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSTILLPRECAPTURECONTAINER_CONSTRUCTL, "e_CAM_APP_AP_SETUP 1" ); + static_cast( this ) + ->SetupActivePaletteL( static_cast(&iView) ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSTILLPRECAPTURECONTAINER_CONSTRUCTL, "e_CAM_APP_AP_SETUP 0" ); + } + PRINT( _L("Camera <= CCamStillPreCaptureContainer::ConstructL" )) + } + +// --------------------------------------------------------- +// CCamContainerBase::BaseConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamStillPreCaptureContainer::BaseConstructL( const TRect& aRect ) + { + CCamPreCaptureContainerBase::BaseConstructL( aRect ); + // Layout the reticule. + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + SizeChanged(); // Init layout + } + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::CCamStillPreCaptureContainer +// C++ constructor +// --------------------------------------------------------------------------- +// + +CCamStillPreCaptureContainer::CCamStillPreCaptureContainer( + CCamAppController& aController, + CAknView& aView ) +: CCamPreCaptureContainerBase( aController, aView ) + { + } + + +// --------------------------------------------------------- +// CCamStillPreCaptureContainer::HandleControllerEventL +// Receives notifications about changes in recording state from the controller +// --------------------------------------------------------- +// +void CCamStillPreCaptureContainer::HandleControllerEventL( TCamControllerEvent aEvent, TInt aError ) + { + PRINT1( _L("Camera => CCamStillPreCaptureContainer::HandleControllerEventL aEvent:%d" ), aEvent ) + CCamAppUi* appUi = static_cast(CEikonEnv::Static()->AppUi()); + + switch( aEvent ) + { + // --------------------------------------------------- + case ECamEventImageQualityChanged: + { + PRINT( _L("Camera <> CCamStillPreCaptureContainer - ECamEventImageQualityChanged") ); + // If our viewfinder area is already set and image quality changes, + // do re-layout. + if( !iRect.IsEmpty() ) + { + const TRect r( ViewFinderFrameRect() ); + if( iRect != r ) + { + PRINT( _L("Camera <> CCamStillPreCaptureContainer - doing re-layout..") ); + iRect = r; + SizeChanged(); + } + } + SetResolutionIndicator(); + break; + } + // --------------------------------------------------- + case ECamEventLocationSettingChanged: + { + // If the location setting was changed on, then the indicator should be visible + SetLocationIndicatorVisibility(); + break; + } + // --------------------------------------------------- + case ECamEventCameraChanged: + { + break; + } + // --------------------------------------------------- + case ECamEventOperationStateChanged: + { + if( ECamCapturing == iController.CurrentOperation() ) + { + // If capture has just begun, and it's burst capture, + // will need to set the softkeys to Blank/Cancel (via UpdateCbaL call) + if ( appUi->IsBurstEnabled() ) + { + // Burst *is* enabled, so force the update of the CBA + static_cast(iView).UpdateCbaL(); + } + else // if burst is not enabled show the saving image wait note + { + Window().Invalidate(); + } + } + else + { + } + break; + } + // --------------------------------------------------- + case ECamEventSetupStateChanged: + { + appUi->APHandler()->UpdateActivePaletteL(); + break; + } + // --------------------------------------------------- + case ECamEventEngineStateChanged: + { + if( iController.CurrentImageModeSetup() == ECamImageCaptureBurst && + !iController.SequenceCaptureInProgress() ) + { + // Burst mode - processing text needed + PrepareBurstProcessingTextL(); + } + break; + } + // --------------------------------------------------- + case ECamEventInitReady: + { + // event only received if UIOrientationOverride feature is supported + if( iAPCreateAO->IsActive() ) + { + iAPCreateAO->Cancel(); + } + iAPCreateAO->Start( TCallBack( BackgroundAPL,this ) ); + break; + } + // --------------------------------------------------- + default: + { + // otherwise, do nothing + break; + } + // --------------------------------------------------- + } + CCamPreCaptureContainerBase::HandleControllerEventL( aEvent, aError ); + PRINT( _L("Camera <= CCamStillPreCaptureContainer::HandleControllerEventL" ) ) + } + + +//---------------------------------------------- +// BackgroundAPL +// Create AP ItemActive object Callback +//---------------------------------------------- +TInt CCamStillPreCaptureContainer::BackgroundAPL( TAny *aparam ) + { + CCamStillPreCaptureContainer* camStillCaptureContainer = reinterpret_cast (aparam); + return camStillCaptureContainer->SetupActivePaletteCallbackL(); + } + + +//---------------------------------------------- +// SetupActivePaletteCallbackL +// Initializes ActivePalette +//---------------------------------------------- +TInt CCamStillPreCaptureContainer::SetupActivePaletteCallbackL() + { + PRINT( _L("Camera => CCamStillPreCaptureContainer::SetupActivePaletteCallbackL" ) ) + CCamAppUi* appUi = static_cast(CEikonEnv::Static()->AppUi()); + if ( !iController.IsTouchScreenSupported() && + iController.CurrentMode()== ECamControllerImage ) + { + if ( appUi ) + { + appUi->SetActivePaletteVisibility( EFalse); + if ( !appUi->ActivePalette() ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSTILLPRECAPTURECONTAINER_HANDLECONTROLLEREVENTL, "e_CAM_APP_AP_SETUP 1" ); + static_cast( this ) + ->SetupActivePaletteL( static_cast(&iView) ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSTILLPRECAPTURECONTAINER_HANDLECONTROLLEREVENTL, "e_CAM_APP_AP_SETUP 0" ); + } + else + { + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMSTILLPRECAPTURECONTAINER_HANDLECONTROLLEREVENTL, "e_CAM_APP_AP_UPDATE 1" ); + appUi->APHandler()->UpdateActivePaletteL(); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMSTILLPRECAPTURECONTAINER_HANDLECONTROLLEREVENTL, "e_CAM_APP_AP_UPDATE 0" ); + } + appUi->SetActivePaletteVisibility( ETrue ); + } + else + { + } + } + PRINT( _L("Camera <= CCamStillPreCaptureContainer::SetupActivePaletteCallbackL" ) ) + return EFalse; + } + +// --------------------------------------------------------- +// CCamStillPreCaptureContainer::OfferKeyEventL +// Handle key events +// --------------------------------------------------------- +// +TKeyResponse +CCamStillPreCaptureContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // if the cancel softkey is pressed + + // If currently capturing a burst + if ( iController.SequenceCaptureInProgress() ) + { + if ( aKeyEvent.iScanCode == EStdKeyDevice1 ) + { + // Just return so the key press does not pass up to the base + // class This will now be handled in HandleCommandL() + return EKeyWasNotConsumed; + } + } + return CCamPreCaptureContainerBase::OfferKeyEventL( aKeyEvent, aType ); + } + +// --------------------------------------------------------- +// CCamStillPreCaptureContainer::ViewFinderLayoutResourceIds +// Return the layout resource id for the viewfinder +// --------------------------------------------------------- +// +void CCamStillPreCaptureContainer::ViewFinderLayoutResourceIds( + TInt& aViewFinderLayoutId, + TInt& aReticuleLayoutId ) const + { + { + aViewFinderLayoutId = ROID(R_CAM_VIEWFINDER_RECT_STILL_ID); + CCamAppUiBase* appui = static_cast( iEikonEnv->AppUi() ); + if ( appui->IsSecondCameraEnabled() ) + { + aViewFinderLayoutId = ROID(R_CAM_STILL_DISPLAYED_RECT_SECONDARY_ID); + } + } + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + // set the layouts for the still capture viewfinder and reticule + aReticuleLayoutId = R_CAM_IMG_PRECAP_RETICULE; + } + else + { + aReticuleLayoutId = 0; + } + } + +// --------------------------------------------------------- +// CCamStillPreCaptureContainer::SetResolutionIndicator +// Sets the resolution indicator to the required icon +// --------------------------------------------------------- +// +void CCamStillPreCaptureContainer::SetResolutionIndicator() + { + // The setting stored is an index into the array of supported qualities, + // and since this matches the array of supported quality icons, we do + // not need to do any further lookup on this value. + iCurrentIndicator = iController.IntegerSettingValue( ECamSettingItemPhotoQuality ); + } + +// --------------------------------------------------------- +// CCamStillPreCaptureContainer::SetLocationIndicatorVisibility +// Sets the resolution indicator visibility, if it is set or not +// --------------------------------------------------------- +// +void CCamStillPreCaptureContainer::SetLocationIndicatorVisibility() + { + // The setting stored is an index of whether the location setting is on or off + iLocationIndicatorVisible = (/*TCamLocationId::ECamLocationOn*/1 == iController.IntegerSettingValue( ECamSettingItemRecLocation )); + } + +// ---------------------------------------------------- +// CCamStillPreCaptureContainer::IncreaseFlashSettingL +// Move up through the flash settings +// ---------------------------------------------------- +// +void CCamStillPreCaptureContainer::IncreaseFlashSettingL() + { + if ( iZoomPane->IsVisible() + || static_cast( iEikonEnv->AppUi() )->IsSecondCameraEnabled() + ) + { + return; + } + // get current setting + TInt setting = + iController.IntegerSettingValue( ECamSettingItemDynamicPhotoFlash ); + + // Max/Min settings are ECamFlashAuto/ECamFlashOff + // and navi-key right moves down the list of settings + if ( setting == ECamFlashOff ) + { + setting = ECamFlashAuto; + } + else if ( setting >= ECamFlashAuto ) + { + setting++; + } + else + { + // remove Lint warning + } + + // only update if setting is invalid + if ( setting >= ECamFlashAuto && setting <= ECamFlashOff ) + { + iController.SetIntegerSettingValueL( + ECamSettingItemDynamicPhotoFlash, ( setting ) ); + } + } + +// ---------------------------------------------------- +// CCamStillPreCaptureContainer::DecreaseFlashSettingL +// Move down through the flash settings +// ---------------------------------------------------- +// +void CCamStillPreCaptureContainer::DecreaseFlashSettingL() + { + if ( iZoomPane->IsVisible() + || static_cast( iEikonEnv->AppUi() )->IsSecondCameraEnabled() + ) + { + return; + } + // get current setting + TInt setting = + iController.IntegerSettingValue( ECamSettingItemDynamicPhotoFlash ); + + // Max/Min settings are ECamFlashAuto/ECamFlashOff + // and navi-key left moves up the list of settings + if ( setting == ECamFlashAuto ) + { + setting = ECamFlashOff; + } + else if ( setting > ECamFlashAuto ) + { + setting--; + } + else + { + // remove Lint warning + } + + // only update if setting is invalid + if ( setting >= ECamFlashAuto && setting <= ECamFlashOff ) + { + iController.SetIntegerSettingValueL( + ECamSettingItemDynamicPhotoFlash, ( setting ) ); + } + } + +// ---------------------------------------------------- +// CCamStillPreCaptureContainer::HandleCaptureKeyEventL +// Change the current capture state +// ---------------------------------------------------- +// +TKeyResponse +CCamStillPreCaptureContainer::HandleCaptureKeyEventL( const TKeyEvent& aKeyEvent ) + { + PRINT( _L("Camera => CCamStillPreCaptureContainer::HandleCaptureKeyEventL")) + TKeyResponse keyResponse = EKeyWasNotConsumed; + CCamAppUi* appui = static_cast( iEikonEnv->AppUi() ); + __ASSERT_DEBUG(appui, CamPanic(ECamPanicNullPointer)); + TBool MSKCapture(EFalse); + // First handle middle softkey and enter key capture event + if ( !appui->IsToolBarVisible() + && ( aKeyEvent.iScanCode == EStdKeyDevice3 + || aKeyEvent.iScanCode == EStdKeyEnter ) ) + { + if ( iController.UiConfigManagerPtr() ) + { + if ( iController.UiConfigManagerPtr()->IsOpticalJoyStickSupported() ) + { + MSKCapture = ETrue; + } + else + { + if ( iController.UiConfigManagerPtr()->IsXenonFlashSupported() ) + { + if ( iController.CheckFlash() + && static_cast( &iView ) + ->StartMskCaptureL() ) + { + return EKeyWasConsumed; + } + } + else if ( static_cast( &iView )->StartMskCaptureL() ) + { + return EKeyWasConsumed; + } + } + } + } + + TBool selfTimerEnabled = appui->SelfTimerEnabled(); + TBool timeLapseEnabled = appui->CurrentBurstMode() == ECamImageCaptureTimeLapse; + + // if currently capturing a sequence + if ( iController.SequenceCaptureInProgress() ) + { + // if capturing an advanced timelapse under the press to start, press to stop rules + // (i.e. not selftimer which captures 6 images) + if ( timeLapseEnabled && !selfTimerEnabled ) + { + // Stop the capture now + iController.StopSequenceCaptureL(); + // Update CBA for setup pane usage + TRAP_IGNORE( static_cast( &iView )->UpdateCbaL() ); + PRINT( _L("Camera <= CCamStillPreCaptureContainer: sequence capture stopped")) + return EKeyWasConsumed; + } + else + { + // For certain products normal sequence capture, if we + // are already capturing a burst, just consume but ignore it. + PRINT( _L("Camera <= CCamStillPreCaptureContainer: ignored during sequence")) + return EKeyWasConsumed; + } + } + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + // If the shutter key has continued to a full press OR + // we are already focussed (as scene is a forced focus mode) + if ( iKeyShutter + || !iPhotoSceneUsesReticule + ) + { + iKeyShutter = EFalse; + + // Check if we are in Burst Mode with the controller not currently focussed. + if ( appui->IsBurstEnabled() + && iController.CurrentOperation() != ECamFocused && + iController.CurrentOperation() != ECamFocusFailed ) + { + // We want to start focus if in multishot and NOT in self-timer mode + // and current scene allows autofocus (ie if it's not forced) + if ( !selfTimerEnabled + && iPhotoSceneUsesReticule + ) + { + if( iXenonFlashSupported && timeLapseEnabled && !iController.CheckFlash() ) + { + // In time lapse mode, do not start focusing with full press if + // Xenon flash is not ready. This is not the case for normal + // burst mode, because flash is not used there. + iKeyShutter = ETrue; + PRINT( _L("Camera <= CCamStillPreCaptureContainer: Flash not ready in timelapse mode, ignore key")) + return EKeyWasConsumed; + } + // Below code commented out - fast capture should be supported also + // in burst/sequence capture mode. Also, in case focusing is already + // in progress, the call won't do anything. + // iController.StartAutoFocus(); + } + } + } +#ifndef __WINS__ + else + { + // This means we've received a full press without a half press - + // probably because the half press was consumed by the post capture view + // and triggered a switch to this view. In this case, we don't want to + // take a picture, therefore ignore the event. + if ( !appui->IsSecondCameraEnabled() + && !MSKCapture ) + { + PRINT( _L("Camera <= CCamStillPreCaptureContainer: full press without half press ignored")) + return EKeyWasConsumed; + } + } +#endif // __WINS__ + } + + if( iXenonFlashSupported + && !appui->IsSecondCameraEnabled() + && !MSKCapture + && !iController.CheckFlash() ) + { + if( !appui->IsBurstEnabled() || (timeLapseEnabled && selfTimerEnabled) ) + { + // For non-burst case, or time lapse captures with self timer, + // we do not allow primary camera capture if flash is required, + // but not ready. + iKeyShutter = ETrue; + PRINT( _L("Camera <= CCamStillPreCaptureContainer: Flash not ready, ignore key")) + return EKeyWasNotConsumed; + } + } + + // Go straight to capture + keyResponse = appui->StartCaptureL( aKeyEvent ); + + // Blank out the softkeys if we are capturing + if ( EKeyWasConsumed == keyResponse + && !iController.SequenceCaptureInProgress() + && !iController.CaptureModeTransitionInProgress() + ) + { + // Only blank the cba if self timer is not enabled + // or it is enabled but not counting down + if ( !selfTimerEnabled + || ( selfTimerEnabled && !appui->SelfTimer()->IsActive() ) + ) + { + static_cast( &iView )->BlankSoftkeysL(); + } + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = appui->CurrentFixedToolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + } + + if ( iController.IsTouchScreenSupported() ) + { + // Hide the toolbar in case full press in burstmode + if ( appui->IsBurstEnabled() ) + { + CAknToolbar* fixedToolbar = appui->CurrentFixedToolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + } + + PRINT( _L("Camera <= CCamStillPreCaptureContainer::HandleCaptureKeyEventL")) + return keyResponse; + } + + +// ---------------------------------------------------- +// CCamStillPreCaptureContainer::HandleShutterKeyEventL +// Change the current capture state following shutter +// key events +// ---------------------------------------------------- +// +TKeyResponse +CCamStillPreCaptureContainer::HandleShutterKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + CCamAppUi* appui = static_cast( iEikonEnv->AppUi() ); + __ASSERT_DEBUG(appui, CamPanic(ECamPanicNullPointer)); + TBool MSKCapture(EFalse); + if ( !appui->IsToolBarVisible() + && aKeyEvent.iScanCode == EStdKeyDevice3 + && iController.UiConfigManagerPtr() + && iController.UiConfigManagerPtr()->IsOpticalJoyStickSupported() ) + { + MSKCapture = ETrue; + } + + // If the key is a half-press and down +#ifndef __WINS__ + if ( aKeyEvent.iScanCode == iPrimaryCameraAFKeys[0] +#else + if ( aKeyEvent.iScanCode == EProductKeyCaptureHalf && + !( aKeyEvent.iModifiers & EModifierShift ) +#endif //__WINS__ + && iController.UiConfigManagerPtr() + && iController.UiConfigManagerPtr()->IsAutoFocusSupported() ) + { + if ( aType == EEventKeyDown ) + { + PRINT( _L("Camera => CCamStillPreCaptureContainer::HandleHalfKeyEventL DOWN")) + PERF_MESSAGE_L2( EPerfMessageCaptureKeyHalfPressed ); + // If the shutter key has been half pressed + iKeyShutter = ETrue; // Shutter key - first stage press -> start focussing... + + // check for active viewfinder and available space before proceeding with capture + if ( !iController.IsViewFinding() || !appui->CheckMemoryL() ) + { + // no memory available - stop capture + return EKeyWasConsumed; + } + + if ( iController.UiConfigManagerPtr() + && iController.UiConfigManagerPtr()->IsAutoFocusSupported() + && !appui->SelfTimerEnabled() + && iPhotoSceneUsesReticule ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSTILLPRECAPTURECONTAINER_HANDLESHUTTERKEYEVENTL, "e_CAM_APP_AF 1" ); //CCORAPP_AF_START + iController.StartAutoFocus(); + } + + return EKeyWasConsumed; + } + else if ( aType == EEventKeyUp && !MSKCapture ) + { + PRINT( _L("Camera => CCamStillPreCaptureContainer::HandleKeyEventL EProductKeyCaptureHalf up ")) + // If full shutter press is released + // The order of conditions is important here as half shutter only release resets the + // value of iKeyShutter + if ( !iKeyShutter ) + { + // Cancelling of a press-and-hold burst is handled + // when the full-press is released, so nothing to + // do when release the half-press apart from consume it + PRINT( _L("Camera <= CCamStillPreCaptureContainer::HandleKeyEventL no action, return EKeyWasConsumed")) + return EKeyWasConsumed; + } + else + { + // if half shutter only is released + iKeyShutter = EFalse; + TCamCaptureOperation operation = iController.CurrentOperation(); + // if not in self timer mode or about to start a capture + if ( !appui->SelfTimerEnabled() + && !iController.CapturePending() + || ECamFocusing == operation + ) + { + // In timelapse mode, when stopping with capture key, + // need this condition to avoid unnecessary entering + // to no-operation while already completing. + if( ECamCompleting != operation ) + { + iController.CancelFocusAndCapture(); + } + + // if not currently capturing + if ( ECamCapturing != operation ) + { + appui->UpdateCba(); + } + } + return EKeyWasConsumed; + } + } + else + { + // Removal of warning + } + } + return EKeyWasNotConsumed; + } + + + +// --------------------------------------------------------------------------- +// DrawAdditionalIcons +// +// --------------------------------------------------------------------------- +// +void +CCamStillPreCaptureContainer::DrawAdditionalIcons( CBitmapContext& aGc ) const + { + if( iXenonFlashSupported && iFlashIconVisible && ECamActiveCameraSecondary != iController.ActiveCamera() ) + { + DrawFlashIcon( aGc ); + } + } + +// ---------------------------------------------------- +// CCamStillPreCaptureContainer::ResolutionIndicatorIconPsiKey +// Returns the PSI key relating to the array of resolution +// indicator bitmaps. +// ---------------------------------------------------- +// +TCamPsiKey CCamStillPreCaptureContainer::ResolutionIndicatorIconPsiKey() const + { + return ECamPsiPrecapStillQualityIconIds; + } + +// --------------------------------------------------------------------------- +// virtual GetAPResourceId +// (From CCamPreCaptureContainerBase) +// +// Helper method to select the AP resource used to set AP items. +// --------------------------------------------------------------------------- +// +TInt CCamStillPreCaptureContainer::GetAPResourceId() const + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + TBool embedded = appUi->IsEmbedded(); + TInt resId = 0; + if( embedded ) + { + if ( !appUi->IsSecondCameraEnabled() ) + { + resId = R_CAM_EMB_STILL_PRE_CAPTURE_AP_ITEMS_ADVANCED; + } + } + else + { + if ( !appUi->IsSecondCameraEnabled() ) + { + resId = R_CAM_STILL_PRE_CAPTURE_AP_ITEMS_ADVANCED; + } + else + { + resId = R_CAM_STILL_PRE_CAPTURE_AP_ITEMS_SECONDARY; + } + } + return resId; + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::SizeChanged +// Called by framework when the component size is changed +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureContainer::SizeChanged() + { + CCamPreCaptureContainerBase::SizeChanged(); + if ( iXenonFlashSupported ) + { + LayoutFlashIcon(); + } + } + + +// --------------------------------------------------------------------------- +// HandleForegroundEventL +// --------------------------------------------------------------------------- +// +void +CCamStillPreCaptureContainer::HandleForegroundEventL( TBool aForeground ) + { + PRINT( _L("Camera => CCamStillPreCaptureContainer::HandleForegroundEventL") ) + + CCamPreCaptureContainerBase::HandleForegroundEventL( aForeground ); + if ( iXenonFlashSupported ) + { + + // Subscribe / unsubscribe from flash related events + // When going to background -> unsubscribe + // Otherwise -> subscribe + SubscribeFlashEvents( aForeground ); + } + + PRINT( _L("Camera => CCamStillPreCaptureContainer::HandleForegroundEventL") ) + } + + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::FlashIconVisible +// Called when Xenon flash icon visibility changes +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureContainer::FlashIconVisible( TBool aVisible ) + { + PRINT( _L("Camera => CCamStillPreCaptureContainer::FlashIconVisible") ) + if( ECamActiveCameraSecondary == iController.ActiveCamera() ) + { + // Do not draw the flash icon even if visible, if using secondary + // camera, as it does not use the flash at all. + return; + } + + + if( ECamCapturing == iController.CurrentOperation() || + ECamCompleting == iController.CurrentOperation() ) + { + if ( !iFlashIconVisible && aVisible ) + { + // During capture, if flash icon is currently invisible, + // do not make it visible. Also if the state has not changed, + // we don't need to redraw anything + return; + } + } + + if( iFlashIconVisible != aVisible ) + { + // Icon state has changed. Redraw. + + iFlashIconVisible = aVisible; + + // State changed, need to redraw + ActivateGc(); + + // Invalidate the flash icon area + RWindow window = Window(); + window.Invalidate( iFlashIconRect ); + window.BeginRedraw( iFlashIconRect ); + + // Redraw the background in that area + Redraw( iFlashIconRect ); + + // Draw the flash icon itself + CWindowGc& gc = SystemGc(); + if( aVisible ) + { + DrawFlashIcon( gc ); + } + + // Tell the window redraw is finished and deactivate Gc + window.EndRedraw(); + DeactivateGc(); + } + PRINT( _L("Camera <= CCamStillPreCaptureContainer::FlashIconVisible") ) + } + + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::FlashError +// Called when there was an error while recharging +// the Xenon flash. +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureContainer::FlashError() + { + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::InitFlashIconL +// +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureContainer::InitFlashIconL() + { + iFlashIconVisible = EFalse; + + // Init flash icon bitmap and mask + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + + AknIconUtils::CreateIconL( iFlashBitmap, + iFlashBitmapMask, + resname, + EMbmCameraappQgn_indi_cam4_flash_on, + EMbmCameraappQgn_indi_cam4_flash_on_mask ); + + // Subscribe to blink events + if( CCamFlashStatus* flashStatus = iController.FlashStatus() ) + { + flashStatus->Subscribe( this ); + iFlashIconVisible = flashStatus->FlashIconVisible(); + PRINT( _L("Camera :: CCamStillPreCaptureContainer::InitFlashIconL - Flash events subscribed") ) + } + else + { + iFlashIconVisible = EFalse; + } + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::LayoutFlashIcon +// +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureContainer::LayoutFlashIcon() + { + // Set rectangle + TRect rect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, rect ); + TInt cba = AknLayoutUtils::CbaLocation() == + AknLayoutUtils::EAknCbaLocationLeft; + TAknLayoutRect parent; + parent.LayoutRect( rect, AknLayoutScalable_Apps::cam6_mode_pane( cba ) ); + TAknLayoutRect l; + l.LayoutRect( parent.Rect(), + AknLayoutScalable_Apps::cam6_mode_pane_g3( cba ) ); + iFlashIconRect = l.Rect(); + if( iFlashBitmap ) + { + AknIconUtils::SetSize( iFlashBitmap, iFlashIconRect.Size() ); + } + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::DrawFlashIcon +// +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureContainer::DrawFlashIcon( CBitmapContext& aGc ) const + { + if( iFlashBitmap ) + { + // aGc.DrawBitmap( iFlashIconRect, iFlashBitmap ); + aGc.BitBltMasked( iFlashIconRect.iTl, iFlashBitmap, iFlashIconRect.Size(), iFlashBitmapMask, ETrue ); + } + } + +// --------------------------------------------------------------------------- +// SubscribeFlashEvents +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureContainer::SubscribeFlashEvents( TBool aSubscribe ) + { + if( CCamFlashStatus* flashStatus = iController.FlashStatus() ) + { + if( aSubscribe ) + { + // Re-subscribe when going to foreground + // Duplicate subscription is acceptable since only one observer can subscribe to + // flash related events. + flashStatus->Subscribe( this ); + iFlashIconVisible = flashStatus->FlashIconVisible(); + PRINT( _L("Camera :: CCamStillPreCaptureContainer::SubscribeFlashEvents - Flash events subscribed") ) + } + else + { + // Un-subscribe when going to background + flashStatus->Subscribe( NULL ); + iFlashIconVisible = EFalse; + PRINT( _L("Camera :: CCamStillPreCaptureContainer::SubscribeFlashEvents - Flash events unsubscribed") ) + } + } + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::MakeVisible +// +// Used to subscribe / unsubscribe from flash events when the control is +// activated / deactivated (standby mode is enabled) +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureContainer::MakeVisible( TBool aVisible ) + { + PRINT1( _L("Camera => CCamPreCaptureContainerBase::MakeVisible %d"), aVisible ) + if ( iXenonFlashSupported ) + { + // Subscribe / unsubscribe from flash related events + // When going to background -> unsubscribe + // Otherwise -> subscribe + SubscribeFlashEvents( aVisible ); + + } + CCamPreCaptureContainerBase::MakeVisible( aVisible ); + PRINT( _L("Camera <= CCamPreCaptureContainerBase::MakeVisible") ) + } + + +// ----------------------------------------------------------------------------- +// CCamStillPreCaptureContainer::InitVfGridL +// ----------------------------------------------------------------------------- +// +void +CCamStillPreCaptureContainer::InitVfGridL( const TRect& /*aRect*/ ) + { + PRINT( _L("Camera => CCamStillPreCaptureContainer::InitVfGridL") ); + iVfGridRect = ViewFinderFrameRect(ECamControllerImage); + + // No vf grid in secondary camera. + if( ECamActiveCameraSecondary != iController.ActiveCamera() ) + { + // Create grid drawer if not done yet + if( !iVfGridDrawer ) + { + iVfGridDrawer = CCamVfGridFactory::CreateVfGridDrawerL( KGridDrawerUid ); + } + ResetVFGridVisibility(); + + PRINT( _L("Camera <> CCamStillPreCaptureContainer: Setting vf grid lines..") ); + + // Setting the lines for grid is specific operation + // for CCamLineVfGridDrawer class not defined in MCamVfGridDrawer interface. + CCamLineVfGridDrawer* ptr = static_cast( iVfGridDrawer ); + ptr->SetLinesL ( iVfGridRect, KGridHrzLines, KGridVrtLines, EFalse ); + ptr->SetPenStyle( KGridStyle ); + ptr->SetPenSize ( TSize( KGridThickness, KGridThickness ) ); + ptr->SetPenColor( KGridColor ); + } + else + { + PRINT( _L("Camera <> CCamStillPreCaptureContainer: Secondary cam active, no vf grid") ); + } + PRINT( _L("Camera <= CCamStillPreCaptureContainer::InitVfGridL") ); + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamStillPreCaptureView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamStillPreCaptureView.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,2178 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Still image pre-capture view class for Camera application* +*/ + + +// INCLUDE FILES +#include "CamAppUi.h" +#include "CamAppController.h" +#include "CamStillPreCaptureView.h" +#include "CamLogger.h" +#include "CamUtility.h" +#include "CamContainerBase.h" +#include "CamAppUiBase.h" +#include +#include +#include +#include "CamCaptureSetupMenu.h" +#include "CamPanic.h" +#include "Cam.hrh" +#include "CamAppUid.h" +#include +#include "CamShootingModeContainer.h" +#include "CamInfoListBoxContainer.h" +#include "CamStillPreCaptureContainer.h" +#include "CamSelfTimer.h" +#include "CamTimeLapseUtility.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "StringLoader.h" +#include "camactivepalettehandler.h" +#include "CameraUiConfigManager.h" + +#include "CamLocalViewIds.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamStillPreCaptureViewTraces.h" +#endif + + +// ========================= MEMBER FUNCTIONS ================================ + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamStillPreCaptureView* CCamStillPreCaptureView::NewLC( CCamAppController& aController ) + { + CCamStillPreCaptureView* self = + new( ELeave ) CCamStillPreCaptureView( aController ); + + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView destructor +// +// --------------------------------------------------------------------------- +// +CCamStillPreCaptureView::~CCamStillPreCaptureView() + { + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::Id +// Returns UID of view +// --------------------------------------------------------------------------- +// +TUid CCamStillPreCaptureView::Id() const + { + return TUid::Uid( ECamViewIdStillPreCapture ); + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::DoDeactivate() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_DODEACTIVATE, "e_CCamStillPreCaptureView_DoDeactivate 1" ); + PERF_EVENT_START_L2( EPerfEventStillPreCaptureViewDeactivation ); + PRINT( _L("Camera => CCamStillPreCaptureView::DoDeactivate" ) ) + + CCamPreCaptureViewBase::DoDeactivate(); + PERF_EVENT_END_L2( EPerfEventStillPreCaptureViewDeactivation ); + PRINT( _L("Camera <= CCamStillPreCaptureView::DoDeactivate" ) ) + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_DODEACTIVATE, "e_CCamStillPreCaptureView_DoDeactivate 0" ); + } + +// ----------------------------------------------------------------------------- +// CCamStillPreCaptureView::HandleCommandL +// Handle commands +// ----------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::HandleCommandL( TInt aCommand ) + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + TCamOrientation orientation = appUi->CamOrientation(); + switch ( aCommand ) + { + case ECamMSKCmdSelect: + case ECamMSKCmdAppCapture: + { + if( orientation == ECamOrientationCamcorder || + orientation == ECamOrientationCamcorderLeft || + orientation == ECamOrientationPortrait ) + { + if ( !StartMskCaptureL() ) + { + // If in the Landscape mode, MSK event is mapped + // like a normal selection key so that AP items + // are selected and respective setting pages are launched + TKeyEvent aKeyEvent; + aKeyEvent.iCode = aKeyEvent.iRepeats = aKeyEvent.iModifiers = 0; + aKeyEvent.iScanCode = EStdKeyDevice3; + static_cast + ( Container() )->OfferKeyEventL( aKeyEvent, EEventKey ); + } + } + else if ( aCommand == ECamMSKCmdAppCapture ) + // if the Camera in the Portrait mode + // MSK event is handled like a capture key + { + if ( iController.IsViewFinding() && appUi->CheckMemoryL() ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_SHOT_TO_SNAPSHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SNAPSHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SAVE 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SHOT_TO_SHOT 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_SHOT_TO_STILL 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_CAPTURE_START 1" ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP6_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_PRI_SERIAL_SHOOTING 1" ); + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + iController.Capture(); + } + } + break; + } + case ECamCmdCaptureImage: + { + if ( iController.IsViewFinding() && appUi->CheckMemoryL() && + !iController.CaptureModeTransitionInProgress() && + !iController.IsProcessingCapture() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + + // Start the autofocus operation now, the capture will be queued + // after focus completes + if ( !appUi->SelfTimerEnabled() + && iController.ActiveCamera() != ECamActiveCameraSecondary + && iController.UiConfigManagerPtr() + && iController.UiConfigManagerPtr()->IsAutoFocusSupported() + && !iController.CurrentSceneHasForcedFocus() ) + { + if( iController.CurrentOperation() == ECamNoOperation ) + { + iController.SetAfNeeded( ETrue ); + } + OstTrace0( CAMERAAPP_PERFORMANCE, DUP7_CCAMSTILLPRECAPTUREVIEW_HANDLECOMMANDL, "e_CAM_APP_AF 1" ); + iController.StartAutoFocus(); + } + TKeyEvent keyEvent; + appUi->StartCaptureL( keyEvent ); + + } + break; + } + case ECamCmdTimeLapseSlider: + { + TCamTimeLapse settingValue = ECamTimeLapseOff; + + if ( appUi && !appUi->IsBurstEnabled() ) + { + settingValue = ECamTimeLapseMin; + } + + TInt command = CamTimeLapseUtility::EnumToCommand( settingValue ); + TTimeIntervalMicroSeconds interval = CamTimeLapseUtility::EnumToInterval( settingValue ); + + // Update the current mode (single/burst/timelapse) + if( appUi ) + { + TRAP_IGNORE( appUi->HandleCommandL( command ) ); + } + + // Update timelapse interval + iController.SetTimeLapseInterval( interval ); + + // stop and start the viewfinder in order to update the settings + StopViewFinder(); + StartViewFinder(); + + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + UpdateToolbarIconsL(); + } + + } + break; + + case ECamCmdCaptureSetupLightSensitivityStill: + // case ECamCmdCaptureSetupLightSensitivityVideo: + { + SwitchToInfoListBoxL( EInfoListBoxModeISO ); + } + break; + + case ECamCmdGoToStandby: + { + // SwitchToStandbyModeL( ECamViewIdStillPreCapture, iStandbyError ); + SwitchToStandbyModeL( ECamViewIdStillPreCapture, appUi->StandbyStatus() ); + } + break; + case ECamCmdExitStandby: + { + ExitStandbyModeL(); + } + break; + case ECamCmdViewfinderGrid: + { + // Switch grid setting + CCamPreCaptureViewBase::HandleCommandL( aCommand ); + UpdateToolbarIconsL(); + } + break; + case ECamCmdToggleFacetracking: + { + // Switch facetracking setting + CCamPreCaptureViewBase::HandleCommandL( aCommand ); + UpdateToolbarIconsL(); + + break; + } + default: + { + CCamPreCaptureViewBase::HandleCommandL( aCommand ); + } + } + } + +// ----------------------------------------------------------------------------- +// CCamStillPreCaptureView::HandleForegroundEventL +// Handle foreground event +// ----------------------------------------------------------------------------- +// +void +CCamStillPreCaptureView::HandleForegroundEventL( TBool aForeground ) + { + PRINT( _L("Camera => CCamStillPreCaptureView::HandleForegroundEventL") ); + + CCamAppUi* appUi = static_cast( AppUi() ); + + // ------------------------------------------------------- + // Foreground + // + // reset menu and cba as appropriate + if( aForeground ) + { + PRINT( _L("Camera <> CCamStillPreCaptureView::HandleForegroundEventL: to foreground") ); + PRINT1( _L("Camera <> CCamStillPreCaptureView .. Current controller operation [%s]"), KCamCaptureOperationNames[iController.CurrentOperation()] ); + PRINT1( _L("Camera <> CCamStillPreCaptureView .. Current controller mode [%s]"), KCamModeNames[iController.CurrentMode()] ); + + + if( iController.SequenceCaptureInProgress() ) + { + PRINT( _L("Camera <= CCamStillPreCaptureView::HandleForegroundEventL: sequence capture ongoing") ); + return; + } + + if ( appUi->IsInPretendExit() ) + { + PRINT( _L("Camera <= CCamStillPreCaptureView::HandleForegroundEventL: app in pretend exit so not grabbing resources") ) + // The view can get a foreground event while the application is + // actually in a pretend exit situation. This occurs when the view switch + // was called before the exit event, but didn't complete until after the + // exit event. In this case the view should not register an interest in + // the engine as the application is really in the background and the resources + // need to be released + return; + } + // if foreground event is received while in videocall, go to standby with error + if ( iController.InVideocallOrRinging() && ECamNoOperation == iController.CurrentOperation() ) + { + ExitAllModesL(); + appUi->SetStandbyStatus( KErrInUse ); + appUi->HandleCommandL( ECamCmdGoToStandby ); + SetTitlePaneTextL(); + return; + } + + // check for silent profile whenever we come to foreground, we dont need it here, + // but we keep track of this in appcontroller. + iController.IsProfileSilent(); + + // set embedded flag here + iEmbedded = appUi->IsEmbedded(); + // make sure CBA is correct + UpdateCbaL(); + + SetMenuBar(); + + if ( iContinueInBackground ) + { + // make sure that CCamAppController is in view finder mode + if ( iController.CurrentImageMode() == ECamImageCaptureNone ) + { + StartViewFinder(); + } + } + } + // ------------------------------------------------------- + // Background + // + // If going to the background, cancel any current autofocus. + // This makes sure that the focus indicator is removed from the side pane + // if the key release event is lost. + // Cancelling focus does nothing if a capture has already been requested + else + { + PRINT( _L("Camera <> CCamStillPreCaptureView::HandleForegroundEventL: to background") ); + // Cancel any outstanding capture + iController.CancelFocusAndCapture(); + + // stop any current sequence capture unless it is only a notification + if( iController.SequenceCaptureInProgress() + && ( appUi->AppInBackground( EFalse ) + || appUi->ForegroundAppIsPhoneApp() + ) + ) + { + iController.StopSequenceCaptureL(); + } + /* + // stop any current sequence capture unless it is only an eikon server or AknCapServer window + if ( iCoeEnv->WsSession().GetFocusWindowGroup() != iEikonServerWindowGroupId + && iController.SequenceCaptureInProgress() ) + { + TInt groupId = iCoeEnv->WsSession().GetFocusWindowGroup(); + if ( !CamUtility::IdMatchesName( groupId, KAknCapServer ) ) + { + // If AknCapServer has NOT got foreground, (which would possibly + // indicate a "charging" note) stop sequence capture + iController.StopSequenceCaptureL(); + } + } + */ + } + + CCamPreCaptureViewBase::HandleForegroundEventL( aForeground ); + + PRINT( _L("Camera <= CCamStillPreCaptureView::HandleForegroundEventL") ); + } + +// ----------------------------------------------------------------------------- +// CCamStillPreCaptureView::HandleFocusLossL +// Handle change of focus +// ----------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::HandleFocusLossL() + { + PRINT( _L( "Camera => CCamStillPreCaptureView::HandleFocusLossL" ) ); + // if the application was already in the background, but behind an + // eikon server window, then handle backgrounding properly now. + // Otherwise the backgrounding will be handled in the normal + // HandleForeground() method. + if ( iContinueInBackground ) + { + if ( iController.SequenceCaptureInProgress() ) + { + iController.StopSequenceCaptureL(); + } + } + CCamPreCaptureViewBase::HandleFocusLossL(); + PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleFocusLossL" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamStillPreCaptureView::HandleControllerEventL +// Handle controller events +// ----------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ) + { + PRINT( _L("Camera => CCamStillPreCaptureView::HandleControllerEventL") ); + + CCamAppUi* appUi = static_cast( AppUi() ); + if ( ECamEventControllerReady == aEvent ) + { + iSoftkeyBlankIsNeeded = EFalse; + UpdateCbaL(); + } + else if ( aEvent == ECamEventOperationStateChanged ) + { + PRINT( _L("Camera <> CCamStillPreCaptureView: ECamEventOperationStateChanged") ); + TCamCaptureOperation operation = iController.CurrentOperation(); + switch ( operation ) + { + case ECamCompleting: + { + UpdateCbaL(); + break; + } + + case ECamFocusing: + { + // Hide the AP during focussing + if ( appUi->AlwaysDrawPreCaptureCourtesyUI() + && !iController.CurrentSceneHasForcedFocus() ) + { + appUi->SetActivePaletteVisibility( EFalse ); + } + break; + } + + case ECamFocused: + { + // Hide the AP during focussing + if ( appUi->AlwaysDrawPreCaptureCourtesyUI() + && !iController.CurrentSceneHasForcedFocus() ) + { + appUi->SetActivePaletteVisibility( EFalse ); + } + UpdateCbaL(); + break; + } + + case ECamNoOperation: + { + if( iController.IsAppUiAvailable() ) + { + //Update softkey state. + UpdateCbaL(); + + // Hide the AP if we already have an autofocus request but operation doesn't + // have it (likely shutter was half-pressed before precap view opened) + if ( iController.PendingAFRequest() != 0 && + appUi->AlwaysDrawPreCaptureCourtesyUI() && + !iController.CurrentSceneHasForcedFocus() ) + { + appUi->SetActivePaletteVisibility( EFalse ); + UpdateCbaL(); + } + + // Show the AP again if the shutter key is released + // without taking a picture, don't show if uiorientationoverride + // feature is on and VF not running (prevents AP flashing in startup) + if ( iPreviousControllerOperation !=ECamStandby && + appUi->CurrentViewState() == ECamViewStatePreCapture && + appUi->AlwaysDrawPreCaptureCourtesyUI() && + !iSceneSettingModeActive && + !( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && + !iController.IsViewFinding() ) ) + { + appUi->SetActivePaletteVisibility( ETrue ); + } + } + + break; + } + + case ECamCapturing: + { + // If in burst, make sure the correct CBA is shown + if( appUi->IsBurstEnabled() ) + { + UpdateCbaL(); + // show image counter + iContainer->SetupNaviPanesL( CCamContainerBase::ECamPaneCounter ); + } + break; + } + default: + { + // Hide the AP if we already have an autofocus request but operation doesn't + // have it (likely shutter was half-pressed before precap view opened) + if ( iController.PendingAFRequest() != 0 && + appUi->AlwaysDrawPreCaptureCourtesyUI() && + !iController.CurrentSceneHasForcedFocus() ) + { + appUi->SetActivePaletteVisibility( EFalse ); + UpdateCbaL(); + } + break; + } + } + + iPreviousControllerOperation = operation; + + } + else + { + PRINT( _L("Camera <> CCamStillPreCaptureView: call CCamPreCaptureViewBase::HandleControllerEventL") ); + CCamPreCaptureViewBase::HandleControllerEventL( aEvent, aError ); + } + PRINT( _L("Camera <= CCamStillPreCaptureView::HandleControllerEventL") ); + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::CreateCaptureSetupMenuL +// Creates a photo capture setup menu +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::CreateCaptureSetupMenuL( ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_CREATECAPTURESETUPMENUL, "e_CCamStillPreCaptureView_CreateCaptureSetupMenuL 1" ); + TInt resource; + // check if we are Western or Arabic/Hebrew layout + if ( !AknLayoutUtils::LayoutMirrored() ) + { + // Do we need APAC layout + if( AknLayoutUtils::Variant() == EApacVariant ) + { + resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_APAC_ID); + } + else + { + // use Western resource + resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_ID); + } + } + else + { + resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_AH_ID); + } + + // Use capture setup menu for second camera + if ( static_cast( AppUi() )->IsSecondCameraEnabled() ) + { + resource = ROID(R_CAM_CAPTURE_SETUP_MENU_PHOTO_DATA_ID); + } + + iCaptureSetupMenuContainer = + CCamCaptureSetupMenu::NewL( iController, *this, AppUi()->ClientRect(), + resource, iCaptureSetupMenuLastItemIndex ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_CREATECAPTURESETUPMENUL, "e_CCamStillPreCaptureView_CreateCaptureSetupMenuL 0" ); + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::SetMenuBar() +// Sets the menu bar according to camera state +// --------------------------------------------------------------------------- +// +void +CCamStillPreCaptureView::SetMenuBar() + { + PRINT( _L("Camera => CCamStillPreCaptureView::SetMenuBar") ); + + // update menu bar as required + CEikMenuBar* menuBar = MenuBar(); + + // if menuBar exists + if ( menuBar ) + { + if ( iStandbyModeActive ) //&& iActivateToStandby ) + { + PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting standby menubar..") ); + menuBar->SetMenuTitleResourceId( R_CAM_STANDBY_MENUBAR ); + } + else if ( iEmbedded && !iSceneSettingModeActive ) + { + PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting embedded menubar..") ); + menuBar->SetMenuTitleResourceId( ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID)); + } + else + { + if ( iSceneSettingModeActive ) + { + PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting scene setting menubar..") ); + menuBar->SetMenuTitleResourceId( ROID(R_CAM_SCENE_SETTING_MENUBAR_ID)); + } + else + { + PRINT( _L("Camera <> CCamStillPreCaptureView::SetMenuBar: setting normal menubar..") ); + menuBar->SetMenuTitleResourceId( ROID(R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID)); + } + } + } + PRINT( _L("Camera <= CCamStillPreCaptureView::SetMenuBar") ); + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::CCamStillPreCaptureView +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamStillPreCaptureView::CCamStillPreCaptureView( CCamAppController& aController ) + : CCamPreCaptureViewBase( aController ),iSoftkeyBlankIsNeeded( EFalse ) + { + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::ConstructL() + { + BaseConstructL( ROID(R_CAM_STILL_PRE_CAPTURE_VIEW_ID)); + + iPreviousControllerOperation = ECamNoOperation; + + CCamPreCaptureViewBase::ConstructL(); + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateCbaL +// Update softkeys to reflect current state +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateCbaL() + { + PRINT( _L("Camera => CCamStillPreCaptureView::UpdateCbaL") ); + + CCamAppUi* appui = static_cast( AppUi() ); + TBool burstEnabled = appui->IsBurstEnabled(); + + TCamCaptureOperation operation = iController.CurrentOperation(); + TBool isSecondaryPortrait = appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera(); + if ( iSoftkeyBlankIsNeeded ) + { + isSecondaryPortrait?SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_EXIT_SECONDARY ):SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_EXIT ); + } + // if video call is active + else if ( iController.InVideocallOrRinging() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); + } + // if the view is in capture setup menu mode + else if ( iCaptureSetupMenuModeActive && + !iCaptureSetupModeActive && + !iSceneSettingModeActive ) + { + SetSoftKeysL( R_AVKON_SOFTKEYS_SELECT_BACK ); + } + // if the view is in capture setup mode + else if ( iCaptureSetupModeActive ) + { + SetSoftKeysL( R_AVKON_SOFTKEYS_OK_CANCEL__OK ); + } + // if the view is in scene settings mode + else if ( iSceneSettingModeActive ) + { + SetSoftKeysL( R_AVKON_SOFTKEYS_SELECT_CANCEL ); + } + else if ( iStandbyModeActive ) + { + PRINT( _L("Camera <> CCamStillPreCaptureView::UpdateCbaL: Setting standby softkeys..") ); + if( KErrNone == appui->StandbyStatus() ) + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CONTINUE ); + else + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); + } + else if( iInfoListBoxActive ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE ); + } + else if ( ( operation == ECamFocusing || operation == ECamFocused || operation == ECamFocusFailed ) + && !iController.CurrentSceneHasForcedFocus() ) + { + // If AutoFocus operation in progress. Can occur for still or + // burst capture + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + // If timelapse capture is ongoing the keys should be blank and cancel + else if ( burstEnabled && + appui->CurrentBurstMode() == ECamImageCaptureTimeLapse && + iController.SequenceCaptureInProgress() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP ); + } + // If "Burst" capture is starting + else if ( burstEnabled && operation == ECamCapturing ) + { + + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_STOP ); + + } + // If "Burst" capture is completing + else if ( burstEnabled && operation == ECamCompleting ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + else if ( appui->SelfTimerEnabled() ) + { + // If self-timer enabled, check the precise state to show the + // correct CBA state. + CCamSelfTimer* selftimer = appui->SelfTimer(); + if ( selftimer->IsActive() ) + { + { + SetSoftKeysL( R_CAM_SOFTKEYS_SELFTIMER_BLANK_CANCEL ); + } + } + else if( iEmbedded && operation == ECamCompleting ) + { + isSecondaryPortrait?SetSoftKeysL( R_CAM_SOFTKEYS_BLANK_SECONDARY ):SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_ACTIVATE_CANCEL__SELECT ); + } + } + else // otherwise, show the default softkeys + { + // options key is disabled if currently in capture mode + // transition (i.e. switching to video mode) + if ( iController.CaptureModeTransitionInProgress() ) + { + SetSoftKeysL( iEmbedded + ? R_CAM_SOFTKEYS_BACK + : R_CAM_SOFTKEYS_BLANK_EXIT ); + if(iEmbedded ) + { + if(isSecondaryPortrait) + { + SetSoftKeysL(R_CAM_SOFTKEYS_BACK_SECONDARY); + } + else + { + SetSoftKeysL(R_CAM_SOFTKEYS_BACK); + } + } + else + { + if(isSecondaryPortrait) + { + SetSoftKeysL(R_CAM_SOFTKEYS_BLANK_EXIT_SECONDARY); + } + else + { + SetSoftKeysL(R_CAM_SOFTKEYS_BLANK_EXIT); + } + } + } + else + { + if ( iEmbedded ) + { + if ( operation == ECamCapturing || operation == ECamCompleting ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + else + { + if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE_SECONDARY ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__CAPTURE ); + } + + } + } + else + { + if ( operation != ECamCompleting + && ( !appui->ShowPostCaptureView() + || iController.IsViewFinding() ) ) + { + const TCamOrientation orientation = appui->CamOrientation(); + if ( iController.IsTouchScreenSupported() + && (ECamOrientationCamcorder == orientation + || ECamOrientationCamcorderLeft == orientation) ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE ); + } + else + { + if ( !appui->IsToolBarVisible() + && appui->IsSecondCameraEnabled() + && !iController.IsTouchScreenSupported() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_TXT ); + } + else + { + appui->IsSecondCameraEnabled()?SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE_SECONDARY ): + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CAPTURE ); + } + } + } + else // operation == ECamCompleting + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + + } + } + } + PRINT( _L("Camera <= CCamStillPreCaptureView::UpdateCbaL") ); + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::SetTitlePaneTextL +// Set the view's title text +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::SetTitlePaneTextL() + { + CCamAppUi* appUi = static_cast( AppUi() ); +#ifndef __WINS__ + if ( iEmbedded /*&& !appUi->IsInCallSend()*/ ) + { + // only set the title if the construction is complete + // otherwise the application is not yet set up correctly + // as embedded + if ( appUi->IsConstructionComplete() ) + { + // set title to name of embedding application + appUi->SetTitleEmbeddedL(); + } + } + else +#endif + { + TInt titleResourceId = R_CAM_STILL_PRE_CAPTURE_TITLE_NAME; + + if ( iCaptureSetupModeActive || iSceneSettingModeActive || iInfoListBoxActive ) + { + titleResourceId = CCamCaptureSetupViewBase::SetupModeTitlePaneResourceId(); + } + + appUi->SetTitleL( titleResourceId ); + } + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::StartViewFinder +// Enter viewfinder mode +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::StartViewFinder() + { + iController.EnterViewfinderMode( ECamControllerImage ); + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::StopViewFinder +// Exit viewfinder mode +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::StopViewFinder() + { + iController.ExitViewfinderMode( ECamControllerImage ); + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::CreateContainerL +// Create container control +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::CreateContainerL() + { + PRINT( _L("Camera => CCamStillPreCaptureView::CreateContainerL" ) ) + + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + iContainer = CCamStillPreCaptureContainer::NewL( + iController, + *this, + screen ); + iContainer->SetMopParent( this ); + PRINT( _L("Camera <= CCamStillPreCaptureView::CreateContainerL" ) ) + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::DynInitMenuPaneL +// Changes MenuPane dynamically +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) + { + PRINT( _L("Camera => CamStillPreCaptureView::DynInitMenuPaneL")) + + if ( iContainer ) + { + iContainer->Window().SetNonFading( ETrue ); + } + + CCamAppUi* appUi = static_cast( AppUi() ); + __ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer)); + TInt itemPos(0); + if( aMenuPane->MenuItemExists(ECamCmdToggleCourtesyUI, itemPos) ) + { + if ( !appUi->AlwaysDrawPreCaptureCourtesyUI() ) + { + aMenuPane->SetItemTextL( ECamCmdToggleCourtesyUI, + R_CAM_CAPTURE_DISPLAY_ON_TEXT); + } + } + + // if menu pane is default still capture menu + if ( aResourceId == ROID(R_CAM_STILL_PRE_CAPTURE_MENU_ID)) + { + DynInitSwitchCameraMenuItemL( aMenuPane ); + } +// else if ( aResourceId == R_CAM_STANDBY_MENU && iStandbyError != KErrNone ) + else if ( aResourceId == R_CAM_STANDBY_MENU ) + { + if( appUi->StandbyStatus() != KErrNone ) + aMenuPane->SetItemDimmed( ECamCmdExitStandby, ETrue ); + } + + else if( aResourceId == ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENU_ID)) + { + DynInitSwitchCameraMenuItemL( aMenuPane ); + +/*#ifndef __WINS__ + // if embedded and not in in-call send + if ( !appUi->IsInCallSend() ) +#endif + { + aMenuPane->SetItemDimmed( ECamCmdNewVideo, ETrue ); + }*/ + aMenuPane->SetItemDimmed( ECamCmdNewVideo, ETrue ); + } + else // otherwise, not embedded, not in burst mode or menu pane is not default + { + CCamCaptureSetupViewBase::DynInitMenuPaneL( aResourceId, aMenuPane ); + } + PRINT( _L("Camera <= CamStillPreCaptureView::DynInitMenuPaneL")) + } + + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::SwitchToSceneSettingModeL +// Switches the current mode to scene setting and activates a +// specific control. +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::SwitchToSceneSettingModeL() + { + if ( !iSceneSettingContainer ) + { + iSceneSettingContainer = CCamShootingModeContainer::NewL( AppUi()->ApplicationRect(), + *this, + ECamControllerImage, + iController ); + iSceneSettingContainer->DrawableWindow()->SetOrdinalPosition(-1); + } + + iSettingModeTitleResourceId = R_CAM_STILL_SCENE_SETTING_TITLE; + + if ( iEmbedded ) + { + iPreviousMenuResourceId = ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID); + } + else + { + iPreviousMenuResourceId = ROID(R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID); + } + // Remove the view's main container, and add the capture setup + // control associated with the input command to the container stack. + //CCamCaptureSetupViewBase::SwitchToSceneSettingModeL(); + + CCamPreCaptureViewBase::SwitchToSceneSettingModeL(); + + + // only remove the capture setup menu container after + // the switch completes successfully + RemoveCaptureSetupMenuContainers(); + + // Stop the viewfinder as it isn't required for scene settings + StopViewFinder(); + } + + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::SwitchToInfoListBoxL +// Switches the current mode to scene setting and activates a +// specific control. +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::SwitchToInfoListBoxL( TCamInfoListBoxMode aMode ) + { + CCamAppUi* appUi = static_cast( iCoeEnv->AppUi() ); + + TBool modeSelected = EFalse; + TInt listBoxResource; + TInt summaryResource; + TInt initialValue; + TInt titleResource; + + switch( aMode ) + { + case EInfoListBoxModeTimeLapse: + { + // Find out whether we are in burst mode + TBool burstmode = EFalse; + + // if capturing burst with 0 interval then this is normal sequence mode + if ( appUi->IsBurstEnabled() ) + { + burstmode = ETrue; + } + + // Time lapse / sequence mode selector initialization values + initialValue = CamTimeLapseUtility::IntervalToEnum( iController.TimeLapseInterval(), burstmode ); + listBoxResource = R_CAM_CAPTURE_SETUP_LIST_SEQUENCE_MODE; + summaryResource = R_CAM_CAPTURE_SETUP_LIST_SEQUENCE_MODE_SUMMARY; + titleResource = R_CAM_TIME_LAPSE_TITLE; + + modeSelected = ETrue; + } + break; + + case EInfoListBoxModeISO: + { + // Light sensitivity selector initialization values + initialValue = iController.IntegerSettingValue( ECamSettingItemDynamicPhotoLightSensitivity ); + if ( iController.UiConfigManagerPtr()->IsExtendedLightSensitivitySupported() ) + { + listBoxResource = R_CAM_CAPTURE_SETUP_LIST_EXTENDED_LIGHT_SENSITIVITY; + summaryResource = R_CAM_CAPTURE_SETUP_LIST_EXTENDED_LIGHT_SENSITIVITY_SUMMARY; + } + else + { + listBoxResource = R_CAM_CAPTURE_SETUP_LIST_LIGHT_SENSITIVITY; + summaryResource = R_CAM_CAPTURE_SETUP_LIST_LIGHT_SENSITIVITY_SUMMARY; + } + titleResource = R_CAM_LIGHT_SENSITIVITY_TITLE; + modeSelected = ETrue; + } + break; + + default: + break; + } + + if( modeSelected ) + { + iInfoListBoxContainer = CCamInfoListBoxContainer::NewL( AppUi()->ApplicationRect(), + *this, + iController, + listBoxResource, + summaryResource, + initialValue, titleResource ); + iInfoListBoxContainer->DrawableWindow()->SetOrdinalPosition(-1); + iInfoListBoxMode = aMode; + iSettingModeTitleResourceId = titleResource; + + if ( iEmbedded ) + { + iPreviousMenuResourceId = ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID); + } + else + { + iPreviousMenuResourceId = ROID(R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID); + } + // Remove the view's main container, and add the capture setup + // control associated with the input command to the container stack. + CCamCaptureSetupViewBase::SwitchToInfoListBoxL( aMode ); + + // only remove the capture setup menu container after + // the switch completes successfully + RemoveCaptureSetupMenuContainers(); + + // Stop the viewfinder + StopViewFinder(); + } + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::DoActivateL +// Activate this view +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_DOACTIVATEL, "e_CCamStillPreCaptureView_DoActivateL 1" ); + PRINT( _L("Camera => CCamStillPreCaptureView::DoActivateL") ); + PERF_EVENT_START_L2( EPerfEventStillPreCaptureViewActivation ); + // Ensure the correct menu is used for the current mode. + + // If we are coming back from settings plugin wait for the sequence to complete + // during that time, update the softkey with BLANK_EXIT softkey + if ( TUid::Uid ( EAknSoftkeyBack ) == aCustomMessageId ) + { + iSoftkeyBlankIsNeeded = ETrue; + } + CCamAppUi* appUi = static_cast( AppUi() ); + + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + if ( appUi && appUi->IsEmbedded() ) + { + CAknToolbar* toolbar = Toolbar(); + toolbar->SetToolbarVisibility(EFalse); + } + + UpdateToolbarIconsL(); + } + else + { + // handled in CamPreCaptureViewBase + } + if ( appUi ) + { + // inform appui of current capture mode + TCamImageCaptureMode mode = appUi->CurrentBurstMode(); + + if ( ECamImageCaptureNone != mode ) + { + appUi->SetCaptureMode( ECamControllerImage, mode ); + } + else + { + appUi->SetCaptureMode( ECamControllerImage, ECamImageCaptureSingle ); + } + } + + + CCamPreCaptureViewBase::DoActivateL( aPrevViewId, + aCustomMessageId, + aCustomMessage ); + + + SetMenuBar(); + + + PERF_EVENT_END_L2( EPerfEventStillPreCaptureViewActivation ); + PRINT( _L("Camera <= CCamStillPreCaptureView::DoActivateL") ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_DOACTIVATEL, "e_CCamStillPreCaptureView_DoActivateL 0" ); + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::GetHelpContext +// Called to identify the help context for this view +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::GetHelpContext( TCoeHelpContext& aContext ) const + { + aContext.iMajor = TUid::Uid( KCameraappUID ); + + // First check to see if the scene settings list is open + if ( iSceneSettingModeActive ) + { + aContext.iContext = KLCAM_HLP_SCENES_PHOTO; + } + else if( iInfoListBoxActive && EInfoListBoxModeTimeLapse == iInfoListBoxMode ) + { + + // aContext.iContext = KLCAM_HLP_SCENES_PHOTO; + aContext.iContext = KLCAM_HLP_ADVANCED_SEQUENCE; + } + else if( iInfoListBoxActive && EInfoListBoxModeISO == iInfoListBoxMode ) + { + + // aContext.iContext = KLCAM_HLP_SCENES_PHOTO; + aContext.iContext = KLCAM_HLP_LIGHT_SENSITIVITY; + } + // Else check for standby mode + else if ( iStandbyModeActive ) + { + // Also check to see if this is embedded standby + if ( iEmbedded ) + { + aContext.iContext = KLCAM_HLP_STANDYBY_EM; + } + else + { + aContext.iContext = KLCAM_HLP_STANDYBY_EM; + } + } + // Else check for embedded mode + else if ( iEmbedded ) + { + aContext.iContext = KLCAM_HLP_VIEWFINDER_PHOTO_EM; + } + // Else this is the plain photo viewfinder + else + { + aContext.iContext = KLCAM_HLP_VIEWFINDER_PHOTO; + } + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::DynInitToolbarL +// Dynamically initialize toolbar contents +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::DynInitToolbarL( TInt aResourceId, + CAknToolbar* aToolbar ) + { + PRINT2( _L("Camera => CCamStillPreCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ); + (void)aResourceId; // remove compiler warning + + CCamAppUi* appUi = static_cast( AppUi() ); + iController.StartIdleTimer(); + + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + UpdateToolbarIconsL(); + if( aToolbar ) + { + if ( iEmbedded && appUi->IsSecondCameraEnabled() ) + { + aToolbar->SetItemDimmed(ECamCmdNewVideo, ETrue, ETrue); + } + CAknToolbarExtension* extension = aToolbar->ToolbarExtension(); + + if( extension ) + { + + if ( iEmbedded ) + { + extension->HideItemL( ECamCmdNewVideo, ETrue ); + extension->HideItemL( ECamCmdTimeLapseSlider, ETrue ); + extension->HideItemL( ECamCmdPhotos, ETrue ); + } + else + { + extension->HideItemL( ECamCmdNewVideo, EFalse ); + extension->HideItemL( ECamCmdToggleFacetracking, EFalse ); + extension->HideItemL( ECamCmdPhotos, EFalse ); + } + if(aResourceId == ECamCmdToolbarExtension) + { + appUi->ZoomPane()->MakeVisible(EFalse,ETrue); + } + } + } + } + + PRINT2( _L("Camera <= CCamStillPreCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ); + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateToolbarIconsL +// Update fixed toolbar icons according to current settings +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateToolbarIconsL() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMSTILLPRECAPTUREVIEW_UPDATETOOLBARICONSL, "e_CCamStillPreCaptureView_UpdateToolbarIconsL 1" ); + // fixed toolbar is used only with touch devices + if(!iController.IsTouchScreenSupported()) + return; + UpdateFlashIconsL(); + UpdateLightSensitivityIconsL(); + UpdateColorToneIconsL(); + UpdateWhiteBalanceIconsL(); + UpdateSharpnessIconsL(); + UpdateExposureIconsL(); + UpdateContrastIconsL(); + UpdateSceneModeIconsL(); + UpdateSelfTimerIconsL(); + UpdateVFGridIconsL(); + UpdateBurstModeIconsL(); + UpdateFaceTracKingIconsL(); + RedrawToolBar(); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMSTILLPRECAPTUREVIEW_UPDATETOOLBARICONSL, "e_CCamStillPreCaptureView_UpdateToolbarIconsL 0" ); + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateFlashIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateFlashIconsL() + { + CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupFlashStill); + if(!button) + return; + TCamFlashId flash = static_cast< TCamFlashId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoFlash ) ); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + switch(flash) + { + case ECamFlashAuto: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_autoflash, + EMbmCameraappQgn_indi_cam4_autoflash_mask, + skinInstance, + KAknsIIDQgnIndiCam4Autoflash ); + + break; + } + case ECamFlashOff: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_flash_off, + EMbmCameraappQgn_indi_cam4_flash_off_mask, + skinInstance, + KAknsIIDQgnIndiCam4FlashOff ); + break; + } + case ECamFlashAntiRedEye: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_antired, + EMbmCameraappQgn_indi_cam4_antired_mask, + skinInstance, + KAknsIIDQgnIndiCam4Antired ); + break; + } + case ECamFlashForced: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_flash_on, + EMbmCameraappQgn_indi_cam4_flash_on_mask, + skinInstance, + KAknsIIDQgnIndiCam4FlashOn ); + break; + } + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateContrastIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateContrastIconsL() + { + CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupContrastStill); + if ( button ) + { + if ( !iController.UiConfigManagerPtr()->IsContrastSupported() ) + { + HideButton(ECamCmdCaptureSetupContrastStill); + return; + } + TInt contrast = iController.IntegerSettingValue( ECamSettingItemDynamicPhotoContrast ); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + if (contrast > 0) + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_contrast_plus, + EMbmCameraappQgn_indi_cam4_contrast_plus_mask, + skinInstance, + KAknsIIDQgnIndiCam4ContrastPlus ); + } + else if (contrast < 0) + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_contrast_minus, + EMbmCameraappQgn_indi_cam4_contrast_minus_mask, + skinInstance, + KAknsIIDQgnIndiCam4ContrastMinus ); + } + else + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_contrast, + EMbmCameraappQgn_indi_cam4_contrast_mask, + skinInstance, + KAknsIIDQgnIndiCam4Contrast ); + } + } + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateExposureIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateExposureIconsL() + { + CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupExposureStill ); + if ( button ) + { + if ( !iController.UiConfigManagerPtr()->IsEVSupported() ) + { + HideButton(ECamCmdCaptureSetupExposureStill); + return; + } + TInt exposure = iController.IntegerSettingValue( ECamSettingItemDynamicPhotoExposure ); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + if (exposure > 0) + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_exposure_plus, + EMbmCameraappQgn_indi_cam4_exposure_plus_mask, + skinInstance, + KAknsIIDQgnIndiCam4ExposurePlus ); + } + else if (exposure < 0) + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_exposure_minus, + EMbmCameraappQgn_indi_cam4_exposure_minus_mask, + skinInstance, + KAknsIIDQgnIndiCam4ExposureMinus ); + } + else + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_exposure, + EMbmCameraappQgn_indi_cam4_exposure_mask, + skinInstance, + KAknsIIDQgnIndiCam4Exposure ); + } + } + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateSharpnessIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateSharpnessIconsL() + { + CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupImageSharpnessStill); + if ( button ) + { + if ( !iController.UiConfigManagerPtr()->IsSharpnessFeatureSupported() ) + { + HideButton(ECamCmdCaptureSetupImageSharpnessStill); + return; + } + TCamImageSharpnessId sharpness = + static_cast< TCamImageSharpnessId > + ( iController.IntegerSettingValue( + ECamSettingItemDynamicPhotoImageSharpness ) ); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + static_cast< TCamImageSharpnessId > + ( iController.IntegerSettingValue( + ECamSettingItemDynamicPhotoImageSharpness ) ); + + switch ( sharpness ) + { + case ECamImageSharpnessHard: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_sharpness_hard, + EMbmCameraappQgn_indi_cam4_sharpness_hard_mask, + skinInstance, + KAknsIIDQgnIndiCam4SharpnessHard ); + break; + } + case ECamImageSharpnessNorm: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_sharpness_normal, + EMbmCameraappQgn_indi_cam4_sharpness_normal_mask, + skinInstance, + KAknsIIDQgnIndiCam4SharpnessNormal ); + break; + } + case ECamImageSharpnessSoft: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_sharpness_soft, + EMbmCameraappQgn_indi_cam4_sharpness_soft_mask, + skinInstance, + KAknsIIDQgnIndiCam4SharpnessSoft ); + break; + } + default: + { + break; + } + } + } + + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateWhiteBalanceIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateWhiteBalanceIconsL() + { + CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupWhiteBalanceStill ); + if ( button ) + { + if ( !iController.UiConfigManagerPtr()->IsWhiteBalanceFeatureSupported() ) + { + HideButton(ECamCmdCaptureSetupWhiteBalanceStill); + return; + } + TCamWhiteBalanceId wb = static_cast< TCamWhiteBalanceId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoWhiteBalance ) ); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + switch ( wb ) + { + case ECamWhiteBalanceAWB: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_auto, + EMbmCameraappQgn_indi_cam4_wb_auto_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbAuto ); + break; + } + case ECamWhiteBalanceDaylight: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_sunny, + EMbmCameraappQgn_indi_cam4_wb_sunny_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbSunny ); + break; + } + case ECamWhiteBalanceCloudy: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_cloudy, + EMbmCameraappQgn_indi_cam4_wb_cloudy_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbCloudy ); + break; + } + case ECamWhiteBalanceTungsten: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_tungsten, + EMbmCameraappQgn_indi_cam4_wb_tungsten_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbTungsten ); + break; + } + case ECamWhiteBalanceFlourescent: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_fluorecent, + EMbmCameraappQgn_indi_cam4_wb_fluorecent_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbFluorecent ); + break; + } + default: + break; + } + } + + } + + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateColorToneIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateColorToneIconsL() + { + CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupColourFilterStill ); + if ( button ) + { + if ( !iController.UiConfigManagerPtr()->IsColorToneFeatureSupported() ) + { + HideButton(ECamCmdCaptureSetupColourFilterStill); + return; + } + TCamColourFilterId color = static_cast< TCamColourFilterId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoColourFilter ) ); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + switch ( color ) + { + case ECamColourFilterColour: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_colour_normal, + EMbmCameraappQgn_indi_cam4_colour_normal_mask, + skinInstance, + KAknsIIDQgnIndiCam4ColourNormal ); + break; + } + case ECamColourFilterBlackAndWhite: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_colour_bw, + EMbmCameraappQgn_indi_cam4_colour_bw_mask, + skinInstance, + KAknsIIDQgnIndiCam4ColourBw ); + break; + } + case ECamColourFilterSepia: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_colour_sepia, + EMbmCameraappQgn_indi_cam4_colour_sepia_mask, + skinInstance, + KAknsIIDQgnIndiCam4ColourSepia ); + break; + } + case ECamColourFilterNegative: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_colour_negative, + EMbmCameraappQgn_indi_cam4_colour_negative_mask, + skinInstance, + KAknsIIDQgnIndiCam4ColourNegative ); + break; + } + case ECamColourFilterVivid: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_colour_vivid, + EMbmCameraappQgn_indi_cam4_colour_vivid_mask, + skinInstance, + KAknsIIDQgnIndiCam4ColourVivid ); + break; + } + default: + break; + } + } + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateLightSensitivityIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateLightSensitivityIconsL() + { + CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupLightSensitivityStill ); + if ( button ) + { + if (!iController.UiConfigManagerPtr()->IsISOSupported()) + { + HideButton(ECamCmdCaptureSetupLightSensitivityStill); + return; + } + TCamLightSensitivityId iso = static_cast< TCamLightSensitivityId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicPhotoLightSensitivity ) ); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + switch ( iso ) + { + case ECamLightSensitivityAuto: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_iso_auto, + EMbmCameraappQgn_indi_cam4_iso_auto_mask, + skinInstance, + KAknsIIDQgnIndiCam4IsoAuto ); + break; + } + case ECamLightSensitivityLow: + //case ECamLightSensitivityLowMed: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_iso_low, + EMbmCameraappQgn_indi_cam4_iso_low_mask, + skinInstance, + KAknsIIDQgnIndiCam4IsoLow ); + break; + } + case ECamLightSensitivityMed: + //case ECamLightSensitivityMedHigh: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_iso_medium, + EMbmCameraappQgn_indi_cam4_iso_medium_mask, + skinInstance, + KAknsIIDQgnIndiCam4IsoMedium ); + break; + } + case ECamLightSensitivityHigh: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_iso_high, + EMbmCameraappQgn_indi_cam4_iso_high_mask, + skinInstance, + KAknsIIDQgnIndiCam4IsoHigh ); + break; + } + default: + break; + } + } + + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::StartMskCapture() +// Try to start the capture with MSK command. Return true if started. +// --------------------------------------------------------------------------- +// +TBool CCamStillPreCaptureView::StartMskCaptureL() + { + PRINT( _L("Camera => CCamStillPreCaptureView::StartMskCapture") ); + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + TCamOrientation orientation = appUi->CamOrientation(); + TBool startedCapture(EFalse); + if( orientation == ECamOrientationCamcorder || + orientation == ECamOrientationCamcorderLeft || + orientation == ECamOrientationPortrait ) + { + // In case of MSK if no AP on screen, it should work as capture + // If optical joystic is not available, we will start the + // capturing with auto-focusing here. Otherwise it is handled + // in CCamStillPreCaptureContainer + if ( appUi && !appUi->IsToolBarVisible() + && iController.UiConfigManagerPtr() + && !iController.UiConfigManagerPtr()->IsOpticalJoyStickSupported() ) + { + if ( iController.IsViewFinding() && appUi->CheckMemoryL() && + !iController.CaptureModeTransitionInProgress() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + // Start the autofocus operation now, the capture will be queued + // after focus completes + if ( !appUi->SelfTimerEnabled() ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMSTILLPRECAPTUREVIEW_STARTMSKCAPTUREL, "e_CAM_APP_AF 1" ); + iController.StartAutoFocus(); + } + + TKeyEvent keyEvent; + appUi->StartCaptureL( keyEvent ); + startedCapture = ETrue; + } + } + // else let the calling function take care of capturing + } + PRINT( _L("Camera <= CCamStillPreCaptureView::StartMskCapture") ); + return startedCapture; + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateSelfTimerIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateSelfTimerIconsL() + { + CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupSelfTimer ); + if ( button ) + { + TCamSelfTimerId selftimer = static_cast< TCamSelfTimerId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicSelfTimer ) ); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + switch ( selftimer ) + { + case ECamSelfTimerOff: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_selftimer_off, + EMbmCameraappQgn_indi_cam4_selftimer_off_mask, + skinInstance, + KAknsIIDQgnIndiCam4SelftimerOff ); + break; + } + case ECamSelfTimer2: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_selftimer_2sec, + EMbmCameraappQgn_indi_cam4_selftimer_2sec_mask, + skinInstance, + KAknsIIDQgnIndiCam4Selftimer2sec ); + break; + } + case ECamSelfTimer10: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_selftimer_10s, + EMbmCameraappQgn_indi_cam4_selftimer_10s_mask, + skinInstance, + KAknsIIDQgnIndiCam4Selftimer10s ); + break; + } + case ECamSelfTimer20: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_selftimer_20s, + EMbmCameraappQgn_indi_cam4_selftimer_20s_mask, + skinInstance, + KAknsIIDQgnIndiCam4Selftimer20s ); + break; + } + default: + break; + } + } + + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateSceneModeIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateSceneModeIconsL() + { + CAknButton* button = ToolbarButtonById( ECamCmdCaptureSetupSceneStill ); + + if ( button ) + { + TCamSceneId scene = static_cast< TCamSceneId > ( + iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) ); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + + switch ( scene ) + { + case ECamSceneAuto: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_mode_auto, + EMbmCameraappQgn_indi_cam4_mode_auto_mask, + skinInstance, + KAknsIIDQgnIndiCam4ModeAuto ); + break; + } + case ECamSceneUser: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_mode_userscene, + EMbmCameraappQgn_indi_cam4_mode_userscene_mask, + skinInstance, + KAknsIIDQgnIndiCam4ModeUserscene ); + break; + } + case ECamSceneMacro: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_mode_closeup, + EMbmCameraappQgn_indi_cam4_mode_closeup_mask, + skinInstance, + KAknsIIDQgnIndiCam4ModeCloseup ); + break; + } + case ECamScenePortrait: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_mode_portrait, + EMbmCameraappQgn_indi_cam4_mode_portrait_mask, + skinInstance, + KAknsIIDQgnIndiCam4ModePortrait ); + break; + } + case ECamSceneScenery: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_mode_landscape, + EMbmCameraappQgn_indi_cam4_mode_landscape_mask, + skinInstance, + KAknsIIDQgnIndiCam4ModeLandscape ); + break; + } + case ECamSceneNight: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_mode_night, + EMbmCameraappQgn_indi_cam4_mode_night_mask, + skinInstance, + KAknsIIDQgnIndiCam4ModeNight ); + break; + } + case ECamSceneSports: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_mode_sport, + EMbmCameraappQgn_indi_cam4_mode_sport_mask, + skinInstance, + KAknsIIDQgnIndiCam4ModeSport ); + break; + } + case ECamSceneNightScenery: + case ECamSceneNightPortrait: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_mode_portrait_night, + EMbmCameraappQgn_indi_cam4_mode_portrait_night_mask, + skinInstance, + KAknsIIDQgnIndiCam4ModePortraitNight ); + break; + } + case ECamSceneCandlelight: + default: + break; + } + } + + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateVFGridIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateVFGridIconsL() + { + CAknButton* button = ToolbarButtonById( ECamCmdViewfinderGrid ); + if ( button ) + { + CAknButtonState* state = button->State(); + if ( state ) + { + TInt grid = iController.IntegerSettingValue( ECamSettingItemViewfinderGrid ); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + + if ( grid == ECamViewfinderGridOn ) + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_viewfinder_off, + EMbmCameraappQgn_indi_cam4_viewfinder_off_mask, + skinInstance, + KAknsIIDQgnIndiCam4ViewfinderOff ); + HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_HIDE_VIEWFINDER_GRID ); + state->SetTextL( *buttonText ); + CleanupStack::PopAndDestroy( buttonText ); + } + else + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_viewfinder_on, + EMbmCameraappQgn_indi_cam4_viewfinder_on_mask, + skinInstance, + KAknsIIDQgnIndiCam4ViewfinderOn ); + HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_SHOW_VIEWFINDER_GRID ); + state->SetTextL( *buttonText ); + CleanupStack::PopAndDestroy( buttonText ); + } + } + } + + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateVFGridIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateBurstModeIconsL() + { + if (!iController.UiConfigManagerPtr()->IsBurstModeSupported()) + { + HideButton( ECamCmdTimeLapseSlider ); + return; + } + CAknButton* button = ToolbarButtonById( ECamCmdTimeLapseSlider ); + if ( button ) + { + CAknButtonState* state = button->State(); + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + if ( state ) + { + TCamImageCaptureMode captureMode = iController.CurrentImageModeSetup(); + if ( captureMode == ECamImageCaptureSingle ) + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_sequence_burst, + EMbmCameraappQgn_indi_cam4_sequence_burst_mask, + skinInstance, + KAknsIIDQgnIndiCam4Sequence ); + + HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_SEQUENCE ); + state->SetTextL( *buttonText ); + CleanupStack::PopAndDestroy( buttonText ); + } + else if ( captureMode == ECamImageCaptureBurst ) + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_sequence, + EMbmCameraappQgn_indi_cam4_sequence, + skinInstance, + KAknsIIDQgnIndiCam4SequenceBurst ); + + HBufC* buttonText = StringLoader::LoadLC( R_QTN_LCAM_TB_TURN_SEQUENCE_OFF ); + state->SetTextL( *buttonText ); + CleanupStack::PopAndDestroy( buttonText ); + + } + else + { + // pass + } + } + } + } + +// --------------------------------------------------------------------------- +// CCamStillPreCaptureView::UpdateFaceTrackingIconsL +// --------------------------------------------------------------------------- +// +void CCamStillPreCaptureView::UpdateFaceTracKingIconsL() + { + CAknButton* button = ToolbarButtonById( ECamCmdToggleFacetracking ); + + if ( button ) + { + CAknButtonState* state = button->State(); + if ( state ) + { + TInt face = iController.IntegerSettingValue( ECamSettingItemFaceTracking ); + + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + if ( face == ECamSettOn ) + { + PRINT( _L( "Camera => UpdateFaceTrackingIconL on" ) ); + SetIconL ( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_tb_facedet_off, + EMbmCameraappQgn_indi_cam4_tb_facedet_off_mask, + skinInstance, + KAknsIIDQgnIndiCam4TbFacedetOff ); + + } + else + { + PRINT( _L( "Camera => UpdateFaceTrackingIconL off" ) ); + SetIconL ( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_tb_facedet, + EMbmCameraappQgn_indi_cam4_tb_facedet_mask, + skinInstance, + KAknsIIDQgnIndiCam4TbFacedet ); + } + } + } + + + + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamStillUserSceneSetupView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamStillUserSceneSetupView.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,320 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Ensures that the container for the user scene setup is constructed* +*/ + + +// INCLUDE FILES +#include "CamStillUserSceneSetupView.h" +#include "CamUserSceneSetupContainer.h" +#include "CamShootingModeContainer.h" +#include "CamAppUiBase.h" +#include "Cam.hrh" +#include "CamAppController.h" +#include "CamUtility.h" + +#include "CamAppUi.h" +#include "CamInfoListBoxContainer.h" +#include "CamTimeLapseUtility.h" +#include "CameraUiConfigManager.h" + +#include +#include + +// ================= MEMBER FUNCTIONS ======================= +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamStillUserSceneSetupView* CCamStillUserSceneSetupView::NewLC( CCamAppController& aController ) + { + CCamStillUserSceneSetupView* self = + new ( ELeave ) CCamStillUserSceneSetupView( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::~CCamStillUserSceneSetupView +// Destructor +// --------------------------------------------------------------------------- +// +CCamStillUserSceneSetupView::~CCamStillUserSceneSetupView() + { + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::Id +// Returns the id of this view. +// --------------------------------------------------------------------------- +// +TUid CCamStillUserSceneSetupView::Id() const + { + return TUid::Uid( ECamViewIdPhotoUserSceneSetup ); + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::CreateContainerL +// Creates the user scene setup list. +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::CreateContainerL() + { + iContainer = + CCamUserSceneSetupContainer::NewL( AppUi()->ClientRect(), + R_CAM_PHOTO_USER_SCENE_SETUP_TITLE_NAME , iController, + *this ); + } + + + + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::StartViewFinder +// Enter viewfinder mode +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::StartViewFinder() + { + iController.EnterViewfinderMode( ECamControllerImage ); + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::StopViewFinder +// Exit viewfinder mode +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::StopViewFinder() + { + iController.ExitViewfinderMode( ECamControllerImage ); + } + + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::ExitCaptureSetupModeL +// Exit capture setup mode +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::ExitCaptureSetupModeL() + { + static_cast ( iContainer )-> + UpdateCurrentListItem(); + CCamUserSceneSetupViewBase::ExitCaptureSetupModeL(); + + StatusPane()->MakeVisible(ETrue); + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::CCamStillUserSceneSetupView +// C++ Constructor +// --------------------------------------------------------------------------- +// +CCamStillUserSceneSetupView::CCamStillUserSceneSetupView +( CCamAppController& aController ) +: CCamUserSceneSetupViewBase( aController ) + { + } + + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::ConstructL +// 2nd phase Constructor +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::ConstructL() + { + BaseConstructL( ROID(R_CAM_USER_SCENE_SETUP_VIEW_ID)); + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::ExitUserSceneSetupModeL +// Exits the user scene setup mode. +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::ExitUserSceneSetupModeL() + { + CCamUserSceneSetupViewBase::ExitUserSceneSetupModeL(); + AppUi()->HandleCommandL( ECamCmdSceneSettingList ); + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::SwitchToUserSceneSetupModeL +// Switches to the user scene setup mode. +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::SwitchToUserSceneSetupModeL() + { + CCamUserSceneSetupViewBase::SwitchToUserSceneSetupModeL(); + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::SwitchToSceneSettingModeL +// Switches the current mode to scene setting and activates a +// specific control. +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::SwitchToSceneSettingModeL() + { + CCamUserSceneSetupViewBase::ExitUserSceneSetupModeL(); + + if ( !iSceneSettingContainer ) + { + // Create the scene setting container for still mode. + iSceneSettingContainer = CCamShootingModeContainer::NewL( AppUi()->ApplicationRect(), + *this, + ECamControllerImage, + iController, + ETrue ); + } + + iSceneSettingContainer->DrawableWindow()->SetOrdinalPosition(-1); + + iSettingModeTitleResourceId = R_CAM_STILL_SCENE_SETTING_TITLE; + + iPreviousMenuResourceId = ROID(R_CAM_USER_SCENE_SETUP_MENUBAR_ID); + + // Remove the view's main container, and add the capture setup + // control associated with the input command to the container stack. + CCamCaptureSetupViewBase::SwitchToSceneSettingModeL(); + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::SwitchToInfoListBoxL +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::SwitchToInfoListBoxL( TCamInfoListBoxMode aMode ) + { + CCamAppUi* appUi = static_cast( iCoeEnv->AppUi() ); + + TBool modeSelected = EFalse; + TInt listBoxResource; + TInt summaryResource; + TInt initialValue; + TInt titleResource; + + + switch( aMode ) + { + // Only ISO mode is supported for InfoListBox in user scene setup + case EInfoListBoxModeISO: + { + // Light sensitivity selector initialization values + initialValue = iController.IntegerSettingValue( ECamSettingItemUserSceneLightSensitivity ); + // initialValue = 0; + if ( iController.UiConfigManagerPtr()->IsExtendedLightSensitivitySupported() ) + { + listBoxResource = R_CAM_CAPTURE_SETUP_LIST_EXTENDED_LIGHT_SENSITIVITY; + summaryResource = R_CAM_CAPTURE_SETUP_LIST_EXTENDED_LIGHT_SENSITIVITY_SUMMARY; + } + else + { + listBoxResource = R_CAM_CAPTURE_SETUP_LIST_LIGHT_SENSITIVITY; + summaryResource = R_CAM_CAPTURE_SETUP_LIST_LIGHT_SENSITIVITY_SUMMARY; + } + titleResource = R_CAM_LIGHT_SENSITIVITY_TITLE; + modeSelected = ETrue; + } + break; + default: + break; + } + + if( modeSelected) + { + + + StatusPane()->MakeVisible( EFalse ); + + CCamUserSceneSetupViewBase::ExitUserSceneSetupModeL(); + + iInfoListBoxContainer = CCamInfoListBoxContainer::NewL( AppUi()->ClientRect(), + *this, + iController, + listBoxResource, + summaryResource, + initialValue, + titleResource ); + iInfoListBoxMode = aMode; + iSettingModeTitleResourceId = titleResource; + + iPreviousMenuResourceId = ROID(R_CAM_USER_SCENE_SETUP_MENUBAR_ID); + + // Remove the view's main container, and add the capture setup + // control associated with the input command to the container stack. + CCamCaptureSetupViewBase::SwitchToInfoListBoxL( aMode ); + } + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::HandleInfoListBoxSelectionL() +// Handle selection events from InfoListBox +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::HandleInfoListBoxSelectionL() + { + CCamAppUiBase* appUi = static_cast( AppUi() ); + + if( iInfoListBoxContainer->SettingValueChanged() ) + { + // Store the selected setting + switch( iInfoListBoxMode ) + { + // Only ISO mode is supported for InfoListBox in user scene setup + case EInfoListBoxModeISO: + { + TInt settingValue = iInfoListBoxContainer->CurrentSettingItemValue(); + iController.SetIntegerSettingValueL( ECamSettingItemUserSceneLightSensitivity, settingValue ); + } + break; + + default: + break; + } + } + + ExitInfoListBoxL(); + } + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::ExitSceneSettingModeL +// Exit scene setting mode +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::ExitSceneSettingModeL() + { + static_cast( iContainer )-> + UpdateCurrentListItem(); + CCamUserSceneSetupViewBase::ExitSceneSettingModeL(); + } + + +// --------------------------------------------------------------------------- +// CCamStillUserSceneSetupView::DynInitMenuPaneL +// Dynamically initialise the options menu +// --------------------------------------------------------------------------- +// +void CCamStillUserSceneSetupView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) + { + PRINT( _L("Camera => CCamStillUserSceneSetupView::DynInitMenuPaneL")) + if ( aResourceId != R_CAM_USER_SCENE_SETUP_MENU ) + { + CCamCaptureSetupViewBase::DynInitMenuPaneL( aResourceId, aMenuPane ); + } + PRINT( _L("Camera <= CCamStillUserSceneSetupView::DynInitMenuPaneL")) + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamSyncRotatorAo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamSyncRotatorAo.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility class to rotate bitmaps* +*/ + + + +// INCLUDE FILES +#include +#include +#include "CamSyncRotatorAo.h" +#include "camlogging.h" + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamSyncRotatorAo::CCamSyncRotatorAo +// C++ constructor +// ----------------------------------------------------------------------------- +// +CCamSyncRotatorAo::CCamSyncRotatorAo(MBitmapRotationObserver& aObserver) : + CActive( EPriorityHigh ), + iObserver( aObserver ) + + { + } + +// ----------------------------------------------------------------------------- +// CCamSyncRotatorAo::ConstructL +// Second phase constructor. +// ----------------------------------------------------------------------------- +// +void CCamSyncRotatorAo::ConstructL() + { + iRotator = CBitmapRotator::NewL(); + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CCamSyncRotatorAo::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamSyncRotatorAo* CCamSyncRotatorAo::NewL(MBitmapRotationObserver& aObserver) + { + CCamSyncRotatorAo* self = new( ELeave ) CCamSyncRotatorAo(aObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// ----------------------------------------------------------------------------- +// CCamSyncRotatorAo::~CCamSyncRotatorAo() +// Destructor +// ----------------------------------------------------------------------------- +// +CCamSyncRotatorAo::~CCamSyncRotatorAo() + { + PRINT( _L("Camera => ~CCamSyncRotatorAo" )) + Cancel(); + delete iRotator; + PRINT( _L("Camera <= ~CCamSyncRotatorAo" )) + } + +// ----------------------------------------------------------------------------- +// CCamSyncRotatorAo::RotateL() +// Rotate the provided bitmap +// ----------------------------------------------------------------------------- +// +void CCamSyncRotatorAo::RotateL( CFbsBitmap* aBitmap, CBitmapRotator::TRotationAngle aRotation ) + { + iRotator->Rotate( &iStatus, *aBitmap, aRotation ); + SetActive(); + } + +// ----------------------------------------------------------------------------- +// CCamSyncRotatorAo::RunL +// Called when a rotation operation is completed (or cancelled) +// ----------------------------------------------------------------------------- +// +void CCamSyncRotatorAo::RunL() + { + iObserver.RotationCompleteL(iStatus.Int()); + } + +// ----------------------------------------------------------------------------- +// CCamSyncRotatorAo::DoCancel +// Called to cancel an outstanding rotation operation +// ----------------------------------------------------------------------------- +// +void CCamSyncRotatorAo::DoCancel() + { + iRotator->Cancel(); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamTimeLapseUtility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamTimeLapseUtility.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Utility class for time lapse setting* +*/ + + +#include +#include "Cam.hrh" // ECamCmd... +#include "CamTimeLapseUtility.h" + +// CONSTANTS + +/* Commented out to avoid compilation warning. Olcay */ +/* const TInt KDivisorFactor = 1024; // Avoids using TReal maths, use factor of 2 */ +const TInt KSecondInMicSec = 1000000; + +const TInt KInterval5secs = 5 * KSecondInMicSec; +const TInt KInterval10secs = 10 * KSecondInMicSec; +const TInt KInterval30secs = 30 * KSecondInMicSec; +const TInt KInterval1min = 60 * KSecondInMicSec; +const TInt KInterval5min = 300 * KSecondInMicSec; +const TInt KInterval10min = 600 * KSecondInMicSec; +const TInt KInterval15min = 900 * KSecondInMicSec; +const TInt KInterval30min = 1800 * KSecondInMicSec; + +// ----------------------------------------------------------------------------- +// CamTimeLapseUtility::IntervalToEnum +// Convert from Interval to Enum +// ----------------------------------------------------------------------------- +// +TCamTimeLapse CamTimeLapseUtility::IntervalToEnum( TTimeIntervalMicroSeconds aInterval, TBool aBurst ) + { + switch( aInterval.Int64() ) + { + case KInterval5secs: + return ECamTimeLapse5sec; + case KInterval10secs: + return ECamTimeLapse10sec; + case KInterval30secs: + return ECamTimeLapse30sec; + case KInterval1min: + return ECamTimeLapse1min; + case KInterval5min: + return ECamTimeLapse5min; + case KInterval10min: + return ECamTimeLapse10min; + case KInterval15min: + return ECamTimeLapse15min; + case KInterval30min: + return ECamTimeLapse30min; + case 0: + { + + // if capturing burst with 0 interval then this is normal sequence mode + if ( aBurst ) + { + return ECamTimeLapseMin; + } + else // otherwise burst is off + { + return ECamTimeLapseOff; + } + } + default: + return ECamTimeLapseOff; + } + // Should never get here + } + +// ----------------------------------------------------------------------------- +// CamTimeLapseUtility::EnumToInterval +// Convert from Enum to Interval +// ----------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds CamTimeLapseUtility::EnumToInterval( TCamTimeLapse aEnum ) + { + TInt64 interval = 0; + + switch( aEnum ) + { + case ECamTimeLapse5sec: + interval = KInterval5secs; + break; + case ECamTimeLapse10sec: + interval = KInterval10secs; + break; + case ECamTimeLapse30sec: + interval = KInterval30secs; + break; + case ECamTimeLapse1min: + interval = KInterval1min; + break; + case ECamTimeLapse5min: + interval = KInterval5min; + break; + case ECamTimeLapse10min: + interval = KInterval10min; + break; + case ECamTimeLapse15min: + interval = KInterval15min; + break; + case ECamTimeLapse30min: + interval = KInterval30min; + break; + // 0 means capture as quick as possible (burst mode) but + // is also used as a default value in single capture + case ECamTimeLapseOff: + case ECamTimeLapseMin: + default: + interval = 0; + break; + } + return interval; + } + +// ----------------------------------------------------------------------------- +// CamTimeLapseUtility::EnumToCommand +// Convert from Enum to capture mode command +// ----------------------------------------------------------------------------- +// +TInt CamTimeLapseUtility::EnumToCommand( TCamTimeLapse aEnum ) + { + switch( aEnum ) + { + case ECamTimeLapseOff: + return ECamCmdSingleCapture; + case ECamTimeLapseMin: + return ECamCmdSequence; + case ECamTimeLapse5sec: + case ECamTimeLapse10sec: + case ECamTimeLapse30sec: + case ECamTimeLapse1min: + case ECamTimeLapse5min: + case ECamTimeLapse10min: + case ECamTimeLapse15min: + case ECamTimeLapse30min: + return ECamCmdTimeLapse; + + default: + return 0; + } + } + + +// End of File + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamTimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamTimer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object for implementing viewfinder timeout and* +*/ + + +// INCLUDE FILES +#include +#include "camlogging.h" +#include "CamTimer.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamTimer::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamTimer* CCamTimer::NewL( TInt aTimeout, TCallBack aCallBack ) + { + CCamTimer* self = NewLC( aTimeout, aCallBack ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamTimer::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamTimer* CCamTimer::NewLC( TInt aTimeout, TCallBack aCallBack ) + { + CCamTimer* self = new ( ELeave ) CCamTimer( aTimeout, aCallBack ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// Destructor +CCamTimer::~CCamTimer() + { + PRINT( _L("Camera => ~CCamTimer" )) + Cancel(); + PRINT( _L("Camera <= ~CCamTimer" )) + } + +// --------------------------------------------------------------------------- +// CCamTimer::StartTimer +// Start timer. +// --------------------------------------------------------------------------- +// +void CCamTimer::StartTimer() + { + After( iTimeout ); + } + +// --------------------------------------------------------------------------- +// CCamTimer::SetTimeout +// Update the timeout period +// --------------------------------------------------------------------------- +// +void CCamTimer::SetTimeout( TInt aTimeout ) + { + iTimeout = aTimeout; + } + +// --------------------------------------------------------------------------- +// CCamTimer::RunL +// From CActive, handle timeout expiration +// --------------------------------------------------------------------------- +// +void CCamTimer::RunL() + { + iCallBack.CallBack(); + } + +// --------------------------------------------------------------------------- +// CCamTimer::CCamTimer +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamTimer::CCamTimer( TInt aTimeout, TCallBack aCallBack ) +: CCamTimerBase( EPriorityStandard ), iTimeout( aTimeout ), iCallBack( aCallBack ) + { + } + +// --------------------------------------------------------------------------- +// CCamTimer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamTimer::ConstructL() + { + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + +// End of File + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamTitlePane.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamTitlePane.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for displaying the title in the Status Pane* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include + +#include "CamPostCaptureInfoDisplay.h" +#include "CamTitlePane.h" + +#include +#include + +// EXTERNAL DATA STRUCTURES + +// EXTERNAL FUNCTION PROTOTYPES + +// CONSTANTS +const TAknsItemID KNaviPaneMajorColour = KAknsIIDQsnTextColors; +const TInt KNaviPaneMinorColour = EAknsCIQsnTextColorsCG1; + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================= LOCAL FUNCTIONS =============================== + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamTitlePane::CCamTitlePane +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamTitlePane::CCamTitlePane() + { + } + +// ----------------------------------------------------------------------------- +// CCamTitlePane::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamTitlePane::ConstructL() + { + // Read the resource to get pane position information + iTitlePaneLayoutRect.LayoutRect( Rect(), ROID(R_CAM_TITLE_PANE_RECT_ID)); + SetRect( iTitlePaneLayoutRect.Rect() ); + } + +// ----------------------------------------------------------------------------- +// CCamTitlePane::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamTitlePane* CCamTitlePane::NewL() + { + CCamTitlePane* self = new( ELeave ) CCamTitlePane; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +CCamTitlePane::~CCamTitlePane() + { + PRINT( _L("Camera => ~CCamTitlePane" )) + delete iTextHbuf; + PRINT( _L("Camera <= ~CCamTitlePane" )) + } + + +// ----------------------------------------------------------------------------- +// CCamTitlePane::SetFromResourceL +// Sets the title with the specified resource string +// ----------------------------------------------------------------------------- +// +void CCamTitlePane::SetFromResourceL( TInt aResource ) + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, aResource ); + + if ( iTextHbuf != NULL ) + { + delete iTextHbuf; + iTextHbuf = NULL; + } + iTextHbuf = reader.ReadHBufC16L(); + CleanupStack::PopAndDestroy(); // resource reader + DrawDeferred(); + } + + + +// ----------------------------------------------------------------------------- +// CCamTitlePane::SetTextL +// Sets the title with the specified string +// ----------------------------------------------------------------------------- +// +void CCamTitlePane::SetTextL( const TDesC& aText ) + { + if ( iTextHbuf != NULL ) + { + delete iTextHbuf; + iTextHbuf = NULL; + } + iTextHbuf = aText.AllocL(); + DrawDeferred(); + } + + +// --------------------------------------------------------- +// CCamTitlePane::Draw +// Draw control +// --------------------------------------------------------- +// +void CCamTitlePane::Draw( const TRect& /*aRect*/ ) const + { + CWindowGc& gc=SystemGc(); + + // Draw the background: + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, this, gc, Rect() ); + + // Set drawing colour from layout information + TRgb color = iTitleTextLayout.Color(); + + // ...Color is not updated if it not found from the skin + AknsUtils::GetCachedColor( skin, color, + KNaviPaneMajorColour, KNaviPaneMinorColour ); + + if ( iTextHbuf ) + { + iTitleTextLayout.DrawText( gc, iTextHbuf->Des(), ETrue, color ); + } + } + + +// --------------------------------------------------------- +// CCamTitlePane::SizeChanged +// Called by framework when the component size is changed +// --------------------------------------------------------- +// +void CCamTitlePane::SizeChanged() + { + if ( Rect().Size() != TSize( 0, 0 ) ) + { + if ( !AknLayoutUtils::LayoutMirrored() ) + { + iTitleTextLayout.LayoutText( Rect(), ROID(R_CAM_TITLE_TEXT_LAYOUT_ID)); + } + else + { + iTitleTextLayout.LayoutText( Rect(), ROID(R_CAM_TITLE_TEXT_LAYOUT_AH_ID)); + } + } + } + + + + + + + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamUserSceneSetupContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamUserSceneSetupContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,451 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements container for the user scene setup list.* +*/ + + +// INCLUDE FILES +#include "CamUserSceneSetupContainer.h" +#include "CamUserSceneSetupItemArray.h" +#include "CamAppController.h" +#include "CamSettings.hrh" +#include "Cam.hrh" +#include "CamPanic.h" +#include +#include +#include +#include + +#include "CamUtility.h" + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::NewLC +// Symbian two-phased constructor. +// --------------------------------------------------------- +// +CCamUserSceneSetupContainer* CCamUserSceneSetupContainer::NewLC +( const TRect& aRect, TInt aResourceId, + CCamAppController& aController, + CAknView& aView ) + { + CCamUserSceneSetupContainer* self = + new ( ELeave ) CCamUserSceneSetupContainer( aController, + aView ); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aResourceId ); + return self; + } + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::NewL +// Symbian two-phased constructor. +// --------------------------------------------------------- +// +CCamUserSceneSetupContainer* CCamUserSceneSetupContainer::NewL +( const TRect& aRect, TInt aResourceId, + CCamAppController& aController, + CAknView& aView ) + { + CCamUserSceneSetupContainer* self = + CCamUserSceneSetupContainer::NewLC + ( aRect, aResourceId, aController, + aView ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::~CCamUserSceneSetupContainer +// Destructor +// --------------------------------------------------------- +// +CCamUserSceneSetupContainer::~CCamUserSceneSetupContainer() + { + PRINT( _L("Camera => ~CCamUserSceneSetupContainer" )) + delete iUserSceneSetupList; + delete iUserSceneSetupItemArray; + PRINT( _L("Camera <= ~CCamUserSceneSetupContainer" )) + } + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::HandleChangeInItemArrayOrVisibilityL +// Handles a change in the item list visibility. +// --------------------------------------------------------- +// +void CCamUserSceneSetupContainer::UpdateDisplayL() + { + ListBox()->DrawNow(); + } + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::TitlePaneTextResourceId +// Returns the resource Id of the title for this container. +// --------------------------------------------------------- +// +TInt CCamUserSceneSetupContainer::TitlePaneTextResourceId() + { + return iTitleResourceId; + } + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::UpdateListItems +// Updates the list items with the settings model values. +// --------------------------------------------------------- +// +void CCamUserSceneSetupContainer::UpdateListItems( void ) + { + TInt listItemCount = iUserSceneSetupItemArray->Count(); + TInt i; + for ( i = 0; i < listItemCount; ++i ) + { + UpdateListItem( i ); + } + } + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::UpdateCurrentListItem +// Updates the current list item with it's associated +// settings model value. +// --------------------------------------------------------- +// +void CCamUserSceneSetupContainer::UpdateCurrentListItem() + { + TInt selectedItemIndex = iUserSceneSetupList->CurrentItemIndex(); + UpdateListItem( selectedItemIndex ); + } + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::HandleListBoxEventL +// Handles a list box event. +// --------------------------------------------------------- +// +void CCamUserSceneSetupContainer::HandleListBoxEventL +( CEikListBox* /*aListBox*/, TListBoxEvent aEventType ) + { + switch( aEventType ) + { + case EEventEnterKeyPressed: // fallthrough + case EEventItemDoubleClicked: + case EEventItemSingleClicked: + { + HandleSelectionL(); + } + break; + + default: + break; + } + } + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::HandleSelectionL +// Handles the user selection of a list item. +// --------------------------------------------------------- +// +void CCamUserSceneSetupContainer::HandleSelectionL( void ) + { + TInt CommandId = CommandIdForActivatingCurrentItemControl(); + iView.HandleCommandL( CommandId ); + } + + + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::CCamUserSceneSetupContainer +// C++ constructor +// --------------------------------------------------------- +// +CCamUserSceneSetupContainer::CCamUserSceneSetupContainer +( CCamAppController& aController, + CAknView& aView ) +: CCamContainerBase( aController, aView ) + { + + } + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::ConstructL +// 2nd phase constructor +// --------------------------------------------------------- +// +void CCamUserSceneSetupContainer::ConstructL +( const TRect& aRect, TInt aResourceId ) + { + const TInt KSettingItemArrayGranularity = 5; + + CreateWindowL(); + + // Create the listbox in the right style + iUserSceneSetupList = new ( ELeave ) CAknSettingStyleListBox; + iUserSceneSetupList->ConstructL( this, CEikListBox::ELeftDownInViewRect ); + iUserSceneSetupList->DisableSingleClick( ETrue ); + + TPoint pos = iEikonEnv->EikAppUi()->ClientRect().iTl; + TSize size = iUserSceneSetupList->MinimumSize(); + SetExtent( pos, size ); + + + // Setup the scroll bar + iUserSceneSetupList->CreateScrollBarFrameL( ETrue ); + iUserSceneSetupList->ScrollBarFrame()-> + SetScrollBarVisibilityL( CEikScrollBarFrame::EOn, + CEikScrollBarFrame::EAuto ); + + iTitleResourceId = aResourceId; + + + // get array of supported resources from psi + RArray userSceneResourceIds; + CleanupClosePushL( userSceneResourceIds ); + + User::LeaveIfError( CamUtility::GetPsiIntArrayL( ECamPsiUserSceneResourceIds, userSceneResourceIds ) ); + + // ...get the number of items in this user scene setup list. + TInt itemCount = userSceneResourceIds.Count(); + iUserSceneSetupItemArray = new ( ELeave ) + CCamUserSceneSetupItemArray( itemCount ); + iUserSceneSetupItemArray->ConstructL(); + + // Make the icon array + CArrayPtrFlat* iconArray = new ( ELeave ) + CAknIconArray( KSettingItemArrayGranularity ); + CleanupStack::PushL( iconArray ); + + // Create all the user scene setup list items defined in the resource. + TInt i; + for ( i=0; i < itemCount; ++i ) + { + CCamUserSceneSetupListItem* listItem = + CCamUserSceneSetupListItem::NewL( userSceneResourceIds[i] ); + CleanupStack::PushL( listItem ); + // Ownership is transferred + iUserSceneSetupItemArray->AppendL( listItem ); + CleanupStack::Pop( listItem ); + } + + + // Update the display + UpdateDisplayL(); + + // Looks like we have no choice but to give ownership + // of this to the listbox. + // There is no flag as there is for the item data + ListBox()->ItemDrawer()->FormattedCellData()->SetIconArrayL( iconArray ); + + // iconArray now has ownership transferred + CleanupStack::Pop( iconArray ); + + CleanupStack::PopAndDestroy( &userSceneResourceIds ); + + CTextListBoxModel* model= iUserSceneSetupList->Model(); + model->SetItemTextArray( iUserSceneSetupItemArray ); + // Ownership retained by SettingItemList + model->SetOwnershipType( ELbmDoesNotOwnItemArray ); + + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( TRect( + TPoint( 0, 0 ), iAvkonAppUi->ClientRect().Size() ), + AKN_LAYOUT_WINDOW_list_gen_pane( 0 ) ); + iUserSceneSetupList->SetRect( layoutRect.Rect() ); + + ListBox()->SetCurrentItemIndex( 0 ); + ListBox()->SetListBoxObserver( this ); + ListBox()->UpdateScrollBarsL(); + + SetRect( aRect ); + ActivateL(); + + UpdateListItems(); + } + + + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::UpdateListItem +// Updates a list item with its corresponding settings model value. +// --------------------------------------------------------- +// +void CCamUserSceneSetupContainer::UpdateListItem( TInt aIndex ) + { + // Get the current value for this list item from the settings model. + // ...get settings model id for list item. + TInt settingsModelId = + iUserSceneSetupItemArray->At( aIndex )->SettingsModelTypeId(); + if ( settingsModelId != ECamSettingItemUserSceneReset ) + { + // ...use id to get current value. + TInt currentVal = iController.IntegerSettingValue( settingsModelId ); + + // Update list item with the current value. + iUserSceneSetupItemArray->At( aIndex )->SetCurrentValue( currentVal ); + } + } + + +// ---------------------------------------------------- +// CCamUserSceneSetupContainer::CommandIdForActivatingCurrentItemControl +// Returns the command id for activating the current list item control. +// ---------------------------------------------------- +// +TInt CCamUserSceneSetupContainer::CommandIdForActivatingCurrentItemControl() + { + // Get the settings model type id for the selected item. + // ...get settings model id for list item. + TInt currentIndex = iUserSceneSetupList->CurrentItemIndex(); + + // ...get settings model id for list item. + TInt settingsModelId = + iUserSceneSetupItemArray->At( currentIndex )-> + SettingsModelTypeId(); + // Convert settings model id to command id that activates the + // control for the selected item. + TInt commandId = -1; + switch ( settingsModelId ) + { + case ECamSettingItemUserSceneBasedOnScene: + { + commandId = ECamCmdCaptureSetupSceneUser; + } + break; + case ECamSettingItemUserSceneWhitebalance: + { + commandId = ECamCmdCaptureSetupWhiteBalanceUser; + } + break; + case ECamSettingItemUserSceneExposure: + { + commandId = ECamCmdCaptureSetupExposureUser; + } + break; + case ECamSettingItemUserSceneColourFilter: + { + commandId = ECamCmdCaptureSetupColourFilterUser; + } + break; + case ECamSettingItemUserSceneFlash: + { + commandId = ECamCmdCaptureSetupFlashUser; + } + break; + case ECamSettingItemUserSceneReset: + { + commandId = ECamCmdUserSceneReset; + } + break; + case ECamSettingItemUserSceneBrightness: + { + commandId = ECamCmdCaptureSetupBrightnessUser; + } + break; + case ECamSettingItemUserSceneContrast: + { + commandId = ECamCmdCaptureSetupContrastUser; + } + break; + + case ECamSettingItemUserSceneImageSharpness: + { + commandId = ECamCmdCaptureSetupImageSharpnessUser; + } + break; + + case ECamSettingItemUserSceneLightSensitivity: + { + commandId = ECamCmdCaptureSetupLightSensitivityUser; + } + break; + default: + { + CamPanic( ECamPanicCaptureSetupMenuUnknownItem ); + } + } + return commandId; + } + + + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::CountComponentControls +// --------------------------------------------------------- +// +TInt CCamUserSceneSetupContainer::CountComponentControls() const + { + return 1; + } + +// --------------------------------------------------------- +// CCamUserSceneSetupContainer::ComponentControl +// --------------------------------------------------------- +// +CCoeControl* CCamUserSceneSetupContainer::ComponentControl +( TInt aIndex ) const + { + switch( aIndex ) + { + case 0: + return iUserSceneSetupList; + default: + return NULL; + } + + // Should never get here + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupContainer::OfferKeyEventL +// Key event handling +// --------------------------------------------------------------------------- +// +TKeyResponse CCamUserSceneSetupContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + return iUserSceneSetupList->OfferKeyEventL( aKeyEvent, aType ); + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupContainer::ListBox +// Returns a pointer to the list box +// --------------------------------------------------------------------------- +// +CEikFormattedCellListBox* CCamUserSceneSetupContainer::ListBox() + { + return ( iUserSceneSetupList ); + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupContainer::IsUserSceneResetHighlighted +// Returns wheather user scene restore is highlighted +// --------------------------------------------------------------------------- +// +TBool CCamUserSceneSetupContainer::IsUserSceneResetHighlighted() + { + TInt currentIndex = iUserSceneSetupList->CurrentItemIndex(); + // ...get settings model id for list item. + TInt settingsModelId = + iUserSceneSetupItemArray->At( currentIndex )->SettingsModelTypeId(); + if ( settingsModelId == ECamSettingItemUserSceneReset ) + { + return ETrue; + } + else + { + return EFalse; + } + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamUserSceneSetupItemArray.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamUserSceneSetupItemArray.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements the array of items for the user scene setup list.* +*/ + + +// INCLUDE FILES +#include "CamUserSceneSetupItemArray.h" +#include + +// ================= MEMBER FUNCTIONS ======================= +// --------------------------------------------------------- +// CCamUserSceneSetupItemArray::CCamUserSceneSetupItemArray +// C++ Constructor +// --------------------------------------------------------- +// +CCamUserSceneSetupItemArray::CCamUserSceneSetupItemArray( TInt aGranularity ) +: CArrayPtrFlat( aGranularity ) + { + } + +// --------------------------------------------------------- +// CCamUserSceneSetupItemArray::ConstructL +// 2nd phase Constructor +// --------------------------------------------------------- +// +void CCamUserSceneSetupItemArray::ConstructL() + { + } + +// --------------------------------------------------------- +// CCamUserSceneSetupItemArray::~CCamUserSceneSetupItemArray +// Destructor +// --------------------------------------------------------- +// +CCamUserSceneSetupItemArray::~CCamUserSceneSetupItemArray() + { + ResetAndDestroy(); + } + + +// --------------------------------------------------------- +// CCamUserSceneSetupItemArray::MdcaCount +// Returns the number of items in the array +// --------------------------------------------------------- +// +TInt CCamUserSceneSetupItemArray::MdcaCount() const + { + return Count(); + } + +// --------------------------------------------------------- +// CCamUserSceneSetupItemArray::MdcaPoint +// Returns the text for the aIndex-th item in the array. +// --------------------------------------------------------- +// +TPtrC16 CCamUserSceneSetupItemArray::MdcaPoint( TInt aIndex ) const + { + return At( aIndex )->ListBoxText(); + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamUserSceneSetupListItem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamUserSceneSetupListItem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,263 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements a user scene setup list item.* +*/ + + +// INCLUDE FILES +#include "CamUserSceneSetupListItem.h" +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "CamPanic.h" +#include +#include +#include +#include "CamUtility.h" + +// CONSTANTS +const TInt KValuesArrayGranularity = 6; + + +// ================= MEMBER FUNCTIONS ======================= +// --------------------------------------------------------- +// CCamUserSceneSetupListItem::NewLC +// Symbian two-phased constructor. +// --------------------------------------------------------- +// +CCamUserSceneSetupListItem* CCamUserSceneSetupListItem::NewLC +( TInt aResId ) + { + CCamUserSceneSetupListItem* self = + new ( ELeave ) CCamUserSceneSetupListItem; + CleanupStack::PushL( self ); + self->ConstructL( aResId ); + return self; + } + +// --------------------------------------------------------- +// CCamUserSceneSetupListItem::NewL +// Symbian two-phased constructor. +// --------------------------------------------------------- +// +CCamUserSceneSetupListItem* CCamUserSceneSetupListItem::NewL +( TInt aResId ) + { + CCamUserSceneSetupListItem* self = + CCamUserSceneSetupListItem::NewLC( aResId ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CCamUserSceneSetupListItem::~CCamUserSceneSetupListItem +// Destructor. +// --------------------------------------------------------- +// +CCamUserSceneSetupListItem::~CCamUserSceneSetupListItem() + { + PRINT( _L("Camera => ~CCamUserSceneSetupListItem" )) + iValues.ResetAndDestroy(); + iValues.Close(); + PRINT( _L("Camera <= ~CCamUserSceneSetupListItem" )) + } + +// --------------------------------------------------------- +// CCamUserSceneSetupListItem::ListBoxText +// Returns the formatted text of this item to be used in the list box +// --------------------------------------------------------- +// +TPtrC16 CCamUserSceneSetupListItem::ListBoxText() + { + // Create the title part of the text. + _LIT( KSettingItemSingleSpace, " " ); + _LIT( KListBoxTextSeparator, "\t" ); + + TPtr listBoxTextPtr = iListBoxText.Des(); + listBoxTextPtr.Copy( KSettingItemSingleSpace ); + listBoxTextPtr.Append( KListBoxTextSeparator ); + listBoxTextPtr.Append( SettingName() ); + listBoxTextPtr.Append( KListBoxTextSeparator ); + listBoxTextPtr.Append( KListBoxTextSeparator ); + + // Append the second part of the text to the title part. + // ...If there is value text for this item then append it. + if ( iValues.Count() > 0 ) + { + TPtrC settingPtr = SettingText(); + listBoxTextPtr.Append( settingPtr ); + } + + return iListBoxText; + } + +// --------------------------------------------------------- +// CCamUserSceneSetupListItem::SettingsModelTypeId +// Returns the settings model item id that is associated with this +// list item. +// --------------------------------------------------------- +// +TInt CCamUserSceneSetupListItem::SettingsModelTypeId() + { + return iSettingsModelItemId; + } + +// --------------------------------------------------------- +// CCamUserSceneSetupListItem::SetCurrentValue +// Sets the current value of this list item +// --------------------------------------------------------- +// +void CCamUserSceneSetupListItem::SetCurrentValue( TInt aNewValue ) + { + PRINT1( _L("Camera => CCamUserSceneSetupListItem::SetCurrentValue = %d" ), aNewValue ) + PRINT1( _L("iSettingsModelItemId = %d" ), iSettingsModelItemId ) + // Find the value-text pair that match the new current value, + // and store the index. + // Currently the brightness and contrast items only show 3 icons + // 1 for normal setting i.e. 0 + // 1 for any positive setting i.e. above 0 and + // 1 for any negative setting i.e. below 0 + // The code below matches positive/negative values to the correct icon + if ( iSettingsModelItemId == ECamSettingItemUserSceneBrightness ) + { + if ( aNewValue < ECamBrightnessNorm ) + { + iCurrentPairIndex = ECamBrightnessNeg; + return; + } + if ( aNewValue > ECamBrightnessNorm ) + { + iCurrentPairIndex = ECamBrightnessPlus; + return; + } + } + else if ( iSettingsModelItemId == ECamSettingItemUserSceneContrast ) + { + if ( aNewValue < ECamContrastNorm ) + { + PRINT( _L("iCurrentPairIndex = ECamContrastNeg" ) ) + iCurrentPairIndex = ECamContrastNeg; + return; + } + if ( aNewValue > ECamContrastNorm ) + { + iCurrentPairIndex = ECamContrastPlus; + PRINT( _L("iCurrentPairIndex = ECamContrastPlus" ) ) + return; + } + } + else + { + // lint + } + + + TInt i = 0; + TBool foundPair = EFalse; + do + { + __ASSERT_DEBUG( i <= iValues.Count(), + CamPanic( ECamPanicUSSPairNotFound ) ); + if ( aNewValue == iValues[i]->iSettingsModelId ) + { + foundPair = ETrue; + iCurrentPairIndex = i; + } + else + { + ++i; + } + } + while ( !foundPair ); + + PRINT1( _L("iCurrentPairIndex = %d" ), iCurrentPairIndex ) + } + +// --------------------------------------------------------- +// CCamUserSceneSetupListItem::CCamUserSceneSetupListItem +// Constructor +// --------------------------------------------------------- +// +CCamUserSceneSetupListItem::CCamUserSceneSetupListItem() +:iValues( KValuesArrayGranularity ) + { + } + +// --------------------------------------------------------- +// CCamUserSceneSetupListItem::ConstructFromResourceL +// 2nd phase Constructor +// --------------------------------------------------------- +// +void CCamUserSceneSetupListItem::ConstructL +( TInt aResId ) + { + // Create a resource reader for reading only this list items data. + TResourceReader localReader; + CEikonEnv::Static()->CreateResourceReaderLC + ( localReader, aResId ); + + // Read the data for this list item from resource. + // ...get setting model item id associated with this list item. + iSettingsModelItemId = localReader.ReadInt16(); + // ...get the text name of this list item. + iName = localReader.ReadTPtrC(); + // ...get the count of all possible values + // ...that this list item can have, and repeatedly get these values + // ...and their associated textual description. + TInt valuesCount = localReader.ReadInt16(); + TInt i; + for ( i = 0; i < valuesCount; ++i ) + { + // ...create the pair object. + CValueTextPair* pair = new ( ELeave ) CValueTextPair; + // ...set the data. + pair->iSettingsModelId = localReader.ReadInt16(); + pair->iText = localReader.ReadTPtrC(); + + // ...add the pair to the pair list. + CleanupStack::PushL( pair ); + iValues.AppendL( pair ); + CleanupStack::Pop( pair ); + } + + // Pop local resource reader. + CleanupStack::PopAndDestroy(); + } + +// --------------------------------------------------------- +// CCamUserSceneSetupListItem::SettingName +// Returns the name of the setting type represented by this +// list item. +// --------------------------------------------------------- +// +TPtrC CCamUserSceneSetupListItem::SettingName() const + { + return iName; + } + +// --------------------------------------------------------- +// CCamUserSceneSetupListItem::SettingText +// Returns the text for the current setting value of this item +// --------------------------------------------------------- +// +TPtrC CCamUserSceneSetupListItem::SettingText() + { + iValueText = iValues[iCurrentPairIndex]->iText; + return iValueText; + } + + + + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamUserSceneSetupViewBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamUserSceneSetupViewBase.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,631 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Controls the switching between different control modes* +*/ + + +// INCLUDE FILES +#include "CamUserSceneSetupViewBase.h" +#include "CamAppUiBase.h" +#include "CamAppUi.h" +#include "CamPanic.h" +#include "CamUserSceneSetupContainer.h" +#include "Cam.hrh" + +#include "CamPreCaptureContainerBase.h" + +#include +#include +#include +#include +#include +#include + +#include "CamUtility.h" + +// ================= MEMBER FUNCTIONS ======================= +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::~CCamUserSceneSetupViewBase +// Destructor +// --------------------------------------------------------------------------- +// +CCamUserSceneSetupViewBase::~CCamUserSceneSetupViewBase() + { + PRINT( _L("Camera => ~CCamUserSceneSetupViewBase" )) + delete iContainer; + iContainer = NULL; + PRINT( _L("Camera <= ~CCamUserSceneSetupViewBase" )) + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::HandleCommandL +// From CAknView Handle commands +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::HandleCommandL( TInt aCommand ) + { + PRINT1( _L("Camera => CCamUserSceneSetupViewBase::HandleCommandL %d"), aCommand ); + switch ( aCommand ) + { + case ECamMSKCmdAppChange: + { + + if ( IsOnlyUserSceneSetupModeActive() ) + { + CCamUserSceneSetupContainer* userSceneSetup = + static_cast( iContainer ); + userSceneSetup->HandleSelectionL(); + } + else + { + CCamCaptureSetupViewBase::HandleCommandL( ECamCmdSelect ); + + // Update the User Scene Setup with all the new values. + CCamUserSceneSetupContainer* userSceneSetup = + static_cast( iContainer ); + userSceneSetup->UpdateListItems(); + } + break; + } + // Handle the user scene scene list navi-key select selection + case EAknSoftkeySelect: + { + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + // Update the User Scene Setup with all the new values. + CCamUserSceneSetupContainer* userSceneSetup = + static_cast( iContainer ); + userSceneSetup->UpdateListItems(); + break; + } + case ECamCmdUserSceneReset: + { + DisplayResetUserSceneDlgL(); + } + break; + case ECamCmdCaptureSetupWhiteBalanceUser: // fallthrough + case ECamCmdCaptureSetupColourFilterUser: + case ECamCmdCaptureSetupExposureUser: + case ECamCmdCaptureSetupFlashUser: + case ECamCmdCaptureSetupBrightnessUser: + case ECamCmdCaptureSetupContrastUser: + case ECamCmdCaptureSetupImageSharpnessUser: + // case ECamCmdCaptureSetupLightSensitivityUser: + { + SwitchToCaptureSetupModeL( aCommand ); + } + break; + case ECamCmdCaptureSetupSceneUser: + { + SwitchToSceneSettingModeL(); + } + break; + case ECamCmdCaptureSetupLightSensitivityUser: + { + SwitchToInfoListBoxL( EInfoListBoxModeISO ); + } + break; + // If capture setup menu is active and user presses softkey cancel, + // deactivate the menu. + case EAknSoftkeyBack: + { + + if ( IsOnlyUserSceneSetupModeActive() ) + { + ExitUserSceneSetupModeL(); + } + else + { + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + + } + } + break; + + case EAknSoftkeyOptions: + { + // do nothing, the command is handled by the framework + } + break; + + case ECamCmdExitStandby: + { + CCamViewBase::ExitStandbyModeL(); + break; + } + case ECamCmdInternalExit: + { + PRINT( _L("Camera CCamUserSceneSetupViewBase::HandleCommandL ECamCmdInternalExit") ); + + CCamCaptureSetupViewBase* preCaptureView = + static_cast( AppUi()->View( TUid::Uid( ECamViewIdStillPreCapture ) ) ); + // reset scene setting flag so that precapture view returns to normal mode in next startup + // Note: this is NOT the proper way to reset precapture view to normal state but seems + // to be the only way that works here. None of the Exit.. or SwitchTo... functions work + // here because precapture view is not the active view. + if ( preCaptureView ) + { + preCaptureView->SetSceneSettingMode( EFalse ); + if ( iController.IsTouchScreenSupported() ) + { + // re-create the toolbar because it's gone for some reason + preCaptureView->CreateAndSetToolbarL( R_CAM_STILL_PRECAPTURE_TOOLBAR ); + } + } + CCamCaptureSetupViewBase::HandleCommandL( ECamCmdInternalExit ); + + + PRINT( _L("Camera CCamUserSceneSetupViewBase::HandleCommandL ECamCmdInternalExit OK") ); + break; + } + case EAknSoftkeyCancel: + { + PRINT1( _L( "Camera <> CCamUserSceneSetupViewBase::HandleCommandL EAknSoftkeyCancel iCancelRequest=%d" ),iCancelRequest); + if( ! iCancelRequest ) // EFalse + { + if( !iController.IsViewFinding( ) && iVFRequested ) + { + PRINT( _L( "Camera <> CCamUserSceneSetupViewBase::HandleCommandL viewfinder inactive" )); + + //viewfinder is not active then set to ETrue ... + //and wait until controller is ready. + iCancelRequest=ETrue; + } + else + { + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + } + } + break; + } + + case EAknSoftkeyOk: + { + PRINT1( _L( "Camera <> CCamUserSceneSetupViewBase::HandleCommandL EAknSoftkeyOk iOkRequest=%d" ),iOkRequest); + if( ! iOkRequest ) // EFalse + { + if( !iController.IsViewFinding( ) && iVFRequested ) + { + PRINT( _L( "Camera <> CCamUserSceneSetupViewBase::HandleCommandL viewfinder inactive" )); + + //viewfinder is not active then set to ETrue ... + //and wait until controller is ready. + iOkRequest=ETrue; + } + else + { + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + } + } + break; + } + default: + CCamCaptureSetupViewBase::HandleCommandL( aCommand ); + + } + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::HandleCommandL ") ); + } + + +// ----------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::HandleForegroundEventL +// Handle foreground event +// ----------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::HandleForegroundEventL( TBool aForeground ) + { + PRINT1( _L("Camera => CCamUserSceneSetupViewBase::HandleForegroundEventL %d"), aForeground ); + if ( aForeground ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + // if foreground event is received while in videocall, go to standby with error + if ( iController.InVideocallOrRinging() && ECamNoOperation == iController.CurrentOperation() ) + { + ExitAllModesL(); + appUi->SetStandbyStatus( KErrInUse ); + appUi->HandleCommandL( ECamCmdGoToStandby ); + return; + } + else if ( !appUi->IsInPretendExit() ) + { + // Register that we want to use the engine + IncrementCameraUsers(); + iController.StartIdleTimer(); + + // copied from still precapture handleforegroundevent implementations + iController.IsProfileSilent(); + UpdateCbaL(); + + + // start viewfinder unless the is activating to standby or scene settings + if ( !iStandbyModeActive && !iSceneSettingModeActive && + !iInfoListBoxActive && !iUserSceneSetupModeActive ) + { + iVFRequested=ETrue; + StartViewFinder(); + } + + } + else + { + // The view can get a foreground event while the application is + // actually in a pretend exit situation. This occurs when the view switch + // was called before the exit event, but didn't complete until after the + // exit event. In this case the view should not register an interest in + // the engine as the application is really in the background and the resources + // need to be released + } + } + // To background + else + { + PRINT( _L("Camera <> CCamUserSceneSetupViewBase::HandleForegroundEventL dec engine count") ); + // Register that we nolonger need the engine + DecrementCameraUsers(); + } + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::HandleForegroundEventL ") ); + } + + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::DoActivateL +// From CAknView activate the view +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, const TDesC8& aCustomMessage ) + { + PRINT( _L("Camera => CCamUserSceneSetupViewBase::DoActivateL") ); + iCancelRequest=EFalse; + iOkRequest=EFalse; + iVFRequested=EFalse; + + StatusPane()->MakeVisible( ETrue ); + + CCamViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + SwitchToUserSceneSetupModeL(); + + // Need to monitor the controller for standby events + iController.AddControllerObserverL( this ); + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::DoActivateL") ); + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::DoDeactivate +// From CAknView deactivates the view +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::DoDeactivate() + { + PRINT( _L("Camera => CCamUserSceneSetupViewBase::DoDeactivateL") ); + CCamViewBase::DoDeactivate(); + + iController.RemoveControllerObserver( this ); + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::DoDeactivateL") ); + } + +// ----------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::HandleControllerEventL +// Handle controller events +// ----------------------------------------------------------------------------- +// +void +CCamUserSceneSetupViewBase +::HandleControllerEventL( TCamControllerEvent aEvent, + TInt /*aError*/ ) + { + PRINT( _L( "Camera => CCamUserSceneSetupViewBase::HandleControllerEventL" ) ); + + switch( aEvent ) + { +/* + // --------------------------------- + case ECamEventOperationStateChanged: + { + switch ( iController.CurrentOperation() ) + { + // Standby event + case ECamStandby: + { + ExitAllModesL(); + // Get the UI to move to standby in the appropriate + // pre capture view + AppUi()->HandleCommandL( ECamCmdGoToStandby ); + break; + } + default: + { + break; + } + } + break; + } +*/ + // --------------------------------- + case ECamEventControllerReady: + { + PRINT1( _L( "Camera <> CCamUserSceneSetupViewBase::HandleControllerEventL ECamEventControllerReady iCancelRequest=%d" ),iCancelRequest); + PRINT1( _L( "Camera <> CCamUserSceneSetupViewBase::HandleControllerEventL ECamEventControllerReady iOkRequest=%d" ),iOkRequest); + iVFRequested=EFalse; + + if( iCancelRequest ) + { + //CAncel has been requested and Cameraengine is now ready to + //switch view and continue cancel. + iCancelRequest=EFalse; + TRAP_IGNORE( HandleCommandL( EAknSoftkeyCancel ) ); + } + else if( iOkRequest ) + { + //Ok has been requested and Cameraengine is now ready to + //switch view and continue with Ok. + iOkRequest=EFalse; + TRAP_IGNORE( HandleCommandL( EAknSoftkeyOk ) ); + } + + break; + } + default: + break; + // --------------------------------- + } + PRINT( _L( "Camera <= CCamUserSceneSetupViewBase::HandleControllerEventL") ); + } + + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::CCamUserSceneSetupViewBase +// C++ Constructor +// --------------------------------------------------------------------------- +// +CCamUserSceneSetupViewBase::CCamUserSceneSetupViewBase +( CCamAppController& aController ) +: CCamCaptureSetupViewBase( aController ) + { + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::ExitUserSceneSetupModeL +// Exits the user scene setup mode +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::ExitUserSceneSetupModeL() + { + iUserSceneSetupModeActive = EFalse; + iContainer->MakeVisible( ETrue ); + + AppUi()->RemoveFromStack( iContainer ); + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::UpdateCbaL +// Updates the command button array for this view +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::UpdateCbaL() + { + PRINT( _L("Camera => CCamUserSceneSetupViewBase::UpdateCbaL()") ); + // if videocall is active, set the softkeys already here + if ( iController.InVideocallOrRinging() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); + } + // if the view is in capture setup mode + else if ( iCaptureSetupModeActive ) + { + SetSoftKeysL( R_AVKON_SOFTKEYS_OK_CANCEL__OK ); + } + else if ( iSceneSettingModeActive ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE ); + } + else if ( iInfoListBoxActive ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE ); + } + // if the view is user scene setup + else + { + // R_AVKON_SOFTKEYS_OPTIONS_BACK --> + // R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE ); + } + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::UpdateCbaL()") ); + } + + + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::SetTitlePaneTextL +// Set the view's title text +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::SetTitlePaneTextL() + { + PRINT( _L("Camera => CCamUserSceneSetupViewBase::SetTitlePaneTextL()") ); + CCamAppUiBase* appUi = static_cast( AppUi() ); + // It is known that the container for this view is of the special + // type CCamUserSceneSetupContainer, and so we can use it's methods. + CCamUserSceneSetupContainer* userSceneSetup = + static_cast( iContainer ); + appUi->SetTitleL( userSceneSetup->TitlePaneTextResourceId() ); + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::SetTitlePaneTextL()") ); + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::SwitchToUserSceneSetupModeL +// Switches to the user scene setup mode. +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::SwitchToUserSceneSetupModeL() + { + PRINT( _L("Camera => CCamUserSceneSetupViewBase::SwitchToUserSceneSetupModeL()") ); + iContainer->SetMopParent( this ); + + // Activate the menu control and mode. + AppUi()->AddToStackL( iContainer ); + iContainer->ActivateL(); + iContainer->MakeVisible( ETrue ); + iUserSceneSetupModeActive = ETrue; + + StatusPane()->MakeVisible( ETrue ); + + // Update the command button array. + UpdateCbaL(); + SetTitlePaneTextL(); + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::SwitchToUserSceneSetupModeL()") ); + } + + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::SwitchToCaptureSetupModeL +// Switches the current mode to capture setup and activates a +// specific control.. +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::SwitchToCaptureSetupModeL( TInt aSetupCommand ) + { + PRINT( _L("Camera => CCamUserSceneSetupViewBase::SwitchToCaptureSetupModeL()") ); + iUserSceneSetupModeActive = EFalse; + iContainer->MakeVisible( ETrue ); + AppUi()->RemoveFromStack( iContainer ); + iVFRequested=ETrue; + StartViewFinder(); + iController.StartIdleTimer(); + + SetCaptureSetupModeActive(ETrue); + + // Remove the view's main container, and add the capture setup + // control associated with the input command to the container stack. + CCamCaptureSetupViewBase::SwitchToCaptureSetupModeL( aSetupCommand ); + StatusPane()->MakeVisible( EFalse ); + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::SwitchToCaptureSetupModeL()") ); + } + + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::ExitCaptureSetupModeL +// Exit capture setup mode. +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::ExitCaptureSetupModeL() + { + PRINT( _L("Camera => CCamUserSceneSetupViewBase::ExitCaptureSetupModeL()") ); + StopViewFinder(); + + StatusPane()->MakeVisible( ETrue ); + CCamCaptureSetupViewBase::ExitCaptureSetupModeL(); + + SwitchToUserSceneSetupModeL(); + + iContainer->DrawDeferred(); + + SetCaptureSetupModeActive(EFalse); + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::ExitCaptureSetupModeL()") ); + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::ExitSceneSettingModeL +// Exit scene setting mode. +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::ExitSceneSettingModeL() + { + PRINT( _L("Camera => CCamUserSceneSetupViewBase::ExitSceneSettingModeL()") ); + CCamCaptureSetupViewBase::ExitSceneSettingModeL(); + SwitchToUserSceneSetupModeL(); + + iContainer->DrawDeferred(); + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::ExitSceneSettingModeL()") ); + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::ExitInfoListBoxL +// Exit scene setting mode. +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::ExitInfoListBoxL() + { + PRINT( _L("Camera => CCamUserSceneSetupViewBase::ExitInfoListBoxL()") ); + CCamCaptureSetupViewBase::ExitInfoListBoxL(); + SwitchToUserSceneSetupModeL(); + + iContainer->DrawDeferred(); + + StatusPane()->MakeVisible( ETrue ); + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::ExitInfoListBoxL()") ); + } + +// ----------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::ExitAllModesL +// Revert to normal mode +// ----------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::ExitAllModesL() + { + PRINT( _L("Camera => CCamUserSceneSetupViewBase::ExitAllModesL()") ); + if ( iSceneSettingModeActive ) + { + ExitSceneSettingModeL(); + } + if ( iCaptureSetupModeActive ) + { + ExitCaptureSetupModeL(); + } + if( iInfoListBoxActive ) + { + ExitInfoListBoxL(); + } + PRINT( _L("Camera <= CCamUserSceneSetupViewBase::ExitAllModesL()") ); + } + + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::IsOnlyUserSceneSetupModeActive +// Returns true if only the user scene setup mode is active. +// --------------------------------------------------------------------------- +// +TBool CCamUserSceneSetupViewBase::IsOnlyUserSceneSetupModeActive() + { + return ( iUserSceneSetupModeActive && !iCaptureSetupModeActive + && !iSceneSettingModeActive && !iUserScenePageModeActive ); + } + +// --------------------------------------------------------------------------- +// CCamUserSceneSetupViewBase::DisplayResetUserSceneDlgL +// Display reset user setting confirmation dialog +// --------------------------------------------------------------------------- +// +void CCamUserSceneSetupViewBase::DisplayResetUserSceneDlgL() + { + HBufC* confirmationText; + confirmationText = StringLoader::LoadLC( R_CAM_RESET_USER_SCENE_NOTE_TEXT ); + CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText ); + CleanupStack::PopAndDestroy( confirmationText ); + + if ( confirmationDialog->ExecuteLD( R_CAM_RESET_USER_SCENE_NOTE ) ) + { + iController.ResetUserSceneL(); + CCamUserSceneSetupContainer* userSceneSetup = + static_cast( iContainer ); + + userSceneSetup->UpdateListItems(); + userSceneSetup->UpdateDisplayL(); + } + } + +// End of File + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamVideoPostCaptureView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamVideoPostCaptureView.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,573 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Video Post-capture view class for Camera application* +*/ + + +// INCLUDE FILES + +#include +#include +#include +#include +#include +#include +#include +#ifndef __WINS__ + //#include + #include // CAknInformationNote +#endif + +#include +#include + +#include "CamAppUiBase.h" +#include "CamAppController.h" +#include "CamVideoPostCaptureView.h" +#include "CamPostCaptureContainer.h" +#include "CamLogger.h" +#include "CamAppUi.h" +#include "CamAppUiBase.h" +#include "CamUtility.h" +#include "Cam.hrh" +#include "camactivepalettehandler.h" +#include "camoneclickuploadutility.h" +#include "CameraUiConfigManager.h" + + + +//CONSTANTS + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamVideoPostCaptureView* CCamVideoPostCaptureView::NewLC( CCamAppController& aController ) + { + CCamVideoPostCaptureView* self = + new( ELeave ) CCamVideoPostCaptureView( aController ); + + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView destructor +// +// --------------------------------------------------------------------------- +// +CCamVideoPostCaptureView::~CCamVideoPostCaptureView() + { + } + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView::Id +// Returns UID of view +// --------------------------------------------------------------------------- +// +TUid CCamVideoPostCaptureView::Id() const + { + return TUid::Uid( ECamViewIdVideoPostCapture ); + } + +// ----------------------------------------------------------------------------- +// CCamVideoPostCaptureView::HandleCommandL +// Handle commands +// ----------------------------------------------------------------------------- +// +void CCamVideoPostCaptureView::HandleCommandL( TInt aCommand ) + { + switch ( aCommand ) + { + case ECamCmdRenameVideo: + { + CCamAppUi* appUi = static_cast( AppUi() ); + QueryRenameL( ECamControllerVideo ); + + // inform the Media gallery of name change + TRAPD( ignore, + appUi->HandleControllerEventL( ECamEventMediaFileChanged, KErrNone ) ); + if ( ignore ) + { + // Do nothing (removes build warning) + } + break; + } + case EAknSoftkeySelect: + { + // In post-capture select key is disabled when embedded + if ( !iEmbedded ) + { + CEikMenuBar* menuBar = MenuBar(); + if ( menuBar ) + { + menuBar->SetMenuTitleResourceId( ROID(R_CAM_VIDEO_POST_CAPTURE_OK_MENUBAR_ID)); + menuBar->TryDisplayMenuBarL(); + menuBar->SetMenuTitleResourceId( ROID(R_CAM_VIDEO_POST_CAPTURE_MENUBAR_ID)); + } + CCamPostCaptureViewBase::HandleCommandL( aCommand ); + } + else + { + AppUi()->HandleCommandL( ECamCmdSelect ); + } + } + break; + case ECamCmdSend: + case ECamCmdSendToCallerMultimedia: + case ECamCmdQuickSend: + { + CCamPostCaptureViewBase::HandleCommandL( aCommand ); + } + break; + default: + { + PRINT1( _L("Camera => CCamVideoPostCaptureView::HandleCommandL default cmd (%d)"), aCommand ) + // Handle AIW commands + TInt aiwServiceCmd = iAiwServiceHandler->ServiceCmdByMenuCmd( aCommand ); + if ( aiwServiceCmd != KAiwCmdNone ) + { + PRINT1( _L("Camera => CCamVideoPostCaptureView::HandleCommandL default handle AIW cmd (%d)" ), aiwServiceCmd) + CAiwGenericParamList& inParams = iAiwServiceHandler->InParamListL(); + CAiwGenericParamList& outParams = iAiwServiceHandler->OutParamListL(); + // Add file path to AIW parameters + TAiwVariant variant( iController.CurrentFullFileName() ); + TAiwGenericParam param( EGenericParamFile, variant ); + inParams.AppendL( param ); + + // Don't add the mime type if uploading, since Share client + // will figure it out from the file + if ( aiwServiceCmd != KAiwCmdUpload ) + { + TAiwGenericParam param2( EGenericParamMIMEType, _L("video/*") ); + inParams.AppendL( param2 ); + } + + iAiwServiceHandler->ExecuteMenuCmdL( aCommand, inParams, outParams, 0, this ); + // we are 'embedding' Edit app + static_cast( AppUi() )->SetEmbedding( ETrue ); + } + else + { + CCamPostCaptureViewBase::HandleCommandL( aCommand ); + } + + } + } + } + +// ----------------------------------------------------------------------------- +// CCamVideoPostCaptureView::DisplayDeleteNoteL() +// Delete the current file +// ----------------------------------------------------------------------------- +// +TBool CCamVideoPostCaptureView::DisplayDeleteNoteL() + { + // Display the delete confirmation note + TInt err = KErrNone; + HBufC* confirmationText; + confirmationText = StringLoader::LoadLC( R_CAM_VIDEO_POST_CAPTURE_DELETE_NOTE_TEXT ); + CAknQueryDialog* confirmationDialog = + new( ELeave )CAknQueryDialog( *confirmationText ); + CleanupStack::PopAndDestroy( confirmationText ); + if ( confirmationDialog->ExecuteLD( R_CAM_VIDEO_POST_CAPTURE_DELETE_NOTE ) ) + { + if ( iEmbedded ) + { + BlankSoftkeysL(); + Cba()->DrawNow(); + SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT ); + } + err = iController.DeleteCurrentFile(); + if ( err ) + { + User::Leave( err ); + } + return ETrue; + } + else + { + if ( iEmbedded ) + { + BlankSoftkeysL(); + Cba()->DrawNow(); + SetSoftKeysL( R_CAM_SOFTKEYS_SELECT_DELETE__SELECT ); + } + return EFalse; + } + } + +// ----------------------------------------------------------------------------- +// CCamVideoPostCaptureView::DoActivateL() +// Activate this view +// ----------------------------------------------------------------------------- +// +void CCamVideoPostCaptureView::DoActivateL( + const TVwsViewId& aPreViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + // Ensure the correct menu is used for the current mode. + CEikMenuBar* menuBar = MenuBar(); + if ( menuBar ) + { + menuBar->SetMenuTitleResourceId( + ROID( R_CAM_VIDEO_POST_CAPTURE_MENUBAR_ID ) ); + } + + CCamAppUi* appUi = static_cast( AppUi() ); + + if ( iController.IsTouchScreenSupported() ) + { + if ( appUi->IsSecondCameraEnabled() ) + { + if ( iOneClickUploadUtility->OneClickUploadSupported() ) + { + TInt resourceId = appUi->IsQwerty2ndCamera()? + R_CAM_VIDEO_POSTCAPTURE_TOOLBAR_LANDSCAPE_UPLOAD: + R_CAM_VIDEO_POSTCAPTURE_TOOLBAR_PORTRAIT_UPLOAD; + CreateAndSetToolbarL( resourceId ); + } + else + { + TInt resourceId = appUi->IsQwerty2ndCamera()? + R_CAM_VIDEO_POSTCAPTURE_TOOLBAR_LANDSCAPE: + R_CAM_VIDEO_POSTCAPTURE_TOOLBAR_PORTRAIT; + CreateAndSetToolbarL( resourceId ); + } + } + else + { + if ( iOneClickUploadUtility->OneClickUploadSupported() ) + { + CreateAndSetToolbarL( R_CAM_VIDEO_POSTCAPTURE_TOOLBAR_UPLOAD ); + } + else + { + CreateAndSetToolbarL( R_CAM_VIDEO_POSTCAPTURE_TOOLBAR ); + } + } + } + + iAiwServiceHandler->Reset(); + iAiwServiceHandler->AttachMenuL( ROID( R_CAM_VIDEO_POST_CAPTURE_MENU_ID ), + R_CAM_SHARE_ON_OVI_INTEREST ); + + CCamPostCaptureViewBase::DoActivateL( + aPreViewId, aCustomMessageId, aCustomMessage ); + + if ( !iController.IsTouchScreenSupported() ) + { + TCamOrientation orientation = appUi->CamOrientation(); + + CCamActivePaletteHandler* apHandler = appUi->APHandler(); + if( !iEmbedded && ( orientation == ECamOrientationCamcorder || + orientation == ECamOrientationCamcorderLeft ) ) + { + iContainer->CreateActivePaletteL(); + MActivePalette2UI* activePalette = + appUi->APHandler()->ActivePalette(); + + if(activePalette) + { + activePalette->SetGc(); + } + + // install still pre-capture items + apHandler->InstallAPItemsL( R_CAM_VIDEO_POST_CAPTURE_AP_ITEMS ); + + // Hide Send or Send to caller + ResetSendAvailabilityL( apHandler ); + apHandler->SetView( this ); + + // Make AP visible + appUi->SetAlwaysDrawPostCaptureCourtesyUI( ETrue ); + } + else + { + } + } + iAiwServiceHandler->AttachMenuL( ROID( R_CAM_VIDEO_POST_CAPTURE_MENU_ID ), + R_CAM_SET_AS_RING_TONE_INTEREST ); + } + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView::CCamVideoPostCaptureView +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamVideoPostCaptureView::CCamVideoPostCaptureView( CCamAppController& aController ) + : CCamPostCaptureViewBase( aController ) + { + } + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamVideoPostCaptureView::ConstructL() + { + PRINT( _L("Camera => CCamVideoPostCaptureView::ConstructL")) + BaseConstructL( ROID(R_CAM_VIDEO_POST_CAPTURE_VIEW_ID)); + CCamPostCaptureViewBase::ConstructL(); + + iAiwServiceHandler->AttachMenuL( ROID( R_CAM_VIDEO_POST_CAPTURE_MENU_ID ), R_CAM_SHARE_ON_OVI_INTEREST ); + + PRINT( _L("Camera <= CCamVideoPostCaptureView::ConstructL")) + } + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CCamVideoPostCaptureView::DoDeactivate() + { + CCamPostCaptureViewBase::DoDeactivate(); + } + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView::SetTitlePaneTextL +// Set the view's title text +// --------------------------------------------------------------------------- +// +void CCamVideoPostCaptureView::SetTitlePaneTextL() + { + TBool titleAlwaysShowsFileName = EFalse; + CCamAppUiBase* appUi = static_cast( AppUi() ); + + if ( appUi->CamOrientation() == ECamOrientationViewMode || + titleAlwaysShowsFileName ) + { + appUi->SetTitleL( iController.CurrentImageName() ); + } + } + + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView::ProcessCommandL +// Handling ECamCmdToggleActiveToolbar from any of the PostCaptureView's +// either Image/Video. +// --------------------------------------------------------------------------- +// +void CCamVideoPostCaptureView::ProcessCommandL( TInt aCommand ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + TCamOrientation orientation = appUi->CamOrientation(); + if( orientation == ECamOrientationCamcorder || + orientation == ECamOrientationCamcorderLeft || + orientation == ECamOrientationPortrait ) + { + if ( aCommand == ECamCmdToggleActiveToolbar ) + { + CCamPostCaptureViewBase::HandleCommandL( aCommand ); + } + else + { + CAknView::ProcessCommandL( aCommand ); + } + } + else + { + if ( aCommand == EAknSoftkeyContextOptions ) + { + iRockerKeyPress = ETrue; + MenuBar()->SetContextMenuTitleResourceId( + ROID(R_CAM_VIDEO_POST_CAPTURE_MENU_ID ) ); + MenuBar()->SetMenuType( CEikMenuBar::EMenuContext ); + MenuBar()->TryDisplayMenuBarL(); + MenuBar()->SetMenuType( CEikMenuBar::EMenuOptions ); + } + else + { + CAknView::ProcessCommandL( aCommand ); + } + + } + // CALL THE BASE CLASS + + } + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView::DynInitMenuPaneL +// Changes MenuPane dynamically +// --------------------------------------------------------------------------- +// +void CCamVideoPostCaptureView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) + { + PRINT( _L("Camera => CCamVideoPostCaptureView::DynInitMenuPaneL")) + + if ( iAiwServiceHandler ) + { + PRINT( _L("Camera => CCamVideoPostCaptureView::DynInitMenuPaneL aiw")) + + // let AIW handle it's own submenus + if ( iAiwServiceHandler->HandleSubmenuL( *aMenuPane ) ) + { + PRINT( _L("Camera => CCamVideoPostCaptureView::DynInitMenuPaneL aiw handle sub")) + return; + } + } + + CCamPostCaptureViewBase::DynInitMenuPaneL( aResourceId, aMenuPane ); + + PRINT( _L("Camera => CCamVideoPostCaptureView::DynInitMenuPaneL A")) + if ( iAiwServiceHandler && iAiwServiceHandler->IsAiwMenu( aResourceId ) ) + { + PRINT1( _L("Camera => CCamVideoPostCaptureView::DynInitMenuPaneL res ID (%d)"),aResourceId ) + CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL(); + TAiwVariant variant( iController.CurrentFullFileName() ); + TAiwGenericParam param( EGenericParamFile, variant ); + paramList.AppendL( param ); + + TAiwVariant variant2( _L("video/*") ); + TAiwGenericParam param2( EGenericParamMIMEType, variant2 ); + paramList.AppendL( param2 ); + + PRINT( _L("Camera => CCamVideoPostCaptureView::DynInitMenuPaneL C")) + iAiwServiceHandler->InitializeMenuPaneL( + *aMenuPane, + aResourceId, + ECamCmdAIWCommands, + paramList ); + + PRINT( _L("Camera => CCamVideoPostCaptureView::DynInitMenuPaneL D")) + } + + TInt itemPos(0); + + if ( aResourceId == ROID( R_CAM_VIDEO_POST_CAPTURE_MENU_ID ) || + aResourceId == ROID( R_CAM_VIDEO_POST_CAPTURE_OK_MENU_ID ) ) + { + TBool showSend = ETrue; + TBool showSendToCaller = EFalse; + +/*#ifndef __WINS__ + if ( iSFIUtils->IsCLIValidL() ) + { + showSend = EFalse; + showSendToCaller = ETrue; + + if ( iController.IntegerSettingValue( ECamSettingItemVideoQuality ) + == ECamVideoQualityHigh ) + { + showSendToCaller = EFalse; + } + } +#endif*/ + + if ( !iController.IsTouchScreenSupported() || + !iOneClickUploadUtility->OneClickUploadSupported() ) + { + // In non-touch UI Send/Send to caller are always in AP. + // No need for Options menu items. + + // If 1-click upload is not supported in touch UI, then there is + // a send button in the fixed toolbar. There is no need to + // have it in Options menu. + showSend = EFalse; + showSendToCaller = EFalse; + } + + if( aMenuPane->MenuItemExists( ECamCmdSendToCallerMultimedia, itemPos ) ) + { + aMenuPane->SetItemDimmed( + ECamCmdSendToCallerMultimedia, !showSendToCaller ); + } + + if( aMenuPane->MenuItemExists( ECamCmdSend, itemPos ) ) + { + aMenuPane->SetItemDimmed( + ECamCmdSend, !showSend ); + } + + /* + * MSK : ContextOptions --> We just hide Help and Exit from the Options Menu when + * the MSK is pressed in the postcapture still view + * iRockerKeyPress represents MSK key event in still postcapture view + */ + if ( aMenuPane->MenuItemExists( EAknCmdHelp, itemPos ) && + aMenuPane->MenuItemExists( ECamCmdInternalExit, itemPos ) ) + { + if ( iRockerKeyPress ) + { // We hide Help and Exit + aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue ); + aMenuPane->SetItemDimmed( ECamCmdInternalExit, ETrue ); + iRockerKeyPress = EFalse; + } + else + { // We show Help and Exit + aMenuPane->SetItemDimmed( EAknCmdHelp, EFalse ); + aMenuPane->SetItemDimmed( ECamCmdInternalExit, EFalse ); + } + } + } + } + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView::HandleNotifyL +// Handles any notification caused by asynchronous ExecuteCommandL +// or event. +// --------------------------------------------------------------------------- +// +TInt CCamVideoPostCaptureView::HandleNotifyL( + TInt /*aCmdId*/, + TInt aEventId, + CAiwGenericParamList& /*aEventParamList*/, + const CAiwGenericParamList& /*aInParamList*/ ) + { + //AIW fails to assign. eg. the contact is locked for being used now. + if ( aEventId == KAiwEventError && iController.IsAppUiAvailable() ) + { + CCamAppUi* appUi = static_cast( AppUi() ); + TRAP_IGNORE( appUi->HandleCameraErrorL( KErrInUse ) ); + } + + return 0; + } + +// --------------------------------------------------------------------------- +// CCamVideoPostCaptureView::DynInitToolbarL +// Dynamically initialize toolbar contents +// --------------------------------------------------------------------------- +// +void CCamVideoPostCaptureView::DynInitToolbarL( TInt aResourceId, + CAknToolbar* aToolbar ) + { + PRINT2( _L("Camera => CCamVideoPostCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ); + (void)aResourceId; // remove compiler warning + + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() && iEmbedded && aToolbar ) + { + // HideItem will not do anything if a button for the given + // command ID is not found. + aToolbar->HideItem( ECamCmdSend, ETrue, EFalse ); + aToolbar->HideItem( ECamCmdDelete, ETrue, EFalse ); + aToolbar->HideItem( ECamCmdOneClickUpload, ETrue, EFalse ); + aToolbar->HideItem( ECamCmdPlay, ETrue, EFalse ); + } + + PRINT2( _L("Camera <= CCamVideoPostCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ); + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamVideoPreCaptureContainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamVideoPreCaptureContainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,641 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Container class for video image pre-capture view* +*/ + +// INCLUDE FILES +#include "CamAppUiBase.h" +#include "CamVideoPreCaptureContainer.h" +#include "CamLogger.h" +#include "CamPanic.h" +#include "CamUtility.h" +#include "CamAppUi.h" +#include "CamSidePane.h" +#include "CamNaviProgressBarControl.h" +#include "CamViewBase.h" +#include "CamIndicator.h" +#include "CamIndicatorData.h" +#include "CamIndicatorResourceReader.h" +#include "CameraUiConfigManager.h" +#include "camactivepalettehandler.h" +#include +#include +#include // For CCoeAppUiBase +#include // For CEikApplication +#include +#include +#include +#include +#include +#include +#include +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamVideoPreCaptureContainerTraces.h" +#endif + + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureContainer::NewL +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamVideoPreCaptureContainer* CCamVideoPreCaptureContainer::NewL( + CCamAppController& aController, + CAknView& aView, + const TRect& aRect ) + { + CCamVideoPreCaptureContainer* self = new( ELeave ) CCamVideoPreCaptureContainer( + aController, aView ); + + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + CleanupStack::Pop( self ); + // Return newly created CCamVideoPreCaptureContainer instance + return self; + } + +// Destructor +CCamVideoPreCaptureContainer::~CCamVideoPreCaptureContainer() + { + PRINT( _L("Camera => ~CCamVideoPreCaptureContainer") ); + delete iFileTypeIndicator; + PRINT( _L("Camera <= ~CCamVideoPreCaptureContainer") ); + } + +// --------------------------------------------------------- +// CCamVideoPreCaptureContainer::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------- +// +void CCamVideoPreCaptureContainer::ConstructL( const TRect& aRect ) + { + PRINT( _L("Camera => CCamVideoPreCaptureContainer::ConstructL")) + PRINT( _L("Camera => CCamVideoPreCaptureContainer::ConstructL C")) + TCamVideoResolution res = iController.GetCurrentVideoResolution(); + PRINT( _L("Camera => CCamVideoPreCaptureContainer::ConstructL D")) + iVFRes = iController.VideoViewFinderResourceId( res ); + PRINT( _L("Camera => CCamVideoPreCaptureContainer::ConstructL E")) + + BaseConstructL( aRect ); + iShowReticule = EFalse; + + iSidePane->SetCaptureMode( ECamControllerVideo ); + + CreateFiletypeIndicatorL(); + + iRecordState = ECamNotRecording; + + // Get the co-ordinates where the resolution + // icon should move to during video capture + TAknLayoutRect layoutRect; + TRect rect; + TAknLayoutRect vidProgressPane; + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, rect ); + } + else + { + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); + } + if ( CamUtility::IsNhdDevice() ) + { + TInt variant = Layout_Meta_Data::IsLandscapeOrientation(); + vidProgressPane.LayoutRect( rect, + AknLayoutScalable_Apps::vid4_progress_pane( variant ) ); + layoutRect.LayoutRect( vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_g1() ); + } + else + { + TInt cba = AknLayoutUtils::CbaLocation() == + AknLayoutUtils::EAknCbaLocationLeft; + vidProgressPane.LayoutRect( rect, + AknLayoutScalable_Apps::vid6_indi_pane( cba ) ); + layoutRect.LayoutRect( vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g1( !cba ) );// quality + } + + iResolutionIndicatorVidcapPosition = layoutRect.Rect(); + if ( !iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) + { + static_cast( this ) + ->SetupActivePaletteL( static_cast(&iView) ); + } + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureContainer::CCamVideoPreCaptureContainer +// C++ constructor +// --------------------------------------------------------------------------- +// + +CCamVideoPreCaptureContainer::CCamVideoPreCaptureContainer( + CCamAppController& aController, + CAknView& aView ) +: CCamPreCaptureContainerBase( aController, aView ) + { + } + +// --------------------------------------------------------- +// CCamVideoPreCaptureContainer::HandleControllerEventL +// Receives notifications about changes in recording state from the controller +// --------------------------------------------------------- +// +void +CCamVideoPreCaptureContainer +::HandleControllerEventL( TCamControllerEvent aEvent, TInt aError ) + { + PRINT1( _L("Camera => CCamVideoPreCaptureContainer::HandleControllerEventL aEvent:%d"), aEvent ) + switch( aEvent ) + { + // --------------------------------------------------- + case ECamEventOperationStateChanged: + { + TCamCaptureOperation operation = iController.CurrentOperation(); + switch( operation ) + { + case ECamCapturing: + { + iRecordState = ECamRecording; + iFileTypeIndicator->SetRect(iFileTypeIndicatorVidcapPosition); + iResolutionIndicators[iCurrentIndicator]->SetRect(iResolutionIndicatorVidcapPosition); + break; + } + case ECamPaused: + { + iRecordState = ECamRecordPaused; + break; + } + default: + { + iRecordState = ECamNotRecording; + break; + } + } + break; + } + // --------------------------------------------------- + case ECamEventLocationSettingChanged: + { + // If the location setting was changed on, then the indicator should be visible + SetLocationIndicatorVisibility(); + } + // --------------------------------------------------- + case ECamEventCameraChanged: + { + SetFileTypeIndicator(); + break; + } + // --------------------------------------------------- + case ECamEventVideoFileTypeChanged: + { + SetResolutionIndicator(); + SetFileTypeIndicator(); + break; + } + // --------------------------------------------------- + case ECamEventImageQualityChanged: + { + // To get correct viewfinder resolution: + TCamVideoResolution res = iController.GetCurrentVideoResolution(); + iVFRes = iController.VideoViewFinderResourceId( res ); + } + // --------------------------------------------------- + case ECamEventRecordComplete: + { + iResolutionIndicators[iCurrentIndicator]->SetRect( ResolutionIndicatorRect() ); + iFileTypeIndicator->SetRect( iFileTypeIndicatorPosition ); + break; + } + // --------------------------------------------------- + case ECamEventInitReady: + { + // event only sent if UIOrientationOverride feature is supported + if ( !iController.IsTouchScreenSupported() && + iController.CurrentMode()== ECamControllerVideo ) + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + if ( appUi ) + { + if ( !appUi->ActivePalette() ) + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMVIDEOPRECAPTURECONTAINER_HANDLECONTROLLEREVENTL, "e_CAM_APP_AP_SETUP 1" ); + static_cast( this ) + ->SetupActivePaletteL( static_cast(&iView) ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMVIDEOPRECAPTURECONTAINER_HANDLECONTROLLEREVENTL, "e_CAM_APP_AP_SETUP 0" ); + } + else + { + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMVIDEOPRECAPTURECONTAINER_HANDLECONTROLLEREVENTL, "e_CAM_APP_AP_UPDATE 1" ); + appUi->APHandler()->UpdateActivePaletteL(); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMVIDEOPRECAPTURECONTAINER_HANDLECONTROLLEREVENTL, "e_CAM_APP_AP_UPDATE 0" ); + } + appUi->SetActivePaletteVisibility( ETrue ); + } + } + break; + } + // --------------------------------------------------- + default: + { + // otherwise, do nothing + } + // --------------------------------------------------- + } + + CCamPreCaptureContainerBase::HandleControllerEventL( aEvent, aError ); + PRINT( _L("Camera <= CCamVideoPreCaptureContainer::HandleControllerEventL")) + } + +// --------------------------------------------------------- +// CCamVideoPreCaptureContainer::HandleForegroundEventL +// Handle events sending app to foreground and background +// --------------------------------------------------------- + +void CCamVideoPreCaptureContainer::HandleForegroundEventL( TBool /*aForeground*/ ) + { + } + + +// --------------------------------------------------------- +// CCamVideoPreCaptureContainer::ViewFinderLayoutResourceIds +// Return the layout resource id for the viewfinder +// (Note: reticule not required for video viewfinder) +// --------------------------------------------------------- +// +void CCamVideoPreCaptureContainer::ViewFinderLayoutResourceIds( + TInt& aViewFinderLayoutId, + TInt& /*aReticuleLayoutId*/ ) const + { + aViewFinderLayoutId = iVFRes; + } + +// --------------------------------------------------------- +// CCamVideoPreCaptureContainer::SetResolutionIndicator +// Sets the resolution indictator to the required icon +// --------------------------------------------------------- +// +void CCamVideoPreCaptureContainer::SetResolutionIndicator() + { + iCurrentIndicator = iController.IntegerSettingValue( ECamSettingItemVideoQuality ); + } + +// --------------------------------------------------------- +// CCamStillPreCaptureContainer::SetLocationIndicatorVisibility +// Sets the resolution indicator visibility, if it is set or not. +// Do nothing if video taken. +// --------------------------------------------------------- +// +void CCamVideoPreCaptureContainer::SetLocationIndicatorVisibility() + { + // The setting stored is an index of whether the location setting is on or off + iLocationIndicatorVisible = (/*TCamLocationId::ECamLocationOn*/1 == iController.IntegerSettingValue( ECamSettingItemRecLocation )); + } + +// ---------------------------------------------------- +// CCamStillPreCaptureContainer::LocationtionIndicatorRect +// Returns the rectangle defining the position and size +// of the location icon +// ---------------------------------------------------- +// +TRect CCamVideoPreCaptureContainer::LocationIndicatorRect() + { + TAknLayoutRect layoutRect; + //layoutRect.LayoutRect( Rect(), ROID(R_CAM_VIDEO_PRECAP_LOCATION_ID) ); + return layoutRect.Rect(); + } + +// ---------------------------------------------------- +// CCamVideoPreCaptureContainer::IncreaseFlashSettingL +// Move up through the flash settings +// ---------------------------------------------------- +// +void CCamVideoPreCaptureContainer::IncreaseFlashSettingL() + { + if ( iController.UiConfigManagerPtr()->IsVideoLightSupported() ) + { + CCamAppUiBase* appUi = static_cast( iEikonEnv->AppUi() ); + if ( !iZoomPane->IsVisible() + && !appUi->IsSecondCameraEnabled() + ) + { + TCamFlashId flash = + static_cast< TCamFlashId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicVideoFlash ) ); + if ( flash == ECamFlashForced ) + { + flash = ECamFlashOff; + } + else + { + flash = ECamFlashForced; + } + iController.SetIntegerSettingValueL(ECamSettingItemDynamicVideoFlash, flash); + } + } // video light supported check + } + +// ---------------------------------------------------- +// CCamVideoPreCaptureContainer::DecreaseFlashSettingL +// Move down through the flash settings +// ---------------------------------------------------- +// +void CCamVideoPreCaptureContainer::DecreaseFlashSettingL() + { + //Given we have two flash modes in video, Increase and Decrease are functionally equivalent + IncreaseFlashSettingL(); + } + +// ---------------------------------------------------- +// CCamVideoPreCaptureContainer::HandleCaptureKeyEventL +// Change the current capture state +// ---------------------------------------------------- +// +TKeyResponse +CCamVideoPreCaptureContainer::HandleCaptureKeyEventL( const TKeyEvent& aKeyEvent ) + { + PRINT( _L("Camera => CCamVideoPreCaptureContainer::HandleCaptureKeyEventL") ); + TKeyResponse keyResponse = EKeyWasNotConsumed; + + // check our current operation state + TCamCaptureOperation operation = iController.CurrentOperation(); + + if ( (ECamCapturing == operation ) || + (ECamPaused == operation ) ) + { + // iController.StopVideoRecording(); + // Stop the video recording using ECamCmdStop command, + // similarily to what happens when Stop softkey is pressed. + iView.HandleCommandL( ECamCmdStop ); + } + + else if ( iController.VideoRecordPending() ) + { + PRINT( _L("Camera <> Video capture already pending") ); + // Do nothing if already pending + keyResponse = EKeyWasConsumed; + } + else + { + // Blank out the softkeys if we are capturing + if ( EKeyWasConsumed == keyResponse ) + { + BlankSoftkeysL(); + } + + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + + // neither recording nor paused + // so attempt to start recording + PRINT( _L("Camera <> starting capture") ); + keyResponse = appUi->StartCaptureL( aKeyEvent ); + + // Hide the toolbar if we are capturing + if( EKeyWasConsumed == keyResponse ) + { + // Repeated key events (MSK) are ignored. + iController.SetDemandKeyRelease( ETrue ); + + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = appUi->CurrentFixedToolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + } + } + PRINT( _L("Camera <= CCamVideoPreCaptureContainer::HandleCaptureKeyEventL") ); + return keyResponse; + } + + +// ---------------------------------------------------- +// virtual InitVfGridL +// ---------------------------------------------------- +void +CCamVideoPreCaptureContainer::InitVfGridL( const TRect& /*aRect*/ ) + { + PRINT(_L("CCamVideoPreCaptureContainer::InitVfGridL -->")); + // Skip constructing vf grid drawer. + // As effect the vf grid is never drawn. + PRINT(_L("CCamVideoPreCaptureContainer::InitVfGridL <--")); + } + + +// ---------------------------------------------------- +// CCamVideoPreCaptureContainer::BlankSoftKeysL +// Blank the softkeys +// ---------------------------------------------------- +// +void CCamVideoPreCaptureContainer::BlankSoftkeysL() + { + static_cast(iView).SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + +// ---------------------------------------------------- +// CCamVideoPreCaptureContainer::HandleShutterKeyEventL +// Change the current capture state following shutter +// key events +// ---------------------------------------------------- +// +TKeyResponse CCamVideoPreCaptureContainer::HandleShutterKeyEventL( const TKeyEvent& /*aKeyEvent*/, + TEventCode /*aType*/ ) + { + return EKeyWasNotConsumed; + } + +// --------------------------------------------------------- +// CCamVideoPreCaptureContainer::DrawAdditionalIcons +// Draw the video file type indicator +// --------------------------------------------------------- +// +void CCamVideoPreCaptureContainer::DrawAdditionalIcons(CBitmapContext& aGc) const + { + + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + TCamCaptureOperation videoOperation = iController.CurrentVideoOperation(); + + // It is essential to check, that the current view state is right. + // Draw request could still arrive to precapture view, + // when in fact video is stopped and transition to post capture + // is in progress. During that time, additional icons should + // not be drawn. + if( appUi + && appUi->CurrentViewState() == ECamViewStatePreCapture + && appUi->DrawPreCaptureCourtesyUI() + && !appUi->IsSecondCameraEnabled() + && ( CamUtility::IsNhdDevice() || videoOperation == ECamNoOperation ) + ) + { + iFileTypeIndicator->Draw( aGc ); + } + } + +// --------------------------------------------------------- +// CCamVideoPreCaptureContainer::CreateFiletypeIndicatorL +// Create the video file type indicator +// --------------------------------------------------------- +// +void CCamVideoPreCaptureContainer::CreateFiletypeIndicatorL() + { + // Create reader + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, ROID(R_CAM_VIDEO_FILETYPE_PANE_ID)); + CCamIndicatorResourceReader* resourceReader = + CCamIndicatorResourceReader::NewLC( reader ); + + // Get indicator data from reader (there will be just 1) + CCamIndicatorData& indData = *( resourceReader->IndicatorData().At( 0 ) ); + iFileTypeIndicator = CCamIndicator::NewL( indData.IndicatorRect() ); + TInt numbitmaps = indData.IndicatorBitmapCount(); // no of bitmaps for indicator + TInt j; + for ( j = 0; j < numbitmaps; j++ ) + { + // Side pane assumes that mask bitmap is defined after the + // normal one in the resource file + iFileTypeIndicator->AddIconL( + indData.IndicatorBitmapId( j ), // bitmap + indData.IndicatorBitmapId( j + 1 )); // mask + j++; + } + + CleanupStack::PopAndDestroy( resourceReader ); + CleanupStack::PopAndDestroy(); // reader + + TAknLayoutRect layoutRect; + TRect rect; + TAknLayoutRect vidProgressPane; + TAknLayoutRect fileTypeIconLayout; + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, rect ); + } + else + { + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); + } + if ( CamUtility::IsNhdDevice() ) + { + TInt variant = Layout_Meta_Data::IsLandscapeOrientation(); + vidProgressPane.LayoutRect( rect, + AknLayoutScalable_Apps::vid4_progress_pane( variant ) ); + layoutRect.LayoutRect( vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid4_progress_pane_g2() ); + + TAknLayoutRect vidIndicatorPane; + vidIndicatorPane.LayoutRect( rect, + AknLayoutScalable_Apps::vid4_indicators_pane( variant ) ); + + fileTypeIconLayout.LayoutRect( vidIndicatorPane.Rect(), + AknLayoutScalable_Apps::vid4_indicators_pane_g2() ); + } + else + { + TInt cba = AknLayoutUtils::CbaLocation() == + AknLayoutUtils::EAknCbaLocationLeft; + vidProgressPane.LayoutRect( rect, + AknLayoutScalable_Apps::vid6_indi_pane( cba ) ); + layoutRect.LayoutRect( vidProgressPane.Rect(), + AknLayoutScalable_Apps::vid6_indi_pane_g2( cba ) );// type + fileTypeIconLayout = layoutRect; + } + + iFileTypeIndicatorVidcapPosition = layoutRect.Rect(); + iFileTypeIndicator->SetRect( fileTypeIconLayout.Rect() ); + iFileTypeIndicatorPosition = fileTypeIconLayout.Rect(); + // Initialise the indicator + SetFileTypeIndicator(); + } + +// ---------------------------------------------------- +// CCamVideoPreCaptureContainer::SetFileTypeIndicator +// Sets the video file type indicator depending on the current +// video file type setting. +// ---------------------------------------------------- +// +void CCamVideoPreCaptureContainer::SetFileTypeIndicator() + { + if ( iFileTypeIndicator ) + { + // If the current mode is video then show the relevant icon + // for the current video file type. + TCamVideoFileType fileType = static_cast< TCamVideoFileType > + ( iController.IntegerSettingValue( ECamSettingItemVideoFileType ) ); + if ( fileType == ECamVideoMpeg4 ) + { + iFileTypeIndicator->SetIcon( 0 ); + } + + // Otherwise display the H263 icon. + else + { + iFileTypeIndicator->SetIcon( 2 ); + } + } + } + +// ---------------------------------------------------- +// CCamVideoPreCaptureContainer::ResolutionIndicatorIconPsiKey +// Returns the PSI key relating to the array of resolution +// indicator bitmaps. +// ---------------------------------------------------- +// +TCamPsiKey CCamVideoPreCaptureContainer::ResolutionIndicatorIconPsiKey() const + { + return ECamPsiPrecapVideoQualityIconIds; + } + + + +// --------------------------------------------------------------------------- +// virtual GetAPResourceId +// (From CCamPreCaptureContainerBase) +// +// Helper method to select the AP resource used to set AP items. +// --------------------------------------------------------------------------- +// +TInt CCamVideoPreCaptureContainer::GetAPResourceId() const + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + TBool embedded = appUi->IsEmbedded(); + TInt resId = 0; + if( embedded ) + { + if ( !appUi->IsSecondCameraEnabled() ) + { + resId = R_CAM_EMB_VIDEO_PRE_CAPTURE_AP_ITEMS_ADVANCED; + } + } + else + { + if ( !appUi->IsSecondCameraEnabled() ) + { + resId = R_CAM_VIDEO_PRE_CAPTURE_AP_ITEMS_ADVANCED; + } + else + { + resId = R_CAM_VIDEO_PRE_CAPTURE_AP_ITEMS_SECONDARY; + } + } + return resId; + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamVideoPreCaptureView.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamVideoPreCaptureView.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1586 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Video pre-capture view class for Camera application* +*/ + + +// INCLUDE FILES + + +#include "CamUtility.h" +#include "CamAppUiBase.h" +#include "CamAppController.h" +#include "CamVideoPreCaptureView.h" +#include "CamLogger.h" +#include "CamContainerBase.h" +#include "CamAppUi.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "CamCaptureSetupMenu.h" +#include "CamPanic.h" + +#include "CamShootingModeContainer.h" +#include "CamVideoPreCaptureContainer.h" +#include "Cam.hrh" +#include "CamAppUid.h" +#include +#include +#include +#include "CamUtility.h" +#include "camactivepalettehandler.h" +#include "CameraUiConfigManager.h" +#include "CamLocalViewIds.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamVideoPreCaptureViewTraces.h" +#endif + + + + +// ========================= MEMBER FUNCTIONS ================================ +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::NewLC +// Symbian OS two-phased constructor +// --------------------------------------------------------------------------- +// +CCamVideoPreCaptureView* CCamVideoPreCaptureView::NewLC( CCamAppController& aController ) + { + CCamVideoPreCaptureView* self = + new( ELeave ) CCamVideoPreCaptureView( aController ); + + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView destructor +// +// --------------------------------------------------------------------------- +// +CCamVideoPreCaptureView::~CCamVideoPreCaptureView() + { + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::Id +// Returns UID of view +// --------------------------------------------------------------------------- +// +TUid CCamVideoPreCaptureView::Id() const + { + return TUid::Uid( ECamViewIdVideoPreCapture ); + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::DoDeactivate() + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMVIDEOPRECAPTUREVIEW_DODEACTIVATE, "e_CCamVideoPreCaptureView_DoDeactivate 1" ); + PERF_EVENT_START_L2( EPerfEventVideoPreCaptureViewDeactivation ); + CCamPreCaptureViewBase::DoDeactivate(); + PERF_EVENT_END_L2( EPerfEventVideoPreCaptureViewDeactivation ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMVIDEOPRECAPTUREVIEW_DODEACTIVATE, "e_CCamVideoPreCaptureView_DoDeactivate 0" ); + } + +// ----------------------------------------------------------------------------- +// CCamVideoPreCaptureView::HandleCommandL +// Handle commands +// ----------------------------------------------------------------------------- +// +void +CCamVideoPreCaptureView::HandleCommandL( TInt aCommand ) + { + PRINT( _L("Camera => CCamVideoPreCaptureView::HandleCommandL") ); + // check our current operation state + TCamCaptureOperation operation = iController.CurrentVideoOperation(); + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + TCamOrientation orientation = appUi->CamOrientation(); + switch ( aCommand ) + { + case ECamMSKCmdSelect: + case ECamMSKCmdAppRecord: + { + if( orientation == ECamOrientationCamcorder || + orientation == ECamOrientationCamcorderLeft || + orientation == ECamOrientationPortrait ) + { + if ( !StartMskCaptureL() ) + { + // If in the Landscape mode, MSK event is mapped + // like a normal selection key so that AP items + // are selected and respective setting pages are launched + TKeyEvent aKeyEvent; + aKeyEvent.iCode = aKeyEvent.iRepeats = aKeyEvent.iModifiers = 0; + aKeyEvent.iScanCode = EStdKeyDevice3; + static_cast + ( Container() )->OfferKeyEventL( aKeyEvent, EEventKey ); + } + } + else if ( aCommand == ECamMSKCmdAppRecord ) + // if the Camera in the Portrait mode + // MSK event is handled like a capture key + { + if ( iController.IsViewFinding() && appUi->CheckMemoryL() ) + { + iController.StartVideoRecordingL(); + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + } + } + break; + } + case ECamCmdRecord: + { + TInt callType( EPSCTsyCallTypeUninitialized ); + RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType ); + if ( callType != EPSCTsyCallTypeH324Multimedia && iController.IsViewFinding() && appUi->CheckMemoryL() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + appUi->SetLensCoverExit( EFalse ); + iController.StartVideoRecordingL(); + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + } + break; + } + + case EAknSoftkeySelect: + { + switch( operation ) + { + // ------------------------- + case ECamNoOperation: + { + if ( !iController.VideoRecordPending() ) + { + CCamPreCaptureViewBase::HandleCommandL( aCommand ); + } + break; + } + // ------------------------- + // ...Otherwise, if we are in video recording or paused mode + // ...then stop the recording. + case ECamCapturing: + case ECamPaused: + { + iController.StopVideoRecording(); + break; + } + // ------------------------- + default: + break; + // ------------------------- + } + break; + } + // --------------------------------------------------- + case ECamCmdPause: + { + iController.PauseVideoRecording(); + break; + } + // --------------------------------------------------- + case ECamCmdContinue: + { + iController.ContinueVideoRecording(); + break; + } + // --------------------------------------------------- + case ECamCmdShootSetup: + { + // If currently recording or paused recording then don't + // popup the capture setup menu. + if ( ECamPaused == operation + || ECamCapturing == operation ) + { + return; + } + // Otherwise popup the capture setup menu + else + { + CCamPreCaptureViewBase::HandleCommandL( aCommand ); + } + break; + } + // --------------------------------------------------- + case ECamCmdGoToStandby: + { + PRINT( _L("Camera <> CCamVideoPreCaptureView::HandleCommandL: case ECamCmdGoToStandby") ); + + //PRINT1( _L("Camera => CCamVideoPreCaptureView::HandleCommandL standby error (%d)"), iStandbyError) + //SwitchToStandbyModeL( ECamViewIdVideoPreCapture, iStandbyError ); + SwitchToStandbyModeL( ECamViewIdVideoPreCapture, appUi->StandbyStatus() ); + break; + } + // --------------------------------------------------- + case ECamCmdExitStandby: + { + PRINT( _L("Camera <> CCamVideoPreCaptureView::HandleCommandL: case ECamCmdExitStandby") ); + ExitStandbyModeL(); + break; + } + // --------------------------------------------------- + case ECamCmdMute: + { + MuteEmbeddedAudioL( ETrue ); + break; + } + // --------------------------------------------------- + case ECamCmdUnmute: + { + MuteEmbeddedAudioL( EFalse ); + break; + } + // --------------------------------------------------- + case ECamCmdStop: + { + CCamAppUi* appUi = static_cast( AppUi() ); + appUi->EndCapture(); + break; + } + // --------------------------------------------------- + case ECamCmdToggleVideoFlash: + { + if ( iController.UiConfigManagerPtr()->IsVideoLightSupported() ) + { + TCamFlashId flash = static_cast< TCamFlashId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicVideoFlash ) ); + if( flash == ECamFlashForced ) + { + flash = ECamFlashOff; + } + else + { + flash = ECamFlashForced; + } + iController.SetIntegerSettingValueL(ECamSettingItemDynamicVideoFlash, flash); + + CCamAppUi* appUi = static_cast( AppUi() ); + if ( appUi && + appUi->APHandler() && + ( appUi->CamOrientation() == ECamOrientationCamcorder || appUi->CamOrientation() == ECamOrientationCamcorderLeft ) ) + { + appUi->APHandler()->UpdateActivePaletteL(); + } + } + UpdateToolbarIconsL(); + break; + } + // --------------------------------------------------- + default: + { + CCamPreCaptureViewBase::HandleCommandL( aCommand ); + break; + } + // --------------------------------------------------- + } + + PRINT( _L("Camera <= CCamVideoPreCaptureView::HandleCommandL") ); + } + +// ----------------------------------------------------------------------------- +// CCamVideoPreCaptureView::HandleForegroundEventL +// Handle foreground event +// ----------------------------------------------------------------------------- +// +void +CCamVideoPreCaptureView::HandleForegroundEventL( TBool aForeground ) + { + PRINT1( _L( "Camera => CCamVideoPreCaptureView::HandleForegroundEventL %d" ), aForeground ); + + CCamAppUi* appUi = static_cast( AppUi() ); + + // ------------------------------------------------------- + // reset menu and cba as appropriate + if( aForeground ) + { + // ignore event if received in postcapture or if uiorientationoverride + // is supported and going to stillmode + if ( ECamViewStatePostCapture == appUi->CurrentViewState() || + ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() && + appUi->TargetMode() == ECamControllerImage ) ) + { + return; + } + + if ( appUi->IsInPretendExit() ) + { + // The view can get a foreground event while the application is + // actually in a pretend exit situation. This occurs when the view switch + // was called before the exit event, but didn't complete until after the + // exit event. In this case the view should not register an interest in + // the engine as the application is really in the background and the resources + // need to be released + PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleForegroundEventL, in pretend exit" ) ); + return; + } + // if foreground event is received while in videocall, go to standby with error + if ( iController.InVideocallOrRinging() && ECamNoOperation == iController.CurrentOperation() ) + { + ExitAllModesL(); + appUi->SetStandbyStatus( KErrInUse ); + appUi->HandleCommandL( ECamCmdGoToStandby ); + SetTitlePaneTextL(); + return; + } + + // make sure CBA is correct + UpdateCbaL(); + + // check for silent profile whenever we come to foreground, we dont need it here, + // but we keep track of this in appcontroller. + iController.IsProfileSilent(); + + // set embedded flag here + iEmbedded = appUi->IsEmbedded(); + PRINT1( _L("Camera <> CCamVideoPreCaptureView::HandleForegroundEventL - iEmbedded:%d"), iEmbedded ); + + // update menu bar as required + SetMenuBar(); + + // if video is currently saving, it can be in either of the states: + // ECamVideoRecordInProgress orECamVideoRecordPaused + // but the recording has already been stopped + if ( iController.CurrentlySavingVideo() ) + { + UpdateCbaL(); + // if the app was behind an eikon server window then the resources + // were not released. + if ( iContinueInBackground ) + { + iContinueInBackground = EFalse; + PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleForegroundEvent, returned behind notification" ) ); + return; + } + + // Register that we want to use the engine + IncrementCameraUsers(); + PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleForegroundEvent, waiting for postcapture" ) ); + return; + } + + } + // ------------------------------------------------------- + // if going to the background, stop any current video recording + // unless already saving or it is only an eikon server window + else + { + TCamCaptureOperation operation( iController.CurrentVideoOperation() ); + + PRINT1( _L("Camera <> CCamVideoPreCaptureView::HandleForegroundEventL - operation=%d"), operation ); + if( !iController.CurrentlySavingVideo() && + ( ( ECamCapturing == operation || ECamPaused == operation ) + && appUi->AppInBackground( EFalse ) + || ( iController.UiConfigManagerPtr()->IsKeyLockWatcherSupported() && iController.IsKeyLockOn() ) ) ) + { + PRINT( _L("Camera <> CCamVideoPreCaptureView::HandleForegroundEventL stopping video") ); + // If the video stops for an active call then inform the controller + // this info is needed so that the stop tone isn't played + if ( appUi->ForegroundAppIsPhoneApp() ) + { + PRINT( _L("Camera <> CCamVideoPreCaptureView::HandleForegroundEventL SetVideoStoppedForPhoneApp") ); + iController.SetVideoStoppedForPhoneApp( ETrue ); + } + + // If AknCapServer has NOT got foreground, (which would possibly + // indicate a "charging" note) stop video recording + iController.StopVideoRecording(); + // reset the stopped for call flag + iController.SetVideoStoppedForPhoneApp( EFalse ); + } + + /* + const TInt KWindowGroupId( iCoeEnv->WsSession().GetFocusWindowGroup() ); + TCamCaptureOperation operation( iController.CurrentVideoOperation() ); + + if ( KWindowGroupId != iEikonServerWindowGroupId + && KWindowGroupId != iBTServerWindowGroupId + && ( ECamCapturing == operation + || ECamPaused == operation ) ) + { + if ( !CamUtility::IdMatchesName( KWindowGroupId, KAknCapServer ) ) + { + // If the video stops for an active call then inform the controller + // this info is needed so that the stop tone isn't played + if ( appUi->ForegroundAppIsPhoneApp() ) + { + iController.SetVideoStoppedForPhoneApp( ETrue ); + } + + // If AknCapServer has NOT got foreground, (which would possibly + // indicate a "charging" note) stop video recording + iController.StopVideoRecording(); + // reset the stopped for call flag + iController.SetVideoStoppedForPhoneApp( EFalse ); + } + } + */ + } + // ------------------------------------------------------- + + CCamPreCaptureViewBase::HandleForegroundEventL( aForeground ); + + PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleForegroundEventL" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamVideoPreCaptureView::HandleFocusLossL +// Handle change of focus +// ----------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::HandleFocusLossL() + { + PRINT( _L( "Camera => CCamVideoPreCaptureView::HandleFocusLossL" ) ); + // if the application was already in the background, but behind an + // eikon server window, then handle backgrounding properly now. + // Otherwise the backgrounding will be handled in the normal + // HandleForeground() method. + if ( iContinueInBackground ) + { + const TCamCaptureOperation operation( iController.CurrentOperation() ); + if ( ECamCapturing == operation + || ECamPaused == operation ) + { + iController.StopVideoRecording(); + } + } + CCamPreCaptureViewBase::HandleFocusLossL(); + PRINT( _L( "Camera <= CCamVideoPreCaptureView::HandleFocusLossL" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamVideoPreCaptureView::HandleControllerEventL +// Handle controller events +// ----------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ) + { + PRINT2( _L("Camera => CCamVideoPreCaptureView::HandleControllerEventL event (%d) error (%d)"), aEvent, aError ); + switch( aEvent ) + { + // ----------------------------------------------------- + // If the recording state of the camera has changed (started/paused/stopped) + // we may need to update the CBA labels + case ECamEventOperationStateChanged: + { + if( iController.IsAppUiAvailable() ) + { + const TCamCaptureOperation operation( iController.CurrentOperation() ); + if ( ECamCapturing == operation ) + { + const TCamOrientation camOrientation = + static_cast( AppUi() )->CamOrientation(); + // if in camcorder mode need to show navi-ctr + if( ECamOrientationCamcorder == camOrientation + || ECamOrientationCamcorderLeft == camOrientation + || ECamOrientationPortrait == camOrientation ) + { + iContainer->SetupNaviPanesL( CCamContainerBase::ECamPaneProgress ); + } + else + { + static_cast( AppUi() )->PushNaviPaneProgressBarL(); + } + } + else if ( ECamCompleting == operation ) + { + iContainer->SetupNaviPanesL( CCamContainerBase::ECamPaneCounter ); + } + else + { + // empty else statement to remove LINT error + } + UpdateCbaL(); + } + break; + } + // ----------------------------------------------------- + case ECamEventRecordComplete: + { + static_cast( AppUi() )->PushNaviPaneCounterL(); + // if the recording failed due to a problem with the MMC + if ( KErrNone != aError + && iController.IntegerSettingValue( ECamSettingItemVideoMediaStorage ) + == ECamMediaStorageCard + && CamUtility::MemoryCardStatus() != ECamMemoryCardInserted ) + { + StopViewFinder(); + StartViewFinder(); + } + if ( static_cast( AppUi() )->ShowPostCaptureView() == EFalse + && !iController.IsCaptureStoppedForUsb() ) + { + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* toolbar = Toolbar(); + if ( toolbar ) + { + toolbar->SetToolbarVisibility( ETrue ); + } + } + } + + if ( iController.IsCaptureStoppedForUsb() ) + { + iContainer->SetupNaviPanesL( CCamContainerBase::ECamPaneCounter ); + } + + if ( EFalse == static_cast( AppUi() )->ShowPostCaptureView() ) + { + // Vf was stopped when stopping video recording, need to restart here + // if postcapture is off. + StartViewFinder(); + } + break; + } + // ----------------------------------------------------- + case ECamEventEngineStateChanged: + { + CCamPreCaptureViewBase::HandleControllerEventL( aEvent, aError ); + break; + } + // ----------------------------------------------------- + case ECamEventSliderOpen: + { + iController.StartViewFinder(); + break; + } + default: + { + // Other events ignored + break; + } + // ----------------------------------------------------- + } + PRINT ( _L("Camera <= CCamVideoPreCaptureView::HandleControllerEventL") ); + } + + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::CCamVideoPreCaptureView +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamVideoPreCaptureView::CCamVideoPreCaptureView( CCamAppController& aController ) + : CCamPreCaptureViewBase( aController ) + { + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::ConstructL +// Symbian OS 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::ConstructL() + { + BaseConstructL( ROID(R_CAM_VIDEO_PRE_CAPTURE_VIEW_ID)); + if(iController.UiConfigManagerPtr()->IsXenonFlashSupported()) + { + CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR); + UpdateToolbarIconsL(); + } + else + { + CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR_VIDEOLIGHT); + } + CCamPreCaptureViewBase::ConstructL(); + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::UpdateCbaL +// Update softkeys to reflect current state +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::UpdateCbaL() + { + PRINT( _L("Camera => CCamVideoPreCaptureView::UpdateCbaL") ); + + CCamAppUi* appui = static_cast( AppUi() ); + + // if videocall is active, set the softkeys already here + if ( iController.InVideocallOrRinging() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); + } + // if the view is in capture setup menu mode + if ( iCaptureSetupMenuModeActive + && !iCaptureSetupModeActive + && !iSceneSettingModeActive ) + { + SetSoftKeysL( R_AVKON_SOFTKEYS_SELECT_BACK ); + } + // if the view is in capture setup mode + else if ( iCaptureSetupModeActive ) + { + SetSoftKeysL( R_AVKON_SOFTKEYS_OK_CANCEL__OK ); + } + // if the view is in scene settings mode + else if ( iSceneSettingModeActive ) + { + // R_AVKON_SOFTKEYS_OPTIONS_BACK + SetSoftKeysL( R_CAM_SOFTKEYS_SETTINGS_SELECT_BACK__CHANGE ); //R_CAM_SOFTKEYS_OPTIONS_BACK__CHANGE ); + } + else if ( iStandbyModeActive ) + { + if( KErrNone == appui->StandbyStatus() ) + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CONTINUE ); + else + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); + } + + else // otherwise, show the default softkeys + { + switch ( iController.CurrentVideoOperation() ) + { + // ------------------------------- + case ECamCapturing: + { + if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) + { + SetSoftKeysL( R_CAM_SOFTKEYS_PAUSE_STOP_SECONDARY ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_PAUSE_STOP ); + } + break; + } + // ------------------------------- + case ECamPaused: + { + if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) + { + SetSoftKeysL( R_CAM_SOFTKEYS_CONTINUE_STOP_SECONDARY ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_CONTINUE_STOP ); + } + break; + } + // ------------------------------- + case ECamNoOperation: + { + if ( iController.CaptureModeTransitionInProgress() ) + { + if(iEmbedded ) + { + if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) + { + SetSoftKeysL(R_CAM_SOFTKEYS_BACK_SECONDARY); + } + else + { + SetSoftKeysL(R_CAM_SOFTKEYS_BACK); + } + } + else + { + if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) + { + SetSoftKeysL(R_CAM_SOFTKEYS_BLANK_EXIT_SECONDARY); + } + else + { + SetSoftKeysL(R_CAM_SOFTKEYS_BLANK_EXIT); + } + } + } + else + { + if ( appui->TargetViewState() != ECamViewStatePostCapture ) + { + if ( iEmbedded ) + { + if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD_SECONDARY ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__RECORD ); + } + + } + else + { + if ( !appui->IsToolBarVisible() + && appui->IsSecondCameraEnabled() + && !appui->IsQwerty2ndCamera()) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD_TXT ); + } + else if ( appui->DrawPreCaptureCourtesyUI() ) + { + if(appui->IsSecondCameraEnabled() && !appui->IsQwerty2ndCamera()) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD_SECONDARY ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__RECORD ); + } + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + } + } + } + break; + } + // ------------------------------- + case ECamCompleting: + { + if ( iController.IntegerSettingValue( ECamSettingItemVideoShowCapturedVideo ) == ECamSettOn && + !iController.IsCaptureStoppedForUsb() && appui->TargetViewState() == ECamViewStatePostCapture ) + { + //We need to blank the precapture view CBA here to prevent + //blinking when changing back to precapture from postcapture. + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + break; + } + // ------------------------------- + default: + { + // do nothing + break; + } + // ------------------------------- + } + } + PRINT( _L("Camera <= CCamVideoPreCaptureView::UpdateCbaL") ); + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::SetTitlePaneTextL +// Set the view's title text +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::SetTitlePaneTextL() + { + CCamAppUi* appUi = static_cast( AppUi() ); +#ifndef __WINS__ + if ( iEmbedded /*&& !appUi->IsInCallSend()*/ ) + { + // only set the title if the construction is complete + // otherwise the application is not yet set up correctly + // as embedded + if ( appUi->IsConstructionComplete() ) + { + // set title to name of embedding application + appUi->SetTitleEmbeddedL(); + } + } + else +#endif + { + TInt titleResourceId = R_CAM_VIDEO_PRE_CAPTURE_TITLE_NAME; + + if ( iCaptureSetupModeActive || iSceneSettingModeActive ) + { + titleResourceId = CCamCaptureSetupViewBase::SetupModeTitlePaneResourceId(); + } + + appUi->SetTitleL( titleResourceId ); + } + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::StartViewFinder +// Enter viewfinder mode +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::StartViewFinder() + { + iController.EnterViewfinderMode( ECamControllerVideo ); + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::StopViewFinder +// Exit viewfinder mode +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::StopViewFinder() + { + iController.ExitViewfinderMode( ECamControllerVideo ); + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::CreateContainerL +// Create container control +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::CreateContainerL() + { + TRect screen; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + + iContainer = CCamVideoPreCaptureContainer::NewL( + iController, + *this, + screen ); + + iContainer->SetMopParent( this ); + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::DynInitMenuPaneL +// Changes MenuPane dynamically +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) + { + PRINT( _L("Camera => CCamVideoPreCaptureView::DynInitMenuPaneL" )); + + if ( iContainer ) + { + iContainer->Window().SetNonFading( ETrue ); + } + + CCamAppUi* appUi = static_cast( AppUi() ); + __ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer)); + TInt itemPos(0); + if( aMenuPane->MenuItemExists(ECamCmdToggleCourtesyUI, itemPos) ) + { + if ( !appUi->AlwaysDrawPreCaptureCourtesyUI() ) + { + aMenuPane->SetItemTextL( ECamCmdToggleCourtesyUI, + R_CAM_CAPTURE_DISPLAY_ON_TEXT); + } + } + +// if ( aResourceId == R_CAM_STANDBY_MENU && iStandbyError != KErrNone ) + if ( aResourceId == R_CAM_STANDBY_MENU && appUi->StandbyStatus() != KErrNone ) + { + aMenuPane->SetItemDimmed( ECamCmdExitStandby, ETrue ); + } + else if ( aResourceId == ROID(R_CAM_VIDEO_PRE_CAPTURE_MENU_ID)) + { + DynInitSwitchCameraMenuItemL( aMenuPane ); + } + else // otherwise, not in burst mode or menu pane is not default + { + // if embedded video set mute/unmute option appropriately, and set up + // Switch camera item + if( aResourceId == ROID(R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENU_ID)) + { + DynInitSwitchCameraMenuItemL( aMenuPane ); + iAudioEnabled = iController.IntegerSettingValue( ECamSettingItemVideoAudioRec ); + // if audio off replace mute with unmute + if( iAudioEnabled == ECamSettOff ) + { + aMenuPane->SetItemDimmed( ECamCmdMute, ETrue ); + aMenuPane->SetItemDimmed( ECamCmdUnmute, EFalse ); + } + else + { + aMenuPane->SetItemDimmed( ECamCmdMute, EFalse ); + aMenuPane->SetItemDimmed( ECamCmdUnmute, ETrue ); + } +/*#ifndef __WINS__ + // if embedded and not in in-call send + if ( !appUi->IsInCallSend() ) +#endif*/ + // { + aMenuPane->SetItemDimmed( ECamCmdNewPhoto, ETrue ); + // } + } + + CCamCaptureSetupViewBase::DynInitMenuPaneL( aResourceId, aMenuPane ); + } + PRINT( _L("Camera <= CCamVideoPreCaptureView::DynInitMenuPaneL" )) + } + + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::CreateCaptureSetupMenuL +// Creates a video capture setup menu +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::CreateCaptureSetupMenuL() + { + TInt resource; + // check if we are Western or Arabic/Hebrew layout + if ( !AknLayoutUtils::LayoutMirrored() ) + { + if( AknLayoutUtils::Variant() == EApacVariant ) + { + resource = ROID(R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_APAC_ID); + } + else + { + // use Western resource + resource = ROID(R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_ID); + } + } + else + { + resource = ROID(R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_AH_ID); + } + + // Use capture setup menu for second camera + if ( static_cast( AppUi() )->IsSecondCameraEnabled() ) + { + resource = ROID(R_CAM_CAPTURE_SETUP_MENU_VIDEO_DATA_ID); + } + + iCaptureSetupMenuContainer = + CCamCaptureSetupMenu::NewL( iController, *this, AppUi()->ClientRect(), + resource, iCaptureSetupMenuLastItemIndex ); + + } + +// --------------------------------------------------------------------------- +// CCamPreCaptureViewBase::SwitchToSceneSettingModeL +// Switches the current mode to scene setting and activates a +// specific control. +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::SwitchToSceneSettingModeL() + { + if ( !iSceneSettingContainer ) + { + // Create the scene setting container for video mode. + iSceneSettingContainer = CCamShootingModeContainer::NewL( AppUi()->ApplicationRect(), + *this, + ECamControllerVideo, + iController ); + iSceneSettingContainer->DrawableWindow()->SetOrdinalPosition(-1); + } + + iSettingModeTitleResourceId = R_CAM_VIDEO_SCENE_SETTING_TITLE; + + if ( iEmbedded ) + { + iPreviousMenuResourceId = ROID(R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_ID); + } + else + { + iPreviousMenuResourceId = ROID(R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_ID); + } + // Remove the view's main container, and add the capture setup + // control associated with the input command to the container stack. + CCamCaptureSetupViewBase::SwitchToSceneSettingModeL(); + + // only remove the capture setup menu container after + // the switch completes successfully + RemoveCaptureSetupMenuContainers(); + + // Stop the viewfinder as it isn't required for scene settings + StopViewFinder(); + + } + + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::DoActivateL +// Activate this view +// --------------------------------------------------------------------------- +// +void +CCamVideoPreCaptureView::DoActivateL( const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMVIDEOPRECAPTUREVIEW_DOACTIVATEL, "e_CCamVideoPreCaptureView_DoActivateL 1" ); + PRINT( _L("Camera => CCamVideoPreCaptureView::DoActivateL") ); + PERF_EVENT_START_L2( EPerfEventVideoPreCaptureViewActivation ); + // Ensure the correct menu is used for the current mode. + CCamAppUi* appUi = static_cast( AppUi() ); + + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + if ( appUi->IsEmbedded() ) + { + CAknToolbar* toolbar = Toolbar(); + toolbar->SetToolbarVisibility(EFalse); + } + } + else + { + // handled in CamPreCaptureViewBase + } + + // Check if view is activated internally or externally + TUid appUid = aPrevViewId.iAppUid; + if( appUid != appUi->Application()->AppDllUid() ) + { + // set capture mode + appUi->SetCaptureMode( ECamControllerVideo ); + } + + SetMenuBar(); + + CCamPreCaptureViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); + + PERF_EVENT_END_L2( EPerfEventVideoPreCaptureViewActivation ); + PRINT( _L("Camera <= CCamVideoPreCaptureView::DoActivateL") ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMVIDEOPRECAPTUREVIEW_DOACTIVATEL, "e_CCamVideoPreCaptureView_DoActivateL 0" ); + } + +// --------------------------------------------------------------------------- +// SetMenuBar <> +// --------------------------------------------------------------------------- +// +void +CCamVideoPreCaptureView::SetMenuBar() + { + PRINT( _L("Camera => CCamVideoPreCaptureView::SetMenuBar") ); + CEikMenuBar* menuBar = MenuBar(); + if ( menuBar ) + { + if ( iStandbyModeActive ) + { + PRINT( _L("Camera <> CCamVideoPreCaptureView::SetMenuBar: setting standby menubar..") ); + menuBar->SetMenuTitleResourceId( R_CAM_STANDBY_MENUBAR ); + } + else if ( iEmbedded ) + { + PRINT( _L("Camera <> CCamVideoPreCaptureView::SetMenuBar: setting menu resource to R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_ID") ); + menuBar->SetMenuTitleResourceId( ROID(R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_ID)); + } + else + { + PRINT( _L("Camera <> CCamVideoPreCaptureView::SetMenuBar: setting menu resource to R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_ID") ); + menuBar->SetMenuTitleResourceId( ROID(R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_ID) ); + } + } + PRINT( _L("Camera <= CCamVideoPreCaptureView::SetMenuBar") ); + } + + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::GetHelpContext +// Called to identify the help context for this view +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::GetHelpContext( TCoeHelpContext& aContext ) const + { + aContext.iMajor = TUid::Uid( KCameraappUID ); + + // First check to see if the scene settings list is open + if ( iSceneSettingModeActive ) + { + aContext.iContext = KLCAM_HLP_SCENES_VIDEO; + } + // Else check for standby mode + else if ( iStandbyModeActive ) + { + // Also check to see if this is embedded standby + if ( iEmbedded ) + { + aContext.iContext = KLCAM_HLP_STANDYBY_EM; + } + else + { + aContext.iContext = KLCAM_HLP_STANDYBY_EM; + } + } + // Else check for embedded mode + else if ( iEmbedded ) + { + aContext.iContext = KLCAM_HLP_VIEWFINDER_VIDEO_EM; + } + // Else this is the plain photo viewfinder + else + { + aContext.iContext = KLCAM_HLP_VIEWFINDER_VIDEO; + } + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::MuteEmbeddedAudioL +// Mute or unmute audio for embedded video +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::MuteEmbeddedAudioL( TBool aMuteAudio ) + { + if( aMuteAudio ) + { + iController.SetIntegerSettingValueL( ECamSettingItemVideoAudioRec, ECamSettOff ); + } + else + { + iController.SetIntegerSettingValueL( ECamSettingItemVideoAudioRec, ECamSettOn ); + } + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::DynInitToolbarL +// Dynamically initialize toolbar contents +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::DynInitToolbarL( TInt aResourceId, + CAknToolbar* aToolbar ) + { + PRINT2( _L("Camera => CCamVideoPreCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ) + (void)aResourceId; // remove compiler warning + + CCamAppUi* appUi = static_cast( AppUi() ); + + iController.StartIdleTimer(); + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + UpdateToolbarIconsL(); + if( aToolbar ) + { + if ( iEmbedded && appUi->IsSecondCameraEnabled() ) + { + aToolbar->SetItemDimmed(ECamCmdNewPhoto, ETrue, ETrue); + } + CAknToolbarExtension* extension = aToolbar->ToolbarExtension(); + if( extension ) + { + if ( iEmbedded ) + { + extension->HideItemL( ECamCmdNewPhoto, ETrue ); + extension->HideItemL( ECamCmdPhotos, ETrue ); + } + else + { + extension->HideItemL( ECamCmdNewPhoto, EFalse ); + extension->HideItemL( ECamCmdPhotos, EFalse ); + } + if(aResourceId == ECamCmdToolbarExtension) + { + appUi->ZoomPane()->MakeVisible(EFalse,ETrue); + } + } + } + } + + + PRINT2( _L("Camera <= CCamVideoPreCaptureView::DynInitToolbarL(%d, 0x%X)" ), aResourceId, aToolbar ) + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::UpdateToolbarIconsL +// Update fixed toolbar icons according to current settings +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::UpdateToolbarIconsL() + { + // fixed toolbar is used only with touch devices + if (!iController.IsTouchScreenSupported() ) + return; + UpdateVideoFlashIconsL(); + UpdateVideoSceneModeIconsL(); + UpdateVideoColorToneIconsL(); + UpdateVideoWhitebalanceIconsL(); + RedrawToolBar(); + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::OfferToolbarEventL +// Handle commands from toolbar +// --------------------------------------------------------------------------- +// +void CCamVideoPreCaptureView::OfferToolbarEventL( TInt aCommand ) + { + PRINT1( _L("Camera => CCamVideoPreCaptureView::OfferToolbarEventL(%d)" ), aCommand ); + + iController.StartIdleTimer(); + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CCamPreCaptureViewBase::OfferToolbarEventL( aCommand ); + + + // Redraw video light button + CAknToolbar* toolbar = Toolbar(); + if ( aCommand == ECamCmdToggleVideoFlash && + toolbar ) + { + CAknButton* button = static_cast( + toolbar->ControlOrNull( aCommand ) ); + if ( button ) + { + button->DrawDeferred(); + } + } + } + + PRINT1( _L("Camera <= CCamVideoPreCaptureView::OfferToolbarEventL(%d)" ), aCommand ); + } + + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::StartMskCapture() +// Try to start the capture with MSK command. Return true if started. +// --------------------------------------------------------------------------- +// +TBool CCamVideoPreCaptureView::StartMskCaptureL() + { + CCamAppUi* appUi = static_cast( iEikonEnv->AppUi() ); + TCamOrientation orientation = appUi->CamOrientation(); + TBool startedCapture(EFalse); + if( orientation == ECamOrientationCamcorder || + orientation == ECamOrientationCamcorderLeft || + orientation == ECamOrientationPortrait ) + { + if ( appUi && !appUi->IsToolBarVisible() + && iController.UiConfigManagerPtr() + && !iController.UiConfigManagerPtr()->IsOpticalJoyStickSupported() ) + { + // In case of MSK if no AP on screen, it should work as record + // If optical joystic is not available, we will start the + // recording here. Otherwise it is handled + // in CCamVideoPreCaptureContainer + TInt callType( EPSCTsyCallTypeUninitialized ); + RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType ); + if ( callType != EPSCTsyCallTypeH324Multimedia && iController.IsViewFinding() && appUi->CheckMemoryL() ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + iController.StartVideoRecordingL(); + startedCapture = ETrue; + // fixed toolbar is used only with touch devices + if ( iController.IsTouchScreenSupported() ) + { + CAknToolbar* fixedToolbar = Toolbar(); + if ( fixedToolbar ) + { + fixedToolbar->SetToolbarVisibility( EFalse ); + } + } + } + } + // else let the calling function take care of capturing + } + return startedCapture; + } + + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::UpdateVideoFlashIconsL() +// --------------------------------------------------------------------------- +// + void CCamVideoPreCaptureView::UpdateVideoFlashIconsL() + { + CAknButton* button = ToolbarButtonById(ECamCmdToggleVideoFlash); + if(!button) + return; + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + TCamFlashId flash = static_cast< TCamFlashId > + ( iController.IntegerSettingValue( + ECamSettingItemDynamicVideoFlash ) ); + + CAknButtonState* state = button->State(); + if ( state ) + { + switch ( flash ) + { + case ECamFlashOff: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_tb_light_off, + EMbmCameraappQgn_indi_cam4_tb_light_off_mask, + skinInstance, + KAknsIIDQgnIndiCam4TbLightOff ); + HBufC* tooltipText = + StringLoader::LoadLC( R_QTN_LCAM_TT_VIDEOFLASH ); + state->SetHelpTextL( *tooltipText ); + CleanupStack::PopAndDestroy( tooltipText ); + break; + } + case ECamFlashForced: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_tb_light, + EMbmCameraappQgn_indi_cam4_tb_light_mask, + skinInstance, + KAknsIIDQgnIndiCam4TbLight ); + HBufC* tooltipText = + StringLoader::LoadLC( R_QTN_LCAM_TT_FLASHOFF ); + state->SetHelpTextL( *tooltipText ); + CleanupStack::PopAndDestroy( tooltipText ); + break; + } + default: + break; + } + } + } + + // --------------------------------------------------------------------------- + // CCamVideoPreCaptureView::UpdateVideoSceneModeIconsL() + // --------------------------------------------------------------------------- + // + void CCamVideoPreCaptureView::UpdateVideoSceneModeIconsL() + { + CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupSceneVideo); + if(!button) + { + return; + } + + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + TCamSceneId scene = static_cast< TCamSceneId > ( + iController.IntegerSettingValue( ECamSettingItemDynamicVideoScene ) ); + switch ( scene ) + { + case ECamSceneAuto: + case ECamSceneNormal: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_mode_auto, + EMbmCameraappQgn_indi_cam4_mode_auto_mask, + skinInstance, + KAknsIIDQgnIndiCam4ModeAuto ); + break; + } + case ECamSceneNight: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_mode_night, + EMbmCameraappQgn_indi_cam4_mode_night_mask, + skinInstance, + KAknsIIDQgnIndiCam4ModeNight ); + break; + } + case ECamSceneLowLight: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_tungsten, + EMbmCameraappQgn_indi_cam4_wb_tungsten_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbTungsten ); + break; + } + default: + { + //Do Nothing + } + break; + } + } + + // --------------------------------------------------------------------------- + // CCamVideoPreCaptureView::UpdateVideoColorToneIconsL() + // --------------------------------------------------------------------------- + // +void CCamVideoPreCaptureView::UpdateVideoColorToneIconsL() + { + CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupColourFilterVideo); + if(!button) + return; + if ( !iController.UiConfigManagerPtr()->IsColorToneFeatureSupported() ) + { + HideButton(ECamCmdCaptureSetupColourFilterVideo); + return; + } + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + + TCamColourFilterId color = static_cast< TCamColourFilterId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicVideoColourFilter ) ); + + switch ( color ) + { + case ECamColourFilterColour: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_colour_normal, + EMbmCameraappQgn_indi_cam4_colour_normal_mask, + skinInstance, + KAknsIIDQgnIndiCam4ColourNormal ); + break; + } + case ECamColourFilterBlackAndWhite: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_colour_bw, + EMbmCameraappQgn_indi_cam4_colour_bw_mask, + skinInstance, + KAknsIIDQgnIndiCam4ColourBw ); + break; + } + case ECamColourFilterSepia: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_colour_sepia, + EMbmCameraappQgn_indi_cam4_colour_sepia_mask, + skinInstance, + KAknsIIDQgnIndiCam4ColourSepia ); + break; + } + case ECamColourFilterNegative: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_colour_negative, + EMbmCameraappQgn_indi_cam4_colour_negative_mask, + skinInstance, + KAknsIIDQgnIndiCam4ColourNegative ); + break; + } + case ECamColourFilterVivid: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_colour_vivid, + EMbmCameraappQgn_indi_cam4_colour_vivid_mask, + skinInstance, + KAknsIIDQgnIndiCam4ColourVivid ); + break; + } + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CCamVideoPreCaptureView::UpdateVideoWhitebalanceIconsL() +// --------------------------------------------------------------------------- +// + void CCamVideoPreCaptureView::UpdateVideoWhitebalanceIconsL() + { + CAknButton* button = ToolbarButtonById(ECamCmdCaptureSetupWhiteBalanceVideo); + if(!button) + return; + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + TFileName iconFileName; + CamUtility::ResourceFileName( iconFileName ); + if ( !iController.UiConfigManagerPtr()->IsWhiteBalanceFeatureSupported() ) + { + HideButton( ECamCmdCaptureSetupWhiteBalanceVideo); + return; + } + TCamWhiteBalanceId wb = static_cast< TCamWhiteBalanceId > + ( iController.IntegerSettingValue( ECamSettingItemDynamicVideoWhiteBalance ) ); + + switch ( wb ) + { + case ECamWhiteBalanceAWB: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_auto, + EMbmCameraappQgn_indi_cam4_wb_auto_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbAuto ); + break; + } + case ECamWhiteBalanceDaylight: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_sunny, + EMbmCameraappQgn_indi_cam4_wb_sunny_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbSunny ); + break; + } + case ECamWhiteBalanceCloudy: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_cloudy, + EMbmCameraappQgn_indi_cam4_wb_cloudy_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbCloudy ); + break; + } + case ECamWhiteBalanceTungsten: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_tungsten, + EMbmCameraappQgn_indi_cam4_wb_tungsten_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbTungsten ); + break; + } + case ECamWhiteBalanceFlourescent: + { + SetIconL( + button, + iconFileName, + EMbmCameraappQgn_indi_cam4_wb_fluorecent, + EMbmCameraappQgn_indi_cam4_wb_fluorecent_mask, + skinInstance, + KAknsIIDQgnIndiCam4WbFluorecent ); + break; + } + default: + break; + } + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamViewBase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamViewBase.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1042 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for all views used in the Camera application* +*/ + + +// INCLUDE FILES + +#include "CamAppUi.h" +#include "CamViewBase.h" +#include "CamContainerBase.h" +#include "CamStandbyContainer.h" +#include "CamUtility.h" +#include "CamPanic.h" +#include + + +#include +#include +#include + +#include +#include +#include + +#include "CamUtility.h" +#include +#include "CamWaitDialog.h" +#include "CamCommandHandlerAo.h" +#include "CameraUiConfigManager.h" + + +static const TRect KCamCbaHiddenRect = TRect(640,640,640,640); + + +// ========================= MEMBER FUNCTIONS ================================ + + +// --------------------------------------------------------------------------- +// CCamViewBase destructor +// +// --------------------------------------------------------------------------- +// +CCamViewBase::~CCamViewBase() + { + PRINT( _L("Camera => ~CCamViewBase" )) + if ( iStandbyContainer ) + { + CAknViewAppUi* appUi = AppUi(); + + if ( appUi ) + { + appUi->RemoveFromStack( iStandbyContainer ); + } + + delete iStandbyContainer; + iStandbyContainer = NULL; + } + + delete iContainer; + iContainer = NULL; + + delete iCommandHandlerAo; + iCommandHandlerAo = NULL; + + PRINT( _L("Camera <= ~CCamViewBase" )) + } + +// ----------------------------------------------------------------------------- +// CCamViewBase::HandleFocusLossL +// Handle focus loss +// ----------------------------------------------------------------------------- +// +void CCamViewBase::HandleFocusLossL() + { + // intentionally doing nothing + } + +// --------------------------------------------------------------------------- +// HandleAppEvent <> +// +// --------------------------------------------------------------------------- +// +void +CCamViewBase::HandleAppEvent( const TCamAppEvent& aEvent ) + { + PRINT1( _L("Camera => CCamViewBase::HandleAppEvent, event:%d"), aEvent ); + if( iContainer ) + { + iContainer->HandleAppEvent( aEvent ); + } + PRINT( _L("Camera <= CCamViewBase::HandleAppEvent") ); + } + + +// ----------------------------------------------------------------------------- +// CCamViewBase::PrepareForModeChange +// Prepare for mode change +// ----------------------------------------------------------------------------- +// +void CCamViewBase::PrepareForModeChange() + { + // intentionally doing nothing + } + +// ----------------------------------------------------------------------------- +// CCamViewBase::HandleCommandL +// Handle commands +// ----------------------------------------------------------------------------- +// +void CCamViewBase::HandleCommandL( TInt aCommand ) + { + PRINT( _L("Camera => CCamViewBase::HandleCommandL")) + switch(aCommand) + { + case ECamCmdInternalExit: + { + TInt standbyError = KErrNone; + if ( iStandbyModeActive && iStandbyContainer ) + { + standbyError = iStandbyContainer->GetStandbyError(); + ExitStandbyModeL(); + } + + if ( standbyError != KErrNone ) + { + AppUi()->HandleCommandL( EEikCmdExit ); + } + else + { + AppUi()->HandleCommandL( aCommand ); + } + + // dismiss menu - if open + StopDisplayingMenuBar(); + } + break; + + case ECamCmdRedrawScreen: + { + if( iContainer ) + { + iContainer->DrawDeferred(); + } + } + break; + + default: + { + AppUi()->HandleCommandL( aCommand ); + break; + } + } + } + +// ----------------------------------------------------------------------------- +// CCamViewBase::HandleForegroundEventL +// Handle foreground event +// ----------------------------------------------------------------------------- +// +void CCamViewBase::HandleForegroundEventL( TBool /*aForeground*/ ) + { + PRINT( _L("CCamViewBase::HandleForegroundEventL") ); + CCamAppUiBase* appUi = static_cast( AppUi() ); + iEmbedded = appUi->IsEmbedded(); + PRINT1( _L("CCamViewBase::HandleForegroundEventL embedded %d"), iEmbedded ); + } + +// --------------------------------------------------------------------------- +// CCamViewBase::DoActivateL +// Activate this view +// --------------------------------------------------------------------------- +// +void +CCamViewBase::DoActivateL( const TVwsViewId& /*aPostvViewId*/, + TUid aCustomMessageId, + const TDesC8& /*aCustomMessage*/ ) + { + PRINT( _L("Camera => CCamViewBase::DoActivateL")); + + CCamContainerBase::DestroyActivePalette(); + + + if(ECamViewMessageDeactivateFirst == aCustomMessageId.iUid) + { + PRINT( _L("CCamViewBase::DoActivateL call deactivate")); + TBool wasCameraUser = IsCameraUser(); + + DoDeactivate(); + // since we still use it + if( wasCameraUser ) + { + IncrementCameraUsers(); + } + } + + CCamAppUiBase* appUi = static_cast( AppUi() ); + iEmbedded = appUi->IsEmbedded(); + + PRINT1( _L("CCamViewBase::DoActivateL Embedded %d"), iEmbedded); + if ( !iContainer ) + { + CreateContainerL(); + AppUi()->AddToStackL( *this, iContainer ); + iContainer->ActivateL(); + } + + SetTitlePaneTextL(); + + TInt orientation; + TCamPsiKey queryValue = ECamPsiOrientation; + CCameraUiConfigManager* configManager = iController.UiConfigManagerPtr(); + + if ( configManager && configManager->IsSecondaryCameraSupported() ) + { + if ( appUi->IsSecondCameraEnabled() && !appUi->IsQwerty2ndCamera() ) // if front camera is active + { + queryValue = ECamPsiSecondaryCameraOrientation; + } + else // back camera is active + { + queryValue = ECamPsiPrimaryCameraOrientation; + } + } + + CamUtility::GetPsiInt( queryValue, orientation ); + + AppUi()->SetOrientationL( ( CAknAppUiBase::TAppUiOrientation ) orientation ); + + TCamOrientation camOrientation = appUi->CamOrientation(); + + // if in camcorder mode need to show navi-ctr + if( camOrientation == ECamOrientationCamcorder || + camOrientation == ECamOrientationCamcorderLeft || + camOrientation == ECamOrientationPortrait ) + { + iContainer->SetupNaviPanesL( CCamContainerBase::ECamPaneCounter ); + } + PRINT( _L("Camera <= CCamViewBase::DoActivateL")); + } + +// --------------------------------------------------------------------------- +// CCamViewBase::DoDeactivate +// Deactivate this view +// --------------------------------------------------------------------------- +// +void CCamViewBase::DoDeactivate() + { + PRINT( _L("Camera => CCamViewBase::DoDeactivate" )) + // Both standard container and standby container should be deactivated + if ( iStandbyContainer ) // implies IsInStandbyMode + { + AppUi()->RemoveFromStack( iStandbyContainer ); + delete iStandbyContainer; + iStandbyContainer = NULL; + SetStandbyModeActive( EFalse ); + } + + if ( iContainer ) + { + AppUi()->RemoveFromStack( iContainer ); + delete iContainer; + iContainer = NULL; + } + + PRINT( _L("Camera <= CCamViewBase::DoDeactivate" )) + } + +// --------------------------------------------------------------------------- +// CCamViewBase::CCamViewBase +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamViewBase::CCamViewBase( CCamAppController& aController ) + : iController( aController ) + { + } + +// --------------------------------------------------------------------------- +// CCamViewBase::UpdateCbaL +// Update softkeys to reflect current state +// --------------------------------------------------------------------------- +// +void CCamViewBase::UpdateCbaL() + { + } + + +// ---------------------------------------------------- +// CCamViewBase::BlankSoftKeysL +// Blank the softkeys +// ---------------------------------------------------- +// +void CCamViewBase::BlankSoftkeysL() + { + // blank the cba + SetSoftKeysL( R_CAM_SOFTKEYS_BLANK ); + } + + + +// --------------------------------------------------------------------------- +// CCamViewBase::SwitchToStandbyModeL +// Switches to standby mode +// --------------------------------------------------------------------------- +// +void CCamViewBase::SwitchToStandbyModeL( TCamAppViewIds aViewId, TInt aError ) + { + PRINT( _L("Camera => CCamViewBase::SwitchToStandbyModeL") ); + // check if already in standby mode + if( iStandbyModeActive ) + { + PRINT( _L("Camera <= CCamViewBase::SwitchToStandbyModeL: already in standby") ); + return; + } + + StatusPane()->MakeVisible( ETrue ); + delete iStandbyContainer; + iStandbyContainer = NULL; + iStandbyContainer = CCamStandbyContainer::NewL( AppUi()->ClientRect(), + *this, iController, aError ); + // dismiss menu - if open + StopDisplayingMenuBar(); + + // save options menu id for reactivation + if ( aViewId == ECamViewIdStillPreCapture ) + { + if ( iEmbedded ) + { + iPreviousMenuResourceId = ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID); + } + else + { + iPreviousMenuResourceId = ROID(R_CAM_STILL_PRE_CAPTURE_MENUBAR_ID); + } + } + else if ( aViewId == ECamViewIdVideoPreCapture ) + { + if ( iEmbedded ) + { + iPreviousMenuResourceId = ROID(R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_ID); + } + else + { + iPreviousMenuResourceId = ROID(R_CAM_VIDEO_PRE_CAPTURE_MENUBAR_ID); + } + } + else if ( aViewId == ECamViewIdVideoSettings ) + { + iPreviousMenuResourceId = ROID(R_CAM_SETTINGS_LIST_MENUBAR_ID); + } + else if ( aViewId == ECamViewIdPhotoSettings ) + { + iPreviousMenuResourceId = ROID(R_CAM_SETTINGS_LIST_MENUBAR_ID); + } + else + { + // remove Lint error + } + + // activate standby container and deactivate current container + iStandbyContainer->SetMopParent( this ); + + CCamAppUi* appUi = static_cast( AppUi() ); + appUi->AddToStackL( *this, iStandbyContainer ); + iStandbyContainer->ActivateL(); + appUi->RemoveFromStack( iContainer ); + iContainer->MakeVisible( EFalse ); + iStandbyContainer->MakeVisible( ETrue ); + iStandbyContainer->DrawNow(); + + UnsetCourtesySoftKeysL(); + + // update softkeys + if ( !appUi->IsConstructionComplete() ) + { + BlankSoftkeysL(); + } + else if ( appUi->StandbyStatus() == KErrInUse + || appUi->StandbyStatus() == KErrPermissionDenied ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); + } + else if ( iEmbedded ) + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_BACK__CONTINUE ); + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT__CONTINUE ); + } + + // change options menu + CEikMenuBar* menuBar = MenuBar(); + if ( menuBar ) + { + menuBar->SetMenuTitleResourceId( R_CAM_STANDBY_MENUBAR ); + } + +// if ( iStandbyError != KErrNone ) + if ( appUi->StandbyStatus() != KErrNone ) + { + // stop idle timer - non recoverable error + iController.StopIdleTimer(); + } + + SetStandbyModeActive(ETrue); + + // Release the camera hardware + iController.ReleaseCamera(); + + + // cancel self timer mode if active + if ( appUi->SelfTimerEnabled() ) + { + appUi->SelfTimerEnableL( ECamSelfTimerDisabled ); + } + PRINT( _L("Camera <= CCamViewBase::SwitchToStandbyModeL") ); + } + +// --------------------------------------------------------------------------- +// CCamViewBase::ExitStandbyModeL +// Exits standby mode +// --------------------------------------------------------------------------- +// +void CCamViewBase::ExitStandbyModeL() + { + PRINT( _L("Camera => CCamViewBase::ExitStandbyModeL") ); + if ( !iStandbyModeActive ) + { + return; + } + + // delete standby container and reactivate previous container + TRAPD( err, AppUi()->AddToStackL( *this, iContainer ) ) + iStandbyContainer->MakeVisible( EFalse ); + AppUi()->RemoveFromStack( iStandbyContainer ); + delete iStandbyContainer; + iStandbyContainer = NULL; + User::LeaveIfError( err ); + + CCamAppUi* appUi = static_cast( AppUi() ); + + + iContainer->MakeVisible( ETrue ); + SetStandbyModeActive( EFalse ); + + if ( appUi->IsSecondCameraEnabled() && !appUi->IsQwerty2ndCamera() ) + { + StatusPane()->MakeVisible( ETrue ); + } + else + { + StatusPane()->MakeVisible( EFalse ); + } + + CCameraUiConfigManager* configManager = iController.UiConfigManagerPtr(); + if ( !( configManager && configManager->IsUIOrientationOverrideSupported() ) ) + { + appUi->RaisePreCaptureCourtesyUI(ETrue); + } + + if ( iPreviousMenuResourceId == ROID(R_CAM_SETTINGS_LIST_MENUBAR_ID) + || iPreviousMenuResourceId == ROID(R_CAM_STILL_EMBEDDED_PRE_CAPTURE_MENUBAR_ID) + || iPreviousMenuResourceId == ROID(R_CAM_VIDEO_EMBEDDED_PRE_CAPTURE_MENUBAR_ID)) + { + if ( iController.CaptureModeTransitionInProgress() ) + { + SetSoftKeysL( R_AVKON_SOFTKEYS_BACK ); + } + else + { + SetSoftKeysL( R_AVKON_SOFTKEYS_OPTIONS_BACK ); + } + } + else + { + SetSoftKeysL( R_CAM_SOFTKEYS_OPTIONS_EXIT ); + } + + // restore options menu + CEikMenuBar* menuBar = MenuBar(); + if ( menuBar ) + { + menuBar->SetMenuTitleResourceId( iPreviousMenuResourceId ); + } + + //SetStandbyModeActive(EFalse); + SetTitlePaneTextL(); + + // restart idle timer + iController.StartIdleTimer(); + PRINT( _L("Camera <= CCamViewBase::ExitStandbyModeL") ); + } + + +// --------------------------------------------------------------------------- +// ExitAllModesL <> +// --------------------------------------------------------------------------- +// +void +CCamViewBase::ExitAllModesL() + { + // Empty default implementation. + } + + +// --------------------------------------------------------------------------- +// CCamViewBase::GetHelpContext +// Called to identify the help context for this view +// --------------------------------------------------------------------------- +// +void CCamViewBase::GetHelpContext( TCoeHelpContext& /*aContext*/ ) const + { + // No context + } + +// --------------------------------------------------------------------------- +// CCamViewBase::QueryRenameL +// Switches orientation if required - calls DoQueryRenameL +// --------------------------------------------------------------------------- +// +void CCamViewBase::QueryRenameL( TCamCameraMode aMode ) + { + // Ensure application is in editing orientation + TInt error = KErrNone; + CCamAppUi* appUi = static_cast( AppUi() ); + TInt editingOrientation = CAknAppUiBase::EAppUiOrientationUnspecified; + + error = CamUtility::GetPsiInt( ECamPsiOrientation, editingOrientation ); + + if ( !error ) + { + appUi->SwitchOrientationIfRequiredL( editingOrientation ); + } + // Trap this to make sure the orientation is reverted back to normal + TRAPD( leaveErr, DoQueryRenameL( aMode ) ) + appUi->SwitchOrientationIfRequiredL( CAknAppUiBase::EAppUiOrientationUnspecified ); + User::LeaveIfError( leaveErr ); + } + +// --------------------------------------------------------------------------- +// CCamViewBase:DoQueryRenameL +// Show rename query and rename file. +// --------------------------------------------------------------------------- +// +void CCamViewBase::DoQueryRenameL( TCamCameraMode aMode ) + { + TBool done = EFalse; + HBufC* lastFilePath = HBufC::NewLC( iController.CurrentFullFileName().Length() ); + TBuf filename( iController.CurrentImageName() ); + + // Repeat until successfully renamed or cancelled + while ( !done ) + { + // Show rename query + if ( ShowRenameQueryL( filename, aMode ) ) + { + // Try to rename file + TRAPD( err, done = RenameCurrentFileL( filename, aMode ) ); + if ( KErrAlreadyExists == err ) + { + // File exists -> show overwrite confirmation query + if ( ShowOverwriteConfirmationQueryL( filename ) ) + { + // Yes, overwrite + TPtr lastFilePathPtr = lastFilePath->Des(); + lastFilePathPtr = iController.CurrentFullFileName(); + TParsePtr parseptr( lastFilePathPtr ); + TFileName fullpath = parseptr.DriveAndPath(); + fullpath.Append( filename ); + fullpath.Append( parseptr.Ext() ); + + // Delete the file that gets overwritten. + if ( ECamControllerVideo != aMode ) + { + CamUtility::DeleteStillImageL( fullpath ); + } + else + { + CamUtility::DeleteVideoL( fullpath ); + } + + // Rename + RenameCurrentFileL( filename, aMode ); + done = ETrue; + } + else // No, don't overwrite + { + // Generate a suitable suggestion for an unique name + TInt key = ( ECamControllerVideo == aMode ) + ? ECamSettingItemVideoNumber + : ECamSettingItemPhotoNumber; + TInt fileNameCounter = iController.IntegerSettingValue( key ); + + TParsePtrC parse( iController.CurrentFullFileName() ); + TFileName filePath = parse.DriveAndPath(); + + const TUint KMax3Digits = 999; + + //if 0 < fileNameCounter <= 999, formatted file name like "Photo001", the length of number part ("001") is fixed 3 + const TUint KFixedNumberLength = 3; + + TBool exceedMaxFileNameLength = EFalse; + //if 0 < fileNameCounter <= 999, formatted file name like "Photo001" + if ( fileNameCounter > 0 && + fileNameCounter <= KMax3Digits && + filename.Length() + KFixedNumberLength > filename.MaxLength() ) + { + exceedMaxFileNameLength = ETrue; + } + //if fileNameCounter > 999, formatted file name like "Photo1234" + else if ( fileNameCounter > KMax3Digits ) + { + _LIT( KCamNameFormatFileNameCounter, "%d" ); + TBuf strFileNameCounter; + strFileNameCounter.Format( KCamNameFormatFileNameCounter, fileNameCounter ); + if ( filename.Length() + strFileNameCounter.Length() > filename.MaxLength() ) + { + exceedMaxFileNameLength = ETrue; + } + } + + if ( !exceedMaxFileNameLength ) + { + CamUtility::GetUniqueNameL( filePath, filename, fileNameCounter, parse.Ext() ); + } + + + } + } + else + { + // If unknown error + User::LeaveIfError( err ); + } + } + else + { + // User cancelled (ShowRenameQueryL() returned false) + done = ETrue; + } + } + CleanupStack::PopAndDestroy(); // lastFilePath + } + +// --------------------------------------------------------------------------- +// CCamViewBase::ShowOverwriteConfirmationQueryL +// Show an overwrite confirmation query. This is used +// when trying to overwrite a file using rename. +// --------------------------------------------------------------------------- +// +TBool CCamViewBase::ShowOverwriteConfirmationQueryL( + const TDesC& aFilename ) + { + HBufC* prompt = StringLoader::LoadLC( R_QTN_FLDR_OVERWRITE_QUERY, + aFilename, CEikonEnv::Static() ); + + CAknQueryDialog* overwriteQuery = + new ( ELeave ) CAknQueryDialog( *prompt ); + TBool result = overwriteQuery->ExecuteLD( R_CAM_OVERWRITE_QUERY ); + + CleanupStack::PopAndDestroy(); // prompt + + return result; + } + +// --------------------------------------------------------------------------- +// CCamViewBase::ShowRenameQueryL +// Show rename query. +// --------------------------------------------------------------------------- +// +TBool CCamViewBase::ShowRenameQueryL( TDes& aFilename, TCamCameraMode aMode ) + { + TBool done = EFalse; + TBool res = ETrue; + + while ( !done ) + { + // Show data query + HBufC* prompt = NULL; + if ( ECamControllerVideo == aMode ) + { + prompt = + StringLoader::LoadLC( R_CAM_QUERY_VIDEO_NAME ); + } + else + { + prompt = + StringLoader::LoadLC( R_CAM_QUERY_IMAGE_NAME ); + } + + CAknTextQueryDialog* nameQuery = + CAknTextQueryDialog::NewL( aFilename ); + nameQuery->SetMaxLength( KMaxNameBaseLengthPlusNumbering ); + nameQuery->PrepareLC( R_CAM_RENAME_QUERY ); + nameQuery->SetPromptL( *prompt ); + + TBool dialogRes = ( nameQuery->RunLD() == EAknSoftkeyOk ); + if ( dialogRes ) + { + if ( !IsNewNameValidL( aFilename ) ) + { + // New name is not valid for another reason. + // In practise, the user has attempted to overwrite + // an image already existing in the burst grid. + + HBufC* text = StringLoader::LoadLC( + R_QTN_FLDR_CANT_RENAME_ITEM, + iController.CurrentImageName() ); + + CAknNoteWrapper* note = new ( ELeave ) CAknNoteWrapper(); + note->ExecuteLD( R_CAM_UNABLE_TO_RENAME, *text ); + + CleanupStack::PopAndDestroy(); // text + + // Don't show dialog again + res = EFalse; + done = ETrue; + } + else if ( CamUtility::CheckFileNameValidityL( aFilename ) ) + { + // New file name seems ok + res = ETrue; + done = ETrue; + } + else + { + // File name is not suitable, ask again + } + } + else + { + // User cancelled rename + res = EFalse; + done = ETrue; + } + + CleanupStack::PopAndDestroy(); // prompt + } + + return res; + } + +// --------------------------------------------------------------------------- +// CCamViewBase::IsNewNameValidL +// Check if renaming to the given name is valid. +// --------------------------------------------------------------------------- +// +TBool CCamViewBase::IsNewNameValidL( const TDesC& /* aFilename */ ) + { + // This should be overridden in derived classes if needed + return ETrue; + } + +// --------------------------------------------------------------------------- +// CCamViewBase::RenameCurrentFileL +// Renames the current capture array file. +// --------------------------------------------------------------------------- +// +TBool +CCamViewBase::RenameCurrentFileL( const TDesC& aNewName, + TCamCameraMode aMode ) + { + return iController.RenameCurrentFileL( aNewName, aMode ); + } + +// --------------------------------------------------------------------------- +// CCamViewBase::Container +// Returns the currently used container in the view. +// --------------------------------------------------------------------------- +// +CCamContainerBase* CCamViewBase::Container() + { + if ( iStandbyContainer ) + { + return iStandbyContainer; + } + else + { + return iContainer; + } + } + +// --------------------------------------------------------------------------- +// CCamViewBase::SetSoftKeysL +// Sets the softkeys to the specified Resource ID +// --------------------------------------------------------------------------- +// +void CCamViewBase::SetSoftKeysL(TInt aResource) + { + CCamAppUi* appUi = static_cast( AppUi() ); + // If courtesy softkeys are enabled, check whether the UI can be drawn without being explicitly raised + // (rare, but possible: e.g. when video recording starts + if(aResource == R_CAM_SOFTKEYS_BLANK && + appUi->IsSecondCameraEnabled() && + !appUi->IsQwerty2ndCamera()) + { + aResource = R_CAM_SOFTKEYS_BLANK_SECONDARY; + } + if ( iCourtesySoftkeys ) + { + if ( appUi ) + { + if ( (IsPreCapture() && appUi->DrawPreCaptureCourtesyUI()) + || (IsPostCapture() && appUi->DrawPostCaptureCourtesyUI()) ) + { + // Disable the courtesy softkeys, otherwise nothing will be drawn when the rest of the + // courtesy UI has been turned back on + iCourtesySoftkeys = EFalse; + + //when disabling the courtesy softkeys, Cba should be recovered to be visible + Cba()->MakeVisible( ETrue ); + } + } + } + + if ( iCourtesySoftkeys || !Cba() ) + { + // If the courtesy (blank) softkeys are being shown, make a note of what to change back to. + iPreviousCbaResource = aResource; + } + else if ( iCurrentCbaResource != aResource ) + { + iPreviousCbaResource = iCurrentCbaResource; + iCurrentCbaResource = aResource; + + Cba()->SetCommandSetL( aResource ); + Cba()->DrawDeferred(); + + } + } + + +// --------------------------------------------------------------------------- +// CCamViewBase::SetCourtesySoftKeysL +// Blanks the softkeys for the Courtesy UI Off state. +// --------------------------------------------------------------------------- +// +void CCamViewBase::SetCourtesySoftKeysL() + { + if ( !iCourtesySoftkeys ) + { + Cba()->MakeVisible( EFalse ); + iPreviousCbaResource = iCurrentCbaResource; + iCourtesySoftkeys = ETrue; + } + } + +// --------------------------------------------------------------------------- +// CCamViewBase::UnsetCourtesySoftKeysL +// Returns the softkeys to their previous state after UI has been turned back on +// --------------------------------------------------------------------------- +// +void CCamViewBase::UnsetCourtesySoftKeysL() + { + if ( iCourtesySoftkeys ) + { + iCourtesySoftkeys = EFalse; + SetSoftKeysL(iPreviousCbaResource); + Cba()->MakeVisible( ETrue ); + } + } + +// --------------------------------------------------------------------------- +// CCamViewBase::IsPreCapture +// Returns whether the view is a precapture view +// --------------------------------------------------------------------------- +// +TBool CCamViewBase::IsPreCapture() + { + return EFalse; + } + +// --------------------------------------------------------------------------- +// CCamViewBase::IsPostCapture +// Returns whether the view is a postcapture view +// --------------------------------------------------------------------------- +// +TBool CCamViewBase::IsPostCapture() + { + return EFalse; + } + +// --------------------------------------------------------------------------- +// CCamViewBase::IsBurstPostCapture +// Returns whether the view is a burst mode postcapture view +// --------------------------------------------------------------------------- +// +TBool CCamViewBase::IsBurstPostCapture() + { + return EFalse; + } + + +// --------------------------------------------------------------------------- +// CCamViewBase::IsInStandbyMode +// Returns whether the view is in standby mode +// --------------------------------------------------------------------------- +// +TBool CCamViewBase::IsInStandbyMode() + { + return iStandbyModeActive; + } + + +// --------------------------------------------------------------------------- +// CCamViewBase::SetStandbyModeActive +// Sets the iStandbyModeActive flag +// --------------------------------------------------------------------------- +// +void CCamViewBase::SetStandbyModeActive(TBool aActive) + { + // This should be the only place iStandbyModeActive is set! + // We need to inform the AppUi + iStandbyModeActive = aActive; + if( iController.IsAppUiAvailable() ) + { + CCamAppUiBase* appUi = static_cast( AppUi() ); + + if ( appUi) + { + if ( aActive ) + { + appUi->SetPreCaptureMode(ECamPreCapStandby); + } + else + { + appUi->SetPreCaptureMode(ECamPreCapViewfinder); + } + } + } + } + + +// --------------------------------------------------------------------------- +// CCamViewBase::IncrementCameraUsers +// +// --------------------------------------------------------------------------- +// +void +CCamViewBase::IncrementCameraUsers() + { + if( !iIncEngineCount ) + { + PRINT( _L("Camera == CCamViewBase::IncrementCameraUsers - incrementing") ); + iIncEngineCount = ETrue; + iController.IncCameraUsers(); + } + else + { + PRINT( _L("Camera == CCamViewBase::IncrementCameraUsers - already incremented, skipping") ); + } + } + + +// --------------------------------------------------------------------------- +// CCamViewBase::DecrementCameraUsers +// +// --------------------------------------------------------------------------- +// +void +CCamViewBase::DecrementCameraUsers() + { + if( iIncEngineCount ) + { + PRINT( _L("Camera == CCamViewBase::DecrementCameraUsers - decrementing") ); + iIncEngineCount = EFalse; + iController.DecCameraUsers(); + } + else + { + PRINT( _L("Camera == CCamViewBase::DecrementCameraUsers - not using camera, skipped") ); + } + } + + +// --------------------------------------------------------------------------- +// CCamViewBase::IsCameraUser +// +// --------------------------------------------------------------------------- +// +TBool +CCamViewBase::IsCameraUser() const + { + return iIncEngineCount; + } + + + +// ----------------------------------------------------------------------------- +// CCamViewBase::RedrawAPArea +// ----------------------------------------------------------------------------- +void CCamViewBase::RedrawAPArea(const TRect& aArea) + { + if ( iContainer ) + { + iContainer->Redraw(aArea); + } + } + + +// ----------------------------------------------------------------------------- +// CCamViewBase::ViewCba +// ----------------------------------------------------------------------------- +CEikButtonGroupContainer* CCamViewBase::ViewCba() + { + return Cba(); + } + +// ----------------------------------------------------------------------------- +// CCamViewBase::UpdateToolbarIconsL +// +void CCamViewBase::UpdateToolbarIconsL() + { + + } +// ----------------------------------------------------------------------------- +// CCamViewBase::HandleCommandAoL +// ----------------------------------------------------------------------------- + +void CCamViewBase::HandleCommandAoL( TInt aCommand ) + { + if ( !iCommandHandlerAo ) + { + iCommandHandlerAo = CCamCommandHandlerAo::NewL( this ); + } + iCommandHandlerAo->HandleCommandL( aCommand ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamVolumeKeyObserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamVolumeKeyObserver.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,358 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Receives buton presses from volume keys* +*/ + + +// INCLUDE FILES + +#include "CamVolumeKeyObserver.h" +#include +#include +#include "CamUtility.h" +#include "CamAppUi.h" +#include "CamZoomPane.h" +#include +#include + + + +/** +* Helper class for sending response back to +* Remote Controller Framework +* +* @since 3.1 +*/ +class CCamRemConKeyResponse : public CActive + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + * aparam Remote Controller instance + * @return new instance. + */ + static CCamRemConKeyResponse* NewL( CRemConCoreApiTarget& + aRemConCoreApiTarget ); + + /** + * Destructor. + */ + virtual ~CCamRemConKeyResponse(); + + public: // new function + + /** + * Send the any key response back to Remcon server + * @since 3.1 + * @param aOperationId Remcon operation + */ + void CompleteAnyKeyL( TRemConCoreApiOperationId aOperationId ); + + private: //from base class + + /** + * From CActive + * Called on completion of a request + * @since 3.1 + */ + void RunL(); + + /** + * From CActive + * Cancels an outstanding request + * @since 3.1 + */ + void DoCancel(); + + private: + + /** + * C++ default constructor. + * @since 3.1 + * aparam Remote Controller instance + */ + CCamRemConKeyResponse( CRemConCoreApiTarget& aRemConCoreApiTarget ); + + private: + + // Response array + RArray iResponseArray; + + // Remote controller + CRemConCoreApiTarget& iRemConCoreApiTarget; + }; + + +// ----------------------------------------------------------------------------- +// CCamRemConKeyResponse::CCamRemConKeyResponse +// default C++ constructor +// ----------------------------------------------------------------------------- +// +CCamRemConKeyResponse::CCamRemConKeyResponse( CRemConCoreApiTarget& + aRemConCoreApiTarget ) + : CActive ( EPriorityNormal ), + iRemConCoreApiTarget ( aRemConCoreApiTarget ) + + { + CActiveScheduler::Add( this ); + } + + +// ----------------------------------------------------------------------------- +// CCamRemConKeyResponse::NewL +// ----------------------------------------------------------------------------- +// +CCamRemConKeyResponse* CCamRemConKeyResponse::NewL(CRemConCoreApiTarget& + aRemConCoreApiTarget) + { + CCamRemConKeyResponse* self = + new (ELeave) CCamRemConKeyResponse( aRemConCoreApiTarget ); + + return self; + } + +// ----------------------------------------------------------------------------- +// CCamRemConKeyResponse::~CCamRemConKeyResponse +// ----------------------------------------------------------------------------- +// +CCamRemConKeyResponse::~CCamRemConKeyResponse() + { + PRINT( _L("Camera => ~CCamRemConKeyResponse::~CCamRemConKeyResponse")) + Cancel(); + PRINT( _L("Camera => ~CCamRemConKeyResponse::~CCamRemConKeyResponse B")) + iResponseArray.Reset(); + PRINT( _L("Camera => ~CCamRemConKeyResponse::~CCamRemConKeyResponse C")) + iResponseArray.Close(); + PRINT( _L("Camera <= ~CCamRemConKeyResponse::~CCamRemConKeyResponse")) + } + +// ----------------------------------------------------------------------------- +// CCamRemConKeyResponse::DoCancel +// ----------------------------------------------------------------------------- +// +void CCamRemConKeyResponse::DoCancel() + { + } + +// ----------------------------------------------------------------------------- +// CCamRemConKeyResponse::RunL +// ----------------------------------------------------------------------------- +// +void CCamRemConKeyResponse::RunL() + { + // if any existing -> Send response + if ( iResponseArray.Count() ) + { + CompleteAnyKeyL( iResponseArray[0] ); + // Remove already completed key + iResponseArray.Remove(0); + iResponseArray.Compress(); + } + } + +// ----------------------------------------------------------------------------- +// CCamConKeyResponse::CompleteAnyKeyL +// ----------------------------------------------------------------------------- +// +void CCamRemConKeyResponse::CompleteAnyKeyL( TRemConCoreApiOperationId + aOperationId ) + { + PRINT(_L("Camera => CCamRemConKeyResponse::CompleteAnyKeyL")) + if ( !IsActive() ) + { + switch ( aOperationId ) + { + case ERemConCoreApiVolumeUp: + { + PRINT( _L("CCamRemConKeyResponse::CompleteAnyKeyL operation volume up") ); + iRemConCoreApiTarget.VolumeUpResponse( iStatus, KErrNone ); + SetActive(); + } + break; + case ERemConCoreApiVolumeDown: + { + PRINT( _L("CCamRemConKeyResponse::CompleteAnyKeyL operation volume down") ); + iRemConCoreApiTarget.VolumeDownResponse( iStatus, KErrNone ); + SetActive(); + } + break; + default: + { + PRINT( _L("CCamRemConKeyResponse::CompleteAnyKeyL operation - other operation") ); + // Send general response for 'other' keys + iRemConCoreApiTarget.SendResponse( iStatus, aOperationId, KErrNone ); + SetActive(); + } + break; + } + } + // already active. Append to array and complete later. + else + { + User::LeaveIfError( iResponseArray.Append( aOperationId ) ); + } + } + + +// ----------------------------------------------------------------------------- +// CCamRemConObserver::NewL +// ----------------------------------------------------------------------------- +// +CCamRemConObserver* CCamRemConObserver::NewL( MCamVolumeKeyObserver &aObserver ) + { + CCamRemConObserver* self = new ( ELeave ) CCamRemConObserver( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CPhoneRemConObserver::~CPhoneRemConObserver +// destructor +// ----------------------------------------------------------------------------- +// +CCamRemConObserver::~CCamRemConObserver() + { + PRINT( _L("Camera => CCamRemConObserver::~CCamRemConObserver")) + delete iActiveRemCon; + + delete iInterfaceSelector; + + PRINT( _L("Camera <= CCamRemConObserver::~CCamRemConObserver")) + } + +// ----------------------------------------------------------------------------- +// CPhoneRemConObserver::CPhoneRemConObserver +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CCamRemConObserver::CCamRemConObserver( MCamVolumeKeyObserver& aObserver ): + iObserver ( aObserver ) + { + } + +// ----------------------------------------------------------------------------- +// CPhoneRemConObserver::ConstructL +// Symbian 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CCamRemConObserver::ConstructL() + { + iInterfaceSelector = CRemConInterfaceSelector::NewL(); + + // owned by CRemConInterfaceSelector instance + iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this ); + + iActiveRemCon = CCamRemConKeyResponse::NewL( *iCoreTarget ); + + iInterfaceSelector->OpenTargetL(); + } + +// ----------------------------------------------------------------------------- +// CPhoneRemConObserver::MrccatoCommand +// A command has been received. +// ----------------------------------------------------------------------------- +// +void CCamRemConObserver::MrccatoCommand( + TRemConCoreApiOperationId aOperationId, + TRemConCoreApiButtonAction aButtonAct ) + { + PRINT2( _L("Camera => CCamRemConObserver::MrccatoCommand op (%d) act (%d)"), aOperationId, aButtonAct ) + switch ( aOperationId ) + { + case ERemConCoreApiVolumeUp: + { + // send the response back to Remcon server + TRAP_IGNORE( iActiveRemCon->CompleteAnyKeyL( aOperationId ) ); + + // send button press to zoom pane + iObserver.HandleVolumeKeyEvent( aOperationId, aButtonAct ); + } + break; + case ERemConCoreApiVolumeDown: + { + TRAP_IGNORE( iActiveRemCon->CompleteAnyKeyL( aOperationId ) ); + iObserver.HandleVolumeKeyEvent( aOperationId, aButtonAct ); + } + break; + default: + { + // Complete any other operation id + TRAP_IGNORE( iActiveRemCon->CompleteAnyKeyL( aOperationId ) ); + } + break; + } + } + +// ----------------------------------------------------------------------------- +// CPhoneRemConObserver::MrccatoPlay +// not used +// ----------------------------------------------------------------------------- +// +void CCamRemConObserver::MrccatoPlay( TRemConCoreApiPlaybackSpeed /*aSpeed*/, + TRemConCoreApiButtonAction /*aButtonAct*/ ) + { + // not used + } + +// ----------------------------------------------------------------------------- +// CPhoneRemConObserver::MrccatoTuneFunction +// not used +// ----------------------------------------------------------------------------- +// +void CCamRemConObserver::MrccatoTuneFunction( TBool /*aTwoPart*/, + TUint /*aMajorChannel*/, + TUint /*aMinorChannel*/, + TRemConCoreApiButtonAction /*aButtonAct*/ ) + { + // not used + } + +// ----------------------------------------------------------------------------- +// CPhoneRemConObserver::MrccatoSelectDiskFunction +// not used +// ----------------------------------------------------------------------------- +// +void CCamRemConObserver::MrccatoSelectDiskFunction( TUint /*aDisk*/, + TRemConCoreApiButtonAction /*aButtonAct*/ ) + { + // not used + } + +// ----------------------------------------------------------------------------- +// CPhoneRemConObserver::MrccatoSelectAvInputFunction +// not used +// ----------------------------------------------------------------------------- +// +void CCamRemConObserver::MrccatoSelectAvInputFunction( TUint8 /*aAvInputSignalNumber*/, + TRemConCoreApiButtonAction /*aButtonAct*/ ) + { + // not used + } + +// ----------------------------------------------------------------------------- +// CPhoneRemConObserver::MrccatoSelectAudioInputFunction +// not used +// ----------------------------------------------------------------------------- +// +void CCamRemConObserver::MrccatoSelectAudioInputFunction( TUint8 /*aAudioInputSignalNumber*/, + TRemConCoreApiButtonAction /*aButtonAct*/ ) + { + // not used + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamZoomModel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamZoomModel.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1493 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Controls the state of the zoom* +*/ + + +// Defining this will reduce the wait period between repeated +// zoom in/out events being sent. This is just a development +// test feature. + +// INCLUDE FILES +#include "CamZoomModel.h" +#include "CamZoomPane.h" +#include "CamPSI.h" +#include "CamUtility.h" +#include "CamAppUi.h" + +// CONSTANTS + +// MACROS + +// LOCAL CONSTANTS AND MACROS + +// MODULE DATA STRUCTURES + +// LOCAL FUNCTION PROTOTYPES + +// FORWARD DECLARATIONS + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamZoomModel::CCamZoomModel +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamZoomModel::CCamZoomModel( CCamAppController& aController, + CCamZoomPane* aPane ) + : iCurrentResolution( KErrNotReady ), + iController( aController ), + iPane( aPane ) + { + } + +// ----------------------------------------------------------------------------- +// CCamZoomModel::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::ConstructL() + { + PRINT( _L( "Camera => CCamZoomModel::ConstructL " ) ); + + // Retrieve the max digital zoom levels + TPckgBuf pckg; + CamUtility::GetPsiAnyL( ECamPsiMaxZoomSteps, &pckg ); + iDigZoomSteps = pckg(); + + // Retrieve the max EXTENDED zoom levels + TPckgBuf pckg2; + CamUtility::GetPsiAnyL( ECamPsiMaxExtendedZoomSteps, &pckg2 ); + iExtZoomSteps = pckg2(); + + // Retrieve the max OPTICAL zoom levels + TPckgBuf pckg3; + CamUtility::GetPsiAnyL( ECamPsiMaxOpticalZoomSteps, &pckg3 ); + iOptZoomSteps = pckg3(); + + // Retrieve the timing and step values for each of the zoom bar + // modes for Optical/Digital/Extended + TPckgBuf pckg4; + CamUtility::GetPsiAnyL( ECamPsiZoomBarLAF, &pckg4); + iZoomLAF = pckg4(); + + // Setting up initial internal values for zoom levels + iCurZoomStepOptical = 0; + iCurZoomStepDigital = 0; + + // Timer used to give smooth zooming + iZoomTimer = CPeriodic::NewL( CActive::EPriorityHigh ); + + // Register for controller events + iController.AddControllerObserverL( this ); + + // Create Zoom Update manager, which is used to + // minimize the amount of times we send updates to + // the camera driver. + iCamZoomUpdateManager = CCamZoomUpdateManager::NewL( iController ); + + // This class and zoom pane are created on application start. + // On app start, we should be setting the zoom to 1x, to + // tidy up incase a previous app has not reset to defaults. + ResetZoomTo1x(); + + PRINT( _L( "Camera <= CCamZoomModel::ConstructL " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomModel::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamZoomModel* CCamZoomModel::NewL( CCamAppController& aController, CCamZoomPane* aPane ) + { + CCamZoomModel* self = new( ELeave ) CCamZoomModel( aController, aPane ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// ----------------------------------------------------------------------------- +// CCamZoomModel::~CCamZoomModel +// Destructor. +// ----------------------------------------------------------------------------- +// +CCamZoomModel::~CCamZoomModel() + { + PRINT( _L("Camera => ~CCamZoomModel" )) + + iController.RemoveControllerObserver( this ); + if ( iZoomTimer && iZoomTimer->IsActive() ) + { + iZoomTimer->Cancel(); + } + delete iZoomTimer; + + if ( iCamZoomUpdateManager && iCamZoomUpdateManager->IsActive() ) + { + iCamZoomUpdateManager->Cancel(); + } + delete iCamZoomUpdateManager; + + iPane = NULL; // Not owned + PRINT( _L("Camera <= ~CCamZoomModel" )) + } + +// ----------------------------------------------------------------------------- +// CCamZoomModel::ZoomTo +// Attempts to zoom to a specified value. +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::ZoomTo( TInt aValue ) + { + PRINT( _L( "Camera => CCamZoomModel::ZoomTo " ) ); + // Note: The following code only supports digital or + // digital+extended zoom combinations. + // Optical zoom is not taken into consideration. + + // avoid mixups between button and touch presses + if ( ZoomingState() != ECamZoomModelStateZoomNone ) + { + PRINT( _L( "Camera <> CCamZoomModel::ZoomTo stopping keypress zoom" ) ); + StopZoom(); + } + + // Start the zoom state + iState = ECamZoomModelStateZoomTo; + + // We don't support pausing between boundaries. If the + // user experience so requires, it should be implemented here. + + // Update the zoom values + // Note: Both digital and extended zoom are represented by iCurZoomStepDigital. + // We assume the maximum value is already checked + // in CCamZoomPane::StartTouchZoomL + PRINT1( _L( "Camera <> CCamZoomModel::ZoomTo iMaxZoomStepDig=%d" ), iMaxZoomStepDig ); + PRINT1( _L( "Camera <> CCamZoomModel::ZoomTo iMaxZoomStepExt=%d" ), iMaxZoomStepExt ); + PRINT1( _L( "Camera <> CCamZoomModel::ZoomTo iCurZoomStepDigital=%d" ), iCurZoomStepDigital ); + iCurZoomStepDigital = aValue; + if ( iCurZoomStepDigital < iMaxZoomStepDig ) + { + CheckZoomMode( ECamZoomModeExtended ); + } + else + { + CheckZoomMode( ECamZoomModeDigital ); + } + + // Notify the camera driver + PRINT1( _L( "Camera <> CCamZoomModel::ZoomTo to (aValue) %d" ), aValue ); + iCamZoomUpdateManager->SetZoomValue( iCurZoomStepDigital ); + + // Tell the zoom pane the value to show. + PRINT1( _L( "CCamZoomModel::ZoomTo set zoom pane %d" ), CurrentZoom() ); + iPane->SetZoomValue( CurrentZoom() ); + + // Clear the zoom state + iState = ECamZoomModelStateZoomNone; + + PRINT( _L( "Camera <= CCamZoomModel::ZoomTo " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomModel::ZoomIn +// Attempts to zoom in one step (if one more step available). +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::ZoomIn( TBool aOneClick ) + { + PRINT( _L( "Camera => CCamZoomModel::ZoomIn " ) ); + iState = ECamZoomModelStateZoomIn; + TInt optZoomJump = 0; + TInt digZoomJump = 0; + TInt extZoomJump = 0; + + ZoomStepsToJump( optZoomJump, digZoomJump, extZoomJump ); + PRINT3( _L( "CCamZoomModel::ZoomIn steps opt(%d) dig(%d) ext(%d) " ), optZoomJump, digZoomJump, extZoomJump ); + + // First of all, check what the current boundary condition is + // then check if we need to pause at that boundary. + PRINT( _L( "ZoomIn boundary check start" ) ); + + TCamZoomBoundary boundary = CheckBoundary(); + if ( PauseAtBoundary( boundary ) ) + { + if ( iPauseState == EPauseStateNone ) + { + PRINT( _L( "ZoomIn at boundary EPauseStateNone return" ) ); + // If this is a new pause, update the state and return + // (no zoom allowed until release) + iPauseState = EPauseStatePaused; + return; + } + else if ( iPauseState == EPauseStatePaused ) + { + PRINT( _L( "ZoomIn at boundary EPauseStatePaused return" ) ); + // If still paused, return (no zoom allowed until release) + return; + } + else // EPauseStateReleased + { + PRINT( _L( "ZoomIn at boundary EPauseStateReleased allow" ) ); + // If released, allow the zoom, but set the state + // back to none. + iPauseState = EPauseStateNone; + } + } + + PRINT( _L( "ZoomIn at boundary EPauseStateNone boundary check end" ) ); + + if ( optZoomJump ) + { + CheckZoomMode( ECamZoomModeOptical ); + iCurZoomStepOptical += optZoomJump; + PRINT1( _L( "Camera => CCamZoomModel::ZoomIn opt to %d" ), iCurZoomStepOptical ); + //iController.SetZoomValue( iCurZoomStepOptical ); + iCamZoomUpdateManager->SetZoomValue( iCurZoomStepOptical ); + } + + if ( digZoomJump ) + { + CheckZoomMode( ECamZoomModeDigital ); + iCurZoomStepDigital += digZoomJump; + PRINT1( _L( "Camera => CCamZoomModel::ZoomIn dig to %d" ), iCurZoomStepDigital ); + //iController.SetZoomValue( iCurZoomStepDigital ); + iCamZoomUpdateManager->SetZoomValue( iCurZoomStepDigital ); + } + + if ( extZoomJump ) + { + CheckZoomMode( ECamZoomModeExtended ); + iCurZoomStepDigital += extZoomJump; + PRINT1( _L( "Camera => CCamZoomModel::ZoomIn ext to %d" ), iCurZoomStepDigital ); + //iController.SetZoomValue( iCurZoomStepDigital ); + iCamZoomUpdateManager->SetZoomValue( iCurZoomStepDigital ); + } + + // Tell the zoom pane the value to show. + PRINT1( _L( "CCamZoomModel::ZoomIn set zoom pane %d" ), CurrentZoom() ); + iPane->SetZoomValue( CurrentZoom() ); + + if ( aOneClick ) + { + // Do not start zoom timer + PRINT( _L( "CCamZoomModel::ZoomIn one click" ) ); + iState = ECamZoomModelStateZoomNone; + } + else + { + // Start the timer to zoom-in again when timer expires + PRINT( _L( "CCamZoomModel::ZoomIn start zoom timer" ) ); + StartZoomTimer(); + } + + PRINT( _L( "Camera <= CCamZoomModel::ZoomIn " ) ); + } + +// --------------------------------------------------------------------------- +// CCamZoomModel::CheckBoundary +// Checks whether the next zoom operation will cross a zoom mode boundary. +// For example from Optical to Digital or from Digital to Extended +// --------------------------------------------------------------------------- +// +CCamZoomModel::TCamZoomBoundary CCamZoomModel::CheckBoundary() const + { + PRINT( _L( "Camera => CCamZoomModel::CheckBoundary " ) ); + + TCamZoomBoundary retVal = ECamZoomBoundaryNone; + + TCamZoomMode modeBefore = CurrentZoomType(); + TCamZoomMode modeAfter = CurrentZoomType( ZoomStepsToJump() ); + + if ( modeBefore != modeAfter ) + { + if ( modeBefore == ECamZoomModeOptical && modeAfter == ECamZoomModeDigital || + modeBefore == ECamZoomModeDigital && modeAfter == ECamZoomModeOptical ) + { + PRINT( _L( "Camera <> CCamZoomModel::CheckBoundary ECamZoomBoundaryOptDig" ) ); + retVal = ECamZoomBoundaryOptDig; + } + else if ( modeBefore == ECamZoomModeExtended && modeAfter == ECamZoomModeDigital || + modeBefore == ECamZoomModeDigital && modeAfter == ECamZoomModeExtended ) + { + PRINT( _L( "Camera <> CCamZoomModel::CheckBoundary ECamZoomBoundaryDigExt" ) ); + retVal = ECamZoomBoundaryDigExt; + } + else + { + // Undefined boundary, should not allow further zooming + PRINT( _L( "Camera <> CCamZoomModel::CheckBoundary ECamZoomBoundaryUndefined" ) ); + retVal = ECamZoomBoundaryUndefined; + } + } + else + { + PRINT( _L( "Camera <> CCamZoomModel::CheckBoundary ECamZoomBoundaryNone" ) ); + retVal = ECamZoomBoundaryNone; + } + + PRINT( _L( "Camera <= CCamZoomModel::CheckBoundary " ) ); + return retVal; + } + + +// --------------------------------------------------------------------------- +// CCamZoomModel::ZoomStepsToJump +// Returns the total number of zoom steps to jump based on the current +// zoom mode (opt/dig/ext). Does not break these steps into optical/digital +// steps to jump, as may be the case on a boundary. +// --------------------------------------------------------------------------- +// +TInt CCamZoomModel::ZoomStepsToJump() const + { + PRINT( _L( "Camera => CCamZoomModel::ZoomStepsToJump " ) ); + + TInt steps = 0; + + if ( iController.ActiveCamera() == ECamActiveCameraPrimary ) + { + // Works out the current zoom mode (opt/dig/ext) + TCamZoomMode mode = CurrentZoomType(); + PRINT1( _L( "Camera <> CCamZoomModel::ZoomStepsToJump mode = %d" ), mode ); + + if ( mode == ECamZoomModeOptical ) + { + steps = iZoomLAF.iZoomStepsOpt; + PRINT1( _L( "Camera <> CCamZoomModel::ZoomStepsToJump ECamZoomModeOptical steps = %d" ), steps ); + } + else if ( mode == ECamZoomModeDigital ) + { + steps = iZoomLAF.iZoomStepsDig; + PRINT1( _L( "Camera <> CCamZoomModel::ZoomStepsToJump ECamZoomModeDigital steps = %d" ), steps ); + } + else if ( mode == ECamZoomModeExtended ) + { + steps = iZoomLAF.iZoomStepsExt; + PRINT1( _L( "Camera <> CCamZoomModel::ZoomStepsToJump ECamZoomModeExtended steps = %d" ), steps ); + } + else + { + steps = 0; + } + } + else if ( iController.ActiveCamera() == ECamActiveCameraSecondary ) + { + //steps = K2ndCamZoomStepSize; + steps = iZoomLAF.iSecondCameraZoomSteps; + PRINT1( _L( "Camera <> CCamZoomModel::ZoomStepsToJump K2ndCamZoomStepSize steps = %d" ), steps ); + } + else + { + } + + + if ( iState == ECamZoomModelStateZoomOut ) + { + steps = -steps; + PRINT1( _L( "Camera <> CCamZoomModel::ZoomStepsToJump Inverse, since ZoomOut: steps = %d" ), steps ); + } + + PRINT( _L( "Camera <= CCamZoomModel::ZoomStepsToJump " ) ); + return steps; + } + +// --------------------------------------------------------------------------- +// CCamZoomModel::ZoomStepsToJump +// Returns the number of Optical, Digital and Extended zoom steps to jump +// --------------------------------------------------------------------------- +// +void CCamZoomModel::ZoomStepsToJump( TInt& aOpt, TInt& aDig, TInt& aExt ) const + { + PRINT( _L( "Camera => CCamZoomModel::ZoomStepsToJump (by reference)" ) ); + + TInt steps = ZoomStepsToJump(); + + TCamZoomBoundary boundary = CheckBoundary(); + + // If jumping this number of steps will make us cross the boundary, + // we need to split the steps up into the composite opt/dig steps. + // Depending on if we are pausing or not, we may not want to cross + // the boundary yet + if ( boundary == ECamZoomBoundaryOptDig ) + { + if ( iState == ECamZoomModelStateZoomIn ) + { + // Zooming in, then assign what we can to Optical, to get to max step + // any remainder then goes to digital + TInt optJumpMax = iMaxZoomStepOpt - iCurZoomStepOptical; + aOpt = optJumpMax; + aDig = steps - optJumpMax; + + // If the zoom in was going to take the digital zoom beyond the max + // allowed, clip it + if ( aDig > iMaxZoomStepDig ) + aDig = iMaxZoomStepDig; + } + else if ( iState == ECamZoomModelStateZoomOut ) + { + // Zooming out, then assign what we can to Digital, to get to min step + // any remainder then goes to optical + aDig = -iCurZoomStepDigital; + aOpt = steps + iCurZoomStepDigital; // zooming out, steps is -ve + } + else + { + // Lint + } + } + else if ( boundary == ECamZoomBoundaryDigExt ) + { + if ( iState == ECamZoomModelStateZoomIn ) + { + // Zooming in, then assign what we can to Optical, to get to max step + // any remainder then goes to digital + TInt digJumpMax = iMaxZoomStepDig - iCurZoomStepDigital; + aDig = digJumpMax; + aExt = steps - digJumpMax; + + // If the zoom in was going to take the digital zoom beyond the max + // allowed, clip it + if ( aExt > iMaxZoomStepExt ) + aExt = iMaxZoomStepExt; + } + else if ( iState == ECamZoomModelStateZoomOut ) + { + // Zooming out, then assign what we can to Digital, to get to min step + // any remainder then goes to optical + //aDig = iCurZoomStepDigital; + aDig = steps; + //aExt = steps - iCurZoomStepDigital; + } + else + { + // Lint + } + } + else if ( boundary == ECamZoomBoundaryNone ) + { + // No boundary crossed. Can assign the steps to the current + // mode + TCamZoomMode mode = CurrentZoomType(); + + if ( iState == ECamZoomModelStateZoomIn ) + { + if ( mode == ECamZoomModeOptical && AllowOptZoom() ) + { + aOpt = steps; + if ( iCurZoomStepOptical + aOpt > iMaxZoomStepOpt ) + { + aOpt = iMaxZoomStepOpt - iCurZoomStepOptical; + } + } + else if ( mode == ECamZoomModeDigital && AllowDigZoom() ) + { + aDig = steps; + if ( iCurZoomStepDigital + aDig > iMaxZoomStepDig ) + { + aDig = iMaxZoomStepDig - iCurZoomStepDigital; + } + } + else if ( mode == ECamZoomModeExtended && AllowExtZoom() ) + { + aExt = steps; + if ( iCurZoomStepDigital + aExt > iMaxZoomStepExt ) + { + aExt = iMaxZoomStepExt - iCurZoomStepDigital; + } + } + else + { + // Do nothing (as invalid state) + } + } + else if ( iState == ECamZoomModelStateZoomOut ) + { + if ( mode == ECamZoomModeOptical && AllowOptZoom() ) + { + aOpt = steps; + if ( iCurZoomStepOptical + aOpt < 0 ) + { + aOpt = -iCurZoomStepOptical; + } + } + else if ( mode == ECamZoomModeDigital && AllowDigZoom() ) + { + aDig = steps; + if ( iCurZoomStepDigital + aDig < 0 ) + { + aDig = -iCurZoomStepDigital; + } + } + else if ( mode == ECamZoomModeExtended && AllowExtZoom() ) + { + aExt = steps; + if ( iCurZoomStepDigital + aExt < iMaxZoomStepDig ) + { + aExt = iMaxZoomStepDig - iCurZoomStepDigital; + } + } + else + { + // Do nothing (as invalid state) + } + } + else + { + // Lint + } + } + else // ECamZoomBoundaryUndefined + { + // If undefined boundary, this would result in an invalid + // zoom valid if we zoom, so set all steps to zero. + // This will stop any zoom operation from changing state. + aOpt = 0; + aDig = 0; + aExt = 0; + } + + PRINT( _L( "Camera <= CCamZoomModel::ZoomStepsToJump " ) ); + } + + +// --------------------------------------------------------------------------- +// CCamZoomModel::CurrentZoomType +// Returns the zoom type (opt/dig/ext) based on current zoom levels modified +// by the specified optical/digital valies +// --------------------------------------------------------------------------- +// +TCamZoomMode CCamZoomModel::CurrentZoomType( TInt aStepModifier ) const + { + PRINT( _L( "Camera => CCamZoomModel::CurrentZoomType " ) ); + + TInt maxOptZoomStep = ( iMaxZoomStepOpt == KErrNotSupported || !AllowOptZoom() )? 0 : iMaxZoomStepOpt; + TInt maxStdZoomStep = ( iMaxZoomStepDig == KErrNotSupported || !AllowDigZoom() )? maxOptZoomStep : maxOptZoomStep + iMaxZoomStepDig; + TInt maxExtZoomStep = ( iMaxZoomStepExt == KErrNotSupported || !AllowExtZoom() )? maxStdZoomStep : maxStdZoomStep + iMaxZoomStepExt; + + // + TInt step = CurrentZoom() + aStepModifier; + + // Optical runs from step 0 to maxOptZoomStep + if ( step <= maxOptZoomStep && // Not at max opt zoom level + AllowOptZoom() ) // ... and optical zoom is allowed + { + PRINT( _L( "Camera <= CCamZoomModel::CurrentZoomType ECamZoomModeOptical" ) ); + return ECamZoomModeOptical; + } + // Digital runs from maxOptZoomStep to maxOptZoomStep+maxStdZoomStep + else if ( step >= maxOptZoomStep && + step <= maxStdZoomStep && // Inside std zoom step limits + AllowDigZoom() ) // ...and is allowed by user setting + { + PRINT( _L( "Camera <= CCamZoomModel::CurrentZoomType ECamZoomModeDigital" ) ); + return ECamZoomModeDigital; + } + // Extended runs from maxOptZoomStep+maxStdZoomStep to maxOptZoomStep+maxStdZoomStep + else if ( step >= maxStdZoomStep && + step <= maxExtZoomStep && // Inside ext zoom step limits + AllowExtZoom() ) // ...and ext zoom is allowed by user + { + PRINT( _L( "Camera <= CCamZoomModel::CurrentZoomType ECamZoomModeExtended" ) ); + return ECamZoomModeExtended; + } + else + { + PRINT( _L( "Camera <= CCamZoomModel::CurrentZoomType ECamZoomModeUndefined" ) ); + return ECamZoomModeUndefined; + } + } + +// ----------------------------------------------------------------------------- +// CCamZoomModel::ZoomOut +// Attempts to zoom out one step (if one more step available). +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::ZoomOut( TBool aOneClick ) + { + PRINT( _L( "Camera => CCamZoomModel::ZoomOut " ) ); + iState = ECamZoomModelStateZoomOut; + TInt optZoomJump = 0; + TInt digZoomJump = 0; + TInt extZoomJump = 0; + + ZoomStepsToJump( optZoomJump, digZoomJump, extZoomJump ); + PRINT3( _L( "CCamZoomModel::ZoomOut steps opt(%d) dig(%d) ext(%d) " ), optZoomJump, digZoomJump, extZoomJump ); + + if ( optZoomJump ) + { + CheckZoomMode( ECamZoomModeOptical ); + iCurZoomStepOptical += optZoomJump; + PRINT1( _L( "Camera => CCamZoomModel::ZoomOut opt to %d" ), iCurZoomStepOptical ); + //iController.SetZoomValue( iCurZoomStepOptical ); + iCamZoomUpdateManager->SetZoomValue( iCurZoomStepOptical ); + } + + if ( digZoomJump ) + { + CheckZoomMode( ECamZoomModeDigital ); + iCurZoomStepDigital += digZoomJump; + PRINT1( _L( "Camera => CCamZoomModel::ZoomOut dig to %d" ), iCurZoomStepDigital ); + //iController.SetZoomValue( iCurZoomStepDigital ); + iCamZoomUpdateManager->SetZoomValue( iCurZoomStepDigital ); + } + + if ( extZoomJump ) + { + CheckZoomMode( ECamZoomModeExtended ); + iCurZoomStepDigital += extZoomJump; + PRINT1( _L( "Camera => CCamZoomModel::ZoomOut ext to %d" ), iCurZoomStepDigital ); + //iController.SetZoomValue( iCurZoomStepDigital ); + iCamZoomUpdateManager->SetZoomValue( iCurZoomStepDigital ); + } + + // Tell the zoom pane the value to show. + PRINT1( _L( "ZoomOut set zoom pane %d" ), CurrentZoom() ); + iPane->SetZoomValue( CurrentZoom() ); + + if ( aOneClick ) + { + // Do not start zoom timer + PRINT( _L( "CCamZoomModel::ZoomIn one click" ) ); + iState = ECamZoomModelStateZoomNone; + } + else + { + // Start the timer to zoom-in again when timer expires + PRINT( _L( "CCamZoomModel::ZoomIn start zoom timer" ) ); + StartZoomTimer(); + } + + PRINT( _L( "Camera <= CCamZoomModel::ZoomOut " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomModel::CheckZoomMode +// Checks to see if the zoom mode needs to be changed. +// The purpose is to avoid unneccessary calls to SetZoomMode where possible +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::CheckZoomMode( TCamZoomMode aMode ) + { + PRINT( _L( "Camera => CCamZoomModel::CheckZoomMode " ) ); + if ( iZoomMode != aMode + && ECamZoomModeUndefined != aMode ) + { + //iController.SetZoomMode( aMode ); + PRINT2( _L( "Camera <> CCamZoomModel::CheckZoomMode iZoomMode changed (%d) -> (%d) " ), aMode, iZoomMode ); + iZoomMode = aMode; + } + PRINT( _L( "Camera <= CCamZoomModel::CheckZoomMode " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomModel::RefreshSettings +// Checks the current state of the Camera application, and adjusts the min/max +// range of the zoom pane accordingly. +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::RefreshSettings() + { + PRINT( _L("Camera => CCamZoomModel::RefreshSettings") ); + // If there is no active camera yet, or engine is not + // in a prepared state yet, do not try to refresh settings + // as we can't work out what to base it on. + + // + if( iController.ActiveCamera() == ECamActiveCameraNone + || !( iCameraState & (ECamImageOn|ECamVideoOn) ) + ) + { + return; + } + + // Cache the current resolution to be used when + // determining zoom limits and steps. + ReadCurrentResolution(); + + // Read settings to update internal state + ReadOpticalZoomSetting(); + ReadDigitalZoomSetting(); + + iMaxZoomStepOpt = MaxZoomStep( iOptZoomSteps ); + iMaxZoomStepDig = MaxZoomStep( iDigZoomSteps ); + iMaxZoomStepExt = MaxZoomStep( iExtZoomSteps ); + + iMaxZoomStep = 0; + + PRINT3( _L("Camera <> CCamZoomModel: max steps opt:%d dig:%d ext:%d"), iMaxZoomStepOpt, iMaxZoomStepDig, iMaxZoomStepExt ); + + if ( AllowOptZoom() ) + { + iMaxZoomStep += iMaxZoomStepOpt; + } + + // Check if Digital zoom is allowed + if ( AllowDigZoom() ) + { + // Check if EXTENDED zoom is allowed by user setting + // and the value is valid. For secondary camera, it may + // be that it is not supported. + if ( AllowExtZoom() ) // done in AllowExtZoom: && iMaxZoomStepExt != KErrNotSupported) + { + iMaxZoomStep += iMaxZoomStepExt; + } + else + { + iMaxZoomStep += iMaxZoomStepDig; + } + } + + TInt optSteps = ( AllowOptZoom() ) ? iMaxZoomStepOpt : 0; + TInt stdSteps = ( AllowDigZoom() ) ? iMaxZoomStepDig : 0; + TInt extSteps = ( AllowExtZoom() ) ? Max( (iMaxZoomStepExt - iMaxZoomStepDig), 0 ) : 0; + + // Check that the max zoom is within (possibly new) limits + CheckZoomLimit(); + + if ( iPane ) + { + // Inform the zoom pane of the new range of zoom steps + iPane->SetZoomRange( 0, iMaxZoomStep ); + iPane->SetZoomSteps( optSteps, stdSteps, extSteps ); + iPane->SetZoomValue( CurrentZoom() ); + } + + PRINT( _L("Camera <= CCamZoomModel::RefreshSettings") ); + } + + +// ----------------------------------------------------------------------------- +// CCamZoomModel::ReadDigitalZoomSetting +// Updates the setting for digital/extended zoom or not depending if user +// setting for it is on AND we have a valid setting for it. +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::ReadDigitalZoomSetting() + { + iZoomSetting = static_cast( + iController.IntegerSettingValue( ECamSettingItemPhotoDigitalZoom ) ); + } + + + +// ----------------------------------------------------------------------------- +// CCamZoomModel::ReadOpticalZoomSetting +// Reads whether optical zoom is allowed +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::ReadOpticalZoomSetting() + { + } + + +// ----------------------------------------------------------------------------- +// CCamZoomModel::CheckZoomLimit +// Checks whether the current zoom level is too great for the limits. +// This can happen if the resolution is changed, as this may result in new limits +// The zoom level should be cropped to where appropriate +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::CheckZoomLimit() + { + TInt maxOptZoomStep = MaxZoomStep( iOptZoomSteps ); + TInt maxStdZoomStep = MaxZoomStep( iDigZoomSteps ); + TInt maxExtZoomStep = MaxZoomStep( iExtZoomSteps ); + + if ( AllowOptZoom() && // If settings allow optical zoom, + iCurZoomStepOptical > maxOptZoomStep ) // ...and value now too high + { + iCurZoomStepOptical = maxOptZoomStep; + // iController.SetZoomMode ( ECamZoomModeOptical ); + iController.SetZoomValue( iCurZoomStepOptical ); + } + + if ( AllowDigZoom() // If digital zoom is allowed + && iCurZoomStepDigital > maxStdZoomStep // and value now too high + && !AllowExtZoom() ) // and extended not allowed + { + // If we get here, digital zoom IS allowed, but extended isn't + // and the digital zoom is too high. + iCurZoomStepDigital = maxStdZoomStep; + //iController.SetZoomMode ( ECamZoomModeDigital ); + iController.SetZoomValue( iCurZoomStepDigital ); + } + else if ( AllowExtZoom() // If extended digitial zoom is allowed + && iCurZoomStepDigital > maxExtZoomStep ) // but over the max extended range + { + iCurZoomStepDigital = maxExtZoomStep; + // iController.SetZoomMode ( ECamZoomModeDigital ); + iController.SetZoomValue( iCurZoomStepDigital ); + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error. + } + + // If we have had to manually set the mode and value of zoom, + // make sure that the zoom mode is still set to what internal state + // dictates it should be. + + /* + if ( iZoomMode == ECamZoomModeOptical ) + { + iController.SetZoomMode( ECamZoomModeOptical ); + } + else if ( iZoomMode == ECamZoomModeDigital || + iZoomMode == ECamZoomModeExtended ) + { + iController.SetZoomMode( ECamZoomModeDigital ); + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error. + */ + } + +// ----------------------------------------------------------------------------- +// CCamZoomModel::ResetZoomTo1x +// Resets the zoom level to 1x. +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::ResetZoomTo1x() + { + PRINT( _L( "Camera => CCamZoomModel::ResetZoomTo1x " ) ); + // Recalculates the min/max values for the zoom pane and + // forwards them to the control. + RefreshSettings(); + + // Reset the actual values used by the engine + iCurZoomStepOptical = 0; + iCurZoomStepDigital = 0; + + iZoomMode = ECamZoomModeUndefined; + + // Only digital mode supported for now. + //iController.SetZoomMode( ECamZoomModeDigital ); + iController.SetZoomValue( iCurZoomStepDigital ); + if ( iPane ) + { + iPane->SetZoomValue( 0 ); + iPane->MakeVisible( EFalse, EFalse ); + } + + PRINT( _L( "Camera <= CCamZoomModel::ResetZoomTo1x " ) ); + } + + +// ----------------------------------------------------------------------------- +// CCamZoomModel::MaxZoomStep +// Returns the maximum zoom step for the supplied step array +// (optical/digital/extended), based on current camera state. +// ----------------------------------------------------------------------------- +// +TInt CCamZoomModel::MaxZoomStep( const TCamMaxZoomSteps& aStepArray ) const + { + PRINT( _L( "Camera => CCamZoomModel::MaxZoomStep " ) ); + + TInt maxStep = KErrNotSupported; + if ( iCameraState & ECamImageOn ) + { + // TCamPhotoSizeId sizeId = iController.GetCurrentImageResolution(); + TCamActiveCamera camera = iController.ActiveCamera(); + if ( ECamActiveCameraPrimary == camera ) + { + // switch ( sizeId ) + switch ( iCurrentResolution ) + { + case ECamPhotoSizeVGA: // 640 x 480 + maxStep = aStepArray.iMaxPhotoStepVGA; + break; + case ECamPhotoSizeXGA: // 0.8MegaPixel (1024 x 768 ) + maxStep = aStepArray.iMaxPhotoStep0_8MP; + break; + case ECamPhotoSize1MP: + maxStep = aStepArray.iMaxPhotoStep1MP; + break; + case ECamPhotoSize1_3MP: // 1280x960 + maxStep = aStepArray.iMaxPhotoStep1_3MP; + break; + case ECamPhotoSize2MP: // 1600x1200 + maxStep = aStepArray.iMaxPhotoStep2MP; + break; + case ECamPhotoSize3MP: // + maxStep = aStepArray.iMaxPhotoStep3MP; + break; + case ECamPhotoSize5MP: + maxStep = aStepArray.iMaxPhotoStep5MP; + break; + case ECamPhotoSize8MP: + maxStep = aStepArray.iMaxPhotoStep8MP; + break; + case ECamPhotoSize12MP: + maxStep = aStepArray.iMaxPhotoStep12MP; + break; + case ECamPhotoSizeW6MP: // 3264x1832 + maxStep = aStepArray.iMaxPhotoStepW6MP; + break; + case ECamPhotoSizeW9MP: // 4000x2248 + maxStep = aStepArray.iMaxPhotoStepW9MP; + break; + default: + break; + } + } + else if ( ECamActiveCameraSecondary == camera ) + { + maxStep = aStepArray.iMax2ndCamPhotoStep; + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error. + } + } + else if ( iCameraState & ECamVideoOn ) + { + // TCamVideoResolution resId = iController.GetCurrentVideoResolution(); + + if ( iController.ActiveCamera() == ECamActiveCameraPrimary ) + { + // switch ( resId ) + switch ( iCurrentResolution ) + { + case ECamVideoResolutionSubQCIF: // Small (128 x 96) + maxStep = aStepArray.iMaxVideoStepSQCIF; + break; + case ECamVideoResolutionQCIF: // Medium (176 x 144) + maxStep = aStepArray.iMaxVideoStepQCIF; + break; + case ECamVideoResolutionCIF: // Large (352 x 288) (Default) + maxStep = aStepArray.iMaxVideoStepCIF; + break; + case ECamVideoResolutionVGA: // VGA (640 x 480) + maxStep = aStepArray.iMaxVideoStepVGA; + break; + case ECamVideoResolutionQVGA: // QVGA ( 320 x 240 ) + maxStep = aStepArray.iMaxVideoStepQVGA; + break; + case ECamVideoResolutionNHD: // NHD ( 640 x 352 ) + maxStep = aStepArray.iMaxVideoStepNHD; + break; + case ECamVideoResolutionWVGA: // WVGA ( 864 x 480 ) + maxStep = aStepArray.iMaxVideoStepWVGA; + break; + case ECamVideoResolutionHD: // HD ( 1280 x 720 ) + maxStep = aStepArray.iMaxVideoStepHD; + break; + default: + break; + } + } + else if ( iController.ActiveCamera() == ECamActiveCameraSecondary ) + { + switch ( iCurrentResolution ) + { + case ECamVideoResolutionCIF: // Large (352 x 288) (Default) + maxStep = aStepArray.iMax2ndCamVideoStepCIF; + break; + case ECamVideoResolutionQCIF: // Medium (176 x 144) + maxStep = aStepArray.iMax2ndCamVideoStepQCIF; + break; + case ECamVideoResolutionSubQCIF: // Small (128 x 96) + maxStep = aStepArray.iMax2ndCamVideoStepSQCIF; + break; + default: + break; + } + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error. + } + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error. + } + + PRINT1( _L( "Camera <= CCamZoomModel::MaxZoomStep maxStep=%d" ), maxStep ); + return maxStep; + } + + + + +// ----------------------------------------------------------------------------- +// CCamZoomModel::StopZoom +// Called when the user releases the zoom key to stop an ongoing zoom operation. +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::StopZoom() + { + PRINT( _L( "Camera => CCamZoomModel::StopZoom " ) ); + + if ( iZoomTimer->IsActive() ) + { + iZoomTimer->Cancel(); + } + + // Clear the zoom state + iState = ECamZoomModelStateZoomNone; + + if ( iPauseState == EPauseStatePaused ) + { + iPauseState = EPauseStateReleased; + } + else + { + iPauseState = EPauseStateNone; + } + + PRINT( _L( "Camera <= CCamZoomModel::StopZoom " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomModel::HandleControllerEventL +// Called when a controller event occurs +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::HandleControllerEventL( TCamControllerEvent aEvent, + TInt /*aError*/ ) + { + PRINT( _L( "Camera => CCamZoomModel::HandleControllerEventL " ) ); + switch( aEvent ) + { + // ----------------------------------------- + case ECamEventEngineStateChanged: + { + iCameraState = iController.CameraControllerState(); + + // If a reset is waiting. This happens if the application 'pretends to exit' + // but this occurred when the engine was not prepared e.g. in standby. + // The zoom needs to be set back to default when prepared, and the engine has + // now entered a prepared state + if ( iResetPending + && ( iCameraState & (ECamImageOn|ECamVideoOn) ) ) + { + // The zoom pane will not be redrawn while the iResetPending flag is on. + // This calls RefreshSettings() + ResetZoomTo1x(); + // In this situation the zoom pane should not be shown. + /*if ( iPane->IsVisible() ) + { + iPane->MakeVisible( EFalse, ETrue ); + }*/ + iResetPending = EFalse; + } + else + { + // If state changes (video <-> photo) refresh settings + RefreshSettings(); + } + } + break; + // ----------------------------------------- + case ECamEventCameraChanged: + { + // If state changes (camera change) refresh settings + RefreshSettings(); + + ResetZoomTo1x(); + } + break; + // ----------------------------------------- + // Zoom settings now involve basic digital zoom too. + // Event name changed ECamEventExtZoomStateChanged => ECamEventZoomSetupChanged + case ECamEventImageQualityChanged: + case ECamEventZoomSetupChanged: // Digital/Extended zoom turned on/off/paused/continuous + { + // If image quality has changed, this may update zoom levels. + RefreshSettings(); + } + break; + // ----------------------------------------- + case ECamEventOperationStateChanged: + { + // As the iRecordingVideo state has changed, need to update + // the settings, as this may disable the optical zoom + RefreshSettings(); + } + break; + // ----------------------------------------- + // otherwise, do nothing + default: + break; + } // switch + + PRINT( _L( "Camera <= CCamZoomModel::HandleControllerEventL " ) ); + } + +// --------------------------------------------------------------------------- +// CCamZoomModel::ZoomTimerCallback +// Callback for Zoom Pane timer, used to give smooth zooming +// --------------------------------------------------------------------------- +// +TInt CCamZoomModel::ZoomTimerCallback( TAny* aObject ) + { + CCamZoomModel* model = static_cast< CCamZoomModel* >( aObject ); + model->ZoomTimerTick(); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CCamZoomModel::ZoomTimerTick +// Called each timer period while the zoom in/out key is held down. +// --------------------------------------------------------------------------- +// +void CCamZoomModel::ZoomTimerTick() + { + PRINT( _L("Camera => CCamZoomModel::ZoomTimerTick") ); + TCamZoomMode modeBefore = iZoomMode; + + // Continue the ongoing zoom operation + if ( iState == ECamZoomModelStateZoomIn ) + { + ZoomIn(); + } + else if ( iState == ECamZoomModelStateZoomOut ) + { + ZoomOut(); + } + else + { + // Do nothing + } + + // Check if we're currently on a boundary, in which case we need + // to stop and re-initialise the timer for the (potentially) new + // interval. + TCamZoomMode modeAfter = iZoomMode; + + if ( modeBefore != modeAfter ) + { + // Restart zoom; + if ( iZoomTimer->IsActive() ) + { + iZoomTimer->Cancel(); + } + StartZoomTimer(); + } + PRINT( _L("Camera <= CCamZoomModel::ZoomTimerTick") ); + } + + + +// --------------------------------------------------------------------------- +// CCamZoomModel::StartZoomTimer +// Called each timer period while the zoom in/out key is held down. +// --------------------------------------------------------------------------- +// +void CCamZoomModel::StartZoomTimer() + { + PRINT( _L( "Camera => CCamZoomModel::StartZoomTimer " ) ); + + if ( iZoomTimer->IsActive() ) + { + return; // If only one speed, we're already running so just return. + } + + TCamZoomMode mode = CurrentZoomType(); + + TInt stepPeriod = 0; + + switch ( mode ) + { + case ECamZoomModeOptical: + { + stepPeriod = iZoomLAF.iZoomSpeedOpt * 1000; + break; + } + + case ECamZoomModeDigital: + { + stepPeriod = iZoomLAF.iZoomSpeedDig * 1000; + break; + } + + case ECamZoomModeExtended: + { + stepPeriod = iZoomLAF.iZoomSpeedExt * 1000; + break; + } + + case ECamZoomModeUndefined: + default: + { + stepPeriod = 1000000; + break; + } + } + + + iZoomTimer->Start( stepPeriod, stepPeriod, TCallBack( ZoomTimerCallback , this) ); + iZoomMode = mode; + + PRINT( _L( "Camera <= CCamZoomModel::StartZoomTimer " ) ); + } + +// --------------------------------------------------------------------------- +// CCamZoomModel::AllowExtZoom +// Returns whether extended zoom is allowed or not, based on current settings +// --------------------------------------------------------------------------- +// +TBool CCamZoomModel::AllowExtZoom() const + { + PRINT( _L( "Camera => CCamZoomModel::AllowExtZoom " ) ); + + TInt extendedStep = MaxZoomStep( iExtZoomSteps ); + + // Check there is a valid extended zoom step to allow to first, and that + // we are not in embedded mode (extended zoom not allowed in embedded) + if ( KErrNotSupported != extendedStep ) + { + if ( iZoomSetting == ECamSettDigZoomExtendPause + || iZoomSetting == ECamSettDigZoomExtendCont ) + { + // If setting allows extended zoom, return true + PRINT( _L( "Camera <= CCamZoomModel::AllowExtZoom ETrue" ) ); + return ETrue; + } + else + { + // else user setting disallows it, so return false + PRINT( _L( "Camera <= CCamZoomModel::AllowExtZoom EFalse" ) ); + return EFalse; + } + } + else + { + // No valid extended zoom, so not allowed even if user said so. + PRINT( _L( "Camera <= CCamZoomModel::AllowExtZoom EFalse" ) ); + return EFalse; + } + } + +// --------------------------------------------------------------------------- +// CCamZoomModel::AllowOptZoom +// Returns whether optical zoom is allowed +// --------------------------------------------------------------------------- +// +TBool CCamZoomModel::AllowOptZoom() const + { + PRINT( _L( "Camera => CCamZoomModel::AllowOptZoom " ) ); + TInt maxOptZoomStep = MaxZoomStep( iOptZoomSteps ); + if ( KErrNotSupported == maxOptZoomStep // Zoom is NOT supported or + || ( !iAllowOptZoom // Settings dont allow zoom during recording + && iRecordingVideo ) ) // ...and we're recording now + { + PRINT( _L( "Camera <= CCamZoomModel::AllowOptZoom EFalse" ) ); + return EFalse; + } + else + { + PRINT( _L( "Camera <= CCamZoomModel::AllowOptZoom ETrue" ) ); + return ETrue; + } + } + +// --------------------------------------------------------------------------- +// CCamZoomModel::AllowDigZoom +// Returns whether digital zoom is allowed +// --------------------------------------------------------------------------- +// +TBool CCamZoomModel::AllowDigZoom() const + { + PRINT( _L( "Camera => CCamZoomModel::AllowDigZoom " ) ); + TInt maxStdZoomStep = MaxZoomStep( iDigZoomSteps ); + + if ( KErrNotSupported != maxStdZoomStep // Zoom is supported in current state + && ECamSettDigZoomNone != iZoomSetting ) // ...and is allowed by user setting + { + PRINT( _L( "Camera <= CCamZoomModel::AllowDigZoom ETrue" ) ); + return ETrue; + } + else + { + PRINT( _L( "Camera <= CCamZoomModel::AllowDigZoom ETrue" ) ); + return EFalse; + } + } + + +// --------------------------------------------------------------------------- +// CCamZoomModel::CurrentZoom +// Returns the current zoom level, taking into account optical (if allowed) +// *and* digital zooms. +// --------------------------------------------------------------------------- +// +TInt CCamZoomModel::CurrentZoom() const + { + PRINT( _L( "Camera => CCamZoomModel::CurrentZoom" ) ); + // If we are recording video, and optical isn't allowed while recording + // then we only need to represent the Digital zoom in the zoom pane. + if ( iRecordingVideo && !iAllowOptZoom ) + { + // Only use digital value if optical not allowed + PRINT( _L( "Camera <= CCamZoomModel::CurrentZoom digital" ) ); + return iCurZoomStepDigital; + } + else + { + // Return the combined zoom value + PRINT( _L( "Camera <= CCamZoomModel::CurrentZoom optical+digital" ) ); + return (iCurZoomStepOptical + iCurZoomStepDigital); + } + } + + +// --------------------------------------------------------------------------- +// CCamZoomModel::PauseAtBoundary +// Returns whether to pause at the specified boundary +// --------------------------------------------------------------------------- +// +TBool CCamZoomModel::PauseAtBoundary( TCamZoomBoundary aBoundary ) const + { + PRINT( _L( "Camera => CCamZoomModel::PauseAtBoundary" ) ); + if ( iCameraState & ECamVideoOn ) + { + // Always return false for video, as we do not want to + // force the zoom operation to pause at any boundary + // in video mode. + PRINT( _L( "Camera <= CCamZoomModel::PauseAtBoundary EFalse" ) ); + return EFalse; + } + else + { + if ( ECamZoomBoundaryOptDig == aBoundary ) + { + // Reason to *not* pause at the optical/digital boundary is if + // user set the "On (continuous)" or "Extended on (continuous) setting + if ( ECamSettDigZoomNormalCont == iZoomSetting + || ECamSettDigZoomExtendCont == iZoomSetting ) + { + PRINT( _L( "Camera <= CCamZoomModel::PauseAtBoundary EFalse" ) ); + return EFalse; + } + else + { + PRINT( _L( "Camera <= CCamZoomModel::PauseAtBoundary ETrue" ) ); + return ETrue; + } + } + else if ( ECamZoomBoundaryDigExt == aBoundary ) + { + // Only reason *not* to pause in digital/extended boundary is if + // user zoom setting states "extended on without pauses". + if ( ECamSettDigZoomExtendCont == iZoomSetting ) + { + PRINT( _L( "Camera <= CCamZoomModel::PauseAtBoundary EFalse" ) ); + return EFalse; + } + else + { + PRINT( _L( "Camera <= CCamZoomModel::PauseAtBoundary ETrue" ) ); + return ETrue; + } + } + else // No other boundaries known, return "no pause". + { + PRINT( _L( "Camera <= CCamZoomModel::PauseAtBoundary EFalse" ) ); + return EFalse; + } + } + } + + +// ----------------------------------------------------------------------------- +// CCamZoomPane::IsCurrentlyZooming +// Returns ETrue if the zoom model is currently zooming in/out, +// else returns EFalse +// ----------------------------------------------------------------------------- +// +TBool CCamZoomModel::IsCurrentlyZooming() const + { + PRINT( _L( "Camera => CCamZoomModel::IsCurrentlyZooming" ) ); + if ( ECamZoomModelStateZoomIn == iState + || ECamZoomModelStateZoomOut == iState ) + { + PRINT( _L( "Camera <= CCamZoomModel::IsCurrentlyZooming ETrue" ) ); + return ETrue; + } + else + { + PRINT( _L( "Camera <= CCamZoomModel::IsCurrentlyZooming EFalse" ) ); + return EFalse; + } + } + +// ----------------------------------------------------------------------------- +// CCamZoomModel::ZoomingState +// ----------------------------------------------------------------------------- +// +CCamZoomModel::TCamZoomModelState CCamZoomModel::ZoomingState() + { + return iState; + } + + +// ----------------------------------------------------------------------------- +// CCamZoomPane::ResetToDefaultAfterPrepare +// Sets the zoompane to reset the zoom level to default values +// next time the engine is prepared +// ----------------------------------------------------------------------------- +// +void CCamZoomModel::ResetToDefaultAfterPrepare( TBool aReset ) + { + iResetPending = aReset; + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::IsResetPending +// Whether or not the zoom level is waiting to be reset to default +// ----------------------------------------------------------------------------- +// +TBool CCamZoomModel::IsResetPending() const + { + return iResetPending; + } + +// ----------------------------------------------------------------------------- +// ReadCurrentResolution +// ----------------------------------------------------------------------------- +// +void +CCamZoomModel::ReadCurrentResolution() + { + PRINT1( _L("Camera => CCamZoomModel::ReadCurrentResolution, now:%d"), iCurrentResolution ); + if ( iCameraState & ECamImageOn ) + { + iCurrentResolution = iController.GetCurrentImageResolution(); + } + else if( iCameraState & ECamVideoOn ) + { + iCurrentResolution = iController.GetCurrentVideoResolution(); + } + else + { + iCurrentResolution = KErrNotReady; + } + PRINT1( _L("Camera <= CCamZoomModel::ReadCurrentResolution, got:%d"), iCurrentResolution ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamZoomPane.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamZoomPane.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1211 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera Zoom Pane; shows the zoom level graphically* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include // For CCoeAppUiBase +#include // For CEikApplication +#include // resource reader +#include +#include +#include +#include +#include +#include +#include +#include "CameraUiConfigManager.h" +#include "CamPanic.h" // Panic codes +#include "CamUtility.h" +#include "CamZoomPane.h" +#include "CamZoomModel.h" +#include "CamAppUi.h" +#include "CamBmpRotatorAo.h" +#include "CameraappPrivateCRKeys.h" +#include "CamTimer.h" + + +// CONSTANTS +const TInt KDivisorFactor = 10000; // integer scaling factor to avoid the + // use of floating point arithmetic +const TInt KTouchAreaExpansion = 35; // Pixels to grow touchable area + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamZoomPane::CCamZoomPane +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamZoomPane::CCamZoomPane( CCamAppController& aController, TBool aOverlayViewFinder ) + : iController( aController ), + iOverlayViewFinder( aOverlayViewFinder ) + { + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::ConstructL() + { + PRINT( _L( "Camera => CCamZoomPane::ConstructL " ) ); + // Load the zoom pane orientation value from the Central Repository + CRepository* repository = CRepository::NewL( KCRUidCameraappSettings ); + TInt val = 0; + TInt err = repository->Get( KCamCrZoomPaneOrientation, val ); + + // If there is an error then assume standard (vertical) orientation + if ( err != KErrNone ) + { + iOrientation = EZPOrientationVertical; + } + else + { + iOrientation = static_cast( val ); + } +#if !( defined(__WINS__) || defined(__WINSCW__) ) + // Get Central Repository key indicating if product uses volume keys for zoom + err = repository->Get( KCamCrZoomUsingVolumeKeys, val ); + + // If there is an error then assume volume keys not used + if ( err != KErrNone ) + { + iZoomUsingVolumeKeys = EFalse; + } + else + { + iZoomUsingVolumeKeys = val; + } + + iZoomUsingVolumeKeys = EFalse; + + // Get Central Repository key indicating if product uses navi-keys for zoom + err = repository->Get( KCamCrZoomUsingNaviKeys, val ); + + // If there is an error then assume navi-keys not used + if ( err != KErrNone ) + { + iZoomUsingNaviKeys = EFalse; + } + else + { + iZoomUsingNaviKeys = val; + } +#else + iZoomUsingVolumeKeys = EFalse; + iZoomUsingNaviKeys = ETrue; +#endif // !( defined(__WINS__) || defined(__WINSCW__) ) + + delete repository; + repository = NULL; + + // Find the name and path of the MBM file for zoom pane bitmaps + TFileName resFileName; + CamUtility::ResourceFileName( resFileName ); + TPtrC resname = resFileName; + + // Create component bitmaps + AknIconUtils::CreateIconL( iIconZoomTop[0], + iIconZoomTop[1], + resname, + EMbmCameraappQgn_indi_cam4_zoom_top, + EMbmCameraappQgn_indi_cam4_zoom_top_mask ); + + AknIconUtils::CreateIconL( iIconZoomMiddle[0], + iIconZoomMiddle[1], + resname, + EMbmCameraappQgn_indi_cam4_zoom_middle, + EMbmCameraappQgn_indi_cam4_zoom_middle_mask ); + + AknIconUtils::CreateIconL( iIconZoomBottom[0], + iIconZoomBottom[1], + resname, + EMbmCameraappQgn_indi_cam4_zoom_bottom, + EMbmCameraappQgn_indi_cam4_zoom_bottom_mask ); + + AknIconUtils::CreateIconL( iIconZoomMarker[0], + iIconZoomMarker[1], + resname, + EMbmCameraappQgn_indi_cam4_zoom_marker, + EMbmCameraappQgn_indi_cam4_zoom_marker_mask ); + + AknIconUtils::CreateIconL( iIconZoomMarkerGray[0], + iIconZoomMarkerGray[1], + resname, + EMbmCameraappQgn_indi_cam4_zoom_marker_selected, + EMbmCameraappQgn_indi_cam4_zoom_marker_selected_mask ); + + AknIconUtils::CreateIconL( iIconZoomMin[0], + iIconZoomMin[1], + resname, + EMbmCameraappQgn_indi_cam4_zoom_min, + EMbmCameraappQgn_indi_cam4_zoom_min_mask ); + + AknIconUtils::CreateIconL( iIconZoomMax[0], + iIconZoomMax[1], + resname, + EMbmCameraappQgn_indi_cam4_zoom_max, + EMbmCameraappQgn_indi_cam4_zoom_max_mask ); + + SizeChanged(); // Initialize layouts and set sizes + CamUtility::SetAlphaL( iIconZoomTop[0], iIconZoomTop[1] ); + CamUtility::SetAlphaL( iIconZoomMiddle[0], iIconZoomMiddle[1] ); + CamUtility::SetAlphaL( iIconZoomBottom[0], iIconZoomBottom[1] ); + CamUtility::SetAlphaL( iIconZoomMarker[0], iIconZoomMarker[1] ); + CamUtility::SetAlphaL( iIconZoomMarkerGray[0], iIconZoomMarkerGray[1] ); + CamUtility::SetAlphaL( iIconZoomMin[0], iIconZoomMin[1] ); + CamUtility::SetAlphaL( iIconZoomMax[0], iIconZoomMax[1] ); + iIconZoomMarkerCurrent = iIconZoomMarker[0]; + + // Retrieve product-specific information about zoom support + CamUtility::GetPsiInt( ECamPsiVideoZoomSupport, iZoomSupport ); + + // Retrieve the timing and step values for each of the zoom bar + // segments/modes eg Optical/Digital/Extended + TPckgBuf pckg; + CamUtility::GetPsiAnyL( ECamPsiZoomBarLAF, &pckg); + iZoomLAF = pckg(); + + // Register for notification of controller events + iController.AddControllerObserverL( this ); + + iModel = CCamZoomModel::NewL( iController, this ); + iFeedback = MTouchFeedback::Instance(); + + PRINT( _L( "Camera <= CCamZoomPane::ConstructL " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::LoadResourceDataL() +// Reads in all information needed from resources +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::LoadResourceDataL() + { + PRINT( _L( "Camera => CCamZoomPane::LoadResourceDataL " ) ); + ReadLayoutL(); + PRINT( _L( "Camera <= CCamZoomPane::LoadResourceDataL " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::UnloadResourceData() +// Frees all dynamic resources allocated in LoadResourceDataL +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::UnloadResourceData() + { + PRINT( _L( "Camera => CCamZoomPane::UnloadResourceData " ) ); + PRINT( _L( "Camera <= CCamZoomPane::UnloadResourceData " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::ReloadResourceDataL() +// Refreshes all resource-based information stored in the class +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::ReloadResourceDataL() + { + PRINT( _L( "Camera => CCamZoomPane::ReloadResourceDataL " ) ); + UnloadResourceData(); + LoadResourceDataL(); + PRINT( _L( "Camera <= CCamZoomPane::ReloadResourceDataL " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamZoomPane* CCamZoomPane::NewL( CCamAppController& aController, + TBool aOverlayViewFinder ) + { + PRINT( _L( "Camera => CCamZoomPane::NewL " ) ); + CCamZoomPane* self = new( ELeave ) CCamZoomPane ( aController, aOverlayViewFinder ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + PRINT( _L( "Camera <= CCamZoomPane::NewL " ) ); + return self; + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::~CCamZoomPane +// Destructor. +// ----------------------------------------------------------------------------- +// +CCamZoomPane::~CCamZoomPane() + { + PRINT( _L("Camera => ~CCamZoomPane" )) + iController.RemoveControllerObserver( this ); + + delete iIconZoomTop[0]; + delete iIconZoomMiddle[0]; + delete iIconZoomBottom[0]; + delete iIconZoomMarker[0]; + delete iIconZoomMarkerGray[0]; + delete iIconZoomMin[0]; + delete iIconZoomMax[0]; + delete iIconZoomTop[1]; + delete iIconZoomMiddle[1]; + delete iIconZoomBottom[1]; + delete iIconZoomMarker[1]; + delete iIconZoomMarkerGray[1]; + delete iIconZoomMin[1]; + delete iIconZoomMax[1]; + + delete iModel; + + if ( iRotatorAo && + iRotatorAo->IsActive() ) + { + iRotatorAo->Cancel(); + } + delete iRotatorAo; + + + iZoomInKeys.Close(); + iZoomOutKeys.Close(); + + PRINT( _L("Camera <= ~CCamZoomPane" )) + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::Draw +// Draws the zoom pane +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::Draw( CBitmapContext& aGc ) const + { + PRINT( _L( "Camera => CCamZoomPane::Draw " ) ); + if ( !iMaxZoom ) + { + PRINT( _L( "Camera <= CCamZoomPane::Draw not set up yet" ) ); + return; // Not set up yet + } + + if ( !iOverlayViewFinder ) + { + aGc.Clear( iZoomPaneRect ); + } + + DrawPlusMinus( aGc ); + DrawShaft( aGc ); + DrawThumb( aGc ); + PRINT( _L( "Camera <= CCamZoomPane::Draw " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::DrawPlusMinus +// Draws the plus and minus icons +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::DrawPlusMinus( CBitmapContext& aGc ) const + { + PRINT( _L( "Camera => CCamZoomPane::DrawPlusMinus " ) ); + aGc.BitBlt( iPlusPoint, iIconZoomMax[0] ); + aGc.BitBlt( iMinusPoint, iIconZoomMin[0] ); + PRINT( _L( "Camera <= CCamZoomPane::DrawPlusMinus " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::DrawShaft +// Draws the shaft of the zoom pane +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::DrawShaft( CBitmapContext& aGc ) const + { + PRINT( _L( "Camera => CCamZoomPane::DrawShaft " ) ); + aGc.BitBlt( iTopPoint, iIconZoomTop[0] ); + aGc.BitBlt( iMiddlePoint, iIconZoomMiddle[0] ); + aGc.BitBlt( iBottomPoint, iIconZoomBottom[0] ); + PRINT( _L( "Camera <= CCamZoomPane::DrawShaft " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::SetPoint +// Sets the value of a point based on another point and an (optional) modifier value. +// This was added to simplify the bar drawing code, so the changes based on orientation +// are (as much as possible) contained in this function +// ----------------------------------------------------------------------------- +// +void +CCamZoomPane::SetPoint( TPoint& aPoint, + const TPoint& aOffset, + TInt aAdditional ) const + { + PRINT( _L( "Camera => CCamZoomPane::SetPoint " ) ); + if ( PaneOrientation() == EZPOrientationVertical ) + { + aPoint.iY = aOffset.iY + aAdditional; + } + else + { + aPoint.iX = aOffset.iX - aAdditional; + } + PRINT( _L( "Camera <= CCamZoomPane::SetPoint " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::PaneOrientation +// Returns the current zoom pane orientation (taking into account whether this +// should be forced or not if on secondary camera) +// ----------------------------------------------------------------------------- +// +CCamZoomPane::TZPOrientation CCamZoomPane::PaneOrientation() const + { + PRINT( _L( "Camera => CCamZoomPane::PaneOrientation " ) ); + if ( iController.ActiveCamera() == ECamActiveCameraSecondary ) + { + PRINT( _L( "Camera <= CCamZoomPane::PaneOrientation EZPOrientationVertical" ) ); + return EZPOrientationVertical; + } + else + { + PRINT( _L( "Camera <= CCamZoomPane::PaneOrientation iOrientation" ) ); + return iOrientation; + } + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::DrawThumb +// Draws the thumb of the zoom pane +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::DrawThumb( CBitmapContext& aGc ) const + { + PRINT( _L( "Camera => CCamZoomPane::DrawThumb " ) ); + TPoint newThumbPos; + // Knob bitmap has an empty area on the edge, thus it starts upper than top + // of zoom slider + // topPointY is iTl.iY of knob bitmap when maximum zoom is used. + newThumbPos.iX = iZoomPaneRect.iTl.iX; + + TInt pixelsPerStep = ( iMaxOffset * KDivisorFactor ) / (iMaxZoom+1); + TInt pixelsFromBase; + pixelsFromBase = ( iTrgZoom * pixelsPerStep ); + newThumbPos.iY = iTopPoint.iY + iMaxOffset - + (pixelsFromBase + pixelsPerStep/2 + + iIconZoomMarker[0]->SizeInPixels().iHeight * + KDivisorFactor / 2) / KDivisorFactor; + + aGc.BitBlt( newThumbPos, iIconZoomMarkerCurrent ); + PRINT( _L( "Camera <= CCamZoomPane::DrawThumb " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::SetRect +// Sets the rect that zoom pane is drawn into +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::SetRect( TRect aRect ) + { + PRINT( _L( "Camera => CCamZoomPane::SetRect " ) ); + iZoomPaneRect = aRect; + PRINT( _L( "Camera <= CCamZoomPane::SetRect " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::SetZoomRange +// Specifies the range of values zoom supports +// aMax should always be more than aMin. +// ----------------------------------------------------------------------------- +// +TInt CCamZoomPane::SetZoomRange( TInt aMin, TInt aMax ) + { + PRINT( _L( "Camera => CCamZoomPane::SetZoomRange " ) ); + // The minimum value should always be less than the max. + if ( aMin >= aMax || + aMin < 0 ) + { + PRINT( _L( "Camera <= CCamZoomPane::SetZoomRange KErrArgument" ) ); + return KErrArgument; + } + + iMinZoom = aMin; + iMaxZoom = aMax; + PRINT( _L( "Camera <= CCamZoomPane::SetZoomRange " ) ); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::SetZoomSteps +// Sets the number of steps allowed in each category +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::SetZoomSteps( TInt aOptSteps, TInt aStdSteps, TInt aExtSteps ) + { + PRINT( _L( "Camera => CCamZoomPane::SetZoomSteps " ) ); + ASSERT( aOptSteps >= 0 && aStdSteps >= 0 && aExtSteps >= 0 ); + + iOptSteps = aOptSteps; + iStdSteps = aStdSteps; + iExtSteps = aExtSteps; + PRINT( _L( "Camera <= CCamZoomPane::SetZoomSteps " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::SetZoomValue +// Specifies the current level of Zoom. +// ----------------------------------------------------------------------------- +// +TInt CCamZoomPane::SetZoomValue( TInt aZoom ) + { + PRINT1( _L( "Camera => CCamZoomPane::SetZoomValue aZoom=%d" ), aZoom ); + if ( iController.UiConfigManagerPtr()->IsExtendedDigitalZoomSupported() ) + { + // this may happen if in the extended zoom range + // and we switch the extended range off - the + // zoom value in the engine will be greater than + // the max value allowed + if ( aZoom > iMaxZoom ) + { + aZoom = iMaxZoom; + } + } + + // Check supplied value is within valid range + if ( aZoom < iMinZoom || aZoom > iMaxZoom ) + { + PRINT( _L( "Camera <= CCamZoomPane::SetZoomValue KErrArgument" ) ); + return KErrArgument; + } + + iCurZoom = aZoom; + iTrgZoom = aZoom; + + if ( iVisible ) + { + // force redraw of zoom pane + MakeVisible( ETrue, ETrue ); + } + + PRINT( _L( "Camera <= CCamZoomPane::SetZoomValue " ) ); + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::ZoomValue +// Returns the current zoom value (as the ZoomPane knows it) +// ----------------------------------------------------------------------------- +// +TInt CCamZoomPane::ZoomValue() const + { + PRINT( _L( "Camera => CCamZoomPane::ZoomValue " ) ); + PRINT1( _L( "Camera <= CCamZoomPane::ZoomValue iCurZoom=%d" ), iCurZoom ); + return iCurZoom; + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::IsZoomAtMinimum +// Returns whether the current zoom value is the minimum zoom +// ----------------------------------------------------------------------------- +// +TBool CCamZoomPane::IsZoomAtMinimum() const + { + PRINT2(_L("Camera =><= CCamZoomPane::IsZoomAtMinimum iCurZoom = %d, iMinZoom = %d"), iCurZoom, iMinZoom); + return iCurZoom == iMinZoom; + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::OkToShowPane +// Returns whether or not the Zoom Pane can currently be shown. +// ----------------------------------------------------------------------------- +// +TBool CCamZoomPane::OkToShowPane() const + { + PRINT( _L( "Camera => CCamZoomPane::OkToShowPane " ) ); + // Are we currently recording video? + if ( iRecordingVideo ) + { + // Are we allowed to zoom when recording video? + if ( ( iZoomSupport & ECamZoomWhenRecord ) ) + { + PRINT( _L( "Camera <= CCamZoomPane::OkToShowPane ETrue" ) ); + return ETrue; + } + else // If not allowed, return false + { + PRINT( _L( "Camera <= CCamZoomPane::OkToShowPane EFalse" ) ); + return EFalse; + } + } + + // If a sequence capture is in progress + if ( iController.SequenceCaptureInProgress() ) + { + PRINT( _L( "Camera <= CCamZoomPane::OkToShowPane EFalse" ) ); + return EFalse; + } + + PRINT( _L( "Camera <= CCamZoomPane::OkToShowPane ETrue" ) ); + return ETrue; + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::HandleControllerEventL +// Handle controller events, specifically to find out if video is currently +// being recorded. Only called if Zooming while recording is NOT allowed +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::HandleControllerEventL( TCamControllerEvent aEvent, + TInt /*aError*/ ) + { + PRINT( _L( "Camera => CCamZoomPane::HandleControllerEventL " ) ); + switch ( aEvent ) + { + case ECamEventOperationStateChanged: + { + iRecordingVideo = ECamControllerVideo == iController.CurrentMode() + && ECamCapturing == iController.CurrentOperation(); + break; + } + case ECamEventCameraChanged: + { + ReadLayoutL(); + break; + } + case ECamEventCaptureComplete: + { + // Release knob if image is captured with HW button while zooming. + iIconZoomMarkerCurrent = iIconZoomMarker[0]; + break; + } + default: + break; + } + PRINT( _L( "Camera <= CCamZoomPane::HandleControllerEventL " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::Rect +// Returns the zoom pane rect +// ----------------------------------------------------------------------------- +// +TRect CCamZoomPane::Rect() const + { + PRINT( _L( "Camera =><= CCamZoomPane::Rect " ) ); + return iZoomPaneRect; + } + +// --------------------------------------------------------- +// CCamZoomPane::ReadLayoutL +// --------------------------------------------------------- +// +void CCamZoomPane::ReadLayoutL() + { + PRINT( _L( "Camera =><= CCamZoomPane::ReadLayoutL " ) ); + + if ( CamUtility::IsNhdDevice() ) + { + TouchLayout(); + } + else + { + NonTouchLayout(); + } + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::IsVisible +// Is the zoom pane invisible +// ----------------------------------------------------------------------------- +// +TBool CCamZoomPane::IsVisible() const + { + PRINT( _L( "Camera =><= CCamZoomPane::IsVisible " ) ); + return iVisible; + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::MakeVisible +// Makes the zoom pane visible +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::MakeVisible( TBool aVisible, TBool aRedraw ) + { + PRINT2( _L( "Camera => CCamZoomPane::MakeVisible aVisible=%d aRedraw=%d" ), aVisible, aRedraw ); + iVisible = aVisible; + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + // No zoom in secondary camera view + if ( appUi && iController.ActiveCamera() == ECamActiveCameraPrimary ) + { + if ( aVisible ) + { + appUi->ShowZoomPane(aRedraw); + } + else + { + appUi->HideZoomPane(aRedraw); + iVisible = EFalse; + } + } + PRINT( _L( "Camera <= CCamZoomPane::MakeVisible " ) ); + } + +void CCamZoomPane::SetZoomKeys( const RArray& aZoomIn, + const RArray& aZoomOut ) + { + PRINT( _L( "Camera => CCamZoomPane::SetZoomKeys CAMERAAPP_MULTIPLE_ZOOM_KEYS" ) ); + iZoomInKeys.Reset(); + ReadZoomKeys( aZoomIn, iZoomInKeys ); + iZoomOutKeys.Reset(); + ReadZoomKeys( aZoomOut, iZoomOutKeys ); + PRINT( _L( "Camera <= CCamZoomPane::SetZoomKeys " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::ReadZoomKeys +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::ReadZoomKeys( const RArray& aSource, + RArray& aTarget ) + { + PRINT( _L( "Camera => CCamZoomPane::ReadZoomKeys " ) ); + for ( TInt i = 0; i < aSource.Count(); i++ ) + { + // here we ignore the error + aTarget.Append( aSource[i] ); + } + PRINT( _L( "Camera <= CCamZoomPane::ReadZoomKeys " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::CheckForZoomKey +// ----------------------------------------------------------------------------- +// +TBool CCamZoomPane::CheckForZoomKey( const TKeyEvent& aKeyEvent, + const RArray& aKeys ) + { + PRINT( _L( "Camera =><= CCamZoomPane::CheckForZoomKey " ) ); + return (KErrNotFound != aKeys.Find( aKeyEvent.iScanCode )); + } + + +// ----------------------------------------------------------------------------- +// CCamZoomPane::OfferKeyEventL +// Handles key events for the zoom pane. +// ----------------------------------------------------------------------------- +// +TKeyResponse CCamZoomPane::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) + { + PRINT2( _L("Camera => CCamZoomPane::OfferKeyEventL (%d) (%d)"),aKeyEvent.iScanCode, aType ) + TBool vertical = PaneOrientation() == EZPOrientationVertical; + + + TBool foundZoomInKey = CheckForZoomKey( aKeyEvent, iZoomInKeys ); + TBool foundZoomOutKey = CheckForZoomKey( aKeyEvent, iZoomOutKeys ); + + if ( foundZoomInKey && vertical || + foundZoomOutKey && !vertical ) + { + // Block key events if touch is active + if ( iTouchActive ) + { + return EKeyWasConsumed; + } + // Handle a zoom-in key as a valid event, and start zoom + else if ( aType == EEventKeyDown ) + { + iModel->ZoomIn(); + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKeyDown, zoom in")) + return EKeyWasConsumed; + } + // Handle an up zoom-in key as a valid event, only if currently + // zooming. Can get stray up events if user woke from standby + // with zoom key. This should filter these out. + else if ( aType == EEventKeyUp && + IsCurrentlyZooming() ) + { + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKeyUp, stop zoom 1")) + iModel->StopZoom(); + return EKeyWasConsumed; + } + // Handle special zoom-in once request + else if ( aType == EEventUser && + !IsCurrentlyZooming() ) + { + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKeyUp, zoom in once")) + iModel->ZoomIn( ETrue ); + return EKeyWasConsumed; + } + // Repeat "key" events are consumed (to keep the bar visible) but + // no need to do anything with it as zooming is timer (not key event) based + else if ( aType == EEventKey && + aKeyEvent.iRepeats > 0 ) + { + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKey repeated 1")) + // Do nothing with it, but consume it + return EKeyWasConsumed; + } + else + { + // empty statement to remove Lint error. + } + + } + // If the orientation of the zoom pane changes, the keys to zoom in/out + // need to switch to move in the correct direction on the zoom pane. + else if ( foundZoomOutKey && vertical || + foundZoomInKey && !vertical ) + { + // Handle a zoom-out key as a valid event, and start zoom + if ( aType == EEventKeyDown ) + { + iModel->ZoomOut(); + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKeyDown, zoom out")) + return EKeyWasConsumed; + } + // Handle an up zoom-out key as a valid event, only if currently + // zooming. Can get stray up events if user woke from standby + // with zoom key. This should filter these out. + else if ( aType == EEventKeyUp && + IsCurrentlyZooming() ) + { + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKeyUp, calling StopZoom")) + iModel->StopZoom(); + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKeyUp, stop zoom 2")) + return EKeyWasConsumed; + } + // Handle special zoom-out once request + else if ( aType == EEventUser && + !IsCurrentlyZooming() ) + { + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKeyUp, zoom out once")) + iModel->ZoomOut( ETrue ); + return EKeyWasConsumed; + } + // Repeat "key" events are consumed (to keep the bar visible) but + // no need to do anything with it as zooming is timer (not key event) based + else if ( aType == EEventKey && + aKeyEvent.iRepeats > 0 ) + { + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKey repeated 2")) + // Do nothing with it, but consume it + return EKeyWasConsumed; + } + else + { + // empty statement to remove Lint error. + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKey empty statement!")) + } + + } + // otherwise, do nothing + else + { + // empty statement to remove Lint error. + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL EEventKey empty statement!!")) + } + PRINT( _L("Camera <= CCamZoomPane::OfferKeyEventL not consumed")) + return EKeyWasNotConsumed; + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::HandleForegroundEvent +// Performs required actions on gaining/losing foreground +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::HandleForegroundEvent( TBool aForeground ) + { + PRINT( _L( "Camera => CCamZoomPane::HandleForegroundEvent " ) ); + if ( !aForeground ) + { + // Ensure any ongoing zoom is stopped + PRINT( _L( "Camera <> CCamZoomPane::HandleForegroundEvent calling StopZoom" ) ); + iModel->StopZoom(); + } + PRINT( _L( "Camera <= CCamZoomPane::HandleForegroundEvent " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::IsCurrentlyZooming +// Returns ETrue if the zoom model is currently zooming in/out, +// else returns EFalse +// ----------------------------------------------------------------------------- +// +TBool CCamZoomPane::IsCurrentlyZooming() const + { + PRINT( _L( "Camera =><= CCamZoomPane::IsCurrentlyZooming " ) ); + return iModel->IsCurrentlyZooming(); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::ResetToDefaultAfterPrepare +// Sets the zoompane to reset the zoom level to default values +// next time the engine is prepared +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::ResetToDefaultAfterPrepare( TBool aReset ) + { + PRINT( _L( "Camera =><= CCamZoomPane::ResetToDefaultAfterPrepare " ) ); + iModel->ResetToDefaultAfterPrepare( aReset ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::IsResetPending +// Whether or not the zoom level is waiting to be reset to default +// ----------------------------------------------------------------------------- +// +TBool CCamZoomPane::IsResetPending() const + { + PRINT( _L( "Camera =><= CCamZoomPane::IsResetPending " ) ); + return iModel->IsResetPending(); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::StopZoom +// Stops zoom actions +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::StopZoom() + { + PRINT( _L( "Camera => CCamZoomPane::StopZoom " ) ); + iModel->StopZoom(); + PRINT( _L( "Camera <= CCamZoomPane::StopZoom " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::ResetZoomTo1x +// Resets the zoom level to 1x. +// ----------------------------------------------------------------------------- +// +void CCamZoomPane::ResetZoomTo1x() + { + PRINT( _L( "Camera => CCamZoomPane::ResetZoomTo1x " ) ); + iModel->ResetZoomTo1x(); + PRINT( _L( "Camera <= CCamZoomPane::ResetZoomTo1x " ) ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::StartTouchZoomL +// ----------------------------------------------------------------------------- +// +TBool CCamZoomPane::StartTouchZoomL( TInt aPointer ) + { + PRINT( _L( "Camera => CCamZoomPane::StartTouchZoomL" ) ); + + // Block key events + iTouchActive = ETrue; + if ( !iMaxZoom ) // Avoid division by zero + { + return EFalse; + } + TInt pixelsPerStep = ( iMaxOffset * KDivisorFactor ) / (iMaxZoom+1); + + PRINT1( _L( "Camera <> CCamZoomPane::StartTouchZoomL (iMaxZoom) %d" ), iMaxZoom ); + PRINT1( _L( "Camera <> CCamZoomPane::StartTouchZoomL (iMinZoom) %d" ), iMinZoom ); + PRINT1( _L( "Camera <> CCamZoomPane::StartTouchZoomL (pixelsPerStep) %d" ), pixelsPerStep ); + + // New zoom according to touched point + TInt base = iSliderParentRect.iBr.iY - aPointer; + PRINT1( _L( "Camera <> CCamZoomPane::StartTouchZoomL (base) %d" ), base ); + + // Target zoom level + iTrgZoom = base * KDivisorFactor / pixelsPerStep; + iTrgZoom = ( iTrgZoom < iMinZoom )? iMinZoom:iTrgZoom; + iTrgZoom = ( iTrgZoom > iMaxZoom )? iMaxZoom:iTrgZoom; + PRINT1( _L( "Camera <> CCamZoomPane::StartTouchZoomL (iTrgZoom) %d" ), iTrgZoom ); + + // Only update zoom when necessary + if ( Abs( aPointer - iPointerPrevi ) >= pixelsPerStep / KDivisorFactor && + iTrgZoom != iCurZoom ) + { + PRINT( _L( "Camera <> CCamZoomPane::StartTouchZoomL ZoomTo" ) ); + iModel->ZoomTo( iTrgZoom ); + iPointerPrevi = aPointer; + PRINT( _L( "Camera <= CCamZoomPane::StartTouchZoomL ETrue" ) ); + return ETrue; + } + + // Pointer didn't move, so we don't need to update anything + PRINT( _L( "Camera <= CCamZoomPane::StartTouchZoomL EFalse" ) ); + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CCamZoomPane::HandlePointerEventL +// ----------------------------------------------------------------------------- +// +TBool CCamZoomPane::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + PRINT( _L( "Camera => CCamZoomPane::HandlePointerEventL" ) ); + + if ( PaneOrientation() != EZPOrientationVertical ) + { + PRINT( _L( "Camera <= CCamZoomPane::HandlePointerEventL (orientation)" ) ); + return EFalse; // EZPOrientationHorizontal not supported + } + + TRect tchZoomArea = iSliderParentRect; + tchZoomArea.Grow( KTouchAreaExpansion, KTouchAreaExpansion ); + TPointerEvent::TType type = aPointerEvent.iType; + + // Only make the pane appear on first touch + if( !IsVisible() && + type == TPointerEvent::EButton1Down ) + { + Touchfeedback(); + StopZoom(); + MakeVisible( ETrue, ETrue ); + PRINT( _L( "Camera <= CCamZoomPane::HandlePointerEventL (first touch)" ) ); + return ETrue; + } + + // At this point, the zoom pane should have already been visible + // so we activate touch zoom if the pointer is on the zoom pane + if ( IsVisible() && + tchZoomArea.Contains( aPointerEvent.iPosition ) && + type == TPointerEvent::EButton1Down ) + { + Touchfeedback(); + // Change zoom thumb to non-dimmed + iIconZoomMarkerCurrent = iIconZoomMarkerGray[0]; // Dimmed knob + // Force redraw of zoom pane, so knob will be dimmed + TBool ret = ETrue; + // Update zoom position, if necessary + StartTouchZoomL( aPointerEvent.iPosition.iY ); + PRINT( _L( "Camera <= CCamZoomPane::HandlePointerEventL (touch active)" ) ); + return ret; + } + + // If the zoom panel is visible, but the touch event is not in the + // zoom area, then make the zoom pane disappear. + if ( IsVisible() && + !tchZoomArea.Contains( aPointerEvent.iPosition ) && + type == TPointerEvent::EButton1Down ) + { + Touchfeedback(); + // Cancel zoom if user is pushing the volume key + StopZoom(); + // Hide zoom pane + MakeVisible( EFalse, ETrue ); + PRINT( _L( "Camera <= CCamZoomPane::HandlePointerEventL (make disappear)" ) ); + // return EFalse so the calling component doesn't reactivate the zoom pane + return EFalse; + } + + // Only allow drag if the zoom is already active + if ( type == TPointerEvent::EDrag && + iTouchActive ) + { + TBool ret = StartTouchZoomL( aPointerEvent.iPosition.iY ); + PRINT( _L( "Camera <= CCamZoomPane::HandlePointerEventL (dragging)" ) ); + return ret; + } + + // Clean up when the touch events are stopped + if ( type == TPointerEvent::EButton1Up ) + { + // don't do anything for stray touches + if ( iTouchActive ) + { + // Key events are no longer blocked + iTouchActive = EFalse; + // Change zoom thumb to non-dimmed + iIconZoomMarkerCurrent = iIconZoomMarker[0]; + // force redraw of zoom pane, so knob is not dimmed anymore + MakeVisible( ETrue, ETrue ); + PRINT( _L( "Camera <= CCamZoomPane::HandlePointerEventL (touch stopped)" ) ); + return ETrue; + } + + PRINT( _L( "Camera <= CCamZoomPane::HandlePointerEventL (touch not active)" ) ); + return EFalse; + } + + PRINT( _L( "Camera <= CCamZoomPane::HandlePointerEventL (not handled)" ) ); + return EFalse; + } + +// --------------------------------------------------------- +// CCamZoomPane::SizeChanged +// Called when the view size is changed +// --------------------------------------------------------- +// +void CCamZoomPane::SizeChanged() + { + PRINT( _L( "Camera => CCamZoomPane::SizeChanged" ) ); + if ( CamUtility::IsNhdDevice() ) + { + TouchLayout(); + } + else + { + NonTouchLayout(); + } + + PRINT( _L( "Camera <= CCamZoomPane::SizeChanged" ) ); + } + +// --------------------------------------------------------- +// CCamZoomPane::TouchLayout +// --------------------------------------------------------- +void CCamZoomPane::TouchLayout() + { + PRINT( _L( "Camera => CCamZoomPane::TouchLayout()" ) ); + TRect mainPaneRect; + iMaxOffset = 0; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, + mainPaneRect ); + mainPaneRect.Move( -mainPaneRect.iTl ); + + TInt variant = Layout_Meta_Data::IsLandscapeOrientation(); + TAknWindowComponentLayout l = AknLayoutScalable_Apps::cam4_zoom_pane(variant); + + TAknLayoutRect area; + area.LayoutRect( mainPaneRect, l.LayoutLine() ); + iZoomPaneRect = area.Rect(); + + l = AknLayoutScalable_Apps::cam4_zoom_cont_pane(variant); + area.LayoutRect( iZoomPaneRect, l.LayoutLine() ); + iSliderParentRect = area.Rect(); + + l = AknLayoutScalable_Apps::cam4_zoom_pane_g1(variant); // + + area.LayoutRect( iZoomPaneRect, l.LayoutLine() ); + AknIconUtils::SetSize( iIconZoomMax[0], area.Rect().Size(), + EAspectRatioNotPreserved ); + iPlusPoint = area.Rect().iTl; + + l = AknLayoutScalable_Apps::cam4_zoom_pane_g2(variant); // - + area.LayoutRect( iZoomPaneRect, l.LayoutLine() ); + AknIconUtils::SetSize( iIconZoomMin[0], area.Rect().Size(), + EAspectRatioNotPreserved ); + iMinusPoint = area.Rect().iTl; + + l = AknLayoutScalable_Apps::cam4_zoom_cont_pane_g1(variant); // Top + area.LayoutRect( iSliderParentRect, l.LayoutLine() ); + AknIconUtils::SetSize( iIconZoomTop[0], area.Rect().Size(), + EAspectRatioNotPreserved ); + iTopPoint = area.Rect().iTl; + iMaxOffset += area.Rect().Height(); + + l = AknLayoutScalable_Apps::cam4_zoom_cont_pane_g3(variant); // Middle + area.LayoutRect( iSliderParentRect, l.LayoutLine() ); + iIconZoomMiddle[0]->Resize( area.Rect().Size()); + AknIconUtils::SetSize( iIconZoomMiddle[0], area.Rect().Size(), + EAspectRatioNotPreserved ); + iMiddlePoint = area.Rect().iTl; + iMaxOffset += area.Rect().Height(); + + l = AknLayoutScalable_Apps::cam4_zoom_cont_pane_g2(variant); // Bottom + area.LayoutRect( iSliderParentRect, l.LayoutLine() ); + AknIconUtils::SetSize( iIconZoomBottom[0], area.Rect().Size(), + EAspectRatioNotPreserved ); + iBottomPoint = area.Rect().iTl; + TRect bottomRect = area.Rect(); + iMaxOffset += area.Rect().Height(); + + l = AknLayoutScalable_Apps::cam4_zoom_pane_g3(variant); // Knob + area.LayoutRect(iSliderParentRect, l.LayoutLine() ); + TRect adj = iZoomPaneRect; + adj.SetHeight( area.Rect().Height() ); + adj.Move( bottomRect.Center() - adj.Center() ); + AknIconUtils::SetSize( iIconZoomMarker[0], adj.Size() ); + AknIconUtils::SetSize( iIconZoomMarkerGray[0], adj.Size() ); + + } + +// --------------------------------------------------------- +// CCamZoomPane::NonTouchLayout +// --------------------------------------------------------- +void CCamZoomPane::NonTouchLayout() + { + TRect mainPaneRect; + iMaxOffset = 0; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, + mainPaneRect ); + mainPaneRect.Move( -mainPaneRect.iTl ); + + TInt variant = Layout_Meta_Data::IsLandscapeOrientation(); + + TAknWindowComponentLayout l = AknLayoutScalable_Apps::cam6_zoom_pane(variant); + + TAknLayoutRect area; + area.LayoutRect( mainPaneRect, l.LayoutLine() ); + iZoomPaneRect = area.Rect(); + + l = AknLayoutScalable_Apps::cam6_zoom_cont_pane(variant); + area.LayoutRect( iZoomPaneRect, l.LayoutLine() ); + iSliderParentRect = area.Rect(); + + l = AknLayoutScalable_Apps::cam6_zoom_pane_g1(variant); // + + area.LayoutRect( iZoomPaneRect, l.LayoutLine() ); + AknIconUtils::SetSize( iIconZoomMax[0], area.Rect().Size(), + EAspectRatioNotPreserved ); + iPlusPoint = area.Rect().iTl; + + l = AknLayoutScalable_Apps::cam6_zoom_pane_g2(variant); // - + area.LayoutRect( iZoomPaneRect, l.LayoutLine() ); + AknIconUtils::SetSize( iIconZoomMin[0], area.Rect().Size(), + EAspectRatioNotPreserved ); + iMinusPoint = area.Rect().iTl; + + l = AknLayoutScalable_Apps::cam6_zoom_cont_pane_g1(variant); // Top + area.LayoutRect( iSliderParentRect, l.LayoutLine() ); + AknIconUtils::SetSize( iIconZoomTop[0], area.Rect().Size(), + EAspectRatioNotPreserved ); + iTopPoint = area.Rect().iTl; + iMaxOffset += area.Rect().Height(); + + l = AknLayoutScalable_Apps::cam6_zoom_cont_pane_g3(variant); // Middle + area.LayoutRect( iSliderParentRect, l.LayoutLine() ); + iIconZoomMiddle[0]->Resize( area.Rect().Size()); + AknIconUtils::SetSize( iIconZoomMiddle[0], area.Rect().Size(), + EAspectRatioNotPreserved ); + iMiddlePoint = area.Rect().iTl; + iMaxOffset += area.Rect().Height(); + + l = AknLayoutScalable_Apps::cam6_zoom_cont_pane_g2(variant); // Bottom + area.LayoutRect( iSliderParentRect, l.LayoutLine() ); + AknIconUtils::SetSize( iIconZoomBottom[0], area.Rect().Size(), + EAspectRatioNotPreserved ); + iBottomPoint = area.Rect().iTl; + TRect bottomRect = area.Rect(); + iMaxOffset += area.Rect().Height(); + + l = AknLayoutScalable_Apps::cam6_zoom_pane_g3(variant); // Knob + area.LayoutRect(iSliderParentRect, l.LayoutLine() ); + iZoomPaneRect.iTl.iX += area.Rect().Width()/2; + AknIconUtils::SetSize( iIconZoomMarker[0], area.Rect().Size() ); + AknIconUtils::SetSize( iIconZoomMarkerGray[0], area.Rect().Size() ); + } + +// --------------------------------------------------------- +// CCamZoomPane::Touchfeedback +// --------------------------------------------------------- +// +void CCamZoomPane::Touchfeedback() + { + PRINT( _L( "Camera => CCamZoomPane::Touchfeedback" ) ); + if ( iFeedback ) + { + iFeedback->InstantFeedback( iRecordingVideo? + ETouchFeedbackNone : ETouchFeedbackBasic ); + } + PRINT( _L( "Camera <= CCamZoomPane::Touchfeedback" ) ); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/CamZoomUpdateManager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/CamZoomUpdateManager.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ???????????????? +* +*/ + + + +//INCLUDES +#include "CamZoomUpdateManager.h" +#include "CamUtility.h" +#include "CameraUiConfigManager.h" + + + +//MACROS + +// Cooldown period inbetween camera driver updates +const TInt KCamZoomCooldown = 200000; // .2 seconds +const TInt KCamMaxZoomCooldown = 250000; // .25 seconds + + +// ====================== MEMBER FUNCTIONS ===================== + +// ----------------------------------------------------------------------------- +// CCamZoomUpdateManager::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamZoomUpdateManager* CCamZoomUpdateManager::NewL( CCamAppController& aController ) + { + PRINT((_L("CCamZoomUpdateManager::NewL in"))); + CCamZoomUpdateManager* self = new(ELeave) CCamZoomUpdateManager( aController ); + CleanupStack::PushL(self); + self->ConstructL (); + CleanupStack::Pop(); + PRINT((_L("CCamZoomUpdateManager::NewL out"))); + return self; + } + + +// ----------------------------------------------------------------------------- +// CCamZoomUpdateManager::CCamZoomUpdateManager +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamZoomUpdateManager::CCamZoomUpdateManager( CCamAppController& aController ) : + CActive( /*EPriorityStandard*/ EPriorityUserInput ), + iController( aController ) + { + iDelayedUpdate = EFalse; + } + +// ----------------------------------------------------------------------------- +// CCamZoomUpdateManager::~CCamZoomUpdateManager +// Destructor. +// ----------------------------------------------------------------------------- +// + +CCamZoomUpdateManager::~CCamZoomUpdateManager() +{ + PRINT((_L("CCamZoomUpdateManager::~CCamZoomUpdateManager() in"))); + Cancel(); + iTimer.Close(); + PRINT((_L("CCamZoomUpdateManager::~CCamZoomUpdateManager() out"))); +} + +// ----------------------------------------------------------------------------- +// CCamZoomUpdateTimer::ConstructL +// Symbian 2nd phase constructor. +// ----------------------------------------------------------------------------- +// +void CCamZoomUpdateManager::ConstructL() + { + PRINT((_L("CCamZoomUpdateManager::ConstructL() in"))); + TRAPD( err, ReadDelayValuesL() ); + if( err ) + { + PRINT((_L("CCamZoomUpdateManager::ConstructL() error in reading delay values"))); + } + User::LeaveIfError(iTimer.CreateLocal()); + CActiveScheduler::Add(this); + PRINT((_L("CCamZoomUpdateManager::ConstructL() out"))); + } + +// ----------------------------------------------------------------------------- +// CCamZoomUpdateManager::SetZoomValue +// +// ----------------------------------------------------------------------------- +// +void CCamZoomUpdateManager::SetZoomValue( TInt aValue ) + { + PRINT((_L("CCamZoomUpdateManager::SetZoomValue() => in"))); + + // PUT IN MUTEX???? + + // update value + iValue = aValue; + + if ( IsActive() ) + { + // check for starvation + TTime current; + current.UniversalTime(); + TInt64 delay = current.MicroSecondsFrom(iCooldownStart).Int64(); + + if ( delay > iCamMaxZoomCooldown ) + { + PRINT((_L("CCamZoomUpdateManager::SetZoomValue() <> IsActive, starved"))); + + // force update if active object is starved + Cancel(); + UpdateAndStartWait(); + } + else + { + PRINT((_L("CCamZoomUpdateManager::SetZoomValue() <> IsActive, updating iValue"))); + + // set the delayed update flag and wait + iDelayedUpdate = ETrue; + } + } + else + { + PRINT((_L("CCamZoomUpdateManager::SetZoomValue() <> IsNotActive, setting zoom"))); + + // notify controller and set active + UpdateAndStartWait(); + } + + PRINT((_L("CCamZoomUpdateManager::SetZoomValue() <= out"))); + } + +// ----------------------------------------------------------------------------- +// CCamZoomUpdateManager::UpdateAndStartWait +// +// ----------------------------------------------------------------------------- +// +void CCamZoomUpdateManager::UpdateAndStartWait() + { + // update cooldown start time + iCooldownStart.UniversalTime(); + + // reset delayed update flag + iDelayedUpdate = EFalse; + + // notify iController + iController.SetZoomValue( iValue ); + + // activate cooldown period + SetActive(); + iTimer.After( iStatus, iCamZoomCooldown ); + } + +// ----------------------------------------------------------------------------- +// CCamZoomUpdateManager::RunL +// +// ----------------------------------------------------------------------------- +// +void CCamZoomUpdateManager::RunL() + { + PRINT((_L("CCamZoomUpdateManager::RunL() in"))); + + //PUT IN MUTEX?? + + if ( iDelayedUpdate ) + { + // notify controller and set active + UpdateAndStartWait(); + } + + PRINT((_L("CCamZoomUpdateManager::RunL() out"))); + } + +// ----------------------------------------------------------------------------- +// CCamZoomUpdateManager::DoCancel +// Cancels the timer +// ----------------------------------------------------------------------------- +// +void CCamZoomUpdateManager::DoCancel() + { + PRINT((_L("CCamZoomUpdateManager::DoCancel() in"))); + // cancel the timer + iTimer.Cancel(); + PRINT((_L("CCamZoomUpdateManager::DoCancel() out"))); + } + +// ----------------------------------------------------------------------------- +// CCamZoomUpdateManager::ReadDelayValuesL +// Gets delay values from cenrep +// ----------------------------------------------------------------------------- +// +void CCamZoomUpdateManager::ReadDelayValuesL() + { + // default values are used in case of error + iCamZoomCooldown = KCamZoomCooldown; + iCamMaxZoomCooldown = KCamMaxZoomCooldown; + RArray delayValues; + if( iController.UiConfigManagerPtr() ) + { + iController.UiConfigManagerPtr()->SupportedZoomDelaysL( delayValues ); + iCamZoomCooldown = delayValues[0]*1000; + iCamMaxZoomCooldown = delayValues[1]*1000; + } + } +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/Camdefaultnamesettingpage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/Camdefaultnamesettingpage.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting item page for default name (text/date).* +*/ + + + +// INCLUDE FILES +#include "Camdefaultnamesettingpage.h" +#include "CamUtility.h" +#include "CamAppUi.h" + +#include +#include + +#include +#include + +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// CCamDefaultNameSettingPage::CCamDefaultNameSettingPage +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamDefaultNameSettingPage::CCamDefaultNameSettingPage( + TDes& aNameBase, + TCamCameraMode aMode, + const TDesC* aSettingTitleText, + TInt aSettingNumber, + TInt aControlType, + TInt aEditorResourceId, + TInt aSettingPageResourceId, + MAknQueryValue& aQueryValue ) + : CAknPopupSettingPage( aSettingTitleText, aSettingNumber, + aControlType, aEditorResourceId, + aSettingPageResourceId, + aQueryValue ), + iNameBase( aNameBase ), + iMode( aMode ) + { + } + + +// --------------------------------------------------------------------------- +// CCamDefaultNameSettingPage::~CCamDefaultNameSettingPage +// Destructor. +// --------------------------------------------------------------------------- +// +CCamDefaultNameSettingPage::~CCamDefaultNameSettingPage() + { + } + + +// --------------------------------------------------------------------------- +// CCamDefaultNameSettingPage::OkToExitL +// Check if the name base value is ok, so the user can +// exit the setting page. +// --------------------------------------------------------------------------- +// +TBool CCamDefaultNameSettingPage::OkToExitL( TBool aAccept ) + { + if ( aAccept ) + { + iTempNameBase = iNameBase; + + if ( QueryValue()->CurrentValueIndex() == ECamNameBaseText ) + { + // Ensure application is in editing orientation + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + TInt editingOrientation = CAknAppUiBase::EAppUiOrientationUnspecified; + TInt error = CamUtility::GetPsiInt( ECamPsiEditingOrientation, editingOrientation ); + if ( !error ) + { + appUi->SwitchOrientationIfRequiredL( editingOrientation ); + } + // Show the editor dialog + TBool editorRet = EFalse; + // Trap this to make sure the orientation is reverted back to normal + TRAPD( leaveErr, editorRet = ShowEditorDialogL() ) + appUi->SwitchOrientationIfRequiredL( CAknAppUiBase::EAppUiOrientationUnspecified ); + User::LeaveIfError( leaveErr ); + return editorRet; + } + } + return ETrue; + } + +// --------------------------------------------------------------------------- +// CCamDefaultNameSettingPage::ShowEditorDialogL +// Display the text editor dialog +// --------------------------------------------------------------------------- +// +TBool CCamDefaultNameSettingPage::ShowEditorDialogL() + { + TBool done = EFalse; + while ( !done ) + { + // Show data query + HBufC* prompt = NULL; + if ( ECamControllerVideo == iMode ) + { + prompt = StringLoader::LoadLC( R_CAM_QUERY_DEFAULT_VIDEO_NAME ); + } + else + { + prompt = StringLoader::LoadLC( R_CAM_QUERY_DEFAULT_IMAGE_NAME ); + } + + CAknTextQueryDialog* nameQuery = + CAknTextQueryDialog::NewL( iTempNameBase ); + + nameQuery->SetMaxLength( KMaxNameBaseLength ); + nameQuery->PrepareLC( R_CAM_RENAME_QUERY ); + nameQuery->SetPromptL( *prompt ); + + TBool res = ( nameQuery->RunLD() == EAknSoftkeyOk ); + + CleanupStack::PopAndDestroy(); // prompt + + if ( !res ) + { + // User cancelled the query, return to setting page + return EFalse; + } + + // Check base name validity + res = CamUtility::CheckFileNameValidityL( iTempNameBase ); + + if ( res ) + { + // New name base was valid, exit setting page + iNameBase = iTempNameBase; + return res; + } + + // Show data query again + } + // should never get here + return EFalse; + } +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/audioplayer/camaudioplayercontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/audioplayer/camaudioplayercontroller.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,631 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Controller for Sound / Tone Wrappers +* +*/ + + + +// =========================================================================== +// includes +#include +#include // CAknAppUi +#include // CAknKeySoundSystem + +#include +#include + +#include "camlogging.h" + +#include "CamSettingsInternal.hrh" // TCamCameraMode, TCamSettingItemIds +#include "CamAppController.h" +#include "mcamplayerobserver.h" +#include "mcamplayerwrapper.h" +#include "camaudioplayerwrapper.h" +#include "camtoneplayerwrapper.h" +#include "camaudioplayercontroller.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "camaudioplayercontrollerTraces.h" +#endif + + + +// =========================================================================== +// Constants +namespace NCamAudioPlayerController + { + static const TInt KImageCaptureSoundId = KMinTInt; + + + // Cached sounds which are loaded once entering image mode. + // No need to include capture sound, it is selected based + // on the setting. + static const TInt KImageCachedSounds[] = + { + // Our own id for image capture sound, + // which can change. + // Also avoid compilation error, if AF beep not supported. + KImageCaptureSoundId, + ECamAutoFocusComplete + }; + + // Cached sounds which are loaded once entering video mode. + static const TInt KVideoCachedSounds[] = + { + ECamVideoStartSoundId, + ECamVideoStopSoundId, + ECamVideoPauseSoundId, + ECamVideoResumeSoundId + }; + } + +using namespace NCamAudioPlayerController; + +// =========================================================================== +// public constructors and destructor + +// --------------------------------------------------------------------------- +// NewL <> +// --------------------------------------------------------------------------- +// +CCamAudioPlayerController* +CCamAudioPlayerController::NewL( CCamAppController& aController, + MCamPlayerObserver& aObserver ) + { + CCamAudioPlayerController* self = + new (ELeave) CCamAudioPlayerController( aController, aObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// destructor <> +// --------------------------------------------------------------------------- +// +CCamAudioPlayerController::~CCamAudioPlayerController() + { + iController.RemoveControllerObserver( this ); + iController.RemoveSettingsObserver( this ); + + Reset(); + iPlayers.Close(); + + iKeySoundSystem = NULL; // not own + } + + + + +// =========================================================================== +// From MCamControllerObserver + +// --------------------------------------------------------------------------- +// HandleControllerEventL <> +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController +::HandleControllerEventL( TCamControllerEvent aEvent, + TInt aError ) + { + PRINT( _L("Camera => CCamAudioPlayerController::HandleControllerEventL") ); + switch( aEvent ) + { + case ECamEventEngineStateChanged: + { + PRINT( _L("Camera <> CCamAudioPlayerController: case ECamEventEngineStateChanged") ); + if( KErrNone == aError ) + { + TCamCameraMode mode = iController.CurrentMode(); + PRINT2( _L("Camera <> CCamAudioPlayerController: KErrNone, old mode[%s] new mode[%s]"), KCamModeNames[iCameraMode], KCamModeNames[mode] ); + if( mode != iCameraMode ) + { + // Changing to video or image mode. + // Cache the players needed. + // If this fails we just retry once a sound is really needed. + if ( ECamControllerImage == mode + || ECamControllerVideo == mode ) { Setup( mode ); } + // Changing to shutdown mode + // Release all players. + else if( ECamControllerShutdown == mode || ECamControllerIdle == mode ) + { + Setup( mode ); + } + // Other mode entered, no action + else { /* no action */ } + } + } + else + { + PRINT1( _L("Camera <> CCamAudioPlayerController: error in (%d), call Reset.."), aError ); + Reset(); + } + break; + } + + default: + { + break; + } + } + PRINT( _L("Camera <= CCamAudioPlayerController::HandleControllerEventL") ); + } + + + +// =========================================================================== +// From MCamSettingsModelObserver + +// --------------------------------------------------------------------------- +// IntSettingChangedL <> +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController +::IntSettingChangedL( TCamSettingItemIds aSettingItem, + TInt /*aSettingValue*/ ) + { + PRINT( _L("Camera => CCamAudioPlayerController::IntSettingChangedL") ); + switch( aSettingItem ) + { + case ECamSettingItemPhotoCaptureTone: + { + PRINT( _L("Camera <> CCamAudioPlayerController: case ECamSettingItemPhotoCaptureTone") ); + + // The setting value is *not* of TCamSoundId type. + // See CCamAppController::CaptureToneId(). + const TCamSoundId newSoundId = iController.CaptureToneId(); + SetupCaptureSoundPlayerL( newSoundId ); + + break; + } + default: + { + break; + } + } + + PRINT( _L("Camera <= CCamAudioPlayerController::IntSettingChangedL") ); + } + + +// --------------------------------------------------------------------------- +// TextSettingChangedL <> +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController +::TextSettingChangedL( TCamSettingItemIds /*aSettingItem*/, + const TDesC& /*aSettingValue*/ ) + { + // these events are ignored + } + + + +// =========================================================================== +// new public + +// --------------------------------------------------------------------------- +// PlaySound +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::PlaySound( TInt aSoundId, + TBool aCallback ) + { + TRAPD( status, + { + // Get cached player, if available. + // Otherwise create new one. + CCamPlayerWrapperBase* player = GetPlayerL( aSoundId ); + player->Play( aCallback ); + }); + + if( KErrNone != status ) + { + if( KErrNoMemory == status ) + { + // If OOM, release all players. + // Create new ones again when needed. + Reset(); + } + if( aCallback ) + { + // If could not instantiate a player, notify observer right away. + iObserver.PlayComplete( status, aSoundId ); + } + } + } + + +// --------------------------------------------------------------------------- +// PlayTone +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::PlayTone( TInt aToneInHz, + TInt aLengthInUs, + TReal32 aVolumeInPercent, + TBool aCallback ) + { + TInt status( KErrNone ); + + if( !iTonePlayer ) + { + TRAP( status, iTonePlayer = CCamTonePlayerWrapper::NewL( iObserver ) ); + } + + if( KErrNone == status ) + { + iTonePlayer->PlayTone( aToneInHz, aLengthInUs, aVolumeInPercent, aCallback ); + } + else + { + if( aCallback ) + iObserver.PlayComplete( status, -1 ); + } + } + + +// --------------------------------------------------------------------------- +// CancelAllPlaying +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::CancelAllPlaying() + { + PRINT( _L("Camera => CCamAudioPlayerController::CancelAllPlaying") ); + + if( iTonePlayer ) + { + iTonePlayer->CancelPlay(); + } + for( TInt i = 0; i < iPlayers.Count(); i++ ) + { + iPlayers[i]->CancelPlay(); + } + + PRINT( _L("Camera <= CCamAudioPlayerController::CancelAllPlaying") ); + } + +// --------------------------------------------------------------------------- +// CancelPlaying +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::CancelPlaying( TInt aSoundId ) + { + TInt index = FindPlayerIndex( aSoundId ); + if( KErrNotFound != index ) + { + CCamPlayerWrapperBase* player = iPlayers[index]; + player->CancelPlay(); + } + } + + +// --------------------------------------------------------------------------- +// InitKeySoundSystem +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::InitKeySoundSystem() + { + PRINT( _L("Camera => CCamAudioPlayerController::InitKeySoundSystem") ); + iKeySoundSystem = static_cast( CEikonEnv::Static()->AppUi() )->KeySounds(); + /* No sounds played via iKeySoundSystem. No need to add sound list. + if( !iKeySoundSystem ) + { + iKeySoundSystem = static_cast( CEikonEnv::Static()->AppUi() )->KeySounds(); + if ( iKeySoundSystem ) + { + TRAPD( status, iKeySoundSystem->AddAppSoundInfoListL( R_CAM_SOUND_LIST ) ); + PRINT1( _L("Camera <> CCamAudioPlayerController: status:%d"), status ); + if( KErrNone != status + && KErrAlreadyExists != status + ) + { + // Set unusable + iKeySoundSystem = NULL; + } + } + } + */ + PRINT( _L("Camera <= CCamAudioPlayerController::InitKeySoundSystem") ); + } + +// --------------------------------------------------------------------------- +// EnableAllKeySounds +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::EnableAllKeySounds() + { + if ( iKeySoundSystem && iKeySoundsDisabled ) + { + iKeySoundSystem->ReleaseContext(); + iKeySoundSystem->PopContext(); + iKeySoundsDisabled = EFalse; + } + } + + +// --------------------------------------------------------------------------- +// DisableAllKeySoundsL +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::DisableAllKeySoundsL() + { + if ( iKeySoundSystem && !iKeySoundsDisabled ) + { + iKeySoundSystem->PushContextL( R_AVKON_SILENT_SKEY_LIST ); + iKeySoundSystem->BringToForeground(); + iKeySoundSystem->LockContext(); + iKeySoundsDisabled = ETrue; + } + } + + + + +// =========================================================================== +// new private + +// --------------------------------------------------------------------------- +// FindPlayerIndex +// --------------------------------------------------------------------------- +// +TInt +CCamAudioPlayerController::FindPlayerIndex( TInt aSoundId ) const + { + TInt found = KErrNotFound; + + // Check that id is valid. + if( aSoundId > 0 ) + { + TInt current = iPlayers.Count(); + while( --current >= 0 ) + { + // Reuse player, if the sound is the same despite + // sound id being different. + // if( aSoundId == iPlayers[current]->Id() ) + if( iPlayers[current]->IsEqualSound( aSoundId ) ) + { + found = current; + current = -1; + } + } + } + return found; + } + +// --------------------------------------------------------------------------- +// GetPlayerL +// --------------------------------------------------------------------------- +// +CCamPlayerWrapperBase* +CCamAudioPlayerController::GetPlayerL( TInt aSoundId ) + { + PRINT1( _L("Camera => CCamAudioPlayerController::GetPlayerL, sound id:%d"), aSoundId ); + CCamPlayerWrapperBase* player( NULL ); + + if( KImageCaptureSoundId == aSoundId ) + { + player = GetPlayerL( iController.CaptureToneId() ); + } + else + { + TInt index = FindPlayerIndex( aSoundId ); + + if( KErrNotFound != index ) + { + player = iPlayers[index]; + } + else + { + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAUDIOPLAYERCONTROLLER_GETPLAYERL, "e_CAM_APP_CAPTURE_SOUND_LOAD 1" ); //CCORAPP_CAPTURE_SOUND_LOAD_START + + player = CCamAudioPlayerWrapper::NewL( iObserver, aSoundId ); + + CleanupStack::PushL( player ); + iPlayers.AppendL( player ); + CleanupStack::Pop( player ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMAUDIOPLAYERCONTROLLER_GETPLAYERL, "e_CAM_APP_CAPTURE_SOUND_LOAD 0" ); //CCORAPP_CAPTURE_SOUND_LOAD_END + } + } + + PRINT( _L("Camera <= CCamAudioPlayerController::GetPlayerL") ); + return player; + } + + + +// --------------------------------------------------------------------------- +// RemovePlayer +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::RemovePlayer( TInt aSoundId ) + { + TInt index = FindPlayerIndex( aSoundId ); + if( KErrNotFound != index ) + { + CCamPlayerWrapperBase* player = iPlayers[index]; + iPlayers.Remove( index ); + delete player; + player = NULL; + } + } + +// --------------------------------------------------------------------------- +// Setup +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::Setup( TCamCameraMode aCameraMode ) + { + PRINT( _L("Camera => CCamAudioPlayerController::Setup") ); + Reset(); + + TInt status( KErrNone ); + switch( aCameraMode ) + { + case ECamControllerImage: + { + TRAP( status, SetupForImageL() ); + break; + } + + case ECamControllerVideo: + { + TRAP( status, SetupForVideoL() ); + break; + } + + case ECamControllerIdle: + case ECamControllerShutdown: + default: + { + // Already reset, no sounds needed now. + break; + } + } + + // If any problems, try reload sounds once really needed, so reset now. + if( KErrNone != status ) + Reset(); + else + iCameraMode = aCameraMode; + + PRINT( _L("Camera <= CCamAudioPlayerController::Setup") ); + } + +// --------------------------------------------------------------------------- +// SetupForVideoL +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::SetupForVideoL() + { + PRINT( _L("Camera => CCamAudioPlayerController::SetupForVideoL") ); + InitKeySoundSystem(); + + TInt count( sizeof( KVideoCachedSounds ) / sizeof( TInt ) ); + PRINT1( _L("Camera <> CCamAudioPlayerController: count of players to load: %d"), count ); + for( TInt i = 0; i < count; i++ ) + { + GetPlayerL( KVideoCachedSounds[i] ); + } + PRINT( _L("Camera <= CCamAudioPlayerController::SetupForVideoL") ); + } + +// --------------------------------------------------------------------------- +// SetupForImageL +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::SetupForImageL() + { + PRINT( _L("Camera => CCamAudioPlayerController::SetupForImageL") ); + TInt count( sizeof( KImageCachedSounds ) / sizeof( TInt ) ); + + PRINT1( _L("Camera <> CCamAudioPlayerController: count of players to load: %d"), count ); + for( TInt i = 0; i < count; i++ ) + { + GetPlayerL( KImageCachedSounds[i] ); + } + PRINT( _L("Camera => CCamAudioPlayerController::SetupForImageL") ); + } + +// --------------------------------------------------------------------------- +// SetupCaptureSoundPlayerL +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::SetupCaptureSoundPlayerL( TInt aNewSoundId ) + { + PRINT2( _L("Camera => CCamAudioPlayerController::SetupCaptureSoundPlayerL, old sound:%d new sound:%d"), iCaptureSoundId, aNewSoundId ); + + if( aNewSoundId != iCaptureSoundId ) + { + // Free old player, if exists. + RemovePlayer( iCaptureSoundId ); + + // If loading new fails, retry when sound is needed. + iCaptureSoundId = -1; + GetPlayerL( aNewSoundId ); + iCaptureSoundId = aNewSoundId; + } + PRINT ( _L("Camera <= CCamAudioPlayerController::SetupCaptureSoundPlayerL") ); + } + +// --------------------------------------------------------------------------- +// Reset +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::Reset() + { + PRINT ( _L("Camera => CCamAudioPlayerController::Reset") ); + iPlayers.ResetAndDestroy(); + + delete iTonePlayer; + iTonePlayer = NULL; + + iCameraMode = ECamControllerIdle; + iCaptureSoundId = -1; + PRINT ( _L("Camera <= CCamAudioPlayerController::Reset") ); + } + + + +// =========================================================================== +// private constructors + +// --------------------------------------------------------------------------- +// ConstructL +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerController::ConstructL() + { + iController.AddControllerObserverL( this ); + iController.AddSettingsObserverL( this ); + } + +// --------------------------------------------------------------------------- +// constructor +// --------------------------------------------------------------------------- +// +CCamAudioPlayerController +::CCamAudioPlayerController( CCamAppController& aController, + MCamPlayerObserver& aObserver ) + : iController ( aController ), + iObserver ( aObserver ), + iCameraMode ( ECamControllerIdle ), + iCaptureSoundId ( -1 ), + iKeySoundsDisabled( EFalse ) + { + } + +// =========================================================================== +// end of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/audioplayer/camaudioplayerwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/audioplayer/camaudioplayerwrapper.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,403 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Wrapper for Audio Player Utility +* +*/ + + +// =========================================================================== +// includes +#include +#include + +#include "Cam.hrh" +#include "CamPanic.h" +#include "camlogging.h" +#include "CamUtility.h" // for resource id's of sounds +#include "mcamplayerobserver.h" +#include "camaudioplayerwrapper.h" +#include "CamPerformance.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "camaudioplayerwrapperTraces.h" +#endif + + + +// =========================================================================== +// Constants + +// Migrated directly from old sound player. +#ifndef __WINSCW__ + static const TUint KAudioPriority = KAudioPriorityCameraTone; +#else + static const TUint KAudioPriority = KAudioPriorityVideoRecording; +#endif // __WINSCW__ + + +// =========================================================================== +// public constructors and destructor + +// --------------------------------------------------------------------------- +// NewL <> +// --------------------------------------------------------------------------- +// +CCamAudioPlayerWrapper* +CCamAudioPlayerWrapper::NewL( MCamPlayerObserver& aObserver, + TInt aSoundId ) + { + PRINT( _L("Camera => CCamAudioPlayerWrapper::NewL()") ); + CCamAudioPlayerWrapper* self = + new (ELeave) CCamAudioPlayerWrapper( aObserver, aSoundId ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + PRINT( _L("Camera <= CCamAudioPlayerWrapper::NewL()") ); + return self; + } + +// --------------------------------------------------------------------------- +// destructor <> +// --------------------------------------------------------------------------- +// +CCamAudioPlayerWrapper::~CCamAudioPlayerWrapper() + { + if( iPlayer ) + { + iPlayer->Stop(); + iPlayer->Close(); + delete iPlayer; + iPlayer = NULL; + } + } + + + +// =========================================================================== +// from CCamPlayerWrapperBase + +// --------------------------------------------------------------------------- +// Id <><> +// --------------------------------------------------------------------------- +// +TInt +CCamAudioPlayerWrapper::Id() const + { + return iSoundId; + } + +// --------------------------------------------------------------------------- +// IsEqualSound <><> +// +// Compare if two sounds are equal. +// If the ids or filenames match, the sounds are considered to be equal. +// --------------------------------------------------------------------------- +// +TBool +CCamAudioPlayerWrapper::IsEqualSound( TInt aSoundId ) const + { + TInt eq( EFalse ); + TRAP_IGNORE( + { + eq = aSoundId == iSoundId + || MapSoundId2FilenameL( aSoundId ) == MapSoundId2FilenameL( iSoundId ); + }); + return eq; + } + + +// --------------------------------------------------------------------------- +// Play <> +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerWrapper::Play( TBool aCallback ) + { + PRINT2( _L("Camera => CCamAudioPlayerWrapper::Play, callback:%d iState[%s]"), + aCallback, + KCamAudioPlayerWrapperStateNames[iState] ); + + switch( iState ) + { + case CCamAudioPlayerWrapper::EReady: + iPlayRequested = EFalse; + iState = CCamAudioPlayerWrapper::EPlaying; + iCallback = aCallback; + iPlayer->Play(); + break; + + case CCamAudioPlayerWrapper::EInitializing: + iPlayRequested = ETrue; + iCallback = aCallback; + break; + + case CCamAudioPlayerWrapper::ECorrupt: + // Notify observer rigth away as init has failed. + iCallback = aCallback; + NotifyPlayComplete( KErrCorrupt ); + break; + + case CCamAudioPlayerWrapper::EPlaying: + PRINT( _L("Camera <> WARNING: Still playing old sound, need to stop early") ); + iPlayer->Stop(); + // Notify observer that playing was interrupted (if callback was requested for previous play). + // Sets state to idle so that we are ready to play again. + NotifyPlayComplete( KErrAbort ); + // Now we can repeat the call as the state is right. + Play( aCallback ); + break; + case CCamAudioPlayerWrapper::EIdle: + default: + //Set state and ignore otherwise... + PRINT( _L("Camera <> CCamAudioPlayerWrapper::Play invalid state") ); + iState = CCamAudioPlayerWrapper::ECorrupt; + break; + } + + PRINT( _L("Camera <= CCamAudioPlayerWrapper::Play") ); + } + + +// --------------------------------------------------------------------------- +// CancelPlay <> +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerWrapper::CancelPlay() + { + PRINT1( _L("Camera => CCamAudioPlayerWrapper::CancelPlay, id:%d"), iSoundId ); + switch( iState ) + { + case CCamAudioPlayerWrapper::EPlaying: + PRINT( _L("Camera <> CCamAudioPlayerWrapper::CancelPlay .. iState == EPlaying, call Stop()..") ); + iPlayer->Stop(); + NotifyPlayComplete( KErrAbort ); + break; + default: + break; + } + + // Make sure pending Play() is cancelled. + iPlayRequested = EFalse; + PRINT( _L("Camera <= CCamAudioPlayerWrapper::CancelPlay") ); + } + + +// =========================================================================== +// from MMdaAudioPlayerCallback + +// --------------------------------------------------------------------------- +// MapcInitComplete <> +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerWrapper +::MapcInitComplete( TInt aStatus, + const TTimeIntervalMicroSeconds& /*aDuration*/ ) + { + PRINT2( _L("Camera => CCamAudioPlayerWrapper::MapcInitComplete, id:%d status:%d"), iSoundId, aStatus ); + if( KErrNone != aStatus ) + { + // If we encounter an error in init phase, + // we'll notify observer once Play gets called. + iState = CCamAudioPlayerWrapper::ECorrupt; + } + else + { + iState = CCamAudioPlayerWrapper::EReady; + } + + // If play has been called before init has finished + // try to play now. If we had an error in init, + // Play() will handle this based on iState. + if( iPlayRequested ) + { + Play( iCallback ); + } + PRINT( _L("Camera <= CCamAudioPlayerWrapper::MapcInitComplete") ); + } + +// --------------------------------------------------------------------------- +// MapcPlayComplete <> +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerWrapper::MapcPlayComplete( TInt aStatus ) + { + NotifyPlayComplete( aStatus ); + } + + + + +// =========================================================================== +// other public + +// --------------------------------------------------------------------------- +// MapSoundId2FilenameL <> +// --------------------------------------------------------------------------- +// +TPtrC +CCamAudioPlayerWrapper::MapSoundId2FilenameL( TInt aSoundId ) + { + PRINT1( _L("Camera => CCamAudioPlayerWrapper::MapSoundId2FilenameL, id:%d"), aSoundId ); + + TPtrC filename( KNullDesC ); + + switch( aSoundId ) + { + case ECamVideoStartSoundId: filename.Set( KCamVideoStartTone ); break; + case ECamVideoStopSoundId: filename.Set( KCamVideoStopTone ); break; + case ECamVideoPauseSoundId: filename.Set( KCamVideoPauseTone ); break; + case ECamVideoResumeSoundId: filename.Set( KCamVideoStartTone ); break; + case ECamAutoFocusFailed: User::Leave( KErrNotSupported ); break; + case ECamAutoFocusComplete: filename.Set( KCamAutoFocusComplete ); break; + case ECamStillCaptureSoundId1: filename.Set( KCamCaptureTone1 ); break; + case ECamStillCaptureSoundId2: filename.Set( KCamCaptureTone2 ); break; + case ECamStillCaptureSoundId3: filename.Set( KCamCaptureTone3 ); break; + case ECamStillCaptureSoundId4: filename.Set( KCamCaptureTone4 ); break; + case ECamBurstCaptureSoundId1: filename.Set( KCamBurstCaptureTone1 ); break; + case ECamBurstCaptureSoundId2: filename.Set( KCamBurstCaptureTone2 ); break; + case ECamBurstCaptureSoundId3: filename.Set( KCamBurstCaptureTone3 ); break; + case ECamBurstCaptureSoundId4: filename.Set( KCamBurstCaptureTone4 ); break; + + case ECamSelfTimerSoundId: User::Leave( KErrNotSupported ); break; + case ECamInCallToneId: User::Leave( KErrNotSupported ); break; + + default: + __ASSERT_DEBUG( EFalse, CamPanic( ECamPanicNotSupported ) ); + break; + } + + PRINT1( _L("Camera <= CCamAudioPlayerWrapper::MapSoundId2FilenameL, return [%S]"), &filename ); + return filename; + } + + + +// =========================================================================== +// other private + +// --------------------------------------------------------------------------- +// InitL +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerWrapper::InitL() + { + PRINT( _L("Camera => CCamAudioPlayerWrapper::InitL") ); + if( CCamAudioPlayerWrapper::EIdle == iState ) + { + iState = CCamAudioPlayerWrapper::EInitializing; + // Our process uses multiple players. Ensure they + // (or their internal controllers) share the same + // heap so we don't run out of memory chunks. + iPlayer->UseSharedHeap(); + iPlayer->OpenFileL( MapSoundId2FilenameL( iSoundId ) ); + } + else + { + CamPanic( ECamPanicInvalidState ); + PRINT( _L("Camera <> CCamAudioPlayerWrapper::InitL invalid state") ); + iState = CCamAudioPlayerWrapper::ECorrupt; + User::Leave(KErrCorrupt); + } + PRINT( _L("Camera <= CCamAudioPlayerWrapper::InitL") ); + } + + +// --------------------------------------------------------------------------- +// NotifyPlayComplete +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerWrapper::NotifyPlayComplete( TInt aStatus ) + { + PRINT1( _L("Camera => CCamAudioPlayerWrapper::NotifyPlayComplete, status:%d"), aStatus ); + switch( iState ) + { + // Problem initializing. + // Init is not tried again as it could slow down the capturing. + case CCamAudioPlayerWrapper::ECorrupt: + break; + + // Normal case where the playing has completed. + // Set state to EReady to indicate we are ready + // for new play request. + case CCamAudioPlayerWrapper::EPlaying: + iState = CCamAudioPlayerWrapper::EReady; + break; + + // Other states not allowed here. + default: + // Make this player ready that we can play new sound. + PRINT( _L("Camera <> CCamAudioPlayerWrapper::NotifyPlayComplete invalid state") ); + iState = CCamAudioPlayerWrapper::EReady; + break; + } + + // Clear flag just in case. + iPlayRequested = EFalse; + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMAUDIOPLAYERWRAPPER_NOTIFYPLAYCOMPLETE, "e_CAM_APP_CAPTURE_SOUND_PLAY 0" ); //CCORAPP_CAPTURE_SOUND_PLAY_END + + // Notify observer with our sound id and received status. + if( iCallback ) + iObserver.PlayComplete( aStatus, iSoundId ); + + PRINT( _L("Camera <= CCamAudioPlayerWrapper::NotifyPlayComplete") ); + } + +// =========================================================================== +// private constructors + +// --------------------------------------------------------------------------- +// ConstructL +// --------------------------------------------------------------------------- +// +void +CCamAudioPlayerWrapper::ConstructL() + { + PRINT( _L("Camera => CCamAudioPlayerWrapper::ConstructL()") ); + iPlayer = CMdaAudioPlayerUtility::NewL( + *this, + KAudioPriority , + TMdaPriorityPreference( KAudioPrefCamera ) ); + + InitL(); + PRINT( _L("Camera <= CCamAudioPlayerWrapper::ConstructL()") ); + } + + +// --------------------------------------------------------------------------- +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamAudioPlayerWrapper +::CCamAudioPlayerWrapper( MCamPlayerObserver& aObserver, + TInt aSoundId ) + : iObserver ( aObserver ), + iSoundId ( aSoundId ), + iPlayer ( NULL ), + iState ( CCamAudioPlayerWrapper::EIdle ), + iPlayRequested( EFalse ), + iCallback ( EFalse ) + { + } + +// =========================================================================== +// end of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/audioplayer/camtoneplayerwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/audioplayer/camtoneplayerwrapper.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,255 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Tone Wrapper implementation +* +*/ + + + +#include +#include + +#include "CamPanic.h" +#include "camlogging.h" +#include "mcamplayerobserver.h" +#include "camtoneplayerwrapper.h" + + + + +// =========================================================================== +// public constructors and destructor + +// --------------------------------------------------------------------------- +// NewL <> +// +// --------------------------------------------------------------------------- +// +CCamTonePlayerWrapper* +CCamTonePlayerWrapper::NewL( MCamPlayerObserver& aObserver ) + { + CCamTonePlayerWrapper* self = + new (ELeave) CCamTonePlayerWrapper( aObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// destructor <> +// +// --------------------------------------------------------------------------- +// +CCamTonePlayerWrapper::~CCamTonePlayerWrapper() + { + CancelPlay(); + + delete iTone; + iTone = NULL; + } + + +// =========================================================================== +// from MMdaAudioToneObserver + +// --------------------------------------------------------------------------- +// MatoPrepareComplete <> +// +// --------------------------------------------------------------------------- +// +void +CCamTonePlayerWrapper::MatoPrepareComplete( TInt aStatus ) + { + PRINT( _L("Camera => CCamTonePlayerWrapper::MatoPrepareComplete") ); + if( KErrNone == aStatus ) + { + iState = CCamTonePlayerWrapper::EPlaying; + iTone->Play(); +#ifdef __WINSCW__ + // The tone player does not give a callback on the emulator. + // Emulate a callback here. + MatoPlayComplete( KErrNone ); +#endif // __WINSCW__ + } + else if( iCallback ) + { + NotifyPlayComplete( aStatus ); + } + else + { + // No action + } + + PRINT( _L("Camera <= CCamTonePlayerWrapper::MatoPrepareComplete") ); + } + + +// --------------------------------------------------------------------------- +// MatoPlayComplete <> +// --------------------------------------------------------------------------- +// +void +CCamTonePlayerWrapper::MatoPlayComplete( TInt aStatus ) + { + NotifyPlayComplete( aStatus ); + } + + + +// =========================================================================== +// other public + +// --------------------------------------------------------------------------- +// PlayTone +// --------------------------------------------------------------------------- +// +void +CCamTonePlayerWrapper::PlayTone( TInt aToneInHz, + TInt aLengthInUs, + TReal32 aVolumeInPercent, + TBool aCallback ) + { + PRINT2( _L("Camera => CCamTonePlayerWrapper::PlayTone, callback:%d iState[%s]"), + aCallback, + KCamTonePlayerWrapperStateNames[iState] ); + + iCallback = aCallback; + + switch( iState ) + { + // --------------------------------- + case CCamTonePlayerWrapper::EIdle: + { + iState = CCamTonePlayerWrapper::EInitializing; + iTone->SetVolume( aVolumeInPercent * iTone->MaxVolume() ); + iTone->PrepareToPlayTone( aToneInHz, aLengthInUs ); + + break; + } + // --------------------------------- + case CCamTonePlayerWrapper::EInitializing: + case CCamTonePlayerWrapper::EPlaying: + { + // Do notification, if asked. + // This play request is simply skipped, + // as there's tone playing on the way right now. + if( aCallback ) + { + iObserver.PlayComplete( KErrInUse, -1 ); //iState-1 is another suggestion. + } + break; + } + default: + CamPanic( ECamPanicInvalidState ); + break; + // --------------------------------- + } + + PRINT( _L("Camera <= CCamAudioPlayerWrapper::Play") ); + } + + +// --------------------------------------------------------------------------- +// CancelPlay +// --------------------------------------------------------------------------- +// +void +CCamTonePlayerWrapper::CancelPlay() + { + if( iTone ) + { + switch( iState ) + { + case CCamTonePlayerWrapper::EPlaying: + iTone->CancelPlay(); + // Because of the observer callback function MMdaAudioToneObserver::MatoPrepareComplete() is not called, + // so set state to idle directly + iState = CCamTonePlayerWrapper::EIdle; + break; + case CCamTonePlayerWrapper::EInitializing: + iTone->CancelPrepare(); + // Because of the observer callback function MMdaAudioToneObserver::MatoPrepareComplete() is not called, + // so set state to idle directly + iState = CCamTonePlayerWrapper::EIdle; + break; + case CCamTonePlayerWrapper::EIdle: + default: + break; + } + } + } + + + +// =========================================================================== +// other private + +// --------------------------------------------------------------------------- +// NotifyPlayComplete +// --------------------------------------------------------------------------- +// +void +CCamTonePlayerWrapper::NotifyPlayComplete( TInt aStatus ) + { + PRINT( _L("Camera => CCamTonePlayerWrapper::NotifyPlayComplete") ); + + // Play is complete, return to idle state. + iState = CCamTonePlayerWrapper::EIdle; + + // Notify observer received status. + // Sound id is not usable here. + if( iCallback ) + iObserver.PlayComplete( aStatus, -1 ); + + PRINT( _L("Camera <= CCamTonePlayerWrapper::NotifyPlayComplete") ); + } + + + +// =========================================================================== +// private constructors + +// --------------------------------------------------------------------------- +// ConstructL +// --------------------------------------------------------------------------- +// +void +CCamTonePlayerWrapper::ConstructL() + { + iTone = CMdaAudioToneUtility::NewL( + *this, + NULL, + KAudioPriorityCameraTone, + TMdaPriorityPreference( KAudioPrefCamera ) ); + } + + +// --------------------------------------------------------------------------- +// constructor +// --------------------------------------------------------------------------- +// +CCamTonePlayerWrapper +::CCamTonePlayerWrapper( MCamPlayerObserver& aObserver ) + : iObserver ( aObserver ), + iTone ( NULL ), + iState ( CCamTonePlayerWrapper::EIdle ), + iCallback ( EFalse ) + { + } + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/camactivepalettehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/camactivepalettehandler.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,1607 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CamUtility.h" +#include "CamAppController.h" +#include "camactivepalettehandler.h" +#include "CamAppUid.h" +#include "CamCaptureSetupViewBase.h" +#include "CamAppUiBase.h" +#include "CamPanic.h" +#include "CamAppUi.h" +#include "CamUtility.h" +#include "CamTimeLapseUtility.h" +#include "CamPSI.h" +#include "CameraUiConfigManager.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "CamActivePaletteHandlerTraces.h" +#endif + + +typedef TAP2GenericPluginIcon TCamAPGenericPluginIcon; +typedef TAP2GenericPluginParams TCamAPGenericPluginParams; + +// ============================ CONSTANTS ====================================== + +// ActivePalette2 settings +const TActivePalette2DrawMode KActivePaletteDrawMode = EAP2DrawModeSemiTransparentTooltipModeFading; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::CCamActivePaletteHandler +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCamActivePaletteHandler::CCamActivePaletteHandler( CCamAppController& aController ) +: iController( aController ) + { + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::ConstructL( TBool aCreatePalette ) + { + if ( !iController.IsTouchScreenSupported() ) + { + iEnv = CEikonEnv::Static(); + + if( aCreatePalette ) + { + iActivePalette = + ActivePalette2Factory::CreateActivePaletteUIL( KActivePaletteDrawMode ); + iActivePalette->SetObserver( this ); + } + + // Get the icon file name + delete iIconFileName; + iIconFileName = NULL; + iIconFileName = HBufC::NewL( KMaxFileName ); + TPtr ptr = iIconFileName->Des(); + CamUtility::ResourceFileName( ptr ); + + + // get res id for EV comp from psi + CamUtility::GetPsiInt( ECamPsiAPEVCompLegend, iEvCompRes ); + if( iEvCompRes == KErrNotSupported ) + { + iEvCompRes = R_CAM_CAPTURE_SETUP_MENU_PHOTO_EXPOSURE_ARRAY; + } + } + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCamActivePaletteHandler* CCamActivePaletteHandler::NewL( CCamAppController& aController, TBool aCreatePalette ) + { + CCamActivePaletteHandler* self = new( ELeave ) CCamActivePaletteHandler( aController ); + + CleanupStack::PushL( self ); + self->ConstructL( aCreatePalette ); + CleanupStack::Pop(); + + return self; + } + + +// Destructor +CCamActivePaletteHandler::~CCamActivePaletteHandler() + { + PRINT( _L("Camera => ~CCamActivePaletteHandler") ); + delete iIconFileName; + iIconFileName = NULL; + + iItemArray.Close(); + + iCurrentValSettingsItem.Close(); + + iPreCaptureItems.Close(); + delete iToolTipText; + + delete iOneClickUploadTooltip; + + DestroyActivePalette(); + PRINT( _L("Camera <= ~CCamActivePaletteHandler") ); + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::ActivePalette() +// Return handle to Active Palette +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +MActivePalette2UI* CCamActivePaletteHandler::ActivePalette() const + { + return iActivePalette; + } + + +/* + * To check if a specific feature is supported, to append or show in AP + */ +TBool CCamActivePaletteHandler:: IsAPItemFeatureSupportedL( const TInt aItemId ) const + { + TBool featureSupported = ETrue; // by default we feature supported + CCameraUiConfigManager* configMgr = iController.UiConfigManagerPtr(); + switch( aItemId ) + { + case ECamSettingItemFaceTracking: + { + featureSupported = configMgr->IsFaceTrackingSupported(); + break; + } + case ECamSettingItemGotoPhotos: + { + featureSupported = configMgr->IsPhotosSupported(); + break; + } + case ECamSettingItemDynamicPhotoFlash: + { + featureSupported = configMgr->IsFlashModeSupported(); + break; + } + case ECamSettingItemDynamicVideoFlash: + { + featureSupported = configMgr->IsVideoLightSupported(); + break; + } + case ECamSettingItemDynamicPhotoColourFilter: + case ECamSettingItemDynamicVideoColourFilter: + { + featureSupported = configMgr->IsColorToneFeatureSupported(); + break; + } + case ECamSettingItemDynamicPhotoWhiteBalance: + case ECamSettingItemDynamicVideoWhiteBalance: + { + featureSupported = configMgr->IsWhiteBalanceFeatureSupported(); + break; + } + case ECamSettingItemDynamicPhotoLightSensitivity: + { + featureSupported = configMgr->IsISOSupported(); + break; + } + case ECamSettingItemDynamicPhotoExposure: + { + featureSupported = configMgr->IsEVSupported(); + break; + } + case ECamSettingItemDynamicPhotoImageSharpness: + { + featureSupported = configMgr->IsSharpnessFeatureSupported(); + break; + } + case ECamSettingItemDynamicPhotoContrast: + case ECamSettingItemDynamicVideoContrast: + { + featureSupported = configMgr->IsContrastSupported(); + break; + } + case ECamSettingItemDynamicPhotoBrightness: + case ECamSettingItemDynamicVideoBrightness: + { + featureSupported = configMgr->IsBrightnessSupported(); + break; + } + default: + { + break; + } + } + return featureSupported; + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::InstallAPItemsL +// Install ap items from resource +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::InstallAPItemsL( TInt aResId ) + { + PRINT( _L( "Camera => CCamActivePaletteHandler::InstallAPItemsL" ) ); + + if ( !iController.IsTouchScreenSupported() ) + { + // Clear existing items first + iItemArray.Reset(); + + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) + { + iCurrentValSettingsItem.Reset(); + } + + + // Array for new toolbar items + RArray newItems; + CleanupClosePushL( newItems ); + + // Static toolbar content - load items from resource + PRINT( _L( "Camera <> CCamActivePaletteHandler::InstallAPItemsL - Static toolbar items from resource" ) ); + ReadToolbarItemsFromResourceL( aResId, newItems ); + iDynamicToolbar = EFalse; + + TInt nItems = newItems.Count(); + + for( TInt i=0; iIsPhotosSupported(); + } + else + { + } + } + + if ( append ) + { + iItemArray.AppendL( item ); + } + } + + TInt items = iItemArray.Count(); + + for( TInt i=0; i CCamActivePaletteHandler: case ECamActivePaletteItemTypeCommand") ); + // Command id is used to identify the icon. + // Only one icon is used for command type items. + settingItem.iSettingVal = iItemArray[i].iCmdId; + iIconId = GetBitmapIdFromValueL( settingItem ); + break; + } + case ECamActivePaletteItemTypePreCapture: + { + PRINT( _L("Camera <> CCamActivePaletteHandler: case ECamActivePaletteItemTypePreCapture") ); + // Get initial value & associated icon + settingItem.iSettingVal = iController.IntegerSettingValue( iItemArray[i].iItemId ); + iIconId = GetBitmapIdFromValueL( settingItem ); + break; + } + case ECamActivePaletteItemTypePreCaptureNonSetting: + { + PRINT( _L("Camera <> CCamActivePaletteHandler: case ECamActivePaletteItemTypePreCaptureNonSetting") ); + settingItem.iSettingVal = DetermineNonSettingState( iItemArray[i] ); + iIconId = GetBitmapIdFromValueL( settingItem ); + if ( iIconId != KErrNotFound ) + { + SetNonSettingItemTooltipL( iItemArray[i] ); + } + break; + } + case ECamActivePaletteItemTypePostCapture: + { + PRINT( _L("Camera <> CCamActivePaletteHandler: case ECamActivePaletteItemTypePostCapture") ); + // Setting up the AP post-capture is simpler as the icons + // don't need to change depending on any settings. + LoadPostCaptureResourcesL( PostCaptureItemId( iItemArray[i].iCmdId ) ); + break; + } + default: + { + PRINT( _L("Camera <> CCamActivePaletteHandler: default case => PANIC!!!") ); + __ASSERT_DEBUG( EFalse, CamPanic( ECamPanicInvalidActivePaletteItemType ) ); + break; + } + } // switch + + PRINT( _L("Camera <> CCamActivePaletteHandler::InstallAPItemsL About to install item")); + + // Override tooltip for one-click upload + if ( iOneClickUploadTooltip && + iItemArray[i].iCmdId == ECamCmdOneClickUpload ) + { + delete iToolTipText; + iToolTipText = NULL; + iToolTipText = iOneClickUploadTooltip->AllocL(); + } + + // cache the current values of the AP items so that we don't need to check later + // specifically for the items that there values are persisted + if ( iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) + { + TCamAPSettingsItem tempSettingItem; + tempSettingItem.iSettingItem = iItemArray[i].iItemId; + // set initial value to some invalid number using -1 + tempSettingItem.iSettingVal = -1; + iCurrentValSettingsItem.AppendL( tempSettingItem ); + } + + InstallOneAPItemL( iItemArray[i], uid, *iToolTipText, *iIconFileName, iIconId, iIconId ); + + PRINT( _L("Camera <> CCamActivePaletteHandler::InstallAPItemsL Item installed")); + } // for + + if ( iController.UiConfigManagerPtr()->IsXenonFlashSupported() ) + { + CheckFlashItemVisibilityL(); + } + + CleanupStack::PopAndDestroy(); // newItems + } + PRINT( _L( "Camera <= CCamActivePaletteHandler::InstallAPItemsL" ) ); + } + + + + +// ----------------------------------------------------------------------------- +// InstallOneAPItemL +// +// Helper method to install one AP item. +// ----------------------------------------------------------------------------- +// +void +CCamActivePaletteHandler +::InstallOneAPItemL( const TCamActivePaletteItem& aItem, + const TUid& aPluginUid, + const TDesC& aToolTipText, + const TDesC& aIconFileName, + TInt aIconId, + TInt aMaskId ) + { + // only add items that actually exist + if( iIconId != KErrNotFound ) + { + TCamAPGenericPluginParams params( + TCamAPGenericPluginParams::EGenericCustomResFile, + aIconFileName, + aIconId, + aMaskId, + aToolTipText, + aItem.iCmdId, // message ID + 0 ); // Custom param + TPckg paramsPckg( params ); + + TActivePalette2ItemVisible itemVisible( aItem.iCmdId,aItem.iIsVisible ); + iActivePalette->InstallItemL( itemVisible, + aPluginUid, + paramsPckg ); + } + } + + +// ----------------------------------------------------------------------------- +// CheckFlashItemVisibilityL +// +// Hide flash AP item if needed. +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::CheckFlashItemVisibilityL() + { + if ( !iController.IsTouchScreenSupported() && + iController.UiConfigManagerPtr()->IsXenonFlashSupported() ) + { + // Make flash item invisible, in case updating AP for burst mode + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( appUi && ECamImageCaptureBurst == appUi->CurrentBurstMode() || + + // ECamCaptureModeTimeLapse == appUi->CurrentBurstMode() || + ECamSceneSports == iController.IntegerSettingValue( ECamSettingItemDynamicPhotoScene ) ) + { + // Flash item is disabled in burst mode and for sport scene + iActivePalette->SetItemVisibility( ECamCmdCaptureSetupFlashStill, EFalse ); + } + else + { + iActivePalette->SetItemVisibility( ECamCmdCaptureSetupFlashStill, ETrue ); + } + } + } + + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::ReturnedFromPretendExitL +// Resets current item position and updates the active palette. +// ----------------------------------------------------------------------------- +// + void CCamActivePaletteHandler::ReturnedFromPretendExitL() + { + PRINT( _L("Camera => CCamActivePaletteHandler::ReturnedFromPretendExitL")); + if ( !iController.IsTouchScreenSupported() ) + { + if ( iActivePalette ) + { + ResetToDefaultItem(); + } + + UpdateActivePaletteL(); + } + PRINT( _L("Camera <= CCamActivePaletteHandler::ReturnedFromPretendExitL")); + } + + + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::ResetToFirstItem +// Resets highlight to the first AP item +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::ResetToFirstItem() + { + PRINT( _L("Camera => CCamActivePaletteHandler::ResetToFirstItem")); + if ( !iController.IsTouchScreenSupported() ) + { + if( iActivePalette && iItemArray.Count() > 0 ) + { + iActivePalette->SetCurrentItem( iItemArray[0].iCmdId ); + } + } + PRINT( _L("Camera <= CCamActivePaletteHandler::ResetToFirstItem")); + } + + + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::ResetToDefaultItem +// Resets highlight to the default AP item +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::ResetToDefaultItem() + { + PRINT( _L("Camera => CCamActivePaletteHandler::ResetToDefaultItem")); + if ( !iController.IsTouchScreenSupported() ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if( !appUi->IsEmbedded() +/*#ifndef __WINS__ + || appUi->IsInCallSend() +#endif*/ + ) + { + if( iActivePalette && iItemArray.Count() > 1 ) + { + // In static toolbar, always reset to second item + // First item selected to adjust the visible items + iActivePalette->SetCurrentItem( iItemArray[0].iCmdId ); + iActivePalette->SetCurrentItem( iItemArray[1].iCmdId ); + } + } + else + { + ResetToFirstItem(); + } + } + PRINT( _L("Camera <= CCamActivePaletteHandler::ResetToDefaultItem")); + } + + + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::UpdateActivePaletteL +// Force Active palette update +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + void CCamActivePaletteHandler::UpdateActivePaletteL() + { + PRINT( _L("Camera => CCamActivePaletteHandler::UpdateActivePaletteL")) + if ( !iController.IsTouchScreenSupported() ) + { + TBool orientation = iController.UiConfigManagerPtr() && + iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported(); + if( iUpdatesDisabled ) + { + PRINT( _L("Camera <= CCamActivePaletteHandler::UpdateActivePaletteL (updates disabled)")) + return; + } + + if( !iActivePalette ) + { + PRINT( _L("Camera <= CCamActivePaletteHandler::UpdateActivePaletteL no palette")) + return; + } + + HBufC8* package = NULL; + TInt messageId = -1; + TInt count = iItemArray.Count(); + for( TInt i = 0; i < count; i++ ) + { + TCamAPSettingsItem settingItem; + + TCamActivePaletteItem& item = iItemArray[i]; + + settingItem.iSettingItem = item.iItemId; + + switch (item.iType) + { + case ECamActivePaletteItemTypeCommand: + { + // Tooltip or icon will now change for command type item + break; + } + case ECamActivePaletteItemTypePreCapture: + case ECamActivePaletteItemTypePostCapture: + { + if ( item.iItemId >= 0 ) + { + // attempt to get actual setting value + // get handle to controller + settingItem.iSettingVal = iController.IntegerSettingValue( item.iItemId ); + + if( !orientation || + ( orientation && + settingItem.iSettingVal != iCurrentValSettingsItem[i].iSettingVal ) ) + { + TPckgBuf buf( settingItem ); + TInt iconId = GetBitmapIdFromValueL( settingItem ); + + if ( iconId != KErrNotFound ) + { + TCamAPGenericPluginIcon icon( iconId, iconId ); + TPckgC iconPckg( icon ); + package = iconPckg.AllocLC(); + messageId = EAPGenericPluginChangeIcon; + } + } + } + break; + } + case ECamActivePaletteItemTypePreCaptureNonSetting: + { + settingItem.iSettingVal = DetermineNonSettingState( item ); + + if( !orientation || + ( orientation && + settingItem.iSettingVal != iCurrentValSettingsItem[i].iSettingVal ) ) + { + iIconId = GetBitmapIdFromValueL( settingItem ); + PRINT1( _L("Camera <> CCamActivePaletteHandler::UpdateActivePaletteL icon id %d"), iIconId); + if( iIconId != KErrNotFound ) + { + SetNonSettingItemTooltipL( item ); + TCamAPGenericPluginParams params ( + TCamAPGenericPluginParams::EGenericCustomResFile, + *iIconFileName, // bitmap filename + iIconId, // icon + iIconId, // mask + *iToolTipText, // text + item.iCmdId, // message ID + 0 ); // Custom param + TPckg paramsPckg( params ); + package = paramsPckg.AllocLC(); + messageId = EAPGenericPluginChangeParams; + } + } + break; + } + default: + { + PRINT( _L("Camera <> CCamActivePaletteHandler::UpdateActivePaletteL: Unknown item, PANIC!!!") ); + __ASSERT_DEBUG( EFalse, CamPanic( ECamPanicInvalidActivePaletteItemType ) ); + } + } // switch + if ( package ) + { + // if the value of the AP item has changed update the local settings value cache + if ( orientation ) + { + iCurrentValSettingsItem[i].iSettingVal = settingItem.iSettingVal; + } + + // Change item by sending message to the generic plugin + iActivePalette->SendMessage( item.iCmdId, messageId, *package) ; + CleanupStack::PopAndDestroy( package ); + package = NULL; + } + } // for + + if ( iController.UiConfigManagerPtr()->IsXenonFlashSupported() ) + { + CheckFlashItemVisibilityL(); + } + + } + + PRINT( _L("Camera <= CCamActivePaletteHandler::UpdateActivePaletteL")) + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::SetView +// Set current view +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::SetView( CCamViewBase* aView ) + { + iView = aView; + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::SetVisibility +// Set Active palette visiblity +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::SetVisibility( TBool aVisibility ) + { + PRINT2(_L("Camera => CCamActivePaletteHandler::SetVisibility from %d to %d"), iVisible, aVisibility) + + if ( !iController.IsTouchScreenSupported() ) + { + // Only animate if we're moving to a different state + if ( iVisible != aVisibility && iActivePalette ) + { + iVisible = aVisibility; + if ( ECamCapturing == iController.CurrentOperation() || + (!iStarted && + !iController.UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) || + !aVisibility ) + { + iActivePalette->SetPaletteVisibility(iVisible, EFalse); + iStarted = ETrue; + PRINT(_L("AP NO animation")); + } + else + { + iActivePalette->SetPaletteVisibility(iVisible,ETrue,100); + PRINT(_L("AP animation")); + } + + PERF_MESSAGE_L2( EPerfMessageActivePaletteAnimationStarting ); + PRINT(_L("AP animation started")); + } + + if ( iController.IsTouchScreenSupported() ) + { + if ( iActivePalette ) + { + iActivePalette->SetPaletteVisibility( EFalse, EFalse ); + } + } + } + + PRINT(_L("Camera <= CCamActivePaletteHandler::SetVisibility")) + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::IsVisible +// Return Active palette visiblity +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CCamActivePaletteHandler::IsVisible() const + { + return iVisible; + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::SetVisibility +// Whether AP has requested item +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TBool CCamActivePaletteHandler::AccessedViaAP() const + { + return iItemAccessedViaAP; + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::APOperationComplete +// Inform AP handler AP launched item has completed +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::APOperationComplete() + { + iItemAccessedViaAP = EFalse; + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::HandleAPKeyEventL +// Pass keys events to Active Palette +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CCamActivePaletteHandler::HandleAPKeyEventL( const TKeyEvent& /* aKeyEvent */, + TEventCode /* aType */ ) + { + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::CreateActivePaletteL +// Create the Active Palette +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// + +void +CCamActivePaletteHandler::CreateActivePaletteL(const CCoeControl &aContainerWindow, + MObjectProvider *aMopParent) + { + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMACTIVEPALETTEHANDLER_CREATEACTIVEPALETTEL, "e_CCamActivePaletteHandler_CreateActivePaletteL 1" ); + PRINT(_L("Camera => CCamActivePaletteHandler::CreateActivePaletteL")) + PERF_EVENT_START_L2( EPerfEventActivePaletteConstruction ); + + if ( !iController.IsTouchScreenSupported() ) + { + if(!iActivePalette) + { + // Variate this according to usage of Direct Screen viewfinder + if ( iController.IsDirectScreenVFSupported() ) + { + iActivePalette = ActivePalette2Factory::CreateActivePaletteUIL(EAP2DrawModeCheckerboard); + } + else + { + iActivePalette = ActivePalette2Factory::CreateActivePaletteUIL(KActivePaletteDrawMode); + } + iActivePalette->SetObserver(this); + } + else + { + ClearActivePalette(); + } + iActivePalette->CoeControl()->SetContainerWindowL( aContainerWindow ); + iActivePalette->CoeControl()->SetMopParent( aMopParent ); + iActivePalette->LocateTo(APScreenLocation( TPoint(280, 30) )); + iActivePalette->SetPaletteVisibility(EFalse,EFalse); + iVisible=EFalse; + } + + PERF_EVENT_END_L2( EPerfEventActivePaletteConstruction ); + PRINT(_L("Camera <= CCamActivePaletteHandler::CreateActivePaletteL")) + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMACTIVEPALETTEHANDLER_CREATEACTIVEPALETTEL, "e_CCamActivePaletteHandler_CreateActivePaletteL 0" ); + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::DestroyActivePalette +// Deletes the Active Palette +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::DestroyActivePalette() + { + if ( !iController.IsTouchScreenSupported() ) + { + delete iActivePalette; + iActivePalette = NULL; + } + } + +// +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::NotifyItemFocused +// Handle a change of item focus in the active palette +// (other items were commented in a header) +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::NotifyItemFocused(TInt /*aPrevItem*/, TInt /*aFocusedItem*/) + { + // We don't care about changes in item focus. + } + + +// +// +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::NotifyItemSelected +// Pass keys events to Active Palette +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::NotifyItemSelected(const TActivePalette2EventData & aEvent) + { + PRINT1( _L("Camera => CCamActivePaletteHandler::NotifyItemSelected item (%d)"), aEvent.CurItem() ); + + if ( !iController.IsTouchScreenSupported() ) + { + if( iView && iVisible ) + { + TRAPD(ignore, iView->HandleCommandL( aEvent.CurItem()) ); + + // Handling a command implies a container switch, so we need to switch the activepalette back + // to the system Gc. + iActivePalette->SetGc(); + + // Error -14 (KErrInUse) must be handled here or it's ignored and there's no error note + if( ignore == KErrInUse ) + { + PRINT( _L( "Camera <> CCamActivePaletteHandler::NotifyItemSelected KErrInUse" ) ); + + // Get the application caption (name) + RApaLsSession ls; + TApaAppInfo appInfo; + TRAPD(err1, ls.Connect() ); + if( err1 != KErrNone) + { + ls.Close(); + return; + } + TRAPD(err2, ls.GetAppInfo(appInfo, TUid::Uid(KCameraappUID)) ); + if( err2 != KErrNone) + { + ls.Close(); + return; + } + TApaAppCaption appCaption = appInfo.iCaption; + ls.Close(); + + // Get the correct error description + CTextResolver* iTextResolver = NULL; + + TRAPD(err3, iTextResolver = CTextResolver::NewL()); + if( err3 != KErrNone) + { + return; + } + TPtrC buf; + buf.Set( iTextResolver->ResolveErrorString( ignore, CTextResolver::ECtxNoCtxNoSeparator ) ); + delete iTextResolver; + iTextResolver = NULL; + + // Compose the full error message + TBuf<100> fullnote; + fullnote.Append(appCaption); + fullnote.Append(':'); + fullnote.Append('\n'); + fullnote.Append(buf); + + // Display the error note + CAknErrorNote* dlg = new CAknErrorNote( ETrue ); + if(dlg==NULL) + { + return; + } + TRAPD(err4, dlg->ExecuteLD( fullnote )); + if( err4 != KErrNone) + { + return; + } + } + iItemAccessedViaAP = ETrue; + } + } + PRINT( _L("Camera <= CCamActivePaletteHandler::NotifyItemSelected") ); + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::NotifyItemComplete +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::NotifyItemComplete(const TActivePalette2EventData& /*aEvent*/, + const TDesC8& /*aDataDes*/, + TInt /*aDataInt*/) + { + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::NotifyMessage +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void +CCamActivePaletteHandler::NotifyMessage( + const TActivePalette2EventData& /*aEvent*/, + TInt /*aMessageID*/, + const TDesC8& /*aDataDes*/, + TInt /*aDataInt*/ ) + { + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::Redraw +// +// (other items were commented in a header) +// ----------------------------------------------------------------------------- +void CCamActivePaletteHandler::Redraw(const TRect& aArea) + { + if ( iView ) + { + iView->RedrawAPArea( aArea ); + } + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::ActivePaletteUpdated +// +// (other items were commented in a header) +// ----------------------------------------------------------------------------- +void CCamActivePaletteHandler::ActivePaletteUpdated() + { + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::LoadPostCaptureResourcesL +// Load resource for post-capture item +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::LoadPostCaptureResourcesL( TInt aResourceId ) + { + if ( !iController.IsTouchScreenSupported() ) + { + TResourceReader reader; + iEnv->CreateResourceReaderLC(reader, aResourceId); + + // Store tooltip text and icon ID in member variables + TPtrC ptr = reader.ReadTPtrC(); + delete iToolTipText; + iToolTipText = NULL; + iToolTipText = ptr.AllocL(); + + iIconId = reader.ReadInt16(); + + CleanupStack::PopAndDestroy(); // reader + } + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::PreCaptureArrayId +// Map settings item to CAM_CAPTURE_SETUP_MENU_ITEM_ARRAY type resource id +// ----------------------------------------------------------------------------- +// +TInt CCamActivePaletteHandler::PreCaptureArrayId( TInt aSettingItem ) + { + PRINT( _L("Camera => CCamActivePaletteHandler::PreCaptureArrayId") ); + TBool extLightSensitivitySupported = EFalse; + TInt resId = KErrNotFound; + if ( !iController.IsTouchScreenSupported() ) + { + switch( aSettingItem ) + { + // ----------------------------------------------------- + case ECamSettingItemDynamicVideoScene: + resId = R_CAM_CAPTURE_SETUP_MENU_VIDEO_SCENE_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicVideoWhiteBalance: + resId = R_CAM_CAPTURE_SETUP_MENU_VIDEO_WHITE_BALANCE_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicVideoExposure: + break; + // ----------------------------------------------------- + // Replaced by ECamSettingItemDynamicVideoLightSensitivity + // case ECamSettingItemDynamicVideoISO: + // break; + // ----------------------------------------------------- + case ECamSettingItemDynamicVideoColourFilter: + resId = R_CAM_CAPTURE_SETUP_MENU_VIDEO_COLOURFILTER_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicVideoBrightness: + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicVideoContrast: + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicVideoColourSaturation: + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicPhotoScene: + resId = R_CAM_CAPTURE_SETUP_MENU_PHOTO_SCENE_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicPhotoWhiteBalance: + resId = R_CAM_CAPTURE_SETUP_MENU_PHOTO_WHITE_BALANCE_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicPhotoExposure: + resId = iEvCompRes; + break; + // ----------------------------------------------------- + // Replaced by ECamSettingItemDynamicPhotoLightSensitivity + // case ECamSettingItemDynamicPhotoISO: + // break; + // ----------------------------------------------------- + case ECamSettingItemDynamicPhotoColourFilter: + resId = R_CAM_CAPTURE_SETUP_MENU_PHOTO_COLOURFILTER_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicPhotoFlash: + resId = R_CAM_CAPTURE_SETUP_MENU_PHOTO_FLASH_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicVideoFlash: + resId = R_CAM_CAPTURE_SETUP_MENU_VIDEO_FLASH_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicPhotoBrightness: + resId = R_CAM_CAPTURE_SETUP_MENU_PHOTO_BRIGHTNESS_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicPhotoContrast: + resId = R_CAM_CAPTURE_SETUP_MENU_PHOTO_CONTRAST_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicPhotoImageSharpness: + resId = R_CAM_CAPTURE_SETUP_MENU_PHOTO_IMAGESHARPNESS_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicPhotoColourSaturation: + break; + // ----------------------------------------------------- + case ECamSettingItemFaceTracking: + resId = R_CAM_ACTIVE_PALETTE_PRECAPTURE_FACETRACKING_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemSequenceMode: + resId = R_CAM_ACTIVE_PALETTE_PRECAPTURE_SEQUENCE_MODE_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemVideoModeSelect: + resId = R_CAM_ACTIVE_PALETTE_PRECAPTURE_VIDEO_MODE_SELECT; + break; + // ----------------------------------------------------- + case ECamSettingItemImageModeSelect: + resId = R_CAM_ACTIVE_PALETTE_PRECAPTURE_IMAGE_MODE_SELECT; + break; + case ECamSettingItemSwitchCamera: + resId = R_CAM_ACTIVE_PALETTE_PRECAPTURE_SWITCH_CAMERA; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicSelfTimer: + resId = R_CAM_ACTIVE_PALETTE_SELF_TIMER_SELECT; + break; + // ----------------------------------------------------- + case ECamSettingItemDynamicPhotoLightSensitivity: + case ECamSettingItemDynamicVideoLightSensitivity: + extLightSensitivitySupported = + iController.UiConfigManagerPtr()->IsExtendedLightSensitivitySupported(); + if ( extLightSensitivitySupported ) + { + resId = R_CAM_ACTIVE_PALETTE_EXTENDED_LIGHT_SENSITIVITY_SELECT; + } + else + { + resId = R_CAM_ACTIVE_PALETTE_LIGHT_SENSITIVITY_SELECT; + } + break; + // ----------------------------------------------------- + case ECamSettingItemViewfinderGrid: + resId = R_CAM_ACTIVE_PALETTE_VF_GRID_SET_ARRAY; + break; + // ----------------------------------------------------- + case ECamSettingItemGotoPhotos: + resId = R_CAM_ACTIVE_PALETTE_GOTO_PHOTOS_SET_ARRAY; + break; + // ----------------------------------------------------- + default: + break; + // ----------------------------------------------------- + } // switch + } + + PRINT1( _L("Camera <= CCamActivePaletteHandler::PreCaptureArrayId, return:%d" ), resId ) + return resId; + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::GetBitmapIdFromValueL +// Find bitmap id for specific settings value +// ----------------------------------------------------------------------------- +// +TInt CCamActivePaletteHandler::GetBitmapIdFromValueL( TCamAPSettingsItem& aItem ) + { + PRINT( _L("Camera => CCamActivePaletteHandler::GetBitmapIdFromValueL") ); + + if ( !iController.IsTouchScreenSupported() ) + { + TInt arrayId = PreCaptureArrayId( aItem.iSettingItem ); + + if ( arrayId == KErrNotFound ) + { + return KErrNotFound; + } + + TInt bitmapId = KErrNotFound; + + PRINT( _L("Camera <> CCamActivePaletteHandler: Looking for tooltip...") ); + + TResourceReader reader; + iEnv->CreateResourceReaderLC( reader, arrayId ); + + // Settings model ID + reader.ReadInt16(); + + // Tooltip text + TPtrC ptr = reader.ReadTPtrC(); + + delete iToolTipText; + iToolTipText = NULL; + iToolTipText = ptr.AllocL(); + + TInt tmpVal = aItem.iSettingVal; + + if ( iController.UiConfigManagerPtr()->IsContrastSupported() ) + { + // For contrast setting map the value to bitmap value + if ( aItem.iSettingItem == ECamSettingItemDynamicPhotoContrast || + aItem.iSettingItem == ECamSettingItemDynamicVideoContrast ) + { + if ( tmpVal > 0 ) + { + tmpVal = ECamContrastPlus; + } + else if ( tmpVal < 0 ) + { + tmpVal = ECamContrastNeg; + } + else + { + tmpVal = ECamContrastNorm; + } + } + } + + if ( iController.UiConfigManagerPtr()->IsBrightnessSupported() ) + { + // For brightness setting map the value to bitmap value + if ( aItem.iSettingItem == ECamSettingItemDynamicPhotoBrightness || + aItem.iSettingItem == ECamSettingItemDynamicVideoBrightness ) + { + if ( tmpVal > 0 ) + { + tmpVal = ECamBrightnessPlus; + } + else if ( tmpVal < 0 ) + { + tmpVal = ECamBrightnessNeg; + } + else + { + tmpVal = ECamBrightnessNorm; + } + } + } + + PRINT( _L("Camera <> CCamActivePaletteHandler: Looking for bitmap...") ); + const TInt count = reader.ReadInt16(); + + for( TInt i = 0; i < count; i++ ) + { + if (reader.ReadInt16() == tmpVal ) + { + bitmapId = reader.ReadInt16(); + break; + } + + // Skip these values if this isn't the one we're interested in. + reader.ReadInt16(); // Bitmap ID + reader.ReadTPtrC(); // Icon text + } + + CleanupStack::PopAndDestroy(); // reader + + PRINT1( _L("Camera <= CCamActivePaletteHandler::GetBitmapIdFromValueL, return id:%d"), bitmapId ); + return bitmapId; + } + else + { + return KErrNotFound; + } + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::PostCaptureItemId +// Find resource ID for post capture item from command ID +// ----------------------------------------------------------------------------- +// +TInt CCamActivePaletteHandler::PostCaptureItemId( TInt aCommandId ) + { + PRINT( _L("Camera => CCamActivePaletteHandler::PostCaptureItemId") ); + TInt resId = KErrNotFound; + + if ( !iController.IsTouchScreenSupported() ) + { + switch( aCommandId ) + { + case ECamCmdPhotos: + resId = R_CAM_AP_PHOTOS; + break; + case ECamCmdDelete: + resId = R_CAM_AP_DELETE; + break; + case ECamCmdPlay: + resId = R_CAM_AP_PLAY; + break; + case ECamCmdSend: + resId = R_CAM_AP_SEND; + break; + case ECamCmdSendToCallerMultimedia: + resId = R_CAM_AP_SEND_MULTIMEDIA; + break; + case ECamCmdOneClickUpload: + resId = R_CAM_AP_ONE_CLICK_UPLOAD; + break; + case ECamCmdAddToAlbum: + resId = R_CAM_AP_ADD_TO_ALBUM; + break; + case ECamCmdProperties: + resId = R_CAM_AP_PROPERTIES; + break; + default: + break; + } + } + PRINT( _L("Camera <= CCamActivePaletteHandler::PostCaptureItemId") ); + return resId; + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::DetermineNonSettingState +// Current state of a Non-Setting Item +// ----------------------------------------------------------------------------- +// +TInt +CCamActivePaletteHandler +::DetermineNonSettingState( const TCamActivePaletteItem& aItem ) const + { + __ASSERT_DEBUG( aItem.iType == ECamActivePaletteItemTypePreCaptureNonSetting, + CamPanic( ECamPanicNonSettingActivePaletteTypeExpected ) ); + + TInt state = KErrNotFound; + + if ( !iController.IsTouchScreenSupported() ) + { + CCamAppUi* appUi = static_cast(iEnv->AppUi()); + + + switch( aItem.iItemId ) + { + // ----------------------------------------------------- + case ECamSettingItemSequenceMode: + { + TBool burst = appUi->IsBurstEnabled(); + state = CamTimeLapseUtility::IntervalToEnum( iController.TimeLapseInterval(), burst ); + PRINT1( _L("Camera <> CCamActivePaletteHandler::DetermineNonSettingState Sequence Mode %d"), appUi->IsBurstEnabled()); + break; + } + // ----------------------------------------------------- + case ECamSettingItemImageModeSelect: + case ECamSettingItemVideoModeSelect: + case ECamSettingItemSwitchCamera: + { + state = 0; + break; + } + // ----------------------------------------------------- + case ECamSettingItemViewfinderGrid: + { + state = iController.IntegerSettingValue( ECamSettingItemViewfinderGrid ); + break; + } + // ----------------------------------------------------- + case ECamSettingItemFaceTracking: + { + state = iController.IntegerSettingValue( ECamSettingItemFaceTracking ); + break; + } + // ----------------------------------------------------- + case ECamSettingItemDynamicVideoFlash: + { + state = iController.IntegerSettingValue( ECamSettingItemDynamicVideoFlash ); + break; + } + // ----------------------------------------------------- + default: + { + __ASSERT_DEBUG( EFalse, CamPanic( ECamPanicInvalidActivePaletteItemType ) ); + break; + } + // ----------------------------------------------------- + } + } + + return state; + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::SetNonSettingItemTooltipL +// Change a Non-Setting Item's tooltip +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::SetNonSettingItemTooltipL(const TCamActivePaletteItem& aItem) + { + if ( !iController.IsTouchScreenSupported() ) + { + __ASSERT_DEBUG( aItem.iType == ECamActivePaletteItemTypePreCaptureNonSetting, + CamPanic( ECamPanicNonSettingActivePaletteTypeExpected ) ); + + TInt resource = 0; + switch ( aItem.iItemId ) + { + // ----------------------------------------------------- + case ECamSettingItemSequenceMode: + { + resource = ( iController.TimeLapseSupported() ) + ? R_CAM_ACTIVE_PALETTE_PRECAPTURE_ADVANCED_SEQUENCE_MODE_TOOLTIP_ARRAY + : R_CAM_ACTIVE_PALETTE_PRECAPTURE_SEQUENCE_MODE_TOOLTIP_ARRAY; + break; + } + // ----------------------------------------------------- + case ECamSettingItemViewfinderGrid: + { + resource = R_CAM_ACTIVE_PALETTE_VF_GRID_TOOLTIP_ARRAY; + break; + } + // ----------------------------------------------------- + case ECamSettingItemDynamicVideoFlash: + { + resource = R_CAM_ACTIVE_PALETTE_VIDEO_FLASH_TOOLTIP_ARRAY; + break; + } + // ----------------------------------------------------- + case ECamSettingItemFaceTracking: + { + resource = R_CAM_ACTIVE_PALETTE_FACETRACKING_TOOLTIP_ARRAY; + break; + } + // ----------------------------------------------------- + default: + { + break; + } + // ----------------------------------------------------- + } // switch + + if ( resource ) + { + TResourceReader reader; + iEnv->CreateResourceReaderLC(reader, resource); + + // Current Item State + TInt state = DetermineNonSettingState(aItem); + + const TInt count = reader.ReadInt16(); + + for( TInt i = 0; i < count; i++ ) + { + if (i == state) + { + TPtrC ptr = reader.ReadTPtrC(); + delete iToolTipText; + iToolTipText = NULL; + iToolTipText = ptr.AllocL(); + break; + } + // Skip these values if this isn't the one we're interested in. + reader.ReadTPtrC(); // Tooltip text + } + CleanupStack::PopAndDestroy(); // reader + } + } + } + + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::SetItemVisible +// Sets an icons visability +// ----------------------------------------------------------------------------- +// +TInt CCamActivePaletteHandler::SetItemVisible( const TInt aCommandId, const TBool aIsVisible ) + { + PRINT( _L("Camera => CCamActivePaletteHandler::SetItemVisible")); + TInt ret = 0; + if ( !iController.IsTouchScreenSupported() ) + { + if ( iActivePalette ) + { + return iActivePalette->SetItemVisibility( aCommandId, aIsVisible ); + } + else + { + return ret; + } + } + else + { + return ret; + } + } + + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::DisableUpdates +// Disables / enables activepalette updates. +// When updates are disabled, UpdateActivePaletteL does nothing. +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::DisableUpdates( TBool aDisableUpdates ) + { + PRINT1( _L("Camera => CCamActivePaletteHandler::DisableUpdates(%d)" ), aDisableUpdates ); + + iUpdatesDisabled = aDisableUpdates; + + PRINT( _L("Camera <= CCamActivePaletteHandler::DisableUpdates" ) ); + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::SetOneClickUploadTooltipL +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::SetOneClickUploadTooltipL( + const TDesC& aToolTip ) + { + delete iOneClickUploadTooltip; + iOneClickUploadTooltip = NULL; + iOneClickUploadTooltip = aToolTip.AllocL(); + } + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::ClearActivePalette +// Deletes all items from the active palette without deleting the active palette +// object itself, as this would cause problems for the containers that have +// pointers to +// ----------------------------------------------------------------------------- +// +void CCamActivePaletteHandler::ClearActivePalette() + { + if ( !iController.IsTouchScreenSupported() ) + { + RArray itemArray; + iActivePalette->GetItemList(itemArray); + for(TInt i=0;iRemoveItem(itemArray[i].ItemId()); + } + itemArray.Close(); + } + } + + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::ReadToolbarItemsFromResourceL +// Load toolbar item resource content to argument array +// ----------------------------------------------------------------------------- +// +void +CCamActivePaletteHandler::ReadToolbarItemsFromResourceL( TInt aResId, + RArray& aItems ) + { + PRINT( _L("Camera => CCamActivePaletteHandler::ReadToolbarItemsFromResourceL" ) ); + if ( !iController.IsTouchScreenSupported() ) + { + // Create resource reader + TResourceReader apItemReader; + iEnv->CreateResourceReaderLC( apItemReader, aResId ); + + // Read number of items + TInt numItems = apItemReader.ReadInt16(); + PRINT1( _L("Camera <> CCamActivePaletteHandler::ReadToolbarItemsFromResourceL %d items"), numItems ); + + TInt currentPosition = 1; + for( TInt i = 0; i < numItems; i++ ) + { + TCamActivePaletteItem item; + item.iItemId = apItemReader.ReadInt32(); + item.iCmdId = apItemReader.ReadInt32(); + + // NOTE: + // !! Current AP2 implementation ignores the iPosition value + // and the order is set by installing order !!! + // + // There are predefined "slots" for + // each used item. The order in resource need not to be + // the same as the order in Active Palette. + // item.iPosition = apItemReader.ReadInt8(); + + apItemReader.ReadInt8(); // Read unused position value + item.iPosition = currentPosition; + currentPosition++; + + item.iIsVisible = apItemReader.ReadInt8(); + item.iType = apItemReader.ReadInt8(); + + // Append to array of items + aItems.AppendL( item ); + } + + CleanupStack::PopAndDestroy(); // apItemReader + PRINT( _L("Camera <= CCamActivePaletteHandler::ReadToolbarItemsFromResourceL" ) ); + } + } + + +// ----------------------------------------------------------------------------- +// CCamActivePaletteHandler::APDimensionConvertion() +// ----------------------------------------------------------------------------- +// +TPoint CCamActivePaletteHandler::APScreenLocation( TPoint aQvgaPoint ) + { + TSize ScreenSize( 0, 0 ); + AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EScreen, ScreenSize ); + TInt baseheight = 240; + TInt lower = 0; + if ( ScreenSize.iWidth < ScreenSize.iHeight ) + { + lower = ScreenSize.iWidth; + } + else + { + lower = ScreenSize.iHeight; + } + TReal ratio = TReal(lower)/baseheight; + TInt APHeightQvga = 240 - 2*aQvgaPoint.iY; + TReal APHeightReal; + Math::Round( APHeightReal, ratio*APHeightQvga, 0 ); + TInt APHeight = TInt(APHeightReal); + TInt YValue = (ScreenSize.iHeight/2) - (APHeight/2); + + TReal APXValueReal; + TInt XValue; + + // With full screen viewfinder, use this! + TInt APXLengthQvga = 320 - aQvgaPoint.iX; + Math::Round( APXValueReal, ratio*APXLengthQvga, 0 ); + TInt APXLength = TInt(APXValueReal); + XValue = ScreenSize.iWidth - APXLength; + + return TPoint( XValue, YValue ); + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cambackupcontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cambackupcontainer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for all camera application containers* +*/ + +#include "cambackupcontainer.h" + +// ----------------------------------------------------------------------------- +// CCamBackupContainer::CCamBackupContainer +// ----------------------------------------------------------------------------- +// +CCamBackupContainer::CCamBackupContainer( CCamAppController& aController, + CAknView& aView) +: CCamContainerBase(aController, aView) + { + + } + +// ----------------------------------------------------------------------------- +// CCamBackupContainer::ConstructL +// ----------------------------------------------------------------------------- +// +void CCamBackupContainer::ConstructL(const CCoeControl& aContainer) + { + SetContainerWindowL(aContainer); + DrawableWindow()->SetOrdinalPosition(-1); + } + +// ----------------------------------------------------------------------------- +// CCamBackupContainer::~CCamBackupContainer +// ----------------------------------------------------------------------------- +// +CCamBackupContainer::~CCamBackupContainer() + { + //Do nothing + } + + +// ----------------------------------------------------------------------------- +// CCamBackupContainer::NewLC +// ----------------------------------------------------------------------------- +// +CCamBackupContainer* CCamBackupContainer::NewLC(CCamAppController& aController, + CAknView& aView, + const CCoeControl& aContainer) + { + CCamBackupContainer* self = new(ELeave) CCamBackupContainer(aController,aView); + CleanupStack::PushL(self); + self->ConstructL(aContainer); + return self; + } + +// ----------------------------------------------------------------------------- +// CCamBackupContainer::NewL +// ----------------------------------------------------------------------------- +// +CCamBackupContainer* CCamBackupContainer::NewL(CCamAppController& aController, + CAknView& aView, + const CCoeControl& aContainer) + { + CCamBackupContainer* self = CCamBackupContainer::NewLC(aController,aView,aContainer); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CCamBackupContainer::Draw +// ----------------------------------------------------------------------------- +// +void CCamBackupContainer::Draw( const TRect& aRect ) const + { + CWindowGc& gc = SystemGc(); + gc.SetBrushColor(KRgbBlack); + gc.Clear(); + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cambatterypanecontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cambatterypanecontroller.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,466 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implemantation for CCamBatteryPaneController class. +* +* Copyright © 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#include "cambatterypanecontroller.h" + +#include +#include // RProperty +#include // P&S keys +#include // KEikColorResourceChange +#include // KAknsMessageSkinChange + +#include "cambatterypanedrawer.h" +#include "CamPropertyWatcher.h" +#include "CamUtility.h" +#include "CamAppUi.h" + + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::CCamBatteryPaneController +// --------------------------------------------------------------------------- +// +CCamBatteryPaneController::CCamBatteryPaneController( + MCamBatteryPaneObserver& aObserver, TBool aCallbackActive ) : + iObserver( aObserver ), iCallbackActive( aCallbackActive ) + { + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::~CCamBatteryPaneController +// --------------------------------------------------------------------------- +// +CCamBatteryPaneController::~CCamBatteryPaneController() + { + PRINT ( _L("Camera => ~CCamBatteryPaneController") ); + + if (iTicker) + { + iTicker->Cancel(); + } + delete iTicker; + delete iDrawer; + delete iBatteryStrengthWatcher; + delete iBatteryChargingWatcher; + + PRINT ( _L("Camera <= ~CCamBatteryPaneController") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::NewL +// --------------------------------------------------------------------------- +// +CCamBatteryPaneController* CCamBatteryPaneController::NewL( + MCamBatteryPaneObserver& aObserver, + TBool aCallbackActive ) + { + PRINT ( _L("Camera => CCamBatteryPaneController::NewL") ); + + CCamBatteryPaneController* self = new (ELeave) CCamBatteryPaneController( + aObserver, aCallbackActive ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + PRINT ( _L("Camera <= CCamBatteryPaneController::NewL") ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::ConstructL +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::ConstructL() + { + PRINT ( _L("Camera => CCamBatteryPaneController::ConstructL") ); + + iDrawer = CCamBatteryPaneDrawer::NewL(); + iTicker = CPeriodic::NewL( CActive::EPriorityHigh ); + + // Construct property watchers for battery level and charging status + iBatteryStrengthWatcher = CCamPropertyWatcher::NewL( *this, KPSUidHWRMPowerState, KHWRMBatteryLevel ); + iBatteryChargingWatcher = CCamPropertyWatcher::NewL( *this, KPSUidHWRMPowerState, KHWRMChargingStatus ); + + // Subscribe to the properties + iBatteryStrengthWatcher->Subscribe(); + iBatteryChargingWatcher->Subscribe(); + + // Read initial values for battery level and charging status + ReadCurrentState(); + + PRINT ( _L( "Camera <= CCamBatteryPaneController::ConstructL" ) ); + } + + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::Pause +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::Pause( TBool aPause ) + { + PRINT1 ( _L("Camera => CCamBatteryPaneController::Pause( %d)"), aPause ); + if( aPause ) + { + // Pause battery pane controller + if( !iPaused ) + { + // Prevent callbacks + TBool oldCbState = iCallbackActive; + iCallbackActive = EFalse; + // Stop recharging + if( iRecharging ) + { + StopRecharging(); + } + // Cancel notifications of battery events + iBatteryStrengthWatcher->Cancel(); + iBatteryChargingWatcher->Cancel(); + iPaused = ETrue; + // Restore callback state + iCallbackActive = oldCbState; + } + } + else + { + // Restart battery pane controller + if( iPaused ) + { + // Re-subscribe to battery events + iBatteryStrengthWatcher->Subscribe(); + iBatteryChargingWatcher->Subscribe(); + ReadCurrentState(); + iPaused = EFalse; + } + } + PRINT( _L("Camera <= CCamBatteryPaneController::Pause") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::SetCallbackActive +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::SetCallbackActive( TBool aActive ) + { + iCallbackActive = aActive; + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::SetBatteryStrength +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::SetBatteryStrength( TInt aStrength ) + { + PRINT( _L("Camera => CCamBatteryPaneController::SetBatteryStrength") ); + + // Drawer uses battery strength for indexing a table, so make + // sure it stays within valid boundaries + if( aStrength > KMaxBatteryStrength ) + { + iBatteryStrength = KMaxBatteryStrength; + } + else if( aStrength < KMinBatteryStrength ) + { + iBatteryStrength = KMinBatteryStrength; + } + else + { + iBatteryStrength = aStrength; + } + + if( !iRecharging ) + { + iDrawer->SetBatteryStrength( iBatteryStrength ); + NotifyObserver(); + } + + PRINT( _L("Camera <= CCamBatteryPaneController::SetBatteryStrength") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::SetLocation +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::SetLocation( TPoint aLocation ) + { + iDrawer->SetLocation( aLocation ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::Rect +// --------------------------------------------------------------------------- +// +TRect CCamBatteryPaneController::Rect() const + { + return iDrawer->Rect(); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::Draw +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::Draw( CBitmapContext& aGc ) const +//void CCamBatteryPaneController::Draw( CWindowGc& aGc ) const + { + CCamAppUi* appUi = static_cast(CEikonEnv::Static()->AppUi()); + + // When battery recharge animation runs over, indicator needs clearing + // PostCap view has redraw functions of its own, so it doesn't need this + if ( iRechargeBatteryStrength == 0 && + iRecharging && + !appUi->IsBurstEnabled() && + appUi->CurrentViewState() != ECamViewStatePostCapture && + !(appUi->IsSecondCameraEnabled() && appUi->IsQwerty2ndCamera() ) ) + { + iDrawer->ClearBattery( aGc ); + } + + iDrawer->Draw( aGc ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::StartRecharging +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::StartRecharging() + { + PRINT( _L("Camera => CCamBatteryPaneController::StartRecharging") ); + + // Stop current timer + iTicker->Cancel(); + + // Initialize + iRecharging = ETrue; + iRechargeBatteryStrength = KMinBatteryStrength; + + // Give initial strength value to drawer and notify observer + iDrawer->SetBatteryStrength( iRechargeBatteryStrength ); + NotifyObserver(); + + // Start the animation + iTicker->Start( KBatteryRechargeTick, KBatteryRechargeTick, TCallBack(TickerCallback, this) ); + + PRINT( _L("Camera => CCamBatteryPaneController::StartRecharging") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::StopRecharging +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::StopRecharging() + { + PRINT( _L("Camera => CCamBatteryPaneController::StopRecharging") ); + + // Stop the timer and give the original battery + // strength to drawer class + iTicker->Cancel(); + iRecharging = EFalse; + iDrawer->SetBatteryStrength( iBatteryStrength ); + NotifyObserver(); + + PRINT( _L("Camera <= CCamBatteryPaneController::StopRecharging") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::NotifyObserver +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::NotifyObserver() + { + if( iCallbackActive ) + { + iObserver.BatteryPaneUpdated(); + } + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::UpdateRechargeBatteryStrength +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::UpdateRechargeBatteryStrength() + { + PRINT( _L("Camera => CCamBatteryPaneController::UpdateRechargeBatteryStrength") ); + + iRechargeBatteryStrength++; + if( iRechargeBatteryStrength > KMaxBatteryStrength ) + { + iRechargeBatteryStrength = KMinBatteryStrength; + } + iDrawer->SetBatteryStrength( iRechargeBatteryStrength ); + + NotifyObserver(); + + PRINT( _L("Camera <= CCamBatteryPaneController::UpdateRechargeBatteryStrength") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::TickerCallback +// --------------------------------------------------------------------------- +// +TInt CCamBatteryPaneController::TickerCallback( TAny* aThis ) + { + CCamBatteryPaneController* self = static_cast( aThis ); + if( self ) + { + self->UpdateRechargeBatteryStrength(); + } + return ETrue; + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::ReadCurrentState +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::ReadCurrentState() + { + PRINT( _L("Camera => CCamBatteryPaneController::ReadCurrentState") ); + + TInt batteryStrength = 0; + TInt chargingStatus = 0; + TInt err = KErrNone; + + // Disable callbacks to avoid two separate callbacks for charging + // status and battery level + TBool callbackActive = iCallbackActive; + iCallbackActive = EFalse; + + // Get the battery strength + err = iBatteryStrengthWatcher->Get( batteryStrength ); + if( KErrNone == err && -1 != batteryStrength ) + { + // We got an acceptable value + SetBatteryStrength( batteryStrength ); + } + else + { + // Default to lowest value + SetBatteryStrength( KMinBatteryStrength ); + } + + // Get current recharging state + err = iBatteryChargingWatcher->Get( chargingStatus ); + if ( KErrNone == err ) + { + HandleChargingStatusChange( chargingStatus ); + } + else + { + StopRecharging(); + } + + // Restore callbacks and notify the observer + iCallbackActive = callbackActive; + NotifyObserver(); + + PRINT( _L("Camera <= CCamBatteryPaneController::ReadCurrentState") ); + } + + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::HandleChargingStatusChange +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::HandleChargingStatusChange( TInt aStatus ) + { + PRINT( _L("Camera => CCamBatteryPaneController::HandleChargingStatusChange") ); + + if( EChargingStatusCharging == aStatus || + EChargingStatusAlmostComplete == aStatus || + EChargingStatusChargingContinued == aStatus ) + { + // The battery is being recharged + + if( !iRecharging ) + { + // Start the recharging animation + StartRecharging(); + } + } + else + { + // The battery is currently not being recharged + if( iRecharging ) + { + // Stop the recharging animation + StopRecharging(); + } + } + + PRINT( _L("Camera <= CCamBatteryPaneController::HandleChargingStatusChange") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::HandlePropertyChangedL +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::HandlePropertyChangedL( const TUid& aCategory, const TUint aKey ) + { + PRINT( _L("Camera => CCamBatteryPaneController::HandlePropertyChangedL") ); + + TInt value; + if( KPSUidHWRMPowerState == aCategory && KHWRMBatteryLevel == aKey ) + { + TInt err = iBatteryStrengthWatcher->Get( value ); + if( KErrNone == err && -1 != value ) + { + SetBatteryStrength( value ); + } + } + else if( KPSUidHWRMPowerState == aCategory && KHWRMChargingStatus == aKey ) + { + TInt err = iBatteryChargingWatcher->Get( value ); + if( KErrNone == err && -1 != value ) + { + HandleChargingStatusChange( value ); + } + } + else + { + // Do nothing. For Lint. + } + + PRINT( _L("Camera <= CCamBatteryPaneController::HandlePropertyChangedL") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneController::HandleResourceChange +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneController::HandleResourceChange( TInt aType ) + { + PRINT( _L("Camera => CCamBatteryPaneController::HandleResourceChange") ); + + if( KAknsMessageSkinChange == aType || + KEikColorResourceChange == aType ) + { + iDrawer->HandleResourceChange( aType ); + } + + PRINT( _L("Camera <= CCamBatteryPaneController::HandleResourceChange") ); + } + +// End of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cambatterypanedrawer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cambatterypanedrawer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,345 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implemantation for CCamBatteryPaneDrawer class. +* +* Copyright © 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#include "cambatterypanedrawer.h" + +#include +#include +#include +#include // KAvkonBitmapFile +#include // FbsBitmap +#include +#include +#include +#include // TAknWindowLineLayout +#include +#include +#include + +#include +#include + +#include "CamUtility.h" +#include "cambitmapitem.h" + +const TInt KCamDefaultBatteryCellHeight = 3; +const TInt KCamDefaultBatteryCellMargin = 1; + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::CCamBatteryPaneDrawer +// --------------------------------------------------------------------------- +// +CCamBatteryPaneDrawer::CCamBatteryPaneDrawer() + { + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::~CCamBatteryPaneDrawer +// --------------------------------------------------------------------------- +// +CCamBatteryPaneDrawer::~CCamBatteryPaneDrawer() + { + PRINT ( _L("Camera => ~CCamBatteryPaneDrawer") ); + + DeleteIcons(); + + PRINT ( _L("Camera <= ~CCamBatteryPaneDrawer") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::NewL +// --------------------------------------------------------------------------- +// +CCamBatteryPaneDrawer* CCamBatteryPaneDrawer::NewL() + { + PRINT ( _L("Camera => CCamBatteryPaneDrawer::NewL") ); + + CCamBatteryPaneDrawer* self = new (ELeave) CCamBatteryPaneDrawer(); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + PRINT ( _L("Camera <= CCamBatteryPaneDrawer::NewL") ); + return self; + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::ConstructL +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneDrawer::ConstructL() + { + PRINT( _L("Camera => CCamBatteryPaneDrawer::ConstructL") ); + + // Load icon bitmaps + LoadIconsL(); + // Load/calculate layout data + LoadLayoutsL(); + + PRINT( _L("Camera <= CCamBatteryPaneDrawer::ConstructL") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::SetBatteryStrength +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneDrawer::SetBatteryStrength( TInt aBatteryStrength ) + { + iBatteryStrength = aBatteryStrength; + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::SetLocation +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneDrawer::SetLocation( const TPoint& aLocation ) + { + iRect = TRect( aLocation, iRect.Size() ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::LoadIconsL +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneDrawer::LoadIconsL() + { + PRINT( _L("Camera => CCamBatteryPaneDrawer::LoadIconsL") ); + + // Delete existing icon bitmaps + DeleteIcons(); + + // Load and resize battery icon and mask + delete iBatteryIcon; + iBatteryIcon = NULL; + iBatteryIcon = CCamBitmapItem::NewL( + EMbmCameraappQgn_prop_cam_battery_icon, + EMbmCameraappQgn_prop_cam_battery_icon_mask ); + + // Load and resize battery strength icon and mask + delete iBatteryStrengthIcon; + iBatteryStrengthIcon = NULL; + iBatteryStrengthIcon = CCamBitmapItem::NewL( + EMbmCameraappQgn_indi_cam_battery_strength, + EMbmCameraappQgn_indi_cam_battery_strength_mask ); + + PRINT( _L("Camera <= CCamBatteryPaneDrawer::LoadIconsL") ); + } + + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::Rect +// --------------------------------------------------------------------------- +// +TRect CCamBatteryPaneDrawer::Rect() const + { + return iRect; + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::Draw +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneDrawer::Draw( CBitmapContext& aGc ) const + { + // Make sure that no brush is being used + aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); + + if( iBatteryStrengthIcon ) + { + TSize iconSize = iBatteryStrengthIcon->BitmapSize(); + + TRect strengthIconCropRect( + 0, + iconSize.iHeight - BatteryStrengthIconHeight( iBatteryStrength ), + iconSize.iWidth, + iconSize.iHeight ); + + // Draw the icon, with correct battery strength + iBatteryStrengthIcon->DrawPartial( + aGc, + iBatteryStrengthIcon->LayoutRect(), + strengthIconCropRect ); + } + + if( iBatteryIcon ) + { + iBatteryIcon->Draw( aGc ); + } + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::ClearBattery +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneDrawer::ClearBattery( CBitmapContext& aGc ) const + { + PRINT( _L("Camera => CCamBatteryPaneDrawer::ClearBattery") ); + + // Get the battery pane rectangle + const TRect rect = Rect(); + aGc.SetPenStyle( CGraphicsContext::ENullPen ); + aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + aGc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); + aGc.SetBrushColor( TRgb::Color16MA( 0 ) ); + aGc.Clear( rect ); //DrawRect( rect ); + PRINT( _L("Camera <= CCamBatteryPaneDrawer::ClearBattery") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::LoadLayoutsL +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneDrawer::LoadLayoutsL() + { + PRINT( _L("Camera => CCamBatteryPaneDrawer::LoadLayoutsL") ); + if ( CamUtility::IsNhdDevice() ) + { + TouchLayoutL(); + } + else + { + NonTouchLayoutL(); + } + } + + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::BatteryStrengthIconHeight +// --------------------------------------------------------------------------- +// +TInt CCamBatteryPaneDrawer::BatteryStrengthIconHeight( TInt aLevel ) const + { + TInt cellHeight = KCamDefaultBatteryCellHeight; + if ( iBatteryStrengthIcon ) + { + cellHeight = iBatteryStrengthIcon->BitmapSize().iHeight / + KMaxBatteryStrength; + } + return ( aLevel * cellHeight ) + KCamDefaultBatteryCellMargin; + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::DeleteIcons +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneDrawer::DeleteIcons() + { + delete iBatteryIcon; + iBatteryIcon = NULL; + delete iBatteryStrengthIcon; + iBatteryStrengthIcon = NULL; + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::HandleResourceChange +// --------------------------------------------------------------------------- +// +void CCamBatteryPaneDrawer::HandleResourceChange( TInt /* aType */ ) + { + PRINT( _L("Camera => CCamBatteryPaneDrawer::HandleResourceChange") ); + + // Called when either skin or color scheme has changed. + // We need to reload icons and re-create the battery color bitmap. + + + // Reload icons + TRAP_IGNORE(LoadIconsL()); + TRAP_IGNORE(LoadLayoutsL()); + + PRINT( _L("Camera <= CCamBatteryPaneDrawer::HandleResourceChange") ); + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::NonTouchLayout +// --------------------------------------------------------------------------- +void CCamBatteryPaneDrawer::NonTouchLayoutL() + { + TRect screen; + TAknLayoutRect indicatorsPane; + TAknLayoutRect batteryPane; + TInt cba = AknLayoutUtils::CbaLocation() == + AknLayoutUtils::EAknCbaLocationLeft? + AknLayoutUtils::EAknCbaLocationLeft : 0; + + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + indicatorsPane.LayoutRect( screen, + AknLayoutScalable_Apps::cam6_indi_pane( cba )); + batteryPane.LayoutRect( indicatorsPane.Rect(), + AknLayoutScalable_Apps::cam6_battery_pane( cba ) ); + iRect = batteryPane.Rect(); + + // Battery icon + if ( iBatteryIcon ) + { + iBatteryIcon->SetLayoutL( iRect, + AknLayoutScalable_Apps::cam6_battery_pane_g1( cba )); + } + + // Battery strength icon + if ( iBatteryStrengthIcon ) + { + iBatteryStrengthIcon->SetLayoutL( iRect, + AknLayoutScalable_Apps::cam6_battery_pane_g2( cba )); + } + } + +// --------------------------------------------------------------------------- +// CCamBatteryPaneDrawer::TouchLayoutL +// --------------------------------------------------------------------------- +void CCamBatteryPaneDrawer::TouchLayoutL() + { + TRect screen; + TAknLayoutRect indicatorsPane; + TAknLayoutRect batteryPane; + TInt var = Layout_Meta_Data::IsLandscapeOrientation(); + + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); + indicatorsPane.LayoutRect( screen, + AknLayoutScalable_Apps::cam4_indicators_pane( var ).LayoutLine() ); + batteryPane.LayoutRect( indicatorsPane.Rect(), + AknLayoutScalable_Apps::cam4_battery_pane( var ).LayoutLine() ); + iRect = batteryPane.Rect(); + + // Battery icon + if ( iBatteryIcon ) + { + iBatteryIcon->SetLayoutL( iRect, + AknLayoutScalable_Apps::cam4_battery_pane_g2( var ).LayoutLine() ); + } + + // Battery strength icon + if ( iBatteryStrengthIcon ) + { + iBatteryStrengthIcon->SetLayoutL( iRect, + AknLayoutScalable_Apps::cam4_battery_pane_g1( var ).LayoutLine() ); + } + } + +// End of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cambitmapitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cambitmapitem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,212 @@ +/* +* 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 for rendering bitmap based indicators +* +*/ + + +#include "cambitmapitem.h" +#include "AknLayout2ScalableDef.h" +#include "AknLayoutFont.h" +#include "CamUtility.h" +#include "CamPanic.h" + +#include +#include +#include + +#include + +_LIT( KCamBitmapFile, "z:\\resource\\apps\\cameraapp.mif" ); + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamBitmapItem::CCamBitmapItem() + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamBitmapItem::~CCamBitmapItem() + { + delete iBitmap; + delete iMask; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamBitmapItem* CCamBitmapItem::NewL( + TInt aBitmapId, + TInt aMaskId ) + { + CCamBitmapItem* self = new ( ELeave ) CCamBitmapItem(); + CleanupStack::PushL( self ); + self->ConstructL( aBitmapId, aMaskId ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamBitmapItem* CCamBitmapItem::NewL( + TInt aBitmapId, + TInt aMaskId, + const TAknsItemID& aID ) + { + CCamBitmapItem* self = new ( ELeave ) CCamBitmapItem(); + CleanupStack::PushL( self ); + self->ConstructL( aBitmapId, aMaskId, aID ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamBitmapItem::ConstructL( TInt aBitmapId, TInt aMaskId ) + { + AknIconUtils::CreateIconL( + iBitmap, + iMask, + KCamBitmapFile, + aBitmapId, + aMaskId ); + + // If SizeInPixels() return zero size, this is a scalable icon + iScalableIcon = iBitmap->SizeInPixels() == TSize( 0, 0 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamBitmapItem::ConstructL( + TInt aBitmapId, TInt aMaskId, const TAknsItemID& aID ) + { + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + + AknsUtils::CreateIconL( + skinInstance, + aID, + iBitmap, + iMask, + KCamBitmapFile, + aBitmapId, + aMaskId ); + + // If SizeInPixels() return zero size, this is a scalable icon + iScalableIcon = iBitmap->SizeInPixels() == TSize( 0, 0 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamBitmapItem::SetLayoutL( + const TRect& aParentRect, + const TAknWindowComponentLayout& aLayout ) + { + TAknLayoutRect layout; + layout.LayoutRect( aParentRect, aLayout.LayoutLine() ); + SetLayoutL( layout.Rect() ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamBitmapItem::SetLayoutL( + const TRect& aRect ) + { + if ( iRect != aRect ) + { + iRect = aRect; + if ( iBitmap && iScalableIcon ) + { + AknIconUtils::SetSize( iBitmap, iRect.Size() ); + } + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamBitmapItem::Draw( CBitmapContext& aBitmapContext ) const + { + TRect cropRect(TPoint(0,0),iRect.Size()); + DrawPartial( aBitmapContext, iRect, cropRect ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamBitmapItem::DrawPartial( + CBitmapContext& aBitmapContext, + const TRect& aDestRect, + const TRect& aCropRect ) const + { + if ( iBitmap && iMask ) + { + // Alpha channel based rendering + aBitmapContext.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); + aBitmapContext.BitBltMasked( + aDestRect.iTl + aCropRect.iTl, + iBitmap, + aCropRect, + iMask, + EFalse); + } + else + { + // Do nothing + } + } + +// --------------------------------------------------------------------------- +// CCamBitmapItem::BitmapSize +// --------------------------------------------------------------------------- +// +TSize CCamBitmapItem::BitmapSize() const + { + if ( iBitmap ) + { + return iBitmap->SizeInPixels(); + } + else + { + return iRect.Size(); + } + } + +// --------------------------------------------------------------------------- +// CCamBitmapItem::LayoutRect +// --------------------------------------------------------------------------- +// +TRect CCamBitmapItem::LayoutRect() const + { + return iRect; + } + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/CamCamera.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/CamCamera.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,967 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + + + +/* +* Refer CCamCamera.h +* Implementing the Interfaces defined in CCamCamera class duplicating the definitions +* for Emulator Ennvironment +*/ + +#include +#include "CamCamera.h" // Interface declarations +#include +#include "CamCamera.hrh" // Constants and Possible Events definitions +#include "camcameracontroller.pan" // Panic category and codes (use cameracontroller's) +#include "camcameracontrollertypes.h" +#include +#include +#include "CamCameraCallback.h" +#include "CameraappTestBitmapManager.h" + + +using namespace NCamCameraController; + +// --------------------------------------------------------------------------- +// NewL +// --------------------------------------------------------------------------- +// +CCamCamera* +CCamCamera::NewL( MCameraObserver2& aObserver, + TInt aCameraIndex, + TInt aPriority ) + { + CCamCamera* self = new (ELeave) CCamCamera + ( aObserver, + aCameraIndex, + aPriority + ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// New2L +// --------------------------------------------------------------------------- +// +CCamCamera* +CCamCamera::New2L( MCameraObserver2& aObserver, + TInt aCameraIndex, + TInt aPriority ) + { + return CCamCamera::NewL( aObserver, aCameraIndex, aPriority ); + } + +// --------------------------------------------------------------------------- +// NewL +// --------------------------------------------------------------------------- +// +CCamCamera* +CCamCamera::NewL( MCameraObserver& aObserver, + TInt aCameraIndex ) + { + CCamCamera* self = new (ELeave) CCamCamera( aObserver, aCameraIndex ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// New2L +// --------------------------------------------------------------------------- +// +CCamCamera* +CCamCamera::New2L( MCameraObserver& /*aObserver */, + TInt /*aCameraIndex*/ ) + { + // Also CCamera implementation rejects New2L + MCameraObserver(1) + User::Leave( KErrNotSupported ); + return NULL; + } + +// --------------------------------------------------------------------------- +// ~CCamCamera +// --------------------------------------------------------------------------- +// +/* +* CCamCamera::NewDuplicateL +*/ +CCamCamera* +CCamCamera::NewDuplicateL( MCameraObserver2& /*aObserver*/, + TInt /*aCameraHandle*/ ) + { + User::Leave( KErrNotSupported ); + return NULL; + } + +// --------------------------------------------------------------------------- +// NewDuplicate2L +// --------------------------------------------------------------------------- +// +CCamCamera* +CCamCamera::NewDuplicate2L( MCameraObserver2& /*aObserver*/, + TInt /*aCameraHandle*/ ) + { + User::Leave( KErrNotSupported ); + return NULL; + } + + +// --------------------------------------------------------------------------- +// NewDuplicateL +// --------------------------------------------------------------------------- +// +CCamCamera* +CCamCamera::NewDuplicateL( MCameraObserver& /*aObserver*/, + TInt /*aCameraHandle*/ ) + { + User::Leave( KErrNotSupported ); + return NULL; + } + +// --------------------------------------------------------------------------- +// NewDuplicate2L +// --------------------------------------------------------------------------- +// +CCamCamera* +CCamCamera::NewDuplicate2L( MCameraObserver& /*aObserver*/, + TInt /*aCameraHandle*/ ) + { + User::Leave( KErrNotSupported ); + return NULL; + } + +// --------------------------------------------------------------------------- +// ~CCamCamera +// --------------------------------------------------------------------------- +// +CCamCamera::~CCamCamera() + { + iPhotoResolutions.Reset(); + delete iCallBackActive; + delete iBitmapManager; + if( iVfPeriodic ) + { + iVfPeriodic->Cancel(); + delete iVfPeriodic; + } + } + + + + + +// --------------------------------------------------------------------------- +// CamerasAvailable +// --------------------------------------------------------------------------- +// +TInt +CCamCamera::CamerasAvailable() + { + return 2; + } + + +// --------------------------------------------------------------------------- +// Reserve +// --------------------------------------------------------------------------- +// +void +CCamCamera::Reserve() + { + TInt status = KErrNone; + if ( ECamIdle == iState ) + { + iState |= ECamReserved; + } + else + { + status = KErrInUse; + } + + User::After( KDelayReserve ); + + if ( iCallBackActive ) + { + iCallBackActive->ReserveCompleteRequest( status ); + } + } + + +// --------------------------------------------------------------------------- +// PowerOn +// --------------------------------------------------------------------------- +// +void +CCamCamera::PowerOn() + { + TInt status = KErrNone; + + if ( ECamIdle == iState ) status = KErrNotReady; + else if ( ECamReserved != iState ) status = KErrInUse; + else iState |= ECamPowerOn; + + User::After( KDelayPowerOn ); + + if ( iCallBackActive ) + { + iCallBackActive->PowerOnCompleteRequest( status ); + } + } + +// --------------------------------------------------------------------------- +// Release +// --------------------------------------------------------------------------- +// +void +CCamCamera::Release() + { + iState = ECamIdle; + } + +// --------------------------------------------------------------------------- +// PowerOff +// --------------------------------------------------------------------------- +// + void CCamCamera::PowerOff() + { + iState = ECamIdle | ECamReserved; + + User::After( KDelayPowerOff ); + } + + +// --------------------------------------------------------------------------- +// Handle +// --------------------------------------------------------------------------- +// +TInt +CCamCamera::Handle() + { + return KCameraHandle; + }; + +// --------------------------------------------------------------------------- +// SetZoomFactorL +// --------------------------------------------------------------------------- +// +void +CCamCamera::SetZoomFactorL( TInt aZoomFactor ) + { + if( Rng( iInfo.iMinZoom, aZoomFactor, iInfo.iMaxZoom ) ) + { + iZoomFactor = aZoomFactor; + } + else + { + User::Leave( KErrNotSupported ); + } + } + +// --------------------------------------------------------------------------- +// ZoomFactor +// --------------------------------------------------------------------------- +// +TInt +CCamCamera::ZoomFactor() const + { + return iZoomFactor; + } + +// --------------------------------------------------------------------------- +// SetDigitalZoomFactorL +// --------------------------------------------------------------------------- +// +void +CCamCamera::SetDigitalZoomFactorL( TInt aDigitalZoomFactor ) + { + if( Rng( 0, aDigitalZoomFactor, iInfo.iMaxDigitalZoom ) ) + { + iDigitalZoom = aDigitalZoomFactor; + } + else + { + User::Leave( KErrNotSupported ); + } + } + +// --------------------------------------------------------------------------- +// DigitalZoomFactor +// --------------------------------------------------------------------------- +// +TInt +CCamCamera::DigitalZoomFactor() const + { + return iDigitalZoom; + } + +// --------------------------------------------------------------------------- +// SetContrastL +// --------------------------------------------------------------------------- +// +void +CCamCamera::SetContrastL( TInt aContrast ) + { + if( EContrastAuto == aContrast ) + { + iContrast = EContrastAuto; + } + else if( Rng( -100, aContrast, 100 ) ) + { + iContrast = aContrast; + } + else + { + User::Leave( KErrNotSupported ); + } + } + +// --------------------------------------------------------------------------- +// Contrast +// --------------------------------------------------------------------------- +// +TInt +CCamCamera::Contrast() const + { + return iContrast; + } + + +// --------------------------------------------------------------------------- +// SetBrightnessL +// --------------------------------------------------------------------------- +// +void +CCamCamera::SetBrightnessL(TInt aBrightness) + { + if( EContrastAuto == aBrightness ) + { + iBrightness = EBrightnessAuto; + } + else if( Rng( -100, aBrightness, 100 ) ) + { + iBrightness = aBrightness; + } + else + { + User::Leave( KErrNotSupported ); + } + } + +// --------------------------------------------------------------------------- +// Brightness +// --------------------------------------------------------------------------- +// +TInt +CCamCamera::Brightness() const + { + return iBrightness; + } + +// --------------------------------------------------------------------------- +// SetFlashL +// --------------------------------------------------------------------------- +// +void +CCamCamera::SetFlashL( TFlash aFlash ) + { + if( CCamCamera::EFlashNone == aFlash // Zero, so need special attention + || KFlashModeSupport & aFlash ) iFlash = aFlash; + else User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// Flash +// --------------------------------------------------------------------------- +// +CCamCamera::TFlash +CCamCamera::Flash() const + { + return iFlash; + } + +// --------------------------------------------------------------------------- +// SetExposureL +// --------------------------------------------------------------------------- +// +void +CCamCamera::SetExposureL(TExposure aExposure ) + { + if( CCamCamera::EExposureAuto == aExposure + || KExposureSupport & aExposure ) iExposure = aExposure; + else User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// Exposure +// --------------------------------------------------------------------------- +// +CCamCamera::TExposure +CCamCamera::Exposure() const + { + return iExposure; + } + +// --------------------------------------------------------------------------- +// SetWhiteBalanceL +// --------------------------------------------------------------------------- +// +void +CCamCamera::SetWhiteBalanceL( TWhiteBalance aWhiteBalance ) + { + if( CCamCamera::EWBAuto == aWhiteBalance + || KWBSupport & aWhiteBalance ) iWhiteBalance = aWhiteBalance; + else User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// WhiteBalance +// --------------------------------------------------------------------------- +// +CCamCamera::TWhiteBalance +CCamCamera::WhiteBalance() const + { + return iWhiteBalance; + } + + +// --------------------------------------------------------------------------- +// StartViewFinderDirectL +// --------------------------------------------------------------------------- +// +void +CCamCamera::StartViewFinderDirectL( RWsSession& /*aWs*/, + CWsScreenDevice& /*aScreenDevice*/, + RWindowBase& /*aWindow*/, + TRect& /*aScreenRect*/ ) + { + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// StartViewFinderDirectL +// --------------------------------------------------------------------------- +// +void +CCamCamera::StartViewFinderDirectL( RWsSession& /*aWs*/, + CWsScreenDevice& /*aScreenDevice*/, + RWindowBase& /*aWindow*/, + TRect& /*aScreenRect*/, + TRect& /*aClipRect*/ ) + { + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// StartViewFinderBitmapsL +// --------------------------------------------------------------------------- +// +void +CCamCamera::StartViewFinderBitmapsL( TSize& aSize ) + { + iViewfinderSize = aSize; + + iVfPeriodic->Start( KVfFrameInterval, + KVfFrameInterval, + TCallBack( ViewfinderCallBack, this ) + ); + + iState |= ECamVFOn; + } + +// --------------------------------------------------------------------------- +// StartViewFinderBitmapsL +// --------------------------------------------------------------------------- +// +void +CCamCamera::StartViewFinderBitmapsL( TSize& aSize, + TRect& aClipRect ) + { + StartViewFinderBitmapsL( aSize ); + aSize = iViewfinderSize; + aClipRect = TRect( iViewfinderSize ); + } + +// --------------------------------------------------------------------------- +// StartViewFinderL +// --------------------------------------------------------------------------- +// +void +CCamCamera::StartViewFinderL( TFormat /*aImageFormat*/, + TSize& /*aSize*/ ) + { + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// StartViewFinderL +// --------------------------------------------------------------------------- +// +void +CCamCamera::StartViewFinderL( TFormat /*aImageFormat*/, + TSize& /*aSize*/, + TRect& /*aClipRect*/ ) + { + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// StopViewFinder +// --------------------------------------------------------------------------- +// +void +CCamCamera::StopViewFinder() + { + // Stop the viewfinder frames + iVfPeriodic->Cancel(); + + iState &= ~ECamVFOn; + } + +// --------------------------------------------------------------------------- +// ViewFinderActive +// --------------------------------------------------------------------------- +// +TBool +CCamCamera::ViewFinderActive() const + { + return ( iState & ECamVFOn ); + } + +// --------------------------------------------------------------------------- +// SetViewFinderMirrorL +// --------------------------------------------------------------------------- +// +void +CCamCamera::SetViewFinderMirrorL( TBool aMirror ) + { + iViewFinderMirror = aMirror; + } + +// --------------------------------------------------------------------------- +// ViewFinderMirror +// --------------------------------------------------------------------------- +// +TBool +CCamCamera::ViewFinderMirror() const + { + return iViewFinderMirror; + } + +// --------------------------------------------------------------------------- +// PrepareImageCaptureL +// --------------------------------------------------------------------------- +// + void +CCamCamera::PrepareImageCaptureL( TFormat aImageFormat, TInt aSizeIndex ) + { + TRect temp; + PrepareImageCaptureL( aImageFormat, aSizeIndex, temp ); + } + +// --------------------------------------------------------------------------- +// PrepareImageCaptureL +// --------------------------------------------------------------------------- +// +void +CCamCamera::PrepareImageCaptureL( TFormat aImageFormat, + TInt aSizeIndex, + const TRect& /*aClipRect*/ ) + { + if( ECamPowerOn & iState ) + { + TSize size; + EnumerateCaptureSizes( size, aSizeIndex, aImageFormat ); + iState |= ECamImageOn; + } + else + { + User::Leave( KErrNotReady ); + } + } + +// --------------------------------------------------------------------------- +// CaptureImage +// --------------------------------------------------------------------------- +// +void +CCamCamera::CaptureImage() + { + if ( iCallBackActive ) + { + iCallBackActive->RequestCaptureImage(); + } + } + +// --------------------------------------------------------------------------- +// CancelCaptureImage +// --------------------------------------------------------------------------- +// +void +CCamCamera::CancelCaptureImage() + { + + // In Wins we dont exactly start any async method + // to capture the image. + } + +// --------------------------------------------------------------------------- +// EnumerateCaptureSizes +// --------------------------------------------------------------------------- +/// +void +CCamCamera::EnumerateCaptureSizes( TSize& aSize, + TInt aSizeIndex, + TFormat aFormat ) const + { + switch( aFormat ) + { + // ----------------------------------------------------- + case EFormatJpeg: + // + // switch( aSizeIndex ) + // { + aSize = iPhotoResolutions[ aSizeIndex ]; + // case 0: aSize = KImageSizeJpegCam1; break; + // default: aSize = TSize(); break; + // } + break; + // ----------------------------------------------------- + case EFormatExif: + // switch( aSizeIndex ) + // { + aSize = iPhotoResolutions[ aSizeIndex ]; + // case 0: aSize = KImageSizeExifCam1; break; + // default: aSize = TSize(); break; + // } + break; + // ----------------------------------------------------- + default: + aSize = TSize(); + break; + // ----------------------------------------------------- + } + } + +// --------------------------------------------------------------------------- +// PrepareVideoCaptureL +// --------------------------------------------------------------------------- +// +void +CCamCamera::PrepareVideoCaptureL( TFormat /*aFormat*/, + TInt /*aSizeIndex*/, + TInt /*aRateIndex*/, + TInt /*aBuffersToUse*/, + TInt /*aFramesPerBuffer*/ ) + { + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// PrepareVideoCaptureL +// --------------------------------------------------------------------------- +// +void +CCamCamera::PrepareVideoCaptureL( TFormat /*aFormat*/, + TInt /*aSizeIndex*/, + TInt /*aRateIndex*/, + TInt /*aBuffersToUse*/, + TInt /*aFramesPerBuffer*/, + const TRect& /*aClipRect*/ ) + { + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// StartVideoCapture +// --------------------------------------------------------------------------- +// +void +CCamCamera::StartVideoCapture() + { + Panic( ECamCameraControllerUnsupported ); + } + +// --------------------------------------------------------------------------- +// StopVideoCapture +// --------------------------------------------------------------------------- +// +void +CCamCamera::StopVideoCapture() + { + Panic( ECamCameraControllerUnsupported ); + } + +// --------------------------------------------------------------------------- +// VideoCaptureActive +// --------------------------------------------------------------------------- +// +TBool +CCamCamera::VideoCaptureActive() const + { + return EFalse; + } + +// --------------------------------------------------------------------------- +// EnumerateVideoFrameSizes +// --------------------------------------------------------------------------- +// +void +CCamCamera::EnumerateVideoFrameSizes( TSize& /*aSize*/, + TInt /*aSizeIndex*/, + TFormat /*aFormat*/ ) const + { + // Video not supported + Panic( ECamCameraControllerUnsupported ); + } + +// --------------------------------------------------------------------------- +// EnumerateVideoFrameRates +// --------------------------------------------------------------------------- +// +void +CCamCamera::EnumerateVideoFrameRates( + TReal32& /*aRate*/, + TInt /*aRateIndex*/, + TFormat /*aFormat*/, + TInt /*aSizeIndex*/, + CCamCamera::TExposure /*aExposure*/ ) const + { + // Video not supported + Panic( ECamCameraControllerUnsupported ); + } + + +// --------------------------------------------------------------------------- +// GetFrameSize +// --------------------------------------------------------------------------- +// +void +CCamCamera::GetFrameSize( TSize& /*aSize*/ ) const + { + // Video not supported + Panic( ECamCameraControllerUnsupported ); + } + +// --------------------------------------------------------------------------- +// FrameRate +// --------------------------------------------------------------------------- +// +TReal32 +CCamCamera::FrameRate() const + { + // Video not supported + Panic( ECamCameraControllerUnsupported ); + + return 0; + } + +// --------------------------------------------------------------------------- +// BuffersInUse +// --------------------------------------------------------------------------- +// +TInt +CCamCamera::BuffersInUse() const + { + // Not sure + return 1; + } + +// --------------------------------------------------------------------------- +// FramesPerBuffer +// --------------------------------------------------------------------------- +// +TInt +CCamCamera::FramesPerBuffer() const + { + return 1; + } + +// --------------------------------------------------------------------------- +// SetJpegQuality +// --------------------------------------------------------------------------- +// +void +CCamCamera::SetJpegQuality( TInt aQuality ) + { + iQuality = Min( 100, Max( 0, aQuality ) ); + } + +// --------------------------------------------------------------------------- +// JpegQuality +// --------------------------------------------------------------------------- +// +TInt +CCamCamera::JpegQuality() const + { + return iQuality; + } + +// --------------------------------------------------------------------------- +// CustomInterface +// --------------------------------------------------------------------------- +// +TAny* +CCamCamera::CustomInterface( TUid /*aInterface*/ ) + { + return NULL; + } + +// --------------------------------------------------------------------------- +// CameraInfo +// --------------------------------------------------------------------------- +// +void +CCamCamera::CameraInfo( TCameraInfo& aInfo ) const + { + aInfo.iHardwareVersion = TVersion( 0, 0, 2007 ); /** Version number and name of camera hardware. */ + aInfo.iSoftwareVersion = TVersion( 0, 0, 2007 ); /** Version number and name of camera software (device driver). */ + aInfo.iOrientation = TCameraInfo::EOrientationUnknown; + aInfo.iOptionsSupported = KOptionsSupport; + aInfo.iFlashModesSupported = KFlashModeSupport; + aInfo.iExposureModesSupported = KExposureSupport; + aInfo.iWhiteBalanceModesSupported = KWBSupport; + aInfo.iMinZoom = 0; + aInfo.iMaxZoom = 100; + aInfo.iMaxDigitalZoom = 100; + aInfo.iMinZoomFactor = 1.0; + aInfo.iMaxZoomFactor = 10.0; + aInfo.iMaxDigitalZoomFactor = 10.0; + // aInfo.iNumImageSizesSupported = 1; + aInfo.iNumImageSizesSupported = iPhotoResolutions.Count(); + aInfo.iImageFormatsSupported = (iCameraIndex == 0)? KImageFormatSupportCAM1 : KImageFormatSupportCAM2;; + aInfo.iNumVideoFrameSizesSupported = 1; + aInfo.iNumVideoFrameRatesSupported = 1; + aInfo.iVideoFrameFormatsSupported = (iCameraIndex == 0)? KVideoFormatSupportCAM1 : KVideoFormatSupportCAM2;; + aInfo.iMaxFramesPerBufferSupported = 1; + aInfo.iMaxBuffersSupported = 2; + } + + +// --------------------------------------------------------------------------- +// InitPhotoResolutionsL +// --------------------------------------------------------------------------- +// +void CCamCamera::InitPhotoResolutionsL() + { + iPhotoResolutions.Append( TSize( 640, 480 ) ); // VGA + iPhotoResolutions.Append( TSize( 800, 600 ) ); // SVGA + iPhotoResolutions.Append( TSize( 1024, 768 ) ); // XGA + iPhotoResolutions.Append( TSize( 1152, 864 ) ); // 1 MP + iPhotoResolutions.Append( TSize( 1280, 960 ) ); // 1.3 MP + iPhotoResolutions.Append( TSize( 1600, 1200 ) ); // 2 MP + iPhotoResolutions.Append( TSize( 2048, 1536 ) ); // 3 MP + iPhotoResolutions.Append( TSize( 2592, 1944 ) ); // 5 MP + iPhotoResolutions.Append( TSize( 3264, 2448 ) ); // 8 MP + iPhotoResolutions.Append( TSize( 4000, 3000 ) ); // 12 MP + iPhotoResolutions.Append( TSize( 3264, 1832 ) ); // 6 MP 16:9 + iPhotoResolutions.Append( TSize( 4000, 2248 ) ); // 9 MP 16:9 + iPhotoResolutions.Append( TSize( 354, 288 ) ); // CIF + iPhotoResolutions.Append( TSize( 320, 240 ) ); // QVGA + } + + +// --------------------------------------------------------------------------- +// ViewfinderCallBack +// --------------------------------------------------------------------------- +// +TInt +CCamCamera::ViewfinderCallBack( TAny* aSelf ) + { + CCamCamera* self = static_cast( aSelf ); + if( self && self->iObserver ) + { + self->iObserver->ViewFinderFrameReady( self->iBitmapManager->NextBitmap() ); + } + return KErrNone; + } + +// =========================================================================== +// Constructors + + +// --------------------------------------------------------------------------- +// 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamCamera::ConstructL() + { + InitPhotoResolutionsL(); + iBitmapManager = CCameraappTestBitmapManager::NewL(); + iVfPeriodic = CPeriodic::NewL( EPriorityLow ); + iCallBackActive = CCamCameraCallBack::NewL( *iObserver ); + + CameraInfo( iInfo ); + } + + +// --------------------------------------------------------------------------- +// 1st phase constructor +// CCamCamera::CCamCamera +// --------------------------------------------------------------------------- +// +CCamCamera::CCamCamera( MCameraObserver& aObserver, TInt aCameraIndex ) + : iObserver ( &aObserver ), + iState ( ECamIdle ), + iCameraIndex( aCameraIndex ) + { + } + +// --------------------------------------------------------------------------- +// CCamCamera::CCamCamera +// +// --------------------------------------------------------------------------- +// +CCamCamera::CCamCamera( MCameraObserver2& aObserver,TInt aCameraIndex, TInt aPriority ) + : iObserver2 ( &aObserver ), + iState ( ECamIdle ), + iCameraIndex( aCameraIndex ), + iPriority ( aPriority ) + { + } + + +void CCamCamera::Construct2L(MCameraObserver& /*aObserver*/, TInt /*aCameraIndex*/) + { + // not implemented + } + +void CCamCamera::Construct2DupL(MCameraObserver& /*aObserver*/, TInt /*aCameraHandle*/) + { + // not implemented + } + +void CCamCamera::Construct2L(MCameraObserver2& /*aObserver*/, TInt /*aCameraIndex*/, TInt /*aPriority*/) + { + // not implemented + } + +void CCamCamera::Construct2DupL(MCameraObserver2& /*aObserver*/, TInt /*aCameraHandle*/) + { + // not implemented + } + + +// end of file + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/CamCameraCallback.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/CamCameraCallback.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,294 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Emualtor support for CCamCameraController part of cameraapp* +*/ + + + +#include "CamCameraCallback.h" +#include "CameraappTestBitmapManager.h" +#include +#include +#include + +_LIT(KImageFile, "c:\\private\\101F857A\\capture.jpg"); + + +/* +* CCamCameraCallBack* CCamCameraCallBack::NewL +*/ +CCamCameraCallBack* CCamCameraCallBack::NewL( + MCameraObserver& aController ) + { + CCamCameraCallBack* self = new( ELeave ) CCamCameraCallBack( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +/* +* CCamCameraCallBack::CCamCameraCallBack +*/ +CCamCameraCallBack::CCamCameraCallBack( + MCameraObserver& aController ) + : CActive( EPriorityLow ), + iController( aController ) + { + } + +/* +* CCamCameraCallBack::ConstructL() +*/ +void CCamCameraCallBack::ConstructL() + { + CActiveScheduler::Add( this ); + iBitmapManager = CCameraappTestBitmapManager::NewL(); + } + +/* +* CCamCameraCallBack::DoCancel +*/ +void CCamCameraCallBack::DoCancel() + { + // Status update flags + iViewFinderFrame = EFalse; + iStillPrepareComplete = EFalse; + iReserveComplete = EFalse; + iPowerOnComplete = EFalse; + iCaptureImage = EFalse; + + // Error status associated with each request + iReserveError = KErrNone; + iPowerOnError = KErrNone; + } + +/* +* CCamCameraCallBack::~CCamCameraCallBack +*/ +CCamCameraCallBack::~CCamCameraCallBack() + { + delete iBitmapManager; + Cancel(); + } + +/* +* CCamCameraCallBack::Cancel +*/ +/* +void CCamCameraCallBack::Cancel() + { + CActive::Cancel(); + DoCancel(); + } +*/ + +/* +* CCamCameraCallBack::RunL +*/ +void CCamCameraCallBack::RunL() + { + if ( iStillPrepareComplete ) + { + DoStillPrepareComplete(); + } + else if ( iReserveComplete ) + { + DoReserveComplete(); + } + else if ( iPowerOnComplete ) + { + DoPowerOnComplete(); + } + else if ( iCaptureImage ) + { + DoCaptureImageL(); + } + else + { + } + if ( iViewFinderFrame ) + { + DoViewFinderFrame(); + } + } + +/* +* CCamCameraCallBack::SetActiveAndCompleteRequest +*/ +void CCamCameraCallBack::SetActiveAndCompleteRequest() + { + SetActive(); + TRequestStatus* statusPtr = &iStatus; + User::RequestComplete( statusPtr, KErrNone ); + } + + +/* +* CCamCameraCallBack::ReserveCompleteRequest +*/ +void +CCamCameraCallBack::ReserveCompleteRequest( const TInt aError ) + { + iReserveError = aError; + iReserveComplete = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +/* +* CCamCameraCallBack::PowerOnCompleteRequest +*/ +void +CCamCameraCallBack::PowerOnCompleteRequest( const TInt aError ) + { + iPowerOnError = aError; + iPowerOnComplete = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + + +/* +* CCamCameraCallBack::StillPrepareComplete +*/ +void CCamCameraCallBack::StillPrepareComplete() + { + iStillPrepareComplete = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +/* +* CCamCameraCallBack::SendViewFinderFrames +*/ +void CCamCameraCallBack::SendViewFinderFrames() + { + iViewFinderFrame = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +/* +* CCamCameraCallBack::StopViewFinderFrames +*/ +void CCamCameraCallBack::StopViewFinderFrames() + { + iViewFinderFrame = EFalse; + } + +/* +* CCamCameraCallBack::RequestCaptureImage +*/ +void CCamCameraCallBack::RequestCaptureImage() + { + iCaptureImage = ETrue; + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + +/* +* CCamCameraCallBack::DoReserveComplete +*/ +void CCamCameraCallBack::DoReserveComplete() + { + iController.ReserveComplete( iReserveError ); + iReserveComplete = EFalse; + } + +/* +* CCamCameraCallBack::DoPowerOnComplete +*/ +void CCamCameraCallBack::DoPowerOnComplete() + { + iController.PowerOnComplete( iPowerOnError ); + iPowerOnComplete = EFalse; + } + + +/* +* CCamCameraCallBack::DoStillPrepareComplete +*/ +void CCamCameraCallBack::DoStillPrepareComplete() + { + iStillPrepareComplete = EFalse; + } + + +/* +* CCamCameraCallBack::DoViewFinderFrame +*/ +void CCamCameraCallBack::DoViewFinderFrame() + { + iController.ViewFinderFrameReady( iBitmapManager->NextBitmap() ); + + if ( iViewFinderFrame ) + { + if ( !IsActive() ) + { + SetActiveAndCompleteRequest(); + } + } + + } + +/* +* CCamCameraCallBack::DoCaptureImageL +*/ +void CCamCameraCallBack::DoCaptureImageL() + { + iCaptureImage = EFalse; + TInt imageIndex = 0; + + // Connect to fs + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + + // Open file and get size + RFile file; + TInt size = 0; + User::LeaveIfError( file.Open( fs, KImageFile, EFileRead ) ); + CleanupClosePushL( file ); + User::LeaveIfError( file.Size( size ) ); + + // Allocate memory + HBufC8* data = HBufC8::NewL( size ); + TPtr8 dataDes = data->Des(); + + + // Read file content + TInt read = file.Read( dataDes, size ); + + // Clean up + CleanupStack::PopAndDestroy( &file ); + CleanupStack::PopAndDestroy( &fs ); + + // Give data to controller + iController.ImageReady( NULL, data, KErrNone ); + } + + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/CameraappTestBitmapManager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/CameraappTestBitmapManager.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dummy controller class for Cameraapp Unit Tests* +*/ + + + +// INCLUDE FILES +#include "CameraappTestBitmapManager.h" + +// EXTERNAL DATA STRUCTURES +//extern ?external_data; + +// EXTERNAL FUNCTION PROTOTYPES +//extern ?external_function( ?arg_type,?arg_type ); + +// CONSTANTS +const TInt KMaxBitmaps = 3; + +// MACROS +//#define ?macro ?macro_def + +// LOCAL CONSTANTS AND MACROS +//const ?type ?constant_var = ?constant; +//#define ?macro_name ?macro_def + +// MODULE DATA STRUCTURES +//enum ?declaration +//typedef ?declaration + +// LOCAL FUNCTION PROTOTYPES +//?type ?function_name( ?arg_type, ?arg_type ); + +// FORWARD DECLARATIONS +//class ?FORWARD_CLASSNAME; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCameraappTestBitmapManager::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCameraappTestBitmapManager* CCameraappTestBitmapManager::NewL() + { + CCameraappTestBitmapManager* self = new( ELeave ) CCameraappTestBitmapManager; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// Destructor +CCameraappTestBitmapManager::~CCameraappTestBitmapManager() + { + iBitmaps.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// CCameraappTestBitmapManager::SnapshotImage +// Get post-exposure snapshot bitmap, if available. +// +// Returns: pointer to post-exposure snapshot bitmap. Does not transfer ownership. +// May be NULL if no image available. +// +// --------------------------------------------------------------------------- +// +CFbsBitmap& CCameraappTestBitmapManager::Bitmap( TInt aBitmapIndex ) const + { + if ( aBitmapIndex < iBitmaps.Count() ) + { + return *( iBitmaps[aBitmapIndex] ); + } + else + { + return *( iBitmaps[iBitmaps.Count() - 1] ); + } + } + +CFbsBitmap& CCameraappTestBitmapManager::NextBitmap() + { + IncrementBitmapIndex(); + return *(iBitmaps[iBitmapIndex]); + } + +// ----------------------------------------------------------------------------- +// CCameraappTestBitmapManager::CCameraappTestBitmapManager +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCameraappTestBitmapManager::CCameraappTestBitmapManager() +: iBitmapIndex( -1 ) + { + } + +// ----------------------------------------------------------------------------- +// CCameraappTestBitmapManager::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCameraappTestBitmapManager::ConstructL() + { + // load test bitmaps + _LIT( bitmapFile, "z:\\system\\apps\\cameraapp\\DummyViewFinder.mbm" ); + + for ( TInt i = 0 ; i < KMaxBitmaps; i++ ) + { + CFbsBitmap* bitmap = new( ELeave ) CFbsBitmap; + CleanupStack::PushL( bitmap ); + + User::LeaveIfError( bitmap->Load( bitmapFile, i ) ); + User::LeaveIfError( iBitmaps.Append( bitmap ) ); + CleanupStack::Pop( bitmap ); + } + } + +void CCameraappTestBitmapManager::IncrementBitmapIndex() + { + iBitmapIndex = ++iBitmapIndex % iBitmaps.Count(); + } + +// End of File diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/cambitmapscaler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/cambitmapscaler.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,212 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Camera Bitmap Scaler +* +*/ + + + + +#include +#include "camlogging.h" +#include "cambitmapscaler.h" + +// =========================================================================== +// Local constants + +namespace NCamCameraController + { + static const TInt KPriority = CActive::EPriorityHigh; + } + +using namespace NCamCameraController; + +// =========================================================================== +// public constructor and destructor + +// --------------------------------------------------------------------------- +// 2 phase constructor +// --------------------------------------------------------------------------- +// +CCamBitmapScaler* +CCamBitmapScaler::NewL( MCamBitmapScalerObserver& aObserver ) + { + CCamBitmapScaler* self = + new (ELeave) CCamBitmapScaler( aObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CCamBitmapScaler::~CCamBitmapScaler() + { + PRINT( _L("Camera => ~CCamBitmapScaler") ); + Cancel(); + + delete iScaledBitmap; + delete iScaler; + + PRINT( _L("Camera <= ~CCamBitmapScaler") ); + } + +// =========================================================================== +// public methods + + +// --------------------------------------------------------------------------- +// InitScalingL +// --------------------------------------------------------------------------- +// +void +CCamBitmapScaler::InitScalingL( const TSize& aTargetSize, + const TDisplayMode& aTargetDisplayMode, + TBool aMaintainAspect ) + { + PRINT( _L("Camera => CCamBitmapScaler::InitScalingL") ); + Cancel(); + + if( !iScaledBitmap ) iScaledBitmap = new (ELeave) CFbsBitmap; + else iScaledBitmap->Reset(); + + PRINT3( _L("Camera <> Create bitmap, size(%d,%d), mode(%d)"), + aTargetSize.iWidth, + aTargetSize.iHeight, + aTargetDisplayMode ); + + User::LeaveIfError( iScaledBitmap->Create( aTargetSize, + aTargetDisplayMode ) ); + + iMaintainAspect = aMaintainAspect; + PRINT( _L("Camera <= CCamBitmapScaler::InitScalingL") ); + } + + +// --------------------------------------------------------------------------- +// StartScaling +// --------------------------------------------------------------------------- +// +void CCamBitmapScaler::StartScaling( CFbsBitmap& aSourceBitmap ) + { + PRINT( _L("Camera => CCamBitmapScaler::StartScaling") ); + + Cancel(); + + iScaler->Scale( &iStatus, aSourceBitmap, *iScaledBitmap, iMaintainAspect ); + SetActive(); + + PRINT( _L("Camera <= CCamBitmapScaler::StartScaling") ); + } + + +// =========================================================================== +// from CActive + +// --------------------------------------------------------------------------- +// virtual +// --------------------------------------------------------------------------- +// +void +CCamBitmapScaler::DoCancel() + { + PRINT( _L("Camera => CCamBitmapScaler::DoCancel") ); + + if( iScaler ) + { + iScaler->Cancel(); + } + + PRINT( _L("Camera <= CCamBitmapScaler::DoCancel") ); + } + + +// --------------------------------------------------------------------------- +// virtual +// --------------------------------------------------------------------------- +// +void +CCamBitmapScaler::RunL() + { + PRINT1( _L("Camera => CCamBitmapScaler::RunL, iStatus:%d"), iStatus.Int() ); + + switch( iStatus.Int() ) + { + case KErrNone : + { + iObserver.BitmapScaled( iStatus.Int(), iScaledBitmap ); + break; + } + default : + { + User::Leave( iStatus.Int() ); + break; + } + } + + PRINT( _L("Camera <= CCamBitmapScaler::RunL") ); + } + + +// --------------------------------------------------------------------------- +// virtual +// --------------------------------------------------------------------------- +// +TInt +CCamBitmapScaler::RunError( TInt aError ) + { + PRINT1( _L("Camera => CCamBitmapScaler::RunError(%d)"), aError ); + + // Leave has occurred in RunL. + // Notify observer with error. + iObserver.BitmapScaled( aError, NULL ); + + PRINT( _L("Camera <= CCamBitmapScaler::RunError") ); + return KErrNone; + } + + +// =========================================================================== +// private constructors + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamBitmapScaler::ConstructL() + { + CActiveScheduler::Add( this ); + + iScaler = CBitmapScaler::NewL(); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamBitmapScaler::CCamBitmapScaler( MCamBitmapScalerObserver& aObserver ) + : CActive( KPriority ), + iObserver( aObserver ) + { + } + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/cambuffer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/cambuffer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,265 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of CCamBuffer class. +* Temporary own implementation of MCameraBuffer. +* To be replaced by ECam CCameraBuffer. +* +*/ + + + +#include + +#include "camlogging.h" +#include "cambuffer.h" + + +// --------------------------------------------------------------------------- +// NewL +// Takes ownership of aData, but not aBitmap +// --------------------------------------------------------------------------- +// +CCamBuffer* +CCamBuffer::NewL( const CFbsBitmap& aBitmap, + HBufC8* aData ) + { + CCamBuffer* self = CCamBuffer::NewLC( aBitmap, aData ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// NewLC +// Takes ownership of aData, but not aBitmap +// --------------------------------------------------------------------------- +// +CCamBuffer* +CCamBuffer::NewLC( const CFbsBitmap& aBitmap, + HBufC8* aData ) + { + CCamBuffer* self = new (ELeave) CCamBuffer; + CleanupStack::PushL( self ); + self->ConstructL( aBitmap, aData ); + return self; + } + + +// --------------------------------------------------------------------------- +// NewL +// Takes ownership of both objects. +// --------------------------------------------------------------------------- +// +CCamBuffer* +CCamBuffer::NewL( CFbsBitmap* aBitmap, + HBufC8* aData ) + { + CCamBuffer* self = CCamBuffer::NewLC( aBitmap, aData ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// NewLC +// Takes ownership of both objects. +// --------------------------------------------------------------------------- +// +CCamBuffer* +CCamBuffer::NewLC( CFbsBitmap* aBitmap, + HBufC8* aData ) + { + CCamBuffer* self = new (ELeave) CCamBuffer; + CleanupStack::PushL( self ); + self->ConstructL( aBitmap, aData ); + return self; + } + + +// --------------------------------------------------------------------------- +// NumFrames +// +// Number of frames available in the buffer. +// --------------------------------------------------------------------------- +// +TInt +CCamBuffer::NumFrames() + { + return 1; + } + + +// --------------------------------------------------------------------------- +// DataL +// +// Frame data as descriptor. +// *not supported here* +// --------------------------------------------------------------------------- +// +TDesC8* +CCamBuffer::DataL( TInt aFrameIndex ) + { + if( aFrameIndex != 0 || !iImageData ) + User::Leave( KErrNotSupported ); + + return iImageData; + } + +// --------------------------------------------------------------------------- +// BitmapL +// +// Frame data as bitmap. +// --------------------------------------------------------------------------- +// +CFbsBitmap& +CCamBuffer::BitmapL( TInt aFrameIndex ) + { + if( aFrameIndex != 0 || !iBitmap ) + User::Leave( KErrNotFound ); + + return *iBitmap; + } + +// --------------------------------------------------------------------------- +// DataL +// +// Frame data as chunk. +// *not supported here* +// --------------------------------------------------------------------------- +// +RChunk& +CCamBuffer::ChunkL() + { + User::Leave( KErrNotSupported ); + + return iChunk; + } + +// --------------------------------------------------------------------------- +// ChunkOffsetL +// +// Frame data offset in chunk. +// *not supported here* +// --------------------------------------------------------------------------- +// +TInt +CCamBuffer::ChunkOffsetL( TInt /*aFrameIndex*/ ) + { + User::Leave( KErrNotSupported ); + + return 0; + } + +// --------------------------------------------------------------------------- +// FrameSize +// +// Frame data size. +// *not supported here, as only bitmap supported* +// --------------------------------------------------------------------------- +// +TInt +CCamBuffer::FrameSize( TInt /*aFrameIndex*/ ) + { + return -1; + } + +// --------------------------------------------------------------------------- +// Release +// +// Release this buffer. +// Simply deletes this object. +// --------------------------------------------------------------------------- +// +void +CCamBuffer::Release() + { + delete this; + } + +// =========================================================================== + +// --------------------------------------------------------------------------- +// ConstructL +// +// --------------------------------------------------------------------------- +// +void +CCamBuffer::ConstructL( const CFbsBitmap& aBitmap, + HBufC8* aData ) + { + PRINT( _L("CamTest => CCamBuffer::ConstructL") ); + + + iBitmap = new (ELeave) CFbsBitmap; + TInt error = iBitmap->Duplicate( aBitmap.Handle() ); + + iImageData = aData; + + PRINT1( _L("CamTest <> duplicate bitmap status(%d)"), error ); + + User::LeaveIfError( error ); + + PRINT( _L("CamTest <= CCamBuffer::ConstructL") ); + } + +// --------------------------------------------------------------------------- +// ConstructL +// +// --------------------------------------------------------------------------- +// +void +CCamBuffer::ConstructL( CFbsBitmap* aBitmap, + HBufC8* aData ) + { + PRINT( _L("CamTest => CCamBuffer::ConstructL") ); + + iImageData = aData; + iBitmap = aBitmap; + + PRINT( _L("CamTest <= CCamBuffer::ConstructL") ); + } + + +// --------------------------------------------------------------------------- +// Constructor +// +// --------------------------------------------------------------------------- +// +CCamBuffer::CCamBuffer() + : iBitmap( NULL ), + iImageData( NULL ), + iOwnBitmap( ETrue ), + iOwnData( ETrue ) + { + } + +// --------------------------------------------------------------------------- +// Destructor +// *private, because Release() is supposed to be used.* +// --------------------------------------------------------------------------- +// +CCamBuffer::~CCamBuffer() + { + PRINT( _L("CamTest => ~CCamBuffer") ); + + PRINT( _L("CamTest <> ~CCamBuffer: Close RChunk..") ); + iChunk.Close(); + PRINT( _L("CamTest <> ~CCamBuffer: delete CFbsBitmap..") ); + delete iBitmap; + PRINT( _L("CamTest <> ~CCamBuffer: delete HBufC8*..") ); + delete iImageData; + + PRINT( _L("CamTest <= ~CCamBuffer") ); + } + + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/cambuffershare.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/cambuffershare.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of CCamBufferShare class. +* Wrapper around to store and handle sharing of buffer +* implementing MCameraBuffer interface. Counts references +* and frees the stored buffer, when no client uses it. +* +* +*/ + + + +// =========================================================================== +// Includes +#include // MCameraBuffer +#include "camlogging.h" +#include "cambuffershare.h" + +// =========================================================================== +// Static data initialisation +#ifdef _DEBUG + TInt CCamBufferShare::isTotalBufferCount = 0; +#endif // _DEBUG + + +// =========================================================================== +// Class methods + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CCamBufferShare::CCamBufferShare( MCameraBuffer* aSharedBuffer ) + : iSharedBuffer( aSharedBuffer ), + iReferenceCount( 0 ) + { +#ifdef _DEBUG + ++isTotalBufferCount; +#endif // _DEBUG + } + +// --------------------------------------------------------------------------- +// Destructor +// Private, Release is to be used by clients. +// --------------------------------------------------------------------------- +// +CCamBufferShare::~CCamBufferShare() + { + PRINT( _L("Camera => ~CCamBufferShare") ); + if( iSharedBuffer ) + { + iSharedBuffer->Release(); + iSharedBuffer = NULL; + } +#ifdef _DEBUG + --isTotalBufferCount; +#endif + PRINT( _L("Camera <= ~CCamBufferShare") ); + } + +// --------------------------------------------------------------------------- +// Return the shared buffer. +// Ownership never transferred to caller. +// --------------------------------------------------------------------------- +// +MCameraBuffer* +CCamBufferShare::SharedBuffer() + { + return iSharedBuffer; + } + +// --------------------------------------------------------------------------- +// Signal, that new client uses this buffer. +// --------------------------------------------------------------------------- +// +void +CCamBufferShare::Reserve() + { + ++iReferenceCount; + } + +// --------------------------------------------------------------------------- +// Signal that one client has stopped using this buffer. +// --------------------------------------------------------------------------- +// +void +CCamBufferShare::Release() + { + --iReferenceCount; + + if( iReferenceCount <= 0 ) + { + delete this; + } + } + +#ifdef _DEBUG +// --------------------------------------------------------------------------- +// TotalBufferShareCount <> +// +// Debug method to follow the total amount of shared buffers in use. +// --------------------------------------------------------------------------- +// +TInt +CCamBufferShare::TotalBufferShareCount() + { + return isTotalBufferCount; + } +#endif // _DEBUG + + +// end of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/camcameracontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/camcameracontroller.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,6647 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camera Controller implementation. +* : Class handles CCamera related operations. +* +*/ + + + +// =========================================================================== +// Included headers + +#include "camcameracontrollerflags.hrh" + +// ------------------------------------- +// General +#include +#include // KNullHandle +#include +#include +#include + +// ------------------------------------- +// ECAM +#include +#ifdef CAMERAAPP_CAPI_V2 + #include + #include + #include + #include + #include +#endif +#include // KUidECamEventCameraSnapshot + +// ------------------------------------- +// Camera Application Engine (CAE) +#ifdef CAMERAAPP_CAE_FOR_VIDEO + #include +#endif + +// ------------------------------------- +// Custom interfaces +#include +#include + +#include +#include +// ------------------------------------- +// Own +#include "camcameracontroller.pan" +#include "camlogging.h" +#include "cambuffershare.h" +#include "cambuffersharecleanup.h" +#include "cambuffercleanup.h" +#include "cambuffer.h" + +#include "camsnapshotprovider.h" +#include "camimageencoder.h" + +#include "mcamsettingprovider.h" +#include "mcamcameraobserver.h" +#include "camsettingconversion.h" +#include "camcameraevents.h" +#include "camcamerarequests.h" +#include "camcameracontrolleractive.h" +#include "camcameracontroller.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "camcameracontrollerTraces.h" +#endif + +#ifdef FORCE_DUMMY_ENGINE + #include "CameraappDummyEngine.h" +#endif // FORCE_DUMMY_ENGINE +#ifdef CAMERAAPP_CAPI_EMULATOR + #include "CamCamera.h" +#endif // CAMERAAPP_CAPI_EMULATOR +#ifdef CAMERAAPP_FLASH_SIMULATOR + #include "camflashsimulator.h" +#endif // CAMERAAPP_FLASH_SIMULATOR +#ifdef CAMERAAPP_CAE_ERR_SIMULATION + #include "CamTimer.h" +#endif // CAMERAAPP_CAE_ERR_SIMULATION + +#include "CamAppUi.h" +#include "CameraUiConfigManager.h" +#include "CamViewBase.h" +#include "campanic.h" +// =========================================================================== +// Local constants +const TInt KIveRecoveryCountMax = 2; +typedef CCamera::CCameraAdvancedSettings CAS; +typedef CCamera::CCameraImageProcessing CIP; + +namespace NCamCameraController + { + static const TInt KPrimaryCameraIndex = 0; + //static const TInt KSecondaryCameraIndex = 1; + static const TInt KInvalidCameraIndex = -1; + + #ifdef CAMERAAPP_CAE_FOR_VIDEO + // static const TInt KCameraDisplayIndex = 0; + #endif + #ifdef CAMERAAPP_CAPI_V2 + static const TInt KCameraClientPriority = 100; // -100...100 + #endif + + static const TInt KCamCallBackPriority = EPriorityHigh; + + static const TInt KCamSequenceGranularity = 2; + static const TInt KResolutionArrayGranularity = 8; + #ifdef CAMERAAPP_CAPI_V2_ADV + static const TInt KAdvArrayGranularity = 5; + #endif + + static const CCamera::TFormat KCamJpegAlternativeFormat1 = CCamera::EFormatFbsBitmapColor16M; + static const CCamera::TFormat KCamJpegAlternativeFormat2 = CCamera::EFormatFbsBitmapColor64K; + + static const TInt KCamReserveTryAgainMaxCount = 50; + static const TInt KCamReserveTryAgainWaitInterval = 50000; // 50 milliseconds + #ifdef _DEBUG + _LIT( KCamDriveModeNameBurst, "EDriveModeBurst" ); + _LIT( KCamDriveModeNameSingle, "EDriveModeSingleShot" ); + _LIT( KCamDriveModeNameUnknown, "Unknown drive mode!" ); + #endif // _DEBUG + } + +// =========================================================================== +// Local methods + +#ifdef CAMERAAPP_PERFORMANCE_CONTROLLER + #include "camperformancelogger.h" + + #define CAMERAAPP_PERF_CONTROLLER_START( AAA ) iPerformanceLogger->Requested( AAA ); + #define CAMERAAPP_PERF_CONTROLLER_STARTNEW( AAA, BBB ) BBB = EFalse; iPerformanceLogger->Requested( AAA ); + #define CAMERAAPP_PERF_CONTROLLER_STOP( AAA ) iPerformanceLogger->Completed( AAA ); + #define CAMERAAPP_PERF_CONTROLLER_STOP_ONCE( AAA, BBB ) if( !BBB ) { iPerformanceLogger->Completed( AAA ); BBB = ETrue; } +#else + #define CAMERAAPP_PERF_CONTROLLER_START( AAA ) + #define CAMERAAPP_PERF_CONTROLLER_STARTNEW( AAA, BBB ) + #define CAMERAAPP_PERF_CONTROLLER_STOP( AAA ) + #define CAMERAAPP_PERF_CONTROLLER_STOP_ONCE( AAA, BBB ) +#endif // CAMERAAPP_PERFORMANCE_CONTROLLER + +// Helper methods +#include "camflagutility.inl" +#include "campointerutility.inl" + + +namespace NCamCameraController + { + /* + inline void SetFalse( TAny* aTBool ) + { + TBool* boolean = static_cast( aTBool ); + + if( boolean ) + *boolean = EFalse; + } + */ + + inline void SetNotBusy( TAny* aTUint ) + { + TUint* flags = static_cast( aTUint ); + + if( flags ) + *flags = ECamBusyOff; + }; + + inline void ReleaseAndNull( MCameraBuffer*& aBuffer ) + { + if( aBuffer ) + { + aBuffer->Release(); + aBuffer = NULL; + } + }; +#ifdef CAMERAAPP_CAPI_V2_ADV + inline void ResetInfo( TAny* aInfo ) + { + TCamAdvancedSettingInfo* info = + static_cast( aInfo ); + + if( info ) + { + info->Reset(); + } + }; + + + inline const TDesC& DriveModeName( TInt aMode ) + { +#ifdef _DEBUG + switch( aMode ) + { + case CAS::EDriveModeBurst: return KCamDriveModeNameBurst; + case CAS::EDriveModeSingleShot: return KCamDriveModeNameSingle; + default: return KCamDriveModeNameUnknown; + } +#else + return KNullDesC; +#endif // _DEBUG + }; +#endif + } +using namespace NCamCameraController; + +// =========================================================================== +// TCamControllerInfo class methods +TCamControllerInfo::TCamControllerInfo() + { + Reset(); + } + +void +TCamControllerInfo::Reset( TBool aPreserveBusyFlag /*= EFalse*/, + TBool aPreserveCameraIndex /*= EFalse*/ ) + { + // When we reset the info e.g. after reserve lost event + // we need to keep the current camera index stored. + if( !aPreserveCameraIndex ) + { + iCurrentCamera = KErrNotFound; + } + + iState = ECamIdle; + iCaptureState = ECamCaptureOff; + iCaptureLimit = 1; + iCaptureCount = 0; + iSnapshotCount = 0; + + iVfMode = ECamViewfinderNone; + iVfState = ECamTriIdle; + iViewfinderSize = TSize(); + iViewfinderFormat = CCamera::EFormatFbsBitmapColor16M; + + iSsState = ECamTriIdle; + iSnapshotSize = TSize(); + iSnapshotFormat = CCamera::EFormatFbsBitmapColor16M; + iSnapshotAspectMaintain = EFalse; + + if( !aPreserveBusyFlag ) + { + iBusy = ECamBusyOff; + } + } + +// --------------------------------------------------------------------------- +// PrintInfo +// --------------------------------------------------------------------------- +// +void +TCamControllerInfo::PrintInfo() const + { + PRINT ( _L("Camera <> --------------------------------------------------") ); + PRINT ( _L("Camera <> TCamControllerInfo") ); + PRINT ( _L("Camera <> ") ); + + PRINT1( _L("Camera <> iCurrentCamera : %d" ), iCurrentCamera ); + PRINT1( _L("Camera <> iState : %08b" ), iState ); + + PRINT1( _L("Camera <> iCaptureState : [%s]" ), KCamCameraCaptureStateNames[iCaptureState] ); + PRINT1( _L("Camera <> iCaptureLimit : %d" ), iCaptureLimit ); + PRINT1( _L("Camera <> iCaptureCount : %d" ), iCaptureCount ); + PRINT1( _L("Camera <> iSnapshotCount : %d" ), iSnapshotCount ); + + PRINT1( _L("Camera <> iVfMode : [%s]" ), KCamViewfinderModeNames [iVfMode] ); + PRINT1( _L("Camera <> iVfState : [%s]" ), KCamCameraTriStateNames [iVfState] ); + PRINT2( _L("Camera <> iViewfinderSize : (%dx%d)"), iViewfinderSize.iWidth, iViewfinderSize.iHeight ); + PRINT1( _L("Camera <> iViewfinderFormat : %d" ), iViewfinderFormat ); + + PRINT1( _L("Camera <> iSsState : [%s]" ), KCamCameraTriStateNames [iSsState] ); + PRINT2( _L("Camera <> iSnapshotSize : (%dx%d)"), iSnapshotSize.iWidth, iSnapshotSize.iHeight ); + PRINT1( _L("Camera <> iSnapshotFormat : %d" ), iSnapshotFormat ); + PRINT1( _L("Camera <> iSnapshotAspectMaintain : %d" ), iSnapshotAspectMaintain ); + + PRINT1( _L("Camera <> iBusy : %08b" ), iBusy ); + + PRINT ( _L("Camera <> --------------------------------------------------") ); + } + + +// =========================================================================== +// TCamCameraResolutionSupport class methods + +TCamCameraResolutionSupport::TCamCameraResolutionSupport() + : iResolutions( KResolutionArrayGranularity ) + { + Reset(); + } + +TCamCameraResolutionSupport::~TCamCameraResolutionSupport() + { + iResolutions.Close(); + } + +void +TCamCameraResolutionSupport::Reset() + { + iForCameraIndex = KInvalidCameraIndex; + iForCameraFormat = -1; + iResolutions.Reset(); + } + +#ifdef CAMERAAPP_CAPI_V2_ADV +// =========================================================================== +// TCamAdvancedSettingInfo class methods + +TCamAdvancedSettingInfo::TCamAdvancedSettingInfo() + : iEvStepsSupport ( KAdvArrayGranularity ), + iIsoRatesSupport( KAdvArrayGranularity ) + { + Reset(); + } + +TCamAdvancedSettingInfo::~TCamAdvancedSettingInfo() + { + iEvStepsSupport.Close(); + iIsoRatesSupport.Close(); + } + +void +TCamAdvancedSettingInfo::Reset() + { + iForCameraIndex = KInvalidCameraIndex; + + iEvModesSupport = 0; + iEvStepsSupport.Reset(); + iEvStepsValueInfo = ENotActive; + + iIsoRatesSupport.Reset(); + + iDigitalZoomSupport.Reset(); + iDigitalZoomValueInfo = ENotActive; + +#ifdef CAMERAAPP_CAPI_V2_IP + iColourEffectSupport.Reset(); + iColourEffectValueInfo = ENotActive; + + iSharpnessSupport.Reset(); + iSharpnessValueInfo = ENotActive; +#endif + + iStabilizationModeSupport = 0; + iStabilizationEffectSupport = 0; + iStabilizationComplexitySupport = 0; + } + +// --------------------------------------------------------------------------- +// PrintInfo +// --------------------------------------------------------------------------- +// +void +TCamAdvancedSettingInfo::PrintInfo() const + { +#ifdef _DEBUG + PRINT ( _L("Camera <> --------------------------------------------------") ); + PRINT ( _L("Camera <> Value infos:") ); + PRINT1( _L("Camera <> EV value info : %04b"), iEvStepsValueInfo ); + PRINT1( _L("Camera <> Dig zoom value info : %04b"), iDigitalZoomValueInfo ); +#ifdef CAMERAAPP_CAPI_V2_IP + PRINT1( _L("Camera <> Colour effct value info : %04b"), iColourEffectValueInfo ); + PRINT1( _L("Camera <> Sharpness value info : %04b"), iSharpnessValueInfo ); +#endif + PRINT1( _L("Camera <> ENotActive : %04b"), ENotActive ); + PRINT1( _L("Camera <> EBitField : %04b"), EBitField ); + PRINT1( _L("Camera <> EDiscreteSteps : %04b"), EDiscreteSteps ); + PRINT1( _L("Camera <> EDiscreteRangeMinMaxStep : %04b"), EDiscreteRangeMinMaxStep ); + PRINT1( _L("Camera <> EContinuousRangeMinMax : %04b"), EContinuousRangeMinMax ); + + PRINT ( _L("Camera <> --------------------------------------------------") ); + PRINT ( _L("Camera <> Dig zoom ratios:") ); + for( TInt i = 0; i < iDigitalZoomSupport.Count(); i++ ) + { + PRINT2( _L("Camera <> step[%4d]: ratio[%4f]"), i, (TReal)iDigitalZoomSupport[i]/(TReal)KECamFineResolutionFactor ); + } + PRINT ( _L("Camera <> --------------------------------------------------") ); + PRINT ( _L("Camera <> ISO rates supported:") ); + for( TInt i = 0; i < iIsoRatesSupport.Count(); i++ ) + { + PRINT2( _L("Camera <> rate[%3d]: %4d"), i, iIsoRatesSupport[i] ); + } + PRINT ( _L("Camera <> --------------------------------------------------") ); + PRINT ( _L("Camera <> EV steps supported:") ); + for( TInt i = 0; i < iEvStepsSupport.Count(); i++ ) + { + PRINT2( _L("Camera <> step[%3d]: %4d"), i, iEvStepsSupport[i] ); + } + + PRINT ( _L("Camera <> --------------------------------------------------") ); + PRINT1( _L("Camera <> Advanced EV modes support : %016b"), iEvModesSupport ); + PRINT1( _L("Camera <> EExposureAuto : %016b"), CCamera::EExposureAuto ); + PRINT1( _L("Camera <> EExposureNight : %016b"), CCamera::EExposureNight ); + PRINT1( _L("Camera <> EExposureBacklight : %016b"), CCamera::EExposureBacklight ); + PRINT1( _L("Camera <> EExposureCenter : %016b"), CCamera::EExposureCenter ); + PRINT1( _L("Camera <> EExposureSport : %016b"), CCamera::EExposureSport ); + PRINT1( _L("Camera <> EExposureVeryLong : %016b"), CCamera::EExposureVeryLong ); + PRINT1( _L("Camera <> EExposureSnow : %016b"), CCamera::EExposureSnow ); + PRINT1( _L("Camera <> EExposureBeach : %016b"), CCamera::EExposureBeach ); + PRINT1( _L("Camera <> EExposureProgram : %016b"), CCamera::EExposureProgram ); + PRINT1( _L("Camera <> EExposureAperturePriority : %016b"), CCamera::EExposureAperturePriority ); + PRINT1( _L("Camera <> EExposureShutterPriority : %016b"), CCamera::EExposureShutterPriority ); + PRINT1( _L("Camera <> EExposureManual : %016b"), CCamera::EExposureManual ); + PRINT1( _L("Camera <> EExposureSuperNight : %016b"), CCamera::EExposureSuperNight ); + PRINT1( _L("Camera <> EExposureInfra : %016b"), CCamera::EExposureInfra ); + PRINT ( _L("Camera <> --------------------------------------------------") ); + +#ifdef CAMERAAPP_CAPI_V2_IP + PRINT ( _L("Camera <> Sharpness support:") ); + for( TInt i = 0; i < iSharpnessSupport.Count(); i++ ) + { + PRINT2( _L("Camera <> step[%3d]: %4d"), i, iSharpnessSupport[i] ); + } + PRINT ( _L("Camera <> --------------------------------------------------") ); + PRINT ( _L("Camera <> Colour effect support:") ); + for( TInt i = 0; i < iColourEffectSupport.Count(); i++ ) + { + PRINT2( _L("Camera <> effect[%3d] : %016b"), i, iColourEffectSupport[i] ); + } + PRINT1( _L("Camera <> EEffectNone : %016b"), CIP::EEffectNone ); + PRINT1( _L("Camera <> EEffectNegative : %016b"), CIP::EEffectNegative ); + PRINT1( _L("Camera <> EEffectMonochrome : %016b"), CIP::EEffectMonochrome ); + PRINT1( _L("Camera <> EEffectSolarize : %016b"), CIP::EEffectSolarize ); + PRINT1( _L("Camera <> EEffectSepia : %016b"), CIP::EEffectSepia ); + PRINT1( _L("Camera <> EEffectEmboss : %016b"), CIP::EEffectEmboss ); + PRINT1( _L("Camera <> EEffectRedEyeReduction: %016b"), CIP::EEffectRedEyeReduction ); + PRINT1( _L("Camera <> EEffectVivid : %016b"), CIP::EEffectVivid ); + PRINT1( _L("Camera <> EEffectLowSharpening : %016b"), CIP::EEffectLowSharpening ); + PRINT ( _L("Camera <> --------------------------------------------------") ); +#endif // CAMERAAPP_CAPI_V2_IP + + PRINT ( _L("Camera <> --------------------------------------------------") ); + PRINT1( _L("Camera <> Stabilization modes support : %016b"), iStabilizationModeSupport ); + PRINT1( _L("Camera <> EStabilizationModeOff : %016b"), CAS::EStabilizationModeOff ); + PRINT1( _L("Camera <> EStabilizationModeHorizontal : %016b"), CAS::EStabilizationModeHorizontal ); + PRINT1( _L("Camera <> EStabilizationModeVertical : %016b"), CAS::EStabilizationModeVertical ); + PRINT1( _L("Camera <> EStabilizationModeRotation : %016b"), CAS::EStabilizationModeRotation ); + PRINT1( _L("Camera <> EStabilizationModeAuto : %016b"), CAS::EStabilizationModeAuto ); + PRINT1( _L("Camera <> EStabilizationModeManual : %016b"), CAS::EStabilizationModeManual ); + PRINT1( _L("Camera <> Stabilization fx support : %016b"), iStabilizationEffectSupport ); + PRINT1( _L("Camera <> EStabilizationOff : %016b"), CAS::EStabilizationOff ); + PRINT1( _L("Camera <> EStabilizationAuto : %016b"), CAS::EStabilizationAuto ); + PRINT1( _L("Camera <> EStabilizationFine : %016b"), CAS::EStabilizationFine ); + PRINT1( _L("Camera <> EStabilizationMedium : %016b"), CAS::EStabilizationMedium ); + PRINT1( _L("Camera <> EStabilizationStrong : %016b"), CAS::EStabilizationStrong ); + PRINT1( _L("Camera <> Stabilization complexity support : %016b"), iStabilizationComplexitySupport ); + PRINT1( _L("Camera <> EStabilizationComplexityAuto : %016b"), CAS::EStabilizationComplexityAuto ); + PRINT1( _L("Camera <> EStabilizationComplexityLow : %016b"), CAS::EStabilizationComplexityLow ); + PRINT1( _L("Camera <> EStabilizationComplexityMedium : %016b"), CAS::EStabilizationComplexityMedium ); + PRINT1( _L("Camera <> EStabilizationComplexityHigh : %016b"), CAS::EStabilizationComplexityHigh ); + PRINT ( _L("Camera <> --------------------------------------------------") ); +#endif // _DEBUG + } + +#endif // CAMERAAPP_CAPI_V2_ADV + + +// =========================================================================== +// CCamCameraController class methods + +// --------------------------------------------------------------------------- +// static 2-phase constructor +// --------------------------------------------------------------------------- +// +CCamCameraController* +CCamCameraController::NewL( MCamSettingProvider& aProvider, + CCamAppController& aAppController, + TInt aCameraIndex /*= 0*/ ) + { + CCamCameraController* self + = new (ELeave) CCamCameraController( aProvider, aAppController ); + + CleanupStack::PushL( self ); + self->ConstructL( aCameraIndex ); + CleanupStack::Pop( self ); + + return self; + } + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamCameraController::~CCamCameraController() + { + PRINT( _L("Camera => ~CCamCameraController") ); + +#ifdef CAMERAAPP_FLASH_SIMULATOR + delete iFlashSimulator; +#endif + +#ifdef CAMERAAPP_PERFORMANCE_CONTROLLER + delete iPerformanceLogger; +#endif // CAMERAAPP_PERFORMANCE_CONTROLLER + + delete iIdle; + iSettingArray.Close(); + + // Remove all observers. + // We do not want to broadcast events anymore in this phase. + iObservers.Reset(); + iObserverInterests.Reset(); + + ClearRequestQueue(); + ClearSettingQueue(); + + + PRINT( _L("Camera <> CCamCameraController: release current camera..") ); + // Release and null CCamera related objects. + ReleaseCurrentCamera(); + PRINT( _L("Camera <> CCamCameraController: ..done") ); + + delete iActive; + + iObservers.Close(); + iObserverInterests.Close(); + +#ifdef CAMERAAPP_CAE_ERR_SIMULATION + if( iCallbackTimer ) + { + iCallbackTimer->Cancel(); + delete iCallbackTimer; + } +#endif // CAMERAAPP_CAE_ERR_SIMULATION + + PRINT( _L("Camera <= ~CCamCameraController") ); + } + + +// =========================================================================== +// MCameraObserver2 + +// --------------------------------------------------------------------------- +// HandleEvent +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandleEvent( const TECAMEvent& aEvent ) + { + // TUid iEventType; + // TInt iErrorCode; + PRINT2( _L("Camera => CCamCameraController::HandleEvent, event uid(0x%08x) error(%d)"), + aEvent.iEventType.iUid, + aEvent.iErrorCode ); + + // If we are getting zoom event while saving video, + // we must not handle the event + TInt uidValue( aEvent.iEventType.iUid ); + if ( uidValue == KUidECamEventCameraSettingDigitalZoomUidValue + && IsFlagOn( iInfo.iBusy, ECamBusySingle ) ) + { + return; + } + +#ifdef CAMERAAPP_CAPI_V2 + + // ------------------------------------------------------- + if( aEvent.iEventType == KUidECamEventReserveComplete ) + { + HandleReserveGainEvent( aEvent.iErrorCode ); + } + // ------------------------------------------------------- + else if( aEvent.iEventType == KUidECamEventPowerOnComplete ) + { + HandlePowerOnEvent( aEvent.iErrorCode ); + } + // ------------------------------------------------------- + else if( aEvent.iEventType == KUidECamEventCameraNoLongerReserved ) + { + HandleReserveLostEvent( aEvent.iErrorCode ); + } + // ------------------------------------------------------- + else if( !(IsFlagOn( iInfo.iState , ECamPowerOn ))) + { + //If camera is in background then all the rest events will be ignored. Should return without leaving + return; + } + // ------------------------------------------------------- + else if( aEvent.iEventType == KUidECamEventCameraSnapshot ) + { + HandleSnapshotEvent( aEvent.iErrorCode ); + } + // ------------------------------------------------------- + else if( aEvent.iEventType == KUidECamEventCameraSettingsOptimalFocus + || aEvent.iEventType == KUidECamEventCameraSettingAutoFocusType2 ) + { + HandleAutoFocusEvent( aEvent.iErrorCode, aEvent.iEventType ); + } + // ------------------------------------------------------- + else + { +#ifdef CAMERAAPP_CAPI_V2_ADV + TInt uidValue( aEvent.iEventType.iUid ); + switch( uidValue ) + { + // ------------------------------- + // Settings + // + // case KUidECamEventCameraSettingTimerIntervalUidValue: + // case KUidECamEventCameraSettingTimeLapseUidValue: + // + case KUidECamEventCameraSettingFlashModeUidValue: + case KUidECamEventCameraSettingExposureCompensationStepUidValue: + case KUidECamEventCameraSettingIsoRateTypeUidValue: + case KUidECamEventCameraSettingWhiteBalanceModeUidValue: + case KUidECamEventCameraSettingDigitalZoomUidValue: + case KUidECamEventCameraSettingOpticalZoomUidValue: + case KUidECamEventImageProcessingAdjustSharpnessUidValue: + case KUidECamEventImageProcessingEffectUidValue: + case KUidECamEventSettingsStabilizationAlgorithmComplexityUidValue: + { + TCamCameraSettingId id = + CCamSettingConversion::Map2CameraSetting( uidValue ); + + HandleCallbackEvent( aEvent.iErrorCode, + ECamCameraEventSettingsSingle, + ECamCameraEventClassSettings, + &id ); + break; + } + // ------------------------------- + // Flash status info + case KUidECamEventFlashReadyUidValue: + HandleFlashStatusEvent( aEvent.iErrorCode, ECamCameraEventFlashReady ); + break; + case KUidECamEventFlashNotReadyUidValue: + HandleFlashStatusEvent( aEvent.iErrorCode, ECamCameraEventFlashNotReady ); + break; + // ------------------------------- + default: + break; + // ------------------------------- + } +#endif // CAMERAAPP_CAPI_V2_ADV + } + +#else // CAMERAAPP_CAPI_V2 + + // Only snapshot event recognized if old observer interface in + // use towards CCamera. This one is then generated by CCamSnapshot. + if( aEvent.iEventType == KUidECamEventCameraSnapshot ) + { + HandleSnapshotEvent( aEvent.iErrorCode ); + } + else + { + // ignore other events + PRINT( _L("Camera <> CCamCameraController: Unknown event") ); + } +#endif + // ------------------------------------------------------- + PRINT( _L("Camera <= CCamCameraController::HandleEvent") ); + } + + + +// --------------------------------------------------------------------------- +// ViewFinderReady +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ViewFinderReady( MCameraBuffer& aCameraBuffer, TInt aError ) + { + HandleViewfinderEvent( &aCameraBuffer, aError ); + } + + +// --------------------------------------------------------------------------- +// ImageBufferReady +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ImageBufferReady( MCameraBuffer& aCameraBuffer, TInt aError ) + { + HandleImageCaptureEvent( &aCameraBuffer, aError ); + } + + +// --------------------------------------------------------------------------- +// VideoBufferReady +// --------------------------------------------------------------------------- +// +void +CCamCameraController::VideoBufferReady( MCameraBuffer& aCameraBuffer, TInt aError ) + { + if( KErrNone == aError ) + { + aCameraBuffer.Release(); + } + } + + + +#if !defined( CAMERAAPP_CAPI_V2 ) +// =========================================================================== +// MCameraObserver + + +// --------------------------------------------------------------------------- +// ReserveComplete +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ReserveComplete( TInt aError ) + { + HandleReserveGainEvent( aError ); + } + + +// --------------------------------------------------------------------------- +// PowerOnComplete +// --------------------------------------------------------------------------- +// +void +CCamCameraController::PowerOnComplete( TInt aError ) + { + HandlePowerOnEvent( aError ); + } + + +// --------------------------------------------------------------------------- +// ViewFinderFrameReady +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ViewFinderFrameReady( CFbsBitmap& aFrame ) + { + PRINT( _L("CamTest => CCamCameraController::ViewFinderFrameReady") ); + + CCamBuffer* buffer = NULL; + + TRAPD( error, buffer = CCamBuffer::NewL( aFrame, NULL ) ); + + // Releases buffer + HandleViewfinderEvent( buffer, error ); + + PRINT( _L("CamTest <= CCamCameraController::ViewFinderFrameReady") ); + } + + +// --------------------------------------------------------------------------- +// ImageReady +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ImageReady( CFbsBitmap* aBitmap, + HBufC8* aData, + TInt aError ) + { + PRINT( _L("Camera => CCamCameraController::ImageReady") ); + + CCamBuffer* buffer = NULL; + + // If no error so far, wrap the data to MCameraBuffer compatible wrapper. + // New API provides these buffers already from CCamera callbacks. + if( KErrNone == aError ) + { + TRAP( aError, + { + CleanupStack::PushL( aData ); + CleanupStack::PushL( aBitmap ); + buffer = CCamBuffer::NewL( aBitmap, aData ); + CleanupStack::Pop( 2 ); + }); + } + + // Ownership taken by buffer, or destroyed by cleanup stack. + aData = NULL; + aBitmap = NULL; + + PRINT1( _L("Camera <> status after buffer create(%d)"), aError ); + + // Releases buffer + HandleImageCaptureEvent( buffer, aError ); + + PRINT( _L("Camera <= CCamCameraController::ImageReady") ); + } + + +// --------------------------------------------------------------------------- +// FrameBufferReady +// --------------------------------------------------------------------------- +// +void +CCamCameraController::FrameBufferReady( MFrameBuffer* aFrameBuffer, + TInt /*aError*/ ) + { + // Release the buffer if one is provided to make sure + // CCamera can reuse it. + if( aFrameBuffer ) + { + aFrameBuffer->Release(); + } + } +#endif // CAMERAAPP_CAPI_V2 + + +#ifdef CAMERAAPP_CAE_FOR_VIDEO +// =========================================================================== +// From MCamAppEngineObserver + +// --------------------------------------------------------------------------- +// McaeoInitComplete +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoInitComplete( TInt aError ) + { + PRINT( _L("Camera => CCamCameraController::McaeoInitComplete") ); + // Only interested on this callback, if CCamera duplicate + // cannot be used with CAE. Otherwise we follow this event through + // MCameraObserver(2) interface. +#ifdef CAMERAAPP_CAE_FIX + HandlePowerOnEvent( aError ); +#endif + PRINT( _L("Camera <= CCamCameraController::McaeoInitComplete") ); + } + +// --------------------------------------------------------------------------- +// McaeoStillPrepareComplete +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoStillPrepareComplete( TInt /*aError*/ ) + { + PRINT( _L("Camera =><= CCamCameraController::McaeoStillPrepareComplete, PANIC!") ); + // Still capture not done through CCaeEngine. + __ASSERT_DEBUG( EFalse, Panic( ECamCameraControllerCaeUnsupported ) ); + } + +// --------------------------------------------------------------------------- +// McaeoVideoPrepareComplete +// +// This method is called asynchronously after a call has been made to +// CCaeEngine::PrepareVideoRecordingL. +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoVideoPrepareComplete( TInt aError ) + { + PRINT( _L("Camera => CCamCameraController::McaeoVideoPrepareComplete") ); +#ifdef CAMERAAPP_CAE_ERR_SIMULATION + HandleVideoEvent( ECamCameraEventVideoInit, aError ); + // DelayCallback( ECamCameraEventVideoInit, aError, 500000 ); +#else + HandleVideoEvent( ECamCameraEventVideoInit, aError ); +#endif // CAMERAAPP_CAE_ERR_SIMULATION + + PRINT( _L("Camera <= CCamCameraController::McaeoVideoPrepareComplete") ); + } + +// --------------------------------------------------------------------------- +// McaeoViewFinderFrameReady +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoViewFinderFrameReady( CFbsBitmap& aFrame, + TInt aError ) + { + PRINT( _L("Camera => CCamCameraController::McaeoViewFinderFrameReady") ); + CCamBuffer* buffer = NULL; + if( KErrNone == aError ) + { + TRAP( aError, buffer = CCamBuffer::NewL( aFrame, NULL ) ); + } + + // Releases buffer if not NULL + HandleViewfinderEvent( buffer, aError ); + + PRINT( _L("Camera <= CCamCameraController::McaeoViewFinderFrameReady") ); + } + +// --------------------------------------------------------------------------- +// McaeoSnapImageReady +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoSnapImageReady( const CFbsBitmap& aBitmap, + TInt aError ) + { + PRINT1( _L("Camera => CCamCameraController::McaeoSnapImageReady, status: %d"), aError ); + //__ASSERT_DEBUG( EFalse, Panic( ECamCameraControllerCaeUnsupported ) ); + if( +#ifdef CAMERAAPP_CAE_FIX + ECamModeChangeInactive == iModeChange && +#endif + IsFlagOn( iInfo.iState, ECamVideoOn ) + ) + { + CAMERAAPP_PERF_CONTROLLER_STOP( ECamRequestSsStart ); + + CFbsBitmap* copy( NULL ); + if( KErrNone == aError ) + { + TRAP( aError, + { + copy = new (ELeave) CFbsBitmap; + User::LeaveIfError( copy->Duplicate( aBitmap.Handle() ) ); + }); + } + + NotifyObservers( aError, + ECamCameraEventSsReady, + ECamCameraEventClassSsData, + copy ); + delete copy; + copy = NULL; + } + PRINT( _L("Camera <= CCamCameraController::McaeoSnapImageReady") ); + } + +// --------------------------------------------------------------------------- +// McaeoStillImageReady +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoStillImageReady( CFbsBitmap* /*aBitmap*/, + HBufC8* /*aData */, + TInt /*aError */ ) + { + // Still images are not captured through CCaeEngine. + __ASSERT_DEBUG( EFalse, Panic( ECamCameraControllerCaeUnsupported ) ); + } + +// --------------------------------------------------------------------------- +// McaeoVideoRecordingOn +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoVideoRecordingOn( TInt aError ) + { + PRINT( _L("Camera => CCamCameraController::McaeoVideoRecordingOn") ); + +#ifdef CAMERAAPP_CAE_ERR_SIMULATION + HandleVideoEvent( ECamCameraEventVideoStart, aError ); +#else + HandleVideoEvent( ECamCameraEventVideoStart, aError ); +#endif // CAMERAAPP_CAE_ERR_SIMULATION + + PRINT( _L("Camera <= CCamCameraController::McaeoVideoRecordingOn") ); + + } + +// --------------------------------------------------------------------------- +// McaeoVideoRecordingPaused +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoVideoRecordingPaused( TInt aError ) + { + PRINT( _L("Camera => CCamCameraController::McaeoVideoRecordingPaused") ); + +#ifdef CAMERAAPP_CAE_ERR_SIMULATION + HandleVideoEvent( ECamCameraEventVideoPause, KErrUnknown ); +#else + HandleVideoEvent( ECamCameraEventVideoPause, aError ); +#endif // CAMERAAPP_CAE_ERR_SIMULATION + + PRINT( _L("Camera <= CCamCameraController::McaeoVideoRecordingPaused") ); + + } + +// --------------------------------------------------------------------------- +// McaeoVideoRecordingComplete +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoVideoRecordingComplete( TInt aError ) + { + PRINT( _L("Camera => CCamCameraController::McaeoVideoRecordingComplete") ); + +#ifdef CAMERAAPP_CAE_ERR_SIMULATION + HandleVideoEvent( ECamCameraEventVideoStop, KErrUnknown ); +#else + HandleVideoEvent( ECamCameraEventVideoStop, aError ); +#endif // CAMERAAPP_CAE_ERR_SIMULATION + // Change stopping mode back to default sync mode + if ( iAsyncVideoStopModeSupported ) + { + if ( iCaeEngine ) + { + iCaeEngine->SetAsyncVideoStopMode( EFalse ); + } + iAsyncVideoStopModeSupported = EFalse; + } + + PRINT( _L("Camera <= CCamCameraController::McaeoVideoRecordingComplete") ); + + } + +// --------------------------------------------------------------------------- +// McaeoVideoRecordingTimes +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoVideoRecordingTimes( + TTimeIntervalMicroSeconds aTimeElapsed, + TTimeIntervalMicroSeconds aTimeRemaining, + TInt aError ) + { + HandleVideoTimeEvent( aError, aTimeElapsed, aTimeRemaining ); + } + +// --------------------------------------------------------------------------- +// McaeoVideoRecordingStopped +// --------------------------------------------------------------------------- +// +void +CCamCameraController::McaeoVideoRecordingStopped() + { + PRINT( _L("Camera => CCamCameraController::McaeoVideoRecordingStopped") ); + +#ifdef CAMERAAPP_CAE_ERR_SIMULATION + HandleVideoEvent( ECamCameraEventVideoAsyncStop, KErrUnknown ); +#else + HandleVideoEvent( ECamCameraEventVideoAsyncStop, KErrNone ); +#endif // CAMERAAPP_CAE_ERR_SIMULATION + + PRINT( _L("Camera <= CCamCameraController::McaeoVideoRecordingStopped") ); + } + +#endif // CAMERAAPP_CAE_FOR_VIDEO +// =========================================================================== +// From MCamImageEncoderObserver + +// --------------------------------------------------------------------------- +// ImageEncoded +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ImageEncoded( TInt aStatus, HBufC8* aData ) + { + PRINT( _L("Camera => CCamCameraController::ImageEncoded") ); + MCameraBuffer* buffer = NULL; + + if( KErrNone == aStatus ) + { + if( aData ) + { + TRAP( aStatus, + { + CleanupStack::PushL( aData ); + buffer = CCamBuffer::NewL( NULL, aData ); + CleanupStack::Pop( aData ); + aData = NULL; // ownership to buffer + }); + } + else + { + aStatus = KErrNotFound; + } + } + else + { + // Just delete on errors + delete aData; + aData = NULL; + } + + // Takes ownership of buffer + HandleImageCaptureEvent( buffer, aStatus ); + PRINT( _L("Camera <= CCamCameraController::ImageEncoded") ); + } + + +// =========================================================================== + + +// --------------------------------------------------------------------------- +// AttachObserverL +// --------------------------------------------------------------------------- +// +void +CCamCameraController::AttachObserverL( const MCamCameraObserver* aObserver, + const TUint& aInterest ) + { + // Only add the observer once. NULL pointer only checked here. + // Observer not added, if no notifications would be sent due to + // event interest being ECamCameraEventClassNone. + if( aObserver + && ECamCameraEventClassNone != aInterest + && KErrNotFound == iObservers.Find( aObserver ) + ) + { + // Try to add the observer to our list. + TInt error = iObservers.Append( aObserver ); + + // If we manage to add the observer, make sure the interest info gets set. + if( KErrNone == error ) + { + error = iObserverInterests.Append( aInterest ); + // If we are unable to add the interest info, + // remove also the observer. + if( KErrNone != error ) + { + iObservers.Remove( iObservers.Count() - 1 ); + } + } + + User::LeaveIfError( error ); + } + } + +// --------------------------------------------------------------------------- +// DetachObserver +// --------------------------------------------------------------------------- +// +void +CCamCameraController::DetachObserver( const MCamCameraObserver* aObserver ) + { + if( aObserver ) + { + // Ignore error if not found among observers + const TInt KObserverIndex( iObservers.Find( aObserver ) ); + if( KErrNotFound != KObserverIndex ) + { + iObservers.Remove( KObserverIndex ); + iObserverInterests.Remove( KObserverIndex ); + } + } + } + + +// --------------------------------------------------------------------------- +// RequestL +// +// Issue request for one operation. +// --------------------------------------------------------------------------- +// +void +CCamCameraController::RequestL( const TCamCameraRequestId& aRequestId ) + { + PRINT1( _L("Camera => CCamCameraController::RequestL, request:[%s]"), KCamRequestNames[aRequestId] ); + CheckEqualsL( iInfo.iBusy, ECamBusyOff, KErrInUse ); + SetFlags ( iInfo.iBusy, ECamBusySingle ); + + TInt proceed( ETrue ); + + // If the request leaves, need to reset busy flag. + CleanupStack::PushL( TCleanupItem( SetNotBusy, &iInfo.iBusy ) ); + PRINT( _L("Camera <> process request..") ); + proceed = ProcessOneRequestL( aRequestId ); + CleanupStack::Pop(); + + // If this request will be responded through MCameraObserver(2) callback, + // new requests cannot be accepted until that call arrives and + // notification to our observers will be sent there. + // Otherwise the request is fully processed from our point of view, + // and new request can be accepted. + if( proceed ) + { + PRINT( _L("Camera <> ..Request has no callback from CCamera, ready for new request.") ); + // Need to clear the busy flag before notification, + // as observer might want to issue a new request during + // the notification callback. + ClearFlags( iInfo.iBusy, ECamBusySingle ); + + if( ECamRequestVideoStop == aRequestId + || ECamRequestSetAsyncVideoStopMode == aRequestId + || ECamRequestImageCancel == aRequestId ) + { + // For video stop request, callback has already happened and notification + // has been given. No need to do anything here. + } + else + { + // Give notification to observers + TCamCameraEventId event( Request2Event( aRequestId ) ); + NotifyObservers( KErrNone, event, EventClass( event ) ); + } + } + else + { + PRINT( _L("Camera <> ..Request has callback, waiting for it.") ); + // Request is finalized in the MCameraObserver(2) callback. + } + PRINT( _L("Camera <= CCamCameraController::RequestL") ); + } + +// --------------------------------------------------------------------------- +// DirectRequestL +// +// Issue request even when busy. +// --------------------------------------------------------------------------- +// +void +CCamCameraController::DirectRequestL( const TCamCameraRequestId& aRequestId ) + { + PRINT( _L("Camera => CCamCameraController::DirectRequestL") ); + + TBool notify( ETrue ); + switch( aRequestId ) + { + // ----------------------------------------------------- + case ECamRequestPowerOff: + case ECamRequestRelease: + ProcessControlShutdownRequest( aRequestId ); + break; + // ----------------------------------------------------- + // Viewfinder + // This does not depend on prepare of video / image + // so even starting can be done during sequence. + case ECamRequestVfStart: + ProcessVfStartRequestL(); + break; + case ECamRequestVfStop: + ProcessVfStopRequestL(); + break; + case ECamRequestVfStopEcam: + ProcessVfStopEcamRequest(); + notify = EFalse; + break; + case ECamRequestVfRelease: + ProcessVfRelaseRequest(); + break; + // ----------------------------------------------------- + // Snapshot + // Just as viewfinder, this can be even started + // during a sequence. + case ECamRequestSsStart: + ProcessSnapshotRequestL( ECamRequestSsStart ); + break; + case ECamRequestSsStop: + ProcessSsStopRequest(); + break; + case ECamRequestSsRelease: + ProcessSsReleaseRequest(); + break; + // ----------------------------------------------------- + // Image capture (cancel) + case ECamRequestImageCancel: + ProcessImageShutdownRequest( ECamRequestImageCancel ); + notify = EFalse; + break; + // ----------------------------------------------------- + // Start/cancel autofocus or set range + case ECamRequestStartAutofocus: + case ECamRequestCancelAutofocus: + case ECamRequestSetAfRange: + ProcessAutofocusRequestL( aRequestId ); + break; + // ----------------------------------------------------- + // Initialize image quality + case ECamRequestImageInit: + ProcessImageRequestL( ECamRequestImageInit ); + break; + // ----------------------------------------------------- + default: + Panic( ECamCameraControllerUnsupported ); + break; + } + + if( notify ) + { + TCamCameraEventId event( Request2Event( aRequestId ) ); + NotifyObservers( KErrNone, event, EventClass( event ) ); + } + + PRINT( _L("Camera <= CCamCameraController::DirectRequestL") ); + } + +// --------------------------------------------------------------------------- +// RequestSequenceL +// +// Issue request for a sequence of operations. +// +// Operations done during the sequence will be notified with +// associated event codes to observers. If any errors happen during the +// sequence, the notification will reflect this with the status code. +// When sequence ends, observers will be notified with event +// ECamCameraEventSequenceEnd. No new requests are accepted before +// ECamCameraEventSequenceEnd notification is sent. +// --------------------------------------------------------------------------- +// +void +CCamCameraController +::RequestSequenceL( const RCamRequestArray& aSequence ) + { + PRINT( _L("Camera => CCamCameraController::RequestSequence") ); + CheckEqualsL( iInfo.iBusy, ECamBusyOff, KErrInUse ); + + CAMERAAPP_PERF_CONTROLLER_START( ECamRequestNone ); + + ClearRequestQueue(); + iReserveTryAgainCount = KCamReserveTryAgainMaxCount; + + iSequenceArray.ReserveL( aSequence.Count() ); + for( TInt i = 0; i < aSequence.Count(); i++ ) + iSequenceArray.AppendL( aSequence[i] ); +// iSequenceArray.Compress(); + + SetFlags( iInfo.iBusy, ECamBusySequence ); // Cleared in EndSequence + iActive->IssueRequest(); + + PRINT( _L("Camera <= CCamCameraController::RequestSequence") ); + } + + +// --------------------------------------------------------------------------- +// RequestSettingsChangeL +// --------------------------------------------------------------------------- +// +void +CCamCameraController::RequestSettingsChangeL() + { + PRINT ( _L("Camera => CCamCameraController::RequestSettingsChangeL") ); + CheckEqualsL( iInfo.iBusy, ECamBusyOff, KErrInUse ); + CheckFlagOnL( iInfo.iState, ECamReserved, KErrNotReady ); + + PRINT ( _L("Camera <> Get changed settings..") ); + ClearSettingQueue(); + iSettingProvider.ProvidePendingSettingChangesL( iSettingArray ); + + PRINT ( _L("Camera <> Start processing..") ); + SetFlags( iInfo.iBusy, ECamBusySetting ); // Cleared in EndSequence + iActive->IssueRequest(); + + PRINT ( _L("Camera <= CCamCameraController::RequestSettingsChangeL") ); + } + + +// --------------------------------------------------------------------------- +// DirectRequestSettingsChangeL +// --------------------------------------------------------------------------- +// +void +CCamCameraController +::DirectSettingsChangeL( const TCamCameraSettingId& aSettingId ) + { + PRINT ( _L("Camera => CCamCameraController::DirectSettingsChangeL") ); + + CheckFlagOnL( iInfo.iState, ECamReserved, KErrNotReady ); + + TBool callback = ProcessSettingL( aSettingId ); + // If there is a callback, do notification there. + if( !callback ) + { + TCamCameraSettingId setting = aSettingId; + NotifyObservers( KErrNone, + ECamCameraEventSettingsSingle, + ECamCameraEventClassSettings, + &setting ); + } + + PRINT ( _L("Camera <= CCamCameraController::DirectSettingsChangeL") ); + } + + +// --------------------------------------------------------------------------- +// CancelSequence +// --------------------------------------------------------------------------- +// +void +CCamCameraController::CancelSequence() + { + PRINT( _L("Camera => CCamCameraController::CancelSequence") ); + if( iActive && + iActive->IsActive() ) + { + PRINT( _L("Camera <> iActive is active, call Cancel()..") ); + // Results to call to iActive::DoCancel + // which in turn calls our EndSequence. + iActive->Cancel(); + } + + // If busy flag is not set, we either had no sequence going on or + // iActive::DoCancel already handled calling EndSequence(). + if( IsFlagOn( iInfo.iBusy, ECamBusySequence|ECamBusySetting ) ) + { + PRINT( _L("Camera <> Busy, call EndSequence()..") ); + // Clears busy flag, if we were processing a sequence of requests / settings. + // If iBusy is set because one request is on the way, + // we must not clear it here - when that request is processed, + // the flag will be cleared. + EndSequence( KErrCancel ); + } + PRINT( _L("Camera <= CCamCameraController::CancelSequence") ); + } + +// --------------------------------------------------------------------------- +// SwitchCameraL +// --------------------------------------------------------------------------- +// +void +CCamCameraController::SwitchCameraL( TInt aCameraIndex ) + { + PRINT1( _L("Camera => CCamCameraController::SwitchCameraL%d"),aCameraIndex ); + #ifdef _DEBUG + if( aCameraIndex == iInfo.iCurrentCamera ) + { + PRINT( _L("Camera <> CCamCameraController::SwitchCameraL - Changing Secondary camera orientation") ); + } + #endif // _DEBUG + + if( aCameraIndex < 0 || aCameraIndex >= CamerasAvailable() ) + { + User::Leave( KErrNotSupported ); + } + else + { + // ----------------------------------------------------- + // First free old camera resources + if( iCamera ) + { + ReleaseCurrentCamera(); + } + + // used in CompleteSwitchCamera + iCurrentCameraIndex = aCameraIndex; + + // ----------------------------------------------------- + // Then create new camera: + PRINT ( _L("############################################################") ); +#ifdef CAMERAAPP_CAE_FOR_VIDEO + + PRINT1( _L("Camera <> Creating CCaeEngine, camera index: %d .."), aCameraIndex ); + iCaeEngine = NewCaeEngineL( aCameraIndex ); + +#else + + PRINT ( _L("Camera <> Note: CCamera only in use, no CCaeEngine") ); + PRINT1( _L("Camera <> Creating CCamera, camera index: %d .."), aCameraIndex ); + iCamera = NewCameraL( aCameraIndex ); + +#endif // CAMERAAPP_CAE_FOR_VIDEO + + + PRINT( _L("Camera <= CCamCameraController::SwitchCameraL") ); + } + } +// --------------------------------------------------------------------------- +// CompleteSwitchCameraL +// --------------------------------------------------------------------------- +// +void +CCamCameraController::CompleteSwitchCameraL() + { + PRINT( _L("Camera => CCamCameraController::CompleteSwitchCameraL") ); + if( iCurrentCameraIndex < 0 || iCurrentCameraIndex >= CamerasAvailable() ) + { + User::Leave( KErrNotSupported ); + } + else if( iCurrentCameraIndex == iInfo.iCurrentCamera ) + { + return; + } + +#ifdef CAMERAAPP_CAE_FOR_VIDEO + #ifdef CAMERAAPP_CAE_FIX + PRINT ( _L("Camera <> Creating new CCamera..") ); + iCamera = NewCameraL( iCurrentCameraIndex ); + #else + PRINT1( _L("Camera <> Creating CCamera duplicate, camera handle: %d .."), iCaeEngine->CCameraHandle() ); + iCamera = NewDuplicateCameraL( iCaeEngine->CCameraHandle() ); + #endif +#endif // CAMERAAPP_CAE_FOR_VIDEO + // Get the camera info and store current camera index. + // Camera index needed by GetAdvancedSettingsInfoL. + iCamera->CameraInfo( iCameraInfo ); + iInfo.iCurrentCamera = iCurrentCameraIndex; + +#ifdef CAMERAAPP_CAPI_V2_ADV + PRINT ( _L("Camera <> Creating CCameraAdvancedSettings..") ); + iAdvancedSettings = CCamera::CCameraAdvancedSettings::NewL( *iCamera ); +#ifdef CAMERAAPP_CAPI_V2_IP + if( KPrimaryCameraIndex == iInfo.iCurrentCamera ) + { + // Support only for primary camera. + // Ignore error in instantiation: If NewL leaves, there's no + // support for Image Processing available. Report error to client + // if settings requiring it are used. + PRINT ( _L("Camera <> Create CCameraImageProcessing..") ); + TRAP_IGNORE( iImageProcessor = CCamera::CCameraImageProcessing::NewL( *iCamera ) ); + PRINT1( _L("Camera <> Image Processor pointer: %d"), iImageProcessor ); + } +#endif // CAMERAAPP_CAPI_V2_IP + + // Get info on CCameraAdvancedSettings and CCameraImageProcessing + // support for several setting. Not supported settings will not + // cause this method to leave, only more serious errors. + GetAdvancedSettingsInfoL(); + + PRINT ( _L("Camera <> Get i/f MCameraOrientation..") ) + iCustomInterfaceOrientation = + static_cast ( + iCamera->CustomInterface( KCameraOrientationUid ) ); + PRINT1( _L("Camera <> Orientation custom i/f pointer:%d"), iCustomInterfaceOrientation ); + +#endif // CAMERAAPP_CAPI_V2_ADV + + PRINT ( _L("Camera <> ..done") ); + PRINT ( _L("############################################################") ); + + // ----------------------------------------------------- +#ifdef _DEBUG + PrintCameraInfo(); +#endif + // ----------------------------------------------------- + PRINT( _L("Camera <= CCamCameraController::CompleteSwitchCameraL") ); + } + + +// --------------------------------------------------------------------------- +// SetOrientationModeL +// --------------------------------------------------------------------------- +// +void +CCamCameraController::SetOrientationModeL( TInt aOrientation ) + { + PRINT1( _L("Camera => CCamCameraController::SetOrientationModeL %d"), aOrientation ); +#ifdef CAMERAAPP_CAE_FOR_VIDEO + PRINT( _L("Camera <> CCameraController: Get i/f MUIOrientationOverride from iCaeEngine..") ) + iCustomInterfaceUIOrientationOverride = + static_cast ( + iCaeEngine->CustomInterface( KCameraUIOrientationOverrideUid ) ); +#else + PRINT( _L("Camera <> CCameraController: Get i/f MUIOrientationOverride from iCamera..") ) + iCustomInterfaceUIOrientationOverride = + static_cast ( + iCamera->CustomInterface( KCameraUIOrientationOverrideUid ) ); +#endif // CAMERAAPP_CAE_FOR_VIDEO + + PRINT1( _L("Camera <> OrientationOverride custom i/f pointer:%d"), iCustomInterfaceUIOrientationOverride ); + iCustomInterfaceUIOrientationOverride->SetOrientationModeL( aOrientation ); + + PRINT( _L("Camera <= CCamCameraController::SetOrientationModeL") ); + } + +// --------------------------------------------------------------------------- +// CamerasAvailable <> +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController::CamerasAvailable() + { +#ifndef CAMERAAPP_CAPI_EMULATOR + return CCamera::CamerasAvailable(); +#else + // Temporary + return 2; +#endif + } + +// --------------------------------------------------------------------------- +// CameraHandle +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController::CameraHandle() + { + if( iCamera ) + return iCamera->Handle(); + else + return KNullHandle; + } + + +// --------------------------------------------------------------------------- +// CameraInfo +// --------------------------------------------------------------------------- +// +const TCameraInfo& +CCamCameraController::CameraInfo() const + { + return iCameraInfo; + } + +// --------------------------------------------------------------------------- +// ControllerInfo +// --------------------------------------------------------------------------- +// +const TCamControllerInfo& +CCamCameraController::ControllerInfo() const + { + return iInfo; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TUint +CCamCameraController::State() const + { + return iInfo.iState; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamViewfinderMode +CCamCameraController::ViewfinderMode() const + { + return iInfo.iVfMode; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamCameraTriState +CCamCameraController::ViewfinderState() const + { + return iInfo.iVfState; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamCameraTriState +CCamCameraController::SnapshotState() const + { + return iInfo.iSsState; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TCamCameraReadyState +CCamCameraController::FlashState() const + { + TCamCameraReadyState state = ECamUnknown; + +#ifdef CAMERAAPP_CAPI_V2_ADV + if( iAdvancedSettings ) + { + TBool ready = EFalse; + TInt queryStatus = iAdvancedSettings->IsFlashReady( ready ); + + if( KErrNone == queryStatus ) + { + state = ready ? ECamReady : ECamNotReady; + } + } +#endif // CAMERAAPP_CAPI_V2_ADV + return state; + } + + + +// --------------------------------------------------------------------------- +// GetCameraSettingValueL +// --------------------------------------------------------------------------- +// +void +CCamCameraController +::GetCameraSettingValueL( const TCamCameraSettingId& aSettingId, + TAny* aSettingData ) + { + PRINT( _L("Camera => CCamCameraController::GetCameraSettingValueL") ); + CheckNonNullL( aSettingData, KErrArgument ); + + switch( aSettingId ) + { + // ----------------------------------------------------- + case ECameraSettingFlash: + case ECameraUserSceneSettingFlash: + { + CCamera::TFlash* flash = static_cast( aSettingData ); +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + *flash = iCaeEngine->FlashMode(); + else +#endif + { + *flash = iCamera->Flash(); + } + break; + } + // ----------------------------------------------------- + case ECameraSettingExposure: + case ECameraUserSceneSettingExposure: + { + TPckgBuf* exposure = + static_cast*>( aSettingData ); +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + (*exposure)().iExposureMode = iCaeEngine->ExposureMode(); + else +#endif // CAMERAAPP_CAE_FIX + { + #ifdef CAMERAAPP_CAPI_V2_ADV + (*exposure)().iExposureMode = iAdvancedSettings->ExposureMode(); + (*exposure)().iExposureStep = iAdvancedSettings->ExposureCompensationStep(); + #else + (*exposure)().iExposureMode = iCamera->Exposure(); + #endif + } + break; + } + // ----------------------------------------------------- +#ifdef CAMERAAPP_CAPI_V2_ADV + case ECameraSettingLightSensitivity: + case ECameraUserSceneSettingLightSensitivity: + { + TInt* iso = static_cast( aSettingData ); + *iso = iAdvancedSettings->IsoRate(); + break; + } + case ECameraSettingContAF: + { + TInt* contAF = static_cast( aSettingData ); + *contAF = iAdvancedSettings->AutoFocusType() & //bitwise + CAS::EAutoFocusTypeContinuous; + break; + } +#endif + // ----------------------------------------------------- + case ECameraSettingWhiteBalance: + case ECameraUserSceneSettingWhiteBalance: + { + TPckgBuf* wb = + static_cast*>( aSettingData ); + +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + (*wb)().iWhiteBalanceMode = iCaeEngine->WhiteBalanceMode(); + else +#endif // CAMERAAPP_CAE_FIX + { + (*wb)().iWhiteBalanceMode = iCamera->WhiteBalance(); + } + break; + } + // ----------------------------------------------------- +#ifdef CAMERAAPP_CAPI_V2_IP + case ECameraSettingColourEffect: + case ECameraUserSceneSettingColourEffect: + { + CheckNonNullL( iImageProcessor, KErrNotSupported ); + + CIP::TEffect* effect = static_cast( aSettingData ); + *effect = + (CIP::TEffect) + iImageProcessor->TransformationValue( KUidECamEventImageProcessingEffect ); + break; + } + // ----------------------------------------------------- + case ECameraSettingSharpness: + case ECameraUserSceneSettingSharpness: + { + CheckNonNullL( iImageProcessor, KErrNotSupported ); + + TInt* sharpness = static_cast( aSettingData ); + *sharpness = iImageProcessor->TransformationValue( KUidECamEventImageProcessingAdjustSharpness ); + break; + } +#endif + // ----------------------------------------------------- + case ECameraSettingDigitalZoom: + { + TInt* zoom = static_cast( aSettingData ); +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + *zoom = iCaeEngine->ZoomValue(); + else +#endif + { + // Zoom step despite the misleading method name. + *zoom = iCamera->ZoomFactor(); + } + break; + } + // ----------------------------------------------------- +#ifdef CAMERAAPP_CAPI_V2_ADV + case ECameraSettingOpticalZoom: + { + TInt* zoom = static_cast( aSettingData ); + *zoom = iAdvancedSettings->OpticalZoom(); + break; + } +#endif + // ----------------------------------------------------- +#ifdef CAMERAAPP_CAE_FOR_VIDEO + case ECameraSettingFileMaxSize: + { + if( iCaeEngine ) + { + TInt* bytes = static_cast( aSettingData ); + *bytes = iCaeEngine->VideoClipMaxSize(); + } + else + { + User::Leave( KErrNotReady ); + } + break; + } + // ----------------------------------------------------- + case ECameraSettingFileName: + { + User::Leave( KErrNotSupported ); + break; + } + // ----------------------------------------------------- + case ECameraSettingAudioMute: + { + if( iCaeEngine ) + { + TBool* mute = static_cast( aSettingData ); + *mute = iCaeEngine->VideoAudio(); + } + else + { + User::Leave( KErrNotReady ); + } + break; + } +#endif + // ----------------------------------------------------- + case ECameraSettingFacetracking: + { + if( iCustomInterfaceFaceTracking ) + { + TBool* ftOn = static_cast( aSettingData ); + *ftOn = iCustomInterfaceFaceTracking->FaceTrackingOn(); + PRINT1( _L("Camera <> facetracking setting: %d"), *ftOn ) + } + else + { + User::Leave( KErrNotReady ); + } + break; + } + // ----------------------------------------------------- + case ECameraSettingBrightness: + case ECameraUserSceneSettingBrightness: + { + CCamera::TBrightness* brightness = + static_cast( aSettingData ); +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + *brightness = (CCamera::TBrightness)iCaeEngine->Brightness(); + else +#endif + *brightness = (CCamera::TBrightness)iCamera->Brightness(); + break; + } + // ----------------------------------------------------- + case ECameraSettingContrast: + case ECameraUserSceneSettingContrast: + { + CCamera::TContrast* contrast = + static_cast( aSettingData ); +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + *contrast = (CCamera::TContrast)iCaeEngine->Contrast(); + else +#endif + *contrast = (CCamera::TContrast)iCamera->Contrast(); + break; + } +#ifdef CAMERAAPP_CAPI_V2_ADV + // ----------------------------------------------------- + case ECameraSettingStabilization: + { + TPckgBuf* pckg = + static_cast*>( aSettingData ); + TCamSettingDataStabilization& stabilization = (*pckg)(); + + stabilization.iMode = iAdvancedSettings->StabilizationMode(); + stabilization.iEffect = iAdvancedSettings->StabilizationEffect(); + stabilization.iComplexity = iAdvancedSettings->StabilizationComplexity(); + break; + } +#endif // CAMERAAPP_CAPI_V2_ADV + // ----------------------------------------------------- + // Image orientation + case ECameraSettingOrientation: + { + CheckNonNullL( iCustomInterfaceOrientation, KErrNotSupported ); + + MCameraOrientation::TOrientation* orientation = + static_cast( aSettingData ); + + *orientation = iCustomInterfaceOrientation->Orientation(); + break; + } + // ----------------------------------------------------- + case ECameraSettingFocusRange: + default: + { +#ifndef CAMERAAPP_EMULATOR_BUILD + PRINT ( _L("Camera <> Not supported, LEAVE!") ); + User::Leave( KErrNotSupported ); +#endif // not CAMERAAPP_EMULATOR_BUILD + break; + } + // ------------------------------- + } + } + + + +// --------------------------------------------------------------------------- +// ProcessNextRequestL +// +// Called from iActive::RunL. +// If the request made to CCamera has a callback, more calls from iActive +// will not be requested here, but in those callbacks. +// Leave here will cause iActive to call EndSequence with the error code. +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController::ProcessNextRequestL() + { + PRINT( _L("Camera => CCamCameraController::ProcessNextRequestL") ); + TInt readyForNextStep( EFalse ); + + +#ifdef CAMERAAPP_CAE_FIX + // ------------------------------------------------------- + if( ECamModeChangeInactive != iModeChange ) + { + readyForNextStep = ProceedModeSwitch(); + } + else +#endif // CAMERAAPP_CAE_FIX + + // ------------------------------------------------------- + if( IsFlagOn( iInfo.iBusy, ECamBusySetting ) ) + { + PRINT( _L("Camera <> Settings ongoing") ); + + iSettingIndex++; + if( iSettingIndex < iSettingArray.Count() ) + { + const TCamCameraSettingId& setting( iSettingArray[iSettingIndex] ); + + readyForNextStep = ProcessSettingL( setting ); + // No notification sent at the moment per setting. + } + else + { + EndSequence( KErrNone ); + } + } + // ------------------------------------------------------- + else if( IsFlagOn( iInfo.iBusy, ECamBusySequence ) ) + { + PRINT( _L("Camera <> Sequence ongoing") ); + + iSequenceIndex++; + if( iSequenceIndex < iSequenceArray.Count() ) + { + const TCamCameraRequestId& requestId( iSequenceArray[iSequenceIndex] ); + + PRINT( _L("Camera <> process request..") ); + // If this request will be responded through MCameraObserver(2) callback, + // iActive will be requested a new callback there and also + // the notification to our observers will be sent there. + // Otherwise we do both of those right away. + readyForNextStep = ProcessOneRequestL( requestId ); + + if( readyForNextStep ) + { + if( ECamRequestVideoStop == requestId + || ECamRequestImageCancel == requestId ) + { + // For video stop request, callback has already happened and notification + // has been given. No need to do anything here. + PRINT( _L("Camera <> CCamCameraController::RequestL .. Skipping commmon notification, is done already.") ); + } + else + { + TCamCameraEventId event( Request2Event( requestId ) ); + NotifyObservers( KErrNone, event, EventClass( event ) ); + } + } + } + else + { + PRINT( _L("Camera <> Sequence end detected") ); + EndSequence( KErrNone ); + } + } + // ------------------------------------------------------- + else + { + PRINT( _L("Camera <> Nothing active!! PANIC") ); + __ASSERT_DEBUG( EFalse, Panic( ECamCameraControllerCorrupt ) ); + } + // ------------------------------------------------------- + + PRINT1( _L("Camera <= CCamCameraController::ProcessNextRequestL, more calls now:%d"), readyForNextStep ); + return readyForNextStep; + } + + + +// --------------------------------------------------------------------------- +// ProcessSettingL +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController::ProcessSettingL( const TCamCameraSettingId& aSettingId ) + { + PRINT1( _L("Camera => CCamCameraController::ProcessSettingL [%s]"), + KCameraSettingNames[aSettingId] ); + + TInt callback( EFalse ); + switch( aSettingId ) + { + // ------------------------------- + case ECameraSettingCaptureLimit: + { + ProcessCaptureLimitSettingL(); + break; + } + // ------------------------------- + case ECameraSettingFlash: + case ECameraUserSceneSettingFlash: + { + if ( IsFlagOn( iInfo.iState, ECamVideoOn ) ) + { + CCamera::TFlash flash( CCamera::EFlashNone ); + TCamFlashId currentFlashSetting( ECamFlashOff ); + // Video light setting has values ECamFlashOff/ECamFlashForced + iSettingProvider.ProvideCameraSettingL( aSettingId, + ¤tFlashSetting ); + PRINT2( _L("Camera => Video Flash now = %d, new = %d"), + iCamera->Flash(), currentFlashSetting ); + // Camera uses values EFlashNone/EFlashVideoLight + flash = (currentFlashSetting == ECamFlashOff)? + CCamera::EFlashNone:CCamera::EFlashVideoLight; + PRINT1( _L("Camera => iCamera->SetFlashL( %d )"), flash ); + iCamera->SetFlashL( flash ); + } + else + { + // Still image flash + CCamera::TFlash flash( CCamera::EFlashAuto ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &flash ); +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + { + iCaeEngine->SetFlashModeL( flash ); + } + else +#endif + { + if( iCamera->Flash() != flash ) + { + iCamera->SetFlashL( flash ); +#ifdef CAMERAAPP_CAPI_V2 + callback = ETrue; +#endif + } + } + } + break; + } + // ------------------------------- + case ECameraSettingExposure: + case ECameraUserSceneSettingExposure: + { + TPckgBuf params; + iSettingProvider.ProvideCameraSettingL( aSettingId, ¶ms ); +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + iCaeEngine->SetExposureModeL( params().iExposureMode ); + else +#endif // CAMERAAPP_CAE_FIX + { +#ifdef CAMERAAPP_CAPI_V2_ADV + PRINT( _L("Calling iAdvancedSettings->SetExposureMode..") ); + const CCamera::TExposure& mode = params().iExposureMode; + // Zero value is default and always supported + // (CCamera::EExposureAuto) + if( mode == CCamera::EExposureAuto || mode & iAdvancedSettingInfo.iEvModesSupport ) + { + iAdvancedSettings->SetExposureMode( mode ); + // iCamera->SetExposureL( mode ); + + TInt step = ResolveEvStep( params().iExposureStep ); + // Value needs to be multiplied by KECamFineResolutionFactor. + // Setting provider does this for us. + PRINT( _L("Calling iAdvancedSettings->SetExposureCompensationStep..") ); + iAdvancedSettings->SetExposureCompensationStep( step ); + + callback = ETrue; + } + else + { + User::Leave( KErrNotSupported ); + } +#else + iCamera->SetExposureL( params().iExposureMode ); +#endif // CAMERAAPP_CAPI_V2_ADV + } + break; + } + // ------------------------------- +#ifdef CAMERAAPP_CAPI_V2_ADV + case ECameraSettingLightSensitivity: + case ECameraUserSceneSettingLightSensitivity: + { + TInt iso( 0 ); + RArray ISOarray; + CleanupClosePushL( ISOarray ); + iAdvancedSettings->GetSupportedIsoRatesL( ISOarray ); + iSettingProvider.SetSupportedISORatesL( ISOarray ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &iso ); + callback = ETrue; + CleanupStack::PopAndDestroy( &ISOarray ); + + PRINT1( _L("Camera <> Setting ISO rate to: %d"), iso ); + if( !iso ) + { + // ISO Auto + iAdvancedSettings->SetISORateL( + CCamera::CCameraAdvancedSettings::EISOAutoUnPrioritised, iso ); + } + else if( IsSupportedValue( iso, + iAdvancedSettingInfo.iIsoRatesSupport, + EDiscreteSteps ) ) + { + // Selected ISO rate + iAdvancedSettings->SetISORateL( + CCamera::CCameraAdvancedSettings::EISOManual, iso ); + } + else + { + User::Leave( KErrNotSupported ); + } + break; + } +#endif + // ------------------------------- + case ECameraSettingWhiteBalance: + case ECameraUserSceneSettingWhiteBalance: + { + TPckgBuf params; + iSettingProvider.ProvideCameraSettingL( aSettingId, ¶ms ); +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + iCaeEngine->SetWhiteBalanceModeL( params().iWhiteBalanceMode ); + else +#endif // CAMERAAPP_CAE_FIX + { + iCamera->SetWhiteBalanceL( params().iWhiteBalanceMode ); +#ifdef CAMERAAPP_CAPI_V2 + callback = ETrue; +#endif + } + break; + } + // ------------------------------- +#ifdef CAMERAAPP_CAPI_V2_IP + case ECameraSettingColourEffect: + case ECameraUserSceneSettingColourEffect: + { + CheckNonNullL( iImageProcessor, KErrNotSupported ); + CIP::TEffect effect( CIP::EEffectNone ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &effect ); + + if( IsSupportedValue( effect, + iAdvancedSettingInfo.iColourEffectSupport, + iAdvancedSettingInfo.iColourEffectValueInfo ) ) + { + iImageProcessor->SetTransformationValue( KUidECamEventImageProcessingEffect, effect ); + callback = ETrue; + } + else + User::Leave( KErrNotSupported ); + break; + } + // ------------------------------- + case ECameraSettingSharpness: + case ECameraUserSceneSettingSharpness: + { + CheckNonNullL( iImageProcessor, KErrNotSupported ); + TInt sharpness( 0 ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &sharpness ); + + if( IsSupportedValue( sharpness, + iAdvancedSettingInfo.iSharpnessSupport, + iAdvancedSettingInfo.iSharpnessValueInfo ) ) + { + iImageProcessor->SetTransformationValue( KUidECamEventImageProcessingAdjustSharpness, sharpness ); + callback = ETrue; + } + else + User::Leave( KErrNotSupported ); + break; + } +#endif // CAMERAAPP_CAPI_V2_IP + // ------------------------------- + case ECameraSettingBrightness: + case ECameraUserSceneSettingBrightness: + { + CCamera::TBrightness brightness( CCamera::EBrightnessAuto ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &brightness ); + iCamera->SetBrightnessL( brightness ); + break; + } + // ------------------------------- + case ECameraSettingContrast: + case ECameraUserSceneSettingContrast: + { + CCamera::TContrast contrast( CCamera::EContrastAuto ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &contrast ); + iCamera->SetContrastL( contrast ); + break; + } + // ------------------------------- + case ECameraSettingDigitalZoom: + { + TInt zoom( 0 ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &zoom ); + PRINT1( _L("Camera <> Setting digital zoom step to: %d"), zoom ); +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + iCaeEngine->SetZoomValueL( zoom ); + else +#endif + { +#ifdef CAMERAAPP_CAPI_V2_ADV + if( iAdvancedSettingInfo.iDigitalZoomSupport.Count() > zoom ) + iAdvancedSettings->SetDigitalZoom( iAdvancedSettingInfo.iDigitalZoomSupport[zoom] ); + else + User::Leave( KErrNotSupported ); + callback = ETrue; + +#else + // Note: Even if the method is misleadingly named + // CCamera::SetDigitalZoomFactorL, the values are + // zoom steps, not zoom factors. + iCamera->SetDigitalZoomFactorL( zoom ); +#endif + + } + break; + } + // ------------------------------- +#ifdef CAMERAAPP_CAPI_V2_ADV + case ECameraSettingOpticalZoom: + { + TInt zoom( 0 ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &zoom ); + PRINT1( _L("Camera <> Setting optical zoom to: %d"), zoom ); + iAdvancedSettings->SetOpticalZoom( zoom ); + callback = ETrue; + break; + } + // ----------------------------------------------------- + case ECameraSettingStabilization: + { + PRINT( _L("Camera <> CCamCameraController::ProcessSettingL ECameraSettingStabilization") ); + TPckgBuf stabilization; + iSettingProvider.ProvideCameraSettingL( aSettingId, &stabilization ); + + // Check that the values are supported.. + TBool modeOk = ( CAS::EStabilizationModeOff == stabilization().iMode + || iAdvancedSettingInfo.iStabilizationModeSupport & stabilization().iMode ); + TBool effectOk = ( CAS::EStabilizationOff == stabilization().iEffect + || iAdvancedSettingInfo.iStabilizationEffectSupport & stabilization().iEffect ); + TBool complexOk = ( CAS::EStabilizationComplexityAuto == stabilization().iComplexity + || iAdvancedSettingInfo.iStabilizationComplexitySupport & stabilization().iComplexity ); + + if( modeOk && effectOk && complexOk ) + { + PRINT1( _L("Camera <> CCamCameraController::ProcessSettingL set stabilization mode=%d"), stabilization().iMode ); + iAdvancedSettings->SetStabilizationMode ( stabilization().iMode ); + iAdvancedSettings->SetStabilizationEffect ( stabilization().iEffect ); + iAdvancedSettings->SetStabilizationComplexity( stabilization().iComplexity ); + // Events: + // KUidECamEventCameraSettingStabilizationMode + // KUidECamEventCameraSettingsStabilizationEffect + // KUidECamEventSettingsStabilizationAlgorithmComplexity + // We use the latest one to determine when we can continue. + // Do not change above order unless CCamSettingConversion::Map2EventUidValue + // is edited.. + } + else + { + User::Leave( KErrNotSupported ); + } + + callback = ETrue; + break; + } + // ------------------------------- + case ECameraSettingContAF: + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi->AppController().UiConfigManagerPtr()->IsContinuosAutofocusSupported() ) + { + TBool isContAFon( iAdvancedSettings->AutoFocusType() & + CAS::EAutoFocusTypeContinuous ); + if( IsFlagOn( iInfo.iState, ECamVideoOn ) ) + { + TBool contAF( ETrue ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &contAF ); + if( contAF != isContAFon ) + { + CAS::TAutoFocusType type = contAF? CAS::EAutoFocusTypeContinuous: + CAS::EAutoFocusTypeOff; + iAdvancedSettings->SetAutoFocusType( type ); + } + } + else + { + // Do nothing + } + } + break; + } +#endif // CAMERAAPP_CAPI_V2_ADV + // ------------------------------- +#ifdef CAMERAAPP_CAE_FOR_VIDEO + case ECameraSettingFileMaxSize: + { + if( iCaeEngine ) + { + TInt bytes( 0 ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &bytes ); + if( iCaeEngine->VideoClipMaxSize() != bytes ) + { + iCaeEngine->SetVideoClipMaxSizeL( bytes ); + callback = IsFlagOn( iInfo.iState, ECamVideoOn ); + } + } + else + { + // + PRINT( _L("Camera <> Video file size too early, NOT SET!!") ); + } + break; + } + // ------------------------------- + case ECameraSettingFileName: + { + if( iCaeEngine ) + { + PRINT ( _L("Camera <> processing filename setting") ); + + HBufC* filename = HBufC::NewLC( KMaxFileName ); + TPtr ptr = filename->Des(); + PRINT ( _L("Camera <> get filename from setting provider..") ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &ptr ); + + PRINT1( _L("Camera <> set filename [%S]"), filename ); + iCaeEngine->SetVideoRecordingFileNameL( ptr ); + + CleanupStack::PopAndDestroy( filename ); + // If video has been prepared, MCaeoVideoPrepareComplete will be repeated, + // and needs to be waited. + callback = IsFlagOn( iInfo.iState, ECamVideoOn ); + } + else + { + PRINT( _L("Camera <> Video name too early, NOT SET!!") ); + } + break; + } + // ------------------------------- + case ECameraSettingAudioMute: + { + if( iCaeEngine ) + { + TBool isAudioOn( EFalse ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &isAudioOn ); + TBool audioOn( iCaeEngine->VideoAudio() ); + // If we need to mute audio and audio is on + // or we need to enable audio and audio is off + if( isAudioOn != audioOn ) + { + iCaeEngine->SetVideoAudioL( isAudioOn ); + callback = IsFlagOn( iInfo.iState, ECamVideoOn ); + } + } + else + { + PRINT( _L("Camera <> Video mute too early, NOT SET!!") ); + } + break; + } + // ------------------------------- + case ECameraSettingFacetracking: + { + if( iCustomInterfaceFaceTracking ) + { + SetFaceTrackingL(); + } + else + { + PRINT( _L("Camera <> Facetracking too early, NOT SET!!") ); + } + break; + } +#endif + // ------------------------------- + // Image orientation + case ECameraSettingOrientation: + { + CheckNonNullL( iCustomInterfaceOrientation, KErrNotSupported ); + MCameraOrientation::TOrientation + orientation( MCameraOrientation::EOrientation0 ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &orientation ); + + PRINT1( _L("Camera <> setting camera orientation to [0x%02x]"), orientation ); + iCustomInterfaceOrientation->SetOrientationL( orientation ); + break; + } + // ------------------------------- + case ECameraSettingFocusRange: + default: + { +#ifndef CAMERAAPP_EMULATOR_BUILD + PRINT ( _L("Camera <> Not supported, LEAVE!") ); + User::Leave( KErrNotSupported ); +#endif // not CAMERAAPP_EMULATOR_BUILD + break; + } + // ------------------------------- + } + + PRINT1( _L("Camera <= CCamCameraController::ProcessSettingL, continue now:%d"), !callback ); + return !callback; + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController +::ProcessOneRequestL( const TCamCameraRequestId& aRequestId ) + { + PRINT( _L("Camera => CCamCameraController::ProcessOneRequestL") ); + PRINT2( _L("Camera <> processing request [%s] id:%d "), + KCamRequestNames[aRequestId], + aRequestId ); + + TInt readyForNext( ETrue ); + + // Order from most time critical / frequent + // to less time critical / seldom. + // Handled in submethods to preserve readability. + // ----------------------------------------------------- + switch( aRequestId ) + { + // ------------------------------- + case ECamRequestReserve: + case ECamRequestPowerOn: + readyForNext = ProcessControlStartupRequestL( aRequestId ); + break; + case ECamRequestPowerOff: + case ECamRequestRelease: + readyForNext = ProcessControlShutdownRequest( aRequestId ); + break; + // ------------------------------- + case ECamRequestVfStart: + case ECamRequestVfStop: + case ECamRequestVfRelease: + readyForNext = ProcessVfRequestL( aRequestId ); + break; + // ------------------------------- + case ECamRequestSsStart: + case ECamRequestSsStop: + case ECamRequestSsRelease: + readyForNext = ProcessSnapshotRequestL( aRequestId ); + break; + // ------------------------------- + case ECamRequestImageInit: + case ECamRequestImageCapture: + readyForNext = ProcessImageRequestL( aRequestId ); + break; + case ECamRequestImageCancel: + case ECamRequestImageRelease: + readyForNext = ProcessImageShutdownRequest( aRequestId ); + break; + // ------------------------------- + case ECamRequestVideoInit: + case ECamRequestVideoStart: + case ECamRequestVideoPause: + case ECamRequestVideoStop: + case ECamRequestVideoRelease: + case ECamRequestSetAsyncVideoStopMode: + readyForNext = ProcessVideoRequestL( aRequestId ); + break; + // ------------------------------- + default: + Panic( ECamCameraControllerUnknownRequest ); + break; + // ------------------------------- + } + // ----------------------------------------------------- + PRINT( _L("Camera <= CCamCameraController::ProcessOneRequestL") ); + return readyForNext; + } + + +// --------------------------------------------------------------------------- +// ProcessControlStartupRequestL +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController +::ProcessControlStartupRequestL( const TCamCameraRequestId& aRequestId ) + { + PRINT1( _L("Camera => CCamCameraController::ProcessControlStartupRequestL [%s]"), + KCamRequestNames[aRequestId] ); + // ------------------------------------------------------- + // Reserve + if( ECamRequestReserve == aRequestId ) + { + CheckFlagOffL( iInfo.iState, ECamReserved, KErrInUse ); + + CAMERAAPP_PERF_CONTROLLER_START( ECamRequestReserve ); + iCamera->Reserve(); + } + // ------------------------------------------------------- + // Power on + else if( ECamRequestPowerOn == aRequestId ) + { + CheckFlagOnL ( iInfo.iState, ECamReserved, KErrNotReady ); + CheckFlagOffL( iInfo.iState, ECamPowerOn, KErrInUse ); + + CAMERAAPP_PERF_CONTROLLER_START( ECamRequestPowerOn ); + + iCamera->PowerOn(); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi->AppController().UiConfigManagerPtr()->IsUIOrientationOverrideSupported() ) + { + NotifyObservers( KErrNone, + ECamCameraEventPowerOnRequested, + ECamCameraEventClassBasicControl ); + } + + } + // ------------------------------------------------------- + // Unknown + else + { + Panic( ECamCameraControllerCorrupt ); + } + // ------------------------------------------------------- + iReleasedByUi = EFalse; + PRINT( _L("Camera <= CCamCameraController::ProcessControlStartupRequestL") ); + // Callback needs to be received before we can continue. + return EFalse; + } + +// --------------------------------------------------------------------------- +// ProcessControlShutdownRequest +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController +::ProcessControlShutdownRequest( const TCamCameraRequestId& aRequestId ) + { + PRINT( _L("Camera => CCamCameraController::ProcessControlShutdownRequest") ); + // ------------------------------------------------------- + // Power off + if( ECamRequestPowerOff == aRequestId ) + { + if( IsFlagOn( iInfo.iState, ECamPowerOn ) ) + { + // ------------------------------- + // Release image or video capture + if( IsFlagOn( iInfo.iState, ECamImageOn ) ) + { + // Leaves only if state is wrong (already checked here). + ProcessImageShutdownRequest( ECamRequestImageRelease ); + NotifyObservers( KErrNone, + ECamCameraEventImageRelease, + ECamCameraEventClassImage ); + } + else if( IsFlagOn( iInfo.iState, ECamVideoOn ) ) + { + TRAP_IGNORE( ProcessVideoRequestL( ECamRequestVideoRelease ) ); + NotifyObservers( KErrNone, + ECamCameraEventVideoRelease, + ECamCameraEventClassVideo ); + } + else + { + } + // ------------------------------- + // If viewfinder is not released yet, release it now. + if( ECamTriIdle != iInfo.iVfState ) + { + ProcessVfRelaseRequest(); + NotifyObservers( KErrNone, + ECamCameraEventVfRelease, + ECamCameraEventClassVfControl ); + } + + // ------------------------------- + // If snapshot is not released yet, release it now. + if( ECamTriIdle != iInfo.iSsState ) + { + ProcessSsReleaseRequest(); + NotifyObservers( KErrNone, + ECamCameraEventSsRelease, + ECamCameraEventClassSsControl ); + } + // ------------------------------- + // Do the actual powering off. +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + { + iCaeEngine->PowerOff(); + } + else +#endif // CAMERAAPP_CAE_FIX + { + iCamera->PowerOff(); + } + // ------------------------------- + } + ClearFlags( iInfo.iState, ECamPowerOn ); + } + // ------------------------------------------------------- + // Release + else if( ECamRequestRelease == aRequestId ) + { + if( IsFlagOn( iInfo.iState, ECamReserved ) ) + { + // If power off not called yet, do it now. + if( IsFlagOn( iInfo.iState, ECamPowerOn ) ) + { + ProcessControlShutdownRequest( ECamRequestPowerOff ); + // Separate notification needed here, because operation done + // as part of handling other request. + NotifyObservers( KErrNone, + ECamCameraEventPowerOff, + ECamCameraEventClassBasicControl ); + } +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + { + iCaeEngine->Release(); + iCaeInUse = EFalse; + } + else +#endif // CAMERAAPP_CAE_FIX + { + iCamera->Release(); + iReleasedByUi = ETrue; + if( iIveRecoveryCount > 0 ) + { + HandleReserveLostEvent( KErrNone ); + } + } + } + PRINT( _L("Camera <> released, reset info") ); + + // Reset our info, but preserve busy flag and camera index. + // Sets iInfo.iState to ECamIdle. + iInfo.Reset( ETrue, ETrue ); + } + // ------------------------------------------------------- + // Unknown + else + { + Panic( ECamCameraControllerCorrupt ); + } + // ------------------------------------------------------- + PRINT( _L("Camera <= CCamCameraController::ProcessControlShutdownRequest") ); + + // No callback needs to be waited. + return ETrue; + } + +// --------------------------------------------------------------------------- +// ProcessViewfinderRequestL +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController +::ProcessVfRequestL( const TCamCameraRequestId& aRequestId ) + { + CheckFlagOnL( iInfo.iState, ECamPowerOn, KErrNotReady ); + + switch( aRequestId ) + { + // ----------------------------------------------------- + case ECamRequestVfStart: + { + CAMERAAPP_PERF_CONTROLLER_STARTNEW( ECamRequestVfStart, iFirstVfFrameReceived ); + ProcessVfStartRequestL(); + break; + } + // ----------------------------------------------------- + case ECamRequestVfStop: + { + ProcessVfStopRequestL(); + break; + } + // ----------------------------------------------------- + case ECamRequestVfRelease: + { + ProcessVfRelaseRequest(); + break; + } + // ----------------------------------------------------- + default: + { + Panic( ECamCameraControllerCorrupt ); + break; + } + // ----------------------------------------------------- + } + + // No callback to be waited + return ETrue; + } + + +// --------------------------------------------------------------------------- +// InitViewfinderL +// --------------------------------------------------------------------------- +// +void +CCamCameraController::InitViewfinderL( const TCamViewfinderMode& aMode ) + { + PRINT( _L("Camera => CCamCameraController::InitViewfinderL") ); + + // Check the old viewfinder is released now. + // No further checks made here. + __ASSERT_DEBUG( ECamTriIdle == iInfo.iVfState, Panic( ECamCameraControllerCorrupt ) ); + + // Then init the new mode + switch( aMode ) + { + // --------------------------------- + case ECamViewfinderDirect: + { + // Don't proceed if not supported by camera. + CheckFlagOnL( iCameraInfo.iOptionsSupported, + TCameraInfo::EViewFinderDirectSupported, + KErrNotSupported ); + + #ifdef CAMERAAPP_CAPI_V2_DVF + PRINT( _L("Camera <> Creating CCameraDirectViewFinder instance") ); + if( iDirectViewfinder ) + { + delete iDirectViewfinder; + iDirectViewfinder=NULL; + } + iDirectViewfinder = CCamera::CCameraDirectViewFinder::NewL( *iCamera ); + #else + // not implemented + Panic( ECamCameraControllerUnsupported ); + #endif + iInfo.iVfState = ECamTriInactive; + iInfo.iVfMode = ECamViewfinderDirect; + break; + } + // --------------------------------- + case ECamViewfinderBitmap: + { + // Don't proceed if not supported by camera. + CheckFlagOnL( iCameraInfo.iOptionsSupported, + TCameraInfo::EViewFinderBitmapsSupported, + KErrNotSupported ); + + iInfo.iVfState = ECamTriInactive; + iInfo.iVfMode = ECamViewfinderBitmap; + break; + } + // --------------------------------- + case ECamViewfinderNone: + // Mode is "none", so no init needed. + break; + // --------------------------------- + default: + // Unknown mode + Panic( ECamCameraControllerUnsupported ); + break; + // --------------------------------- + } + PRINT( _L("Camera <= CCamCameraController::InitViewfinderL") ); + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +void +CCamCameraController +::ProcessVfStartRequestL() + { + PRINT( _L("Camera => CCamCameraController::ProcessVfStartRequestL") ); + +#ifdef __WINSCW__ + const TCamViewfinderMode KTargetMode( ECamViewfinderBitmap ); +#else + + TPckgBuf mode; + iSettingProvider.ProvideCameraParamL( ECameraParamVfMode, &mode ); + + // If the viewfinder mode needs to be changed, + // first stop and release resources related to the old viewfinder type. + const TCamViewfinderMode KTargetMode( mode() ); +#endif + + if( ECamViewfinderNone != iInfo.iVfMode + && KTargetMode != iInfo.iVfMode ) + { + ProcessVfRelaseRequest(); + } + + // Check that application is still in foreground, if not then return + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + if ( !appUi->AppInBackground( ETrue ) ) + { + switch( iInfo.iVfState ) + { + // ----------------------------------------------------- + case ECamTriIdle: + PRINT( _L("Camera <> case ECamTriIdle") ); + + InitViewfinderL( KTargetMode ); + // << fall through >> + + case ECamTriInactive: + { + // ------------------------------- + PRINT( _L("Camera <> case ECamTriInactive") ); + + if( ECamViewfinderDirect == iInfo.iVfMode ) +#ifdef CAMERAAPP_CAPI_V2_DVF + { + switch( iDirectViewfinder->ViewFinderState() ) + { + case CCamera::CCameraDirectViewFinder::EViewFinderInActive: + { + if ( !iViewfinderWindow ) + { + PRINT( _L("Camera <> CCamCameraController::iViewfinderWindow is NULL - cannot start VF!") ); + User::Leave( KErrNotReady ); + } + + // Use the same viewfinder position and size as for bitmap viewfinder + TPckgBuf params; + iSettingProvider.ProvideCameraParamL( ECameraParamVfBitmap, ¶ms ); + + CEikonEnv* env = CEikonEnv::Static(); + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_VF_INIT 0" ); //CCORAPP_APP_VF_INIT_END + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_OVERLAY_INIT 0" ); //CCORAPP_APP_OVERLAY_INIT_END + + TInt orgPos = SetVfWindowOrdinal(); // Set visible + iCamera->StartViewFinderDirectL( + env->WsSession(), + *env->ScreenDevice(), + *iViewfinderWindow, + params().iRect ); + (void) SetVfWindowOrdinal( orgPos ); // back to original + + CCamAppUi* appUi = static_cast( env->AppUi() ); + if ( ECamActiveCameraSecondary == appUi->ActiveCamera() ) + { + iCamera->SetViewFinderMirrorL(ETrue); + } + // VF started succesfully, reset recovery counter + delete iIdle; + iIdle = NULL; + iIveRecoveryCount = KIveRecoveryCountMax; + break; + } + case CCamera::CCameraDirectViewFinder::EViewFinderPause: + { + iDirectViewfinder->ResumeViewFinderDirectL(); + break; + } + case CCamera::CCameraDirectViewFinder::EViewFinderActive: + { + // Already running. Not considered as error. + break; + } + default: + { + Panic( ECamCameraControllerUnsupported ); + break; + } + } + } +#else // CAMERAAPP_CAPI_V2_DVF + { + // No controller support for direct vf. + Panic( ECamCameraControllerUnsupported ); + } +#endif // CAMERAAPP_CAPI_V2_DVF + // ------------------------------- + else + { + PRINT( _L("Camera <> Get bitmap vf details..") ); + + TPckgBuf params; + iSettingProvider.ProvideCameraParamL( ECameraParamVfBitmap, ¶ms ); + iInfo.iViewfinderFormat = params().iFormat; + iInfo.iViewfinderSize = params().iRect.Size(); +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + { + PRINT( _L("Camera <> Call CCaeEngine::StartViewFinderBitmapsL..") ); + + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_VF_INIT 0" ); //CCORAPP_APP_VF_INIT_END + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_OVERLAY_INIT 0" ); //CCORAPP_APP_OVERLAY_INIT_END + iCaeEngine->StartViewFinderBitmapsL( iInfo.iViewfinderSize ); + } + else +#endif // CAMERAAPP_CAE_FIX + { + PRINT( _L("Camera <> Call CCamera::StartViewFinderBitmapsL..") ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP4_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_VF_INIT 0" ); //CCORAPP_APP_VF_INIT_END + OstTrace0( CAMERAAPP_PERFORMANCE, DUP5_CCAMCAMERACONTROLLER_PROCESSVFSTARTREQUESTL, "e_CAM_APP_OVERLAY_INIT 0" ); //CCORAPP_APP_OVERLAY_INIT_END + iCamera->StartViewFinderBitmapsL( iInfo.iViewfinderSize ); + + if ( params().iMirrorImage ) + { + iCamera->SetViewFinderMirrorL( params().iMirrorImage ); + } + } + } + // ------------------------------- + + iInfo.iVfState = ECamTriActive; + //view finder started now(set stop status as false) + appUi->SetViewFinderStoppedStatus( EFalse ); + break; + } + // ----------------------------------------------------- + case ECamTriActive: + { + PRINT( _L("Camera <> case ECamTriActive") ); + // Viewfinder started *and* the right mode + // no action needed. + break; + } + // ----------------------------------------------------- + default: + Panic( ECamCameraControllerCorrupt ); + break; + // ----------------------------------------------------- + } + } + PRINT( _L("Camera <= CCamCameraController::ProcessVfStartRequestL") ); + } + + + +// --------------------------------------------------------------------------- +// ProcessVfStopRequestL +// +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ProcessVfStopRequestL() + { + PRINT( _L("Camera => CCamCameraController::ProcessVfStopRequestL") ); + + switch( iInfo.iVfState ) + { + case ECamTriActive: + { + ProcessVfStopEcamRequest(); + iInfo.iVfState = ECamTriInactive; + break; + } + case ECamTriIdle: + { + // Viewfinder not initialized. + // Let this pass as our "start viewfinder" handles all states. + break; + } + case ECamTriInactive: + { + // Already stopped. No action needed. + break; + } + default: + { + Panic( ECamCameraControllerCorrupt ); + break; + } + } + PRINT( _L("Camera <= CCamCameraController::ProcessVfStopRequestL") ); + } + + +// --------------------------------------------------------------------------- +// ProcessVfStopEcamRequest +// +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ProcessVfStopEcamRequest() + { + PRINT( _L("Camera => CCamCameraController::ProcessVfStopEcamRequest") ); + + if( ECamViewfinderDirect == iInfo.iVfMode ) + { +#ifdef CAMERAAPP_CAPI_V2_DVF + if ( iCamera ) + { + PRINT( _L("Camera <> VF stop by CCamera") ); + iCamera->StopViewFinder(); + } +#else // CAMERAAPP_CAPI_V2_DVF + Panic( ECamCameraControllerUnsupported ); +#endif // CAMERAAPP_CAPI_V2_DVF + } + else + { +#ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse && iCaeEngine ) + { + PRINT( _L("Camera <> stop by CAE") ); + iCaeEngine->StopViewFinder(); + } + else +#endif // CAMERAAPP_CAE_FIX + { + if ( iCamera ) + { + PRINT( _L("Camera <> stop by CCamera") ); + iCamera->StopViewFinder(); + } + } + } + PRINT( _L("Camera <= CCamCameraController::ProcessVfStopEcamRequest") ); + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamCameraController +::ProcessVfRelaseRequest() + { + switch( iInfo.iVfState ) + { + // ----------------------------------------------------- + case ECamTriActive: + { + // Do the stopping first and continue then with release. + // Leaves only if iVfState is ECamVfIdle, which is not the case here. + TRAP_IGNORE( ProcessVfStopRequestL() ); + + // Need to notify here, because done as a part of other request. + NotifyObservers( KErrNone, + ECamCameraEventVfStop, + ECamCameraEventClassVfControl ); + // << fall through >> + } + // ----------------------------------------------------- + case ECamTriInactive: + { + if( ECamViewfinderDirect == iInfo.iVfMode ) + { +#ifdef CAMERAAPP_CAPI_V2_DVF + delete iDirectViewfinder; + iDirectViewfinder = NULL; +#endif + } + else + { + // No further actions needed for bitmap viewfinding. + } + // These may very well remain as they are. + // Atleast for the format there is no "zero" value available. + // iInfo.iViewfinderSize + // iInfo.iViewfinderFormat + iInfo.iVfState = ECamTriIdle; + iInfo.iVfMode = ECamViewfinderNone; + break; + } + // ----------------------------------------------------- + case ECamTriIdle: + // Already released. + break; + // ----------------------------------------------------- + default: + Panic( ECamCameraControllerCorrupt ); + break; + // ----------------------------------------------------- + } + } + + +// --------------------------------------------------------------------------- +// ProcessImageRequestL +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController +::ProcessImageRequestL( const TCamCameraRequestId& aRequestId ) + { + PRINT( _L("Camera => CCamCameraController::ProcessImageRequestL") ); + CheckFlagOnL( iInfo.iState, ECamPowerOn, KErrNotReady ); + + TInt callback( ETrue ); + switch( aRequestId ) + { + // ----------------------------------------------------- + case ECamRequestImageInit: + { + // When camera engine still capture don't Init a new capture + + if ( ECamCaptureOn == iInfo.iCaptureState ) + { + return EFalse; + } + CAMERAAPP_PERF_CONTROLLER_START( ECamRequestImageInit ); + +#ifdef CAMERAAPP_CAE_FOR_VIDEO + #ifdef CAMERAAPP_CAE_FIX + if( iCaeInUse ) + { + iModeChange = ECamModeChangeVideo2Image; + iModeChangePhase = ECamModeChangePhaseIdle; // incremented before first step + iModeChangeStatus = KErrNone; + iActive->IssueRequest(); + } + else + #else + if( IsFlagOn( iInfo.iState, ECamVideoOn ) ) + { + // Release any video recording resources + iCaeEngine->CloseVideoRecording(); + ClearFlags( iInfo.iState, ECamVideoOn ); + } + #endif // CAMERAAPP_CAE_FIX +#endif + { + PRINT( _L("Camera <> Checking that image capture not ongoing..") ); + CheckEqualsL( iInfo.iCaptureState, ECamCaptureOff, KErrInUse ); + + PRINT( _L("Camera <> Checking that image capture supported..") ); + CheckFlagOnL( iCameraInfo.iOptionsSupported, + TCameraInfo::EImageCaptureSupported, + KErrNotSupported ); + + PRINT( _L("Camera <> Ask image parameters..") ); + TPckgBuf params; + iSettingProvider.ProvideCameraParamL( ECameraParamImage, ¶ms ); + + PRINT( _L("Camera <> Enumerating capture sizes..") ); + // Query the supported resolutions for the selected format. + // GetResolutionIndexL may change the format to some alternative, + // if we are able to convert the incoming image later to the + // format requested by client. + CCamera::TFormat format( params().iFormat ); + TInt index = GetResolutionIndexL( format, params().iSize ); + User::LeaveIfError( index ); + + PRINT( _L("Camera <> Call CCamera::PrepareImageCaptureL..") ); + PRINT2( _L("Camera <> Image size: (%d, %d)"), + params().iSize.iWidth, + params().iSize.iHeight ); + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMCAMERACONTROLLER_PROCESSIMAGEREQUESTL, "e_CAM_APP_CONFIGURATIONS 0" ); //CCORAPP_APP_CONFIGS_END + iCamera->PrepareImageCaptureL( format, index ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMCAMERACONTROLLER_PROCESSIMAGEREQUESTL, "e_CAM_APP_STILL_INIT 0" ); //CCORAPP_APP_STILL_INIT_END + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMCAMERACONTROLLER_PROCESSIMAGEREQUESTL, "e_CAM_APP_OVERLAY_INIT 1" ); //CCORAPP_APP_OVERLAY_INIT_START + + iCamera->SetJpegQuality( params().iQualityFactor ); + + SetFlags( iInfo.iState, ECamImageOn ); + +#ifdef CAMERAAPP_CAPI_V2_ADV + // Set current autofocus range to invalid value to force focusing + iInfo.iCurrentFocusRange = static_cast( -1 ); + GetAdvancedSettingsInfoL(); +#endif // CAMERAAPP_CAPI_V2_ADV + + iInfo.iCaptureCount = 0; + iInfo.iSnapshotCount = 0; + callback = EFalse; // No callback to wait for. + CAMERAAPP_PERF_CONTROLLER_STOP( ECamRequestImageInit ); + } + break; + } + // ----------------------------------------------------- + case ECamRequestImageCapture: + { + CheckFlagOnL( iInfo.iState, ECamImageOn, KErrNotReady ); + CheckEqualsL( iInfo.iCaptureState, ECamCaptureOff, KErrInUse ); + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMCAMERACONTROLLER_PROCESSIMAGEREQUESTL, "e_CAM_APP_CAPTURE_START 0" ); //CCORAPP_CAPTURE_START_END + + // New capture starts, reset capture and snapshot counters. + iInfo.iCaptureCount = 0; + iInfo.iSnapshotCount = 0; + iInfo.iCaptureState = ECamCaptureOn; + + PRINT1( _L("Camera <> CCamCameraController .. About to start capture, total shared buffers in use: %d"), CCamBufferShare::TotalBufferShareCount() ); + iCamera->CaptureImage(); + + // When image data is received from CCamera, + // an event is generated for that. We need to notify + // here as other places check if the request has associated + // callback, and send no notification yet if callback exist. + NotifyObservers( KErrNone, + ECamCameraEventImageStart, + ECamCameraEventClassImage ); + break; + } + // ----------------------------------------------------- + default: + { + Panic( ECamCameraControllerCorrupt ); + break; + } + // ----------------------------------------------------- + } + PRINT1( _L("Camera <= CCamCameraController::ProcessImageRequestL, continue now:%d"), !callback ); + return !callback; + } + + +// --------------------------------------------------------------------------- +// ProcessImageShutdownRequest +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController +::ProcessImageShutdownRequest( const TCamCameraRequestId& aRequestId ) + { + PRINT( _L("Camera => CCamCameraController::ProcessImageShutdownRequest") ); + + switch( aRequestId ) + { + // ----------------------------------------------------- + case ECamRequestImageCancel: + { + if( IsFlagOn( iInfo.iState, ECamImageOn ) +// && ECamCaptureOn == iInfo.iCaptureState + ) + { + const TCamCameraCaptureState previousState( iInfo.iCaptureState ); + + if( iEncoder ) + { + iEncoder->Cancel(); + + delete iEncoder; + iEncoder = NULL; + } + + PRINT( _L("Camera <> Calling iCamera->CancelCaptureImage()") ); + iCamera->CancelCaptureImage(); + + iInfo.iCaptureState = ECamCaptureOff; + + // Notify if we actually stopped the capturing here. + if( ECamCaptureOn == previousState ) + { + + // Capturing image was stopped here. + // If single request was ongoing, it must be "capture image". + ClearFlags( iInfo.iBusy, ECamBusySingle ); + + TInt fullCaptures( Min( iInfo.iCaptureCount, iInfo.iSnapshotCount ) ); + NotifyObservers( KErrNone, + ECamCameraEventImageStop, + ECamCameraEventClassImage, + &fullCaptures ); + } + } + break; + } + // ----------------------------------------------------- + case ECamRequestImageRelease: + { + // Cancel any pending capture. + ProcessImageShutdownRequest( ECamRequestImageCancel ); + + // Nothing else really needed for image, just set flags. + ClearFlags( iInfo.iState, ECamImageOn ); + iInfo.iCaptureCount = 0; + iInfo.iSnapshotCount = 0; + iInfo.iCaptureState = ECamCaptureOff; + + break; + } + // ----------------------------------------------------- + default: + { + Panic( ECamCameraControllerCorrupt ); + break; + } + // ----------------------------------------------------- + } + PRINT( _L("Camera <= CCamCameraController::ProcessImageShutdownRequest") ); + return ETrue; // can continue sequence, if needed + } + + + +// --------------------------------------------------------------------------- +// ProcessVideoRequestL +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController +::ProcessVideoRequestL( const TCamCameraRequestId& aRequestId ) + { + PRINT( _L("Camera => CCamCameraController::ProcessVideoRequestL") ); + CheckFlagOnL( iInfo.iState, ECamPowerOn, KErrNotReady ); + + TInt callback( ETrue ); + +#ifdef CAMERAAPP_CAE_FOR_VIDEO + switch( aRequestId ) + { + // ----------------------------------------------------- + case ECamRequestVideoInit: + { + PRINT( _L("Camera <> case ECamRequestVideoInit") ); + #ifdef CAMERAAPP_CAE_FIX + PRINT( _L("Camera <> old CAE") ); + // First init for video after image mode or startup + if( !IsFlagOn( iInfo.iState, ECamVideoOn ) ) + { + iModeChange = ECamModeChangeImage2Video; + iModeChangePhase = ECamModeChangePhaseIdle; // incremented before first step + iModeChangeStatus = KErrNone; + iActive->IssueRequest(); + } + // Just repeat prepare + else + #else + PRINT( _L("Camera <> new CAE, CCameraHandle + SetCameraReserved supported") ); + if( !IsFlagOn( iInfo.iState, ECamVideoOn ) ) + { + PRINT( _L("Camera <> CCaeEngine::EnableVideoRecording..") ); + iCaeEngine->EnableVideoRecording(); + } + #endif + { + if ( iAppController.VideoInitNeeded() ) + { + PRINT( _L("Camera <> CCaeEngine::InitVideoRecorderL..") ); + iCaeEngine->InitVideoRecorderL(); + } + + PRINT( _L("Camera <> Ask filename..") ); + HBufC* filename( HBufC::NewLC( KMaxFileName ) ); + TPtr ptr ( filename->Des() ); + iSettingProvider.ProvideCameraSettingL( ECameraSettingFileName, &ptr ); + // _LIT( KTempFilename, "C:\\video.3gp" ); + // TPtrC ptr; + // ptr.Set( KTempFilename() ); + PRINT1( _L("Camera <> Set filename [%S]"), &ptr ); + iCaeEngine->SetVideoRecordingFileNameL( ptr ); + CleanupStack::PopAndDestroy( filename ); + + // Set max video clip size + ProcessSettingL( ECameraSettingFileMaxSize ); + + TPckgBuf params; + PRINT( _L("Camera <> Getting params from setting provider..") ); + iSettingProvider.ProvideCameraParamL( ECameraParamVideoCae, ¶ms ); + // The audioOn value is defined On==0 and Off==1, but the engine expects + // ETrue if audio recording is On + params().iAudioOn = ( ECamSettOn == params().iAudioOn ) + ? ETrue + : EFalse; + PRINT( _L("Camera <> Calling PrepareVideoRecordingL..") ); + PRINT2( _L("Camera <> FrameSize: (%d x %d)"), params().iFrameSize.iWidth, params().iFrameSize.iHeight ); + if ( iAppController.VideoInitNeeded() ) + { + // McaeoVideoPrepareComplete will be called when prepare is ready. + // The callback is allowed to come also *during* this call. + iCaeEngine->PrepareVideoRecordingL( params().iFrameSize, + params().iFrameRate, + params().iVideoBitRate, + params().iAudioOn, + params().iAudioBitRate, + params().iMimeType, + params().iSupplier, + params().iVideoType, + params().iAudioType ); + } + +#ifdef CAMERAAPP_CAPI_V2_ADV + // Set current autofocus range to invalid value to force focusing + iInfo.iCurrentFocusRange = static_cast( -1 ); +#endif // CAMERAAPP_CAPI_V2_ADV + + iAppController.SetVideoInitNeeded( EFalse ); + // iState is updated in the callback. + PRINT( _L("Camera <> ..waiting for callback") ); + } + break; + } + // ----------------------------------------------------- + case ECamRequestVideoStart: + { + PRINT( _L("Camera <> case ECamRequestVideoStart") ); + CheckFlagOnL( iInfo.iState, ECamVideoOn, KErrNotReady ); + switch( iInfo.iCaptureState ) + { + case ECamCaptureOn: User::Leave( KErrInUse ); break; + case ECamCaptureOff: iCaeEngine->StartVideoRecording(); break; + //case ECamCaptureOff: iCaeEngine->ResumeVideoRecording(); break; + case ECamCapturePaused: iCaeEngine->ResumeVideoRecording(); break; + default: + Panic( ECamCameraControllerCorrupt ); + break; + } + // iCaptureState is updated in McaeoVideoRecordingOn. + break; + } + // ----------------------------------------------------- + case ECamRequestVideoPause: + { + PRINT( _L("Camera <> case ECamRequestVideoPause") ); + CheckEqualsL( iInfo.iCaptureState, ECamCaptureOn, KErrNotReady ); + iCaeEngine->PauseVideoRecording(); + // iCaptureState is updated in McaeoVideoRecordingPaused. + break; + } + // ----------------------------------------------------- + case ECamRequestVideoStop: + { + PRINT( _L("Camera <> case ECamRequestVideoStop") ); + switch( iInfo.iCaptureState ) + { + case ECamCaptureOn: // << fall through >> + case ECamCapturePaused: + PRINT( _L("Camera <> call CCaeEngine::StopVideoRecording..") ); + iCaeEngine->StopVideoRecording(); + // If we got the callback during above call, + // we should not wait for it anymore. + // Check the capture state to be sure. + callback = (ECamCaptureOff != iInfo.iCaptureState); + break; + case ECamCaptureOff: + // no action, already stopped + break; + default: + Panic( ECamCameraControllerCorrupt ); + break; + } + // iCaptureState is updated in McaeoVideoRecordingComplete. + break; + } + // ----------------------------------------------------- + case ECamRequestVideoRelease: + { + // Need to be stopped. + CheckEqualsL( iInfo.iCaptureState, ECamCaptureOff, KErrInUse ); + + if( IsFlagOn( iInfo.iState, ECamVideoOn ) ) + iCaeEngine->CloseVideoRecording(); + + ClearFlags( iInfo.iState, ECamVideoOn ); + callback = EFalse; +#ifdef CAMERAAPP_CAPI_V2_ADV + GetAdvancedSettingsInfoL(); +#endif + break; + } + // ----------------------------------------------------- + case ECamRequestSetAsyncVideoStopMode: + { + TInt err = iCaeEngine->SetAsyncVideoStopMode( ETrue ); + PRINT1( _L("Camera <> CCamCameraController::ProcessVideoRequestL, engine SetAsyncVideoStopMode return code:%d"), err ); + iAsyncVideoStopModeSupported = !err; // Use async stop if KErrNone + callback = EFalse; + break; + } + // ----------------------------------------------------- + default: + Panic( ECamCameraControllerCorrupt ); + break; + // ----------------------------------------------------- + } +#else + #pragma message("CCamCameraController::ProcessVideoRequestL not implemented!") + PRINT( _L("Camera <> Not supported, PANIC!") ); + Panic( ECamCameraControllerUnsupported ); +#endif // CAMERAAPP_CAE_FOR_VIDEO + + PRINT1( _L("Camera <= CCamCameraController::ProcessVideoRequestL, continue now:%d"), !callback ); + return !callback; + } + + + +// --------------------------------------------------------------------------- +// ProcessSnapshotRequestL +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController +::ProcessSnapshotRequestL( const TCamCameraRequestId& aRequestId ) + { + PRINT( _L("Camera => CCamCameraController::ProcessSnapshotRequestL") ); + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMCAMERACONTROLLER_PROCESSSNAPSHOTREQUESTL, "e_CCamCameraController_ProcessSnapshotRequestL 1" ); + CheckFlagOnL( iInfo.iState, ECamReserved, KErrNotReady ); + + switch( aRequestId ) + { + // ----------------------------------------------------- + case ECamRequestSsStart: + { + PRINT( _L("Camera <> case ECamRequestSsStart") ); + switch( iInfo.iSsState ) + { + case ECamTriIdle: + PRINT( _L("Camera <> ECamTriIdle") ); + InitSnapshotL(); + // << fall through >> + case ECamTriInactive: + { + PRINT( _L("Camera <> ECamTriInactive") ); + iSnapshotProvider->StartSnapshot(); + break; + } + case ECamTriActive: // Already active, no action + PRINT( _L("Camera <> ECamTriActive") ); + break; + default: + Panic( ECamCameraControllerCorrupt ); + break; + } + iInfo.iSsState = ECamTriActive; + break; + } + // ----------------------------------------------------- + case ECamRequestSsStop: + { + PRINT( _L("Camera <> case ECamRequestSsStop") ); + ProcessSsStopRequest(); + break; + } + // ----------------------------------------------------- + case ECamRequestSsRelease: + { + PRINT( _L("Camera <> case ECamRequestSsRelease") ); + ProcessSsReleaseRequest(); + break; + } + // ----------------------------------------------------- + default: + Panic( ECamCameraControllerCorrupt ); + break; + // ----------------------------------------------------- + } + OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMCAMERACONTROLLER_PROCESSSNAPSHOTREQUESTL, "e_CCamCameraController_ProcessSnapshotRequestL 0" ); + + PRINT( _L("Camera <= CCamCameraController::ProcessSnapshotRequestL") ); + + // No callback to wait for any of the requests => can continue now. + return ETrue; + } + +// --------------------------------------------------------------------------- +// ProcessSsStopRequest +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ProcessSsStopRequest() + { + PRINT( _L("Camera <= CCamCameraController::ProcessSsStopRequest") ); + switch( iInfo.iSsState ) + { + case ECamTriIdle: // Not even initialized yet. No action needed. + case ECamTriInactive: // Already inactive, no action. + PRINT( _L("Camera <> Snapshot idle/inactive, no need to stop") ); + break; + case ECamTriActive: + PRINT( _L("Camera <> Snapshot ECamTriActive -> need to stop") ); + iSnapshotProvider->StopSnapshot(); + break; + default: + Panic( ECamCameraControllerCorrupt ); + break; + } + iInfo.iSsState = ECamTriInactive; + PRINT( _L("Camera <= CCamCameraController::ProcessSsStopRequest") ); + } + +// --------------------------------------------------------------------------- +// ProcessSsReleaseRequest +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ProcessSsReleaseRequest() + { + PRINT( _L("Camera => CCamCameraController::ProcessSsReleaseRequest") ); + switch( iInfo.iSsState ) + { + case ECamTriIdle: // No action needed + break; + case ECamTriActive: + iSnapshotProvider->StopSnapshot(); + NotifyObservers( KErrNone, + ECamCameraEventSsStop, + ECamCameraEventClassSsControl ); + // << fall through >> + case ECamTriInactive: + delete iSnapshotProvider; + iSnapshotProvider = NULL; + break; + default: + Panic( ECamCameraControllerCorrupt ); + break; + } + + iInfo.iSsState = ECamTriIdle; + PRINT( _L("Camera <= CCamCameraController::ProcessSsReleaseRequest") ); + } + +// --------------------------------------------------------------------------- +// InitSnapshotL +// --------------------------------------------------------------------------- +// +void +CCamCameraController::InitSnapshotL() + { + PRINT( _L("Camera => CCamCameraController::InitSnapshotL") ); + + // Check the snapshot state here. No further checks made. + __ASSERT_DEBUG( ECamTriIdle == iInfo.iSsState, Panic( ECamCameraControllerCorrupt ) ); + + // ------------------------------------------------------- + // Create snapshot provider if not available yet. + if( !iSnapshotProvider ) + { + iSnapshotProvider = CCamSnapshotProvider::NewL( *iCamera, *this, *this ); + } + +#ifdef _DEBUG + PrintSnapshotInfo(); +#endif // _DEBUG + + + // ------------------------------------------------------- + // Initialize the snapshot parameters + TPckgBuf params; + iSettingProvider.ProvideCameraParamL( ECameraParamSnapshot, ¶ms ); + + // Try to get the best, still supported, snapshot format. + iInfo.iSnapshotFormat = ResolveSnapshotFormatL( params().iFormat ); + iInfo.iSnapshotSize = params().iSize; + iInfo.iSnapshotAspectMaintain = params().iMaintainAspect; + + PRINT( _L("Camera <> Prepare snapshot..") ); + iSnapshotProvider->PrepareSnapshotL( iInfo.iSnapshotFormat, + iInfo.iSnapshotSize, + iInfo.iSnapshotAspectMaintain ); + + iInfo.iSsState = ECamTriInactive; + // ------------------------------------------------------- + PRINT( _L("Camera <= CCamCameraController::InitSnapshotL") ); + } + + +// --------------------------------------------------------------------------- +// CCamCameraController::ProcessAutofocusRequestL +// --------------------------------------------------------------------------- +// +void CCamCameraController::ProcessAutofocusRequestL( const TCamCameraRequestId& aRequestId ) + { + PRINT( _L("Camera => CCamCameraController::ProcessAutofocusRequestL") ); +#ifdef CAMERAAPP_CAPI_V2_ADV + CheckNonNullL( iAdvancedSettings, KErrNotReady ); + if( ECamRequestStartAutofocus == aRequestId ) + { + PRINT( _L("Camera <> SetAutoFocusType( EAutoFocusTypeSingle )") ); + iAdvancedSettings->SetAutoFocusType( CAS::EAutoFocusTypeSingle ); + iAfInProgress = ETrue; + iFirstAfEventReceived = EFalse; + } + else if( ECamRequestCancelAutofocus == aRequestId ) + { + if( iAfInProgress ) + { + // Autofocus in progress, need to cancel it before setting range to hyperfocal + PRINT( _L("Camera <> Cancel ongoing autofocus request") ); + iAdvancedSettings->SetAutoFocusType( CAS::EAutoFocusTypeOff ); + iAfHyperfocalPending = ETrue; + } + else + { + // If focustype is set to continuous, need to change it to off + // before continuing + + PRINT( _L("Camera <> SetAutoFocusType( EAutoFocusTypeOff )") ); + if ( iAdvancedSettings->AutoFocusType() & CAS::EAutoFocusTypeContinuous ) + { + iAdvancedSettings->SetAutoFocusType( CAS::EAutoFocusTypeOff ); + } + + PRINT( _L("Camera <> Cancel autofocus - set focus range to hyperfocal") ); + iInfo.iCurrentFocusRange = CAS::EFocusRangeHyperfocal; + iAdvancedSettings->SetFocusRange( CAS::EFocusRangeHyperfocal ); + + // Then start the focus. The callback of this cancel request sets + // a boolean in CamAppController, so the resulting optimal + // focus event does not change reticule/focus state. + iAdvancedSettings->SetAutoFocusType( CAS::EAutoFocusTypeSingle ); + iAfInProgress = ETrue; + } + } + else if( ECamRequestSetAfRange == aRequestId ) + { + PRINT( _L("Camera <> Set autofocus range") ); + // Get autofocus mode from settings provider + + CAS::TFocusRange afRange; + iSettingProvider.ProvideCameraSettingL( ECameraSettingFocusRange, &afRange ); + + if( iInfo.iCurrentFocusRange != afRange ) + { + iAdvancedSettings->SetFocusRange( afRange ); + + // Should this be done in the callback?: + iInfo.iCurrentFocusRange = afRange; + } + else + { + // Correct range already set. No need to do anything. + } + } + else + { + // Other request must not end up here + __ASSERT_DEBUG( EFalse, Panic( ECamCameraControllerCorrupt ) ); + } +#endif // CAMERAAPP_CAPI_V2_ADV + + (void)aRequestId; // removes compiler warning + PRINT( _L("Camera <= CCamCameraController::ProcessAutofocusRequestL") ); + } + + + +// --------------------------------------------------------------------------- +// ProcessCaptureLimitSettingL +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ProcessCaptureLimitSettingL() + { + PRINT ( _L("Camera => CCamCameraController::ProcessCaptureLimitSettingL") ); +#ifdef CAMERAAPP_CAPI_V2_ADV + // Check that we are prepared for image mode. + CheckFlagOnL( iInfo.iState, ECamImageOn, KErrNotReady ); + + // Get requested capture count and determine current and target drive modes. + TInt requestedLimit( 1 ); + iSettingProvider.ProvideCameraSettingL( ECameraSettingCaptureLimit, &requestedLimit ); + if( requestedLimit < 1 ) User::Leave( KErrArgument ); + + const CAS::TDriveMode& currentMode( iAdvancedSettings->DriveMode() ); + const CAS::TDriveMode targetMode ( requestedLimit <= 1 + ? CAS::EDriveModeSingleShot + : CAS::EDriveModeBurst ); + const TInt cameraLimit( iAdvancedSettings->BurstImages() ); + + PRINT ( _L("Camera <> CCamCameraController .. --------------------------------------") ); + PRINT1( _L("Camera <> CCamCameraController .. requested capture limit %04d"), requestedLimit ); + PRINT1( _L("Camera <> CCamCameraController .. current capture limit : %04d"), iInfo.iCaptureLimit ); + PRINT1( _L("Camera <> CCamCameraController .. current camera's limit : %04d"), cameraLimit ); + PRINT1( _L("Camera <> CCamCameraController .. current capture count : %04d"), iInfo.iCaptureCount ); + PRINT1( _L("Camera <> CCamCameraController .. current snapshot count : %04d"), iInfo.iSnapshotCount ); + PRINT1( _L("Camera <> CCamCameraController .. current drive mode : [%S]"), &DriveModeName( currentMode ) ); + PRINT1( _L("Camera <> CCamCameraController .. target drive mode : [%S]"), &DriveModeName( targetMode ) ); + PRINT ( _L("Camera <> CCamCameraController .. --------------------------------------") ); + + // ------------------------------------------------------- + // Determine needed changes and when to issue them + // + // During burst capture, we may receive snapshots and + // image data on mixed order, e.g: + // + // [ ss#1 | img#1 | ss#2 | ss#3 | img2 | img3 ] + // --------------^^--------------------------^^ + // + // C-API starts new burst capture when we adjust the + // capture limit. To avoid problems and to get equal + // amount of snapshots and images, capture count is + // only changed when we image data is received, + // and as many images as snapshots have arrived. + // In the chart above ^ marks a place where capture limit + // can be updated. + TBool callback( EFalse ); + + // ----------------------------------- + // Capture ongoing.. + if( ECamCaptureOn == iInfo.iCaptureState ) + { + PRINT( _L("Camera <> CCamCameraController .. Capture ongoing..") ); + if( targetMode != currentMode ) + { + // Cannot change drive mode during capturing. + PRINT( _L("Camera <> CCamCameraController .. Drive mode update not possible now, LEAVE!") ); + User::Leave( KErrInUse ); + } + else if ( CAS::EDriveModeBurst == currentMode ) + { + if( cameraLimit != requestedLimit ) + { + PRINT( _L("Camera <> CCamCameraController .. Adjusting capture limit during burst..") ); + // Set limit locally and react on next image data event. + iInfo.iCaptureLimit = Min( cameraLimit, Max( requestedLimit, iInfo.iCaptureCount+1 ) ); + PRINT1( _L("Camera <> CCamCameraController .. Set local capture limit to %d.."), iInfo.iCaptureLimit ); + } + else + { + PRINT( _L("Camera <> CCamCameraController .. Capture limit during burst already has right value.") ); + } + } + else + { + // No action needed. Capture limit of 1 image kept. + PRINT( _L("Camera <> CCamCameraController .. Single shot mode kept, no action") ); + } + } + // ----------------------------------- + // Not capturing + // + else + { + PRINT( _L("Camera <> CCamCameraController .. No capture ongoing..") ); + + iInfo.iCaptureLimit = requestedLimit; + // Capture limit has changed, + // check if drive mode also needs to be changed.. + if( targetMode != currentMode ) + { + PRINT1( _L("Camera <> CCamCameraController .. Calling SetDriveMode([%S])"), &DriveModeName( targetMode ) ); + iAdvancedSettings->SetDriveMode( targetMode ); + } + if( CAS::EDriveModeBurst == targetMode ) + { + PRINT1( _L("Camera <> CCamCameraController .. Calling SetBurstImages(%d).."), iInfo.iCaptureLimit ); + iAdvancedSettings->SetBurstImages( iInfo.iCaptureLimit ); + } + } + + // ------------------------------------------------------- + // Notify user that the change is done + // or wait for camera callbacks to finish. + PRINT1( _L("Camera <> CCamCameraController .. Should wait callback = %d"), callback ); + if( !callback ) + { + TInt setting( ECameraSettingCaptureLimit ); + NotifyObservers( KErrNone, + ECamCameraEventSettingsSingle, + ECamCameraEventClassSettings, + &setting ); + } +#else + User::Leave( KErrNotSupported ); +#endif // CAMERAAPP_CAPI_V2_ADV + PRINT ( _L("Camera <= CCamCameraController::ProcessCaptureLimitSettingL") ); + } + + + +// --------------------------------------------------------------------------- +// EndSequence +// --------------------------------------------------------------------------- +// +void +CCamCameraController::EndSequence( TInt aStatus ) + { + PRINT1( _L("Camera => CCamCameraController::EndSequence, status:%d"), aStatus ); + + iIveRecoveryOngoing = EFalse; +#ifdef CAMERAAPP_CAE_FIX + if( ECamModeChangeInactive != iModeChange ) + { + PRINT( _L("Camera <> mode change not cleared, PANIC!!") ); + Panic( ECamCameraControllerUnrecovableError ); + } +#endif // CAMERAAPP_CAE_FIX + // ------------------------------------------------------- + if( IsFlagOn( iInfo.iBusy, ECamBusySequence ) ) + { + CAMERAAPP_PERF_CONTROLLER_STOP( ECamRequestNone ); + + PRINT( _L("Camera <> ending sequence..") ); + ClearRequestQueue(); + iReserveTryAgainCount = KCamReserveTryAgainMaxCount; + + + // Need to first clear busy flag as observer might issue + // new requests in notification callback. + ClearFlags( iInfo.iBusy, ECamBusySequence ); + + PRINT( _L("Camera <> send notification..") ); + NotifyObservers( aStatus, + ECamCameraEventSequenceEnd, + ECamCameraEventClassBasicControl ); + } + // ------------------------------------------------------- + else if( IsFlagOn( iInfo.iBusy, ECamBusySetting ) ) + { + PRINT( _L("Camera <> ending settings handling..") ); + + + TCamCameraSettingId last( ECameraSettingNone ); + if( KErrNone != aStatus ) + { + if( Rng( 0, iSettingIndex, iSettingArray.Count()-1 ) ) + { + last = iSettingArray[iSettingIndex]; + } + } + ClearSettingQueue(); + + ClearFlags( iInfo.iBusy, ECamBusySetting ); + + NotifyObservers( aStatus, + ECamCameraEventSettingsDone, + ECamCameraEventClassSettings, + &last ); + } + // ------------------------------------------------------- + else + { + PRINT( _L("Camera <> No active operation, no action needed") ); + } + // ------------------------------------------------------- + PRINT( _L("Camera <= CCamCameraController::EndSequence") ); + } + + + +// --------------------------------------------------------------------------- +// ClearRequestQueue +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ClearRequestQueue() + { + iSequenceArray.Reset(); + iSequenceIndex = -1; + } + +// --------------------------------------------------------------------------- +// ClearSettingQueue +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ClearSettingQueue() + { + iSettingArray.Reset(); + iSettingIndex = -1; + } + + + + +// --------------------------------------------------------------------------- +// HandlePowerOnEvent +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandlePowerOnEvent( TInt aStatus ) + { + PRINT1( _L("Camera => CCamCameraController::HandlePowerOnEvent, status:%d"), aStatus ); + + // We should be blocking new request at the moment. + __ASSERT_DEBUG( iInfo.iBusy, Panic( ECamCameraControllerCorrupt ) ); + CAMERAAPP_PERF_CONTROLLER_STOP( ECamRequestPowerOn ); + + OstTrace0( CAMERAAPP_PERFORMANCE, CCAMCAMERACONTROLLER_HANDLEPOWERONEVENT, "e_CAM_APP_INIT 0" ); //CCORAPP_APP_INIT_END + OstTrace0( CAMERAAPP_PERFORMANCE, DUP1_CCAMCAMERACONTROLLER_HANDLEPOWERONEVENT, "e_CAM_APP_VF_INIT 1" ); //CCORAPP_APP_VF_INIT_START + OstTrace0( CAMERAAPP_PERFORMANCE, DUP2_CCAMCAMERACONTROLLER_HANDLEPOWERONEVENT, "e_CAM_APP_CONFIGURATIONS 1" ); //CCORAPP_APP_CONFIGS_START + OstTrace0( CAMERAAPP_PERFORMANCE, DUP3_CCAMCAMERACONTROLLER_HANDLEPOWERONEVENT, "e_CAM_APP_STILL_INIT 1" ); //CCORAPP_APP_STILL_INIT_START + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + + if ( appUi->AppController().UiConfigManagerPtr()->IsFaceTrackingSupported() ) + { + PRINT( _L("Camera <> CCamAppController: Get i/f MCameraFaceTracking..") ) + iCustomInterfaceFaceTracking = + static_cast ( + iCamera->CustomInterface( KCameraFaceTrackingUid ) ); + PRINT1( _L("Camera <> Face Tracking custom i/f pointer:%d"), iCustomInterfaceFaceTracking ); + } + + if( KErrNone == aStatus ) + { + SetFlags( iInfo.iState, ECamPowerOn|ECamReserved ); + + TRAP_IGNORE( SetFaceTrackingL() ); +#if defined( CAMERAAPP_CAE_FOR_VIDEO ) && !defined( CAMERAAPP_CAE_FIX ) + // We need to tell to CCaeEngine that the CCamera has been reserved + // and powered on "behind its back". + if( iCaeEngine ) + { + iCaeEngine->EnableVideoRecording(); + } +#endif + } + else + { + ClearFlags( iInfo.iState, ECamPowerOn ); + } + +#ifdef CAMERAAPP_CAE_FIX + if( ECamModeChangeVideo2Image == iModeChange ) + { + if( ECamModeChangePhase2 == iModeChangePhase ) + { + // We have called CCamera::PowerOn in phase2 + PRINT( _L("Camera <> mode change image->video ongoing, continue") ); + iModeChangeStatus = aStatus; + // Handle repeative events before iActive gets to run. + if( !iActive->IsActive() ) + iActive->IssueRequest(); + } + } + else if( ECamModeChangeImage2Video == iModeChange ) + { + if( ECamModeChangePhase1 == iModeChangePhase ) + { + // We have called CCaeEngine::InitL in phase1 + PRINT( _L("Camera <> mode change image->video ongoing, continue") ); + iModeChangeStatus = aStatus; + // Handle repeative events before iActive gets to run. + if( !iActive->IsActive() ) + iActive->IssueRequest(); + } + } + else + { + PRINT( _L("Camera <> no mode change ongoing") ); + HandleCallbackEvent( aStatus, + ECamCameraEventPowerOn, + ECamCameraEventClassBasicControl ); + } +#else + + HandleCallbackEvent( aStatus, + ECamCameraEventPowerOn, + ECamCameraEventClassBasicControl ); + +#endif // CAMERAAPP_CAE_FIX + + if ( appUi->AppController().UiConfigManagerPtr()->IsOrientationSensorSupported() ) + { + PRINT( _L("Camera <> CCamCameraController: Get i/f MCameraOrientation..") ) + + if(!iCustomInterfaceOrientation ) + { + iCustomInterfaceOrientation = + static_cast ( + iCamera->CustomInterface( KCameraOrientationUid ) ); + } + + PRINT1( _L("Camera <> Orientation custom i/f pointer:%d"), iCustomInterfaceOrientation ); + } + + PRINT( _L("Camera <= CCamCameraController::HandlePowerOnEvent") ); + } + +// --------------------------------------------------------------------------- +// HandleReserveGainEvent +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandleReserveGainEvent( TInt aStatus ) + { + PRINT1( _L("Camera => CCamCameraController::HandleReserveGainEvent, status:%d"), aStatus ); + if( iIdle && iIdle->IsActive() ) + { + PRINT( _L("Camera => CCamCameraController::HandleReserveGainEvent - return, recovery in progress")); + return; + } + // We should be blocking new request at the moment. + __ASSERT_DEBUG( iInfo.iBusy, Panic( ECamCameraControllerCorrupt ) ); + CAMERAAPP_PERF_CONTROLLER_STOP( ECamRequestReserve ); + + if( KErrNone == aStatus ) SetFlags ( iInfo.iState, ECamReserved ); + else ClearFlags( iInfo.iState, ECamReserved ); + +#ifdef CAMERAAPP_CAE_FIX + if( ECamModeChangeVideo2Image == iModeChange ) + { + if( ECamModeChangePhase1 == iModeChangePhase ) + { + // We have called CCamera::Reserve in phase1 + PRINT( _L("Camera <> mode change video->image ongoing, continue") ); + iModeChangeStatus = aStatus; + // Handle repeative events before iActive gets to run. + if( !iActive->IsActive() ) + iActive->IssueRequest(); + } + } + else if( ECamModeChangeImage2Video == iModeChange ) + { + // No action yet, wait for power on event + PRINT( _L("Camera <> mode change image->video ongoing, waiting for power on event") ); + } + else + { + PRINT( _L("Camera <> no mode change ongoing") ); + HandleCallbackEvent( aStatus, + ECamCameraEventReserveGain, + ECamCameraEventClassBasicControl ); + } +#else + HandleCallbackEvent( aStatus, + ECamCameraEventReserveGain, + ECamCameraEventClassBasicControl ); +#endif // CAMERAAPP_CAE_FIX + PRINT( _L("Camera <= CCamCameraController::HandleReserveGainEvent") ); + } + + + +// --------------------------------------------------------------------------- +// HandleReserveLostEvent +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandleReserveLostEvent( TInt aStatus ) + { + PRINT1( _L("Camera => CCamCameraController::HandleReserveLostEvent, status:%d"), aStatus ); + iInfo.iState = ECamIdle; + iInfo.iVfState = ECamTriIdle; + iInfo.iSsState = ECamTriIdle; + +#pragma message("CCamCameraController: Reserve lost event does not stop sequence") + + // These are not valid anymore. + ReleaseCustomInterfaces(); + +#ifdef CAMERAAPP_CAE_FOR_VIDEO + // ------------------------------------------------------- +#ifdef CAMERAAPP_CAE_FIX +#ifdef CAMERAAPP_CAPI_V2 + if( ECamModeChangeVideo2Image == iModeChange ) + { + // ignore + } + else if( ECamModeChangeImage2Video == iModeChange ) + { + // ignore + } + else +#endif // CAMERAAPP_CAPI_V2 + { + PRINT( _L("Camera <> no mode change ongoing") ); + NotifyObservers( aStatus, + ECamCameraEventReserveLose, + ECamCameraEventClassBasicControl ); + } + +#else // CAMERAAPP_CAE_FIX +/* + // We need to tell to CCaeEngine that the CCamera + // has been released "behind its back". + if( iCaeEngine ) + { + iCaeEngine->DisableVideoRecording(); + } +*/ +#endif // CAMERAAPP_CAE_FIX + // ------------------------------------------------------- +#else + + NotifyObservers( aStatus, + ECamCameraEventReserveLose, + ECamCameraEventClassBasicControl ); + // ------------------------------------------------------- +#endif // CAMERAAPP_CAE_FOR_VIDEO + + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + TInt err = KErrNone; + if( !iIdle ) + { + TRAP( err, iIdle = CIdle::NewL( CActive::EPriorityIdle ) ); + } + + PRINT1( _L("Camera <> CCamCameraController::HandleReserveLostEvent iIveRecoveryOngoing = %d"), iIveRecoveryOngoing ); + if ( !err && iIdle && !iIdle->IsActive() && // Recovering already + iAppController.IsAppUiAvailable() && // Exit mode + iIveRecoveryCount && // Give up eventually + !appUi->AppInBackground( EFalse ) && // Only if on the foreground + ( !iReleasedByUi || // Try recover if unknown reason + appUi->StandbyStatus() ) && // or known error + !iAppController.InVideocallOrRinging() && // Video telephony parallel use case + !iIveRecoveryOngoing // processing recovery sequence + ) + { + PRINT( _L("Camera <> CCamCameraController::HandleReserveLostEvent - Start recovery") ); + NotifyObservers( aStatus, + ECamCameraEventReserveLose, + ECamCameraEventClassBasicControl ); + iIdle->Start( TCallBack( IdleCallback, this ) ); + } + PRINT( _L("Camera <= CCamCameraController::HandleReserveLostEvent") ); + } + +// --------------------------------------------------------------------------- +// HandleViewfinderEvent +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandleViewfinderEvent( MCameraBuffer* aCameraBuffer, + TInt aStatus ) + { + PRINT_FRQ1( _L("Camera => CCamCameraController::HandleViewfinderEvent, status in:%d"), aStatus ); + + CAMERAAPP_PERF_CONTROLLER_STOP_ONCE( ECamRequestVfStart, iFirstVfFrameReceived ); + + CFbsBitmap* vfFrame = NULL; + + if( KErrNone == aStatus ) + { + __ASSERT_ALWAYS( aCameraBuffer, Panic( ECamCameraControllerCorrupt ) ); + + PRINT_FRQ( _L("Camera <> get new one..") ); + TRAP( aStatus, + { + vfFrame = &(aCameraBuffer->BitmapL( 0 )); + }); + PRINT_FRQ1( _L("Camera <> ..status after getting bitmap data: %d"), aStatus ); + } + + NotifyObservers( aStatus, + ECamCameraEventVfFrameReady, + ECamCameraEventClassVfData, + vfFrame ); + + ReleaseAndNull( aCameraBuffer ); + + PRINT_FRQ( _L("Camera <= CCamCameraController::HandleViewfinderEvent") ); + } + + +// --------------------------------------------------------------------------- +// HandleImageCaptureEvent +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandleImageCaptureEvent( MCameraBuffer* aCameraBuffer, + TInt aStatus ) + { + PRINT1( _L("Camera => CCamCameraController::HandleImageCaptureEvent, status in: %d"), aStatus ); + + + // Check that we are expecting images.. + if( ECamCaptureOn == iInfo.iCaptureState ) + { + // Store flags + TUint busyFlags( iInfo.iBusy ); + + // ----------------------------------------------------- + // Try to get the image data. + if( KErrNone == aStatus ) + { + // Takes ownership of aCameraBuffer and NULLs the pointer. + TRAP( aStatus, HandleImageCaptureEventL( aCameraBuffer ) ); + PRINT1( _L("Camera <> status after handling data: %d"), aStatus ); + } + + // Release if not NULLed in HandleImageCaptureEventL. + ReleaseAndNull( aCameraBuffer ); + + // ----------------------------------------------------- + // Errors in or in handling + if( KErrNone != aStatus ) + { + PRINT( _L("Camera <> CCamCameraController ... [WARNING] error in image data event!") ); + iInfo.PrintInfo(); + + iInfo.iCaptureState = ECamCaptureOff; + + // See HandleCallbackEvent for comments. + // ClearFlags( iInfo.iBusy, ECamBusySingle ); + + NotifyObservers( aStatus, + ECamCameraEventImageData, + ECamCameraEventClassImage ); + } + // ----------------------------------------------------- + + // If capture state was just changed to OFF, + // send notification that capture has fully completed. + if( ECamCaptureOff == iInfo.iCaptureState ) + { + // See HandleCallbackEvent for comments. + ClearFlags( iInfo.iBusy, ECamBusySingle ); + + TInt fullCaptures( Min( iInfo.iCaptureCount, iInfo.iSnapshotCount ) ); + NotifyObservers( aStatus, + ECamCameraEventImageStop, + ECamCameraEventClassImage, + &fullCaptures ); + + // Now we can actually continue, if necessary. + if( IsFlagOn( busyFlags, ECamBusySequence ) ) + { + __ASSERT_DEBUG( iActive, Panic( ECamCameraControllerCorrupt ) ); + iActive->IssueRequest(); + } + } + } + else + { + PRINT( _L("Camera <> CCamCameraController ... [WARNING] Unexpected image data event!") ); + iInfo.PrintInfo(); + + // Stop capture to be safe. + PRINT( _L("Camera <> CCamCameraController ... Calling CancelCaptureImage..") ); + iCamera->CancelCaptureImage(); + + // Not expecting image data at this time. + // Release the buffer and ignore event. + ReleaseAndNull( aCameraBuffer ); + } + PRINT( _L("Camera <= CCamCameraController::HandleImageCaptureEvent") ); + } + +// --------------------------------------------------------------------------- +// HandleImageCaptureEventL +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandleImageCaptureEventL( MCameraBuffer*& aCameraBuffer ) + { + PRINT( _L("Camera => CCamCameraController::HandleImageCaptureEventL") ); + CheckNonNullL( aCameraBuffer, KErrNotFound ); + + MCameraBuffer* temp = aCameraBuffer; + aCameraBuffer = NULL; // ownership taken + + PRINT( _L("Camera <> Wrap MCameraBuffer to sharable..") ); + CleanupStack::PushL( TCleanupItem( CameraBufferCleanup, temp ) ); + CCamBufferShare* share = new (ELeave) CCamBufferShare( temp ); + CleanupStack::Pop(); // cleanup item + temp = NULL; // ownership to share + + share->Reserve(); + CleanupStack::PushL( TCleanupItem( CamBufferShareCleanup, share ) ); + + PRINT( _L("Camera <> CCamCameraController .. Checking encoded data availability..") ); + TRAPD( dataStatus, + { + TDesC8* data = share->SharedBuffer()->DataL( 0 ); + if( !data ) + User::Leave( KErrNotFound ); + }); + + // ------------------------------------------------------- + // Normal capture format case + if( KErrNone == dataStatus ) + { + PRINT( _L("Camera <> CCamCameraController .. Normal, encoded capture format found..") ); + + // Increase received images count. Needed in burst drive mode. + iInfo.iCaptureCount++; + PRINT1( _L("Camera <> CCamCameraController ... Incremented capture counter to: %d"), iInfo.iCaptureCount ); + + // If we have needed amount of snapshots and images, end capture. + if( iInfo.iCaptureCount >= iInfo.iCaptureLimit + && ( (iInfo.iSnapshotCount >= iInfo.iCaptureLimit) || iInfo.iSsState != ECamTriActive ) ) + { + PRINT( _L("Camera <> CCamCameraController ... Capture limit met, calling CancelCaptureImage..") ); + iCamera->CancelCaptureImage(); + + PRINT( _L("Camera <> CCamCameraController ... Setting capture state to OFF..") ); + iInfo.iCaptureState = ECamCaptureOff; + } +#ifdef CAMERAAPP_CAPI_V2_ADV + // If we are in burst mode and need to increase capture limit, + // do it now. If we have just decreased the capture limit, + // we just cancel once the limit is met. + else if( iAdvancedSettings + && iAdvancedSettings->DriveMode() == CAS::EDriveModeBurst ) + { + const TInt cameraLimit( iAdvancedSettings->BurstImages() ); + + PRINT1( _L("Camera <> CCamCameraController ... Camera capture limit: %d"), cameraLimit ); + PRINT1( _L("Camera <> CCamCameraController ... Local capture limit: %d"), iInfo.iCaptureLimit ); + + if( cameraLimit < iInfo.iCaptureLimit ) + { + TInt startedCaptures = Max( iInfo.iSnapshotCount, iInfo.iCaptureCount ); + iInfo.iCaptureLimit = Max( iInfo.iCaptureLimit, startedCaptures+1 ); + + PRINT1( _L("Camera <> CCamCameraController ... Pending capture limit increase, calling SetBurstImages(%d).."), iInfo.iCaptureLimit ); + iAdvancedSettings->SetBurstImages( iInfo.iCaptureLimit ); + } + } +#endif // CAMERAAPP_CAPI_V2_ADV + // Normal, single capture. + else + { + } + + // See HandleCallbackEvent for comments. + // ClearFlags( iInfo.iBusy, ECamBusySingle ); + + NotifyObservers( KErrNone, + ECamCameraEventImageData, + ECamCameraEventClassImage, + share ); + } + // ------------------------------------------------------- + // Bitmap format case. Need to encode first. + else if( iAlternateFormatInUse ) + { + PRINT( _L("Camera <> Bitmap alternative capture format in use..") ); + // NOTE: We get another callback with encoded image data + // once encoder has done the conversion. + PRINT( _L("Camera <> CCamCameraController ... Starting jpeg encoding..") ); + if( !iEncoder ) iEncoder = CCamImageEncoder::NewL( *this ); + + // Encoder needs to call Reserve + iEncoder->StartConversionL( share ); + } + // ------------------------------------------------------- + // Encoded data missing although expected. + else + { + User::Leave( dataStatus ); + } + // ----------------------------------------------------- + CleanupStack::PopAndDestroy(); // share->Release(); + share = NULL; + + PRINT( _L("Camera <= CCamCameraController::HandleImageCaptureEventL") ); + } + + +// --------------------------------------------------------------------------- +// HandleSnapshotEvent +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandleSnapshotEvent( TInt aStatus ) + { + PRINT( _L("Camera => CCamCameraController::HandleSnapshotEvent") ); + + // Check that we are in right state to handle snapshot. + // CCameraSnapshot sends atleast event with KErrCancel status + // when releasing the camera. + TBool videoSsExpected( IsFlagOn( iInfo.iState, ECamVideoOn ) ); + TBool imageSsExpected( IsFlagOn( iInfo.iState, ECamImageOn ) + && ECamCaptureOn == iInfo.iCaptureState + && iInfo.iSnapshotCount < iInfo.iCaptureLimit ); + + if( +#ifdef CAMERAAPP_CAE_FIX + ECamModeChangeInactive == iModeChange && +#endif + (videoSsExpected||imageSsExpected) + ) + { + CAMERAAPP_PERF_CONTROLLER_STOP( ECamRequestSsStart ); + + // ----------------------------------------------------- + // Try to get snapshot data + if( KErrNone == aStatus ) + { + TRAP( aStatus, HandleSnapshotEventL() ); + PRINT1( _L("Camera <> CCamCameraController ... status after handling snapshot data: %d"), aStatus ); + } + + // ----------------------------------------------------- + // If snapshot was received and notified ok, + // check if capture ended. + if( KErrNone == aStatus ) + { + // If we have needed amount of snapshots and images, end capture. + if( iInfo.iCaptureCount >= iInfo.iCaptureLimit + && iInfo.iSnapshotCount >= iInfo.iCaptureLimit ) + { + PRINT( _L("Camera <> CCamCameraController ... Setting capture state to OFF..") ); + iInfo.iCaptureState = ECamCaptureOff; + } + } + // ----------------------------------------------------- + // If any error, stop capture. + else + { + PRINT( _L("Camera <> CCamCameraController ... error encountered, notify and set capture state off..") ); + NotifyObservers( aStatus, + ECamCameraEventSsReady, + ECamCameraEventClassSsData ); + iInfo.iCaptureState = ECamCaptureOff; + } + + // ----------------------------------------------------- + // Check if we have just completed the capture. + // Notify observers if so. + if( imageSsExpected + && ECamCaptureOff == iInfo.iCaptureState ) + { + // See HandleCallbackEvent for comments. + ClearFlags( iInfo.iBusy, ECamBusySingle ); + + TInt fullCaptures( Min( iInfo.iCaptureCount, iInfo.iSnapshotCount ) ); + NotifyObservers( aStatus, + ECamCameraEventImageStop, + ECamCameraEventClassImage, + &fullCaptures ); + } + // ----------------------------------------------------- + } + else + { + // Just retrieve and release camera buffer if snapshot is not expected + TRAP_IGNORE( HandleSnapshotEventL( ETrue ) ); + + if( iInfo.iSnapshotCount > iInfo.iCaptureLimit ) + { + // For burst stopping: + // We have more snapshots already than requested.. + // All needed captures have to have started, + // so we can call cancel here. + // Note: + // Cannot use ">=" as last image might not be provided then. + // + PRINT( _L("Camera <> CCamCameraController ... Snapshot limit passed, calling CancelCaptureImage..") ); + iCamera->CancelCaptureImage(); + } + + PRINT( _L("Camera <> CCamCameraController ... [WARNING] Snapshot ignored!") ); + iInfo.PrintInfo(); + } + + PRINT( _L("Camera <= CCamCameraController::HandleSnapshotEvent") ); + } + + +// --------------------------------------------------------------------------- +// HandleSnapshotEventL +// +// Helper method for leaving part of HandleSnapshotEvent. +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandleSnapshotEventL( TBool aIgnore ) + { + PRINT1( _L("Camera => CCamCameraController::HandleSnapshotEventL ignore %d"),aIgnore); + __ASSERT_DEBUG( iSnapshotProvider, Panic( ECamCameraControllerCorrupt ) ); + RArray temp; + CleanupClosePushL( temp ); + MCameraBuffer* buffer( NULL ); + + buffer = &iSnapshotProvider->SnapshotDataL( temp ); + + TInt firstImageIndex = temp.Find( 0 ); + CleanupStack::PopAndDestroy(); // temp.Close() + + if( !aIgnore ) + { + + CleanupStack::PushL( TCleanupItem( CameraBufferCleanup, buffer ) ); + CFbsBitmap& snapshot = buffer->BitmapL( firstImageIndex ); + PRINT2( _L("Camera <> CCamCameraController ... snapshot size: (%dx%d)"), + snapshot.SizeInPixels().iWidth, snapshot.SizeInPixels().iHeight ); + + // Increase received snapshots count. + // Needed in burst drive mode. + iInfo.iSnapshotCount++; + PRINT1( _L("Camera <> CCamCameraController ... Incremented snapshot counter to: %d"), iInfo.iSnapshotCount ); + + // No leaving code after notification as otherwise + // HandleSnapshotEvent calling this method will notify clients again. + NotifyObservers( KErrNone, + ECamCameraEventSsReady, + ECamCameraEventClassSsData, + &snapshot ); + + CleanupStack::PopAndDestroy(); // buffer->Release() + } + else + { + ReleaseAndNull(buffer); + } + PRINT( _L("Camera <= CCamCameraController::HandleSnapshotEventL")); + } + + + + +// --------------------------------------------------------------------------- +// HandleVideoInitEvent +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandleVideoEvent( const TCamCameraEventId& aEventId, + TInt aStatus ) + { + PRINT2( _L("Camera => CCamCameraController::HandleVideoEvent, status:%d, event[%s]"), + aStatus, + KCamCameraEventNames[aEventId] ); + + // Only video stop of these events may come without our explicit request. +/* + if( ECamCameraEventVideoStop != aEventId ) + { + if( ECamBusyOff != iInfo.iBusy ) + Panic( ECamCameraControllerCorrupt ); + } +*/ + + switch( aEventId ) + { + // ----------------------------------------------------- + case ECamCameraEventVideoInit: + // Some settings repeat this event if CCaeEngine in use. + if( !IsFlagOn( iInfo.iBusy, ECamBusySetting ) ) + { + CAMERAAPP_PERF_CONTROLLER_STOP( ECamRequestVideoInit ); + if( KErrNone == aStatus ) SetFlags ( iInfo.iState, ECamVideoOn ); + else ClearFlags( iInfo.iState, ECamVideoOn ); + } +#ifdef CAMERAAPP_CAPI_V2_ADV + TRAP_IGNORE( GetAdvancedSettingsInfoL() ); +#endif +#ifdef CAMERAAPP_CAE_FIX + if( ECamModeChangeImage2Video == iModeChange ) + { + iModeChangeStatus = aStatus; + iActive->IssueRequest(); + return; + } +#endif // CAMERAAPP_CAE_FIX + break; + // ----------------------------------------------------- + case ECamCameraEventVideoStart: + if( KErrNone == aStatus ) + { + iInfo.iCaptureState = ECamCaptureOn; + } + break; + // ----------------------------------------------------- + case ECamCameraEventVideoPause: + if( KErrNone == aStatus ) + { + iInfo.iCaptureState = ECamCapturePaused; + } + else + { + // Problem with pausing. + // Keep our capture state unchanged. + } + break; + // ----------------------------------------------------- + case ECamCameraEventVideoStop: + // Even if error we have done what we can for stopping. + // Update internal capture state anyway. + iInfo.iCaptureState = ECamCaptureOff; + // We may receive this event from CCaeEngine, even though we have not + // issued a request to stop the video recording. If e.g. there is not + // enough space in the disk to continue recording, this event is + // generated without explicit request. + // + // We must not continue any pending operations if this event is not + // a response to our stop request. + // HandleCallbackEvent takes care of that. + break; + // ----------------------------------------------------- + case ECamCameraEventVideoAsyncStop: + PRINT( _L("Camera <> CCamCameraController::HandleVideoEvent case ECamCameraEventVideoAsyncStop") ); + // Do not change state, just play sound later + break; + // ----------------------------------------------------- + default: + { + Panic( ECamCameraControllerCorrupt ); + break; + } + // ----------------------------------------------------- + } + + HandleCallbackEvent( aStatus, + aEventId, + ECamCameraEventClassVideo ); + PRINT( _L("Camera <= CCamCameraController::HandleVideoEvent") ); + } + + +#ifdef CAMERAAPP_CAE_FOR_VIDEO +// --------------------------------------------------------------------------- +// HandleVideoTimeEvent +// --------------------------------------------------------------------------- +// +void +CCamCameraController +::HandleVideoTimeEvent( TInt aStatus, + TTimeIntervalMicroSeconds aTimeElapsed, + TTimeIntervalMicroSeconds aTimeRemaining ) + { + // If capture has already stopped, we don't echo this to our observers. + if( ECamCaptureOff != iInfo.iCaptureState ) + { + iVideoTimes.iTimeElapsed = aTimeElapsed.Int64(); + iVideoTimes.iTimeRemaining = aTimeRemaining.Int64(); + + NotifyObservers( aStatus, + ECamCameraEventVideoTimes, + ECamCameraEventClassVideoTimes, + &iVideoTimes ); + } + } +#endif + +// --------------------------------------------------------------------------- +// HandleAutoFocusEvent +// +// --------------------------------------------------------------------------- +// +void +CCamCameraController::HandleAutoFocusEvent( TInt aStatus, const TUid& aEventUid ) + { + PRINT1( _L("Camera => CCamCameraController::HandleAutoFocusEvent, status: %d"), aStatus ); + TBool proceed = EFalse; + + // ------------------------------------------------------- + // Check the event + if( KUidECamEventCameraSettingsOptimalFocus == aEventUid ) + { + PRINT( _L("Camera <> CCamCameraController: event KUidECamEventCameraSettingsOptimalFocus") ); + if( !iAfHyperfocalPending ) + { + proceed = ETrue; + iAfInProgress = EFalse; + iFirstAfEventReceived = EFalse; + } + } + else if( KUidECamEventCameraSettingAutoFocusType2 == aEventUid ) + { + PRINT( _L("Camera <> CCamCameraController: event KUidECamEventCameraSettingsAutoFocusType2") ); + // If AF started and canceled before finishing + if( iAfInProgress && iAfHyperfocalPending && iFirstAfEventReceived ) + { + // continue to set focus to hyperfocal + proceed = ETrue; + } + if( !iFirstAfEventReceived ) + { + // For the first time, this event means that the autofocusing has been started + iFirstAfEventReceived = ETrue; + PRINT( _L("Camera <> CCamCameraController: event KUidECamEventCameraSettingAutoFocusType2 - first time, set iFirstAfEventReceived ") ); + } + else + { + iFirstAfEventReceived = EFalse; + PRINT( _L("Camera <> CCamCameraController: event KUidECamEventCameraSettingAutoFocusType2 - second time") ); + } + } + else + { + // No other event acceptable here.. + __ASSERT_DEBUG( EFalse, Panic( ECamCameraControllerCorrupt ) ); + } + // ------------------------------------------------------- + // Proceed if right event received + if( proceed ) + { + TCamCameraEventId event = ( KErrNone == aStatus ) + ? ECamCameraEventAutofocusSuccessful + : ECamCameraEventAutofocusFailed; + if( iAfHyperfocalPending ) + { + PRINT( _L("Camera <> Cancelled active autofocus request.") ); + PRINT( _L("Camera <> Setting focus range to hyperfocal, no event to observers yet") ); + iAfHyperfocalPending = EFalse; + iAfInProgress = EFalse; + TRAP_IGNORE( ProcessAutofocusRequestL( ECamRequestCancelAutofocus ) ); + } + else + { + HandleCallbackEvent( KErrNone, + event, + ECamCameraEventClassAutofocus ); + } + + } + else if(iFirstAfEventReceived && (aStatus != KErrNone) ) + { + //There might have been error when first event was received + //and no further autofocus events would occur. + iFirstAfEventReceived = EFalse; + iAfInProgress = EFalse; + + if( iAfHyperfocalPending ) + { + PRINT( _L("Camera <> Cancelled active autofocus request.") ); + PRINT( _L("Camera <> Set focus range to hyperfocal, no event to observers yet") ); + iAfHyperfocalPending = EFalse; + TRAP_IGNORE( ProcessAutofocusRequestL( ECamRequestCancelAutofocus ) ); + } + else + { + HandleCallbackEvent( KErrNone, + ECamCameraEventAutofocusFailed, + ECamCameraEventClassAutofocus ); + } + } + // ------------------------------------------------------- + PRINT( _L("Camera <= CCamCameraController::HandleAutoFocusEvent") ); + } + + + +// --------------------------------------------------------------------------- +// +// HandleFlashStatusEvent +// +// Helper method to handle flash status updates. +// +// --------------------------------------------------------------------------- +void +CCamCameraController::HandleFlashStatusEvent( TInt aStatus, + const TCamCameraEventId& aEventId ) + { + PRINT2( _L("Camera => CCamCameraController::HandleFlashStatusEvent, event[%s] status:%d"), KCamCameraEventNames[aEventId], aStatus ); + NotifyObservers( aStatus, + aEventId, + EventClass( aEventId ) ); + PRINT ( _L("Camera <= CCamCameraController::HandleFlashStatusEvent" ) ); + } + + + +// --------------------------------------------------------------------------- +// HandleCallbackEvent +// +// Helper method to handle CCamera callback events. +// Notifies observers and checks if we should proceed with the sequence. +// --------------------------------------------------------------------------- +// +void +CCamCameraController +::HandleCallbackEvent( TInt aStatus, + const TCamCameraEventId& aEventId, + const TCamCameraEventClassId& aEventClass, + TAny* aEventData /*= NULL*/ ) + { + PRINT1( _L("Camera => CCamCameraController::HandleCallbackEvent, event[%s]"), + KCamCameraEventNames[aEventId] ); + // ------------------------------------------------------- + // Clear single request busy flag before notification to observers, + // in case client wishes to issue new request during the notification. + // Sequence busy flag can only be cleared in EndSequence + ClearFlags( iInfo.iBusy, ECamBusySingle ); + + // Observers might issue a new sequence during notification. + // We need to decide if sequence needs to continue here + // based on the status *before* notification. + TBool proceedSequence = EFalse; + TBool notify = ETrue; + + // ------------------------------------------------------- + // Continue if: + // 1) Processing sequence is ongoing. + // 2) The received event is exact response to our request. + // There are events like "video stopped" or "reserve lost" + // that may be received without our associated request. + // In that case we must not proceed sequence processing now. + // 3) In case that aStatus is KErrInUse and the current event is + // Reserve, it means reserve failed for some reason + if( IsFlagOn( iInfo.iBusy, ECamBusySequence ) ) // 1 + { + PRINT( _L("Camera <> Sequence is active") ); + PRINT2( _L("Camera <> seq index: %d, seq array len: %d"), iSequenceIndex, iSequenceArray.Count() ); + if( KErrNone != aStatus ) + { + + if ( KErrInUse == aStatus // 3 + && aEventId == ECamCameraEventReserveGain + && iSequenceIndex >= 0 + && Request2Event( iSequenceArray[iSequenceIndex] ) == ECamCameraEventReserveGain + && iReserveTryAgainCount > 0 ) + { + // Handle here only if reserve gain with error is part of a sequence and try again count is not zero + + iReserveTryAgainCount--; + User::After( KCamReserveTryAgainWaitInterval ); + + // decrease index, to get the same request handled again + iSequenceIndex--; + notify = EFalse; + proceedSequence = ETrue; + PRINT1( _L( "Camera <> CCamCameraController::HandleCallbackEvent - %d reserve try again left" ), iReserveTryAgainCount ); + + } + else + { + + notify = EFalse; + proceedSequence = EFalse; + EndSequence( aStatus ); + + } + + } + else if( iSequenceIndex >= 0 && // Sequence has started + Request2Event( iSequenceArray[iSequenceIndex] ) == aEventId ) // 2 + { + notify = ETrue; + proceedSequence = ETrue; + } + else + { + // Not the event we need yet. + } + + } + // ------------------------------------------------------- + // Setting sequence ongoing + else if( IsFlagOn( iInfo.iBusy, ECamBusySetting ) + && iSettingIndex >= 0 ) + { + PRINT( _L("Camera <> Settings change ongoing..") ); + + // Default is no notification + if( aEventClass != ECamCameraEventClassAutofocus ) + { + notify = EFalse; + } + if( KErrNone != aStatus ) + { + PRINT( _L("Camera <> error in, end settings sequence!") ); + proceedSequence = EFalse; + EndSequence( aStatus ); // does one notification + } + else if( ECamCameraEventSettingsSingle == aEventId + && aEventData + && iSettingArray[iSettingIndex] == *( static_cast( aEventData ) ) + ) + { + // We have checked already in HandleEvent that this is + // the right event for the setting we wait to finish. + // Notification can be sent with the given data. + PRINT( _L("Camera <> One setting finished, continue sequence") ); + proceedSequence = ETrue; + } + // Video init event repeated when filename or max file size set + // after init already done + else if( IsFlagOn( iInfo.iState, ECamVideoOn ) + && ECamCameraEventVideoInit == aEventId + && ( ECameraSettingFileName == iSettingArray[iSettingIndex] + || ECameraSettingFileMaxSize == iSettingArray[iSettingIndex] + || ECameraSettingAudioMute == iSettingArray[iSettingIndex] ) ) + { + PRINT( _L("Camera <> One setting finished, continue sequence") ); + proceedSequence = ETrue; + } + else if( ECamCameraEventVideoStop == aEventId || ECamCameraEventVideoAsyncStop == aEventId ) + { + // Video stop might come whenever. + // Need to notify client. + notify = ETrue; + } + else + { + // Not event for us yet + } + } + // ------------------------------------------------------- + else + { + // Single request or no request sent + } + // ------------------------------------------------------- + + + // ------------------------------------------------------- + // Notify the observers with data from the event. + if( notify ) + { + NotifyObservers( aStatus, aEventId, aEventClass, aEventData ); + } + + // ------------------------------------------------------- + // If this is part of sequence, continue processing. + if( proceedSequence ) + { + PRINT ( _L("Camera <> proceeding with the sequence") ); + __ASSERT_DEBUG( iActive, Panic( ECamCameraControllerCorrupt ) ); + iActive->IssueRequest(); + } + // ------------------------------------------------------- + PRINT ( _L("Camera <= CCamCameraController::HandleCallbackEvent") ); + } + + +// =========================================================================== + +// --------------------------------------------------------------------------- +// Notify all our observers of an event. +// --------------------------------------------------------------------------- +// +void +CCamCameraController +::NotifyObservers( TInt aStatus, + TCamCameraEventId aEventId, + TCamCameraEventClassId aEventClass, + TAny* aEventData /*=NULL*/ ) + { +// PRINT ( _L("Camera => CCamCameraController::NotifyObservers") ); +// PRINT3( _L("Camera <> status:% 3d event:% 3d class:%032b"), aStatus, aEventId, aEventClass ); + + // NOTE: + // We might skip an observer, if during the notification some observer + // is removed from the array (from smaller index than current one). + // This is a commmon problem for all observable classes in this application. + for( TInt i = 0; i < iObservers.Count(); i++ ) + { + // Observer defines which events it is interested in. +// PRINT1( _L("Camera <> observer interest:%032b"), iObserverInterests[i] ); + + if( iObserverInterests[i] & aEventClass ) + { + TRAP_IGNORE( iObservers[i]->HandleCameraEventL( aStatus, aEventId, aEventData ) ); + } + } +// PRINT ( _L("Camera <= CCamCameraController::NotifyObservers") ); + } + + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ReleaseCurrentCamera() + { + PRINT( _L("Camera => CCamCameraController::ReleaseCurrentCamera") ); + // Cancel any outstanding sequence. + if( IsFlagOn( iInfo.iBusy, ECamBusySequence ) +#ifdef CAMERAAPP_CAE_FIX + // Mode change calls this method possibly in the middle + // of request sequence. Must not try to cancel then. + && ECamModeChangeInactive == iModeChange +#endif + ) + { + CancelSequence(); + } + + if( IsFlagOn( iInfo.iState, ECamReserved ) ) + { + // Releases viewfinder and snapshot, cancels capture, + // powers off and releases CCamera if needed. + ProcessControlShutdownRequest( ECamRequestRelease ); + } + + // Custom interfaces (not owned) + ReleaseCustomInterfaces(); + + delete iEncoder; iEncoder = NULL; +#ifdef CAMERAAPP_CAE_FOR_VIDEO + delete iCaeEngine; iCaeEngine = NULL; +#endif // CAMERAAPP_CAE_FOR_VIDEO + +#ifdef CAMERAAPP_CAPI_V2_ADV + delete iAdvancedSettings; iAdvancedSettings = NULL; + iAdvancedSettingInfo.Reset(); +#endif +#ifdef CAMERAAPP_CAPI_V2_DVF + delete iDirectViewfinder; iDirectViewfinder = NULL; +#endif +#ifdef CAMERAAPP_CAPI_V2_OL + delete iOverlayProvider; iOverlayProvider = NULL; +#endif +#ifdef CAMERAAPP_CAPI_V2_HG + delete iHistogramProvider; iHistogramProvider = NULL; +#endif +#ifdef CAMERAAPP_CAPI_V2_IP + delete iImageProcessor; iImageProcessor = NULL; +#endif + delete iSnapshotProvider; iSnapshotProvider = NULL; + + delete iCamera; iCamera = NULL; + +#ifdef CAMERAAPP_CAE_FIX + // Must not reset busy flags if this method is called + // because of mode switch. + TBool saveBusyFlags = (ECamModeChangeInactive != iModeChange); + iInfo.Reset( saveBusyFlags ); +#else + iInfo.Reset(); +#endif + iResolutionSupport.Reset(); + iInfo.iState = ECamIdle; + + PRINT( _L("Camera <= CCamCameraController::ReleaseCurrentCamera") ); + } + + +// --------------------------------------------------------------------------- +// ReleaseCustomInterfaces +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ReleaseCustomInterfaces() + { + iCustomInterfaceOrientation = NULL; + } + +// --------------------------------------------------------------------------- +// CompareSize +// Compare two TSize instances +// --------------------------------------------------------------------------- +// +TBool CCamCameraController::CompareSize( const TSize& aA, const TSize& aB ) + { + return ( aA.iWidth == aB.iWidth && aA.iHeight == aB.iHeight ); + } + + +// --------------------------------------------------------------------------- +// GetResolutionIndexL +// +// Get quality index for prepare with given format and size. +// If current info is not for the given format, update the +// supported resolutions info. After the support info is up to date, +// find the index. Return KErrNotFound if not supported size. +// +// For JPEG format we try two alternate bitmap formats, if +// the given resolution is not supported in JPEG format. +// If support is achieved by using one of the alternate formats, +// the format in use is returned in aFormat. When image is then +// later captured, we encode the bitmap to JPEG before handing +// it over to clients. +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController +::GetResolutionIndexL( CCamera::TFormat& aFormat, + const TSize& aSize ) + { + PRINT ( _L("Camera => CCamCameraController::GetResolutionIndexL") ); + + if( iResolutionSupport.iForCameraFormat != aFormat + || iResolutionSupport.iForCameraIndex != iInfo.iCurrentCamera ) + { + iAlternateFormatInUse = EFalse; + + // Reset all old resolution info + iResolutionSupport.Reset(); + + // Get the resolution info for current camera with given format. + const TInt KResolutionCount( iCameraInfo.iNumImageSizesSupported ); + RArray& resolutions( iResolutionSupport.iResolutions ); + + resolutions.ReserveL( KResolutionCount ); + for( TInt i = 0; i < KResolutionCount; i++ ) + { + // Reserve called, so should not leave. + resolutions.AppendL( TSize() ); + iCamera->EnumerateCaptureSizes( resolutions[i], i, aFormat ); + } + + // Set these after successful filling of the array + iResolutionSupport.iForCameraIndex = iInfo.iCurrentCamera; + iResolutionSupport.iForCameraFormat = aFormat; + } + +#ifdef _DEBUG + PRINT ( _L("Camera <> ==================================================") ); + PRINT2( _L("Camera <> Size requested : (%d,%d)"), aSize.iWidth, aSize.iHeight ); + PRINT1( _L("Camera <> Formats supported : %032b" ), iCameraInfo.iImageFormatsSupported ); + PRINT1( _L("Camera <> Sizes listed for : %032b" ), aFormat ); + PRINT1( _L("Camera <> EFormatJpeg : %032b" ), CCamera::EFormatJpeg ); + PRINT1( _L("Camera <> EFormatExif : %032b" ), CCamera::EFormatExif ); + PRINT1( _L("Camera <> EFormatFbsBitmapColor4K : %032b" ), CCamera::EFormatFbsBitmapColor4K ); + PRINT1( _L("Camera <> EFormatFbsBitmapColor64K : %032b" ), CCamera::EFormatFbsBitmapColor64K ); + PRINT1( _L("Camera <> EFormatFbsBitmapColor16M : %032b" ), CCamera::EFormatFbsBitmapColor16M ); + PRINT1( _L("Camera <> EFormatFbsBitmapColor16MU: %032b" ), CCamera::EFormatFbsBitmapColor16MU ); + for( TInt i = 0; i < iResolutionSupport.iResolutions.Count(); i++ ) + { + const TSize& size( iResolutionSupport.iResolutions[i] ); + PRINT3( _L("Camera <> Size (%d): (%d,%d)"), i, size.iWidth, size.iHeight ); + } + PRINT ( _L("Camera <> ==================================================") ); +#endif + + TIdentityRelation compareFunc( CCamCameraController::CompareSize ); + TInt index = iResolutionSupport.iResolutions.Find( aSize, compareFunc ); + + // Exception for JPEG format: + // If JPEG format is not supported, but bitmap format is, + // pretend to support the format anyway. + // When capturing, we encode the JPEG from the bitmap. + if( CCamera::EFormatJpeg == aFormat + && KErrNotFound == index ) + { + PRINT ( _L("Camera <> Jpeg not supported, trying bitmap format 1..") ); + aFormat = KCamJpegAlternativeFormat1; + index = GetResolutionIndexL( aFormat, aSize ); + + if( KErrNotFound == index ) + { + PRINT ( _L("Camera <> Jpeg not supported, trying bitmap format 2..") ); + aFormat = KCamJpegAlternativeFormat2; + index = GetResolutionIndexL( aFormat, aSize ); + } + + if( KErrNotFound != index ) + { + iAlternateFormatInUse = ETrue; + } + else + { + // Could not find alternative. + aFormat = CCamera::EFormatJpeg; + iAlternateFormatInUse = EFalse; + } + } + + PRINT1( _L("Camera <= CCamCameraController::GetResolutionIndexL, return: %d"), index ); + return index; + } + + +#ifdef CAMERAAPP_CAPI_V2_ADV +// --------------------------------------------------------------------------- +// GetAdvancedSettingsInfoL +// +// --------------------------------------------------------------------------- +// +void +CCamCameraController::GetAdvancedSettingsInfoL() + { + PRINT ( _L("Camera => CCamCameraController::GetAdvancedSettingsInfoL") ); + PRINT2( _L("Camera <> current camera:%d, latest info for:%d"), + iInfo.iCurrentCamera, + iAdvancedSettingInfo.iForCameraIndex ); + + + CheckNonNullL( iAdvancedSettings, KErrNotReady ); + iAdvancedSettingInfo.Reset(); + + TInt error( KErrNone ); + CleanupStack::PushL( TCleanupItem( ResetInfo, &iAdvancedSettingInfo ) ); + + // ----------------------------------------------------- + // Digital zoom steps support + PRINT( _L("Camera <> Get zoom steps..") ); + if( IsFlagOn( iInfo.iState, ECamImageOn ) ) + { + TPckgBuf params; + iSettingProvider.ProvideCameraParamL( ECameraParamImage, ¶ms ); + + PRINT( _L("Camera <> Enumerating capture sizes..") ); + CCamera::TFormat format( params().iFormat ); + TInt index ( GetResolutionIndexL( format, params().iSize ) ); + User::LeaveIfError( index ); + TBool isInfluencePossible; // Not used + + PRINT( _L("Camera <> Get zoom steps for image") ); + TRAP( error, iAdvancedSettings->GetDigitalZoomStepsForStillL ( + iAdvancedSettingInfo.iDigitalZoomSupport, + iAdvancedSettingInfo.iDigitalZoomValueInfo, + index, + format, + isInfluencePossible ) ); + + if( KErrNotSupported != error ) User::LeaveIfError( error ); + } + else if( IsFlagOn( iInfo.iState, ECamVideoOn ) ) + { + PRINT( _L("Camera <> Get zoom steps for video") ); + TRAP( error, iAdvancedSettings->GetDigitalZoomStepsL( + iAdvancedSettingInfo.iDigitalZoomSupport, + iAdvancedSettingInfo.iDigitalZoomValueInfo ) ); + if( KErrNotSupported != error ) User::LeaveIfError( error ); + } + + // ----------------------------------------------------- + // EV steps multiplied by KECamFineResolutionFactor. + PRINT( _L("Camera <> Get EV support..") ); + iAdvancedSettingInfo.iEvModesSupport = + iAdvancedSettings->SupportedExposureModes(); + + TRAP( error, iAdvancedSettings->GetExposureCompensationStepsL( + iAdvancedSettingInfo.iEvStepsSupport, + iAdvancedSettingInfo.iEvStepsValueInfo ) ); + // Ignore error if just not supported. + // We check the support when setting is requested. + if( KErrNotSupported != error ) User::LeaveIfError( error ); + + // ----------------------------------------------------- + // ISO rates (.. 50, 100, 200, ..) + PRINT( _L("Camera <> Get ISO rates..") ); + TRAP( error, iAdvancedSettings->GetSupportedIsoRatesL( + iAdvancedSettingInfo.iIsoRatesSupport ) ); + if( KErrNotSupported != error ) User::LeaveIfError( error ); + + // ----------------------------------------------------- + // Stabilization + PRINT( _L("Camera <> Get Stabilization info..") ); + iAdvancedSettingInfo.iStabilizationModeSupport = + iAdvancedSettings->SupportedStabilizationModes(); + + iAdvancedSettingInfo.iStabilizationEffectSupport = + iAdvancedSettings->SupportedStabilizationEffects(); + + iAdvancedSettingInfo.iStabilizationComplexitySupport = + iAdvancedSettings->SupportedStabilizationComplexityValues(); + // ----------------------------------------------------- + +#ifdef CAMERAAPP_CAPI_V2_IP + // Image Processor only for primary camera + if( KPrimaryCameraIndex == iInfo.iCurrentCamera ) + { + PRINT( _L("Camera <> Get image processing info..") ); + + if( iImageProcessor != NULL ) + { + // ----------------------------------------------------- + PRINT( _L("Camera <> Get sharpness support..") ); + TRAP( error, iImageProcessor->GetTransformationSupportedValuesL( + KUidECamEventImageProcessingAdjustSharpness, + iAdvancedSettingInfo.iSharpnessSupport, + iAdvancedSettingInfo.iSharpnessValueInfo ) ); + if( KErrNotSupported != error ) User::LeaveIfError( error ); + + // ----------------------------------------------------- + PRINT( _L("Camera <> Get colour effect support..") ); + TRAP( error, iImageProcessor->GetTransformationSupportedValuesL( + KUidECamEventImageProcessingEffect, + iAdvancedSettingInfo.iColourEffectSupport, + iAdvancedSettingInfo.iColourEffectValueInfo ) ); + if( KErrNotSupported != error ) User::LeaveIfError( error ); + } + else + { + PRINT( _L("Camera <> [WARNING] Image processing not supported") ); + } + } +#endif // CAMERAAPP_CAPI_V2_IP + // ----------------------------------------------------- + PRINT( _L("Camera <> ..done") ); + CleanupStack::Pop(); // Cleanup item + + // Set only after successfully gathering the data + iAdvancedSettingInfo.iForCameraIndex = iInfo.iCurrentCamera; + +#ifdef _DEBUG + iAdvancedSettingInfo.PrintInfo(); +#endif + + PRINT ( _L("Camera <= CCamCameraController::GetAdvancedSettingsInfoL") ); + } + + + +// --------------------------------------------------------------------------- +// ResolveEvStep +// +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController::ResolveEvStep( TInt aEvProposedStep ) const + { + PRINT1( _L("Camera => CCamCameraController::ResolveEvStep( %d )"), aEvProposedStep ); + + TInt delta ( KMaxTInt ); + TInt delta1( 0 ); + TInt step ( 0 ); + + for( TInt i = 0; i < iAdvancedSettingInfo.iEvStepsSupport.Count() && delta != 0; i++ ) + { + delta1 = Max( iAdvancedSettingInfo.iEvStepsSupport[i], aEvProposedStep ) + - Min( iAdvancedSettingInfo.iEvStepsSupport[i], aEvProposedStep ); + + if( delta1 < delta ) + { + delta = delta1; + step = iAdvancedSettingInfo.iEvStepsSupport[i]; + } + } + + PRINT1( _L("Camera <= CCamCameraController::ResolveEvStep, return %d"), step ); + return step; + } + + +// --------------------------------------------------------------------------- +// IsSupportedValue <> +// --------------------------------------------------------------------------- +// +TBool +CCamCameraController::IsSupportedValue( const TInt& aValue, + const RArray& aValueList, + const TValueInfo& aValueInfo ) + { + TBool support( EFalse ); + + switch( aValueInfo ) + { + // ----------------------------------------------------- + case EBitField: + { + // Supported values are described by a bitfield. + // Compare the support bitfield and the setting value. + // Default value for these settings is zero (0) and + // that is always supported. + // Array: [0] bitfield of supported bits + support = ( 1 <= aValueList.Count() + && ( !aValue + || (aValue & aValueList[0]) // 0 always supported + ) + ); + break; + } + // ----------------------------------------------------- + case EDiscreteSteps: + { + // All supported steps are listed, look for this one. + support = ( KErrNotFound != aValueList.Find( aValue ) ); + break; + } + // ----------------------------------------------------- + case EDiscreteRangeMinMaxStep: + { + // Support is described with evenly spaced steps between + // min and max value. Step is given. + // Array: [0] min supported value + // [1] max supported value + // [2] step between supported values + support = + ( 3 <= aValueList.Count() // We need 3 items. + && 1 <= aValueList[2] // 1 <= step + && aValue >= aValueList[0] // aValue >= min + && aValue <= aValueList[1] // aValue <= max + && (aValue - aValueList[0])%aValueList[2] == 0 // aValue = min + N*step + ); + break; + } + // ----------------------------------------------------- + case EContinuousRangeMinMax: + { + // Support is described by min and max value, + // continuous range of values within those two is supported. + // Array: [0] min supported value + // [1] max supported value + support = + ( 2 <= aValueList.Count() // We need 2 items. + && aValue >= aValueList[0] // aValue >= min + && aValue <= aValueList[1] // aValue <= max + ); + break; + } + // ----------------------------------------------------- + case ENotActive: + default: + // Not supported setting + support = EFalse; + break; + // ----------------------------------------------------- + } + + return support; + } +#endif // CAMERAAPP_CAPI_V2_ADV + + +// --------------------------------------------------------------------------- +// ResolveSnapshotFormat +// +// --------------------------------------------------------------------------- +// +CCamera::TFormat +CCamCameraController +::ResolveSnapshotFormatL( CCamera::TFormat aPreferredFormat ) const + { + PRINT ( _L("Camera => CCamCameraController::ResolveSnapshotFormatL") ); + + CheckNonNullL( iSnapshotProvider, KErrNotReady ); + + const TUint32 support = iSnapshotProvider->SupportedFormats(); + CCamera::TFormat final = aPreferredFormat; + + // Return the preferred format if it is supported. + // Otherwise return the "best" supported format. + if ( support & aPreferredFormat ) final = aPreferredFormat; + else if ( support & CCamera::EFormatFbsBitmapColor16MU ) final = CCamera::EFormatFbsBitmapColor16MU; + else if ( support & CCamera::EFormatFbsBitmapColor16M ) final = CCamera::EFormatFbsBitmapColor16M; + else if ( support & CCamera::EFormatFbsBitmapColor64K ) final = CCamera::EFormatFbsBitmapColor64K; + else if ( support & CCamera::EFormatFbsBitmapColor4K ) final = CCamera::EFormatFbsBitmapColor4K; + else + { + // No known acceptable format supported + PRINT( _L("Camera <> CCamCameraController: No acceptable format available, LEAVE!") ); + User::Leave( KErrNotSupported ); + } + + PRINT1( _L("Camera <> Preferred format : %032b"), aPreferredFormat ); + PRINT1( _L("Camera <> Supported formats: %032b"), support ); + PRINT1( _L("Camera <> Selected format : %032b"), final ); + PRINT ( _L("Camera <= CCamCameraController::ResolveSnapshotFormatL") ); + return final; + } + + + +// --------------------------------------------------------------------------- +// Request2Event <> +// +// Convert request id to event id +// --------------------------------------------------------------------------- +// +TCamCameraEventId +CCamCameraController::Request2Event( const TCamCameraRequestId& aType ) + { + switch( aType ) + { + // ----------------------------------------------------- + // Camera control + case ECamRequestReserve: return ECamCameraEventReserveGain; + case ECamRequestRelease: return ECamCameraEventReserveLose; + case ECamRequestPowerOn: return ECamCameraEventPowerOn; + case ECamRequestPowerOff: return ECamCameraEventPowerOff; + // ----------------------------------------------------- + // Viewfinder + case ECamRequestVfStart: return ECamCameraEventVfStart; + case ECamRequestVfStop: return ECamCameraEventVfStop; + case ECamRequestVfRelease: return ECamCameraEventVfRelease; + // ----------------------------------------------------- + // Snapshot + case ECamRequestSsStart: return ECamCameraEventSsStart; + case ECamRequestSsStop: return ECamCameraEventSsStop; + case ECamRequestSsRelease: return ECamCameraEventSsRelease; + // ----------------------------------------------------- + // Still capture + case ECamRequestImageInit: return ECamCameraEventImageInit; + case ECamRequestImageCapture: return ECamCameraEventImageStart; + case ECamRequestImageCancel: return ECamCameraEventImageStop; + case ECamRequestImageRelease: return ECamCameraEventImageRelease; + // ----------------------------------------------------- + // Video recording + case ECamRequestVideoInit: return ECamCameraEventVideoInit; + case ECamRequestVideoStart: return ECamCameraEventVideoStart; + case ECamRequestVideoPause: return ECamCameraEventVideoPause; + case ECamRequestVideoStop: return ECamCameraEventVideoStop; + case ECamRequestVideoRelease: return ECamCameraEventVideoRelease; + // ----------------------------------------------------- + // Autofocus + case ECamRequestStartAutofocus: return ECamCameraEventStartAutofocus; + case ECamRequestCancelAutofocus: return ECamCameraEventCancelAutofocus; + case ECamRequestSetAfRange: return ECamCameraEventSetAfRange; + // ----------------------------------------------------- + + // Unrecognised + default: + { + Panic( ECamCameraControllerUnknownRequest ); + return ECamCameraEventNone; + } + // ----------------------------------------------------- + } + } + + +// --------------------------------------------------------------------------- +// EventClass <> +// +// Get the event class for an event +// --------------------------------------------------------------------------- +// +TCamCameraEventClassId +CCamCameraController::EventClass( const TCamCameraEventId& aEventId ) + { + switch( aEventId ) + { + // ------------------------------------------------------- + case ECamCameraEventSequenceEnd: + case ECamCameraEventReserveGain: + case ECamCameraEventReserveLose: + case ECamCameraEventPowerOn: + case ECamCameraEventPowerOff: + return ECamCameraEventClassBasicControl; + // ------------------------------------------------------- + case ECamCameraEventVfStart: + case ECamCameraEventVfStop: + case ECamCameraEventVfRelease: + return ECamCameraEventClassVfControl; + // ------------------------------------------------------- + case ECamCameraEventVfFrameReady: + return ECamCameraEventClassVfData; + // ------------------------------------------------------- + case ECamCameraEventSsStart: + case ECamCameraEventSsStop: + case ECamCameraEventSsRelease: + return ECamCameraEventClassSsControl; + // ------------------------------------------------------- + case ECamCameraEventSsReady: + return ECamCameraEventClassSsData; + // ------------------------------------------------------- + case ECamCameraEventImageInit: + case ECamCameraEventImageStart: + case ECamCameraEventImageStop: + case ECamCameraEventImageRelease: + case ECamCameraEventImageData: + return ECamCameraEventClassImage; + // ------------------------------------------------------- + case ECamCameraEventVideoInit: + case ECamCameraEventVideoStart: + case ECamCameraEventVideoPause: + case ECamCameraEventVideoStop: + case ECamCameraEventVideoRelease: + return ECamCameraEventClassVideo; + // ------------------------------------------------------- + case ECamCameraEventVideoTimes: + return ECamCameraEventClassVideoTimes; + // ------------------------------------------------------- + case ECamCameraEventSettingsSingle: + case ECamCameraEventSettingsDone: + return ECamCameraEventClassSettings; + // ------------------------------------------------------- + case ECamCameraEventStartAutofocus: + case ECamCameraEventCancelAutofocus: + case ECamCameraEventAutofocusSuccessful: + case ECamCameraEventAutofocusFailed: + case ECamCameraEventSetAfRange: + return ECamCameraEventClassAutofocus; + // ------------------------------------------------------- + case ECamCameraEventFlashReady: + case ECamCameraEventFlashNotReady: + return ECamCameraEventClassFlashStatus; + // ------------------------------------------------------- + default: + { + #ifdef _DEBUG + Panic( ECamCameraControllerCorrupt ); + #endif + return ECamCameraEventClassAll; + } + } + } + + + +// --------------------------------------------------------------------------- +// HasCallback +// --------------------------------------------------------------------------- +// +TBool +CCamCameraController::HasCallback( const TCamCameraRequestId& aType ) + { + TBool callback = EFalse; + switch( aType ) + { + // ----------------------------------------------------- + case ECamRequestReserve: // ReserveComplete / KUidECamEventReserveComplete + case ECamRequestPowerOn: // PowerOnComplete / KUidECamEventPowerOnComplete + + case ECamRequestImageCapture: // ImageReady / ImageBufferReady + +#ifdef CAMERAAPP_CAE_FOR_VIDEO + case ECamRequestVideoInit: // McaeoVideoPrepareComplete + case ECamRequestVideoStart: // McaeoVideoRecordingOn + case ECamRequestVideoPause: // McaeoVideoRecordingPaused + case ECamRequestVideoStop: // McaeoVideoRecordingComplete +#endif + callback = ETrue; + break; + // ----------------------------------------------------- + default: + callback = EFalse; + break; + // ----------------------------------------------------- + } + return callback; + } + +// --------------------------------------------------------------------------- +// CurrentSettingHasCallback +// --------------------------------------------------------------------------- +// +TBool +CCamCameraController::CurrentSettingHasCallback() + { + TBool callback( EFalse ); +#ifdef CAMERAAPP_CAE_FOR_VIDEO + if( IsFlagOn( iInfo.iState, ECamVideoOn ) ) + { + switch( iSettingArray[iSettingIndex] ) + { + case ECameraSettingFileName: + case ECameraSettingFileMaxSize: + callback = ETrue; + break; + default: + break; + } + } + else + { + // no callback if not prepared for video yet. + } +#endif + return callback; + } + +#ifdef CAMERAAPP_CAE_FOR_VIDEO +// --------------------------------------------------------------------------- +// NewCaeEngineL +// --------------------------------------------------------------------------- +// +CCaeEngine* +CCamCameraController::NewCaeEngineL( TInt aCameraIndex ) + { + PRINT( _L("Camera => CCamCameraController::NewCaeEngineL") ); + +#ifndef FORCE_DUMMY_ENGINE + CCaeEngine* engine = CCaeEngine::NewL( aCameraIndex ); +#else + (void)aCameraIndex; // remove compiler warning + CCaeEngine* engine = CCameraappDummyEngine::NewL(); +#endif + + engine->SetCamAppEngineObserver( *this ); + + PRINT( _L("Camera <= CCamCameraController::NewCaeEngineL") ); + return engine; + } +#endif + +// --------------------------------------------------------------------------- +// NewCameraL +// --------------------------------------------------------------------------- +// +CAMERA* +CCamCameraController::NewCameraL( TInt aCameraIndex ) + { + PRINT( _L("Camera => CCamCameraController::NewCameraL") ); + CAMERA* camera( NULL ); +#ifdef CAMERAAPP_CAPI_V2 + camera = CAMERA::New2L( *this, aCameraIndex, KCameraClientPriority ); +#else + + // Both v1 and v2 observer interface implemented + // Need to cast to avoid ambiguous call. + MCameraObserver* self( this ); + PRINT1( _L("Camera <> Give observer pointer: %d"), self ); + + camera = CAMERA::NewL ( *self, aCameraIndex ); + +#endif // CAMERAAPP_CAPI_V2 + + PRINT( _L("Camera <= CCamCameraController::NewCameraL") ); + return camera; + } + +// --------------------------------------------------------------------------- +// NewDuplicateCameraL +// --------------------------------------------------------------------------- +// +CAMERA* +CCamCameraController::NewDuplicateCameraL( TInt aCameraHandle ) + { + PRINT1( _L("Camera => CCamCameraController::NewDuplicateCameraL( %d )"), aCameraHandle ); + CAMERA* camera( NULL ); + +#ifdef CAMERAAPP_CAPI_V2 + PRINT( _L("Camera <> call NewDuplicate2L..") ); + camera = CAMERA::NewDuplicate2L( *this, aCameraHandle ); +#else + MCameraObserver* self( this ); + PRINT( _L("Camera <> call NewDuplicateL..") ); + camera = CAMERA::NewDuplicateL ( *self, aCameraHandle ); +#endif + + PRINT( _L("Camera <= CCamCameraController::NewCameraL") ); + return camera; + } + + +// =========================================================================== +// Constructors + + +// --------------------------------------------------------------------------- +// 2nd phase constructor +// --------------------------------------------------------------------------- +// +void +CCamCameraController::ConstructL( TInt aCameraIndex ) + { + iActive = CCamCameraControllerActive::NewL( *this, KCamCallBackPriority ); + iIveRecoveryCount = KIveRecoveryCountMax; + +#ifdef CAMERAAPP_PERFORMANCE_CONTROLLER + iPerformanceLogger = new (ELeave) CCamPerformanceLogger; + iFirstVfFrameReceived = EFalse; +#endif + +#ifdef CAMERAAPP_FLASH_SIMULATOR + iFlashSimulator = CCamFlashSimulator::NewL( *this ); +#endif + + SwitchCameraL( aCameraIndex ); + iAsyncVideoStopModeSupported = EFalse; + + } + + + +// --------------------------------------------------------------------------- +// 1st phase constructor +// --------------------------------------------------------------------------- +// +CCamCameraController +::CCamCameraController( MCamSettingProvider& aSettingProvider, + CCamAppController& aAppController ) + : iSequenceArray ( KCamSequenceGranularity ), + iReserveTryAgainCount( KCamReserveTryAgainMaxCount ), + iSettingProvider ( aSettingProvider ), + iAppController ( aAppController ) + { + } + + +// =========================================================================== +// Workaround for CCaeEngine with no support for CCamera sharing + +#ifdef CAMERAAPP_CAE_FIX +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController::ProceedModeSwitch() + { + PRINT1( _L("Camera => CCamCameraController::ProceedModeSwitch, status in:%d"), iModeChangeStatus ); + TInt proceed( EFalse ); + + // Update only after here, so any events arriving + // in the middle get ignored if wanted. + ++iModeChangePhase; + + if( KErrNone == iModeChangeStatus ) + { + TRAP( iModeChangeStatus, proceed = DoProceedModeSwitchL() ); + } + + if( KErrNone != iModeChangeStatus ) + { + PRINT1( _L("Camera <> Mode switch error: %d"), iModeChangeStatus ); + iModeChange = ECamModeChangeInactive; + iModeChangePhase = ECamModeChangePhase0; + iModeChangeStatus = KErrNone; + + PRINT( _L("Camera <> Deleting engine..") ); + delete iCaeEngine; + iCaeEngine = NULL; + + PRINT( _L("Camera <> Deleting camera..") ); + delete iCamera; + iCamera = NULL; + + iInfo.Reset(); + + PRINT( _L("Camera <> PANIC!!") ); + + Panic( ECamCameraControllerUnrecovableError ); + } + + PRINT1( _L("Camera <= CCamCameraController::ProceedModeSwitch, more calls now:%d"), proceed ); + return proceed; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController::DoProceedModeSwitchL() + { + PRINT( _L("Camera => CCamCameraController::DoProceedModeSwitchL") ); + User::LeaveIfError( iModeChangeStatus ); + + TBool callback = ETrue; + + // ------------------------------------------------------- + if( ECamModeChangeImage2Video == iModeChange ) + { + PRINT( _L("Camera <> Changing mode image => video") ); + switch( iModeChangePhase ) + { + // First two phases only usable if CAE v1 in use. + // Must start from phase2 otherwise. + // ------------------------------- + case ECamModeChangePhase0: + { + PRINT( _L("Camera <> Phase0: Release camera..") ); + TInt cameraIndex = iInfo.iCurrentCamera; + ReleaseCurrentCamera(); + SwitchCameraL( cameraIndex ); + CompleteSwitchCameraL(); + callback = EFalse; + // iModeChangePhase is incremented when iActive->RunL calls + // ProcessNextRequestL for the next time. + break; + } + // ------------------------------- + case ECamModeChangePhase1: + { + PRINT( _L("Camera <> Phase1: calling CCaeEngine::InitL..") ); + iCaeEngine->InitL(); + iCaeInUse = ETrue; + // Continue mode change in callback + PRINT( _L("Camera <> ..waiting for to complete") ); + break; + } + // ------------------------------- + case ECamModeChangePhase2: + { + PRINT( _L("Camera <> Phase2: Prepare video..") ); + PRINT( _L("Camera <> Call InitVideoRecorderL..") ); + iCaeEngine->InitVideoRecorderL(); + + PRINT( _L("Camera <> Ask filename..") ); +// HBufC* filename( HBufC::NewLC( KMaxFileName ) ); +// TPtr ptr ( filename->Des() ); +// iSettingProvider.ProvideCameraSettingL( ECameraSettingFileName, &ptr ); + _LIT( KTempFilename, "C:\\video.3gp" ); + TPtrC ptr; + ptr.Set( KTempFilename() ); +#pragma message( "Camera Controller: video filename hardcoded" ) + PRINT1( _L("Camera <> Set filename [%S]"), &ptr ); + iCaeEngine->SetVideoRecordingFileNameL( ptr ); +// CleanupStack::PopAndDestroy( filename ); + + + // Set max video clip size + ProcessSettingL( ECameraSettingFileMaxSize ); + + + TPckgBuf params; + iSettingProvider.ProvideCameraParamL( ECameraParamVideoCae, ¶ms ); + // The audioOn value is defined On==0 and Off==1, but the engine expects + // ETrue if audio recording is On + params().iAudioOn = ( ECamSettOn == params().iAudioOn ) + ? ETrue + : EFalse; + PRINT( _L("Camera <> Call prepare..") ); + // McaeoVideoPrepareComplete will be called when prepare is ready. + // The callback is allowed to come also *during* this call. + iCaeEngine->PrepareVideoRecordingL( params().iFrameSize, + params().iFrameRate, + params().iVideoBitRate, + params().iAudioOn, + params().iAudioBitRate, + params().iMimeType, + params().iSupplier, + params().iVideoType, + params().iAudioType ); + +// iCaeEngine->PrepareVideoRecordingL( 0 ); + + break; + } + // ------------------------------- + case ECamModeChangePhase3: + { + PRINT( _L("Camera <> Phase3: Notifying..") ); + iModeChange = ECamModeChangeInactive; + iModeChangePhase = ECamModeChangePhaseIdle; + callback = EFalse; + + NotifyObservers( iModeChangeStatus, + ECamCameraEventVideoInit, + ECamCameraEventClassVideo ); + break; + } + // ------------------------------- + default: + { + Panic( ECamCameraControllerCorrupt ); + break; + } + // ------------------------------- + } + } + // ------------------------------------------------------- + else if( ECamModeChangeVideo2Image == iModeChange ) + { + PRINT( _L("Camera <> Changing mode video => image") ); + switch( iModeChangePhase ) + { + // ------------------------------- + case ECamModeChangePhase0: + { + PRINT( _L("Camera <> Phase0: Release camera..") ); + TInt cameraIndex = iInfo.iCurrentCamera; + ReleaseCurrentCamera(); + SwitchCameraL( cameraIndex ); + CompleteSwitchCameraL(); + callback = EFalse; + break; + } + // ------------------------------- + case ECamModeChangePhase1: + { + PRINT( _L("Camera <> Phase1: Reserve camera..") ); + iCaeInUse = EFalse; + iCamera->Reserve(); + break; + } + // ------------------------------- + case ECamModeChangePhase2: + { + PRINT( _L("Camera <> Phase2: Power on..") ); + iCamera->PowerOn(); + break; + } + // ------------------------------- + case ECamModeChangePhase3: + { + PRINT( _L("Camera <> Phase3: Prepare image..") ); + TPckgBuf params; + iSettingProvider.ProvideCameraParamL( ECameraParamImage, ¶ms ); + + // Query the supported resolutions for the selected format. + TInt index = GetResolutionIndexL( params().iFormat, params().iSize ); + User::LeaveIfError( index ); + + PRINT2( _L("Camera <> Image size: (%d, %d)"), + params().iSize.iWidth, + params().iSize.iHeight ); + iCamera->PrepareImageCaptureL( params().iFormat, index ); + iCamera->SetJpegQuality( params().iQualityFactor ); + + SetFlags( iInfo.iState, ECamImageOn ); + + callback = EFalse; + break; + } + // ------------------------------- + case ECamModeChangePhase4: + { + PRINT( _L("Camera <> Phase4: Notifying..") ); + iModeChange = ECamModeChangeInactive; + iModeChangePhase = ECamModeChangePhaseIdle; + callback = EFalse; + + NotifyObservers( iModeChangeStatus, + ECamCameraEventImageInit, + ECamCameraEventClassImage ); + + break; + } + // ------------------------------- + default: + { + Panic( ECamCameraControllerCorrupt ); + break; + } + // ------------------------------- + } + } + // ------------------------------------------------------- + else + { + Panic( ECamCameraControllerCorrupt ); + } + // ------------------------------------------------------- + + PRINT1( _L("Camera <= CCamCameraController::DoProceedModeSwitchL, more calls now:%d"), !callback ); + return !callback; + } +#endif // CAMERAAPP_CAE_FIX + + +/** +* CCamCameraController::RemainingVideoRecordingTime() +* Method to retrieve Remaining Recording time from CCaeEngine +* which is used in AppController and AppUi during Video Rec Operation +*/ +TTimeIntervalMicroSeconds +CCamCameraController::RemainingVideoRecordingTime() + { + if( iCaeEngine ) + return iCaeEngine->RemainingVideoRecordingTime(); + else + return 0; + } + + +// =========================================================================== +// Performance measurement related + +#ifdef CAMERAAPP_PERFORMANCE_CONTROLLER + +// --------------------------------------------------------------------------- +// PerformanceLogger() +// +// Return the performance logger instance. +// Used to record performance measurement data. +// --------------------------------------------------------------------------- +// +const CCamPerformanceLogger* +CCamCameraController::PerformanceLogger() const + { + return iPerformanceLogger; + } + +#endif // CAMERAAPP_PERFORMANCE_CONTROLLER + + + +// =========================================================================== +// Debug prints + +#ifdef _DEBUG +// --------------------------------------------------------------------------- +// PrintCameraInfo +// --------------------------------------------------------------------------- +// +void +CCamCameraController::PrintCameraInfo() const + { + PRINT ( _L("Camera <> ==================================================") ); + PRINT ( _L("Camera <> Camera info:") ); + PRINT3( _L("Camera <> Camera hw version[%d.%d.%d]"), + iCameraInfo.iHardwareVersion.iMajor, + iCameraInfo.iHardwareVersion.iMinor, + iCameraInfo.iHardwareVersion.iBuild ); + PRINT3( _L("Camera <> Camera sw version[%d.%d.%d]"), + iCameraInfo.iSoftwareVersion.iMajor, + iCameraInfo.iSoftwareVersion.iMinor, + iCameraInfo.iSoftwareVersion.iBuild ); + PRINT1( _L("Camera <> TCameraInfo.iMinZoom : %d"), iCameraInfo.iMinZoom ); + PRINT1( _L("Camera <> TCameraInfo.iMaxZoom : %d"), iCameraInfo.iMaxZoom ); + PRINT1( _L("Camera <> TCameraInfo.iMaxDigitalZoom : %d"), iCameraInfo.iMaxDigitalZoom ); + PRINT1( _L("Camera <> TCameraInfo.iMinZoomFactor : %f"), iCameraInfo.iMinZoomFactor ); + PRINT1( _L("Camera <> TCameraInfo.iMaxZoomFactor : %f"), iCameraInfo.iMaxZoomFactor ); + PRINT1( _L("Camera <> TCameraInfo.iMaxDigitalZoomFactor: %f"), iCameraInfo.iMaxDigitalZoomFactor ); + PRINT ( _L("Camera <> ==================================================") ); + } + + +// --------------------------------------------------------------------------- +// PrintSnapshotInfo +// --------------------------------------------------------------------------- +// +void +CCamCameraController::PrintSnapshotInfo() const + { + PRINT ( _L("Camera <> ===========================================================") ); + PRINT ( _L("Camera <> Snapshot info" ) ); + PRINT1( _L("Camera <> Formats supported (1st) : %032b" ), iSnapshotProvider->SupportedFormats() ); + PRINT1( _L("Camera <> EFormatFbsBitmapColor4K : %032b" ), CCamera::EFormatFbsBitmapColor4K ); + PRINT1( _L("Camera <> EFormatFbsBitmapColor64K : %032b" ), CCamera::EFormatFbsBitmapColor64K ); + PRINT1( _L("Camera <> EFormatFbsBitmapColor16M : %032b" ), CCamera::EFormatFbsBitmapColor16M ); + PRINT1( _L("Camera <> EFormatFbsBitmapColor16MU: %032b" ), CCamera::EFormatFbsBitmapColor16MU ); + PRINT ( _L("Camera <> ===========================================================") ); + } + +// =========================================================================== +#endif // _DEBUG + +// --------------------------------------------------------------------------- +// CCamCameraController::SettingValueUpToDateL +// --------------------------------------------------------------------------- +// +TBool +CCamCameraController::SettingValueUpToDateL( const NCamCameraController::TCamCameraSettingId& aSettingId ) + { + PRINT( _L("Camera => CCamCameraController::SettingValueUpToDate") ); + TBool upToDate = ETrue; + + switch( aSettingId ) + { + case ECameraSettingFlash: + case ECameraUserSceneSettingFlash: + { + PRINT( _L("Camera <> CCamCameraController::SettingValueUpToDate ECameraSettingFlash") ); + + // Supposed setting value from settings provider + CCamera::TFlash flashSetting( CCamera::EFlashNone ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &flashSetting ); + + // Real settings value from camera + CCamera::TFlash flashValue( CCamera::EFlashNone ); + GetCameraSettingValueL( aSettingId, &flashValue ); + + PRINT2( _L("Camera <> flashValue = %d, flashSetting = %d"), flashValue, flashSetting ); + upToDate = ( flashValue == flashSetting ); + break; + } + case ECameraSettingExposure: + case ECameraUserSceneSettingExposure: + { + PRINT( _L("Camera <> CCamCameraController::SettingValueUpToDate ECameraSettingExposure") ); + TPckgBuf exposureSetting; + iSettingProvider.ProvideCameraSettingL( aSettingId, &exposureSetting ); + + TPckgBuf exposureValue; + GetCameraSettingValueL( aSettingId, &exposureValue ); + + if ( exposureSetting().iExposureMode != exposureValue().iExposureMode || + exposureSetting().iExposureStep != exposureValue().iExposureStep ) + { + upToDate = EFalse; + } + + break; + } + case ECameraSettingLightSensitivity: + case ECameraUserSceneSettingLightSensitivity: + { + PRINT( _L("Camera <> CCamCameraController::SettingValueUpToDate ECameraSettingLightSensitivity") ); + + RArray ISOarray; + CleanupClosePushL( ISOarray ); +#ifdef CAMERAAPP_CAPI_V2 + iAdvancedSettings->GetSupportedIsoRatesL( ISOarray ); +#endif + iSettingProvider.SetSupportedISORatesL( ISOarray ); + + TInt* isoSetting = 0; + iSettingProvider.ProvideCameraSettingL( aSettingId, &isoSetting ); + CleanupStack::PopAndDestroy( &ISOarray ); + + + TInt* isoValue = 0; + GetCameraSettingValueL( aSettingId, &isoValue ); + + upToDate = ( isoSetting == isoValue ); + break; + } + case ECameraSettingWhiteBalance: + case ECameraUserSceneSettingWhiteBalance: + { + PRINT( _L("Camera <> CCamCameraController::SettingValueUpToDate ECameraSettingWhiteBalance") ); + + TPckgBuf wbSetting; + iSettingProvider.ProvideCameraSettingL( aSettingId, &wbSetting ); + + TPckgBuf wbValue; + GetCameraSettingValueL( aSettingId, &wbValue ); + + upToDate = ( wbSetting().iWhiteBalanceMode == wbValue().iWhiteBalanceMode ); + break; + } + case ECameraSettingColourEffect: + case ECameraUserSceneSettingColourEffect: + { + PRINT( _L("Camera <> CCamCameraController::SettingValueUpToDate ECameraSettingColourEffect") ); + + CIP::TEffect effectSetting( CIP::EEffectNone ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &effectSetting ); + + CIP::TEffect effectValue( CIP::EEffectNone ); + // Can't leave here or other settings won't be restored + TRAP_IGNORE( GetCameraSettingValueL( aSettingId, &effectValue ) ); + + upToDate = ( effectSetting == effectValue ); + break; + } + case ECameraSettingBrightness: + case ECameraUserSceneSettingBrightness: + { + PRINT( _L("Camera <> CCamCameraController::SettingValueUpToDate ECameraSettingBrightness") ); + CCamera::TBrightness brightnessSetting; + iSettingProvider.ProvideCameraSettingL( aSettingId, &brightnessSetting ); + + CCamera::TBrightness brightnessValue; + GetCameraSettingValueL( aSettingId, &brightnessValue ); + + upToDate = ( brightnessSetting == brightnessValue ); + break; + } + case ECameraSettingContrast: + case ECameraUserSceneSettingContrast: + { + PRINT( _L("Camera <> CCamCameraController::SettingValueUpToDate ECameraSettingContrast") ); + CCamera::TContrast contrastSetting( CCamera::EContrastAuto ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &contrastSetting ); + + CCamera::TContrast contrastValue( CCamera::EContrastAuto ); + GetCameraSettingValueL( aSettingId, &contrastValue ); + + upToDate = ( contrastSetting == contrastValue ); + break; + } + case ECameraSettingSharpness: + case ECameraUserSceneSettingSharpness: + { + PRINT( _L("Camera <> CCamCameraController::SettingValueUpToDate ECameraSettingSharpness") ); + TInt sharpnessSetting( 0 ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &sharpnessSetting ); + + TInt sharpnessValue( 0 ); + // Can't leave here or other settings won't be restored + TRAP_IGNORE( GetCameraSettingValueL( aSettingId, &sharpnessValue ) ); + + upToDate = ( sharpnessSetting == sharpnessValue ); + break; + } + case ECameraSettingDigitalZoom: + { + TInt zoomSetting( 0 ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &zoomSetting ); + + TInt zoomValue( 0 ); + GetCameraSettingValueL( aSettingId, &zoomValue ); + + upToDate = ( zoomSetting == zoomValue ); + break; + } +#ifdef CAMERAAPP_CAPI_V2 + case ECameraSettingStabilization: + { + PRINT( _L("Camera <> CCamCameraController::SettingValueUpToDate ECameraSettingStabilization") ); + + TPckgBuf stabilizationSetting; + iSettingProvider.ProvideCameraSettingL( aSettingId, &stabilizationSetting ); + + TPckgBuf stabilizationValue; + GetCameraSettingValueL( aSettingId, &stabilizationValue ); + if ( stabilizationSetting().iMode != stabilizationValue().iMode || + stabilizationSetting().iEffect != stabilizationValue().iEffect || + stabilizationSetting().iComplexity != stabilizationValue().iComplexity ) + { + upToDate = EFalse; + } + break; + } + case ECameraSettingContAF: + { + TBool isContAFon( iAdvancedSettings->AutoFocusType() & + CAS::EAutoFocusTypeContinuous ); + if( IsFlagOn( iInfo.iState, ECamVideoOn ) ) + { + TBool contAF( ETrue ); + iSettingProvider.ProvideCameraSettingL( aSettingId, &contAF ); + if( contAF != isContAFon ) + { + upToDate = EFalse; + } + } + else + { + //Do nothing + + } + break; + } +#endif + default: + { + PRINT1( _L("CCamCameraController::SettingValueUpToDate - unknown setting id: %d"), aSettingId ); + } + + } + + PRINT1( _L("Camera <= CCamCameraController::SettingValueUpToDate returning %d"), upToDate ); + return upToDate; + } + + + +// --------------------------------------------------------------------------- +// CCamCameraController::SetViewfinderWindowHandle +// --------------------------------------------------------------------------- +// +void CCamCameraController::SetViewfinderWindowHandle( RWindowBase* aWindow ) + { + PRINT( _L("Camera => CCamCameraController::SetViewfinderWindowHandle") ); + PRINT2( _L("Camera <> aWindow=0x%08x iViewfinderWindow=0x%08x "), aWindow, iViewfinderWindow ); + + if ( aWindow != iViewfinderWindow && + iCamera && + iInfo.iVfState == ECamTriActive && + iInfo.iVfMode == ECamViewfinderDirect ) + { + PRINT( _L("Camera <> viewfinder active and window handle changed, restarting viewfinder...") ); + iCamera->StopViewFinder(); + iInfo.iVfState = ECamTriInactive; + + // restart viewfinder + //TRAP_IGNORE( ProcessVfStartRequestL() ); + iAppController.EnterViewfinderMode(iAppController.CurrentMode()); + } + iViewfinderWindow = aWindow; + + PRINT( _L("Camera <= CCamCameraController::SetViewfinderWindowHandle") ); + } + +// --------------------------------------------------------------------------- +// CCamCameraController::ViewfinderWindowDeleted +// --------------------------------------------------------------------------- +// +void CCamCameraController::ViewfinderWindowDeleted( RWindowBase* aWindow ) + { + PRINT( _L("Camera => CCamCameraController::ViewfinderWindowDeleted") ); + PRINT2( _L("Camera <> aWindow=0x%08x iViewfinderWindow=0x%08x "), aWindow, iViewfinderWindow ); + + if ( aWindow == iViewfinderWindow ) + { + if ( iCamera && + iInfo.iVfState == ECamTriActive && + iInfo.iVfMode == ECamViewfinderDirect ) + { + PRINT( _L("Camera <> viewfinder active and window deleted, stopping viewfinder...") ); + iCamera->StopViewFinder(); + iInfo.iVfState = ECamTriInactive; + } + iViewfinderWindow = NULL; + } + + PRINT( _L("Camera <= CCamCameraController::ViewfinderWindowDeleted") ); + } + +// --------------------------------------------------------------------------- +// CCamCameraController::SetVfWindowOrdinal +// --------------------------------------------------------------------------- +// +TInt CCamCameraController::SetVfWindowOrdinal( TInt aOrdinalPosition ) + { + TInt orgPos( KErrUnknown ); + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( iViewfinderWindow ) + { + TInt cbaPos(0); + TInt toolbarPos(0); + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + orgPos = iViewfinderWindow->OrdinalPosition(); + if ( aOrdinalPosition != KErrUnknown) + { + // Set wanted ordinal position + iViewfinderWindow->SetOrdinalPosition( aOrdinalPosition ); + } + else if ( appUi ) + { + // Find out other windows ordinal positions + if ( cba ) + { + cbaPos = cba->DrawableWindow()->OrdinalPosition(); + } + CAknToolbar* toolbar = appUi->CurrentFixedToolbar(); + if ( toolbar ) + { + RDrawableWindow* toolbarwindow = toolbar->DrawableWindow(); + if ( toolbarwindow ) + { + toolbarPos = toolbarwindow->OrdinalPosition(); + } + } + // Calculate new viewfinder position, + // just under fixed toolbar and CBA buttons + TInt newPos = Max( toolbarPos, cbaPos ) + 1; + // Use new position if viefinder window is not visible already + iViewfinderWindow->SetOrdinalPosition( Min( orgPos, newPos ) ); + } + } + return orgPos; + } + +#ifdef CAMERAAPP_CAE_ERR_SIMULATION + +// --------------------------------------------------------------------------- +// CCamCameraController::DelayedCaeCallback +// Static function called when the timer expires +// --------------------------------------------------------------------------- +// +TInt +CCamCameraController::DelayedCaeCallback( TAny* aController ) + { + CCamCameraController* self = static_cast( aController ); + self->CallAppropriateCallback(); + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CCamCameraController::CallAppropriateCallback +// Helper function to call the appropriate callback handler. +// --------------------------------------------------------------------------- +// +void +CCamCameraController::CallAppropriateCallback( const TCamCameraEventId aEventId, + TInt aStatus ) + { + PRINT2( _L("Camera => CCamCameraController::CallAppropriateCallback, event:%d, status:%d"), aEventId, aStatus ) + + switch ( iSimEventId ) + { + case ECamCameraEventVideoInit: + case ECamCameraEventVideoStart: // fallthrough + case ECamCameraEventVideoPause: // fallthrough + case ECamCameraEventVideoStop: + if( aEventId == ECamCameraEventNone ) + { + PRINT( _L("Camera <> CCamCameraController::CallAppropriateCallback - calling handler after delay") ) + HandleVideoEvent( iSimEventId, iSimStatus ); + } + else + { + PRINT( _L("Camera <> CCamCameraController::CallAppropriateCallback - calling handler without delay") ) + HandleVideoEvent( aEventId, aStatus ); + } + break; + default: + break; + } + + // In case of being called by timer, stop and destro the timer + if( aEventId == ECamCameraEventNone && iCallbackTimer ) + { + iCallbackTimer->Cancel(); + delete iCallbackTimer; + iCallbackTimer = NULL; + } + + PRINT( _L("Camera <= CCamCameraController::CallAppropriateCallback") ) + } + +#endif // CAMERAAPP_CAE_ERR_SIMULATION + +// --------------------------------------------------------------------------- +// CCamCameraController::AsyncVideoStopModeSupported +// --------------------------------------------------------------------------- +// +TBool +CCamCameraController::AsyncVideoStopModeSupported() + { + PRINT1( _L("Camera <> CCamCameraController::AsyncVideoStopModeSupported = %d "), iAsyncVideoStopModeSupported ); + return( iAsyncVideoStopModeSupported ); + } + +// --------------------------------------------------------------------------- +// IdleCallback <> +// --------------------------------------------------------------------------- +// +// static +TInt CCamCameraController::IdleCallback( TAny* aSelf ) + { + CCamCameraController* self( static_cast( aSelf ) ); + self->DoIveRecovery(); + + return EFalse; + } + +// --------------------------------------------------------------------------- +// CCamCameraController::DoIveRecovery +// --------------------------------------------------------------------------- +// +void CCamCameraController::DoIveRecovery() + { + PRINT( _L("Camera => CCamCameraController::DoIveRecovery") ) + if( iAppController.IsAppUiAvailable() + && !( iAppController.IsInShutdownMode() || iAppController.CheckExitStatus() ) ) + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + __ASSERT_DEBUG(appUi, CamPanic(ECamPanicNullPointer)); + TVwsViewId activeView; + TInt viewErr = appUi->GetActiveViewId( activeView ); + CCamViewBase* view = NULL; + if( !viewErr ) + { + view = static_cast( appUi->View( activeView.iViewUid )); + } + else + { + //There was an error when getting active view ID. Propably camera + //application went to background. In that case just return because + //camera resource should be released when going to background. + return; + } + __ASSERT_DEBUG(view, CamPanic(ECamPanicNullPointer)); + if ( appUi->StandbyStatus() && view->IsInStandbyMode() ) + { + PRINT( _L("Camera <> CCamCameraController::DoIveRecovery - Standby mode active, try to exit") ) + TRAP_IGNORE( appUi->HandleControllerEventL( ECamEventCameraChanged, + KErrNone ) ); + } + else + { + PRINT( _L("Camera <> CCamCameraController::DoIveRecovery - Start recovering from beginning") ) + if( IsFlagOn( iInfo.iBusy, ECamBusySequence|ECamBusySetting ) ) + { + if( iActive && + iActive->IsActive() ) + { + iActive->Cancel(); + } + EndSequence( KErrNone ); + } + NotifyObservers( KErrNone, ECamCameraEventIveRecover, + ECamCameraEventClassBasicControl ); + } + iIveRecoveryCount--; + iIveRecoveryOngoing = ETrue; + } + PRINT1( _L("Camera <= CCamCameraController::DoIveRecovery iIveRecoveryCount%d"),iIveRecoveryCount ) + } + +// --------------------------------------------------------------------------- +// CCamCameraController::IsWaitingIveResources +// --------------------------------------------------------------------------- +// +TBool CCamCameraController::IsWaitingIveResources() + { + return iIdle && iIdle->IsActive(); + } + + +// --------------------------------------------------------------------------- +// CCamCameraController::SetFaceTrackingL +// --------------------------------------------------------------------------- +// +void CCamCameraController::SetFaceTrackingL() + { + if( iCustomInterfaceFaceTracking && + KPrimaryCameraIndex == iInfo.iCurrentCamera ) + { + TBool ftOn( EFalse ); + iSettingProvider.ProvideCameraSettingL( ECameraSettingFacetracking, &ftOn ); + PRINT1( _L("Camera <> Set facetracking: %d"), ftOn ) + iCustomInterfaceFaceTracking->SetFaceTrackingL( ftOn ); + iCustomInterfaceFaceTracking->EnableFaceIndicatorsL( ETrue ); + DirectRequestL( ECamRequestSetAfRange ); + } + } + +// End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/camcameracontrolleractive.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/camcameracontrolleractive.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CCamCameraControllerActive class implementation. +* +* +*/ + + +#include +#include "camcameracontroller.pan" +#include "camlogging.h" +#include "camcameracontroller.h" +#include "camcameracontrolleractive.h" + +using namespace NCamCameraController; + + +// =========================================================================== +// Costructors and destructor + +// --------------------------------------------------------------------------- +// 2 phase constructor <> +// --------------------------------------------------------------------------- +// +CCamCameraControllerActive* +CCamCameraControllerActive::NewL( CCamCameraController& aController, + TInt aPriority ) + { + CCamCameraControllerActive* self = + new (ELeave) CCamCameraControllerActive( aController, aPriority ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +// --------------------------------------------------------------------------- +// Destructor <> +// --------------------------------------------------------------------------- +// +CCamCameraControllerActive::~CCamCameraControllerActive() + { + PRINT( _L("Camera => ~CCamCameraControllerActive") ); + Cancel(); + PRINT( _L("Camera <= ~CCamCameraControllerActive") ); + } + + +// --------------------------------------------------------------------------- +// 2nd phase constructor +// --------------------------------------------------------------------------- +// +void +CCamCameraControllerActive::ConstructL() + { + CActiveScheduler::Add( this ); + } + + +// --------------------------------------------------------------------------- +// 1st phase constructor +// --------------------------------------------------------------------------- +// +CCamCameraControllerActive +::CCamCameraControllerActive( CCamCameraController& aController, + TInt aPriority ) + : CActive( aPriority ), + iController( aController ) + { + } + +// =========================================================================== +// From CActive + +// --------------------------------------------------------------------------- +// DoCancel <> +// --------------------------------------------------------------------------- +// +void +CCamCameraControllerActive::DoCancel() + { + HandleError( KErrCancel ); + } + +// --------------------------------------------------------------------------- +// RunL <> +// --------------------------------------------------------------------------- +// +void +CCamCameraControllerActive::RunL() + { + PRINT( _L("Camera => CCamCameraControllerActive::RunL") ); + User::LeaveIfError( iStatus.Int() ); + + TInt more = iController.ProcessNextRequestL(); + + if( more ) + { + IssueRequest(); + } + else + { + // No more callbacks needed atleast for now. + } + PRINT( _L("Camera <= CCamCameraControllerActive::RunL") ); + } + +// --------------------------------------------------------------------------- +// RunError <> +// +// Called when leave occurs in RunL +// --------------------------------------------------------------------------- +// +TInt +CCamCameraControllerActive::RunError( TInt aError ) + { + PRINT1( _L("Camera => CCamCameraControllerActive::RunError, error:%d"), aError ); + + HandleError( aError ); + + PRINT( _L("Camera <= CCamCameraControllerActive::RunError") ); + return KErrNone; + } + +// =========================================================================== +// New methods + +// --------------------------------------------------------------------------- +// IssueRequest +// --------------------------------------------------------------------------- +// +void +CCamCameraControllerActive::IssueRequest() + { + PRINT( _L("Camera => CCamCameraControllerActive::IssueRequest") ); + + __ASSERT_ALWAYS( !IsActive(), Panic( ECamCameraControllerBusy ) ); + + // Set RunL to be called as soon as possible + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + SetActive(); + + PRINT( _L("Camera <= CCamCameraControllerActive::IssueRequest") ); + } + + +// --------------------------------------------------------------------------- +// HandleError +// --------------------------------------------------------------------------- +// +void +CCamCameraControllerActive::HandleError( TInt aStatus ) + { + iController.EndSequence( aStatus ); + } + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/camconstantsettingprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/camconstantsettingprovider.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,523 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CCamCameraControllerActive class implementation. +* +* +*/ + +#include "camcameracontrollerflags.hrh" + +#include +#ifdef CAMERAAPP_CAPI_V2 + #include // KECamFineResolutionFactor +#endif + +#include "camlogging.h" +#include "camcameracontroller.pan" +#include "camcameracontrollertypes.h" +#include "camconstantsettingprovider.h" +#include "camsettingconversion.h" +#include "CamAppController.h" +#include "campointerutility.inl" + +using namespace NCamCameraController; + +// =========================================================================== +// Local data + +static const CCamera::TFormat KImageFormat = CCamera::EFormatExif; +static const TSize KImageSize = TSize(1600,1200); // 2MPix, supported in most products +static const TInt KImageFactor = 100; + +static const CCamera::TFormat KImageFormatSecondary = CCamera::EFormatFbsBitmapColor16M; +static const TSize KImageSizeSecondary = TSize( 320,240 ); +static const TInt KImageFactorSecondary = 100; + +static const TSize KViewfinderSize = TSize(320, 240); +static const TCamViewfinderMode KViewFinderMode = ECamViewfinderBitmap; + +static const TSize KViewfinderSizeSecondary = TSize( 240, 180 ); + +static const CCamera::TFormat KSnapshotFormat = CCamera::EFormatFbsBitmapColor16M; +static const TSize KSnapshotSize = TSize(320, 240); +static const TBool KSnapshotMaintainAspect = EFalse; + +static const CCamera::TFlash KFlashSetting = CCamera::EFlashAuto; + +static const CCamera::TExposure KEvModeSetting = CCamera::EExposureAuto; +#ifdef CAMERAAPP_CAPI_V2 + static const TInt KEvValueSetting = 2; +#endif + +static const TInt KISOValue = 100; +static const CCamera::TWhiteBalance KWbModeSetting = CCamera::EWBAuto; +static const CCamera::TBrightness KBrightnessValue = CCamera::EBrightnessAuto; +static const CCamera::TContrast KContrastValue = CCamera::EContrastAuto; +static const TInt KDigitalZoomValue = 1; +static const TInt KOpticalZoomValue = 1; + +#ifdef CAMERAAPP_CAPI_V2 + static const CCamera::CCameraAdvancedSettings::TFocusRange KFocusRange = + CCamera::CCameraAdvancedSettings::EFocusRangeAuto; +#endif // CAMERAAPP_CAPI_V2 + +// ------------------------------------- +// Video by CAE settings: +// - MMS video setting, as it's the same in all products in use. +#ifdef CAMERAAPP_CAE_FOR_VIDEO + +static const TSize KVideoFrameSize = TSize(176, 144); +static const TReal KVideoFrameRate = 15.0f; +static const TInt KVideoVideoBitRate = 64000; +static const TInt KVideoAudioBitRate = 12200; +static const TBool KVideoAudioOn = ETrue; + +_LIT8( KVideoMimeType, "video/3gpp" ); +_LIT ( KVideoSupplier, "Nokia" ); +_LIT8( KVideoVideoType, "video/H263-2000" ); +_LIT8( KVideoAudioType, " AMR" ); + +#endif // CAMERAAPP_CAE_FOR_VIDEO +// ------------------------------------- + + +// =========================================================================== +// Local methods + + +// =========================================================================== +// Methods + +// static +CCamConstantSettingProvider* +CCamConstantSettingProvider::NewL( CCamAppController& aController ) + { + CCamConstantSettingProvider* self = + CCamConstantSettingProvider::NewLC( aController ); + CleanupStack::Pop( self ); + return self; + } + +// static +CCamConstantSettingProvider* +CCamConstantSettingProvider::NewLC( CCamAppController& aController ) + { + CCamConstantSettingProvider* self = + new (ELeave) CCamConstantSettingProvider( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// virtual +CCamConstantSettingProvider::~CCamConstantSettingProvider() + { + iPendingSettingChanges.Close(); + } + +// =========================================================================== +// From MCamSettingProvider + +// --------------------------------------------------------------------------- +// virtual +// --------------------------------------------------------------------------- +// +void +CCamConstantSettingProvider::ProvideCameraParamL( + const NCamCameraController::TCamCameraParamId& aParamId, + TAny* aParamData ) + { + __ASSERT_DEBUG( aParamData, Panic( ECamNullPointer ) ); + switch( aParamId ) + { + // ----------------------------------------------------------------------- + case ECameraParamImage: + { + TPckgBuf* ptr = + static_cast*>( aParamData ); + CheckNonNullL( ptr, KErrNotFound ); + TCamParamsImage& params( (*ptr)() ); + + if( ECamActiveCameraPrimary == iController.ActiveCamera() ) + { + // Primary camera parameters + params.iFormat = KImageFormat; + params.iSize = KImageSize; + params.iQualityFactor = KImageFactor; + } + else + { + // Secondary camera parameters + params.iFormat = KImageFormatSecondary; + params.iSize = KImageSizeSecondary; + params.iQualityFactor = KImageFactorSecondary; + } + + break; + } + // ----------------------------------------------------------------------- +#ifdef CAMERAAPP_CAE_FOR_VIDEO + case ECameraParamVideoCae: + { + TPckgBuf* ptr = + static_cast*>( aParamData ); + CheckNonNullL( ptr, KErrNotFound ); + + TCamParamsVideoCae& params( (*ptr)() ); + + params.iFrameSize = KVideoFrameSize; + params.iFrameRate = KVideoFrameRate; + params.iVideoBitRate = KVideoVideoBitRate; + params.iAudioBitRate = KVideoAudioBitRate; + params.iAudioOn = KVideoAudioOn; + params.iMimeType.Set ( KVideoMimeType ); + params.iSupplier.Set ( KVideoSupplier ); + params.iVideoType.Set( KVideoVideoType ); + params.iAudioType.Set( KVideoAudioType ); + + break; + } +#endif // CAMERAAPP_CAE_FOR_VIDEO + // ----------------------------------------------------------------------- + case ECameraParamVfMode: + { + TPckgBuf* ptr = + static_cast*>( aParamData ); + CheckNonNullL( ptr, KErrNotFound ); + TCamViewfinderMode& params( (*ptr)() ); + params = KViewFinderMode; + break; + } + // ----------------------------------------------------------------------- + case ECameraParamSnapshot: + { + TPckgBuf* ptr = + static_cast*>( aParamData ); + CheckNonNullL( ptr, KErrNotFound ); + TCamParamsSnapshot& params( (*ptr)() ); + + params.iSize = KSnapshotSize; + params.iFormat = KSnapshotFormat; + params.iMaintainAspect = KSnapshotMaintainAspect; + break; + } + // ----------------------------------------------------------------------- + default: + { + User::Leave( KErrNotSupported ); + break; + } + // ----------------------------------------------------------------------- + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamConstantSettingProvider::ProvideCameraSettingL( + const NCamCameraController::TCamCameraSettingId& aSettingId, + TAny* aSettingData ) + { + switch( aSettingId ) + { + case ECameraSettingQualityFactor: + { + TInt* ptr = static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = KImageFactor; + break; + } + case ECameraSettingFlash: + { + CCamera::TFlash* ptr = + static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = KFlashSetting; + break; + } + case ECameraSettingExposure: + { + TPckgBuf* ptr = + static_cast*>( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + + TCamSettingDataExposure& evData( (*ptr)() ); + evData.iExposureMode = KEvModeSetting; +#ifdef CAMERAAPP_CAPI_V2 + evData.iExposureStep = KEvValueSetting * KECamFineResolutionFactor; +#else + evData.iExposureStep = 0; +#endif + break; + } + case ECameraSettingLightSensitivity: + { + TInt* ptr = static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = KISOValue; + break; + } + case ECameraSettingWhiteBalance: + { + TPckgBuf* ptr = + static_cast*>( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + + TCamSettingDataWhiteBalance& wbData( (*ptr)() ); + wbData.iWhiteBalanceMode = KWbModeSetting; + break; + } + case ECameraSettingBrightness: + { + CCamera::TBrightness* ptr = + static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = KBrightnessValue; + break; + } + case ECameraSettingContrast: + { + CCamera::TContrast* ptr = + static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = KContrastValue; + break; + } + case ECameraSettingDigitalZoom: + { + TInt* ptr = static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = KDigitalZoomValue; + break; + } + case ECameraSettingOpticalZoom: + { + TInt* ptr = static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = KOpticalZoomValue; + break; + } + +#ifdef CAMERAAPP_CAPI_V2 + case ECameraSettingFocusRange: + { + CCamera::CCameraAdvancedSettings::TFocusRange* ptr = + static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = KFocusRange; + break; + } +#endif // CAMERAAPP_CAPI_V2 + case ECameraSettingAudioMute: + { + TBool* ptr = static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = EFalse; + break; + } + case ECameraSettingContAF: + { + TBool* ptr = static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = ETrue; + break; + } + case ECameraSettingFileMaxSize: + { + TInt* ptr = static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = 0; // not limited + break; + } + case ECameraSettingFileName: + { + TPtr* ptr = static_cast( aSettingData ); + CheckNonNullL( ptr, KErrNotFound ); + *ptr = iController.CurrentFullFileName(); + break; + } + default: + { + User::Leave( KErrNotSupported ); + break; + } + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamConstantSettingProvider::ProvidePendingSettingChangesL( + RArray& aSettingIds ) + { + PRINT( _L("Camera => CCamConstantSettingProvider::ProvidePendingSettingChangesL") ); + aSettingIds.Reset(); + aSettingIds.ReserveL( iPendingSettingChanges.Count() ); + for( TInt i = 0; i < iPendingSettingChanges.Count(); i++ ) + { + aSettingIds.AppendL( iPendingSettingChanges[i] ); + } + PRINT1( _L("Camera <> %d settings changed"), aSettingIds.Count() ); + + + // Update: Reset only when asked. Enables retries. + // iPendingSettingChanges.Reset(); + PRINT( _L("Camera <= CCamConstantSettingProvider::ProvidePendingSettingChangesL") ); + } + + +// --------------------------------------------------------------------------- +// PendingSettingChangeCount +// --------------------------------------------------------------------------- +// +TInt +CCamConstantSettingProvider::PendingSettingChangeCount() const + { + return iPendingSettingChanges.Count(); + } + + +// =========================================================================== +// From MCamSettingsModelObserver +/* +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamConstantSettingProvider::IntegerSettingChangedL( + TCamSettingItemIds aSettingItem, + TInt// aSettingValue + ) + { + TCamCameraIntSettingId cameraId = + Map2CameraControllerSettingId( aSettingItem ); + + if( ECameraSettingNone != cameraId + && KErrNotFound == iPendingSettingChanges.Find( cameraId ) ) + { + iPendingSettingChanges.AppendL( cameraId ) + } + } + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamConstantSettingProvider::TextSettingChangedL( + TCamSettingItemIds aSettingItem, + const TDesC&// aSettingValue + ) + { + TCamCameraIntSettingId cameraId = + Map2CameraControllerSettingId( aSettingIds[i] ); + + if( ECameraSettingNone != cameraId ) + { + iPendingSettingChanges.Append( cameraId ) + } + } +*/ +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamConstantSettingProvider::Reset() + { + iPendingSettingChanges.Reset(); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamConstantSettingProvider +::AddPendingSettingChangesL( const RArray& aUiSettingIds ) + { + iPendingSettingChanges.ReserveL( aUiSettingIds.Count() + + iPendingSettingChanges.Count() ); + + for( TInt i = 0; i < aUiSettingIds.Count(); i++ ) + { + AddPendingSettingChangeL( aUiSettingIds[i] ); + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamConstantSettingProvider +::AddPendingSettingChangeL( TCamSettingItemIds aUiSettingId ) + { + TCamCameraSettingId cameraId = + CCamSettingConversion::Map2CameraControllerSettingId( aUiSettingId ); + + // Add each setting only once + if( ECameraSettingNone != cameraId + && KErrNotFound == iPendingSettingChanges.Find( cameraId ) ) + { + iPendingSettingChanges.AppendL( cameraId ); + } + } + +// --------------------------------------------------------------------------- +// SetSupportedISORatesL +// +// --------------------------------------------------------------------------- +// +void +CCamConstantSettingProvider::SetSupportedISORatesL( const RArray& aSupportedIsoRates ) + { + iSupportedISORates = aSupportedIsoRates; + if ( iSupportedISORates.Count() != 0 ) + { + iValidISORates = ETrue; + } + } + +// =========================================================================== +// private + + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamConstantSettingProvider::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamConstantSettingProvider +::CCamConstantSettingProvider( CCamAppController& aController ) + : iController( aController ), + iPendingSettingChanges() + { + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/camflashsimulator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/camflashsimulator.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,206 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Simulator for flash recharging +* +*/ + + + +// =========================================================================== +// Includes +#include // TECAMEvent +#include // ECam event ids + +#include "camlogging.h" +#include "camcameracontroller.h" +#include "camflashsimulator.h" + + +// =========================================================================== +// Local constants +static const TUint KEventInterest = ECamCameraEventClassNone + | ECamCameraEventClassImage; + + +// =========================================================================== +// Methods + +// --------------------------------------------------------------------------- +// CCamFlashSimulator::CCamFlashSimulator +// --------------------------------------------------------------------------- +// +CCamFlashSimulator::CCamFlashSimulator( CCamCameraController& aController ) + : iController ( aController ), + iError ( KErrNone ), + iFlashRequired( EFalse ), + iFlashReady ( ETrue ) + { + } + +// --------------------------------------------------------------------------- +// CCamFlashSimulator::~CCamFlashSimulator +// --------------------------------------------------------------------------- +// +CCamFlashSimulator::~CCamFlashSimulator() + { + iController.DetachObserver( this ); + + if( iRechargeTimer ) + { + iRechargeTimer->Cancel(); + delete iRechargeTimer; + } + // DeleteProperty(); + } + + +// --------------------------------------------------------------------------- +// CCamFlashSimulator::NewL +// --------------------------------------------------------------------------- +// +CCamFlashSimulator* +CCamFlashSimulator::NewL( CCamCameraController& aController ) + { + CCamFlashSimulator* self = + new (ELeave) CCamFlashSimulator( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + return self; + } + +// --------------------------------------------------------------------------- +// CCamFlashSimulator::ConstructL +// --------------------------------------------------------------------------- +// +void +CCamFlashSimulator::ConstructL() + { + iRechargeTimer = CPeriodic::NewL( EPriorityNormal ); + + iController.AttachObserverL( this, KEventInterest ); + } + + +// --------------------------------------------------------------------------- +// HandleCameraEventL <> +// --------------------------------------------------------------------------- +// +void +CCamFlashSimulator::HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData /*=NULL*/ ) + { + switch( aEventId ) + { + case ECamCameraEventImageInit : + { + StartRecharging(); + break; + } + + default : + { + break; + } + } + } + + +// --------------------------------------------------------------------------- +// CCamFlashSimulator::SetFlashRequired +// --------------------------------------------------------------------------- +// +void +CCamFlashSimulator::SetFlashRequired( TBool aFlashRequired ) + { + iFlashRequired = aFlashRequired; + } + +// --------------------------------------------------------------------------- +// CCamFlashSimulator::SetFlashError +// --------------------------------------------------------------------------- +// +void +CCamFlashSimulator::SetFlashError( TBool aFlashError ) + { + iError = aFlashError; + } + + +// --------------------------------------------------------------------------- +// CCamFlashSimulator::StartRecharging +// --------------------------------------------------------------------------- +// +void +CCamFlashSimulator::StartRecharging( TBool aError ) + { + if( iRechargeTimer ) + { + // Empty the flash, and publish the property value + iFlashReady = EFalse; + + // The possible error shall be published when the recharging is done + iError = aError; + + // Start recharging timer + iRechargeTimer->Cancel(); + iRechargeTimer->Start( KSimulatedChargingTime, + KMaxTInt32, + TCallBack( RechargeTimerCallback, this ) ); + + // Send "flash not ready" event to Camera Controller + NotifyController(); + } + } + + +// --------------------------------------------------------------------------- +// NotifyController +// --------------------------------------------------------------------------- +// +void +CCamFlashSimulator::NotifyController() + { + PRINT2( _L("Camera => CCamFlashSimulator::NotifyController, flash ready:%d, status:%d"), iFlashReady, iError ) + + const TUid eventId( iFlashReady + ? KUidECamEventFlashReady + : KUidECamEventFlashNotReady ); + const TECAMEvent event( eventId, iError ); + + iController.HandleEvent( event ); + + PRINT ( _L("Camera <= CCamFlashSimulator::NotifyController") ); + } + +// --------------------------------------------------------------------------- +// CCamFlashSimulator::RechargeTimerCallback +// --------------------------------------------------------------------------- +// +TInt +CCamFlashSimulator::RechargeTimerCallback( TAny* aSelf ) + { + CCamFlashSimulator* self = static_cast( aSelf ); + if( self ) + { + self->iRechargeTimer->Cancel(); + // Set the flash to ready state and publish value + self->iFlashReady = ETrue; + + // Send "flash ready" event to Camera Controller + self->NotifyController(); + } + return KErrNone; + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/camimagedecoder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/camimagedecoder.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,344 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Camera image decoder +* +*/ + + + + +#include +#include +#include // MCameraBuffer + +#include + +#include "camlogging.h" +#include "camfilesaveutility.h" +#include "cambuffershare.h" + +#include "camimagedecoder.h" + +// =========================================================================== +// Local constants + +namespace NCamCameraController + { + // Decoding flags + static const TUint32 KConversionOptions = + ( CImageDecoder::EOptionNone + | CImageDecoder::EOptionAlwaysThread + | CImageDecoder::EPreferFastDecode + ); + + // EXIF reader flags + // Only need the thumbnail, so no need to parse the + // main (jpeg) image. + static const TUint KExifReaderFlags = CExifRead::ENoJpeg; + + // Other constants + static const TInt KMaxRetries = 10; + static const TInt KPriority = CActive::EPriorityHigh; + } + +using namespace NCamCameraController; + +// =========================================================================== +// public constructor and destructor + +CCamImageDecoder* +CCamImageDecoder::NewL( MCamImageDecoderObserver& aObserver ) + { + CCamImageDecoder* self = + new (ELeave) CCamImageDecoder( aObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + + +CCamImageDecoder::~CCamImageDecoder() + { + PRINT( _L("Camera => ~CCamImageDecoder") ); + Cancel(); + + delete iDecoder; + + SetImageData( NULL ); + if(iDecodedBitmap) + { + delete iDecodedBitmap; + iDecodedBitmap = NULL; + } + iFs.Close(); + PRINT( _L("Camera <= ~CCamImageDecoder") ); + } + +// =========================================================================== +// public methods +void +CCamImageDecoder::StartConversionL( CCamBufferShare* aBuffer ) + { + PRINT( _L("Camera => CCamImageDecoder::StartConversionL") ); + + // Data for CImageDecoder must be available throughout the conversion. + // Need to stop any outstanding operation before deleting the descriptor. + Cancel(); + + PRINT( _L("Camera <> CCamImageDecoder: Copying image data..") ); + + SetImageData( aBuffer ); + + // GetImageDataL leaves if no data available. + TDesC8* imageData = GetImageDataL(); + + PRINT( _L("Camera <> CCamImageDecoder: Creating decoder..") ); + + delete iDecoder; + iDecoder = NULL; + iDecoder = CImageDecoder::DataNewL( iFs, *imageData, (CImageDecoder::TOptions)KConversionOptions ); + + if( iDecoder->FrameCount() > 0 ) + { + const TFrameInfo& info( iDecoder->FrameInfo() ); + +#ifdef _DEBUG + TSize size = info.iOverallSizeInPixels; + PRINT2( _L("Camera <> CCamImageDecoder: Bmp size(%d,%d)"), size.iWidth, size.iHeight ); + PRINT1( _L("Camera <> CCamImageDecoder: Bmp dispmode(%d)"), info.iFrameDisplayMode ); +#endif + + PRINT( _L("Camera <> CCamImageDecoder: Create bitmap for snapshot..") ); + if( !iDecodedBitmap ) iDecodedBitmap = new (ELeave) CFbsBitmap; + else iDecodedBitmap->Reset(); + + TInt createError = iDecodedBitmap->Create( info.iOverallSizeInPixels, + info.iFrameDisplayMode ); + if( KErrNone != createError ) + { + delete iDecodedBitmap; + iDecodedBitmap = NULL; + User::Leave( createError ); + } + + PRINT( _L("Camera <> CCamImageDecoder: start conversion..") ); + iRetryCounter = 0; + iDecoder->Convert( &iStatus, *iDecodedBitmap, 0 ); + SetActive(); + } + else + { + PRINT( _L("Camera <> CCamImageDecoder: No frame provided, leave..") ); + User::Leave( KErrNotFound ); + } + + PRINT( _L("Camera <= CCamImageDecoder::StartConversionL") ); + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TDesC8* +CCamImageDecoder::GetImageDataL() + { + PRINT( _L("Camera => CCamImageDecoder::GetImageDataL") ); + + if( !iSharedImageData || + !iSharedImageData->SharedBuffer() ) + { + User::Leave( KErrNotFound ); + } + + TDesC8* data = iSharedImageData->SharedBuffer()->DataL( 0 ); + + if( !data ) + User::Leave( KErrNotFound ); + + delete iThumbnailData; + iThumbnailData = ReadExifThumbNail( *data ); // Returns NULL on errors + +#ifdef CAMERAAPP_CREATE_TESTIMAGE + TRAPD( saveStatus1, SaveImageDataToFileL( *data, _L("testimagefull.jpg") ) ); + PRINT1( _L("Camera <> CCamImageDecoder: Save full image to file status:%d"), saveStatus1 ); + if( iThumbnailData ) + { + TRAPD( saveStatus2, SaveImageDataToFileL( *iThumbnailData, _L("testimagethumb.jpg") ) ); + PRINT1( _L("Camera <> CCamImageDecoder: Save thumbnail to file status:%d"), saveStatus2 ); + } +#endif + + + if( iThumbnailData ) + { + data = iThumbnailData; + } + + PRINT1( _L("Camera <= CCamImageDecoder::GetImageDataL, data size:%d"), data->Size() ); + return data; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +HBufC8* +CCamImageDecoder::ReadExifThumbNail( const TDesC8& aExifData ) + { + PRINT( _L("Camera => CCamImageDecoder::ReadExifThumbNailL") ); + HBufC8* thumb = NULL; + TRAP_IGNORE( + { + CExifRead* reader = CExifRead::NewL( aExifData, KExifReaderFlags ); + CleanupStack::PushL( reader ); + thumb = reader->GetThumbnailL(); + CleanupStack::PopAndDestroy( reader ); + }); + + PRINT( _L("Camera <= CCamImageDecoder::ReadExifThumbNailL") ); + return thumb; + } + +// =========================================================================== +// from CActive + +// --------------------------------------------------------------------------- +// virtual +// --------------------------------------------------------------------------- +// +void +CCamImageDecoder::DoCancel() + { + PRINT( _L("Camera => CCamImageDecoder::DoCancel") ); + + if( iDecoder ) + { + iDecoder->Cancel(); + delete iDecoder; + iDecoder = NULL; + } + + SetImageData( NULL ); + + PRINT( _L("Camera <= CCamImageDecoder::DoCancel") ); + } + + +// --------------------------------------------------------------------------- +// virtual +// --------------------------------------------------------------------------- +// +void +CCamImageDecoder::RunL() + { + PRINT1( _L("Camera => CCamImageDecoder::RunL, iStatus:%d"), iStatus.Int() ); + + switch( iStatus.Int() ) + { + case KErrNone : + { + // CImageDecoder has finished using the data, + // so we are able to free it. + SetImageData( NULL ); + iObserver.ImageDecoded( iStatus.Int(), iDecodedBitmap ); + break; + } + case KErrUnderflow : + { + // Decoder did not have enough data to convert. + // CImageDecoder documentation recommends calling + // repeatedly ContinueConvert. + if( iRetryCounter++ < KMaxRetries ) + { + iStatus = KErrNone; + iDecoder->ContinueConvert( &iStatus ); + SetActive(); + } + else + { + // Handled in RunError + User::Leave( KErrUnderflow ); + } + break; + } + case KErrCancel : + default : + { + User::Leave( iStatus.Int() ); + break; + } + } + + PRINT( _L("Camera <= CCamImageDecoder::RunL") ); + } + + +// --------------------------------------------------------------------------- +// virtual +// --------------------------------------------------------------------------- +// +TInt +CCamImageDecoder::RunError( TInt aError ) + { + PRINT1( _L("Camera => CCamImageDecoder::RunError(%d)"), aError ); + + SetImageData( NULL ); + // Leave has occurred in RunL. + // Notify observer with error. + iObserver.ImageDecoded( aError, NULL ); + + PRINT( _L("Camera <= CCamImageDecoder::RunError") ); + return KErrNone; + } + + +// =========================================================================== +void +CCamImageDecoder::SetImageData( CCamBufferShare* aBuffer ) + { + if( iSharedImageData ) + { + iSharedImageData->Release(); + iSharedImageData = NULL; + } + + iSharedImageData = aBuffer; + + if( iSharedImageData ) + iSharedImageData->Reserve(); + } + +// =========================================================================== +// private constructors + + +void +CCamImageDecoder::ConstructL() + { + User::LeaveIfError( iFs.Connect() ); + + CActiveScheduler::Add( this ); + } + + + +CCamImageDecoder::CCamImageDecoder( MCamImageDecoderObserver& aObserver ) + : CActive( KPriority ), + iObserver( aObserver ) + { + } + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/camimageencoder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/camimageencoder.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,279 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Camera image encoder +* +*/ + + + + +#include +#include +#include // MCameraBuffer + +#include + +#include "camlogging.h" +#include "camfilesaveutility.h" +#include "cambuffershare.h" + +#include "camimageencoder.h" + +// =========================================================================== +// Local constants + +// Encoding flags +static const CImageEncoder::TOptions KConversionOptions = + CImageEncoder::EOptionAlwaysThread; + +// Other constants +static const TInt KImageIndex = 0; +static const TInt KPriority = CActive::EPriorityHigh; + +_LIT8( KMimeTypeDesc8, "image/jpeg" ); + + +// =========================================================================== +// public constructor and destructor + +// --------------------------------------------------------------------------- +// 2-phase constructor +// --------------------------------------------------------------------------- +// +CCamImageEncoder* +CCamImageEncoder::NewL( MCamImageEncoderObserver& aObserver ) + { + CCamImageEncoder* self = + new (ELeave) CCamImageEncoder( aObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CCamImageEncoder::~CCamImageEncoder() + { + PRINT( _L("Camera => ~CCamImageEncoder") ); + Cancel(); + + ReleaseEncoder(); + SetInputBuffer( NULL ); + + PRINT( _L("Camera <= ~CCamImageEncoder") ); + } + +// =========================================================================== +// public methods + +// --------------------------------------------------------------------------- +// StartConversionL +// --------------------------------------------------------------------------- +// +void +CCamImageEncoder::StartConversionL( CCamBufferShare* aBuffer ) + { + PRINT( _L("Camera => CCamImageEncoder::StartConversionL") ); + + // Cancel any previous action + Cancel(); + + ReleaseEncoder(); + + if( aBuffer + && aBuffer->SharedBuffer() ) + { + // Store the bitmap data. + // Need to release old buffer and reserve given one. + SetInputBuffer( aBuffer ); + + PRINT( _L("Camera <> CCamImageEncoder: Creating encoder..") ); + iEncoder = CImageEncoder::DataNewL( iEncodedData, + KMimeTypeDesc8(), + KConversionOptions ); + + PRINT( _L("Camera <> CCamImageEncoder: get source bitmap..") ); + MCameraBuffer* buffer( iSharedInput->SharedBuffer() ); + CFbsBitmap& bitmap( buffer->BitmapL( KImageIndex ) ); + + + PRINT( _L("Camera <> CCamImageEncoder: start conversion..") ); + iEncoder->Convert( &iStatus, bitmap ); + SetActive(); + } + else + { + PRINT( _L("Camera <> CCamImageEncoder: No bitmap provided, leave..") ); + User::Leave( KErrNotFound ); + } + + PRINT( _L("Camera <= CCamImageEncoder::StartConversionL") ); + } + + +// =========================================================================== +// from CActive + +// --------------------------------------------------------------------------- +// virtual DoCancel +// --------------------------------------------------------------------------- +// +void +CCamImageEncoder::DoCancel() + { + PRINT( _L("Camera => CCamImageEncoder::DoCancel") ); + + if( iEncoder ) + { + iEncoder->Cancel(); + } + + ReleaseEncoder(); + SetInputBuffer( NULL ); + + PRINT( _L("Camera <= CCamImageEncoder::DoCancel") ); + } + + +// --------------------------------------------------------------------------- +// virtual RunL +// --------------------------------------------------------------------------- +// +void +CCamImageEncoder::RunL() + { + PRINT1( _L("Camera => CCamImageEncoder::RunL, iStatus:%d"), iStatus.Int() ); + + switch( iStatus.Int() ) + { + case KErrNone : + { + SetInputBuffer( NULL ); + + // Notify observer + NotifyObserver( KErrNone ); + + // Source data and encoder not needed anymore + ReleaseEncoder(); + + break; + } + case KErrCancel : + default : + { + User::Leave( iStatus.Int() ); + break; + } + } + + PRINT( _L("Camera <= CCamImageEncoder::RunL") ); + } + + +// --------------------------------------------------------------------------- +// virtual RunError +// --------------------------------------------------------------------------- +// +TInt +CCamImageEncoder::RunError( TInt aError ) + { + PRINT1( _L("Camera <= CCamImageEncoder::RunError(%d)"), aError ); + + ReleaseEncoder(); + SetInputBuffer( NULL ); + + // Leave has occurred in RunL. + // Notify observer with error and NULL data. + NotifyObserver( aError ); + + PRINT( _L("Camera <= CCamImageEncoder::RunError") ); + return KErrNone; + } + + +// =========================================================================== +// Private methods + +// --------------------------------------------------------------------------- +// SetInputBuffer +// --------------------------------------------------------------------------- +// +void +CCamImageEncoder::SetInputBuffer( CCamBufferShare* aBuffer ) + { + if( iSharedInput ) + { + iSharedInput->Release(); + iSharedInput = NULL; + } + + iSharedInput = aBuffer; + + if( iSharedInput ) + { + iSharedInput->Reserve(); + } + } + +void +CCamImageEncoder::ReleaseEncoder() + { + delete iEncoder; + iEncoder = NULL; + + delete iEncodedData; + iEncodedData = NULL; + } + + +// --------------------------------------------------------------------------- +// NotifyObservers +// --------------------------------------------------------------------------- +// +void +CCamImageEncoder::NotifyObserver( TInt aStatus ) + { + iObserver.ImageEncoded( aStatus, iEncodedData ); + iEncodedData = NULL; // Ownership to observer + } + +// =========================================================================== +// private constructors + +// --------------------------------------------------------------------------- +// 2nd phase constructor +// --------------------------------------------------------------------------- +// +void +CCamImageEncoder::ConstructL() + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// 1st phase constructor +// --------------------------------------------------------------------------- +// +CCamImageEncoder::CCamImageEncoder( MCamImageEncoderObserver& aObserver ) + : CActive ( KPriority ), + iObserver( aObserver ) + { + } + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/camsettingconversion.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/camsettingconversion.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,401 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting conversion utility class implementation +* +*/ + + +// =========================================================================== +// Includes +#include "camcameracontrollerflags.hrh" // Keep first + +#include +#ifdef CAMERAAPP_CAPI_V2_ADV + #include +#endif +#include "camcameracontroller.pan" +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "camcameracontrollersettings.h" +#include "camsettingconversion.h" + + +using namespace NCamCameraController; + +// =========================================================================== +// Class methods + +// --------------------------------------------------------------------------- +// Map2CameraWb +// --------------------------------------------------------------------------- +// +CCamera::TWhiteBalance +CCamSettingConversion::Map2CameraWb( const TCamWhiteBalanceId& aWbId ) + { + CCamera::TWhiteBalance wb( CCamera::EWBAuto ); + switch( aWbId ) + { + case ECamWhiteBalanceAWB: wb = CCamera::EWBAuto; break; + case ECamWhiteBalanceDaylight: wb = CCamera::EWBDaylight; break; + case ECamWhiteBalanceCloudy: wb = CCamera::EWBCloudy; break; + case ECamWhiteBalanceTungsten: wb = CCamera::EWBTungsten; break; + case ECamWhiteBalanceFlourescent: wb = CCamera::EWBFluorescent; break; +/* + case ECamWhiteBalanceFlash: wb = CCamera::EWBFlash; break; + case ECamWhiteBalanceSnow: wb = CCamera::EWBSnow; break; + case ECamWhiteBalanceBeach: wb = CCamera::EWBBeach; break; + case ECamWhiteBalanceManual: wb = CCamera::EWBManual; break; + case ECamWhiteBalanceShade: wb = CCamera::EWBShade; break; +*/ + default: + break; + } + return wb; + } + +// --------------------------------------------------------------------------- +// Map2CameraFlash +// --------------------------------------------------------------------------- +// +CCamera::TFlash +CCamSettingConversion::Map2CameraFlash( const TCamFlashId& aFlashId ) + { + CCamera::TFlash flash( CCamera::EFlashAuto ); + switch ( aFlashId ) + { + case ECamFlashAuto: flash = CCamera::EFlashAuto; break; + case ECamFlashAntiRedEye: flash = CCamera::EFlashRedEyeReduce; break; + case ECamFlashForced: flash = CCamera::EFlashForced; break; + case ECamFlashOff: flash = CCamera::EFlashNone; break; +/* + case ECamFlashFill: flash = CCamera::EFlashFillIn; break; + case ECamFlashSlowFront: flash = CCamera::EFlashSlowFrontSync; break; + case ECamFlashSlowRear: flash = CCamera::EFlashSlowRearSync; break; + case ECamFlashManual: flash = CCamera::EFlashManual; break; +*/ + default: + break; + } + return flash; + } + + +// --------------------------------------------------------------------------- +// Map2FlashId +// --------------------------------------------------------------------------- +// +TCamFlashId +CCamSettingConversion::Map2FlashId( const CCamera::TFlash& aCameraFlash ) + { + TCamFlashId flashId( ECamFlashAuto ); + + switch( aCameraFlash ) + { + case CCamera::EFlashAuto: flashId = ECamFlashAuto; break; + case CCamera::EFlashRedEyeReduce: flashId = ECamFlashAntiRedEye; break; + case CCamera::EFlashForced: flashId = ECamFlashForced; break; + case CCamera::EFlashNone: flashId = ECamFlashOff; break; + default: + break; + } + + return flashId; + } + + + + +// --------------------------------------------------------------------------- +// Map2CameraFormat +// --------------------------------------------------------------------------- +// +CCamera::TFormat +CCamSettingConversion::Map2CameraFormat( const TDisplayMode& aDisplayMode ) + { + CCamera::TFormat format( CCamera::EFormatFbsBitmapColor16M ); + switch ( aDisplayMode ) + { + case EColor16MA: format = CCamera::EFormatFbsBitmapColor16MU; break; + case EColor16MU: format = CCamera::EFormatFbsBitmapColor16MU; break; + case EColor4K: format = CCamera::EFormatFbsBitmapColor4K; break; + case EColor16M: format = CCamera::EFormatFbsBitmapColor16M; break; + case EColor64K: format = CCamera::EFormatFbsBitmapColor64K; break; + //case EColor256: format = CCamera:: break; + //case EColor16: format = CCamera:: break; + //case EGray256: format = CCamera:: break; + //case EGray16: format = CCamera:: break; + //case EGray4: format = CCamera:: break; + //case EGray2: format = CCamera:: break; + default: break; + } + return format; + } + + +// --------------------------------------------------------------------------- +// Map2CameraExposureMode +// --------------------------------------------------------------------------- +// +CCamera::TExposure +CCamSettingConversion::Map2CameraExposureMode( const TCamSceneAEMode& aExpModeId ) + { + CCamera::TExposure expo( CCamera::EExposureAuto ); + + switch ( aExpModeId ) + { + case ECamSceneAEModeAuto: expo = CCamera::EExposureAuto; break; + case ECamSceneAEModeNight: expo = CCamera::EExposureNight; break; + case ECamSceneAEModeBacklight: expo = CCamera::EExposureBacklight; break; + case ECamSceneAEModeCenter: expo = CCamera::EExposureCenter; break; + case ECamSceneAEModeSports: expo = CCamera::EExposureSport; break; + default: + break; + } + + return expo; + } + + + + +#ifdef CAMERAAPP_CAPI_V2_IP +// --------------------------------------------------------------------------- +// Map2CameraEffect +// --------------------------------------------------------------------------- +// +CCamera::CCameraImageProcessing::TEffect +CCamSettingConversion::Map2CameraEffect( const TCamColourFilterId& aColourFilterId ) + { + CCamera::CCameraImageProcessing::TEffect effect( + CCamera::CCameraImageProcessing::EEffectNone ); + + switch( aColourFilterId ) + { + case ECamColourFilterColour: effect = CCamera::CCameraImageProcessing::EEffectNone; break; + case ECamColourFilterBlackAndWhite: effect = CCamera::CCameraImageProcessing::EEffectMonochrome; break; + case ECamColourFilterSepia: effect = CCamera::CCameraImageProcessing::EEffectSepia; break; + case ECamColourFilterNegative: effect = CCamera::CCameraImageProcessing::EEffectNegative; break; + case ECamColourFilterVivid: effect = CCamera::CCameraImageProcessing::EEffectVivid; break; + default: + break; + } + return effect; + } +#endif + + +// --------------------------------------------------------------------------- +// Map2CameraControllerSettingId +// --------------------------------------------------------------------------- +// +TCamCameraSettingId +CCamSettingConversion +::Map2CameraControllerSettingId( const TCamSettingItemIds& aUiSettingId ) + { + switch( aUiSettingId ) + { + // ------------------------------- + case ECamSettingItemPhotoDigitalZoom: + case ECamSettingItemVideoDigitalZoom: return ECameraSettingDigitalZoom; + // ------------------------------- + case ECamSettingItemPhotoCompression: return ECameraSettingQualityFactor; + // ------------------------------- + case ECamSettingItemDynamicPhotoExposure: + case ECamSettingItemDynamicVideoExposure: return ECameraSettingExposure; + // ------------------------------- + case ECamSettingItemUserSceneExposure: return ECameraUserSceneSettingExposure; + // ------------------------------- + case ECamSettingItemDynamicPhotoWhiteBalance: + case ECamSettingItemDynamicVideoWhiteBalance: return ECameraSettingWhiteBalance; + // ------------------------------- + case ECamSettingItemUserSceneWhitebalance: return ECameraUserSceneSettingWhiteBalance; + // ------------------------------- + case ECamSettingItemDynamicPhotoLightSensitivity: + case ECamSettingItemDynamicVideoLightSensitivity: return ECameraSettingLightSensitivity; + // ------------------------------- + case ECamSettingItemUserSceneLightSensitivity: return ECameraUserSceneSettingLightSensitivity; + // ------------------------------- + case ECamSettingItemFaceTracking: return ECameraSettingFacetracking; + // ------------------------------- + case ECamSettingItemDynamicPhotoFlash: + case ECamSettingItemDynamicVideoFlash: return ECameraSettingFlash; + // ------------------------------- + case ECamSettingItemUserSceneFlash: return ECameraUserSceneSettingFlash; + // ------------------------------- + case ECamSettingItemDynamicPhotoBrightness: + case ECamSettingItemDynamicVideoBrightness: return ECameraSettingBrightness; + // ------------------------------- + case ECamSettingItemUserSceneBrightness: return ECameraUserSceneSettingBrightness; + // ------------------------------- + case ECamSettingItemDynamicPhotoContrast: + case ECamSettingItemDynamicVideoContrast: return ECameraSettingContrast; + // ------------------------------- + case ECamSettingItemUserSceneContrast: return ECameraUserSceneSettingContrast; + // ------------------------------- + case ECamSettingItemDynamicPhotoImageSharpness: return ECameraSettingSharpness; + /* no video sharpness setting item available */ + case ECamSettingItemUserSceneImageSharpness: return ECameraUserSceneSettingSharpness; + // ------------------------------- + case ECamSettingItemDynamicPhotoColourFilter: + case ECamSettingItemDynamicVideoColourFilter: return ECameraSettingColourEffect; + // ------------------------------- + case ECamSettingItemUserSceneColourFilter: return ECameraUserSceneSettingColourEffect; + // ------------------------------- + case ECamSettingItemVideoAudioRec: return ECameraSettingAudioMute; + // ------------------------------- + case ECamSettingItemContinuousAutofocus: return ECameraSettingContAF; + // ------------------------------- + case ECamSettingItemVideoClipLength: return ECameraSettingFileMaxSize; + // ------------------------------- + case ECamSettingItemVideoNameBase: + case ECamSettingItemVideoNameBaseType: + case ECamSettingItemVideoNumber: return ECameraSettingFileName; + // ------------------------------- + case ECamSettingItemVideoStab: return ECameraSettingStabilization; + case ECamSettingItemFlickerCancel: return ECameraSettingFlickerCancel; + // ------------------------------- + // Not supported + case ECamSettingItemDynamicSelfTimer: + case ECamSettingItemDynamicPhotoColourSaturation: + case ECamSettingItemDynamicVideoColourSaturation: + case ECamSettingItemUserSceneColourSaturation: + default: return ECameraSettingNone; + // ------------------------------- + } + } + + +#if defined( CAMERAAPP_CAPI_V2_ADV ) || defined( CAMERAAPP_CAPI_V2_IP ) +// --------------------------------------------------------------------------- +// MapCameraSetting2EventUidValue +// --------------------------------------------------------------------------- +// +TInt +CCamSettingConversion::Map2EventUidValue( const TCamCameraSettingId& aSettingId ) + { + TInt uid( 0 ); + + switch( aSettingId ) + { + case ECameraSettingFlash: uid = KUidECamEventCameraSettingFlashModeUidValue; break; + case ECameraSettingExposure: uid = KUidECamEventCameraSettingExposureCompensationStepUidValue; break; + case ECameraSettingLightSensitivity: uid = KUidECamEventCameraSettingIsoRateTypeUidValue; break; + case ECameraSettingWhiteBalance: uid = KUidECamEventCameraSettingWhiteBalanceModeUidValue; break; + case ECameraSettingColourEffect: uid = KUidECamEventImageProcessingEffectUidValue; break; + case ECameraSettingSharpness: uid = KUidECamEventImageProcessingAdjustSharpnessUidValue; break; + + case ECameraSettingDigitalZoom: uid = KUidECamEventCameraSettingDigitalZoomUidValue; break; + case ECameraSettingOpticalZoom: uid = KUidECamEventCameraSettingOpticalZoomUidValue; break; + + case ECameraSettingFocusRange: uid = KUidECamEventCameraSettingFocusRange2UidValue; break; + case ECameraSettingStabilization: uid = KUidECamEventSettingsStabilizationAlgorithmComplexityUidValue; break; + + + // case ECameraSettingAudioMute: + // case ECameraSettingFileMaxSize: + // case ECameraSettingFileName: + // case ECameraSettingContrast: + // case ECameraSettingBrightness: + // case ECameraSettingQualityFactor + // case ECameraSettingNone + default: + break; + } + + return uid; + } + + +// --------------------------------------------------------------------------- +// Map2CameraSetting +// --------------------------------------------------------------------------- +// +TCamCameraSettingId +CCamSettingConversion::Map2CameraSetting( TInt aUidValue ) + { + TCamCameraSettingId id( ECameraSettingNone ); + + switch( aUidValue ) + { + case KUidECamEventCameraSettingFlashModeUidValue: id = ECameraSettingFlash; break; + case KUidECamEventCameraSettingExposureCompensationStepUidValue: id = ECameraSettingExposure; break; + case KUidECamEventCameraSettingIsoRateTypeUidValue: id = ECameraSettingLightSensitivity; break; + case KUidECamEventCameraSettingWhiteBalanceModeUidValue: id = ECameraSettingWhiteBalance; break; + case KUidECamEventImageProcessingEffectUidValue: id = ECameraSettingColourEffect; break; + case KUidECamEventImageProcessingAdjustSharpnessUidValue: id = ECameraSettingSharpness; break; + case KUidECamEventCameraSettingDigitalZoomUidValue: id = ECameraSettingDigitalZoom; break; + case KUidECamEventCameraSettingOpticalZoomUidValue: id = ECameraSettingOpticalZoom; break; + case KUidECamEventCameraSettingFocusRange2UidValue: id = ECameraSettingFocusRange; break; + case KUidECamEventSettingsStabilizationAlgorithmComplexityUidValue: id = ECameraSettingStabilization; break; + default: + break; + } + + return id; + } + +// --------------------------------------------------------------------------- +// CCamSettingConversion::Map2CameraAutofocus +// --------------------------------------------------------------------------- +// +CCamera::CCameraAdvancedSettings::TFocusRange +CCamSettingConversion::Map2CameraAutofocus( const TCamSceneAFMode& aAfMode ) + { + switch( aAfMode ) + { + case ECamSceneAFModeMacro: + return CCamera::CCameraAdvancedSettings::EFocusRangeMacro; + case ECamSceneAFPortrait: + return CCamera::CCameraAdvancedSettings::EFocusRangePortrait; + case ECamSceneAFModeInfinity: + return CCamera::CCameraAdvancedSettings::EFocusRangeInfinite; + case ECamSceneAFModeHyperfocal: + return CCamera::CCameraAdvancedSettings::EFocusRangeHyperfocal; + + case ECamSceneAFModeContinuous: // Fall through + // Currently no support for continuous auto focus. + // This case anyway needs to be handled differently as + // continuous auto focus is not a setting, but autofocus + // type given when starting focusing. + case ECamSceneAFModeNormal: // Fall through + default: + return CCamera::CCameraAdvancedSettings::EFocusRangeAuto; + } + + } + +#endif // defined( CAMERAAPP_CAPI_V2_ADV ) || defined( CAMERAAPP_CAPI_V2_IP ) + +// --------------------------------------------------------------------------- +// CCamSettingConversion::Map2CameraOrientation +// --------------------------------------------------------------------------- +// +MCameraOrientation::TOrientation +CCamSettingConversion::Map2CameraOrientation( + const TCamImageOrientation& aSettingOrientation ) + { + switch( aSettingOrientation ) + { + case ECamOrientation90: return MCameraOrientation::EOrientation90; + case ECamOrientation180: return MCameraOrientation::EOrientation180; + case ECamOrientation270: return MCameraOrientation::EOrientation270; + case ECamOrientation0: // <> + default: return MCameraOrientation::EOrientation0; + } + } + + + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/camsettingprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/camsettingprovider.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,838 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting Provider class implementation +* +*/ + + +// =========================================================================== +// Includes + +#include "camcameracontrollerflags.hrh" +#include +#ifdef CAMERAAPP_CAPI_V2 + #include // KECamFineResolutionFactor +#endif + +#include + +#include "camlogging.h" +#include "camcameracontroller.pan" +#include "CamSettingsInternal.hrh" +#include "camcameracontrollertypes.h" +#include "camsettingprovider.h" +#include "CamSettingsModel.h" +#include "camsettingconversion.h" +#include "CamAppController.h" +#include "campointerutility.inl" +#include "CameraUiConfigManager.h" + +#include "CamAppUi.h" +#include "CamUtility.h" +#include "CamPSI.h" + +#include "CamVideoQualityLevel.h" + + +// =========================================================================== +// Types + +using namespace NCamCameraController; + +#ifdef CAMERAAPP_CAPI_V2_ADV + typedef CCamera::CCameraAdvancedSettings CAS; +#endif +#ifdef CAMERAAPP_CAPI_V2_IP + typedef CCamera::CCameraImageProcessing CIP; +#endif + +// =========================================================================== +// Local data + +static const TInt KSettingArrayGranularity = 8; + +static const TSize KViewfinderSize = TSize(320, 240); +static const TBool KSnapshotMaintainAspect = EFalse; +static const TInt KEngineMultiplier = 10; + +// =========================================================================== +// Methods + +// static +CCamSettingProvider* +CCamSettingProvider::NewL( CCamAppController& aController, + MCamSettingsModel* aSettingsModel ) + { + CCamSettingProvider* self = + CCamSettingProvider::NewLC( aController, aSettingsModel ); + CleanupStack::Pop( self ); + return self; + } + +// static +CCamSettingProvider* +CCamSettingProvider::NewLC( CCamAppController& aController, + MCamSettingsModel* aSettingsModel ) + { + CCamSettingProvider* self = + new (ELeave) CCamSettingProvider( aController, aSettingsModel ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// virtual +CCamSettingProvider::~CCamSettingProvider() + { + iPendingSettingChanges.Close(); + } + + +// =========================================================================== +// From MCamSettingProvider + +// --------------------------------------------------------------------------- +// virtual ProvideCameraParamL +// +// --------------------------------------------------------------------------- +// +void +CCamSettingProvider::ProvideCameraParamL( + const NCamCameraController::TCamCameraParamId& aParamId, + TAny* aParamData ) + { + __ASSERT_DEBUG( aParamData, Panic( ECamNullPointer ) ); + switch( aParamId ) + { + // ----------------------------------------------------- + case ECameraParamImage: + { + TPckgBuf* ptr = + static_cast*>( aParamData ); + CheckNonNullL( ptr, KErrNotFound ); + TCamParamsImage& params( (*ptr)() ); + CCamAppUiBase* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + if ( appUi->ActiveCamera() == ECamActiveCameraSecondary ) + { + params.iFormat = CCamera::EFormatJpeg; + } + else // primary camera + { + params.iFormat = CCamera::EFormatExif; + } + TCamPhotoSizeId PhotoSizeIndex = iSettingsModel->CurrentPhotoResolution(); + TSize PhotoSize = iSettingsModel->ImageResolutionFromIndex( PhotoSizeIndex ); + params.iSize = PhotoSize; + params.iQualityFactor = iSettingsModel->CurrentPhotoCompression(); + break; + } + // ----------------------------------------------------- +#ifdef CAMERAAPP_CAE_FOR_VIDEO + case ECameraParamVideoCae: + { + TPckgBuf* ptr = + static_cast*>( aParamData ); + CheckNonNullL( ptr, KErrNotFound ); + + TCamParamsVideoCae& params( (*ptr)() ); + + + TInt videoQuality = iSettingsModel->IntegerSettingValue( ECamSettingItemVideoQuality ); + + PRINT1( _L("Camera <> CCamSettingProvider::ProvideCameraParamL - video quality (index): %d"), videoQuality ); + PRINT1( _L("Camera <> CCamSettingProvider::ProvideCameraParamL - quality count: %d"), iSettingsModel->VideoQualityArray().Count() ); + + CCamVideoQualityLevel& level = *( iSettingsModel->VideoQualityArray() )[videoQuality]; + TInt res = level.VideoResolution(); + PRINT1( _L("Camera <> CCamSettingProvider::ProvideCameraParamL - video resolution (index): %d"), res ); + PRINT1( _L("Camera <> CCamSettingProvider::ProvideCameraParamL - resolution count: %d"), iSettingsModel->VideoResolutions().Count() ); + + // Video resolutions array in Setting Model is set up from + // R_CAM_VIDEO_RESOLUTION_ARRAY resource. New resolutions + // need to be added there also, in addition to configuration files. + TSize resolution = ( iSettingsModel->VideoResolutions() )[ res ]; + params.iFrameSize = resolution; + params.iFrameRate = level.FrameRate(); + params.iVideoBitRate = level.VideoBitRate(); + params.iAudioBitRate = level.AudioBitRate(); + params.iAudioOn = iSettingsModel->IntegerSettingValue( ECamSettingItemVideoAudioRec ); + params.iMimeType.Set ( level.VideoMimeType() ); + params.iSupplier.Set ( level.PreferredSupplier() ); + params.iVideoType.Set( level.VideoFileType() ); + params.iAudioType.Set( level.AudioType() ); + + TInt framerate = -1; + TCamSceneId videoscene = static_cast< TCamSceneId > ( + iSettingsModel->IntegerSettingValue(ECamSettingItemDynamicVideoScene) ); + + framerate = iSettingsModel->SceneSettingValue(videoscene, ECamSettingItemSceneFramerate); + + // Change the framerate if scene has defined it to be > 0 + if ( framerate > 0 ) + { + params.iFrameRate = framerate; + } + + PRINT1( _L("Camera <> CCamSettingProvider::ProvideCameraParamL ECameraParamVideoCae framerate: %d"), framerate ) + + break; + } +#endif // CAMERAAPP_CAE_FOR_VIDEO + // ----------------------------------------------------- + case ECameraParamVfMode: + { + CCamAppUi* appUi = static_cast( CEikonEnv::Static()->AppUi() ); + TPckgBuf* ptr = + static_cast*>( aParamData ); + CheckNonNullL( ptr, KErrNotFound ); + TCamViewfinderMode& params( (*ptr)() ); + TBool isPrimaryCamera = appUi->ActiveCamera() == ECamActiveCameraPrimary; + + if ( iController.IsDirectScreenVFSupported( isPrimaryCamera ) ) + {// primary camera or 2nd camera DSVF + PRINT( _L("Setting Provider <> provide ECameraParamVfMode == ECamViewfinderDirect") ); + params = ECamViewfinderDirect; + } + else + {// primary camera or 2nd camera bitmap view finder + PRINT( _L("Setting Provider <> provide ECameraParamVfMode == ECamViewfinderBitmap") ); + params = ECamViewfinderBitmap; + } + break; + } + // ----------------------------------------------------- + case ECameraParamVfBitmap: + { + CCamAppUi* appUi = static_cast( + CEikonEnv::Static()->AppUi() ); + PRINT2( _L("Setting Provider <> provide ECameraParamVfBitmap. CurrentMode: (%d) TargetMode: (%d)"), iController.CurrentMode(), appUi->TargetMode() ); + TPckgBuf* ptr = + static_cast*>( aParamData ); + CheckNonNullL( ptr, KErrNotFound ); + TCamParamsVfBitmap& params( (*ptr)() ); + + TDisplayMode displayMode = + CEikonEnv::Static()->ScreenDevice()->DisplayMode(); + CCamera::TFormat viewfinderFormat = + CCamSettingConversion::Map2CameraFormat( displayMode ); + + const TCamCameraMode cameraMode = iController.CurrentMode(); + const TInt resolution = (cameraMode == ECamControllerVideo) + ? iController.GetCurrentVideoResolution() + : iController.GetCurrentImageResolution(); + params.iRect = CamUtility::ViewfinderLayout( cameraMode, resolution ); + + params.iFormat = viewfinderFormat; + + // Mirror viewfinder for secondary camera + params.iMirrorImage = ECamActiveCameraSecondary == appUi->ActiveCamera(); + + break; + } + // ----------------------------------------------------- + case ECameraParamVfDirect: + { + // Not supported yet. + User::Leave( KErrNotSupported ); + break; + } + // ----------------------------------------------------- + case ECameraParamSnapshot: + { + TPckgBuf* ptr = + static_cast*>( aParamData ); + CheckNonNullL( ptr, KErrNotFound ); + TCamParamsSnapshot& params( (*ptr)() ); + + // Fetch the snapshot size + TDisplayMode displayMode = CEikonEnv::Static()->ScreenDevice()->DisplayMode(); + TCamCameraMode cameraMode = iController.CurrentMode(); + TInt resolution = (cameraMode == ECamControllerVideo) + ? iController.GetCurrentVideoResolution() + : iController.GetCurrentImageResolution(); + params.iSize = CamUtility::ViewfinderLayout( cameraMode, resolution ).Size(); + params.iFormat = CCamSettingConversion::Map2CameraFormat(displayMode); + params.iMaintainAspect = KSnapshotMaintainAspect; + break; + } + // ----------------------------------------------------- + default: + { + User::Leave( KErrNotSupported ); + break; + } + // ----------------------------------------------------- + } + } + + +// --------------------------------------------------------------------------- +// virtual ProvideCameraSettingL +// +// --------------------------------------------------------------------------- +// +void +CCamSettingProvider::ProvideCameraSettingL( + const NCamCameraController::TCamCameraSettingId& aSettingId, + TAny* aSettingData ) + { + CheckNonNullL( aSettingData, KErrArgument ); + + TCamCameraMode mode( iController.CurrentMode() ); + + switch( aSettingId ) + { + // ----------------------------------------------------- + // Flash + case ECameraSettingFlash: + case ECameraUserSceneSettingFlash: + { + TCamFlashId flashId = static_cast (iSettingsModel-> + IntegerSettingValue( ECamSettingItemDynamicPhotoFlash ) ); + if ( mode == ECamControllerVideo ) + { + flashId = static_cast (iSettingsModel-> + IntegerSettingValue( ECamSettingItemDynamicVideoFlash ) ); + } + CCamera::TFlash CamFlashId = CCamSettingConversion::Map2CameraFlash( flashId ); + CCamera::TFlash* ptr = static_cast( aSettingData ); + *ptr = CamFlashId; + break; + } + // ----------------------------------------------------- + // Exposure (EV mode + EV compensation step) + case ECameraSettingExposure: + case ECameraUserSceneSettingExposure: + { + TPckgBuf* ptr = + static_cast*>( aSettingData ); + TCamSettingDataExposure& evData( (*ptr)() ); + + TInt sceneItemId = ( ECamControllerVideo == mode ) + ? ECamSettingItemDynamicVideoScene + : ECamSettingItemDynamicPhotoScene; + + TInt sceneId = iSettingsModel->IntegerSettingValue( sceneItemId ); + + TCamSceneAEMode evMode = + static_cast( + iSettingsModel->SceneSettingValue( sceneId, ECamSettingItemSceneAEMode ) ); + + evData.iExposureMode = CCamSettingConversion::Map2CameraExposureMode( evMode ); + PRINT1( _L("Camera <> provide EV mode: %016b"), evData.iExposureMode ); +#ifdef CAMERAAPP_CAPI_V2 + TInt evKey; + if ( ECameraUserSceneSettingExposure != aSettingId ) + { + evKey = ( ECamControllerVideo == mode ) + ? ECamSettingItemDynamicVideoExposure + : ECamSettingItemDynamicPhotoExposure; + } + else + { + evKey = ECamSettingItemUserSceneExposure; + } + + TInt evValue = iSettingsModel->IntegerSettingValue( evKey ); + if( iEvStepAsUiValue != 0 ) + evData.iExposureStep = (evValue * KECamFineResolutionFactor) / iEvStepAsUiValue; + else + evData.iExposureStep = 0; + PRINT1( _L("Camera <> provide EV compensation: %d"), evData.iExposureStep ); +#else + evData.iExposureStep = 0; +#endif + break; + } + // ----------------------------------------------------- + // Light sensitivity (ISO value) + case ECameraSettingLightSensitivity: + case ECameraUserSceneSettingLightSensitivity: + { + TInt* ptr = static_cast( aSettingData ); + TInt isoKey; + + if ( ECameraUserSceneSettingLightSensitivity != aSettingId ) + { + isoKey = ( ECamControllerVideo == mode ) + ? ECamSettingItemDynamicVideoLightSensitivity + : ECamSettingItemDynamicPhotoLightSensitivity; + } + else + { + isoKey = ECamSettingItemUserSceneLightSensitivity; + } + // TCamLightSensitivityId type value returned + TCamLightSensitivityId isoId = + static_cast( iSettingsModel->IntegerSettingValue( isoKey ) ); + + *ptr = CamUtility::MapLightSensitivity2IsoValueL( isoId, iSupportedISORates ); + PRINT1( _L("Camera <> provide ISO rate: %d"), *ptr ); + break; + } + // ----------------------------------------------------- + // White balance + case ECameraSettingWhiteBalance: + case ECameraUserSceneSettingWhiteBalance: + { + TPckgBuf* ptr = + static_cast*>( aSettingData ); + TInt key; + + if ( ECameraUserSceneSettingWhiteBalance != aSettingId ) + { + key = ( ECamControllerVideo == mode ) + ? ECamSettingItemDynamicVideoWhiteBalance + : ECamSettingItemDynamicPhotoWhiteBalance; + } + else + { + key = ECamSettingItemUserSceneWhitebalance; + } + + TCamSettingDataWhiteBalance& wbData( (*ptr)() ); + + TCamWhiteBalanceId WB = static_cast(iSettingsModel->IntegerSettingValue( key )); + CCamera::TWhiteBalance CamWB = CCamSettingConversion::Map2CameraWb( WB ); + + wbData.iWhiteBalanceMode = CamWB; + break; + } +#ifdef CAMERAAPP_CAPI_V2_IP + // ----------------------------------------------------- + // Colour effect (colour filter: sepia/b&w/vivid/..) + case ECameraSettingColourEffect: + case ECameraUserSceneSettingColourEffect: + { + CIP::TEffect* ptr = static_cast( aSettingData ); + + TInt key; + + if ( ECameraUserSceneSettingColourEffect != aSettingId ) + { + key = ( ECamControllerVideo == mode ) + ? ECamSettingItemDynamicVideoColourFilter + : ECamSettingItemDynamicPhotoColourFilter; + } + else + { + key = ECamSettingItemUserSceneColourFilter; + } + + TCamColourFilterId uiValue = + static_cast( iSettingsModel->IntegerSettingValue( key ) ); + + CIP::TEffect effect = CCamSettingConversion::Map2CameraEffect( uiValue ); + + PRINT1( _L("Camera <> provide colour effect: 0x%08x"), effect ); + *ptr = effect; + break; + } + // ----------------------------------------------------- + // Sharpness + case ECameraSettingSharpness: + case ECameraUserSceneSettingSharpness: + { + TInt* ptr = static_cast( aSettingData ); + + TInt key; + + if ( ECameraUserSceneSettingSharpness != aSettingId ) + { + key = ECamSettingItemDynamicPhotoImageSharpness; + } + else + { + key = ECamSettingItemUserSceneImageSharpness; + } + TCamImageSharpnessId uiValue = + static_cast( + iSettingsModel->IntegerSettingValue( key ) ); + + TInt sharpness = CamUtility::MapSharpnessId2SharpnessValueL( uiValue ); + PRINT1( _L("Camera <> provide sharpness: %d"), sharpness ); + *ptr = sharpness; + + break; + } +#endif // CAMERAAPP_CAPI_V2_IP + // ----------------------------------------------------- + // Brightness + case ECameraSettingBrightness: + case ECameraUserSceneSettingBrightness: + { + CCamera::TBrightness* ptr = + static_cast( aSettingData ); + + TInt key; + + if ( ECameraUserSceneSettingBrightness != aSettingId ) + { + key = ( ECamControllerVideo == mode ) + ? ECamSettingItemDynamicVideoBrightness + : ECamSettingItemDynamicPhotoBrightness; + } + else + { + key = ECamSettingItemUserSceneBrightness; + } + + TInt SettingsBrightness = iSettingsModel->IntegerSettingValue( key ); + CCamera::TBrightness CamBrightness = CCamera::TBrightness( KEngineMultiplier * SettingsBrightness ); + + PRINT1( _L("Camera <> provide brightness: %d"), CamBrightness ); + *ptr = CamBrightness; + break; + } + // ----------------------------------------------------- + // Contrast + case ECameraSettingContrast: + case ECameraUserSceneSettingContrast: + { + CCamera::TContrast* ptr = static_cast( aSettingData ); + TInt key; + + if ( ECameraUserSceneSettingContrast != aSettingId ) + { + key = ( ECamControllerVideo == mode ) + ? ECamSettingItemDynamicVideoContrast + : ECamSettingItemDynamicPhotoContrast; + } + else + { + key = ECamSettingItemUserSceneContrast; + } + + TInt SettingsContrast = iSettingsModel->IntegerSettingValue( key ); + CCamera::TContrast CamContrast = CCamera::TContrast( KEngineMultiplier * SettingsContrast ); + PRINT1( _L("Camera <> provide contrast: %d"), CamContrast ); + *ptr = CamContrast; + break; + } + // ----------------------------------------------------- + // Digital zoom + case ECameraSettingDigitalZoom: + { + TInt* ptr = static_cast( aSettingData ); + CheckNonNullL( ptr, KErrArgument ); + *ptr = iController.ZoomValue(); + break; + } + // ----------------------------------------------------- + // Optical zoom + case ECameraSettingOpticalZoom: + { + User::Leave( KErrNotSupported ); + //iSettingsModel->IntegerSettingValue( ECamSettingItemPhotoOpticalZoom ); + break; + } +#ifdef CAMERAAPP_CAPI_V2_ADV + case ECameraSettingFocusRange: + { + // User::Leave( KErrNotSupported ); + CAS::TFocusRange* ptr = static_cast( aSettingData ); + + // Get current scene, from which the focus range value should be obtained + TInt currentScene = iSettingsModel->IntegerSettingValue( ECamSettingItemDynamicPhotoScene ); + if ( currentScene == ECamSceneUser ) + { + // In case of user scene, use the base scene instead + currentScene = iSettingsModel->IntegerSettingValue( ECamSettingItemUserSceneBasedOnScene ); + } + PRINT1( _L("Camera <> current scene: %d"), currentScene ); + + // Get the autofocus mode in camera internal format + TInt afMode = iSettingsModel->SceneSettingValue( currentScene, ECamSettingItemSceneAFMode ); + + PRINT1( _L("Camera <> Autofocusmode for current scene: %d"), afMode ); + + TCamSettingsOnOff facetrack = + static_cast( + iSettingsModel->IntegerSettingValue( ECamSettingItemFaceTracking ) ); + if ( iController.UiConfigManagerPtr() && iController.UiConfigManagerPtr()->IsFaceTrackingSupported() && + ( ECamSettOn == facetrack ) ) + { + // Use CCamera::CCameraAdvancedSettings::EFocusRangeAuto if in facetracking mode. + *ptr = CCamera::CCameraAdvancedSettings::EFocusRangeAuto; + } + else + { + // Convert it to TFocusRange + *ptr = CCamSettingConversion::Map2CameraAutofocus( static_cast( afMode ) ); + PRINT1( _L("Camera <> Autofocusmode mapped for CCamera: %d"), *ptr ); + } + //CheckNonNullL( ptr, KErrNotFound ); + //*ptr = KFocusRange;//iSettingsModel->IntegerSettingValue( ECamSettingItemDynamicPhotoFocusRange ); + break; + } + // ----------------------------------------------------- + case ECameraSettingCaptureLimit: + { + TInt* ptr = static_cast( aSettingData ); + *ptr = iController.CaptureLimitSetting(); + + PRINT1( _L("Camera <> provide capture limit: %d"), *ptr ); + break; + } + // ----------------------------------------------------- + // Stabilization setting (for video) + case ECameraSettingStabilization: + { + TCamSettingDataStabilization& stabilization = + ( *static_cast*>( aSettingData ) )(); + + TCamSettingsOnOff settingOn = + static_cast( iSettingsModel->IntegerSettingValue( ECamSettingItemVideoStab ) ); + + // These could be made product specific.. + if( ECamSettOn == settingOn ) + { + PRINT( _L("Camera <> Stabilization is set ON") ); + stabilization.iMode = CAS::EStabilizationModeAuto; + stabilization.iEffect = CAS::EStabilizationAuto; + stabilization.iComplexity = CAS::EStabilizationComplexityAuto; + } + else + { + PRINT( _L("Camera <> Stabilization is set OFF") ); + stabilization.iMode = CAS::EStabilizationModeOff; + stabilization.iEffect = CAS::EStabilizationOff; + stabilization.iComplexity = CAS::EStabilizationComplexityAuto; + } + break; + } +#endif // CAMERAAPP_CAPI_V2_ADV + // ----------------------------------------------------- + // Device orientation setting + case ECameraSettingOrientation: + { + MCameraOrientation::TOrientation* ptr = + static_cast( aSettingData ); + + TCamImageOrientation orientationSetting = + static_cast( iController.ImageOrientation() ); + PRINT1( _L("Camera <> Got image orientation from ui: [%s]"), KCamOrientationNames[orientationSetting] ); + + *ptr = CCamSettingConversion::Map2CameraOrientation( orientationSetting ); + PRINT1( _L("Camera <> provide camera orientation: 0x%02X"), *ptr ); + break; + } + // ----------------------------------------------------- + // Video audio mute setting + case ECameraSettingAudioMute: + { + TCamSettingsOnOff mute = + static_cast( + iSettingsModel->IntegerSettingValue( ECamSettingItemVideoAudioRec ) ); + + TBool* ptr = static_cast( aSettingData ); + *ptr = (ECamSettOn == mute); + PRINT1( _L("Camera <> provide mute on: %d"), *ptr ); + break; + } + // ----------------------------------------------------- + // Continuous autofocus setting + case ECameraSettingContAF: + { + TCamSettingsOnOff caf = static_cast( + iSettingsModel->IntegerSettingValue( ECamSettingItemContinuousAutofocus ) ); + + TBool* ptr = static_cast( aSettingData ); + *ptr = (ECamSettOn == caf); + PRINT1( _L("Camera <> provide continuous autofocus on: %d"), *ptr ); + break; + } + // ----------------------------------------------------- + // facetracking setting + case ECameraSettingFacetracking: + { + TCamSettingsOnOff facetrack = + static_cast( + iSettingsModel->IntegerSettingValue( ECamSettingItemFaceTracking ) ); + TBool* ptr = static_cast( aSettingData ); + *ptr = (ECamSettOn == facetrack); + PRINT1( _L("Camera <> provide facetracking on: %d"), *ptr ); + break; + } + // ----------------------------------------------------- + // Video max size in bytes + case ECameraSettingFileMaxSize: + { + TCamVideoClipLength setting = + static_cast( + iSettingsModel->IntegerSettingValue( ECamSettingItemVideoClipLength ) ); + + TInt* ptr = static_cast( aSettingData ); + + *ptr = ( ECamVideoClipShort == setting ) + ? CamUtility::MaxMmsSizeInBytesL() + : 0; // 0 means not limited + + PRINT1( _L("Camera <> provide max file size: %d"), *ptr ); + break; + } + // ----------------------------------------------------- + // Video filename + case ECameraSettingFileName: + { + TPtr* ptr = static_cast( aSettingData ); + //*ptr = iController.CurrentFullFileName(); + *ptr = iController.CurrentVideoFileName(); + break; + } + // ----------------------------------------------------- + default: + { +#ifndef CAMERAAPP_EMULATOR_BUILD + User::Leave( KErrNotSupported ); +#endif // not CAMERAAPP_EMULATOR_BUILD + break; + } + // ----------------------------------------------------- + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSettingProvider::ProvidePendingSettingChangesL( + RArray& aSettingIds ) + { + PRINT( _L("Camera => CCamSettingProvider::ProvidePendingSettingChangesL") ); + aSettingIds.Reset(); + aSettingIds.ReserveL( iPendingSettingChanges.Count() ); + for( TInt i = 0; i < iPendingSettingChanges.Count(); i++ ) + { + aSettingIds.AppendL( iPendingSettingChanges[i] ); + } + PRINT1( _L("Camera <> %d settings changed"), aSettingIds.Count() ); + + // These have been asked and delivered now. + // Update: Reset only when asked. Enables retries. + // iPendingSettingChanges.Reset(); + PRINT( _L("Camera <= CCamSettingProvider::ProvidePendingSettingChangesL") ); + } + + +// --------------------------------------------------------------------------- +// PendingSettingChangeCount +// --------------------------------------------------------------------------- +// +TInt +CCamSettingProvider::PendingSettingChangeCount() const + { + return iPendingSettingChanges.Count(); + } + + +// =========================================================================== +// New methods + +// --------------------------------------------------------------------------- +// Reset +// --------------------------------------------------------------------------- +// +void +CCamSettingProvider::Reset() + { + PRINT( _L("Camera =><= CCamSettingProvider::Reset") ); + iPendingSettingChanges.Reset(); + } + +// --------------------------------------------------------------------------- +// AddPendingSettingChangesL +// --------------------------------------------------------------------------- +// +void +CCamSettingProvider +::AddPendingSettingChangesL( const RArray& aUiSettingIds ) + { + iPendingSettingChanges.ReserveL( aUiSettingIds.Count() + + iPendingSettingChanges.Count() ); + + for( TInt i = 0; i < aUiSettingIds.Count(); i++ ) + { + AddPendingSettingChangeL( aUiSettingIds[i] ); + } + } + +// --------------------------------------------------------------------------- +// AddPendingSettingChangeL +// --------------------------------------------------------------------------- +// +void +CCamSettingProvider +::AddPendingSettingChangeL( TCamSettingItemIds aUiSettingId ) + { + PRINT1( _L("Camera => CCamSettingProvider::AddPendingSettingChangeL [%s]"), + KCamSettingItemNames[aUiSettingId] ); + + TCamCameraSettingId cameraId = + CCamSettingConversion::Map2CameraControllerSettingId( aUiSettingId ); + + if( ECameraSettingNone != cameraId ) + { + // Add each setting only once + if( KErrNotFound == iPendingSettingChanges.Find( cameraId ) ) + { + PRINT1( _L("Camera <> Add pending setting [%s]"), KCameraSettingNames[cameraId] ); + iPendingSettingChanges.AppendL( cameraId ); + } + } + else + { + User::Leave( KErrNotSupported ); + } + PRINT( _L("Camera <= CCamSettingProvider::AddPendingSettingChangeL") ); + } + +// --------------------------------------------------------------------------- +// SetSupportedISORatesL +// +// --------------------------------------------------------------------------- +// +void +CCamSettingProvider::SetSupportedISORatesL( const RArray& aSupportedIsoRates ) + { + iSupportedISORates = aSupportedIsoRates; + if ( iSupportedISORates.Count() != 0 ) + { + iValidISORates = ETrue; + } + } + +// =========================================================================== +// private + +void +CCamSettingProvider::ConstructL() + { + PRINT( _L("Camera => CCamSettingProvider::ConstructL") ); + // Get EV steps range. + iEvStepAsUiValue = iController.EvRange().iStepsPerUnit; + PRINT( _L("Camera <= CCamSettingProvider::ConstructL") ); + } + + +CCamSettingProvider::CCamSettingProvider( CCamAppController& aController, + MCamSettingsModel* aSettingsModel ) + : iSettingsModel( aSettingsModel ), + iController ( aController ), + iPendingSettingChanges( KSettingArrayGranularity ) + { + } + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/camsnapshot.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/camsnapshot.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,695 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implemantation of CCamSnapshot class. +* Temporary own implementation of MCameraSnapshot. +* To be replaced by ECam CCamera::CCameraSnapshot. +* +*/ + + +#include "camcameracontrollerflags.hrh" + +#include +#include + +#include + +#include "camlogging.h" +#include "mcamcameraobserver.h" +#include "camcameraevents.h" +#include "cambuffer.h" +#include "cambuffershare.h" +#include "camimagedecoder.h" +#include "cambitmapscaler.h" +#include "camsnapshot.h" + + + + + + +// =========================================================================== +// Local constants +static const TPoint KDefaultPosition = TPoint(0,0); +static const TRgb KDefaultBackgroudColor = KRgbWhite; +static const TUint32 KSupportedSnapshotFormats = + ( CCamera::EFormatFbsBitmapColor4K + | CCamera::EFormatFbsBitmapColor64K + | CCamera::EFormatFbsBitmapColor16M + | CCamera::EFormatFbsBitmapColor16MU + ); +static const TInt KCallbackPriority = CActive::EPriorityIdle; + +static const TUint KEventInterest = ( ECamCameraEventClassImage + | ECamCameraEventClassVideo + | ECamCameraEventClassVfData + ); + +// =========================================================================== +// Local methods + +#ifndef CAMERAAPP_CAPI_V2 + +// Not needed when new CAPI support ready. +TECAMEvent::TECAMEvent( TUid aEventType, + TInt aErrorCode ) + : iErrorCode( aErrorCode ) + { + iEventType.iUid = aEventType.iUid; + #pragma message("camsnapshot.cpp, temporarily define TECAMEvent constructor") + } +#endif + + +#include "campointerutility.inl" +using namespace NCamCameraController; + + +// =========================================================================== +// public constructors and destructor + +// --------------------------------------------------------------------------- +// static 2-phase constructor +// --------------------------------------------------------------------------- +// +CCamSnapshot* +CCamSnapshot::NewL( CCamera& aCamera, + MCameraObserver2& aObserver, + MCamCameraObservable& aObservable ) + { + CCamSnapshot* self = + new (ELeave) CCamSnapshot( aCamera, aObserver, aObservable ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CCamSnapshot::~CCamSnapshot() + { + PRINT( _L("Camera => ~CCamSnapshot") ); + iObservable.DetachObserver( this ); + + delete iSnapshotBitmap; + + // No need to Cancel(), destructors do it already. + delete iIdle; + delete iDecoder; + delete iScaler; + + SetImageData( NULL ); + + PRINT( _L("Camera <= ~CCamSnapshot") ); + } + +// =========================================================================== +// from MCameraSnapshot + +// --------------------------------------------------------------------------- +// SupportedFormats +// --------------------------------------------------------------------------- +// +TUint32 +CCamSnapshot::SupportedFormats() + { + return KSupportedSnapshotFormats; + } + + +// --------------------------------------------------------------------------- +// PrepareSnapshotL +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::PrepareSnapshotL( CCamera::TFormat aFormat, + const TPoint& aPosition, + const TSize& aSize, + const TRgb& aBgColor, + TBool aMaintainAspectRatio ) + { + PRINT( _L("Camera => CCamSnapshot::PrepareSnapshotL") ); + + if( !(KSupportedSnapshotFormats & aFormat) ) + { + PRINT( _L("Camera <> Not supported format, LEAVE") ); + User::Leave( KErrNotSupported ); + } + else + { + PRINT( _L("Camera <> do prepare..") ); + iSnapshotOn = EFalse; + iStatus = KErrNotReady; + iDecoder->Cancel(); + iScaler->Cancel(); + iSnapshotBitmap->Reset(); + + PRINT( _L("Camera <> Init bitmap scaler..") ); + iScaler->InitScalingL( aSize, + Format2DisplayMode( iFormat ), + aMaintainAspectRatio ); + + PRINT1( _L("Camera <> Attach as controller observer, interest: %032b"), KEventInterest ); + iObservable.AttachObserverL( this, KEventInterest ); + + PRINT( _L("Camera <> Store parameters..") ); + iFormat = aFormat; + iPosition = aPosition; + iSize = aSize; + iBackgroundColor = aBgColor; + iMaintainAspectRatio = aMaintainAspectRatio; + } + + PRINT( _L("Camera <= CCamSnapshot::PrepareSnapshotL") ); + } + + +// --------------------------------------------------------------------------- +// PrepareSnapshotL +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::PrepareSnapshotL( CCamera::TFormat aFormat, + const TSize& aSize, + TBool aMaintainAspectRatio ) + { + PrepareSnapshotL( aFormat, + KDefaultPosition, + aSize, + KDefaultBackgroudColor, + aMaintainAspectRatio ); + } + + +// --------------------------------------------------------------------------- +// SetBgColorL +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::SetBgColorL( const TRgb& aBgColor ) + { + iBackgroundColor = aBgColor; + } + + +// --------------------------------------------------------------------------- +// SetPositionL +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::SetPositionL( const TPoint& aPosition ) + { + iPosition = aPosition; + } + + +// --------------------------------------------------------------------------- +// IsSnapshotActive +// --------------------------------------------------------------------------- +// +TBool +CCamSnapshot::IsSnapshotActive() const + { + return iSnapshotOn; + } + +// --------------------------------------------------------------------------- +// StartSnapshot +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::StartSnapshot() + { + iSnapshotOn = ETrue; + } + + +// --------------------------------------------------------------------------- +// StopSnapshot +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::StopSnapshot() + { + iSnapshotOn = EFalse; + + iUseNextVfFrame = EFalse; + } + + +// --------------------------------------------------------------------------- +// SnapshotDataL +// --------------------------------------------------------------------------- +// +MCameraBuffer& +CCamSnapshot::SnapshotDataL( RArray& aFrameIndexOrder ) + { + PRINT( _L("Camera => CCamSnapshot::SnapshotDataL") ); + + // Leave if not ready or other error. + User::LeaveIfError( iStatus ); + + if( !iSnapshotOn || !iSnapshotBitmap ) + { + User::Leave( KErrNotReady ); + } + + // Set the frame order + aFrameIndexOrder.Reset(); + User::LeaveIfError( aFrameIndexOrder.Append( 0 ) ); + + // Client *must* call Release() for the buffer + CCamBuffer* buffer = CCamBuffer::NewL( *iSnapshotBitmap, NULL ); + + PRINT( _L("Camera <= CCamSnapshot::SnapshotDataL") ); + return *buffer; + } + + +// =========================================================================== +// From MCamCameraObserver + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData /*= NULL*/ ) + { + if( iSnapshotOn ) + { + switch( aEventId ) + { + // --------------------------------------------------- + // Viewfinder frame ready event + // + case ECamCameraEventVfFrameReady: + { + if( iUseNextVfFrame ) + { + iUseNextVfFrame = EFalse; + + // Take the viewfinder frame just as it would be + // a still image, just in bitmap format. + PRINT( _L("Camera <> CCamSnapshot: Storing VF frame as snapshot") ); + + + // TEMP ==> + CCamBufferShare* share = NULL; + TRAPD( error, + { + if( KErrNone == aStatus ) + { + CFbsBitmap* bitmap = new (ELeave) CFbsBitmap; + CleanupStack::PushL( bitmap ); + User::LeaveIfError( bitmap->Duplicate( static_cast( aEventData )->Handle() ) ); + + CCamBuffer* buffer = CCamBuffer::NewL( bitmap, NULL ); + CleanupStack::Pop( bitmap ); + + CleanupStack::PushL( buffer ); + share = new (ELeave) CCamBufferShare( buffer ); + CleanupStack::Pop( buffer ); + } + }); + if( KErrNone != error ) + { + aStatus = error; + } + if( share ) share->Reserve(); + // <== TEMP + + + StartSnapshotProcessing( share, aStatus ); + + // TEMP ==> + if( share ) share->Release(); + // <== TEMP + } + break; + } + // --------------------------------------------------- + // Image captured event + // + // Need to decode the snapshot from the image data. + case ECamCameraEventImageData: + { + if( !iVideoMode ) + { + PRINT( _L("Camera <> CCamSnapshot: Starting to decode snapshot") ); + CCamBufferShare* share = static_cast( aEventData ); + StartSnapshotProcessing( share, aStatus ); + } + break; + } + // --------------------------------------------------- + // Video init might come before snapshot is + // initialized, so we do not rely on this event + // case ECamCameraEventVideoInit: + // { + // PRINT( _L("Camera <> CCamSnapshot: Video mode entered") ); + // break; + // } + // --------------------------------------------------- + case ECamCameraEventVideoRelease: + { + PRINT( _L("Camera <> CCamSnapshot: Video mode left") ); + iVideoMode = EFalse; + break; + } + // --------------------------------------------------- + // Video started event + // + // Use next vf frame as snapshot. + case ECamCameraEventVideoStart: + { + PRINT( _L("Camera <> CCamSnapshot: Video started, will use next VF frame as snapshot") ); + SetImageData( NULL ); + if( KErrNone == aStatus ) + { + iVideoMode = ETrue; + iUseNextVfFrame = ETrue; + } + break; + } + // --------------------------------------------------- + // Video stopped. + // + // Provide the vf frame as snapshot. + case ECamCameraEventVideoStop: + { + if( iVideoMode ) + { + PRINT( _L("Camera <> CCamSnapshot: Video stopped, provide the VF frame snapshot..") ); + + // Cancel any activity, if not ready for some reason. + if( iIdle ) iIdle->Cancel(); + if( iScaler ) iScaler->Cancel(); + if( iDecoder ) iDecoder->Cancel(); + + // Snapshot is in iSnapshotBitmap + SetImageData( NULL ); + + // Need to clear this flag as no events are notified + // when this flag is on. + iVideoMode = EFalse; + + PRINT( _L("Camera <> CCamSnapshot: Start snapshot callback") ); + iIdle->Start( TCallBack( SnapshotReadyCallback, this ) ); + } + break; + } + // --------------------------------------------------- + default: + { + // Other events ignored + break; + } + // --------------------------------------------------- + } + } + } + + + + +// =========================================================================== +// from MCamImageDecoderObserver + +// --------------------------------------------------------------------------- +// ImageDecoded <> +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::ImageDecoded( TInt aStatus, const CFbsBitmap* aBitmap ) + { + PRINT1( _L("Camera => CCamSnapshot::ImageDecoded, status in: %d"), aStatus ); + if( iSnapshotOn ) + { + iStatus = aStatus; + + iSnapshotBitmap->Reset(); + + if( iStatus == KErrNone ) + { + iStatus = iSnapshotBitmap->Duplicate( aBitmap->Handle() ); + } + PRINT1( _L("Camera <> status after bitmap duplicate: %d"), iStatus ); + + // Release image data, as not used anymore. + // All that is needed is iSnapshotBitmap. + SetImageData( NULL ); + + if( iStatus == KErrNone ) + { + iScaler->StartScaling( *iSnapshotBitmap ); + } + else + { + iIdle->Start( TCallBack( SnapshotReadyCallback, this ) ); + } + } + PRINT( _L("Camera <= CCamSnapshot::ImageDecoded") ); + } + +// =========================================================================== +// from MCamBitmapScalerObserver + +// --------------------------------------------------------------------------- +// BitmapScaled <> +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::BitmapScaled( TInt aStatus, const CFbsBitmap* aBitmap ) + { + // Release any data we hold, as it's not needed anymore. + SetImageData( NULL ); + + if( iSnapshotOn ) + { + iStatus = aStatus; + iSnapshotBitmap->Reset(); + + if( KErrNone == iStatus ) + { + iStatus = iSnapshotBitmap->Duplicate( aBitmap->Handle() ); + } + + TECAMEvent event( KUidECamEventCameraSnapshot, iStatus ); + iObserver.HandleEvent( event ); + } + } + + +// =========================================================================== +// public new methods + +// --------------------------------------------------------------------------- +// StartSnapshotProcessing +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::StartSnapshotProcessing( CCamBufferShare* aBuffer, + TInt aError ) + { + PRINT1( _L("Camera => CCamSnapshot::StartSnapshotProcessing, status in:%d"), aError ); + + if( iSnapshotOn ) + { + TRAP( iStatus, DoStartSnapshotProcessingL( aBuffer, aError ) ); + + if( iStatus != KErrNone ) + { + iIdle->Start( TCallBack( SnapshotReadyCallback, this ) ); + } + } + + PRINT1( _L("Camera <= CCamSnapshot::StartSnapshotProcessing, status out:%d"), aError ); + } + + +// --------------------------------------------------------------------------- +// SnapshotReadyCallback <> +// --------------------------------------------------------------------------- +// +// static +TInt +CCamSnapshot::SnapshotReadyCallback( TAny* aSelf ) + { + PRINT( _L("Camera => CCamSnapshot::SnapshotReadyCallback <>") ); + CCamSnapshot* self( static_cast( aSelf ) ); + + if( !self->iVideoMode ) + { + TECAMEvent event( KUidECamEventCameraSnapshot, self->iStatus ); + self->iObserver.HandleEvent( event ); + } + else + { + // In video mode we must wait for the video stopped event + // even to report error. + PRINT( _L("Camera <> CCamSnapshot: Video mode, wait until video stopped.") ); + } + + PRINT( _L("Camera <= CCamSnapshot::SnapshotReadyCallback <>") ); + return EFalse; + } + + + +// =========================================================================== +// private methods + +// --------------------------------------------------------------------------- +// DoStartSnapshotProcessingL +// +// Helper method for StartSnapshotProcessing. +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::DoStartSnapshotProcessingL( CCamBufferShare* aBuffer, + TInt aError ) + { + PRINT1( _L("Camera => CCamSnapshot::DoStartSnapshotProcessingL, status in:%d"), aError ); + + // Cancel all ongoing activity. + iDecoder->Cancel(); + iScaler->Cancel(); + SetImageData( NULL ); // Release any old. + + // Check that we have the data needed. + CheckNonNullL( aBuffer, KErrNotFound ); + CheckNonNullL( aBuffer->SharedBuffer(), KErrNotFound ); + User::LeaveIfError( aError ); + + + SetImageData( aBuffer ); + MCameraBuffer* buffer = iImageData->SharedBuffer(); + + // First try to use bitmap data if available + TRAP( aError, + { + CFbsBitmap& bitmap = buffer->BitmapL( 0 ); + PRINT( _L("Camera <> Using bitmap data, just scale..") ); + // Simulate that the bitmap has been decoded now. + ImageDecoded( aError, &bitmap ); + }); + + // If problems with bitmap data, try encoded data. + if( KErrNone != aError ) + { + PRINT( _L("Camera <> Using encoded data, decode first") ); + // If not able to use bitmap (or there is none), + // start converting bitmap from encoded image data. + TRAP( aError, iDecoder->StartConversionL( iImageData ) ); + } + + + // Neither of the formats could be used. + // Release the image data. + if( KErrNone != aError ) + { + SetImageData( NULL ); + User::Leave( aError ); + } + PRINT( _L("Camera <= CCamSnapshot::DoStartSnapshotProcessingL") ); + } + + +// --------------------------------------------------------------------------- +// Format2DisplayMode +// --------------------------------------------------------------------------- +// +TDisplayMode +CCamSnapshot::Format2DisplayMode( CCamera::TFormat aFormat ) const + { + switch( aFormat ) + { + case CCamera::EFormatFbsBitmapColor4K: return EColor4K; + case CCamera::EFormatFbsBitmapColor64K: return EColor64K; + case CCamera::EFormatFbsBitmapColor16M: return EColor16M; + case CCamera::EFormatFbsBitmapColor16MU: return EColor16MU; + default: return EColor16MU; + } + } + + + +// --------------------------------------------------------------------------- +// SetImageData +// +// Release old shared buffer (if any exists) and store pointer to new one and +// reserve it (if any provided). Can be used to just release any existing +// share with NULL parameter. +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::SetImageData( CCamBufferShare* aImageData ) + { + if( iImageData ) + { + iImageData->Release(); + } + + iImageData = aImageData; + + if( iImageData ) + { + iImageData->Reserve(); + } + } + + + +// =========================================================================== +// private constructors + +// --------------------------------------------------------------------------- +// 2nd phase constructor +// --------------------------------------------------------------------------- +// +void +CCamSnapshot::ConstructL() + { + iSnapshotBitmap = new (ELeave) CFbsBitmap; + + iDecoder = CCamImageDecoder::NewL( *this ); + iScaler = CCamBitmapScaler::NewL( *this ); + + iIdle = CIdle::NewL( KCallbackPriority ); + } + +// --------------------------------------------------------------------------- +// 1st phase constructor +// --------------------------------------------------------------------------- +// +CCamSnapshot::CCamSnapshot( CCamera& aCamera, + MCameraObserver2& aObserver, + MCamCameraObservable& aObservable ) + : iObserver( aObserver ), + iObservable( aObservable ), + iCameraHandle( aCamera.Handle() ), + iSnapshotOn( EFalse ), + iStatus( KErrNotReady ) + { + } + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/cameracontroller/camsnapshotprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/cameracontroller/camsnapshotprovider.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implemantation of CCamSnapshotProvider class. +* Handles different setups of CCamSnapshot and CCameraSnapshot. +* For example secondary camera does not always support +* CCameraSnapshot. +* +*/ + + +// =========================================================================== +// Includes +#include // CCamera, MCameraObserver2 +#include // CCameraSnapshot + +#include "camcameracontroller.pan" +#include "camlogging.h" +#include "camsnapshot.h" +#include "camsnapshotprovider.h" + + + +// =========================================================================== +// Constants etc +using namespace NCamCameraController; + + +// =========================================================================== +// Methods (see also inline methods in .inl) + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamSnapshotProvider* +CCamSnapshotProvider::NewL( CCamera& aCamera, + MCameraObserver2& aObserver, + MCamCameraObservable& aObservable ) + { + CCamSnapshotProvider* self = new (ELeave) CCamSnapshotProvider; + + CleanupStack::PushL( self ); + self->ConstructL( aCamera, aObserver, aObservable ); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamSnapshotProvider::~CCamSnapshotProvider() + { + delete iSs1; + delete iSs2; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void +CCamSnapshotProvider::ConstructL( CCamera& aCamera, + MCameraObserver2& aObserver, + MCamCameraObservable& aObservable ) + { + PRINT( _L("Camera => CCamSnapshotProvider::ConstructL") ); +#ifdef CAMERAAPP_CAPI_V2_SS + TRAPD( error, iSs1 = CCamera::CCameraSnapshot::NewL( aCamera ) ); + + PRINT1( _L("Camera <> status from CCameraSnapshot::NewL: %d"), error ); + if( KErrNone != error ) + { + if( KErrNotSupported == error ) + { + PRINT( _L("Camera <> CCameraSnapshot not supported, use CCamSnapshot..") ); + iSs2 = CCamSnapshot::NewL( aCamera, aObserver, aObservable ); + } + else + { + User::Leave( error ); + } + } +#else + iSs1 = NULL; + iSs2 = CCamSnapshot::NewL( aCamera, aObserver, aObservable ); +#endif + + __ASSERT_ALWAYS( iSs1 || iSs2, Panic( ECamNullPointer ) ); + PRINT( _L("Camera <= CCamSnapshotProvider::ConstructL") ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamSnapshotProvider::CCamSnapshotProvider() + { + } + + + +// =========================================================================== +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/camflashstatus.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/camflashstatus.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,381 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implemantation for CCamFlashStatus class. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +// #include "CamPropertyWatcher.h" +// #include "CamUtility.h" +#include "camlogging.h" +#include "CamSettings.hrh" +#include "CamSettingsInternal.hrh" +#include "camcameraevents.h" +#include "CamAppController.h" +#include "camflashstatus.h" + +static const TUint KCameraEventInterest = ECamCameraEventClassFlashStatus; + +// --------------------------------------------------------------------------- +// CCamFlashStatus::CCamFlashStatus +// --------------------------------------------------------------------------- +// +CCamFlashStatus::CCamFlashStatus( CCamAppController& aController ): + iErrorCallbacksEnabled( ETrue ), + iController( aController ) + { + } + +// --------------------------------------------------------------------------- +// CCamFlashStatus::~CCamFlashStatus +// --------------------------------------------------------------------------- +// +CCamFlashStatus::~CCamFlashStatus() + { + iController.RemoveCameraObserver( this ); + + if( iBlinkTimer ) + { + iBlinkTimer->Cancel(); + delete iBlinkTimer; + } + } + +// --------------------------------------------------------------------------- +// CCamFlashStatus::NewL +// --------------------------------------------------------------------------- +// +CCamFlashStatus* +CCamFlashStatus::NewL( CCamAppController& aController ) + { + CCamFlashStatus* self = + new (ELeave) CCamFlashStatus( aController ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); // self + return self; + } + + +// --------------------------------------------------------------------------- +// CCamFlashStatus::ConstructL +// --------------------------------------------------------------------------- +// +void +CCamFlashStatus::ConstructL() + { + iBlinkTimer = CPeriodic::NewL( EPriorityLow ); + + iController.AddCameraObserverL( this, KCameraEventInterest ); + iFlashError = EFalse; + iFlashRequired = EFalse; + iFlashReady = EFalse; + } + +// --------------------------------------------------------------------------- +// CCamFlashStatus::Subscribe +// --------------------------------------------------------------------------- +// +void +CCamFlashStatus::Subscribe( MFlashStatusObserver* aObserver ) + { + PRINT1( _L("Camera => CCamFlashStatus::Subscribe, observer ptr:%d"), aObserver ); + iObserver = aObserver; + + // If there is need to blink, but no observer before, + // we need to recheck the blinking status when observer subscribes. + CheckBlinkingStatus(); + + PRINT ( _L("Camera <= CCamFlashStatus::Subscribe") ); + } + + +// --------------------------------------------------------------------------- +// CCamFlashStatus::FlashReady +// --------------------------------------------------------------------------- +// +TBool +CCamFlashStatus::FlashReady() const + { + return iFlashReady; + } + +// --------------------------------------------------------------------------- +// CCamFlashStatus::FlashError +// --------------------------------------------------------------------------- +// +TBool +CCamFlashStatus::FlashError() const + { + return iFlashError; + } + +// --------------------------------------------------------------------------- +// CCamFlashStatus::SetFlashError +// --------------------------------------------------------------------------- +// +void +CCamFlashStatus::SetFlashError( TBool aFlashError ) + { + iFlashError = aFlashError; + } + +// --------------------------------------------------------------------------- +// CCamFlashStatus::ErrorCallbacksEnabled +// --------------------------------------------------------------------------- +// +TBool +CCamFlashStatus::ErrorCallbacksEnabled() const + { + return iErrorCallbacksEnabled; + } + +// --------------------------------------------------------------------------- +// CCamFlashStatus::EnableErrorCallback +// --------------------------------------------------------------------------- +// +void +CCamFlashStatus::EnableErrorCallbacks( TBool aCallbacksEnabled ) + { + iErrorCallbacksEnabled = aCallbacksEnabled; + } + +// --------------------------------------------------------------------------- +// CCamFlashStatus::FlashIconVisible +// --------------------------------------------------------------------------- +// +TBool +CCamFlashStatus::FlashIconVisible() const + { + return iBlinkStatus; + } + + +// --------------------------------------------------------------------------- +// HandleCameraEventL <> +// +// --------------------------------------------------------------------------- +// +void +CCamFlashStatus::HandleCameraEventL( TInt aStatus, + TCamCameraEventId aEventId, + TAny* aEventData /*= NULL*/ ) + { + PRINT( _L("Camera => CCamFlashStatus::HandleCameraEventL") ); + + switch( aEventId ) + { + // --------------------------------------------------- + // Flash ready. + case ECamCameraEventFlashReady: + { + PRINT ( _L("Camera <> CCamFlashStatus: Flash ready") ); + iFlashError = aStatus; + iFlashReady = (KErrNone == aStatus); + break; + } + // --------------------------------------------------- + // Flash not ready, e.g. recharging. + case ECamCameraEventFlashNotReady: + { + PRINT ( _L("Camera <> CCamFlashStatus: Flash NOT ready") ); + iFlashError = aStatus; + iFlashReady = EFalse; + break; + } + // --------------------------------------------------- + default: + { + PRINT ( _L("Camera <> CCamFlashStatus: unhandled event!") ); + break; + } + // --------------------------------------------------- + } + + // Check if need to start/stop blinking + CheckBlinkingStatus(); + + // Notify error + if( iFlashError ) + { + NotifyObserverAboutFlashError(); + } + + PRINT( _L("Camera <= CCamFlashStatus::HandleCameraEventL") ); + } + + +// --------------------------------------------------------------------------- +// CheckBlinkingStatus +// +// --------------------------------------------------------------------------- +// +void +CCamFlashStatus::CheckBlinkingStatus() + { + // If blinking is on, check if it needs to be stopped + if( iBlinking ) + { + // No observer OR flash ready OR flash error OR flash off + // => stop blinking + if( !iObserver + || iFlashReady + || iFlashError + || IsFlashOff() ) + { + StopBlinking(); + } + } + // If blinking is off, check if it needs to be started. + else + { + // Observer joined AND flash not ready AND no error AND flash used + // => start blinking + if( iObserver && !iFlashReady && !iFlashError && !IsFlashOff() ) + { + StartBlinking(); + } + } + } + + + +// --------------------------------------------------------------------------- +// CCamFlashStatus::StartBlinking +// --------------------------------------------------------------------------- +// +void +CCamFlashStatus::StartBlinking() + { + // Start blinking only if some observer is displaying the status + if( iObserver ) + { + PRINT( _L("Camera =><= CamFlashStatus::StartBlinking - starting blinking") ) + iBlinking = ETrue; + iBlinkStatus = EFalse; + // Make first callback to make the flash icon visible + BlinkTimerCallback( this ); + + // Start the blinking timer + iBlinkTimer->Cancel(); + iBlinkTimer->Start( KFlashIconBlinkDelay, + KFlashIconBlinkDelay, + TCallBack( BlinkTimerCallback, this) ); + + } + } + +// --------------------------------------------------------------------------- +// CCamFlashStatus::StopBlinking +// --------------------------------------------------------------------------- +// +void +CCamFlashStatus::StopBlinking() + { + PRINT( _L("Camera =><= CamFlashStatus::StopBlinking - stopping blinking") ) + + // Stop blinking + iBlinking = EFalse; + iBlinkTimer->Cancel(); + + if( iBlinkStatus ) + { + // The flash icon is visible. Make one more callback to + // hide it. + BlinkTimerCallback( this ); + } + } + + +// --------------------------------------------------------------------------- +// CCamFlashStatus::BlinkTimerCallback +// --------------------------------------------------------------------------- +// +TInt +CCamFlashStatus::BlinkTimerCallback( TAny* aSelf ) + { + PRINT( _L("Camera => CamFlashStatus::BlinkTimerCallback") ) + + CCamFlashStatus* self = static_cast( aSelf ); + if( self ) + { + // Invert icon visibility + TBool newBlinkStatus = self->iBlinkStatus ? EFalse : ETrue; + self->iBlinkStatus = newBlinkStatus; + + // Inform observer of change + if( self->iObserver ) + { + self->iObserver->FlashIconVisible( newBlinkStatus ); + } + } + + PRINT( _L("Camera <= CamFlashStatus::BlinkTimerCallback") ) + return KErrNone; + } + + +// --------------------------------------------------------------------------- +// FlashOff +// --------------------------------------------------------------------------- +// +TBool +CCamFlashStatus::IsFlashOff() const + { + TInt key = KErrNotFound; + TCamCameraMode mode = iController.CurrentMode(); + + switch( mode ) + { + case ECamControllerImage: key = ECamSettingItemDynamicPhotoFlash; break; + case ECamControllerVideo: key = ECamSettingItemDynamicVideoFlash; break; + default: + break; + } + + TBool off = ( KErrNotFound == key // Not prepared or standby mode. + || ECamFlashOff == iController.IntegerSettingValue( key ) + ); + + return off; + } + +// --------------------------------------------------------------------------- +// CCamFlashStatus::NotifyObserverAboutFlashError +// --------------------------------------------------------------------------- +// +void +CCamFlashStatus::NotifyObserverAboutFlashError() + { + if( iErrorCallbacksEnabled && iObserver ) + { + // Give error callback to the observer. + iObserver->FlashError(); + } + } + + +// End of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/camfolderutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/camfolderutility.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,432 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* Copyright © 2007-2008 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +// =========================================================================== +// Included headers + + +#include // for feature definitions + +#include +#include +#include +#include + +#include +#include + +#include "CamPanic.h" +#include "CamUtility.h" // PRINT macros +#include "CameraappPrivateCRKeys.h" +#include "camfolderutility.h" + + +// =========================================================================== +// Local constants + +static const TInt KMultipleFolderNumberChars = 2; +static const TInt KMaxMonthFolders = 260; +static const TInt KBase10 = 10; +static const TInt KCamMonthFolderNameLength = 8; + + +_LIT( KCamMonthFolderFormat, "%F%Y%M" ); +_LIT( KBackslash, "\\" ); +_LIT( KCharacterOffset, "A" ); +_LIT( KDigitOffset, "0" ); +_LIT( KMaxCharacter, "Z" ); +_LIT( KWildCardCharacter, "?" ); + + + +// =========================================================================== +// CCamFolderUtility implementation + +// --------------------------------------------------------------------------- +// GetBasePathL +// Generates the path where new images/videos are to be saved to. +// --------------------------------------------------------------------------- +// +void +CCamFolderUtility::GetBasePathL( TInt* aMonthCounters, + TInt aStorage, // TCamMediaStorage + TDes& aPath, + TCamCameraMode aCaptureMode, + TBool aCreateAll, + TInt aRequiredFileCount, + TTime aTime ) + { + PRINT( _L("Camera => CCamFolderUtility::GetBasePathL")) + + TInt folderTypeIndex = 0; + + if ( ( aStorage == ECamMediaStoragePhone ) ) // Saving to phone memory + { + // phone folders are in the odd indexes + folderTypeIndex ++; + PRINT( _L("Camera GetBasePathL saving to phone memory")) + aPath.Copy( PathInfo::PhoneMemoryRootPath() ); + } + // with multiple drives, mass storage is the default, like phone memory used to be. + else if ( aStorage == ECamMediaStorageMassStorage ) // Saving to mass storage memory + { + PRINT( _L("Camera GetBasePathL saving to mass storage memory")) + // Get the root path of the mass storage drive. + TInt drive; + TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ); + TFileName path; + err = PathInfo::GetRootPath( path, drive ); + aPath.Copy(path); + } + else // Saving to MMC + { + PRINT( _L("Camera GetBasePathL saving to memory card")) + // Get the root path of the mmc. + TInt drive; + TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, drive ); + TFileName path; + err = PathInfo::GetRootPath( path, drive ); + aPath.Copy(path); + } + + // Append the folder to the path + if ( ECamControllerVideo == aCaptureMode ) + { + aPath.Append( PathInfo::VideosPath() ); + // video folders are offset to ECamFolderTypeVideoMMC + folderTypeIndex += ECamFolderTypeVideoMMC; + } + else + { + aPath.Append( PathInfo::ImagesPath() ); + } + + // Add a folder for the current month + // Use the specified time to determine the year and month. + // If this is 0 then use the current time. + TTime now = aTime; + if ( now.Int64() == TInt64( 0 ) ) + { + now.HomeTime(); + } + TBuf monthFolder; + now.FormatL( monthFolder, KCamMonthFolderFormat ); + // If the month folder name is different to the last used month folder name + // this indicates that a new month has been started. All the counters will + // need to be reinitialised + + // Get last used folder name + TBuf previousMonthFolder; + CRepository* cr = CRepository::NewLC( KCRUidCameraappSettings ); + cr->Get( KCamCrLastUsedMonthFolder, previousMonthFolder ); + + // Compare to current folder name, if different then reset all counters + if ( monthFolder.Compare( previousMonthFolder) != 0 ) + { + ResetCounters( aMonthCounters ); + // Write month folder name to shared data + cr->Set( KCamCrLastUsedMonthFolder, monthFolder ); + } + CleanupStack::PopAndDestroy( cr ); + TBuf cameraFolder; + StringLoader::Load( cameraFolder, R_CAM_CAMERA_SUBFOLDER ); + aPath.Append( cameraFolder ); + aPath.Append( KBackslash ); + aPath.Append( monthFolder ); + aPath.Append( KBackslash ); + + // Keep track of the month folder (YYYYMM) name length + // This may be returned e.g.if the month counter destination folder (YYYYMMXX) is + // not created + TInt monthFolderLength = aPath.Length(); + + RFs rfs; + User::LeaveIfError( rfs.Connect() ); + CleanupClosePushL( rfs ); + + // ensure the path exists + TInt err = rfs.MkDirAll( aPath ); + + // If the folder is newly created then set the counter to 0 + if ( KErrNone == err ) aMonthCounters[folderTypeIndex] = 0; + else if ( KErrAlreadyExists == err ) err = KErrNone; + else User::Leave( err ); + + + // If the month counter is uninitialised it needs to be set up + if ( aMonthCounters[folderTypeIndex] < 0 ) + { + User::LeaveIfError( InitialiseMonthCounter( aMonthCounters, + aPath, + monthFolder, + rfs, + folderTypeIndex ) ); + } + aPath.Append( monthFolder ); + // Only ensure the folder exists (and has space) if the aCreateAll flag is set + if ( aCreateAll ) + { + PRINT( _L("Camera GetBasePathL creating month counter folder") ) + // This adds on the correct counter if completing without error + User::LeaveIfError( CreateDestinationFolder( aMonthCounters, + aPath, + rfs, + folderTypeIndex, + aRequiredFileCount ) ); + } + else + { + TInt monthCounter = aMonthCounters[folderTypeIndex]; + aPath.Append( KCharacterOffset()[0] + monthCounter/KBase10 ); + aPath.Append( KDigitOffset()[0] + monthCounter%KBase10 ); + aPath.Append( KBackslash ); + // If the folder does not exist then remove the final folder name from the path + TEntry entry; + if ( rfs.Entry( aPath, entry ) == KErrNotFound ) + { + aPath.SetLength( monthFolderLength ); + } + } + CleanupStack::PopAndDestroy( &rfs ); + + PRINT( _L("Camera <= CCamAppController::GetBasePathL returning") ) + } + + +// --------------------------------------------------------------------------- +// ResetCounters +// --------------------------------------------------------------------------- +// +void +CCamFolderUtility::ResetCounters( TInt* aMonthCounters, + TInt aFrom, + TInt aTo ) + { + PRINT( _L("Camera => CCamFolderUtility::ResetCounters") ) + { + for( TInt i = aFrom; i <= aTo; i++ ) + { + aMonthCounters[i] = -1; + } + } + } + + + +// --------------------------------------------------------------------------- +// InitialiseMonthCounter +// Sets the value of the folder counter for the current month/media store/mode +// --------------------------------------------------------------------------- +// +TInt +CCamFolderUtility::InitialiseMonthCounter( TInt* aMonthCounters, + TDes& aPath, + TDesC& aMonthFolder, + RFs& aFs, + TInt aFolderType ) + { + PRINT( _L("Camera => CCamFolderUtility::InitialiseMonthCounter") ) + + // start by initialising the appropriate folder counter to 0 + aMonthCounters[aFolderType] = 0; + + TInt monthFolderLength = aPath.Length(); + // The month counter folder starts with the same characters as the parent month folder + aPath.Append( aMonthFolder ); + TInt charCount; + // Add on '??' wildcard characters to get a list of all folders with this + // month's format + for ( charCount = 0; charCount < KMultipleFolderNumberChars; charCount++ ) + { + aPath.Append( KWildCardCharacter ); + } + // Get a list of folders for this month, sorted in descending alphabetical order + // the first entry should be the latest used folder + CDir* dirList; + TInt err = KErrNone; + err = aFs.GetDir( aPath, + KEntryAttMatchExclusive|KEntryAttDir, + ESortByName|EDescending, + dirList ); + // Prune back to the parent folder path + aPath.SetLength( monthFolderLength ); + if ( err == KErrNone ) + { + TInt monthFolderCount = dirList->Count(); + TInt index = 0; + TBool done = EFalse; + // Look through the list of folders in the month for the highest numbered folder + // with the format YYYYMMAX Where YYYY is the year MM is the month A is an alphabetical + // character in the range a-z or A-Z and X is a digit 0-9 + while ( index < monthFolderCount && !done ) + { + done = ETrue; + // The list is sorted in descending order. Get the last 2 characters from + // the first directory in the list these indicate the highest folder number + TPtrC name = ( *dirList )[index].iName; + TInt nameLength = name.Length(); + // Check the first character is in the range a-z or A-Z + TChar firstChar = name[nameLength - KMultipleFolderNumberChars]; + firstChar.UpperCase(); + // If the character is not in the range then disregard this folder + if ( firstChar < KCharacterOffset()[0] || + firstChar > KMaxCharacter()[0] ) + { + done = EFalse; + } + // Check the second character is in the range 0-9 + TChar secondChar = name[nameLength - 1]; + TInt secondCharVal = secondChar.GetNumericValue(); + if ( secondCharVal < 0 || + secondCharVal > KBase10 - 1 ) + { + done = EFalse; + } + if ( done ) + { + TUint folderNumber = firstChar; + // 10's part of folder number is represented by characters A-Z + // convert the character into a decimal value + folderNumber -= KCharacterOffset()[0]; + folderNumber *= KBase10; + // Now add on the units + folderNumber += secondCharVal; + aMonthCounters[aFolderType] = folderNumber; + } + // TUint folderNumber = name[nameLength - 2]; + index++; + } + } + delete dirList; + dirList = NULL; + + PRINT1( _L("Camera <= CCamAppController::InitialiseMonthCounter returning %d"), err) + return err; + } + +// --------------------------------------------------------------------------- +// CreateDestinationFolder +// Creates the folder where new images/videos are to be saved to. +// --------------------------------------------------------------------------- +// +TInt +CCamFolderUtility::CreateDestinationFolder( TInt* aMonthCounters, + TDes& aPath, + RFs& aFs, + TInt aFolderType, + TInt aRequiredFileCount ) + { + PRINT( _L("Camera => CCamFolderUtility::CreateDestinationFolder ") ) + __ASSERT_DEBUG( aFolderType < ECamFolderTypeLast, CamPanic( ECamPanicBadIndex ) ); + + TInt folderCreated = EFalse; + // This error value will only be retained if the counter is outside + // the allowed range + TInt err = KErrArgument; + TInt monthCounter = aMonthCounters[aFolderType]; + while ( !folderCreated && monthCounter < KMaxMonthFolders ) + { + aMonthCounters[aFolderType] = monthCounter; + err = KErrNone; + // Add on the new counter + aPath.Append( KCharacterOffset()[0] + monthCounter/KBase10 ); + aPath.Append( KDigitOffset()[0] + monthCounter%KBase10 ); + aPath.Append( KBackslash ); + err = aFs.MkDirAll( aPath ); + PRINT1( _L("Camera <> MkDirAll returned %d "), err ) + // If the folder already exists then check there is enough space for the required file count + if ( err == KErrAlreadyExists ) + { + PRINT( _L("Camera <> MkDirAll KErrALreadyExists ") ) + // if this is the final folder (Z9) there is no need to check for available space + // this folder will be used anyway + if ( monthCounter >= KMaxMonthFolders - 1 ) + { + PRINT( _L("Camera <> MkDirAll KErrALreadyExists Z9") ) + folderCreated = ETrue; + // sanity check to ensure the counter is not too high + aMonthCounters[aFolderType] = KMaxMonthFolders - 1; + err = KErrNone; + } + // if this is not the final folder (Z9) check for space and try the next one if necessary + else + { + PRINT( _L("Camera <> MkDirAll KErrALreadyExists not Z9, retry") ) + CDir* fileList; + TInt dirErr = ( aFs.GetDir( aPath, + KEntryAttMaskSupported, + ESortNone, + fileList ) ); + TBool spaceRemaining = EFalse; + if ( !dirErr ) + { + spaceRemaining = ( fileList->Count() + aRequiredFileCount <= KMaxFilesPerFolder ); + } + delete fileList; + fileList = NULL; + if ( dirErr ) + { + PRINT1( _L("Camera <= CCamFolderUtility::DoCreateDestinationFolderL returning %d"), err) + return dirErr; + } + + // If there is insufficient space then try the next folder + if ( !spaceRemaining ) + { + monthCounter++; + // Remove the previous counter characters and the trailing backslash then try again + aPath.SetLength( aPath.Length() - ( KMultipleFolderNumberChars + 1 ) ); + } + else // This folder has enough space for the capture + { + folderCreated = ETrue; + err = KErrNone; + } + } + } + // There is a problem creating folders - report error + else if ( err ) + { + PRINT1( _L("Camera <= CCamFolderUtility::DoCreateDestinationFolderL returning %d"), err) + return err; + } + // A new folder has been created. There is no need to check the space + else + { + folderCreated = ETrue; + } + } + + PRINT1( _L("Camera <= CCamFolderUtility::DoCreateDestinationFolderL returning %d"), err) + return err; + } + +// =========================================================================== + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/camlinevfgriddrawer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/camlinevfgriddrawer.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,377 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implemantation for CCamLineVfGridDrawer class. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#include +#include "camlinevfgriddrawer.h" +#include "camlogging.h" + +// ======== LOCAL CONSTANTS ======== + +namespace + { + const TInt KArrayGranularity = 8; + const TInt KMaxLineCount = 64; + + const TInt KPenColorRed = 255; + const TInt KPenColorGreen = 0;//255; + const TInt KPenColorBlue = 0;//255; + const TInt KPenColorAlpha = 255;//128; + const TInt KPenWidth = 2; + const TInt KPenHeight = 2; + const CGraphicsContext::TPenStyle KPenStyle = CGraphicsContext::ESolidPen; + } + +// ======== LOCAL FUNCTIONS ======== + +// ======== MEMBER FUNCTIONS ======== + +// =========================================================================== +// Public part + +// --------------------------------------------------------------------------- +// static NewL +// +// 2-phased constructor +// --------------------------------------------------------------------------- +// +CCamLineVfGridDrawer* +CCamLineVfGridDrawer::NewL() + { + CCamLineVfGridDrawer* self = new (ELeave) CCamLineVfGridDrawer; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CCamLineVfGridDrawer::~CCamLineVfGridDrawer() + { + PRINT( _L("Camera => ~CCamLineVfGridDrawer") ); + iLineArray.Reset(); + iLineArray.Close(); + PRINT( _L("Camera <= ~CCamLineVfGridDrawer") ); + } + + + +// --------------------------------------------------------------------------- +// virtual InitL +// * from MCamVfGridDrawer +// +// Initialize the drawer. +// --------------------------------------------------------------------------- +// +void +CCamLineVfGridDrawer::InitL( TAny* /*aParam*/ ) + { + } + +// --------------------------------------------------------------------------- +// virtual Draw( CBitmapContext& ) +// * from MCamVfGridDrawer +// +// Draw the grid. If not set visible nothing is drawn. +// --------------------------------------------------------------------------- +// +void +CCamLineVfGridDrawer::Draw( CBitmapContext& aGc ) const + { + if( iVisible && + iLineArray.Count() > 0 ) + { + // Set drawing properties. + aGc.SetPenStyle( iPenStyle ); + aGc.SetPenSize ( iPenSize ); + aGc.SetPenColor( iPenColor ); + + // Draw the lines + for( TInt i = 0; i < iLineArray.Count(); i++ ) + { + // Top-left and bottom-right corners of the rect + // represent the line ends. + aGc.DrawLine( iLineArray[i].iTl, iLineArray[i].iBr ); + } + + // Clear any settings made to gc + aGc.Reset(); + } + else + { + // Not visible => draw nothing. + } + } + + +// --------------------------------------------------------------------------- +// virtual Draw( const TRect&, CBitmapContext& ) +// * from MCamVfGridDrawer +// +// Draw part of the grid. If not set visible nothing is drawn. +// Note: +// Only pure vertical and pure horizontal lines +// get drawn to right place if lines expand outside +// the aRect rectangle given here as parameter. +// --------------------------------------------------------------------------- +// +void +CCamLineVfGridDrawer::Draw( const TRect& aRect, + CBitmapContext& aGc ) const + { + if( iVisible && + iLineArray.Count() > 0 ) + { + // Limit the drawing to given rectangle. + // Drawing outside this rectangle has no visible effect. + aGc.SetClippingRect( aRect ); + // Make the same drawing operations as in full screen draw. + // The drawing is so simple that any optimization is + // probably more time consuming than the drawing itself. + // Draw resets the gc in the end, so clipping rect is cleared. + Draw( aGc ); + } + else + { + // Not visible => draw nothing. + } + } + +// --------------------------------------------------------------------------- +// virtual SetVisible +// * from MCamVfGridDrawer +// +// Set visibility of the grid. +// +// --------------------------------------------------------------------------- +// +void +CCamLineVfGridDrawer::SetVisible( TBool aVisible ) + { + iVisible = aVisible; + } + + + +// --------------------------------------------------------------------------- +// virtual IsVisible +// * from MCamVfGridDrawer +// +// Get visibility of the grid. +// +// --------------------------------------------------------------------------- +// +TBool +CCamLineVfGridDrawer::IsVisible() const + { + return iVisible; + } + + +// --------------------------------------------------------------------------- +// SetLinesL +// * from MCamVfGridDrawer +// +// Set the line end pair array. +// --------------------------------------------------------------------------- +// +void +CCamLineVfGridDrawer::SetLinesL( const RLineArray& aLineArray ) + { + TInt newLineCount = aLineArray.Count(); + if( newLineCount > KMaxLineCount ) + { + User::Leave( KErrArgument ); + } + + iLineArray.Reset(); + for( TInt i = 0; i < newLineCount; i++ ) + { + iLineArray.Append( aLineArray[i] ); + } + } + + +// --------------------------------------------------------------------------- +// SetLinesL +// +// Set the line end pair array by defining the count and bordered property +// of lines per horizontal and vertical axis. +// --------------------------------------------------------------------------- +// +void +CCamLineVfGridDrawer::SetLinesL( const TRect& aDrawingRect, + TInt aHorizontalLines, + TInt aVerticalLines, + TBool aBorderedGrid /* = EFalse */) + { + // ------------------------------------------------------- + // Check the max limit for lines does not exceed. + if( aHorizontalLines < 0 + || aVerticalLines < 0 + || aHorizontalLines + aVerticalLines > KMaxLineCount + ) + { + User::Leave( KErrArgument ); + } + + // ------------------------------------------------------- + // Fill the line end array + // + // The lines are evenly spaced over the draw area axis in question. + // The aBorderedGrid parameter determines whether the grid + // draws lines to the borders of draw area: + // E.g. 3 vertical lines: '[' and ']' are the draw area borders. + // aBorderedGrid: [| | |] + // !aBorderedGrid: [ | | | ] + // + // The formula for the location of i:th line when N lines + // are used along dimension D: + // - aBorderedGrid: ( i * D) / (N - 1) + // - !aBorderedGrid: ((i+1) * D) / (N + 1) + // * Divide by (N-1) needs special handling with N=1. + // * Half of pen width is subtracted from the above formula result + // to center the line to the calculated location. + // * odd area or pen width/height may cause error of 1 pixel. + TInt indexOffset = (aBorderedGrid ? 0 : 1); + TInt countOffset = (aBorderedGrid ? -1 : 1); + + // ----------------------------------- + // First horizontal lines + TInt height = aDrawingRect.Height(); + TInt leftX = aDrawingRect.iTl.iX; + TInt rightX = aDrawingRect.iBr.iX; + + TInt i = 0; + while( i < aHorizontalLines ) + { + // Max used to make sure no div-by-zero + TInt currentY = ((i+indexOffset)*height) / Max(1,aHorizontalLines+countOffset) - KPenHeight/2; + iLineArray.Append( TRect( leftX, currentY, rightX, currentY ) ); + i++; + } + + // ----------------------------------- + // Then vertical lines + TInt width = aDrawingRect.Width(); + TInt topY = aDrawingRect.iTl.iY; + TInt bottomY = aDrawingRect.iBr.iY; + + TInt j = 0; + while( j < aVerticalLines ) + { + // Max used to make sure no div-by-zero + TInt currentX = ((j+indexOffset)*width) / Max(1,aVerticalLines+countOffset) - KPenWidth/2; + iLineArray.Append( TRect( currentX, topY, currentX, bottomY ) ); + j++; + } + // ------------------------------------------------------- + } + + +// --------------------------------------------------------------------------- +// SetPenStyle +// +// Set the style of drawing pen. +// See CGraphicsContext. +// --------------------------------------------------------------------------- +// +void +CCamLineVfGridDrawer::SetPenStyle( const CGraphicsContext::TPenStyle& aPenStyle ) + { + iPenStyle = aPenStyle; + } + + +// --------------------------------------------------------------------------- +// SetPenSize +// +// Set the size of drawing pen. +// See CGraphicsContext. +// --------------------------------------------------------------------------- +// +void +CCamLineVfGridDrawer::SetPenSize( const TSize& aPenSize ) + { + iPenSize = aPenSize; + } + +// --------------------------------------------------------------------------- +// SetPenColor +// +// Set the color of drawing pen. +// See CGraphicsContext. +// --------------------------------------------------------------------------- +// +void +CCamLineVfGridDrawer::SetPenColor( const TRgb aPenColor ) + { + iPenColor = aPenColor; + } + + +// =========================================================================== +// Protected part + +// --------------------------------------------------------------------------- +// ConstructL +// +// 2nd phase constructor. +// --------------------------------------------------------------------------- +// +void +CCamLineVfGridDrawer::ConstructL() + { + // empty + } + + + +// =========================================================================== +// Private part + +// --------------------------------------------------------------------------- +// C++ constructor. +// Called in 1st phase of construction. +// --------------------------------------------------------------------------- +// +CCamLineVfGridDrawer::CCamLineVfGridDrawer() + : iLineArray( KArrayGranularity ), + iVisible( EFalse ), + iPenStyle( KPenStyle ), + iPenSize( KPenWidth, KPenHeight ), + iPenColor( KPenColorRed, KPenColorGreen, KPenColorBlue, KPenColorAlpha ) + { + // empty + } + + +// ============================== end of file ================================ diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/camoneclickuploadutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/camoneclickuploadutility.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,276 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper class for implementing one-click upload support +* +*/ + + +#include +#include +#include +#include + +#include "camoneclickuploadutility.h" +#include "camlogging.h" +#include "CamPanic.h" + +const TUid KShareOnlineCrUid = { 0x2000BB53 }; +const TUint32 KShareCrApplicationVersion = 0x01010020; +const TInt KCamShareOnlineVersionBufLen = 12; +const TVersion KShareOnlineMinimumVersion( 4, 3, 0 ); +const TUid KOpenModeOneClick = { 2 }; +const TUid KCmdGetOneClickToolTip = { 15 }; + + +// ======== MEMBER FUNCTIONS ======== + + +// --------------------------------------------------------------------------- +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +CCamOneClickUploadUtility* CCamOneClickUploadUtility::NewL() + { + CCamOneClickUploadUtility* self = + new ( ELeave ) CCamOneClickUploadUtility(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// C++ constructor +// --------------------------------------------------------------------------- +// +CCamOneClickUploadUtility::CCamOneClickUploadUtility() + { + // No implementation needed + } + +// --------------------------------------------------------------------------- +// 2nd phase constructor +// --------------------------------------------------------------------------- +// +void CCamOneClickUploadUtility::ConstructL() + { + PRINT( _L( "Camera => CCamOneClickUploadUtility::ConstructL()" ) ); +#ifndef __WINSCW__ + // iUploadSupported is zeroed by CBase constructor. + // If a leave occurs here, it is left as EFalse. + // If InitializeAiwL() succeeds, it is set to ETrue. + TRAP_IGNORE( + { + CheckVersionL(); + InitializeAiwL(); + iUploadSupported = ETrue; + } ); +#else + iUploadSupported = EFalse; +#endif // __WINSCW__ + PRINT1( _L( "Camera <> iUploadSupported = %d" ), iUploadSupported ); + PRINT( _L( "Camera <= CCamOneClickUploadUtility::ConstructL()" ) ); + } + + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CCamOneClickUploadUtility::~CCamOneClickUploadUtility() + { + delete iAiwServiceHandler; + delete iTooltip; + } + + +// --------------------------------------------------------------------------- +// Check if one-click upload is supported +// --------------------------------------------------------------------------- +// +TBool CCamOneClickUploadUtility::OneClickUploadSupported() const + { + return iUploadSupported; + } + + +// --------------------------------------------------------------------------- +// Upload a file +// --------------------------------------------------------------------------- +// +void CCamOneClickUploadUtility::UploadL( const TDesC& aFilename ) + { + PRINT( _L( "Camera => CCamOneClickUploadUtility::UploadL(TDesC&)" ) ); + + CDesC16ArrayFlat* array = new ( ELeave ) CDesC16ArrayFlat( 1 ); + CleanupStack::PushL( array ); + + array->AppendL( aFilename ); + + UploadL( *array ); + + CleanupStack::PopAndDestroy( array ); + + PRINT( _L( "Camera <= CCamOneClickUploadUtility::UploadL(TDesC&)" ) ); + } + +// --------------------------------------------------------------------------- +// Upload multiple files +// --------------------------------------------------------------------------- +// +void CCamOneClickUploadUtility::UploadL( const MDesC16Array& aFilenames ) + { + PRINT( _L( "Camera => CCamOneClickUploadUtility::UploadL(MDesC16Array&)" ) ); + + __ASSERT_ALWAYS( iAiwServiceHandler, CamPanic( ECamPanicNullPointer ) ); + + CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL(); + paramList.Reset(); + + TAiwVariant openVariant( KOpenModeOneClick ); + TAiwGenericParam openParam( EGenericParamModeActivation, openVariant ); + paramList.AppendL( openParam ); + + for ( TInt i = 0; i < aFilenames.MdcaCount(); i++ ) + { + TPtrC filename = aFilenames.MdcaPoint( i ); + PRINT1( _L( "Camera <> adding file %S" ), &filename ); + TAiwVariant variant( filename ); + TAiwGenericParam param( EGenericParamFile, variant ); + paramList.AppendL( param ); + } + + iAiwServiceHandler->ExecuteServiceCmdL( + KAiwCmdUpload, + paramList, + iAiwServiceHandler->OutParamListL() ); + + PRINT( _L( "Camera <= CCamOneClickUploadUtility::UploadL(MDesC16Array&)" ) ); + } + +// --------------------------------------------------------------------------- +// Get the tooltip text for one-click upload button. +// --------------------------------------------------------------------------- +// +const TDesC& CCamOneClickUploadUtility::ButtonTooltipL() + { + __ASSERT_ALWAYS( iAiwServiceHandler, CamPanic( ECamPanicNullPointer ) ); + + CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL(); + paramList.Reset(); + + TAiwVariant openVariant( KCmdGetOneClickToolTip ); + TAiwGenericParam openParam( EGenericParamModeActivation, openVariant ); + paramList.AppendL( openParam ); + + CAiwGenericParamList& outParamList = iAiwServiceHandler->OutParamListL(); + outParamList.Reset(); + iAiwServiceHandler->ExecuteServiceCmdL( + KAiwCmdUpload, paramList, outParamList ); + + TInt index = 0; + const TAiwGenericParam* res = outParamList.FindFirst( + index, + EGenericParamNoteItem, + EVariantTypeDesC ); + + if ( !res ) + { + User::Leave( KErrArgument ); + } + + delete iTooltip; + iTooltip = NULL; + iTooltip = res->Value().AsDes().AllocL(); + return *iTooltip; + } + + +// --------------------------------------------------------------------------- +// Check Share Online version +// --------------------------------------------------------------------------- +// +void CCamOneClickUploadUtility::CheckVersionL() + { + PRINT( _L( "Camera => CCamOneClickUploadUtility::CheckVersionL()" ) ); + + CRepository* rep = CRepository::NewLC( KShareOnlineCrUid ); + TBuf versionBuf; + User::LeaveIfError( rep->Get( KShareCrApplicationVersion, versionBuf ) ); + TVersion version( 0, 0, 0 ); + TLex lex( versionBuf ); + User::LeaveIfError( lex.Val( version.iMajor ) ); + if ( lex.Get() != TChar('.') ) + { + User::Leave( KErrCorrupt ); + } + User::LeaveIfError( lex.Val( version.iMinor ) ); + if ( lex.Get() != TChar('.') ) + { + User::Leave( KErrCorrupt ); + } + User::LeaveIfError( lex.Val( version.iBuild ) ); + + PRINT3( _L( "Camera <> CCamOneClickUploadUtility::CheckVersionL() - share online %d.%d.%d" ), version.iMajor, version.iMinor, version.iBuild ); + + // Compare version number and leave if the detected + // version is less than KShareOnlineMinimumVersion. + if ( version.iMajor < KShareOnlineMinimumVersion.iMajor ) + { + User::LeaveIfError( KErrNotSupported ); + } + else if ( version.iMajor == KShareOnlineMinimumVersion.iMajor ) + { + if ( version.iMinor < KShareOnlineMinimumVersion.iMinor ) + { + User::LeaveIfError( KErrNotSupported ); + } + else if ( version.iMinor == KShareOnlineMinimumVersion.iMinor ) + { + if ( version.iBuild < KShareOnlineMinimumVersion.iBuild ) + { + User::LeaveIfError( KErrNotSupported ); + } + else + { + // Version is supported, fall through + } + } + else + { + // Version is supported, fall through + } + } + else + { + // Version is supported, fall through + } + + CleanupStack::PopAndDestroy( rep ); + + PRINT( _L( "Camera <= CCamOneClickUploadUtility::CheckVersionL()" ) ); + } + + +// --------------------------------------------------------------------------- +// Initialize AIW framework +// --------------------------------------------------------------------------- +// +void CCamOneClickUploadUtility::InitializeAiwL() + { + __ASSERT_DEBUG( !iAiwServiceHandler, CamPanic( ECamPanicResourceLeak ) ); + + iAiwServiceHandler = CAiwServiceHandler::NewL(); + iAiwServiceHandler->AttachL( R_CAM_ONE_CLICK_UPLOAD_INTEREST ); + } diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/camtextitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/camtextitem.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for rendering text based indicators on top of viewfinder +* +*/ + + +#include "camtextitem.h" +#include "AknLayout2ScalableDef.h" +#include "AknLayoutFont.h" +#include "CamUtility.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamTextItem::CCamTextItem() + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamTextItem::~CCamTextItem() + { + delete iText; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CCamTextItem* CCamTextItem::NewL() + { + CCamTextItem* self = new ( ELeave ) CCamTextItem(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamTextItem::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamTextItem::SetLayoutL( + const TRect& aParentRect, + const TAknTextComponentLayout& aLayout ) + { + const CFont* layoutFont = AknLayoutUtils::FontFromId(aLayout.LayoutLine().FontId(), 0); + layoutFont->FontSpecInTwips().iFontStyle.SetEffects(FontEffect::EOutline,ETrue); + layoutFont->FontSpecInTwips().iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap); + iLayout.LayoutText( aParentRect, aLayout.LayoutLine(), layoutFont ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamTextItem::SetTextL( const TDesC& aText ) + { + if ( !iText || aText.Compare( *iText ) ) + { + delete iText; + iText = NULL; + iText = aText.AllocL(); + TPtr textPtr = iText->Des(); + AknTextUtils::LanguageSpecificNumberConversion( textPtr ); + } + } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CCamTextItem::Draw( CBitmapContext& aBitmapContext ) const + { + if ( iText ) + { + aBitmapContext.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); + iLayout.DrawText( + aBitmapContext, + *iText, + ETrue, + KRgbBlack); + } + } + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/camvfgridfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/camvfgridfactory.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implemantation for CCamVfGridFactory class. +* +* Copyright © 2007 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. + +* +* +*/ + + +#include "camvfgridinterface.h" + +#include "camlinevfgriddrawer.h" // CCamLineVfGridDrawer + +//static +MCamVfGridDrawer* +CCamVfGridFactory::CreateVfGridDrawerL( TUid aUid ) + { + switch( aUid.iUid ) + { + case KCamLineDrawVfGridUid: + return CCamLineVfGridDrawer::NewL(); + default: + return NULL; + } + } + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/generic/src/camvideotime.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/generic/src/camvideotime.cpp Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 Dynamic Configuration +* +*/ + + +#include "camvideotime.h" + +const TReal KMetaDataCoeff = 1.03; // Coefficient to estimate metadata amount +const TUint KCamCMaxClipDurationInSecs = 5400; // Maximun video clip duration in seconds +const TReal KCMRAvgVideoBitRateScaler = 0.9; +const TUint KDiskSafetyLimit = 400000; // Amount of free disk space to leave unused + +// ----------------------------------------------------------------------------- +// TCamVideoTime::TCamVideoTime +// +// Constructor +// ----------------------------------------------------------------------------- +// +TCamVideoTime::TCamVideoTime( TInt64 aDiskSpace, + TInt64 aCriticalLimit, + TInt aVideoBitRate, + TInt aAudioBitRate, + TUint aSizeLimit, + TBool aMuteAudio, + TReal aBitrateScaler ) + { + + // Video bitrate scaler - if not given, use default + TReal scaler = KCMRAvgVideoBitRateScaler; + if( aBitrateScaler != 0 ) + { + scaler = aBitrateScaler; + } + + // Init bitrates + iVideoAverageBitRate = static_cast( aVideoBitRate * scaler ); + iAudioAverageBitRate = aAudioBitRate; + + if( aMuteAudio ) + { + iAudioAverageBitRate = 0; + } + + // Calculate available disk space, taking into account safety limit + // and disk critical level limit + iAvailableSpaceAtStart = aDiskSpace - KDiskSafetyLimit - aCriticalLimit; + if( iAvailableSpaceAtStart <= 0 ) + { + iAvailableSpaceAtStart = 0; + } + + // File size limit + iSizeLimit = aSizeLimit; + } + + + +// ----------------------------------------------------------------------------- +// TCamVideoTime::GetRemainingTimeL - from CamC3GPDataSinkImp.cpp +// +// Return the estimated remaining time for the recording in microseconds. +// This method takes into account the file size and disk full restrictions. +// ----------------------------------------------------------------------------- +// +TTimeIntervalMicroSeconds TCamVideoTime::GetRemainingTimeL() + { + TTimeIntervalMicroSeconds remaining; + TInt64 availableSpace; + TBool remainingFromSizeLimit = EFalse; + + if (iSizeLimit && ( (TInt64)iSizeLimit < iAvailableSpaceAtStart ) ) + { + // use sizelimit as available space. + remainingFromSizeLimit = ETrue; + } + + // Use average audio/video bitrates to estimate remaining time + TUint averageBitRate; + TUint averageByteRate; + + averageBitRate = (TUint)((iVideoAverageBitRate + iAudioAverageBitRate) * KMetaDataCoeff); + averageByteRate = averageBitRate / 8; + + if (remainingFromSizeLimit) + { + availableSpace = iSizeLimit; + } + else + { + availableSpace = iAvailableSpaceAtStart; + } + + if (availableSpace <= 0) + { + remaining = 0; + } + else + { + remaining = availableSpace * 1000000 / averageByteRate; // 1000000 is for conversion between microseconds and seconds + + if ( (remaining.Int64()) > (TInt64(KCamCMaxClipDurationInSecs)*1000000) ) + { + remaining = (TInt64(KCamCMaxClipDurationInSecs)*1000000); + } + } + + if ( remaining <= TInt64(0) ) + { + remaining = 0; + } + return remaining; + } + +// End of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/group/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/group/backup_registration.xml Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,4 @@ + + + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + + +#include "camproductconfig.mmh" + +// build config manager +#include _CAMERA_UI_CONFIG_MGR + +// build settings plugin +#include _SETTINGS_PLUGIN_ + + +// build camera +#include _GENERIC_BLD_ +#include _PRODUCT_EXPORTS_ +#include _CAMERA_HELPS_ + +PRJ_EXPORTS +../conf/cameraapp.confml APP_LAYER_CONFML(cameraapp.confml) +../conf/cameraapp_101FFA86.crml APP_LAYER_CRML(cameraapp_101FFA86.crml) +../conf/cameraapp_10208A43.crml APP_LAYER_CRML(cameraapp_10208A43.crml) +../conf/cameraapp_101F8809.crml APP_LAYER_CRML(cameraapp_101F8809.crml) + +../rom/cameraapp.iby CORE_APP_LAYER_IBY_EXPORT_PATH(cameraapp.iby) +../rom/cameraappresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cameraappresources.iby) + +../sis/cameraapp_stub.sis /epoc32/data/z/system/install/cameraapp_stub.sis diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/group/camproductconfig.mmh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/group/camproductconfig.mmh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project header file for Camera +* +*/ + +#ifndef CAMPRODUCTCONFIG_MMH +#define CAMPRODUCTCONFIG_MMH + +// config manager bld.inf path +#define _CAMERA_UI_CONFIG_MGR "../generic/camerauiconfigmanager/group/bld.inf" + +// settings plugin bld.inf path +#define _SETTINGS_PLUGIN_ "../generic/GsCamcorderPlugin/group/bld.inf" + +// camera bld.inf path +#define _GENERIC_BLD_ "../build/cameraapp.inf" +#define _PRODUCT_EXPORTS_ "./camproductexports.inf" + +#define _CAMERA_HELPS_ "../help/group/bld.inf" + +#endif + +// End of file + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/group/camproductexports.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/group/camproductexports.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for Camera.* +*/ + +#include + +PRJ_EXPORTS +../loc/cam.loc APP_LAYER_LOC_EXPORT_PATH(cam.loc) + +./backup_registration.xml /epoc32/data/Z/private/101FFA86/backup_registration.xml + + diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/help/data/xhtml.zip Binary file camerauis/cameraapp/help/data/xhtml.zip has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/help/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/help/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* +* Description: +* Export help related files. +* +*/ + +#include +PRJ_EXPORTS +:zip ../data/xhtml.zip /epoc32/data/z/resource/ overwrite +:zip ../data/xhtml.zip /epoc32/winscw/c/resource/ overwrite + +../inc/lcam.hlp.hrh MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/lcam.hlp.hrh) +../rom/cameraapphelps_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(cameraapphelps_variant.iby) diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/help/inc/lcam.hlp.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/help/inc/lcam.hlp.hrh Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// +// lcam.hlp.hrh generated by CSXHelp Utilities. +// + +#ifndef __LCAM_HLP_HRH__ +#define __LCAM_HLP_HRH__ + +_LIT(KLCAM_HLP_VIEWFINDER_PHOTO, "LCAM_HLP_VIEWFINDER_PHOTO"); // +_LIT( KLCAM_HLP_STANDBY_STATE, "LCAM_HLP_STANDYBY_STATE" ); //Camera standby view +_LIT( KLCAM_HLP_ADVANCED_SEQUENCE, "LCAM_HLP_ADVANCED_SEQUENCE" ); // Advanced sequence mode setting page. - obsolete +_LIT(KLCAM_HLP_CUST_TOOLBAR, "LCAM_HLP_CUST_TOOLBAR"); // +_LIT(KLCAM_HLP_LIGHT_SENSITIVITY, "LCAM_HLP_LIGHT_SENSITIVITY"); // +_LIT(KLCAM_HLP_SETTINGS_PHOUSER, "LCAM_HLP_SETTINGS_PHOUSER"); // +_LIT(KLCAM_HLP_SCENES_PHOTO, "LCAM_HLP_SCENES_PHOTO"); // +_LIT(KLCAM_HLP_SETTINGS, "LCAM_HLP_SETTINGS"); // +_LIT(KLCAM_HLP_SETTINGS_PHOTO, "LCAM_HLP_SETTINGS_PHOTO"); // +_LIT(KLCAM_HLP_VIEWFINDER_VIDEO, "LCAM_HLP_VIEWFINDER_VIDEO"); // +_LIT(KLCAM_HLP_SCENES_VIDEO, "LCAM_HLP_SCENES_VIDEO"); // +_LIT(KLCAM_HLP_SETTINGS_VIDEO, "LCAM_HLP_SETTINGS_VIDEO"); // +_LIT(KLCAM_HLP_VIEWFINDER_VIDEO_EM, "LCAM_HLP_VIEWFINDER_VIDEO_EM"); // +_LIT(KLCAM_HLP_STANDYBY_EM, "LCAM_HLP_STANDYBY_EM"); // +_LIT(KLCAM_HLP_POST_VIDEO, "LCAM_HLP_POST_VIDEO"); // +_LIT(KLCAM_HLP_VIEWFINDER_PHOTO_EM, "LCAM_HLP_VIEWFINDER_PHOTO_EM"); // +_LIT(KLCAM_HLP_POST_PHOTO, "LCAM_HLP_POST_PHOTO"); // +_LIT(KLCAM_HLP_POST_SEQ, "LCAM_HLP_POST_SEQ"); // + +#endif \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/help/rom/cameraapphelps_variant.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/help/rom/cameraapphelps_variant.iby Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __CAMERAAPPHELPS_VARIANT_IBY__ +#define __CAMERAAPPHELPS_VARIANT_IBY__ + +#if defined(FF_S60_HELPS_IN_USE) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F857A\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x101F857A\contents.zip) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F857A\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101F857A\index.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F857A\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101F857A\keywords.xml) + data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x101F857A\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x101F857A\meta.xml) +#endif + +#endif \ No newline at end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/loc/cam.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/loc/cam.loc Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,4201 @@ +/* +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File to conditionally include specific language localised text files +* +*/ + + + +// The Text in source files is encoded in UTF-8 + +CHARACTER_SET UTF8 + +// LOCALISATION STRINGS + +// Application Name + +//d:Name of the application shown in the +//d:application grid +//l:cell_app_pane_t1 +// +#define qtn_apps_lcam_grid "Camera" + +//d:Name of the application shown in the +//d:task list +//l:list_single_large_graphic_pane_t1 +// +#define qtn_apps_lcam_list "Camera" + +//---------------------------------------------------- + + +//d:Command text when video recording paused. +//d:Visible in CBA in video pre-capture view. +//l:control_pane_t1/opt7 +// +#define qtn_lcam_softkey_continue "Continue" + +//d:Command text for delete key . +//d:Visible in CBA in post-capture view. +//l:control_pane_t1/opt7 +// +#define qtn_lcam_softkey_delete "Delete" + +//d:Command text to start self-timer countdown +//d:Visible in CBA when in self-timer idle state +//d:qtn_lcam_softkey_activate +//l:control_pane_t1/opt7 +// +#define qtn_lcam_softkey_activate "Activate" + +//d:MSK string in Image PreCapture View +//l:control_pane_t3/opt7 +//r:9.1 +#define qtn_lcam_msk_capture "Capture" + +//d:MSK string in Video PreCapture View +//l:control_pane_t3/opt7 +//r:9.1 +#define qtn_lcam_msk_record "Record" + +//---------------------------------------------------- + +//d:Options menu item for renaming captured image. +//d:Visible in Options-menu in image post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_cmd_rename_image "Rename image" + +//d:Options menu item for renaming captured video. +//d:Visible in Options-menu in video post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_cmd_rename_video "Rename video" + +//d:Options menu item for printing the current image +//d:Visible in options menu in image post-capture view +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_print_photo "Print" + +//d:Options menu item for muting audio in embedded video. +//d:Visible in Options-menu in pre-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_mute "Mute" + +//d:Options menu item for un-muting audio in embedded video. +//d:Visible in Options-menu in pre-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_unmute "Unmute" + +//d:Options menu item for switching to secondary camera. +//d:Visible in options menu in primary camera pre-capture view +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_cam2 "Use secondary camera" + +//d:Options menu item for switching to primary camera. +//d:Visible in options menu in secondary camera pre-capture view +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_cam1 "Use main camera" + +//d:Options menu item for opening send to caller sub-menu. +//d:Visible when there is an active call in +//d:Options-menu in post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_send_to_call "Send to caller" + +//d:Options menu item for switching to pre-capture mode from standby. +//d:Visible in Options-menu in standby mode. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_cmd_continue "Continue" + +//d:Options menu item for switching to burst pre-capture view. +//d:Visible in Options-menu in burst post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_new_photos "New images" + +//d:Options menu item for playing the video (in media player). +//d:Visible in Options-menu in video post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_play "Play" + +//d:Options menu item for switching to Video capture mode. +//d:Visible in Options-menu in pre-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_video_mode "Video mode" + +//d:Options menu item for switching to still image capture mode. +//d:Visible in Options-menu in video pre-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_photo_mode "Image mode" + +//d:Options menu item for accessing the Free Memory View of the Media Gallery. +//d:Visible in Options-menu in pre-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_memory "Go to free memory" + +//d:Options menu item for accessing the MC Photos application +//d:Visible in Options-menu in pre and post capture views +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_go_to_photos "Go to Photos" + +//d:Options menu item for accessing the image details +//d:Visible in Options-menu in post capture views +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_tags "Properties" + +//d:Options menu item for adding shown image into album +//d:Visible in Options-menu in post capture views +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_add_to_album "Add to Album" +//d:Options menu item opening a highlighted burst mode image +//d:Options-menu in burst post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_open_photo "Open image" + +//d:Options menu item for deleting image. +//d:Visible in Options-menu in post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_delete "Delete" + +//d:Options menu item for deleting image sequence. +//d:Visible in Options-menu in time lapse post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_deleteall "Delete sequence" + +//d:Options menu item for switching to settings view. +//d:Visible in Options-menu in pre-capture views. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_cmd_settings "Settings" + +//d:Options menu item for select +//d:Visible in Options-menu in pre-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_select "Select" + +//d:Options menu item for back. +//d:Visible in Options-menu in embedded pre-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_options_back "Back" + +//d:Options menu item sets captured video as ring tone +//d:Options-menu in video post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_set_as_ringing_tone_video "Set as ringing tone" + +//d:Options menu item sets captured video as contact ring tone +//d:Options-menu in video post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_set_as_contact_ringing_tone_video "Set as contact ringing tone" + +//d:Options menu item sets captured photo as contact call image +//d:Options-menu in photo post-capture view. +//l:list_single_pane_t1_cp2/opt3 +// +#define qtn_lcam_options_set_as_contactcall "Set as contact call image" + +//---------------------------------------------------- +// Tooltip texts for active palette + +//d:Tooltip item for scene. +//d:Visible in pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_scene "Scene modes" + +//d:Tooltip item for whitebalance. +//d:Visible in pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_wb "White balance" + +//d:Tooltip item for exposure value. +//d:Visible in pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_ev "Exposure compensation" + +//d:Tooltip item for colour tone. +//d:Visible in pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_coltone "Colour tone" + +//d:Tooltip item for play. +//d:Visible in video post-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_play "Play" + +//d:Tooltip item for new video. +//d:Visible in video post-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_newvideo "New video" + +//d:Tooltip item for send. +//d:Visible in post-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_send "Send" + +//d:Tooltip item for send to caller +//d:Visible in post-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_sendtocall "Send to caller" + + +// + +//d:Tooltip item for print. +//d:Visible in post-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_print "Print" + +//d:Tooltip item for delete. +//d:Visible in post-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_delete "Delete" + +//d:Tooltip item for new image. +//d:Visible in image post-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_newphoto "New image" + +//d:Tooltip item for switch to image mode +//d:Visible in video pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_switch_image "Switch to image mode" + +//d:Tooltip item for switch to video mode +//d:Visible in image pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_switch_video "Switch to video mode" + +//d:Tooltip item for flash mode +//d:Visible in pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_flash "Flash mode" + +//d:Tooltip item for ISO Setting +//d:Visible in pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_isosetting "Light sensitivity" + +//d:Tooltip item for self-timer +//d:Visible in pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_st "Self timer" + +//d:Tooltip item for sequence mode +//d:Visible in pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_sequence "Switch to sequence mode" + +//d:Tooltip item for normal mode +//d:Visible in sequence pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_normal "Switch to normal mode" + +//d:Tooltip item for add to print basket +//d:Visible in image pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_printbasket "Add to print basket" + +//d:Tooltip item for remove from print basket +//d:Visible in image pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_remprintbasket "Remove from print basket" + +//d:Tooltip item for video flash assist on +//d:Visible in video pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_videoflash "Switch video light on" + +//d:Tooltip item for video flash assist off +//d:Visible in video pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_flashoff "Switch video light off" + +//d:Tooltip item for sequence mode +//d:Visible in advanced sequence pre-capture view active palette +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_adv_sequence "Sequence mode" + +//d:Tooltip item for image sharpness +//d:Visible in image pre-capture view active palette +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_sharp "Sharpness" + +//d:Tooltip item for contrast +//d:Visible in image pre-capture view active palette +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_contr "Contrast" + +//d:Tooltip item for brightness +//d:Visible in image pre-capture view active palette +//d:For cameraapp Increment 3.1, Release 6 +//r:3.1 +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_bright "Brightness" + + +// + +//d:Tooltip item for viewfinder grid +//d:Visible in image pre-capture view active palette. +//d:Visible when grid is not yet shown and can turned on. +//d:Counterpart to qtn_lcam_tt_hide_viewfinder_grid. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_show_viewfinder_grid "Show viewfinder grid" + +//d:Tooltip item for viewfinder grid +//d:Visible in image pre-capture view active palette. +//d:Visible when grid is already shown and can turned off. +//d:Counterpart to qtn_lcam_tt_show_viewfinder_grid. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_hide_viewfinder_grid "Hide viewfinder grid" +// + +// + +//d:Tooltip item for histogram +//d:Visible in image pre-capture view active palette. +//d:Visible when histogram is not yet shown and can be turned on. +//d:Counterpart to qtn_lcam_tt_hide_histogram. +//l:main_cam5_pane_t11 +//r:4.0 +#define qtn_lcam_tt_show_histogram "Show histogram" + +//d:Tooltip item for histogram +//d:Visible in image pre-capture view active palette. +//d:Visible when histogram is already shown and can be turned off. +//d:Counterpart to qtn_lcam_tt_show_histogram. +//l:main_cam5_pane_t11 +//r:4.0 +#define qtn_lcam_tt_hide_histogram "Hide histogram" + +// + +// + +//d:Tooltip item for add to album +//d:Visible in image post-capture view active palette. +//d:Visible when snapshot is shown and can be added to album. +//l:main_cam5_pane_t11 +//r: 4.0 +#define qtn_lcam_tt_add_to_album "Add to album" + +// + + +//---------------------------------------------------- + +//d:View title +//d:In still pre-capture view +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_text_camera "Camera" + +//d:View title +//d:In video pre-capture view +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_text_video_camera "Video camera" + +//d:View title +//d:In video settings view +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_text_vidsetting "Video settings" + +//d:View title +//d:In photo settings view +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_text_photsetting "Image settings" + +//d:View title +//d:In video scene settings mode +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_text_scenes_vid "Scene modes" + +//d:View title +//d:In still scene settings mode +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_text_scenes_phot "Scene modes" + +//d:View title +//d:In still user scene setup mode +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_text_photoscene "Image user scene" + +//d:View title +//d:In video quality settings popup +//l:title_pane_t2/opt9 +// +#define qtn_lcam_sett_title_vi_type "Video quality" + +//d:View title +//d:In image quality settings popup +//l:title_pane_t2/opt9 +// +#define qtn_lcam_sett_title_ph_resolut "Image quality" + +//d:View title +//d:In advanced sequence mode popup +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_tl "Sequence mode" + +//---------------------------------------------------- + +//d:Night scene title text +//d:Visible in user scene setting list +//l: list_single_pane_t1 +// +#define qtn_lcam_user_scene_night "Night" + +//d:Auto scene title text +//d:Visible in user scene setting list +//l: list_single_pane_t1 +// +#define qtn_lcam_user_scene_auto "Auto" + +//d:Macro scene title text +//d:Visible in user scene setting list +//l: list_single_pane_t1 +// +#define qtn_lcam_user_scene_macro "Close-up mode" + +//d:Portrait scene title text +//d:Visible in user scene setting list +//l: list_single_pane_t1 +// +#define qtn_lcam_user_scene_port "Portrait" + +//d:Landscape scene title text +//d:Visible in user scene setting list +//l: list_single_pane_t1 +// +#define qtn_lcam_user_scene_land "Landscape" + +//d:Night portrait scene title text +//d:Visible in user scene setting list +//l: list_single_pane_t1 +// +#define qtn_lcam_user_scene_nightport "Night portrait" + +//d:Sport scene title text +//d:Visible in user scene setting list +//l: list_single_pane_t1 +// +#define qtn_lcam_user_scene_sport "Sport" + +//---------------------------------------------------- + +//d:Night scene title text +//d:Visible in user scene setting list +//l: cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_user_scene_night_v2 "Night" + +//d:Auto scene title text +//d:Visible in user scene setting list +//l: cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_user_scene_auto_v2 "Auto" + +//d:Macro scene title text +//d:Visible in user scene setting list +//l: cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_user_scene_macro_v2 "Close-up mode" + +//d:Portrait scene title text +//d:Visible in user scene setting list +//l: cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_user_scene_port_v2 "Portrait" + +//d:Landscape scene title text +//d:Visible in user scene setting list +//l: cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_user_scene_land_v2 "Landscape" + +//d:Night portrait scene title text +//d:Visible in user scene setting list +//l: cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_user_scene_nightport_v2 "Night portrait" + +//d:Sport scene title text +//d:Visible in user scene setting list +//l: cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_user_scene_sport_v2 "Sport" + +//---------------------------------------------------- + +//d:Titles for photo capture tone item in photo settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_tone "Capture tone" + +//d:Current base scene. +//d:Shown in user scene setting list +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_user_scene "Based on scene mode" + +//d:Flash setting item +//d:Shown in user scene setting list +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_user_flash "Flash" + +//d:Whitebalance setting item +//d:Shown in user scene setting list +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_user_wb "White balance" + +//d:Exposure value setting item +//d:Shown in user scene setting list +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_user_ev "Exposure compensation" + +//d:Colour effect setting item +//d:Shown in user scene setting list +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_user_ce "Colour tone" + +//d:Sharpness setting item +//d:Shown in user scene setting list +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_user_sharp "Sharpness" + +//d:Contrast setting item +//d:Shown in user scene setting list +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_user_contr "Contrast" + +//d:Brightness setting item +//d:Shown in user scene setting list +//d:For cameraapp Increment 3.1, Release 6 +//r:3.1 +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_user_bright "Brightness" + +//d:Reset user scene setting item +//d:Shown in user scene setting list +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_user_reset "Reset user scene" + +//d:Title for restore camera settings item in photo/video settings list +//l:list_single_pane_t1 +// +#define qtn_lcam_sett_attr_reset "Restore camera settings" + +//d:Title for photo base name item in photo settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_name_base "Default image name" + +//d:Title for video base name item in video settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_video_name "Default video name" + +//d:Title for extended zoom item in photo settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_zoom "Extended digital zoom" + +// + +//d:Title for red eye removal item in photo settings list +//l:list_setting_pane_t1 +//r:4.0 +#define qtn_lcam_sett_attr_red_eye_rem "Red eye removal" + +// + +// +//d:Title for digital zoom item in photo settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_zoom_digital "Digital zoom" +// + + + +//d:Titles for optical zoom in video settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_opzoom_off "Optical zoom during recording" + +//d:Title for audio recording item in video settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_audio_rec "Audio recording" + +//d:Title for continuous auto-focus item in video settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_cont_af "Continuous auto-focus" + +//d:Title for video quality item in video settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_vi_type "Video quality" + +//d:Title for video stabilisation item in video settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_vid_stable "Video stabilisation" + +//d:Title for store in album item in settings lists +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_add_toalbum "Add to album" + +//d:Title for show captured video item in video settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_post_vi "Show last captured video" + +//d:Title for video media storage item in video settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_store "Memory in use" + +//d:Titles for photo quality item in photo settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_quality "Image quality" + +//d:Title for show captured photo item in photo settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_post_ph "Show captured image" + +//d:Data query header for inputting new video name +//l:popup_query_data_window_t3/opt2 +// +#define qtn_lcam_query_video_name "Video name:" + +//d:Data query header for inputting new image name +//l:popup_query_data_window_t3/opt2 +// +#define qtn_lcam_query_image_name "Image name:" + +//d:Data query header for inputting default image name +//l:popup_query_data_window_t3/opt2 +// +#define qtn_lcam_query_default_image_name "Default image name:" + +//d:Data query header for inputting default video name +//l:popup_query_data_window_t3/opt2 +// +#define qtn_lcam_query_default_video_name "Default video name:" + +//d:ISO setting setting item +//d:Shown in user scene setting list +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_user_iso "Light sensitivity value" + +//d:Title for Tilt sensor Rotate Image item in settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_tsensor "Rotate image" + + +// +//d:Title for flicker cancellation item in image capture settings list +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_flickr "Flicker cancellation" +// + +//---------------------------------------------------- + +//d:View title +//d:In capture setup mode +//l:main_cam5_pane_t2 +// +#define qtn_lcam_title_subm_flash "Flash" + +//d:View title +//d:In capture setup mode +//l:main_cam5_pane_t2 +// +#define qtn_lcam_title_subm_wb "White balance" + +//d:View title +//d:In capture setup mode +//l:main_cam5_pane_t2 +// +#define qtn_lcam_title_subm_ev "Exposure compensation" + +//d:View title +//d:In capture setup mode +//l:main_cam5_pane_t2 +// +#define qtn_lcam_title_subm_ceff "Colour tone" + +//d:View title +//d:In capture setup mode +//l:main_cam5_pane_t2 +// +#define qtn_lcam_title_subm_sharp "Sharpness" + +//d:View title +//d:in capture setup mode +//l:main_cam5_pane_t2 +// +#define qtn_lcam_title_subm_contr "Contrast" + +//d:View title in capture setup mode +//d:For cameraapp Increment 3.1, cameraapp Release 6 +//r:3.1 +//l:main_cam5_pane_t2 +// +#define qtn_lcam_title_subm_bright "Brightness" + +//d:View title +//d: +//l:main_cam5_pane_t2 +// +#define qtn_lcam_title_selftimer "Self timer" + + +//d:View title +//d:In capture setup mode +//l:main_cam5_pane_t2 +// +#define qtn_lcam_title_subm_iso "Light sensitivity" + +//---------------------------------------------------- + +//d:Item text for flash auto value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_auto "Automatic" + +//d:Item text for flash forced value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_force "On" + +//d:Item text for flash off value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_flash_off "Off" + +//d:Item text for flash redeye reduction value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_redeye "Red eye redu." + +//---------------------------------------------------- + +//d:Item text for white balance auto value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_awb "Automatic" + +//d:Item text for white balance daylight value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_day "Sunny" + +//d:Item text for white balance cloudy value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_cloud "Cloudy" + +//d:Item text for white balance tungsten value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_tung "Incandescent" + +//d:Item text for white balance fluorescent value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_flu "Fluorescent" + +//---------------------------------------------------- + +//d:Item text for colour filter colour value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_col "Normal" + +//d:Item text for colour filter sepia value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_sep "Sepia" + +//d:Item text for colour filter black and white value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_bw "Black & white" + +//d:Item text for colour filter vivid colours value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_neg "Negative" + +//d:Item text for colour filter vivid colours value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_viv "Vivid" + +//---------------------------------------------------- + +//d:Item text for ISO value automatic ISO setting +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_isoauto "Auto" + +//d:Item text for ISO value Low ISO setting +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_isolow "Low" + +//d:Item text for ISO value Medium ISO setting +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_isomedium "Medium" + +//d:Item text for ISO value High ISO setting +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_isohigh "High" + +//---------------------------------------------------- +// Image quality setting texts + +// +//d:Image quality slider bar top subtitle +//d:Visible in image quality slider control. +//l:main_cam5_pane_t6 +// +#define qtn_lcam_quality_subtitle_maximum "Maximum" + +//d:Image quality slider bar bottom subtitle +//d:Visible in image quality slider control. +//l:main_cam5_pane_t6 +// +#define qtn_lcam_quality_subtitle_minimum "Low" +// + +// Video quality setting texts + +//d:Video quality slider bar top sub title +//d:Visible in video quality slider control. +//l:main_cam5_pane_t6 +// +#define qtn_lcam_quality_subtitle_vmax "High" + +//d:Video quality slider bar top sub title +//d:Visible in video quality slider control. +//l:main_cam5_pane_t6 +// +#define qtn_lcam_quality_subtitle_vmin "Low" + +//---------------------------------------------------- + +//d:Text placed above video time remaining counter +//d:Visible in video quality slider control. +//l:main_cam5_pane_t5 +// +#define qtn_lcam_video_remain "Record time available" + +//d:Text placed above image counter +//d:Visible in image quality slider control. +//l:main_cam5_pane_t5 +// +#define qtn_lcam_image_remain "Images remaining" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print9mlarge "Print 9M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print8mlarge "Print 8M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print6mlarge "Print 6M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print5mlarge "Print 5M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print3mlarge "Print 3M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print2mlarge "Print 2M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print3mmed "Print 3M - Med." + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print2mmed "Print 2M - Med." + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +#define qtn_lcam_sett_attr_quality_print1med "Print 1M - Med." + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print1_3small "Print/Email 1.3M - Small" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print1_0small "Print/Email 1M - Small" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print0_8med "Email 0.8M - Med." + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_mms "MMS 0.3M - Small" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_type_high "High" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_type_normal "Normal" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_type_sharing "Sharing" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_type_tvhigh "4:3 resolution high quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_type_tvnorm "4:3 resolution normal quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_type_webhigh "Email high quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_type_webnorm "Email normal quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_type_mms "Sharing quality" + + +//---------------------------------------------------- + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_print9m "Capture images with 16:9 aspect ratio" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_print8m "Use for large sized prints up to 16 x 12 in (41x31 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_print6m "Capture images with 16:9 aspect ratio" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_print5m "Use for large sized prints up to 14x11 in (36x28 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_print3m "Use for prints up to 10x8 in (25x20 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_print2m "Use for prints up to 7x5 in (18x13 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_print1_3m "Use for prints up to 6x4 in (15x10 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_print1m "Use for prints up to 6x4 in (15x10 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_low "Ideal image size to send via Multimedia message (MMS)" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_vhigh "Use for best quality playback through handset or PC" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_vnorm "Standard quality for playback through handset" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_vshare "Limited video clip size to send using multimedia message (MMS)" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//d:Before : "Best quality for long term usage and playback on TV/PC and handset" +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_tvhigh "Best quality for playback on displays using 4:3 aspect ratio" + + +//d:Video quality setting description +//d:Visible in video quality slider control. +//d:Before : "Standard quality for long term usage and playback on TV/PC and handset" +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_tvnorm "Standard quality for playback on displays using 4:3 aspect ratio" + + +//d:Video quality setting description +//d:Visible in video quality slider control. +//d:Before : "Best quality for playback through handset and compatible with other mobile phones" +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_webhigh "Best quality for uploading videos" + + +//d:Video quality setting description +//d:Visible in video quality slider control. +//d:Before : "Standard quality for playback through handset and compatible with other mobile phones" +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_webnorm "Standard quality for uploading videos" + + + + + +//---------------------------------------------------- + +// +//d:Item text for increased value +//d:Visible in set_up lists (e.g. for brightness) +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_increased "Increased" + +//d:Item text for decreased value +//d:Visible in set_up lists (e.g. for brightness) +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_decreased "Decreased" + +// +// ------------------------------------- +// Zoom options if only digital zoom available + +//d:Item value for photo settings list +//d:Extended digital zoom is disabled with this setting. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_ex_set_off "Off" + + +//d:Item value for photo settings list +//d:Extended digital zoom is enabled with this setting. +//d:When selected, transition from digital to extended digital +//d:zoom range is done smoothly, without a pause. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_ex_set_oncont "On (continuous)" + + +//d:Item value for photo settings list +//d:Extended digital zoom is enabled with this setting. +//d:When selected, transition from digital to extended digital +//d:zoom range causes a pause in the zooming. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_ex_set_onpause "On (paused)" + +// + +//d:Item value for photo settings list +//d:Red eye removal is enabled with this setting. +//l:list_set_graphic_pane_t1 +//r:4.0 +#define qtn_lcam_set_land_img_redeye_rem_on "On" + +//d:Item value for photo settings list +//d:Red eye removal is disabled with this setting. +//l:list_set_graphic_pane_t1 +//r:4.0 +#define qtn_lcam_set_land_img_redeye_rem_off "Off" + +// + +// ------------------------------------- +// Zoom options if optical zoom available + +//d:Item value for photo settings list +//d:When selected, the digital zoom functionality is +//d:switched off, leaving only the optical zoom. +//d:Used only in products with optical zoom. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_zoom_digital_off "Off" + + +//d:Item value for photo settings list +//d:When selected, the extended digital zoom is switched off, +//d:but the default digital zoom functionality will remain on and +//d:a transition from optical to digital zoom range +//d:results in a pause in the zooming. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_on_zoom_pause "On (paused)" + +//d:Item value for photo settings list +//d:When selected, the extended digital zoom is switched off, +//d:but the default digital zoom functionality will remain on and +//d:a transition from optical to digital zoom range +//d:is done smoothly without a pause. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_on_zoom_cont "On (continuous)" + + +//d:Item value for photo settings list +//d:Extended digital zoom is enabled with this setting. +//d:When selected, transition from digital to extended digital +//d:zoom range causes a pause in the zooming. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_on_zoom_ex_pause "Extended on (paused)" + +//d:Item value for photo settings list +//d:Extended digital zoom is enabled with this setting. +//d:When selected, transitions from optical to digital and +//d:digital to extended digital zoom range are done smoothly +//d:without a pause. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_on_zoom_ex_cont "Extended on (continuous)" +// ------------------------------------- +// + + + +//d:Item in setting page for selecting text as photo/video name base type. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_pop_text "Text" + +//d:Item in setting page for selecting date as photo/video name base type. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_pop_date "Date" + + +//d:Item in video setting list for switching off audio recording +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_audio_off "Mute" + +//d:Capture tone setting in photo settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_camera_1 "Camera 1" + +//d:Capture tone setting in photo settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_camera_2 "Camera 2" + +//d:Capture tone setting in photo settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_camera_3 "Camera 3" + +//d:Capture tone setting in photo settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_camera_4 "Camera 4" + +//---------------------------------------------------- + +//d:Night scene title text +//d:Visible in scene settings page +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_scene_night "Night" + +//d:User scene title text +//d:Visible in scene settings page +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_scene_user "User defined" + +//d:Auto scene title text +//d:Visible in scene settings page +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_scene_auto "Auto" + +//d:Macro scene title text +//d:Visible in scene settings page +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_scene_macro "Close-up mode" + +//d:Portrait scene title text +//d:Visible in scene settings page +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_scene_port "Portrait" + +//d:Landscape scene title text +//d:Visible in scene settings page +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_scene_land "Landscape" + +//d:Night portrait scene title text +//d:Visible in scene settings page +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_scene_nightport "Night portrait" + +//d:Sport scene title text +//d:Visible in scene settings page +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_scene_sport "Sport" + +//---------------------------------------------------- +//d:Night scene descriptive text +//d:In scene settings list +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_night_ex "Ideal for taking pictures in low light without flash" + +//d:User scene descriptive text +//d:In scene settings list +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_user_ex "Create personalised settings for instant retrieval - adjust and keep your favourite settings" + + +//d:Auto scene descriptive text +//d:In scene settings list +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_auto_ex "Ideal for everyday photography - all settings are adjusted automatically for you" + +//d:Macro scene descriptive text +//d:In scene settings list +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_macro_ex "Ideal for capturing small objects between 10 and 60cm" + +//d:Portrait scene descriptive text +//d:In scene settings list +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_port2_ex "Ideal for shooting better portrait photos" + +//d:Landscape scene descriptive text +//d:In scene settings list +//d:Used in auto focus products +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_land_ex "Ideal for shooting distant scenerys" + +//d:Landscape scene descriptive text +//d:In scene settings list +//d:Used in fixed focus products +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_land2_ex "Ideal for shooting better outdoor scenery photos" + +//d:Night portrait scene descriptive text +//d:In scene settings list +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_nightport_ex "Ideal for taking portraits in low light with flash" + +//d:Auto (video mode) text scene descriptive text +//d:In video scene settings list +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_vid_auto_ex "Ideal for filming everyday moments" + +//d:Night (video mode) text scene descriptive text +//d:In video scene settings list +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_vid_night_ex "Ideal for filming in low light" + +//d:Sport scene descriptive text +//d:In image scene settings list +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_sport_ex "Ideal for capturing fast moving subject matter" + +//---------------------------------------------------- +// Settings value indicators + +//d:Value of plus two for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_plus2 "+2" + +//d:Value of plus 1.5 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_plus1_5 "+1.5" + +//d:Value of plus one for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_plus1 "+1" + +//d:Value of plus 0.5 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_plus0_5 "+0.5" + +//d:Value of zero for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_0 "0" + +//d:Value of minus 0.5 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_minus0_5 "-0.5" + +//d:Value of minus one for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_minus1 "-1" + +//d:Value of minus 1.5 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_minus1_5 "-1.5" + +//d:Value of minus two for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_minus2 "-2" + +//d:Value of plus 1.7 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_plus1_7 "+1.7" + +//d:Value of plus 1.3 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_plus1_3 "+1.3" + +//d:Value of plus 0.7 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_plus0_7 "+0.7" + +//d:Value of plus 0.3 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs)t +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_plus0_3 "+0.3" + +//d:Value of minus 0.3 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_minus0_3 "-0.3" + +//d:Value of minus 0.7 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_minus0_7 "-0.7" + +//d:Value of minus 1.3 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_minus1_3 "-1.3" + +//d:Value of minus 1.7 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cam5_pane_t3 +// +#define qtn_lcam_ev_minus1_7 "-1.7" + +//---------------------------------------------------- + +//d:Query dialog when user selects restore camera settings +//l:popup_note_window +// +#define qtn_lcam_restore_query "Restore image and video settings?" + +//d:Label for wait note when setting wallpaper image +//l:popup_note_wait_window +// +#define qtn_lcam_loading_image "Loading image" + +//d:Saving video wait note text +//d:In video pre-capture view +//l:popup_note_wait_window +// +#define qtn_lcam_note_saving_video "Saving video clip" + +// + +//d:Saving a photo wait note text +//d:Displayed in the event of Photo mode buffer overflow +//l:popup_note_wait_window +//r:4.0 +#define qtn_lcam_note_saving_image "Saving image" + +// + +//d:Saving photos wait note text +//d:Displayed in the event of Photo mode buffer overflow +//l:popup_note_wait_window +// +#define qtn_lcam_note_saving_images "Saving images" + +//---------------------------------------------------- + +//d:Delete video confirmation note text +//d:In video post-capture view +//l:popup_note_window +// +#define qtn_lcam_note_delete_video "Delete video clip?" + +//d:Delete image confirmation note text +//d:In still post-capture view +//l:popup_note_window +// +#define qtn_lcam_note_delete_photo "Delete image?" + +//d:Hardware failure error note text +//l:main_list_empty_pane +// +#define qtn_lcam_standby_hardware_failure "Unexpected error occurred. Power off the device and restart" + +//d:Camera in use error note text +//l:main_list_empty_pane +// +#define qtn_lcam_standby_camera_in_use "Camera already in use by an app" + +//d:Memory full error note text +//d:The same error text is used if either memory card or internal memory is full +//l:popup_note_window +// +#define qtn_lcam_note_memory_full "Memory full - Change storage location?" + +//d:All memory full error note text +//l:popup_note_window +// +#define qtn_lcam_note_allmemory_full "Memory full. Unable to save image. Delete some data first" + +//d:Internal memory full note text +//l:popup_note_window +// +#define qtn_lcam_note_internal_full "Internal memory full - Please delete some data" + +//d:Card memory full; switch to Internal memory query note text +//l:popup_note_window +// +#define qtn_lcam_note_card_mem_full "Card memory full - Change storage location to internal memory?" + +//d:Internal memory full; switch to Card memory query note text +//l:popup_note_window +// +#define qtn_lcam_note_internal_mem_full "Internal memory full - Change storage location to card memory?" + +//d:Memory card not accessible error note text +//l:popup_note_window +// +#define qtn_lcam_mmc_not_inserted "Memory card is not accessible. Phone memory will be used instead" + +//d:Memory card read only error note text +//l:popup_note_window +// +#define qtn_lcam_mmc_read_only "Memory card is read only. Phone memory will be used instead" + +//d:Restore user scene settings confirmation note text +//l:popup_note_window +// +#define qtn_lcam_note_user_reset "Restore user scene settings?" + +//---------------------------------------------------- + +//d:Camera timed out text +//l:main_list_empty_pane +// +#define qtn_lcam_standby_timeout_expired "Camera on standby" + +// Namebase + +//d:Default video base name +//d:Used as a stub for a video name in the title pane +//l:main_cam5_pane_t10 +// +#define qtn_lcam_namebase_video "Video" + +//d:Default photo base name +//d:Used as a stub for a photo name in the title pane +//l:main_cam5_pane_t10 +// +#define qtn_lcam_namebase_image "Image" + +//d:Title for the popup selection list showing available albums +//l:heading_pane_t1 +// +#define qtn_lcam_select_album "Select album:" + +//d:Shown when no albums in gallery +//d:Visible in a popup list when there are no albums to list +//l:main_cam5_pane_t12/opt3 +// +#define qtn_lcam_note_noalbums "(No albums) Create new albums in Gallery" + +//d:Represents number of images captured in a sequence +//d:Visible in navi-pane after sequence capture +//l:navi_text_pane_t1 +// +#define qtn_lcam_images_captured "Images captured %N" + + +//d:Represents time between image captures in sequence +//d:Visible in navi-pane during sequence capture +//l:navi_text_pane_t1 +// +#define qtn_lcam_time_cap "%U" + +//---------------------------------------------------- + +//d:Menu item for 2 sec selftimer activation +//d:Visible in selftimer submenu +//l:main_cam5_pane_t1 +// +#define qtn_lcam_st_2 "2 seconds" + +//d:Menu item for 10 sec selftimer activation +//d:Visible in selftimer submenu +//l:main_cam5_pane_t1 +// +#define qtn_lcam_st_10 "10 seconds" + +//d:Menu item for 20 sec selftimer activation +//d:Visible in selftimer submenu +//l:main_cam5_pane_t1 +// +#define qtn_lcam_st_20 "20 seconds" + +//d:Menu item for selftimer deactivation +//d:Visible in selftimer submenu +//l:main_cam5_pane_t1 +// +#define qtn_lcam_st_off "Off" + + +//---------------------------------------------------- + +//d:Item text for sharpness hard value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_hard "Hard" + +//d:Item text for sharpness normal value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_normal "Normal" + +//d:Item text for sharpness soft value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_soft "Soft" + +//---------------------------------------------------- + +//d:Legend for positive brightness. +//d:Shown brightness/contrast setup +//l:main_cam5_pane_t9 +// +#define qtn_lcam_set_plus "+" + +//d:legend for negative brightness. +//d:Shown brightness/contrast setup +//l:main_cam5_pane_t9 +// +#define qtn_lcam_set_minus "-" + +// +// --------------------------------------------------------- +// Light sensitivity (ISO value) setting page + +//d:View title. +//d:Visible in Image light sensitivity setting page. +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_selector_iso "Light sensitivity" + +// ------------------------------------- +// Light sensitivity setting titles + +//d:Title text for light sensitivity setting. +//d:Stands for automatic setting. +//d:Visible in light sensitivity setting page and user scene setting list. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_iso_auto "Auto" + +//d:Title text for sensitivity setting. +//d:Stands for lowest setting. +//d:Visible in light sensitivity setting page and user scene setting list. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_iso_low "Low" + +//d:Title text for sensitivity setting. +//d:Stands for medium-low setting. +//d:Visible in light sensitivity setting page and user scene setting list. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_iso_low_medium "Low - Medium" + +//d:Title text for sensitivity setting. +//d:Stands for medium setting. +//d:Visible in light sensitivity setting page and user scene setting list. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_iso_medium "Medium" + +//d:Title text for sensitivity setting. +//d:Stands for medium-high setting. +//d:Visible in light sensitivity setting page and user scene setting list. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_iso_medium_high "Medium - High" + +//d:Title text for sensitivity setting. +//d:Stands for highest setting. +//d:Visible in light sensitivity setting page and user scene setting list. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_iso_high "High" + + +// ------------------------------------- +// Light sensitivity setting descriptions + + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_auto setting. +//d:Visible in light sensitivity setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_iso_auto_ex "Use in everyday situations" + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_low setting. +//d:Visible in light sensitivity setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_iso_low_ex "Ideal for use in bright sunny conditions" + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_low_medium setting. +//d:Visible in light sensitivity setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_iso_low_medium_ex "Ideal for use in less bright, outdoor conditions" + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_medium setting. +//d:Visible in light sensitivity setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_iso_medium_ex "Ideal for cloudy/indoor pictures with flash" + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_medium_high setting. +//d:Visible in light sensitivity setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_iso_medium_high_ex "Ideal for low light pictures where flash might be required" + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_high setting. +//d:Visible in light sensitivity setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_iso_high_ex "Ideal for low light pictures without flash and for freezing action in bright light" + +// --------------------------------------------------------- +// Advanced sequence mode setting page + +//d:View title. +//d:Visible in Image advanced sequence mode setting page. +//l:title_pane_t2/opt9 +// +#define qtn_lcam_selector_title_tl "Sequence mode" + +// ------------------------------------- +// Setting titles + +//d:Title text for advanced sequence mode setting. +//d:This setting sets advanced sequence mode off and single shot mode on. +//d:Visible in advanced sequence mode setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_set_adv_seq_off "Single shot" + +//d:Title text for advanced sequence mode setting. +//d:This setting sets burst sequence mode on. +//d:Visible in advanced sequence mode setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_set_burst "Burst" + +//d:Title text for advanced sequence mode setting. +//d:This setting sets timelapse sequence mode on with interval of 5 seconds. +//d:Visible in advanced sequence mode setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_set_seq_5secs "5 Seconds" + +//d:Title text for advanced sequence mode setting. +//d:This setting sets timelapse sequence mode on with interval of 10 seconds. +//d:Visible in advanced sequence mode setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_set_seq_10secs "10 Seconds" + +//d:Title text for advanced sequence mode setting. +//d:This setting sets timelapse sequence mode on with interval of 30 seconds. +//d:Visible in advanced sequence mode setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_set_seq_30secs "30 Seconds" + +//d:Title text for advanced sequence mode setting. +//d:This setting sets timelapse sequence mode on with interval of 1 minute. +//d:Visible in advanced sequence mode setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_set_seq_1min "1 Minute" + +//d:Title text for advanced sequence mode setting. +//d:This setting sets timelapse sequence mode on with interval of 5 minutes. +//d:Visible in advanced sequence mode setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_set_seq_5min "5 Minutes" + +//d:Title text for advanced sequence mode setting. +//d:This setting sets timelapse sequence mode on with interval of 10 minutes. +//d:Visible in advanced sequence mode setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_set_seq_10min "10 Minutes" + +//d:Title text for advanced sequence mode setting. +//d:This setting sets timelapse sequence mode on with interval of 30 minutes. +//d:Visible in advanced sequence mode setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_set_seq_30min "30 Minutes" + + +// ------------------------------------- +// Setting descriptions + +//d:Description text for qtn_lcam_set_adv_seq_off setting. +//d:Visible in advanced sequence mode setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_adv_seq_off_ex "Switch to single shot mode" + +//d:Description text for qtn_lcam_set_seq_5secs setting. +//d:Visible in advanced sequence mode setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_seq_5secs_ex "Capture an image every 5 seconds until the current selected memory runs out" + +//d:Description text for qtn_lcam_set_seq_10secs setting. +//d:Visible in advanced sequence mode setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_seq_10secs_ex "Capture an image every 10 seconds until the current selected memory runs out" + +//d:Description text for qtn_lcam_set_seq_30secs setting. +//d:Visible in advanced sequence mode setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_seq_30secs_ex "Capture an image every 30 seconds until the current selected memory runs out" + +//d:Description text for qtn_lcam_set_seq_1min setting. +//d:Visible in advanced sequence mode setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_seq_1min_ex "Capture an image every 1 minute until the current selected memory runs out" + +//d:Description text for qtn_lcam_set_seq_5min setting. +//d:Visible in advanced sequence mode setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_seq_5min_ex "Capture an image every 5 minutes until the current selected memory runs out" + +//d:Description text for qtn_lcam_set_seq_10min setting. +//d:Visible in advanced sequence mode setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_seq_10min_ex "Capture an image every 10 minutes until the current selected memory runs out" + +//d:Description text for qtn_lcam_set_seq_30min setting. +//d:Visible in advanced sequence mode setting page. +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_set_seq_30min_ex "Capture an image every 30 minutes until the current selected memory runs out" + + + +// --------------------------------------------------------- +// Location data setting + +//d:Setting item name. +//d:User selects with this setting, if location data, +//d:when available, is recorded to the captured images or videos. +//l:list_setting_pane_t1 +// +#define qtn_lcam_sett_attr_rec_location "Record location" + +//d:View title. +//d:Visible in location data setting page. +//l:title_pane_t2/opt9 +// +#define qtn_lcam_sett_attr_ph_location_setting "Location" + +// ------------------------------------- +// Setting values + +//d:This setting sets location data recording on. +//d:Visible in location data setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_location_set_on "On" + +//d:This setting sets location data recording off. +//d:Visible in location data setting page. +//l:main_cam5_pane_t7 +// +#define qtn_lcam_location_set_off "Off" + +// ------------------------------------- +// Setting descriptions + +//d:Description text for qtn_lcam_location_set_on setting. +//d:Visible in location data setting page. +//d:This text is used in both image and video mode. +//l:main_cset_text2_pane_t1 +// +#define qtn_lcam_descr_location_on "Location data will be recorded to each image or video if GPS co-ordinates are found. It might take many minutes to acquire these co-ordinates, best conditions are obtained in open areas away from tall buildings." + +//d:Description text for qtn_lcam_location_set_off setting. +//d:Visible in location data setting page. +//d:The text is intentionally empty +//l:main_cset_text2_pane_t1 +// +#define qtn_lcam_descr_location_off "" + + +// --------------------------------------------------------- +// +// Context specific setting value texts + + +//d:Item value for portrait mode image settings list. +//d:"Yes" value for setting with title qtn_lcam_sett_attr_add_toalbum. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_port_img_add_toalbum_yes "Yes" + +//d:Same as qtn_lcam_set_port_img_add_toalbum_yes, but for landscape mode. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_img_add_toalbum_yes "Yes" + +//d:Same as qtn_lcam_set_port_img_add_toalbum_yes, but for video setting list. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_port_vid_add_toalbum_yes "Yes" + +//d:Same as qtn_lcam_set_port_vid_add_toalbum_yes, but for landscape mode. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_vid_add_toalbum_yes "Yes" + + + + +//d:Item value for portrait image settings list. +//d:"No" value for setting with title qtn_lcam_sett_attr_add_toalbum. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_port_img_add_toalbum_no "No" + +//d:Same as qtn_lcam_set_port_img_add_toalbum_no, but for landscape mode. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_img_add_toalbum_no "No" + +//d:Same as qtn_lcam_set_port_img_add_toalbum_no, but for video setting list. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_port_vid_add_toalbum_no "No" + +//d:Same as qtn_lcam_set_port_vid_add_toalbum_no, but for landscape mode. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_vid_add_toalbum_no "No" + + + + +//d:Item value for portrait image settings list. +//d:"On" value for setting with title qtn_lcam_sett_attr_post_ph. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_port_showcap_img_on "On" + +//d:Same as qtn_lcam_set_port_showcap_img_on, but for landscape mode. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_showcap_img_on "On" + +//d:Same as qtn_lcam_set_port_showcap_img_on, but for video. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_port_showcap_vid_on "On" + +//d:Same as qtn_lcam_set_port_showcap_vid_on, but for landscape mode. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_showcap_vid_on "On" + + + +//d:Item value for portrait image settings list. +//d:"Off" value for setting with title qtn_lcam_sett_attr_post_ph. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_port_showcap_img_off "Off" + +//d:Same as qtn_lcam_set_port_showcap_img_off, +//d:but for landscape mode image setting list. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_showcap_img_off "Off" + + +//d:Same as qtn_lcam_set_port_showcap_img_off, but for video. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_port_showcap_vid_off "Off" + +//d:Same as qtn_lcam_set_port_showcap_vid_off, but for landscape mode. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_showcap_vid_off "Off" + + + +//d:Item value for landscape image settings list. +//d:This value sets image rotation based on device orientation "on". +//d:Setting title is qtn_lcam_sett_attr_tsensor. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_rotate_img_on "On" + + +//d:Item value for landscape image settings list. +//d:This value sets image rotation based on device orientation "off". +//d:Setting title is qtn_lcam_sett_attr_tsensor. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_rotate_img_off "Off" + + + + +//d:Item value for portrait mode video settings list. +//d:This value sets audio recording "on". +//d:The opposite setting, "mute", is qtn_lcam_set_audio_off. +//d:Setting title is qtn_lcam_sett_attr_audio_rec. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_port_audio_vid_on "On" + +//d:Same as qtn_lcam_set_port_audio_vid_on, but for landscape mode. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_audio_vid_on "On" + + + + +//d:Item value for landscape mode video settings list. +//d:This value sets video stabilisation "on". +//d:Setting title is qtn_lcam_sett_attr_vid_stable. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_vidstab_on "On" + +//d:Item value for landscape mode video settings list. +//d:This value sets video stabilisation "off". +//d:Setting title is qtn_lcam_sett_attr_vid_stable. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_vidstab_off "Off" + + + + +//d:Item value for landscape mode video settings list. +//d:This value enables optical zoom during video recording. +//d:Setting title is qtn_lcam_sett_attr_opzoom_off. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_optical_vid_on "On" + +//d:Item value for landscape mode video settings list. +//d:This value disables optical zoom during video recording. +//d:Setting title is qtn_lcam_sett_attr_opzoom_off. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_set_land_optical_vid_off "Off" + + + + +//d:Item value for landscape mode image settings list. +//d:Setting the flicker cancellation value to 50Hz. +//d:The setting title is qtn_lcam_sett_attr_flickr. +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_pop_50hz "50Hz" + +//d:Item value for landscape mode image settings list. +//d:Setting the flicker cancellation value to 60Hz. +//d:The setting title is qtn_lcam_sett_attr_flickr. +//l:list_setting_pane_t1 +// +#define qtn_lcam_set_pop_60hz "60Hz" + + +// +// + +//d:Options menu item for turning UI off +//d:Visible in Options-menu in pre-capture and post-capture views. +//l:list_single_pane_t1_cp2 +//r:4.0 +#define qtn_lcam_options_display_off2 "Hide icons" + +//d:Options menu item for accessing the camera album application +//d:Visible in Options-menu in pre and post capture views +//l:list_single_pane_t1_cp2 +//r:4.0 +#define qtn_lcam_go_to_camera_album "Go to camera album" + +//d: Tooltip text for ’Image detail’ button. +//l: main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_tags "Properties" +//d:Freeing memory wait note text +//d:Displayed in the startup if there is not enough memory available +//d:and some applications are being shut down to free memory before +//d:camera is started. It may take several seconds. +//l:popup_note_wait_window +//r:4.0 +#define qtn_lcam_note_free_memory "Camera is attempting to free memory, this may take several seconds" + +//d:Processing a photo wait note text +//d:Displayed when processing image after capture key has been pressed +//l:popup_note_wait_window +//r:3.0 +#define qtn_lcam_note_processing_image "Processing image" + +//d:Processing a video wait note text +//d:Displayed when processing the video after video recording has been stopped +//l:popup_note_wait_window +//r:3.0 +#define qtn_lcam_note_processing_video "Processing video" + +// + +// + +//d:Camera specific subfolder in camera increment 4 +//d:Used to store captured photos and videos +//r:4.0 +//l:none +// +#define qtn_lcam_camera_subfolder "Camera" + +//d:Freeing memory wait note text +//d:Displayed in the startup if there is not enough memory available +//d:and some applications are being shut down to free memory before +//d:camera is started. It may take several seconds. +//l:popup_note_wait_window +//r:3.0 +#define qtn_lcam_note_free_memory "Camera is attempting to free memory, this may take several seconds" + +// + +// + +//d:Options menu item for turning UI off +//d:Visible in Options-menu in pre-capture views. +//l:list_single_pane_t1_cp2 +//r:4.0 +#define qtn_lcam_options_display_on2 "Show icons" + + +// + +// + +//d:ISO value for the sensitivity setting. +//d:The value of qtn_lcam_set_iso_auto setting. +//d:Visible in light sensitivity setting page. +//l:main_cam5_pane_t8/opt2 +//r: 3.1 +#define qtn_lcam_set_iso_value_auto "ISO value: Auto" + +//d:ISO value for the sensitivity setting. +//d:The value of qtn_lcam_set_iso_XXX setting. +//d:Visible in light sensitivity setting page. +//d:Where %U represents the equivalent ISO value for the setting (high/low/medium). +//l:main_cam5_pane_t8/opt2 +//r: 3.1 +#define qtn_lcam_set_iso_value_set "ISO value: %U" + +// + +// + +//d:Memory card not accessible error note text +//l:popup_note_window +//r:3.1 +#define qtn_lcam_mmc_not_inserted_mass_storage "Memory card is not accessible. Mass storage will be used instead" + +//d:Memory card read only error note text +//l:popup_note_window +//r:3.1 +#define qtn_lcam_mmc_read_only_mass_storage "Memory card is read only. Mass storage will be used instead" + +// + +//d: Tool tip text for the capture button in touch toolbar in still mode +//d: pre-capture view +//l: main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_capture "Capture an image" + +//d: Tool tip text for the main camera button in touch toolbar in secondary +//d: camera pre-capture views. +//l: main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_camera_main "To main camera" + + +//d: Tool tip text for the video mode button in touch toolbar in secondary +//d: camera still pre-capture view. +//l: main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_video_mode "To video mode" + +//d: Tool tip text for the record button in touch toolbar in video +//d: pre-capture view. +//l: main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_record "Record" + +//d: Tool tip text for the still mode button in touch toolbar in video +//d: pre-capture view. +//l: main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_still_mode "To still mode" + +//d: Tool tip text for the video mode button in touch toolbar extension +//d: in primary camera still pre-capture view. +//l: main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_switch_video_mode "Switch to video mode" + +//d: Icon text for 'Scene mode' button in touch toolbar extension in both +//d: video and still mode pre-capture views. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_scenes "Scene mode" + +//d: Icon text for 'Face tracking' button in touch toolbar extension in both +//d: video and still mode pre-capture views. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_facedet_on "Face detection" + +//d: Icon text for 'Video' button in touch toolbar extension in still mode +//d: pre-capture view. Pressing the button will switch camera to video mode. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_switch_video_mode "Go to Video" + +//d: Icon text for 'Show grid' button in touch toolbar extension in still mode +//d: pre-capture view. Pressing the button will enable a 3x3 grid layout on +//d: top of the viewfinder image to help the user to compose the image. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_show_viewfinder_grid "Show grid" + +//d: Icon text for 'Hide grid' button in touch toolbar extension in still mode +//d: pre-capture view. Pressing the button will hide the viewfinder grid. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_hide_viewfinder_grid "Hide grid" + +//d: Icon text for 'Self timer' button in touch toolbar extension in still +//d: mode pre-capture view. Pressing the button will open the self-timer +//d: settings view. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_st "Self timer" + +//d: Icon text for 'Sequence' button in touch toolbar extension in still mode +//d: pre-capture view. Pressing the button will open the sequence mode +//d: settings view. Sequence settings enable the user to capture images in a +//d: high speed burst mode and to use time-lapse photography modes. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_sequence "Sequence mode" + +//d: Icon text for 'Colour tone' button in touch toolbar extension in video +//d: and still mode pre-capture views. Pressing the button will open the +//d: colour filter settings view. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_coltone "Colour tone" + +//d: Icon text for 'White balance' button in touch toolbar extension in video +//d: and still mode pre-capture views. Pressing the button will open the +//d: white balance settings view. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_wb "White balance" + +//d: Icon text for 'Exposure' button in touch toolbar extension in still mode +//d: pre-capture view. Pressing the button will open the exposure compensation +//d: settings view. Exposure compensation (EV) setting can be used to adjust +//d: the exposure manually in case the automatic meter over- or underexposes +//d: the images. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_ev "Exposure" + +//d: Icon text for 'Light sensitivity' button in touch toolbar extension in +//d: still mode pre-capture view. Pressing the button will open the light +//d: sensitivity (ISO) setting view. +//d: view. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_isosetting "Light sensitivity" + +//d: Icon text for 'Contrast' button in touch toolbar extension in still mode +//d: pre-capture view. Pressing the button will open the contrast settings +//d: view. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_contr "Contrast" + +//d: Icon text for 'Sharpness' button in touch toolbar extension in still mode +//d: pre-capture view. Pressing the button will open the sharpness settings +//d: view. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_sharp "Sharpness" + +//d: Icon text for 'Go to Photos' button in touch toolbar extension in +//d: video and still mode. Pressing the button will open MC Photos application. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_go_to_photos "Go to Photos" + +//d: Tooltip text for ’Goto Photos’ button. +//l: main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_go_to_photos "Go to Photos" + +//d: Tooltip text for ’Change’ button in touch toolbar in Scene +//d: settings view. Pressing button will open settings page to modify +//d: user defined preset scene mode +//l: main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_change_settings "Change settings" + +//d: This message is shown when the user tries to access the camera if the camera +//d: has been disabled in the device. +//l: main_list_empty_pane +//r: 3.1 +// +#define qtn_camera_disabled_info_note "Camera disabled by system administrator" + +//d:Options menu item text +//d:Visible in image precapture view options menu. +//d:Used to launch "Customise toolbar" setting view. +//l:list_single_pane_t1_cp2 +//r:5.0 +// +#define qtn_lcam_options_customise_toolbar "Customise toolbar" + +//d:Options menu item text +//d:Visible in Customise Toolbar setting view options menu. +//d:With this menu option user can select item to replace the selected one. +//l:list_single_pane_t1_cp2 +//r:5.0 +// +//#define qtn_options_change "Change" + +//d:Options menu item text +//d:Visible in Customise Toolbar setting view options menu. +//d:With this menu option user can remove selected item from the Toolbar. +//l:list_single_pane_t1_cp2 +//r:5.0 +// +#define qtn_lcam_options_remove "Remove" + +//d:Options menu item text +//d:Visible in Customise Toolbar setting view options menu. +//d:With this menu option user can move selected item one step up in the Toolbar. +//l:list_single_pane_t1_cp2 +//r:5.0 +// +#define qtn_lcam_options_move_up "Move up" + +//d:Options menu item text +//d:Visible in Customise Toolbar setting view options menu. +//d:With this menu option user can move selected item one step down in the Toolbar. +//l:list_single_pane_t1_cp2 +//r:5.0 +// +#define qtn_lcam_options_move_down "Move down" + +//d:Options menu item text +//d:Visible in Customise Toolbar setting view options menu. +//d:With this menu option user can reset the Toolbar items to the default set. +//l:list_single_pane_t1_cp2 +//r:5.0 +// +#define qtn_lcam_options_revert_defaults "Revert to defaults" + + + + + +//d:View title. +//d:Visible in "Customise toolbar" setting view. +//l:title_pane_t2/opt9 +//r:5.0 +// +#define qtn_lcam_sett_attr_ti_cust_tool "Customise toolbar" + +//d:View title. +//d:Visible in "Add toolbar item" view. +//l:title_pane_t2/opt9 +//r:5.0 +// +#define qtn_lcam_selector_title_add_item "Add item" + +//d:View title. +//d:Visible in "Change toolbar item" view. +//l:title_pane_t2/opt9 +//r:5.0 +// +#define qtn_lcam_selector_title_change_item "Change item to" + + + + + +//d:Confirmation query dialog text +//d:Shown when user selects qtn_lcam_options_revert_defaults +//l:popup_note_window/opt2 +//r:5.0 +// +#define qtn_lcam_revert_toolbar_settings "Revert to default toolbar items and settings" + +//d:Confirmation query dialog text +//d:Shown when user selects qtn_lcam_options_remove +//l:popup_note_window/opt2 +//r:5.0 +// +#define qtn_lcam_remove_toolbar_item "Remove item from toolbar" + +//d:Information note text +//d:Shown when user selects qtn_lcam_options_remove and +//d:the currentlty selected item is not allowed to be removed from Toolbar. +//l:popup_note_window/opt2 +//r:5.0 +// +#define qtn_lcam_unable_remove_item "Unable to remove toolbar item. Item is locked" + + + +//d:Title for a listbox item +//d:Visible in "Customise toolbar" setting view. +//d:Shows the Toolbar item position and name, e.g. "Item 1: White balance". +//l:list_single_graphic_pane_t1 +//r:5.0 +// +#define qtn_lcam_set_item_n "Item %0N: %1U" + +//d:Navipane text +//d:Visible in "Customise toolbar" setting view. +//d:Shows the amount of items in the Toolbar +//l:navi_text_pane_t1 +//r:5.0 +// +#define qtn_lcam_set_n_items "%N items" + + + +//d:Title for a listbox item +//d:Visible in "Customise toolbar" setting view. +//d:This item represents the "Customise toolbar" Toolbar item in the listbox. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_customise "Customise toolbar" + + +//d:Title for a listbox item +//d:Visible in "Customise toolbar" setting view. +//d:This item represents the "Add item" command in the listbox. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_add_item "Add item" + + +//d:Title for a listbox item +//d:Visible in "Customise toolbar" setting view. +//d:This item represents the "Switch to video mode" Toolbar item in the listbox. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_video_mode "Video mode" + +//d:Title for a listbox item +//d:Visible in "Customise toolbar" setting view. +//d:This item represents the scene setting Toolbar item in the listbox. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_scene "Scene mode" + +//d:Title for a listbox item +//d:Visible in "Customise toolbar" setting view. +//d:This item represents the flash setting Toolbar item in the listbox. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_flash "Flash mode" + + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This item is used to add all available items to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_all_items "All items" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add self-timer setting item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_st "Self timer" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add "sequence mode" setting item to Toolbar. +//d:Sequence mode types are e.g. single, burst or timelapse. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_adv_sequence "Sequence mode" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add "drive mode" setting item to Toolbar. +//d:Drive mode can be e.g. single, burst, timelapse, exposure bracketing. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_drive_mode "Drive modes" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add "colour tone" item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_coltone "Colour tone" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add viewfinder grid on/off item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_viewfinder_grid "Viewfinder grid" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add white balance setting item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_wb "White balance" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add exposure compensation item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_ev "Exp. compensation" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add histogram on/off item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_histogram "Histogram" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add focus mode setting item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_focus_mode "Focus mode" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add sharpness setting item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_sharp "Sharpness" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add contrast setting item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_contr "Contrast" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add brightness setting item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_bright "Brightness" + +//d:Title for a listbox item +//d:Visible in "Add toolbar item" view. +//d:This listbox item is used to add light sensitivity (ISO) setting item to Toolbar. +//l:main_cam5_pane_t7 +//r:5.0 +// +#define qtn_lcam_set_isosetting "Light sensitivity" + + + + + +//d:Description for qtn_lcam_set_customise. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_customise_ex "Add, remove and change items on the toolbar. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_all_items. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_all_items_ex "Select this item to add all items to the toolbar" + +//d:Description for qtn_lcam_set_st. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_self_timer_ex "Set a timer of 2, 10, 20 seconds. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_scene. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_scene_mode_ex "Choose between several shot settings, like portrait and night. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_adv_sequence. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_sequence_mode_ex "Capture a sequence of images. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_drive_mode. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_drive_mode_ex "Capture a sequence of images or capture an image at several different exposures. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_coltone. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_colour_tone_ex "Change the colour tone before capture. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_viewfinder_grid. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_grid_ex "Switch the viewfinder grid display on. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_wb. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_white_balance_ex "Change the white balance before capture. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_ev. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_exp_comp_ex "Change the exposure compensation before capture. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_histogram. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_histogram_ex "Switch the Histogram display on. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_focus_mode. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_focus_mode_ex "Change the focus mode before capture. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_sharp. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_sharpness_ex "Adjust sharpness before capture. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_contr. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_contrast_ex "Adjust contrast before capture. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_contr. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_bright_ex "Adjust brightness before capture. Select this item to add it to the toolbar" + +//d:Description for qtn_lcam_set_isosetting. +//d:Visible in "Add toolbar item" view. +//l:main_cam5_pane_t8/opt2 +//r:5.0 +// +#define qtn_lcam_set_add_iso_ex "Adjust light sensitivity before capture. Select this item to add it to the toolbar" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +//r:5.0 +#define qtn_lcam_set_type_highdefinition "High definition quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +//r:5.0 +#define qtn_lcam_set_type_widescreen "Widescreen high quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:list_set_graphic_pane_t1 +//r:5.0 +#define qtn_lcam_set_type_widescr_normal "Widescreen normal quality" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cam5_pane_t4/opt1 +//r:5.0 +#define qtn_lcam_descr_quality_highdefinition "Best quality for playback on high definition displays" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cam5_pane_t4/opt1 +//r:5.0 +#define qtn_lcam_descr_quality_widescreen "Best quality for playback on wide displays" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cam5_pane_t4/opt1 +//r:5.0 +#define qtn_lcam_descr_quality_widescr_normal "Standard quality for playback on wide displays" + +/////////////////////////////////////////////////////////////////////////////// +// CAMCORDER PLUGIN SETTINGS STRINGS +/////////////////////////////////////////////////////////////////////////////// + +//d: Application plugin title for general settings +//l: list_single_large_graphic_pane_t1 +//w: +//r: 5.0 +#define qtn_lcam_gen_sett_list "Camera" + +//l:title_pane_t2/opt12 +//r: 5.0 +#define qtn_lcam_gen_sett_title_camera "Camera" + +//d:List item for image settings in main settings view. +//l:list_single_large_graphic_pane_t1 +// +#define qtn_lcam_gen_sett_camera_folder_image "Image" + +//d:List item for video settings in main settings view. +//l:list_single_large_graphic_pane_t1 +// +#define qtn_lcam_gen_sett_camera_folder_video "Video" +//////////////////////////////////////////////////////////////////////////////////// + +//d:Tooltip item for opening/closing toolbar extension. +//d:Visible in pre-capture view toolbar. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_open_extension "Open extension" + +//d:Tooltip item for scene mode settings. +//d:Visible in pre-capture view toolbar. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_goto_scenemode_settings "Scene mode" + +//d:Options menu item opens submenu with AIW assign services +//d:Options-menu in video post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_use_video_postcapture_menu "Use video" + + +//d:Options menu item opens submenu with AIW assign services +//d:Options-menu in still image post-capture view. +//l:list_single_pane_t1_cp2 +// +#define qtn_lcam_use_image_postcapture_menu "Use image" + +//d: Icon text for 'Image mode' button in touch toolbar extension in video +//d: mode pre-capture view. Pressing the button will open the +//d: Image precapture view. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_switch_mode "Go to Still" + +//d:Tooltip text for recording button. +//d:Visible in pre-capture view toolbar. +//l:main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_start_video_rec "Start video recording" + + +//d: In image mode Scene modes options menu when +//d: User defined (qtn_lcam_scene_user) is selected +//l: list_single_pane_t1_cp2 +//W: +//R:9.1 +#define qtn_lcam_options_edit_userdef "Edit" + +//d: In Image and Video mode Settings options menu when +//d: 'Restore camera settings' (qtn_lcam_sett_attr_reset ) is selected +//l: list_single_pane_t1_cp2 +//W: +//R:9.1 +#define qtn_lcam_set_options_restore_or "Restore" + +//d: In User scene options menu when +//d: 'Restore user scene' is selected +//l: list_single_pane_t1_cp2 +//W: +//R:9.1 +#define qtn_lcam_set_user_scene_restore_or "Restore" + +//d: Increased value for 'Contrast' (qtn_lcam_set_user_contr) in +//d: 'Image user scene' view (Image mode > Scene modes > User defined open) +//l: list_single_pane_t1 +//W: +//R:9.1 +#define qtn_lcam_set_contrast_increased "Increased" + +//d: Normal value for 'Contrast' (qtn_lcam_set_user_contr) in +//d: 'Image user scene' view (Image mode > Scene modes > User defined open) +//l: list_single_pane_t1 +//W: +//R:9.1 +#define qtn_lcam_set_contrast_normal "Normal" + +//d: Decreased value for 'Contrast' (qtn_lcam_set_user_contr) in +//d: 'Image user scene' view (Image mode > Scene modes > User defined open) +//l: list_single_pane_t1 +//W: +//R:9.1 +#define qtn_lcam_set_contrast_decreased "Decreased" + + + + +//////////////////////////////////////////////////////////////////////////////// +//*****************THE DUPLICATES FOR NEW VGA LAYOUTS*************************// +//****************************************************************************// +// // +// // +//d:View title +//d:In capture setup mode +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_subm_flash_v2 "Flash" + +//d:View title +//d:In capture setup mode +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_subm_wb_v2 "White balance" + +//d:View title +//d:In capture setup mode +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_subm_ev_v2 "Exposure compensation" + +//d:View title +//d:In capture setup mode +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_subm_ceff_v2 "Colour tone" + +//d:View title +//d:In capture setup mode +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_subm_sharp_v2 "Sharpness" + +//d:View title +//d:in capture setup mode +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_subm_contr_v2 "Contrast" + +//d:View title in capture setup mode +//d:For cameraapp Increment 3.1, cameraapp Release 6 +//r:3.1 +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_subm_bright_v2 "Brightness" + +//d:View title +//d: +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_selftimer_v2 "Self timer" + + +//d:View title +//d:In capture setup mode +//l:title_pane_t2/opt9 +// +#define qtn_lcam_title_subm_iso_v2 "Light sensitivity" + +//---------------------------------------------------- + +//d:Item text for flash auto value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_auto_v2 "Automatic" + +//d:Item text for flash forced value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_force_v2 "On" + +//d:Item text for flash off value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_flash_off_v2 "Off" + +//d:Item text for flash redeye reduction value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_redeye_v2 "Red eye redu." + +//---------------------------------------------------- + +//d:Item text for white balance auto value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_awb_v2 "Automatic" + +//d:Item text for white balance daylight value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_day_v2 "Sunny" + +//d:Item text for white balance cloudy value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_cloud_v2 "Cloudy" + +//d:Item text for white balance tungsten value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_tung_v2 "Incandescent" + +//d:Item text for white balance fluorescent value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_flu_v2 "Fluorescent" + +//---------------------------------------------------- + +//d:Item text for colour filter colour value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_col_v2 "Normal" + +//d:Item text for colour filter sepia value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_sep_v2 "Sepia" + +//d:Item text for colour filter black and white value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_bw_v2 "Black & white" + +//d:Item text for colour filter vivid colours value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_neg_v2 "Negative" + +//d:Item text for colour filter vivid colours value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_viv_v2 "Vivid" + +//---------------------------------------------------- + +//d:Item text for ISO value automatic ISO setting +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_isoauto_v2 "Auto" + +//d:Item text for ISO value Low ISO setting +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_isolow_v2 "Low" + +//d:Item text for ISO value Medium ISO setting +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_isomedium_v2 "Medium" + +//d:Item text for ISO value High ISO setting +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_isohigh_v2 "High" + +//---------------------------------------------------- +// Image quality setting texts + +// +//d:Image quality slider bar top subtitle +//d:Visible in image quality slider control. +//l:main_cset6_slider_pane_t1/opt2 +// +#define qtn_lcam_quality_subtitle_maximum_v2 "Maximum" + +//d:Image quality slider bar bottom subtitle +//d:Visible in image quality slider control. +//l:main_cset6_slider_pane_t7/opt2 +// +#define qtn_lcam_quality_subtitle_minimum_v2 "Low" +// + +// Video quality setting texts + +//d:Video quality slider bar top sub title +//d:Visible in video quality slider control. +//l:main_cset6_slider_pane_t1/opt4 +// +#define qtn_lcam_quality_subtitle_vmax_v2 "High" + +//d:Video quality slider bar top sub title +//d:Visible in video quality slider control. +//l:main_cset6_slider_pane_t7/opt4 +// +#define qtn_lcam_quality_subtitle_vmin_v2 "Low" + +//---------------------------------------------------- + +//d:Text placed above video time remaining counter +//d:Visible in video quality slider control. +//l:main_cset_text_pane_t6_copy1 +// +#define qtn_lcam_video_remain_v2 "Record time available" + +//d:Text placed above image counter +//d:Visible in image quality slider control. +//l:main_cset_text_pane_t6_copy1 +// +#define qtn_lcam_image_remain_v2 "Images remaining" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_print9m_v2 "Capture images with 16:9 aspect ratio" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_print8m_v2 "Use for large sized prints up to 16 x 12 in (41x31 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_print6m_v2 "Capture images with 16:9 aspect ratio" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_print5m_v2 "Use for large sized prints up to 14x11 in (36x28 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_print3m_v2 "Use for prints up to 10x8 in (25x20 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_print2m_v2 "Use for prints up to 7x5 in (18x13 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_print1_3m_v2 "Use for prints up to 6x4 in (15x10 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_print1m_v2 "Use for prints up to 6x4 in (15x10 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_low_v2 "Ideal image size to send via Multimedia message (MMS)" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_vhigh_v2 "Use for best quality playback through handset or PC" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_vnorm_v2 "Standard quality for playback through handset" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_vshare_v2 "Limited video clip size to send using multimedia message (MMS)" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//d:Before : "Best quality for long term usage and playback on TV/PC and handset" +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_tvhigh_v2 "Best quality for playback on displays using 4:3 aspect ratio" + + +//d:Video quality setting description +//d:Visible in video quality slider control. +//d:Before : "Standard quality for long term usage and playback on TV/PC and handset" +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_tvnorm_v2 "Standard quality for playback on displays using 4:3 aspect ratio" + + +//d:Video quality setting description +//d:Visible in video quality slider control. +//d:Before : "Best quality for playback through handset and compatible with other mobile phones" +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_webhigh_v2 "Best quality for uploading videos" + + +//d:Video quality setting description +//d:Visible in video quality slider control. +//d:Before : "Standard quality for playback through handset and compatible with other mobile phones" +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_webnorm_v2 "Standard quality for uploading videos" + + + + + +//---------------------------------------------------- + +// +//d:Item text for increased value +//d:Visible in set_up lists (e.g. for brightness) +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_increased_v2 "Increased" + +//d:Item text for decreased value +//d:Visible in set_up lists (e.g. for brightness) +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_decreased_v2 "Decreased" + +//---------------------------------------------------- +// Settings value indicators + +//d:Value of plus two for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cset6_slider_pane_t1/opt6 +// +#define qtn_lcam_ev_plus2_v2 "+2" + +//d:Value of plus 1.5 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cset6_slider_pane_t8/opt6 +// +#define qtn_lcam_ev_plus1_5_v2 "+1.5" + +//d:Value of plus one for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cset6_slider_pane_t2/opt6 +// +#define qtn_lcam_ev_plus1_v2 "+1" + +//d:Value of plus 0.5 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cset6_slider_pane_t9/opt6 +// +#define qtn_lcam_ev_plus0_5_v2 "+0.5" + +//d:Value of zero for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cset6_slider_pane_t3/opt6 +// +#define qtn_lcam_ev_0_v2 "0" + +//d:Value of minus 0.5 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cset6_slider_pane_t10/opt6 +// +#define qtn_lcam_ev_minus0_5_v2 "-0.5" + +//d:Value of minus one for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cset6_slider_pane_t4/opt6 +// +#define qtn_lcam_ev_minus1_v2 "-1" + +//d:Value of minus 1.5 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cset6_slider_pane_t11/opt6 +// +#define qtn_lcam_ev_minus1_5_v2 "-1.5" + +//d:Value of minus two for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cset6_slider_pane_t5/opt6 +// +#define qtn_lcam_ev_minus2_v2 "-2" + +//d:Value of plus 1.7 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cset6_slider_pane_t8/opt6 +// +#define qtn_lcam_ev_plus1_7_v2 "+1.7" + +//d:Value of plus 1.3 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cset6_slider_pane_t8/opt6 +// +#define qtn_lcam_ev_plus1_3_v2 "+1.3" + +//d:Value of plus 0.7 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs) +//l:main_cset6_slider_pane_t8/opt6 +// +#define qtn_lcam_ev_plus0_7_v2 "+0.7" + +//d:Value of plus 0.3 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//d:+ sign should be shown also (as usual in camera UIs)t +//l:main_cset6_slider_pane_t8/opt6 +// +#define qtn_lcam_ev_plus0_3_v2 "+0.3" + +//d:Value of minus 0.3 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cset6_slider_pane_t11/opt6 +// +#define qtn_lcam_ev_minus0_3_v2 "-0.3" + +//d:Value of minus 0.7 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cset6_slider_pane_t11/opt6 +// +#define qtn_lcam_ev_minus0_7_v2 "-0.7" + +//d:Value of minus 1.3 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cset6_slider_pane_t11/opt6 +// +#define qtn_lcam_ev_minus1_3_v2 "-1.3" + +//d:Value of minus 1.7 for exposure. +//d:Shown in EV slider, and in user scene setting list. +//l:main_cset6_slider_pane_t11/opt6 +// +#define qtn_lcam_ev_minus1_7_v2 "-1.7" + + +//---------------------------------------------------- + +//d:Menu item for 2 sec selftimer activation +//d:Visible in selftimer submenu +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_st_2_v2 "2 seconds" + +//d:Menu item for 10 sec selftimer activation +//d:Visible in selftimer submenu +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_st_10_v2 "10 seconds" + +//d:Menu item for 20 sec selftimer activation +//d:Visible in selftimer submenu +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_st_20_v2 "20 seconds" + +//d:Menu item for selftimer deactivation +//d:Visible in selftimer submenu +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_st_off_v2 "Off" + + +//---------------------------------------------------- + +//d:Item text for sharpness hard value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_hard_v2 "Hard" + +//d:Item text for sharpness normal value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_normal_v2 "Normal" + +//d:Item text for sharpness soft value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_soft_v2 "Soft" + +//---------------------------------------------------- + +//d:Legend for positive brightness. +//d:Shown brightness/contrast setup +//l:main_cset6_slider_pane_t14/opt5 +// +#define qtn_lcam_set_plus_v2 "+" + +//d:legend for negative brightness. +//d:Shown brightness/contrast setup +//l:main_cset6_slider_pane_t15/opt5 +// +#define qtn_lcam_set_minus_v2 "-" + +// ------------------------------------- + +//d:View title. +//d:Visible in location data setting page. +//l:title_pane_t2/opt9 +// +#define qtn_lcam_sett_attr_ph_location_setting_v2 "Location" + +// ------------------------------------- +// Setting values + +//d:This setting sets location data recording on. +//d:Visible in location data setting page. +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_location_set_on_v2 "On" + +//d:This setting sets location data recording off. +//d:Visible in location data setting page. +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_location_set_off_v2 "Off" + +// ------------------------------------- +// Setting descriptions + +//d:Description text for qtn_lcam_location_set_on setting. +//d:Visible in location data setting page. +//d:This text is used in both image and video mode. +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_descr_location_on_v2 "Location data will be recorded to each image or video if GPS co-ordinates are found. It might take many minutes to acquire these co-ordinates, best conditions are obtained in open areas away from tall buildings." + +//d:Description text for qtn_lcam_location_set_off setting. +//d:Visible in location data setting page. +//d:The text is intentionally empty +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_descr_location_off_v2 "" + +// ------------------------------------- + +//d:Processing a photo wait note text +//d:Displayed when processing image after capture key has been pressed +//l:vid6_indi_pane_t4/opt2 +// +#define qtn_lcam_note_processing_image_v2 "Processing image" + +//d:Processing a video wait note text +//d:Displayed when processing the video after video recording has been stopped +//l:vid6_indi_pane_t4/opt2 +// +#define qtn_lcam_note_processing_video_v2 "Processing video" + +//d:ISO value for the sensitivity setting. +//d:The value of qtn_lcam_set_iso_auto setting. +//d:Visible in light sensitivity setting page. +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_set_iso_value_auto_v2 "ISO value: Auto" + +//d:ISO value for the sensitivity setting. +//d:The value of qtn_lcam_set_iso_XXX setting. +//d:Visible in light sensitivity setting page. +//d:Where %U represents the equivalent ISO value for the setting (high/low/medium). +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_set_iso_value_set_v2 "ISO value: %U" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_highdefinition_v2 "Best quality for playback on high definition displays" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_widescreen_v2 "Best quality for playback on wide displays" + +//d:Video quality setting description +//d:Visible in video quality slider control. +//l:main_cset_text_pane +//r:5.0 +#define qtn_lcam_descr_quality_widescr_normal_v2 "Standard quality for playback on wide displays" + +//d: Increased value for 'Contrast' (qtn_lcam_set_user_contr) in +//d: 'Image user scene' view (Image mode > Scene modes > User defined open) +//l: cset_list_set_pane_t1_copy1/opt1 +//W: +//R:9.1 +// +#define qtn_lcam_set_contrast_increased_v2 "Increased" + +//d: Normal value for 'Contrast' (qtn_lcam_set_user_contr) in +//d: 'Image user scene' view (Image mode > Scene modes > User defined open) +//l: cset_list_set_pane_t1_copy1/opt1 +//W: +//R:9.1 +// +#define qtn_lcam_set_contrast_normal_v2 "Normal" + +//d: Decreased value for 'Contrast' (qtn_lcam_set_user_contr) in +//d: 'Image user scene' view (Image mode > Scene modes > User defined open) +//l: cset_list_set_pane_t1_copy1/opt1 +//W: +//R:9.1 +// +#define qtn_lcam_set_contrast_decreased_v2 "Decreased" + + + +//---------------------------------------------------- +//d:Night scene descriptive text +//d:In scene settings list +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_night_ex_v2 "Ideal for taking pictures in low light without flash" + +//d:User scene descriptive text +//d:In scene settings list +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_user_ex_v2 "Create personalised settings for instant retrieval - adjust and keep your favourite settings" + + +//d:Auto scene descriptive text +//d:In scene settings list +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_auto_ex_v2 "Ideal for everyday photography - all settings are adjusted automatically for you" + +//d:Macro scene descriptive text +//d:In scene settings list +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_macro_ex_v2 "Ideal for capturing small objects between 10 and 60cm" + +//d:Portrait scene descriptive text +//d:In scene settings list +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_port2_ex_v2 "Ideal for shooting better portrait photos" + +//d:Landscape scene descriptive text +//d:In scene settings list +//d:Used in auto focus products +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_land_ex_v2 "Ideal for shooting distant scenerys" + +//d:Landscape scene descriptive text +//d:In scene settings list +//d:Used in fixed focus products +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_land2_ex_v2 "Ideal for shooting better outdoor scenery photos" + +//d:Night portrait scene descriptive text +//d:In scene settings list +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_nightport_ex_v2 "Ideal for taking portraits in low light with flash" + +//d:Auto (video mode) text scene descriptive text +//d:In video scene settings list +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_vid_auto_ex_v2 "Ideal for filming everyday moments" + +//d:Night (video mode) text scene descriptive text +//d:In video scene settings list +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_vid_night_ex_v2 "Ideal for filming in low light" + +//d:Sport scene descriptive text +//d:In image scene settings list +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_sport_ex_v2 "Ideal for capturing fast moving subject matter" + + +// ------------------------------------- +// Light sensitivity setting descriptions + + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_auto setting. +//d:Visible in light sensitivity setting page. +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_set_iso_auto_ex_v2 "Use in everyday situations" + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_low setting. +//d:Visible in light sensitivity setting page. +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_set_iso_low_ex_v2 "Ideal for use in bright sunny conditions" + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_low_medium setting. +//d:Visible in light sensitivity setting page. +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_set_iso_low_medium_ex_v2 "Ideal for use in less bright, outdoor conditions" + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_medium setting. +//d:Visible in light sensitivity setting page. +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_set_iso_medium_ex_v2 "Ideal for cloudy/indoor pictures with flash" + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_medium_high setting. +//d:Visible in light sensitivity setting page. +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_set_iso_medium_high_ex_v2 "Ideal for low light pictures where flash might be required" + +//d:Description text for sensitivity setting. +//d:Describes the qtn_lcam_set_iso_high setting. +//d:Visible in light sensitivity setting page. +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_set_iso_high_ex_v2 "Ideal for low light pictures without flash and for freezing action in bright light" + + +// -------------------------------------- + +//d:Information note while processing image data during sequence capture +//d:Visible in navi-pane after sequence capture +//d: %0U will be replaced by the current image being processed +//d: %1U will be replaced by the total amount of images captured +//d: during the sequence capture. +//l: vid4_progress_pane_t3/opt1 +// +#define qtn_lcam_note_processing_images "Processing image %0U/%1U" + +//d:Information note while processing image data during sequence capture +//d:Visible in navi-pane after sequence capture +//d: %0U will be replaced by the current image being processed +//d: %1U will be replaced by the total amount of images captured +//d: during the sequence capture. +//l: vid6_indi_pane_t4/opt2 +// +#define qtn_lcam_note_processing_images_v2 "Processing image %0U/%1U" + +//d: Tooltip text for mark/unmark button +//d: in touch toolbar in sequence post capture view +//d: Mark/unmark button will mark highlighted item if it is not marked, +//d: and it will unmark the item if it is marked. +//l: main_cam5_pane_t11 +//w: +//r: 5.0 +#define qtn_lcam_tt_mark_unmark "Mark/Unmark" + +//d: Icon text for 'Sequence mode' button in touch toolbar extension in +//d: still mode. Pressing the button will turn sequence mode on. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_turn_sequence_on "To sequence mode" + +//d: Icon text for 'Sequence mode' button in touch toolbar extension in +//d: still mode. Pressing the button will turn sequence mode off. +//l: cell_tb_ext_pane_t1/opt1 +//w: +//r: 5.0 +#define qtn_lcam_tb_turn_sequence_off "To single shot" + +//d: Video scene mode title text for Low light mode +//d: Visible in video scene settings list +//l: list_set_graphic_pane_t1 +//w: +//r: 5.0 +#define qtn_lcam_scene_lowlight "Low light" + +//d: Video scene mode title text for Low light mode +//d: Visible in video scene settings list +//l: cset_list_set_pane_t1_copy1 +//w: +//r: 5.0 +#define qtn_lcam_scene_lowlight_v2 "Low light" + +// -------------------------------------- + + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_email "Ideal size for e-mail" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_email_v2 "Ideal size for e-mail" + +//d:Indoor (video mode) text scene descriptive text +//d:In video scene settings list +//l:popup_preview_text_window/opt5 +// +#define qtn_lcam_scene_vid_lowlight_ex "Ideal for filming in indoor lighting" + +//d:Indoor (video mode) text scene descriptive text +//d:In video scene settings list +//l:main_cset_text2_pane_t1_copy1 +// +#define qtn_lcam_scene_vid_lowlight_ex_v2 "Ideal for filming in indoor lighting" + +//d:Item text for brightness normal value +//d:Visible in set_up lists +//l:main_cam5_pane_t1 +// +#define qtn_lcam_set_normal_bright "Normal" + +//d:Item text for brightness normal value +//d:Visible in set_up lists +//l:cset_list_set_pane_t1_copy1/opt1 +// +#define qtn_lcam_set_normal_bright_v2 "Normal" + +//---------------------------------------------------- + +//d:Night scene title text +//d:Visible in scene settings page +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_scene_night_v2 "Night" + +//d:User scene title text +//d:Visible in scene settings page +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_scene_user_v2 "User defined" + +//d:Auto scene title text +//d:Visible in scene settings page +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_scene_auto_v2 "Auto" + +//d:Macro scene title text +//d:Visible in scene settings page +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_scene_macro_v2 "Close-up mode" + +//d:Portrait scene title text +//d:Visible in scene settings page +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_scene_port_v2 "Portrait" + +//d:Landscape scene title text +//d:Visible in scene settings page +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_scene_land_v2 "Landscape" + +//d:Night portrait scene title text +//d:Visible in scene settings page +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_scene_nightport_v2 "Night portrait" + +//d:Sport scene title text +//d:Visible in scene settings page +//l:cset_list_set_pane_t1_copy1 +// +#define qtn_lcam_scene_sport_v2 "Sport" + + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +//r:5.0 +#define qtn_lcam_set_type_highdefinition_v2 "High definition quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +//r:5.0 +#define qtn_lcam_set_type_widescreen_v2 "Widescreen high quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +//r:5.0 +#define qtn_lcam_set_type_widescr_normal_v2 "Widescreen normal quality" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print9mlarge_v2 "Print 9M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print8mlarge_v2 "Print 8M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print6mlarge_v2 "Print 6M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print5mlarge_v2 "Print 5M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print3mlarge_v2 "Print 3M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print2mlarge_v2 "Print 2M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print3mmed_v2 "Print 3M - Med." + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print2mmed_v2 "Print 2M - Med." + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +#define qtn_lcam_sett_attr_quality_print1med_v2 "Print 1M - Med." + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print1_3small_v2 "Print/Email 1.3M - Small" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print1_0small_v2 "Print/Email 1M - Small" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print0_8med_v2 "Email 0.8M - Med." + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_mms_v2 "MMS 0.3M - Small" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_set_type_high_v2 "High" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_set_type_normal_v2 "Normal" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_set_type_sharing_v2 "Sharing" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_set_type_tvhigh_v2 "4:3 resolution high quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_set_type_tvnorm_v2 "4:3 resolution normal quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_set_type_webhigh_v2 "Email high quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_set_type_webnorm_v2 "Email normal quality" + +//d:Video quality setting description +//d:Visible in video quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_set_type_mms_v2 "Sharing quality" + +//d:Tooltip item for facetracking on +//d:Visible in still pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_facedet_on_v2 "Turn Face detection on" + +//d:Tooltip item for facetracking off +//d:Visible in still pre-capture view active palette. +//l:main_cam5_pane_t11 +// +#define qtn_lcam_tt_facedet_off_v2 "Turn Face detection off" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_quality_print12largem "Print 12M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control and settings list +//l:main_cset_text_pane_t1_copy1 +// +#define qtn_lcam_sett_attr_quality_print12largem_v2 "Print 12M - Large" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cam5_pane_t4/opt1 +// +#define qtn_lcam_descr_quality_print12m "Use for large sized prints up to 20x15 in (50x38 cm)" + +//d:Image quality setting description +//d:Visible in image quality slider control. +//l:main_cset_text_pane +// +#define qtn_lcam_descr_quality_print12m_v2 "Use for large sized prints up to 20x15 in (50x38 cm)" + +//d: Tooltip text for mark mode button +//d: in touch toolbar in sequence post capture view +//l: main_cam5_pane_t11 +#define qtn_lcam_tt_markmode "Mark mode " + +//d:Item value for landscape mode video settings list. +//d:This value sets continuous auto-focus "on". +//d:Setting title is qtn_lcam_sett_attr_cont_af. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_cont_af_on "On" + +//d:Item value for landscape mode video settings list. +//d:This value sets continuous auto-focus "off". +//d:Setting title is qtn_lcam_sett_attr_cont_af. +//l:list_set_graphic_pane_t1 +// +#define qtn_lcam_sett_attr_cont_af_off "Off" + +// end of file diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/rom/cameraapp.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/rom/cameraapp.iby Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for CameraApp +* +*/ + + +#ifndef CAMERAAPP_IBY +#define CAMERAAPP_IBY + +#include + +// Executable +S60_APP_EXE(cameraapp) + +// non-localisable resource files +S60_APP_BITMAP(cameraapp) +S60_APP_BITMAP(cameraapp2) +S60_APP_AIF_ICONS(cameraapp) +S60_UPGRADABLE_APP_REG_RSC(cameraapp) + +// Binary data files +data = ABI_DIR\BUILD_DIR\z\system\sounds\Digital\cameraappCapture1.wav system\sounds\Digital\cameraappCapture1.wav +data = ABI_DIR\BUILD_DIR\z\system\sounds\Digital\cameraappCapture2.wav system\sounds\Digital\cameraappCapture2.wav +data = ABI_DIR\BUILD_DIR\z\system\sounds\Digital\cameraappCapture3.wav system\sounds\Digital\cameraappCapture3.wav +data = ABI_DIR\BUILD_DIR\z\system\sounds\Digital\cameraappCapture4.wav system\sounds\Digital\cameraappCapture4.wav +data = ABI_DIR\BUILD_DIR\z\system\sounds\Digital\cameraappFocusSucc.wav system\sounds\Digital\cameraappFocusSucc.wav +data = ABI_DIR\BUILD_DIR\z\system\sounds\digital\cameraappStop.wav system\sounds\digital\cameraappStop.wav +data = ABI_DIR\BUILD_DIR\z\system\sounds\digital\cameraappStart.wav system\sounds\digital\cameraappStart.wav +data = ABI_DIR\BUILD_DIR\z\system\sounds\Digital\cameraappCaptureShort1.wav system\sounds\Digital\cameraappCaptureShort1.wav +data = ABI_DIR\BUILD_DIR\z\system\sounds\Digital\cameraappCaptureShort2.wav system\sounds\Digital\cameraappCaptureShort2.wav +data = ABI_DIR\BUILD_DIR\z\system\sounds\Digital\cameraappCaptureShort3.wav system\sounds\Digital\cameraappCaptureShort3.wav +data = ABI_DIR\BUILD_DIR\z\system\sounds\Digital\cameraappCaptureShort4.wav system\sounds\Digital\cameraappCaptureShort4.wav + +// Backup registration +data = ZPRIVATE\101FFA86\backup_registration.xml private\101FFA86\backup_registration.xml + + +// General settings camera plug-in +ECOM_PLUGIN(gscameraplugin.dll, 2000F8E0.rsc) +SCALABLE_IMAGE(APP_BITMAP_DIR, APP_BITMAP_DIR, camerasettingsplugin) + + +// Camera UI configuration manager +file=ABI_DIR\BUILD_DIR\CameraUiConfigManager.dll SHARED_LIB_DIR\CameraUiConfigManager.dll + +// Stub sis file +data=ZSYSTEM\install\cameraapp_stub.sis System\Install\cameraapp_stub.sis + +// Backup registration +data = ZPRIVATE\2001B29B\backup_registration.xml private\2001B29B\backup_registration.xml + + +#endif // CAMERAAPP_IBY diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/rom/cameraappresources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/rom/cameraappresources.iby Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Image description file for project ?myapp +* +*/ + + +#ifndef CAMERAAPPRESOURCES_IBY +#define CAMERAAPPRESOURCES_IBY + +#include + +S60_APP_CAPTION(cameraapp) +S60_APP_RESOURCE(cameraapp) + +S60_APP_RESOURCE(nhdcamsettings) +S60_APP_RESOURCE(vgacamsettings) + +data=DATAZ_\RESOURCE_FILES_DIR\gscamerapluginrsc.rsc RESOURCE_FILES_DIR\gscamerapluginrsc.rsc +data=DATAZ_\RESOURCE_FILES_DIR\gscamerapluginrscv2.rsc RESOURCE_FILES_DIR\gscamerapluginrscv2.rsc + +#endif // CAMERAAPPRESOURCES_IBY diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/sis/cameraapp_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/sis/cameraapp_stub.pkg Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,46 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: Stub SIS package cameraapp to enable SIS updates +; +; + +; Languages +&EN + +; Header +#{"cameraapp"},(0x101FFA86),9,20,0,TYPE=SA + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +;Files +; ================= +""-"z:\sys\bin\cameraapp.exe" +""-"z:\sys\bin\CameraUiConfigManager.dll" +""-"z:\resource\apps\cameraapp.r*" +""-"z:\resource\apps\cameraapp.mbm" +""-"z:\resource\apps\cameraapp.mif" +""-"z:\resource\apps\cameraapp_aif.mif" +""-"z:\private\10003a3f\import\apps\cameraapp_reg.rsc" + +""-"z:\resource\apps\nhdcamsettings.r*" +""-"z:\resource\apps\vgacamsettings.r*" + +""-"z:\sys\bin\gscameraplugin.dll" +""-"z:\resource\gscamerapluginrsc.r*" +""-"z:\resource\plugins\gscameraplugin.r*" +""-"z:\resource\gscamerapluginrscv2.r*" diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/sis/cameraapp_stub.sis Binary file camerauis/cameraapp/sis/cameraapp_stub.sis has changed diff -r 000000000000 -r 1ddebce53859 camerauis/cameraapp/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraapp/traces/OstTraceDefinitions.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +//#define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r 000000000000 -r 1ddebce53859 camerauis/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "../activepalette/Group/bld.inf" +#include "../cameraapp/group/bld.inf" + diff -r 000000000000 -r 1ddebce53859 group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/group/bld.inf Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 "../camera_plat/group/bld.inf" + +#include "../camerauis/group/bld.inf" + +PRJ_EXPORTS diff -r 000000000000 -r 1ddebce53859 inc/CamcorderInternalPSKeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/CamcorderInternalPSKeys.h Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Camcorder internal Publish & Subscribe keys. +* +*/ + + + +#ifndef CAMCORDERINTERNALPSKEYS_H +#define CAMCORDERINTERNALPSKEYS_H + +const TUid KPSUidCamcorderNotifier = {0x101F882E}; + +// Camcorder Notification API + +const TUint32 KCCorLatestFilePath = 0x00000001; + +#endif // CAMCORDERINTERNALPSKEYS_H + + +// End of File diff -r 000000000000 -r 1ddebce53859 layers.sysdef.50.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/layers.sysdef.50.xml Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,29 @@ + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 1ddebce53859 layers.sysdef.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/layers.sysdef.xml Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,30 @@ + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 1ddebce53859 package_definition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_definition.xml Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 1ddebce53859 sysdef_1_4_0.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sysdef_1_4_0.dtd Thu Jan 07 16:18:56 2010 +0200 @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +