tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / DEPRACATED / Display / IScreen.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /**
17  * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
18  */
19
20 #ifndef WRTPLUGINS_DISPLAY_ISCREEN_H_
21 #define WRTPLUGINS_DISPLAY_ISCREEN_H_
22
23 #include <dpl/shared_ptr.h>
24 #include <dpl/noncopyable.h>
25 #include <platform/commons/Dimension.h>
26 #include "EventChangeOrientation.h"
27 #include "EventChangeState.h"
28 #include "Enums.h"
29
30 namespace WrtPlugins {
31 namespace Api {
32 namespace Display {
33 class IScreen : private DPL::Noncopyable
34 {
35   public:
36     virtual ~IScreen() = 0;
37
38     /**
39      * Gets color depth.
40      * @return Color depth (in bits per pixel).
41      */
42     virtual unsigned short getColorDepth() const = 0;
43
44     /**
45      * Gets screen's real size (in pixels).
46      * @return Screen's real size.
47      * @throw UnsupportedException If platform doesn't support it.
48      * @throw PlatformException If error in platform occurs.
49      * @remarks "Real size" means that temporary screen modifications like e.g.
50      *          changing orientation are not taken into account.
51      */
52     virtual Platform::Dimension getSize() const = 0;
53
54     /**
55      * Gets screen's actual size (in pixels).
56      * @return Screen's actual size.
57      * @throw UnsupportedException If platform doesn't support it.
58      * @throw PlatformException If error in platform occurs.
59      * @remarks Convenience method that takes into account any temporary screen
60      *          modifications like e.g. changing orientation.
61      */
62     virtual Platform::Dimension getActualSize() const = 0;
63
64     /**
65      * Gets screen's orientation.
66      * @return Orientation.
67      * @throw UnsupportedException If platform doesn't support it.
68      * @throw PlatformException If error in platform occurs.
69      */
70     virtual Orientation getOrientation() const = 0;
71
72     /**
73      * Gets screen state.
74      * @return State of the screen.
75      * @throw UnsupportedException If platform doesn't support it.
76      * @throw PlatformException If error in platform occurs.
77      */
78     virtual State getState() const = 0;
79
80     /**
81      * Adds on change size event emitter.
82      * @param emitter On change size event emitter.
83      * @throw UnsupportedException If platform doesn't support it.
84      * @throw PlatformException If error in platform occurs.
85      */
86     virtual void addOnChangeOrientation(
87             const EventChangeOrientationEmitterPtr& emitter) = 0;
88
89     /**
90      * Removes on change size emitter.
91      * @param id Id of an event emitter.
92      * @throw UnsupportedException If platform doesn't support it.
93      * @throw PlatformException If error in platform occurs.
94      */
95     virtual void removeOnChangeOrientation(
96             EventChangeOrientationEmitter::IdType id) = 0;
97
98     /**
99      * Adds on change state event emitter.
100      * @param emitter On change state event emitter.
101      * @throw UnsupportedException If platform doesn't support it.
102      * @throw PlatformException If error in platform occurs.
103      */
104     virtual void addOnChangeState(const EventChangeStateEmitterPtr& emitter) =
105         0;
106
107     /**
108      * Removes on change state emitter.
109      * @param id Id of an event emitter.
110      * @throw UnsupportedException If platform doesn't support it.
111      * @throw PlatformException If error in platform occurs.
112      */
113     virtual void removeOnChangeState(EventChangeStateEmitter::IdType id) = 0;
114 };
115
116 typedef DPL::SharedPtr<IScreen> IScreenPtr;
117 } // Display
118 } // Api
119 } // WrtPlugins
120
121 #endif // WRTPLUGINS_DISPLAY_ISCREEN_H_