fix AppControl data handling
[platform/framework/native/appfw.git] / src / app / inc / FApp_AppMessageImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file         FApp_AppMessageImpl.h
20  * @brief       This is the header file of the %_AppMessageImpl class.
21  *
22  * This header file contains the declarations of the %_AppMessageImpl class.
23  */
24
25 #ifndef _FAPP_INTERNAL_APP_MESSAGE_IMPL_H_
26 #define _FAPP_INTERNAL_APP_MESSAGE_IMPL_H_
27
28 #include <bundle.h>
29
30 #include <FBaseObject.h>
31 #include <FBaseString.h>
32
33 namespace Tizen { namespace Base { namespace Collection { class IList; } } }
34
35 namespace Tizen { namespace App
36 {
37
38 /**
39  * @class        _AppMessageImpl
40  * @brief
41  * @since 2.1
42  *
43  *
44  */
45 class _OSP_EXPORT_ _AppMessageImpl
46 {
47 public:
48         _AppMessageImpl(void);
49
50         ~_AppMessageImpl(void);
51
52         _AppMessageImpl(const _AppMessageImpl& rhs);
53
54         _AppMessageImpl& operator=(const _AppMessageImpl& rhs);
55
56         const bundle* GetBundle(void) const
57         {
58                 return __pBundle;
59         }
60
61         bundle* GetBundle(void)
62         {
63                 return __pBundle;
64         }
65
66         Tizen::Base::String GetValue(const wchar_t key[]) const;
67
68         Tizen::Base::String GetValue(const Tizen::Base::String& key) const;
69
70         result AddData(const Tizen::Base::String& key, const Tizen::Base::String& value);
71
72         result AddData(const Tizen::Base::Collection::IList* pList);
73
74         result AddData(const Tizen::Base::Collection::IMap* pMap);
75
76         result AddValueArray(const Tizen::Base::String& key, const Tizen::Base::Collection::IList* pList);
77
78         result AddValueArraySingle(const Tizen::Base::String& key, const Tizen::Base::String& value);
79
80         result RemoveData(const Tizen::Base::String& key);
81
82         static result SetOperation(bundle* pBundle, const Tizen::Base::String& operation);
83
84         static result SetUri(bundle* pBundle, const Tizen::Base::String& uri);
85
86         static result SetMime(bundle* pBundle, const Tizen::Base::String& mime);
87
88         static result SetCategory(bundle* pBundle, const Tizen::Base::String& category);
89
90         static result AddData(bundle* pBundle, const Tizen::Base::String& key, const Tizen::Base::String& value);
91
92         static result AddData(bundle* pBundle, const Tizen::Base::Collection::IList* pList);
93
94         static result RemoveData(bundle* pBundle, const Tizen::Base::String& key);
95
96         static result AddStringMap(bundle* pBundle,  const Tizen::Base::Collection::IMap* pMap);
97
98         static Tizen::Base::Collection::ArrayList* GetValueArrayN(bundle* pBundle, const char* pKey);
99         static Tizen::Base::Collection::ArrayList* GetValueArrayN(bundle* pBundle, const Tizen::Base::String& key);
100
101         static result AddValueArray(bundle* pBundle, const char* pKey, const Tizen::Base::Collection::IList* pList);
102         static result AddValueArray(bundle* pBundle, const Tizen::Base::String& key, const Tizen::Base::Collection::IList* pList);
103
104 private:
105         bundle* __pBundle;
106 };
107
108 } } // Tizen::App
109
110 #endif //_FAPP_INTERNAL_APP_MESSAGE_IMPL_H_
111