2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FSys_SettingClient.h
20 * @brief This is the header file for _SettingClient class.
23 #ifndef _FSYSTEM_INTERNAL_SETTING_CLIENT_H_
24 #define _FSYSTEM_INTERNAL_SETTING_CLIENT_H_
26 #include <FIo_IpcClient.h>
28 #include <FBaseColArrayList.h>
29 #include <FBaseColHashMap.h>
30 #include <FBaseObject.h>
31 #include <FBaseRtEvent.h>
32 #include <FBaseRtIEventArg.h>
33 #include <FBaseRtIEventListener.h>
34 #include <FBaseString.h>
35 #include <FBaseInteger.h>
36 #include <FBaseUuId.h>
37 #include <FSysISettingEventListener.h>
38 #include <FSys_ICommunicationDispatcherListener.h>
39 #include <FSysISettingInfoSetValueAsyncResultListener.h>
41 namespace Tizen { namespace System
45 : public Tizen::Base::Object
46 , public Tizen::System::_ICommunicationDispatcherListener
50 virtual ~_SettingClient(void);
53 result GetValue(const Tizen::Base::String& key, bool& value);
54 result GetValueForPrivilegedKey(const Tizen::Base::String& key, bool& value);
55 result GetValue(const Tizen::Base::String& key, double& value);
56 result GetValue(const Tizen::Base::String& key, int& value);
57 result GetValue(const Tizen::Base::String& key, long long& value);
58 result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
59 result GetValue(const Tizen::Base::String& key, Tizen::Base::UuId& value);
61 bool HasKey(const Tizen::Base::String& key);
63 result SetValue(const Tizen::Base::String& key, const bool& value);
64 result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
65 result SetValueAsync(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener);
66 result SetValueAsyncForPrivilegedKey(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener);
67 result SetValue(const Tizen::Base::String& key, const int& value);
68 result SetValue(const Tizen::Base::String& key, const Tizen::Base::String& value);
69 result SetValueForPrivilegedKey(const Tizen::Base::String& key, Tizen::Base::String value);
71 result AddSettingEventListenerForInternal(ISettingEventListener& listener);
72 result RemoveSettingEventListenerForInternal(ISettingEventListener& listener);
73 result AddSettingEventListener(ISettingEventListener& listener);
74 result RemoveSettingEventListener(ISettingEventListener& listener);
76 result SetSettingEventListener(ISettingEventListener* pListener);
78 result ResetToFactoryDefault(void);
80 static _SettingClient* GetInstance(void);
83 void OnDataReceived(const Tizen::Base::Collection::ArrayList& data);
84 result ConvertCode(Tizen::Base::String code);
86 Tizen::Base::String ConvertKeyOspToTizen(Tizen::Base::String ospKey);
87 result ConvertKeyTizenToOsp(Tizen::Base::String tizenKey, Tizen::Base::String& ospKey);
89 result GetOnService(Tizen::Base::String commandId, Tizen::Base::String key, Tizen::Base::String& response);
90 result SetOnService(Tizen::Base::String commandId, Tizen::Base::String key, Tizen::Base::String& value);
91 result SetVolume(const Tizen::Base::String& soundCategory, int level);
93 result SubscribeEvent(void);
95 static void InitSettingClient(void);
97 Tizen::Base::Collection::HashMap __asyncEventList;
98 Tizen::Base::Runtime::Event* __pSettingEvent;
99 Tizen::Base::Runtime::Event* __pSettingEventForInternal;
102 Tizen::Io::_IpcClient* __pIpcClient;
103 ISettingEventListener* __pListener;
105 static _SettingClient* __pSettingClient;
111 #endif //_FSYSTEM_INTERNAL_SETTING_CLIENT_H_