summaryrefslogtreecommitdiff
path: root/mobile_src/DataSync/DataSyncManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'mobile_src/DataSync/DataSyncManager.h')
-rwxr-xr-xmobile_src/DataSync/DataSyncManager.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/mobile_src/DataSync/DataSyncManager.h b/mobile_src/DataSync/DataSyncManager.h
new file mode 100755
index 0000000..603cf5a
--- /dev/null
+++ b/mobile_src/DataSync/DataSyncManager.h
@@ -0,0 +1,100 @@
+//
+// Tizen Web Device API
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+
+#ifndef _PLATFORM_DATASYNC_MANAGER_H_
+#define _PLATFORM_DATASYNC_MANAGER_H_
+
+#include "IDataSyncManager.h"
+#include "OnDataSyncStateChanged.h"
+
+#include <string>
+#include <map>
+
+namespace DeviceAPI {
+namespace DataSync {
+
+#define MAX_PROFILES_NUM 5
+
+class DataSyncManager : public IDataSyncManager
+{
+ public:
+ DataSyncManager();
+ virtual ~DataSyncManager();
+
+ virtual void addProfile(const IEventAddProfilePtr &event) {
+ OnRequestReceived(event);
+ }
+
+ virtual void updateProfile(const IEventUpdateProfilePtr &event) {
+ OnRequestReceived(event);
+ }
+
+ virtual void removeProfile(const IEventRemoveProfilePtr &event) {
+ OnRequestReceived(event);
+ }
+
+ virtual void getMaxProfilesNum(const IEventGetMaxProfilesNumPtr &event) {
+ OnRequestReceived(event);
+ }
+
+ virtual void getProfilesNum(const IEventGetProfilesNumPtr &event) {
+ OnRequestReceived(event);
+ }
+
+ virtual void getProfile(const IEventGetProfilePtr &event) {
+ OnRequestReceived(event);
+ }
+
+ virtual void getAllProfiles(const IEventGetAllProfilesPtr &event) {
+ OnRequestReceived(event);
+ }
+
+ virtual void startSync(const IEventStartSyncPtr &event) {
+ OnRequestReceived(event);
+ }
+
+ virtual void stopSync(const IEventStopSyncPtr &event) {
+ OnRequestReceived(event);
+ }
+
+ virtual void getLastSyncStatistics(const IEventGetLastSyncStatisticsPtr &event) {
+ OnRequestReceived(event);
+ }
+
+ std::map<std::string, OnDataSyncStateChangedEmitterPtr> m_changeEmitters;
+
+ protected:
+ virtual void OnRequestReceived(const IEventAddProfilePtr &event);
+ virtual void OnRequestReceived(const IEventUpdateProfilePtr &event);
+ virtual void OnRequestReceived(const IEventRemoveProfilePtr &event);
+ virtual void OnRequestReceived(const IEventGetMaxProfilesNumPtr &event);
+ virtual void OnRequestReceived(const IEventGetProfilesNumPtr &event);
+ virtual void OnRequestReceived(const IEventGetProfilePtr &event);
+ virtual void OnRequestReceived(const IEventGetAllProfilesPtr &event);
+ virtual void OnRequestReceived(const IEventStartSyncPtr &event);
+ virtual void OnRequestReceived(const IEventStopSyncPtr &event);
+ virtual void OnRequestReceived(const IEventGetLastSyncStatisticsPtr &event);
+
+ private:
+ static int m_instanceCount;
+};
+
+}
+}
+
+#endif /* _PLATFORM_DATASYNC_MANAGER_H_ */