|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "AknScreenMode.h" |
|
19 #include "AknLayoutConfig.h" |
|
20 #include "AknSgcc.h" |
|
21 #include "AknLayoutConfigInternal.h" |
|
22 #include "AknPanic.h" |
|
23 #include "aknappui.h" |
|
24 |
|
25 EXPORT_C TSize TAknScreenMode::SizeInPixels() const |
|
26 { |
|
27 return iInfo.iPixelsTwipsAndRotation.iPixelSize; |
|
28 } |
|
29 |
|
30 EXPORT_C TDisplayMode TAknScreenMode::DisplayMode() const |
|
31 { |
|
32 return iInfo.iDisplayMode; |
|
33 } |
|
34 |
|
35 EXPORT_C TInt TAknScreenMode::ModeNumber() const |
|
36 { |
|
37 return iInfo.iModeNumber; |
|
38 } |
|
39 |
|
40 TAknScreenMode::TAknScreenMode(const SAknScreenModeInfo& aInfo) |
|
41 : iInfo(aInfo) |
|
42 { |
|
43 } |
|
44 |
|
45 |
|
46 EXPORT_C TAknScreenModes TAknScreenModes::GetModes() |
|
47 { |
|
48 return CAknSgcClient::LayoutConfig().ScreenModes(); |
|
49 } |
|
50 |
|
51 EXPORT_C TInt TAknScreenModes::Count() const |
|
52 { |
|
53 return iInfo.iNumScreenModes; |
|
54 } |
|
55 |
|
56 EXPORT_C TAknScreenMode TAknScreenModes::operator[](TInt aIndex) const |
|
57 { |
|
58 __ASSERT_ALWAYS(0 <= aIndex && aIndex < iInfo.iNumScreenModes, Panic(EAknPanicLayoutConfigBadScreenModeIndex)); |
|
59 return TAknScreenMode(iInfo.iScreenModes[aIndex]); |
|
60 } |
|
61 |
|
62 EXPORT_C void TAknScreenModes::SetAppUiScreenModeL(CAknAppUiBase* aAppUi, const TAknScreenMode& aMode) |
|
63 { |
|
64 aAppUi->SetScreenModeL(aMode.ModeNumber()); |
|
65 } |
|
66 |
|
67 TAknScreenModes::TAknScreenModes(const SAknLayoutConfig& aInfo) |
|
68 : iInfo(aInfo) |
|
69 { |
|
70 } |
|
71 |
|
72 |