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