2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 //==========================================================================
12 * @file CicoNotificationApp.cpp
14 * @brief This file is implemetation of CicoNotificationApp class
16 //==========================================================================
20 #include "CicoNotificationApp.h"
22 //--------------------------------------------------------------------------
24 * @brief default constructor
26 //--------------------------------------------------------------------------
27 CicoNotificationApp::CicoNotificationApp()
32 //--------------------------------------------------------------------------
36 //--------------------------------------------------------------------------
37 CicoNotificationApp::~CicoNotificationApp()
41 //--------------------------------------------------------------------------
43 * @brief add notification
45 * @param [in] ico notification handle
48 * @retval true success
49 * @retval false notification handle is null or
50 * notification_insert() failed
52 //--------------------------------------------------------------------------
54 CicoNotificationApp::Add(CicoNotification noti)
56 if (true == noti.Empty()) {
57 ICO_WRN("notification handle is null.");
62 notification_error_e err = NOTIFICATION_ERROR_NONE;
63 err = notification_insert(noti.GetNotiHandle(), &retid);
64 if (NOTIFICATION_ERROR_NONE != err) {
65 ICO_ERR("notification_insert() failed(%d).", err);
72 //--------------------------------------------------------------------------
74 * @brief update notification
76 * @param [in] ico notification handle
79 * @retval true success
80 * @retval false notification handle is null or
81 * notification is not add yet or
82 * notification_update() failed
84 //--------------------------------------------------------------------------
86 CicoNotificationApp::Update(CicoNotification noti)
88 if ((true == noti.Empty()) || (0 == m_privateid)) {
89 ICO_WRN("notification handle is null. or not add notification.");
93 notification_error_e err = NOTIFICATION_ERROR_NONE;
94 err = notification_update(noti.GetNotiHandle());
95 if (NOTIFICATION_ERROR_NONE != err) {
96 ICO_ERR("notification_update() failed(%d).", err);
103 //--------------------------------------------------------------------------
105 * @brief delete notification
107 * @param [in] ico notification handle
110 * @retval true success
111 * @retval false notification handle is null or
112 * notification is not add yet or
113 * notification_update() failed
115 //--------------------------------------------------------------------------
117 CicoNotificationApp::Delete(CicoNotification noti)
119 if ((true == noti.Empty()) || (0 == m_privateid)) {
120 ICO_WRN("notification handle is null. or not add notification.");
124 const char *pkgname = noti.GetPkgname();
125 if (NULL == pkgname) {
129 notification_error_e err = notification_delete_by_priv_id(pkgname,
132 if (NOTIFICATION_ERROR_NONE != err) {
133 ICO_ERR("notification_delete_by_priv_id() failed(%d).", err);
139 // vim:set expandtab ts=4 sw=4: