williamr@2: /* williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Interface to product screen mode data. williamr@2: * williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef AKNSCREENMODE_H williamr@2: #define AKNSCREENMODE_H williamr@2: williamr@2: #include williamr@2: williamr@2: class CAknAppUiBase; williamr@2: class SAknLayoutConfig; williamr@2: class SAknScreenModeInfo; williamr@2: williamr@2: williamr@2: /** williamr@2: * Information about a screen mode williamr@2: * williamr@2: * @since 3.1 williamr@2: */ williamr@2: class TAknScreenMode williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Gets the size of the screen for this screen mode in pixels.. williamr@2: * @return The screen size. williamr@2: */ williamr@2: IMPORT_C TSize SizeInPixels() const; williamr@2: /** williamr@2: * Gets the display mode (color depth) for this screen mode. williamr@2: * @return The display mode. williamr@2: */ williamr@2: IMPORT_C TDisplayMode DisplayMode() const; williamr@2: /** williamr@2: * Gets the screen mode number. This is the screen mode number williamr@2: * as used by @c CWsScreenDevice APIs, which start from zero. williamr@2: * It is one less than the number of the coresponding entry williamr@2: * in wsini.ini, which start from one. williamr@2: * @return The screen mode number. williamr@2: */ williamr@2: IMPORT_C TInt ModeNumber() const; williamr@2: williamr@2: public: williamr@2: TAknScreenMode(const SAknScreenModeInfo& aInfo); williamr@2: williamr@2: protected: williamr@2: const SAknScreenModeInfo& iInfo; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * TAknScreenModes is a collection of available screen williamr@2: * modes on this device, with API for setting an application's williamr@2: * screen mode. williamr@2: * williamr@2: * @since 3.1 williamr@2: */ williamr@2: class TAknScreenModes williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Factory function. williamr@2: * @return A constructed TAknScreenModes object. williamr@2: */ williamr@2: IMPORT_C static TAknScreenModes GetModes(); williamr@2: /** williamr@2: * Get the number of screen modes. williamr@2: * @return The number of screen modes. williamr@2: */ williamr@2: IMPORT_C TInt Count() const; williamr@2: /** williamr@2: * Get screen mode information by index. williamr@2: * @param aIndex, the screen mode index, must be in the williamr@2: * range [0, Count()). williamr@2: * @return Information about a screen mode. williamr@2: */ williamr@2: IMPORT_C TAknScreenMode operator[](TInt aIndex) const; williamr@2: /** williamr@2: * Set the screen mode for an application UI. williamr@2: * The application will be displayed in the selected williamr@2: * screen mode. The application will no longer respond to williamr@2: * hardware or software events which would normally affect williamr@2: * screen mode. It will be permanently fixed to the selected williamr@2: * screen mode. williamr@2: * By using this API, the application effectively declares williamr@2: * itself to be non-scalable. williamr@2: * Notifier dialogs and other non-full-screen UI will appear williamr@2: * in the selected screen mode when displayed over this app. williamr@2: * Other full-screen applications will not be affected by williamr@2: * this call, except in that switching between this app and williamr@2: * other apps using different screen modes will be slow. williamr@2: * The screen mode selected must be one returned through williamr@2: * the API of this class. There are no fixed screen modes williamr@2: * which will appear on every device. The emulator may williamr@2: * support many screen modes, but any particular device williamr@2: * will probably only support one or two modes. williamr@2: * Setting a screen mode may result in the application looking williamr@2: * low resolution, badly positioned, the wrong shape, williamr@2: * incorrect for certain hardware configurations (eg softkeys williamr@2: * in the wrong place), only taking up part of the screen, williamr@2: * other applications being visible behind it and generally williamr@2: * bad in many other ways. williamr@2: * It is strongly recommended that application authors write williamr@2: * their applications to be scalable, rather than use this API. williamr@2: * If an application wants a fixed orientation, it should use williamr@2: * @c CAknAppUiBase::SetOrientationL(). williamr@2: * Note: this API has no effect on non-full-screen app UIs. williamr@2: * @param aAppUi The app UI. williamr@2: * @param aMode A screen mode accessed through this API. williamr@2: */ williamr@2: IMPORT_C static void SetAppUiScreenModeL(CAknAppUiBase* aAppUi, const TAknScreenMode& aMode); williamr@2: williamr@2: public: williamr@2: TAknScreenModes(const SAknLayoutConfig& aInfo); williamr@2: williamr@2: protected: williamr@2: const SAknLayoutConfig& iInfo; williamr@2: }; williamr@2: williamr@2: williamr@2: #endif