tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / DEPRACATED / UI / IPreferences.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      Karol Majewski (k.majewski@samsung.com)
18  * @version     0.1
19  * @brief
20  */
21
22 #ifndef WRTPLUGINSUIIPREFERENCES_H_
23 #define WRTPLUGINSUIIPREFERENCES_H_
24
25 #include <dpl/event/controller.h>
26 #include <commons/ThreadPool.h>
27 #include <commons/EventReceiver.h>
28 #include "IPreferencesEvents.h"
29
30 namespace WrtPlugins {
31 namespace Api {
32 //============================================================
33 class IPreferences : public Platform::EventRequestReceiver< IEventSetWallpaper >,
34     public Platform::EventRequestReceiver< IEventSetCallRingtone >,
35     public Platform::EventRequestReceiver< IEventSetMessageRingtone >
36 {
37   protected:
38     IPreferences() : Platform::EventRequestReceiver< IEventSetWallpaper >(
39             Platform::ThreadEnum::UI_THREAD),
40         Platform::EventRequestReceiver< IEventSetCallRingtone >(Platform::
41                                                                     ThreadEnum
42                                                                     ::UI_THREAD),
43         Platform::EventRequestReceiver< IEventSetMessageRingtone >(Platform::
44                                                                        ThreadEnum
45                                                                        ::
46                                                                        UI_THREAD)
47     {
48     }
49
50     virtual void OnRequestReceived(
51             const DPL::SharedPtr<IEventSetWallpaper> &event) = 0;
52     virtual void OnRequestReceived(
53             const DPL::SharedPtr<IEventSetCallRingtone> &event) = 0;
54     virtual void OnRequestReceived(
55             const DPL::SharedPtr<IEventSetMessageRingtone> &event) = 0;
56   public:
57     virtual void setWallpaper(DPL::SharedPtr<IEventSetWallpaper> &event)
58     {
59         PostRequest(event);
60     }
61     virtual void setCallRingtone(DPL::SharedPtr<IEventSetCallRingtone> &event)
62     {
63         PostRequest(event);
64     }
65     virtual void setMessageRingtone(
66             DPL::SharedPtr<IEventSetMessageRingtone> &event)
67     {
68         PostRequest(event);
69     }
70
71     virtual ~IPreferences()
72     {
73     }
74 };
75 //============================================================
76 } //namespace
77 } //namespace
78
79 #endif /* WRTPLUGINSUIIPREFERENCES_H_ */