upload tizen1.0 source
[framework/web/wrt-commons.git] / tests / 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 <dpl/wrt-dao-rw/widget_dao.h>
28
29 #include <sstream>
30 #include <dpl/foreach.h>
31 #include <dpl/log/log.h>
32 #include <dpl/sstream.h>
33
34 namespace WrtDB {
35
36 std::map<DbWidgetHandle,WidgetDAO::WidgetStartFileList> WidgetDAO::s_startFileMap;
37 std::map<DbWidgetHandle,WidgetDAO::LocalizedStartFileList> WidgetDAO::s_localizedStartFileMap;
38 std::map<DbWidgetHandle,DPL::String> WidgetDAO::s_pathMap;
39
40 DbWidgetHandle WidgetDAO::getHandle(const WidgetGUID /* GUID */) const
41 {
42     LogError("Not impleneted!");
43     return 0;
44 }
45
46 DbWidgetHandle WidgetDAO::getHandle(const DPL::String /* pkgName */)
47 {
48     LogError("Not implemented!");
49     return 0;
50 }
51
52 DPL::String WidgetDAO::getPath() const
53 {
54     return s_pathMap[m_widgetHandle];
55 }
56
57 void WidgetDAO::setPath(const DPL::String &path) const
58 {
59     s_pathMap[m_widgetHandle] = path;
60 }
61
62 WidgetLocalizedInfo
63         WidgetDAO::getLocalizedInfo(const DPL::String& /* languageTag */)
64         const
65 {
66     LogError("Not implemented!");
67     return WidgetLocalizedInfo();
68 }
69
70 DPL::OptionalString WidgetDAO::getDefaultlocale() const
71 {
72     LogError("Not implemented!");
73     return DPL::OptionalString();
74 }
75
76 WidgetDAO::WidgetLocalizedIconList WidgetDAO::getLocalizedIconList() const
77 {
78     LogError("Not implemented!");
79     return WidgetLocalizedIconList();
80 }
81
82 WidgetDAO::WidgetIconList WidgetDAO::getIconList() const
83 {
84     LogError("Not implemented!");
85     return WidgetIconList();
86 }
87
88 WidgetDAO::LocalizedStartFileList WidgetDAO::getLocalizedStartFileList() const
89 {
90     return s_localizedStartFileMap[m_widgetHandle];
91 }
92
93 void WidgetDAO::setLocalizedStartFileList(const LocalizedStartFileList &list) const {
94     s_localizedStartFileMap[m_widgetHandle] = list;
95 }
96
97 WidgetDAO::WidgetStartFileList WidgetDAO::getStartFileList() const
98 {
99     return s_startFileMap[m_widgetHandle];
100 }
101
102 void WidgetDAO::setStartFileList(const WidgetStartFileList &list) const
103 {
104     s_startFileMap[m_widgetHandle] = list;
105 }
106
107 } // namespace WrtDB