epoc32/include/mw/aknscreenmode.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Interface to product screen mode data.
    15 *
    16 *
    17 */
    18 
    19 
    20 #ifndef AKNSCREENMODE_H
    21 #define AKNSCREENMODE_H
    22 
    23 #include <w32std.h>
    24 
    25 class CAknAppUiBase;
    26 class SAknLayoutConfig;
    27 class SAknScreenModeInfo;
    28 
    29 
    30 /**
    31 *  Information about a screen mode
    32 *
    33 *  @since 3.1
    34 */
    35 class TAknScreenMode
    36     {
    37 public:
    38     /**
    39     * Gets the size of the screen for this screen mode in pixels..
    40     * @return The screen size.
    41     */
    42     IMPORT_C TSize SizeInPixels() const;
    43     /**
    44     * Gets the display mode (color depth) for this screen mode.
    45     * @return The display mode.
    46     */
    47     IMPORT_C TDisplayMode DisplayMode() const;
    48 	/**
    49 	* Gets the screen mode number. This is the screen mode number
    50 	* as used by @c CWsScreenDevice APIs, which start from zero.
    51 	* It is one less than the number of the coresponding entry 
    52 	* in wsini.ini, which start from one.
    53 	* @return The screen mode number.
    54 	*/
    55 	IMPORT_C TInt ModeNumber() const;
    56 
    57 public:
    58     TAknScreenMode(const SAknScreenModeInfo& aInfo);
    59     
    60 protected:
    61     const SAknScreenModeInfo& iInfo;
    62     };
    63 
    64 
    65 /**
    66 *  TAknScreenModes is a collection of available screen 
    67 *  modes on this device, with API for setting an application's
    68 *  screen mode.
    69 *
    70 *  @since 3.1
    71 */
    72 class TAknScreenModes
    73     {
    74 public:
    75     /**
    76     * Factory function.
    77     * @return A constructed TAknScreenModes object.
    78     */
    79     IMPORT_C static TAknScreenModes GetModes();
    80     /**
    81     * Get the number of screen modes.
    82     * @return The number of screen modes.
    83     */
    84     IMPORT_C TInt Count() const;
    85     /**
    86     * Get screen mode information by index.
    87     * @param aIndex, the screen mode index, must be in the
    88     * range [0, Count()).
    89     * @return Information about a screen mode.
    90     */
    91     IMPORT_C TAknScreenMode operator[](TInt aIndex) const;
    92     /**
    93     * Set the screen mode for an application UI.
    94     * The application will be displayed in the selected
    95     * screen mode. The application will no longer respond to
    96     * hardware or software events which would normally affect
    97     * screen mode. It will be permanently fixed to the selected
    98     * screen mode.
    99     * By using this API, the application effectively declares
   100     * itself to be non-scalable.
   101     * Notifier dialogs and other non-full-screen UI will appear
   102     * in the selected screen mode when displayed over this app.
   103     * Other full-screen applications will not be affected by
   104     * this call, except in that switching between this app and
   105     * other apps using different screen modes will be slow.
   106     * The screen mode selected must be one returned through
   107     * the API of this class. There are no fixed screen modes
   108     * which will appear on every device. The emulator may
   109     * support many screen modes, but any particular device
   110     * will probably only support one or two modes.
   111     * Setting a screen mode may result in the application looking
   112     * low resolution, badly positioned, the wrong shape,
   113     * incorrect for certain hardware configurations (eg softkeys
   114     * in the wrong place), only taking up part of the screen,
   115     * other applications being visible behind it and generally
   116     * bad in many other ways.
   117     * It is strongly recommended that application authors write
   118     * their applications to be scalable, rather than use this API.
   119     * If an application wants a fixed orientation, it should use
   120     * @c CAknAppUiBase::SetOrientationL().
   121     * Note: this API has no effect on non-full-screen app UIs.
   122     * @param aAppUi The app UI.
   123     * @param aMode A screen mode accessed through this API.
   124     */
   125     IMPORT_C static void SetAppUiScreenModeL(CAknAppUiBase* aAppUi, const TAknScreenMode& aMode);
   126 
   127 public:
   128     TAknScreenModes(const SAknLayoutConfig& aInfo);
   129 
   130 protected:
   131     const SAknLayoutConfig& iInfo;
   132     };
   133 
   134 
   135 #endif