d781c054bfadff3903be93dc7696bb6d86428878
[platform/framework/web/wrt-commons.git] / tests / dpl / localization / mockup_src / widget_dao.cpp
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  * This file contains the declaration of widget dao class.
18  *
19  * @file    widget_dao_read_only.cpp
20  * @author  Yang Jie (jie2.yang@samsung.com)
21  * @author  Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
22  * @author  Pawel Sikorski (p.sikorski@samsung.com)
23  * @version 1.0
24  * @brief   This file contains the declaration of widget dao
25  */
26
27 //#include "../mockup_include/dpl/wrt-dao-rw/widget_dao.h"
28 #include <dpl/wrt-dao-rw/widget_dao.h>
29
30 #include <sstream>
31 #include <dpl/foreach.h>
32 #include <dpl/log/log.h>
33 #include <dpl/sstream.h>
34
35 namespace WrtDB {
36
37 std::map<DbWidgetHandle,WidgetDAO::WidgetStartFileList> WidgetDAO::s_startFileMap;
38 std::map<DbWidgetHandle,WidgetDAO::LocalizedStartFileList> WidgetDAO::s_localizedStartFileMap;
39 std::map<DbWidgetHandle,DPL::String> WidgetDAO::s_pathMap;
40
41 DbWidgetHandle WidgetDAO::getHandle(const WidgetGUID /* GUID */) const
42 {
43     LogError("Not impleneted!");
44     return 0;
45 }
46
47 DbWidgetHandle WidgetDAO::getHandle(const DPL::String /* pkgName */)
48 {
49     LogError("Not implemented!");
50     return 0;
51 }
52
53 DPL::String WidgetDAO::getPath() const
54 {
55     return s_pathMap[m_widgetHandle];
56 }
57
58 void WidgetDAO::setPath(const DPL::String &path) const
59 {
60     s_pathMap[m_widgetHandle] = path;
61 }
62
63 WidgetLocalizedInfo
64         WidgetDAO::getLocalizedInfo(const DPL::String& /* languageTag */)
65         const
66 {
67     LogError("Not implemented!");
68     return WidgetLocalizedInfo();
69 }
70
71 DPL::OptionalString WidgetDAO::getDefaultlocale() const
72 {
73     LogError("Not implemented!");
74     return DPL::OptionalString();
75 }
76
77 WidgetDAO::WidgetLocalizedIconList WidgetDAO::getLocalizedIconList() const
78 {
79     LogError("Not implemented!");
80     return WidgetLocalizedIconList();
81 }
82
83 WidgetDAO::WidgetIconList WidgetDAO::getIconList() const
84 {
85     LogError("Not implemented!");
86     return WidgetIconList();
87 }
88
89 WidgetDAO::LocalizedStartFileList WidgetDAO::getLocalizedStartFileList() const
90 {
91     return s_localizedStartFileMap[m_widgetHandle];
92 }
93
94 void WidgetDAO::setLocalizedStartFileList(const LocalizedStartFileList &list) const {
95     s_localizedStartFileMap[m_widgetHandle] = list;
96 }
97
98 WidgetDAO::WidgetStartFileList WidgetDAO::getStartFileList() const
99 {
100     return s_startFileMap[m_widgetHandle];
101 }
102
103 void WidgetDAO::setStartFileList(const WidgetStartFileList &list) const
104 {
105     s_startFileMap[m_widgetHandle] = list;
106 }
107
108 } // namespace WrtDB