tizen beta release
[framework/web/wrt-plugins-common.git] / src / 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
30 StorageEvent::StorageEvent() :
31     m_storageArea(NULL) {}
32
33 StorageEvent::StorageEvent(
34         const LocalStorage::Api::ILocalStoragePtr &storageArea) :
35     m_storageArea(storageArea) {}
36
37 std::string StorageEvent::getKey() const
38 {
39     return m_key;
40 }
41
42 DPL::OptionalString StorageEvent::getOldValue() const
43 {
44     return m_oldValue;
45 }
46
47 DPL::OptionalString StorageEvent::getNewValue() const
48 {
49     return m_newValue;
50 }
51 std::string StorageEvent::getUrl() const
52 {
53     return m_url;
54 }
55
56 LocalStorage::Api::ILocalStoragePtr StorageEvent::getStorageArea() const
57 {
58     return m_storageArea;
59 }
60
61 void StorageEvent::setKey(const std::string &inKey)
62 {
63     m_key = inKey;
64 }
65
66 void StorageEvent::setOldValue(const std::string &inValue)
67 {
68     m_oldValue = DPL::FromUTF8String(inValue);
69 }
70
71 void StorageEvent::setNewValue(const std::string &inValue)
72 {
73     m_newValue = DPL::FromUTF8String(inValue);
74 }
75
76 void StorageEvent::setUrl(const std::string &inUrl)
77 {
78     m_url = inUrl;
79 }
80
81 void StorageEvent::setStorageArea(
82         const LocalStorage::Api::ILocalStoragePtr &inStorageArea)
83 {
84     m_storageArea = inStorageArea;
85 }
86
87 } // Api
88 } // StorageEvent
89 } // WrtDeviceApis