2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FApp_NotificationManagerEventParamTraits.h
20 * @brief This is the header file for NotificationManagerEvent param traits.
23 #ifndef _FAPP_INTERNAL_NOTIFICATIONMANAGER_EVENT_ARG_PARAM_TRAITS_H_
24 #define _FAPP_INTERNAL_NOTIFICATIONMANAGER_EVENT_ARG_PARAM_TRAITS_H_
26 #include "FBaseString.h"
27 #include "FBaseColIList.h"
28 #include "FBaseColArrayList.h"
29 #include "FIo_IpcCommonDataTypes.h"
31 #include "base/tuple.h"
32 #include "ipc/ipc_param_traits.h"
34 #include "FAppNotificationMessage.h"
40 struct ParamTraits<Tizen::App::NotificationMessage>
42 typedef Tizen::App::NotificationMessage param_type;
44 static void Write(Message* m, const param_type& p)
46 WriteParam(m, p.GetAlertText());
47 WriteParam(m, p.GetAppMessage());
48 WriteParam(m, p.GetTitleText());
49 WriteParam(m, p.GetIconFilePath());
50 WriteParam(m, p.GetSoundFilePath());
52 m->WriteInt(p.GetBadgeNumber());
53 m->WriteInt(p.GetBadgeOffset());
54 m->WriteInt((int)p.GetOngoingActivityType());
55 m->WriteInt(p.GetOngoingActivityProgressValue());
58 static bool Read(const Message* m, void** iter, param_type* r)
60 Tizen::Base::String alertText;
61 Tizen::Base::String appMessage;
62 Tizen::Base::String titleText;
63 Tizen::Base::String iconFilePath;
64 Tizen::Base::String soundFilePath;
68 int progressValue = -1;
69 int activityType = Tizen::App::ONGOING_ACTIVITY_TYPE_TEXT;
71 if (!ReadParam(m, iter, &alertText))
75 if (!ReadParam(m, iter, &appMessage))
79 if (!ReadParam(m, iter, &titleText))
83 if (!ReadParam(m, iter, &iconFilePath))
87 if (!ReadParam(m, iter, &soundFilePath))
91 m->ReadInt(iter, &badgeNo);
92 m->ReadInt(iter, &badgeOffset);
93 m->ReadInt(iter, &progressValue);
94 m->ReadInt(iter, &activityType);
96 Tizen::App::NotificationMessage notimessage;
97 notimessage.SetAlertText(alertText);
98 notimessage.SetAppMessage(appMessage);
99 notimessage.SetTitleText(titleText);
100 notimessage.SetIconFilePath(iconFilePath);
101 notimessage.SetSoundFilePath(soundFilePath);
103 notimessage.SetBadgeNumber(badgeNo);
104 notimessage.SetBadgeOffset(badgeOffset);
105 notimessage.SetOngoingActivityProgressValue(progressValue);
106 notimessage.SetOngoingActivityType((Tizen::App::OngoingActivityType)activityType);
112 static void Log(const param_type& p, std::string* l)
119 #endif //_FAPP_INTERNAL_NOTIFICATIONMANAGER_EVENT_ARG_PARAM_TRAITS_H_