Initialize Tizen 2.3
[framework/web/wrt-plugins-common.git] / src_wearable / modules / API / StorageEvent / StorageEvent.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  *
18  * @file        StorageEvent.cpp
19  * @author      Andrzej Surdej (a.surdej@samsung.com)
20  * @version     0.1
21  * @brief       Storage event class implementation
22  */
23
24 #include "StorageEvent.h"
25
26 namespace WrtDeviceApis {
27 namespace StorageEvent {
28 namespace Api {
29 StorageEvent::StorageEvent() :
30     m_storageArea(NULL) {}
31
32 StorageEvent::StorageEvent(
33     const LocalStorage::Api::ILocalStoragePtr &storageArea) :
34     m_storageArea(storageArea) {}
35
36 std::string StorageEvent::getKey() const
37 {
38     return m_key;
39 }
40
41 DPL::OptionalString StorageEvent::getOldValue() const
42 {
43     return m_oldValue;
44 }
45
46 DPL::OptionalString StorageEvent::getNewValue() const
47 {
48     return m_newValue;
49 }
50 std::string StorageEvent::getUrl() const
51 {
52     return m_url;
53 }
54
55 LocalStorage::Api::ILocalStoragePtr StorageEvent::getStorageArea() const
56 {
57     return m_storageArea;
58 }
59
60 void StorageEvent::setKey(const std::string &inKey)
61 {
62     m_key = inKey;
63 }
64
65 void StorageEvent::setOldValue(const std::string &inValue)
66 {
67     m_oldValue = DPL::FromUTF8String(inValue);
68 }
69
70 void StorageEvent::setNewValue(const std::string &inValue)
71 {
72     m_newValue = DPL::FromUTF8String(inValue);
73 }
74
75 void StorageEvent::setUrl(const std::string &inUrl)
76 {
77     m_url = inUrl;
78 }
79
80 void StorageEvent::setStorageArea(
81     const LocalStorage::Api::ILocalStoragePtr &inStorageArea)
82 {
83     m_storageArea = inStorageArea;
84 }
85 } // Api
86 } // StorageEvent
87 } // WrtDeviceApis