|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Interface for Render Stage Display Policy |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef WSDISPLAYPOLICY_H_ |
|
19 #define WSDISPLAYPOLICY_H_ |
|
20 |
|
21 /** |
|
22 @file |
|
23 @publishedpartner |
|
24 @released |
|
25 */ |
|
26 |
|
27 #include <graphics/displayconfiguration.h> |
|
28 #include <graphics/wsgraphicdrawerinterface.h> |
|
29 |
|
30 class MWsDisplayPolicy: public MWsObjectProvider |
|
31 { |
|
32 public: |
|
33 enum |
|
34 { |
|
35 KUidWsDisplayPolicy = 0x102869FA, |
|
36 ETypeId= KUidWsDisplayPolicy, |
|
37 EWsObjectInterfaceId= KUidWsDisplayPolicy |
|
38 }; |
|
39 |
|
40 enum TDisplayStatus |
|
41 { |
|
42 EDetach = 0, |
|
43 EAttach, |
|
44 EConnecting, |
|
45 }; |
|
46 public: |
|
47 /** |
|
48 * Notification from the Window Server that the application size mode list has been updated. |
|
49 */ |
|
50 virtual void NewAppModesAvailable()=0; |
|
51 /** |
|
52 * Determine the display configuration and application rendering extent to use for a given screen size mode. |
|
53 * |
|
54 * The Window Server uses this function when a request to change to a new screen size mode or new display |
|
55 * configuration is made by a client. The display configuration passed in may be partially filled, and the |
|
56 * combination of the defined entries in it and the requested screen size mode values shall be used to define |
|
57 * the rest of the configuration and new application extent to be used. |
|
58 * |
|
59 * Only undefined entries in the configuration may be set by this function. Entries already defined must retain |
|
60 * the same values. If the combination of defined entries and size mode values is not acceptable to the implementer, |
|
61 * the function shall return KErrArgument. |
|
62 * |
|
63 * If the function returns KErrNone, the Window Server shall set the returned display configuration, notify render |
|
64 * stages of the new application extent and change to use the screen size mode. If either this function returns |
|
65 * EFalse or the call to set the display configuration fails for any reason (such as KErrNoMemory, for example), |
|
66 * then no further changes are made. |
|
67 * |
|
68 * @see MWsScreenConfigList |
|
69 * @see MWsDisplayMapping |
|
70 * |
|
71 * @param aScreenSizeMode The requested screen size mode. If static, the size in pixels, size in twips, and |
|
72 * the rotation must be respected. If dynamic, only the rotation must be respected. |
|
73 * @param aConfig The requested display configuration on input, the required configuration on return. Only |
|
74 * undefined entries may be set. |
|
75 * @param aExtent The screen size mode offset and size on input, the required application offset and size on return. |
|
76 * If the screen driver buffer is used as the UI surface, this must be left unchanged. |
|
77 * @return KErrNone if no error, otherwise a system wide error code |
|
78 */ |
|
79 virtual TInt GetSizeModeConfiguration(TInt aScreenSizeMode, TDisplayConfiguration& aConfig, TRect& aSizeModePosition) const =0; |
|
80 virtual TInt SuitableAppMode(TDisplayStatus aSituation)=0; |
|
81 /** |
|
82 * Sets the application mode resumed to after a display is connected again after a disconnect. |
|
83 * |
|
84 * @param aMode The application mode. |
|
85 */ |
|
86 virtual void SetLastAppMode(TInt aMode)=0; |
|
87 }; |
|
88 |
|
89 #endif /*WSDISPLAYPOLICY_H_*/ |