/base/notification/distributed_notification_service/frameworks/ans/src/ |
H A D | notification_capsule.cpp | 98 NotificationCapsule *capsule = new (std::nothrow) NotificationCapsule(); in FromJson() local 99 if (capsule == nullptr) { in FromJson() 100 ANS_LOGE("Failed to create capsule instance"); in FromJson() 106 capsule->title_ = jsonObject.at("title").get<std::string>(); in FromJson() 110 capsule->backgroundColor_ = jsonObject.at("backgroundColor").get<std::string>(); in FromJson() 114 capsule->content_ = jsonObject.at("content").get<std::string>(); in FromJson() 119 capsule->icon_ = AnsImageUtil::UnPackImage(pmStr); in FromJson() 122 return capsule; in FromJson() 178 NotificationCapsule *capsule = new (std::nothrow) NotificationCapsule(); in Unmarshalling() local 180 if (capsule in Unmarshalling() [all...] |
H A D | notification_local_live_view_content.cpp | 48 void NotificationLocalLiveViewContent::SetCapsule(NotificationCapsule capsule) in SetCapsule() argument 50 capsule_ = capsule; in SetCapsule() 107 ", capsule = " + capsule_.Dump() + in Dump() 123 ANS_LOGE("Cannot convert capsule to JSON"); in ToJson() 146 jsonObject["capsule"] = capsuleObj; in ToJson() 175 if (jsonObject.find("capsule") != jsonEnd) { in FromJson() 176 auto capsuleObj = jsonObject.at("capsule"); in FromJson() 239 ANS_LOGE("Failed to write capsule"); in Marshalling() 291 ANS_LOGE("Failed to read capsule"); in ReadFromParcel()
|
/base/notification/distributed_notification_service/frameworks/ans/test/unittest/ |
H A D | notification_local_live_view_content_test.cpp | 69 NotificationCapsule capsule; in HWTEST_F() local 70 capsule.SetTitle("testTitle"); in HWTEST_F() 71 liveViewContent->SetCapsule(capsule); in HWTEST_F() 99 nlohmann::json jsonObject = nlohmann::json{"typeCode", "capsule", "button", "progress", "time"}; in HWTEST_F() 115 {"additionalText", ""}, {"button", ""}, {"capsule", ""}, {"flags", ""}, in HWTEST_F() 182 NotificationCapsule capsule; in HWTEST_F() local 183 capsule.SetTitle("testTitle"); in HWTEST_F() 184 liveViewContent->SetCapsule(capsule); in HWTEST_F() 211 NotificationCapsule capsule; in HWTEST_F() local 212 capsule in HWTEST_F() 245 NotificationCapsule capsule; HWTEST_F() local [all...] |
H A D | notification_capsule_test.cpp | 150 auto capsule = std::make_shared<NotificationCapsule>(); in HWTEST_F() local 151 capsule->SetIcon(pixmap); in HWTEST_F() 152 EXPECT_NE(capsule->GetIcon(), nullptr); in HWTEST_F()
|
/base/notification/distributed_notification_service/frameworks/js/napi/src/ |
H A D | common_convert_liveview.cpp | 59 // capsule: NotificationCapsule in SetNotificationLocalLiveViewContent() 61 napi_value capsule = nullptr; in SetNotificationLocalLiveViewContent() local 62 napi_create_object(env, &capsule); in SetNotificationLocalLiveViewContent() 63 if (!SetCapsule(env, localLiveViewContent->GetCapsule(), capsule)) { in SetNotificationLocalLiveViewContent() 67 napi_set_named_property(env, result, "capsule", capsule); in SetNotificationLocalLiveViewContent() 108 napi_value Common::SetCapsule(const napi_env &env, const NotificationCapsule &capsule, napi_value &result) in SetCapsule() argument 114 napi_create_string_utf8(env, capsule.GetTitle().c_str(), NAPI_AUTO_LENGTH, &value); in SetCapsule() 118 napi_create_string_utf8(env, capsule.GetBackgroundColor().c_str(), NAPI_AUTO_LENGTH, &value); in SetCapsule() 122 napi_create_string_utf8(env, capsule in SetCapsule() 446 NotificationCapsule capsule; GetNotificationLocalLiveViewCapsule() local [all...] |
/base/notification/distributed_notification_service/interfaces/inner_api/ |
H A D | notification_local_live_view_content.h | 59 * @brief Sets the capsule to be included in a local live view notification. 61 * @param capsule Indicates the type to be included. 63 void SetCapsule(NotificationCapsule capsule); 66 * @brief Get the capsule of a local live view notification.
|
/base/notification/distributed_notification_service/frameworks/cj/ffi/src/ |
H A D | notification_utils.cpp | 487 NotificationCapsule capsule; in GetNotificationLocalLiveViewCapsule() local 488 if (strcpy_s(str, STR_MAX_SIZE, contentResult->capsule.title) != EOK) { in GetNotificationLocalLiveViewCapsule() 489 LOGE("copy capsule.title failed"); in GetNotificationLocalLiveViewCapsule() 492 capsule.SetTitle(std::string(str)); in GetNotificationLocalLiveViewCapsule() 494 if (strcpy_s(str, STR_MAX_SIZE, contentResult->capsule.backgroundColor) != EOK) { in GetNotificationLocalLiveViewCapsule() 495 LOGE("copy capsule.backgroundColor failed"); in GetNotificationLocalLiveViewCapsule() 498 capsule.SetBackgroundColor(std::string(str)); in GetNotificationLocalLiveViewCapsule() 500 if (contentResult->capsule.icon != -1) { in GetNotificationLocalLiveViewCapsule() 501 auto pixelMap = FFIData::GetData<Media::PixelMapImpl>(contentResult->capsule.icon); in GetNotificationLocalLiveViewCapsule() 506 capsule in GetNotificationLocalLiveViewCapsule() 1298 SetCapsule(const NotificationCapsule &capsule, CNotificationCapsule &cCapsule) SetCapsule() argument 1362 CNotificationCapsule capsule = { SetNotificationLocalLiveViewContentDetailed() local [all...] |
/base/location/frameworks/js/napi/notification/src/ |
H A D | notification_napi_convert_liveview.cpp | 81 NAPI_CALL(env, napi_has_named_property(env, contentResult, "capsule", &hasProperty)); in GetNotificationLocalLiveViewCapsule() 83 napi_get_named_property(env, contentResult, "capsule", &capsuleResult); in GetNotificationLocalLiveViewCapsule() 90 NotificationCapsule capsule; in GetNotificationLocalLiveViewCapsule() local 102 capsule.SetTitle(str); in GetNotificationLocalLiveViewCapsule() 103 LBSLOGD(NAPI_UTILS, "capsule title = %{public}s", str); in GetNotificationLocalLiveViewCapsule() 115 capsule.SetBackgroundColor(str); in GetNotificationLocalLiveViewCapsule() 116 LBSLOGD(NAPI_UTILS, "capsule backgroundColor = %{public}s", str); in GetNotificationLocalLiveViewCapsule() 131 capsule.SetIcon(pixelMap); in GetNotificationLocalLiveViewCapsule() 132 LBSLOGD(NAPI_UTILS, "capsule icon = %{public}d", pixelMap->GetWidth()); in GetNotificationLocalLiveViewCapsule() 135 content->SetCapsule(capsule); in GetNotificationLocalLiveViewCapsule() [all...] |
/base/notification/distributed_notification_service/frameworks/cj/ffi/include/ |
H A D | notification_utils.h | 111 CNotificationCapsule capsule; member 315 bool SetCapsule(const OHOS::Notification::NotificationCapsule &capsule, CNotificationCapsule &cCapsule);
|
/base/notification/distributed_notification_service/frameworks/js/napi/include/ |
H A D | common.h | 443 * @param capsule Indicates a NotificationCapsule object to be converted 447 static napi_value SetCapsule(const napi_env &env, const NotificationCapsule &capsule, napi_value &result); 453 * @param capsule Indicates a NotificationLocalLiveViewButton object to be converted 463 * @param capsule Indicates a NotificationProgress object to be converted 1285 * @brief Gets a capsule of NotificationLocalLiveViewContent object from specified js object 1289 * @param content Indicates a capsule object from specified js object
|