tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / Profile / IManager.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 WRTDEVICEAPIS_PROFILE_IMANAGER_H_
21 #define WRTDEVICEAPIS_PROFILE_IMANAGER_H_
22
23 #include <cstddef>
24 #include "IDesktop.h"
25 #include "IRingtone.h"
26 #include "Enums.h"
27
28 namespace WrtDeviceApis {
29 namespace Profile {
30 namespace Api {
31 class IManager
32 {
33   public:
34     static IManager& getInstance();
35
36     typedef enum
37     {
38         NORMAL, SILENT, DRIVING, MEETING, OUTDOOR, FLIGHT
39     } ProfileType;
40
41   public:
42     virtual ~IManager() = 0;
43
44     /**
45      * Gets desktop settings interface for current profile.
46      * @param index 1-based index
47      * @return Desktop interface (or NULL if 0 is passed and general desktop is not supported).
48      * @throw PlatformException If error in platform occurs.
49      * @throw OutOfRangeException If desktop doesn't exist.
50      * @throw UnsupportedException If platform doesn't support it.
51      * @remarks Passing IDesktop::DEFAULT as index results in returning default
52      *          desktop interface (or first one if platform doesn't distinct them).
53      * @remarks Ownership is NOT passed to the caller.
54      */
55     virtual IDesktopPtr getDesktop(std::size_t index) const = 0;
56
57     /**
58      * Gets number of available desktops on current platform.
59      * @return Number of desktops.
60      * @throw PlatformException If error in platform occurs.
61      */
62     virtual std::size_t getDesktopCount() const = 0;
63
64     /**
65      * Gets ringtone interface for specific type of received message.
66      * @param scope Received message/call type.
67      * @return Ringtone interface.
68      * @throw PlatformException If error in platform occurs.
69      * @throw UnsupportedException If platform doesn't support it.
70      * @remarks Some platforms may not distinct between different types of messages
71      *          as far as ringtone settings are concerned, e.g. they may assign
72      *          SMS, MMS and EMAIL the same ringtone settings.
73      * @remarks Ownership is NOT passed to the caller.
74      */
75     virtual IRingtone* getRingtone(RingtoneScope scope) const = 0;
76
77     /**
78      * Returns profile setting.
79      * @return ProfileType enum.
80      * @throw ConversionException
81      * @throw OutOfRangeException
82      */
83     virtual ProfileType getProfileType() const = 0;
84
85     /**
86      * Returns system volume value.
87      * @return system volume as int.
88      * @throw ConversionException
89      */
90     virtual int getSystemVolume() const = 0;
91
92     /**
93      * Release resources.
94      */
95     virtual void Release() const = 0;
96     virtual int getVibrateType() const = 0;
97 };
98 } // Api
99 } // Profile
100 } // WrtDeviceApis
101
102 #endif // WRTDEVICEAPIS_PROFILE_IMANAGER_H_