2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
20 #ifndef WRTPLUGINS_DISPLAY_ISCREEN_H_
21 #define WRTPLUGINS_DISPLAY_ISCREEN_H_
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"
30 namespace WrtPlugins {
33 class IScreen : private DPL::Noncopyable
36 virtual ~IScreen() = 0;
40 * @return Color depth (in bits per pixel).
42 virtual unsigned short getColorDepth() const = 0;
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.
52 virtual Platform::Dimension getSize() const = 0;
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.
62 virtual Platform::Dimension getActualSize() const = 0;
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.
70 virtual Orientation getOrientation() const = 0;
74 * @return State of the screen.
75 * @throw UnsupportedException If platform doesn't support it.
76 * @throw PlatformException If error in platform occurs.
78 virtual State getState() const = 0;
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.
86 virtual void addOnChangeOrientation(
87 const EventChangeOrientationEmitterPtr& emitter) = 0;
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.
95 virtual void removeOnChangeOrientation(
96 EventChangeOrientationEmitter::IdType id) = 0;
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.
104 virtual void addOnChangeState(const EventChangeStateEmitterPtr& emitter) =
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.
113 virtual void removeOnChangeState(EventChangeStateEmitter::IdType id) = 0;
116 typedef DPL::SharedPtr<IScreen> IScreenPtr;
121 #endif // WRTPLUGINS_DISPLAY_ISCREEN_H_