tizen beta release
[platform/framework/web/wrt-plugins-common.git] / src / modules / API / Radio / ISource.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_RADIO_ISOURCE_H_
21 #define WRTDEVICEAPIS_RADIO_ISOURCE_H_
22
23 #include "Enums.h"
24 #include "EventSourceTypeChange.h"
25
26 namespace WrtDeviceApis {
27 namespace Radio {
28 namespace Api {
29 class ISource
30 {
31   public:
32     virtual ~ISource() = 0;
33
34     /**
35      * Gets whether device is connected to some signal source.
36      * @return True if connected, false otherwise.
37      * @throw PlatformException If error in platform occurs.
38      */
39     virtual bool isConnected() const = 0;
40
41     /**
42      * Gets type of the signal source.
43      * @return Type of the source.
44      * @throw UnsupportedException If platform doesn't support it.
45      * @throw PlatformException If error in platform occurs.
46      */
47     virtual SourceType getType() const = 0;
48
49     /**
50      * Adds on type change emitter.
51      * @param emitter On type change event emitter.
52      * @throw UnsupportedException If platform doesn't support it.
53      * @throw PlatformException If error in platform occurs.
54      */
55     virtual void addOnTypeChange(const EventSourceTypeChangeEmitterPtr& emitter)
56         = 0;
57
58     /**
59      * Removes on type change emitter.
60      * @param id Id of an event emitter.
61      * @throw UnsupportedException If platform doesn't support it.
62      * @throw PlatformException If error in platform occurs.
63      */
64     virtual void removeOnTypeChange(EventSourceTypeChangeEmitter::IdType id) =
65         0;
66 };
67 } // Api
68 } // Radio
69 } // WrtDeviceApis
70
71 #endif // WRTDEVICEAPIS_RADIO_ISOURCE_H_