2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FIo_IpcCommonParamTraits.h
19 * @brief This is the header file for common param traits.
22 #ifndef _FAPP_INTERNAL_APPMANAGER_EVENT_ARG_PARAM_TRAITS_H_
23 #define _FAPP_INTERNAL_APPMANAGER_EVENT_ARG_PARAM_TRAITS_H_
25 #include "FBaseString.h"
26 #include "FBaseColIList.h"
27 #include "FBaseColArrayList.h"
28 #include "FIo_IpcCommonDataTypes.h"
30 #include "base/tuple.h"
31 #include "ipc/ipc_param_traits.h"
33 #include "FApp_AppManagerEventArg.h"
36 //namespace Tizen { namespace App { class _AppManagerEventArg; } }
41 struct ParamTraits<Tizen::App::_AppManagerEventArg>
43 typedef Tizen::App::_AppManagerEventArg param_type;
45 static void Write(Message* m, const param_type& p)
47 WriteParam(m, p.GetAppId());
48 m->WriteInt(p.GetAppType());
49 m->WriteInt(p.GetEventType());
52 static bool Read(const Message* m, void** iter, param_type* r)
54 Tizen::App::AppId appId;
55 int appType = Tizen::App::_APP_TYPE_UI_APP;
56 int eventType = Tizen::App::_AppManagerEvent::_APP_MANAGER_EVENT_INVALID;
58 if (!ReadParam(m, iter, &appId))
62 m->ReadInt(iter, &appType);
63 m->ReadInt(iter, &eventType);
65 Tizen::App::_AppManagerEventArg arg(appId, static_cast<Tizen::App::_AppType>(appType), static_cast<Tizen::App::_AppManagerEvent::_Type>(eventType));
71 static void Log(const param_type& p, std::string* l)
77 #endif //_FAPP_INTERNAL_APPMANAGER_EVENT_ARG_PARAM_TRAITS_H_