Lines Matching defs:pThis
29 static const char* GetUdsStrValue(UdsObject* pThis, NdkStructId ndkStructId, const char* paramName)
31 if (IsInvalidUdsObjectPtr(pThis, ndkStructId)) {
34 auto value = pThis->GetUdsValue<std::string>(paramName);
38 static int GetUdsUint8Value(UdsObject* pThis, const char* paramName, const char* paramNameLen, unsigned char** data,
41 auto value = pThis->GetUdsValue<std::vector<uint8_t>>(paramName);
45 auto lengthPtr = pThis->GetUdsValue<int>(paramNameLen);
65 bool IsInvalidUdsObjectPtr(const UdsObject *pThis, int cid)
67 return pThis == nullptr || pThis->cid != cid || pThis->obj == nullptr;
70 bool IsInvalidUdsObjectByType(const UdsObject* pThis, const UDType& type)
74 return IsInvalidUdsObjectPtr(pThis, UDS_PLAIN_TEXT_STRUCT_ID);
76 return IsInvalidUdsObjectPtr(pThis, UDS_HYPERLINK_STRUCT_ID);
78 return IsInvalidUdsObjectPtr(pThis, UDS_HTML_STRUCT_ID);
80 return IsInvalidUdsObjectPtr(pThis, UDS_APP_ITEM_STRUCT_ID);
82 return IsInvalidUdsObjectPtr(pThis, UDS_FILE_URI_STRUCT_ID);
84 return IsInvalidUdsObjectPtr(pThis, UDS_PIXEL_MAP_STRUCT_ID);
152 void OH_UdsPlainText_Destroy(OH_UdsPlainText* pThis)
154 if (pThis != nullptr && pThis->cid == NdkStructId::UDS_PLAIN_TEXT_STRUCT_ID) {
155 delete pThis;
159 const char* OH_UdsPlainText_GetType(OH_UdsPlainText* pThis)
161 return GetUdsStrValue(pThis, NdkStructId::UDS_PLAIN_TEXT_STRUCT_ID, UNIFORM_DATA_TYPE);
164 const char* OH_UdsPlainText_GetContent(OH_UdsPlainText* pThis)
166 return GetUdsStrValue(pThis, NdkStructId::UDS_PLAIN_TEXT_STRUCT_ID, CONTENT);
169 const char* OH_UdsPlainText_GetAbstract(OH_UdsPlainText* pThis)
171 return GetUdsStrValue(pThis, NdkStructId::UDS_PLAIN_TEXT_STRUCT_ID, ABSTRACT);
174 int OH_UdsPlainText_SetContent(OH_UdsPlainText* pThis, const char* content)
176 if (content == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_PLAIN_TEXT_STRUCT_ID)) {
179 return pThis->SetUdsValue<std::string>(CONTENT, content);
182 int OH_UdsPlainText_SetAbstract(OH_UdsPlainText* pThis, const char* abstract)
184 if (abstract == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_PLAIN_TEXT_STRUCT_ID)) {
187 return pThis->SetUdsValue<std::string>(ABSTRACT, abstract);
204 void OH_UdsHyperlink_Destroy(OH_UdsHyperlink* pThis)
206 if (pThis != nullptr && pThis->cid == NdkStructId::UDS_HYPERLINK_STRUCT_ID) {
207 delete pThis;
211 const char* OH_UdsHyperlink_GetType(OH_UdsHyperlink* pThis)
213 return GetUdsStrValue(pThis, NdkStructId::UDS_HYPERLINK_STRUCT_ID, UNIFORM_DATA_TYPE);
216 const char* OH_UdsHyperlink_GetUrl(OH_UdsHyperlink* pThis)
218 return GetUdsStrValue(pThis, NdkStructId::UDS_HYPERLINK_STRUCT_ID, URL);
221 const char* OH_UdsHyperlink_GetDescription(OH_UdsHyperlink* pThis)
223 return GetUdsStrValue(pThis, NdkStructId::UDS_HYPERLINK_STRUCT_ID, DESCRIPTION);
226 int OH_UdsHyperlink_SetUrl(OH_UdsHyperlink* pThis, const char* url)
228 if (url == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_HYPERLINK_STRUCT_ID)) {
231 return pThis->SetUdsValue<std::string>(URL, url);
234 int OH_UdsHyperlink_SetDescription(OH_UdsHyperlink* pThis, const char* description)
236 if (description == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_HYPERLINK_STRUCT_ID)) {
239 return pThis->SetUdsValue<std::string>(DESCRIPTION, description);
256 void OH_UdsHtml_Destroy(OH_UdsHtml* pThis)
258 if (pThis != nullptr && pThis->cid == NdkStructId::UDS_HTML_STRUCT_ID) {
259 delete pThis;
263 const char* OH_UdsHtml_GetType(OH_UdsHtml* pThis)
265 return GetUdsStrValue(pThis, NdkStructId::UDS_HTML_STRUCT_ID, UNIFORM_DATA_TYPE);
268 const char* OH_UdsHtml_GetContent(OH_UdsHtml* pThis)
270 return GetUdsStrValue(pThis, NdkStructId::UDS_HTML_STRUCT_ID, HTML_CONTENT);
273 const char* OH_UdsHtml_GetPlainContent(OH_UdsHtml* pThis)
275 return GetUdsStrValue(pThis, NdkStructId::UDS_HTML_STRUCT_ID, PLAIN_CONTENT);
278 int OH_UdsHtml_SetContent(OH_UdsHtml* pThis, const char* content)
280 if (content == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_HTML_STRUCT_ID)) {
283 return pThis->SetUdsValue<std::string>(HTML_CONTENT, content);
286 int OH_UdsHtml_SetPlainContent(OH_UdsHtml* pThis, const char* plainContent)
288 if (plainContent == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_HTML_STRUCT_ID)) {
291 return pThis->SetUdsValue<std::string>(PLAIN_CONTENT, plainContent);
312 void OH_UdsAppItem_Destroy(OH_UdsAppItem* pThis)
314 if (pThis != nullptr && pThis->cid == NdkStructId::UDS_APP_ITEM_STRUCT_ID) {
315 delete pThis;
319 const char* OH_UdsAppItem_GetType(OH_UdsAppItem* pThis)
321 return GetUdsStrValue(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID, UNIFORM_DATA_TYPE);
324 const char* OH_UdsAppItem_GetId(OH_UdsAppItem* pThis)
326 return GetUdsStrValue(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID, APP_ID);
329 const char* OH_UdsAppItem_GetName(OH_UdsAppItem* pThis)
331 return GetUdsStrValue(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID, APP_NAME);
334 const char* OH_UdsAppItem_GetIconId(OH_UdsAppItem* pThis)
336 return GetUdsStrValue(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID, APP_ICON_ID);
339 const char* OH_UdsAppItem_GetLabelId(OH_UdsAppItem* pThis)
341 return GetUdsStrValue(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID, APP_LABEL_ID);
344 const char* OH_UdsAppItem_GetBundleName(OH_UdsAppItem* pThis)
346 return GetUdsStrValue(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID, BUNDLE_NAME);
349 const char* OH_UdsAppItem_GetAbilityName(OH_UdsAppItem* pThis)
351 return GetUdsStrValue(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID, ABILITY_NAME);
354 int OH_UdsAppItem_SetId(OH_UdsAppItem* pThis, const char* appId)
356 if (appId == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID)) {
359 return pThis->SetUdsValue<std::string>(APP_ID, appId);
362 int OH_UdsAppItem_SetName(OH_UdsAppItem* pThis, const char* appName)
364 if (appName == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID)) {
367 return pThis->SetUdsValue<std::string>(APP_NAME, appName);
370 int OH_UdsAppItem_SetIconId(OH_UdsAppItem* pThis, const char* appIconId)
372 if (appIconId == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID)) {
375 return pThis->SetUdsValue<std::string>(APP_ICON_ID, appIconId);
378 int OH_UdsAppItem_SetLabelId(OH_UdsAppItem* pThis, const char* appLabelId)
380 if (appLabelId == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID)) {
383 return pThis->SetUdsValue<std::string>(APP_LABEL_ID, appLabelId);
386 int OH_UdsAppItem_SetBundleName(OH_UdsAppItem* pThis, const char* bundleName)
388 if (bundleName == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID)) {
391 return pThis->SetUdsValue<std::string>(BUNDLE_NAME, bundleName);
394 int OH_UdsAppItem_SetAbilityName(OH_UdsAppItem* pThis, const char* abilityName)
396 if (abilityName == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_APP_ITEM_STRUCT_ID)) {
399 return pThis->SetUdsValue<std::string>(ABILITY_NAME, abilityName);
416 void OH_UdsFileUri_Destroy(OH_UdsFileUri* pThis)
418 if (pThis != nullptr && pThis->cid == NdkStructId::UDS_FILE_URI_STRUCT_ID) {
419 delete pThis;
423 const char* OH_UdsFileUri_GetType(OH_UdsFileUri* pThis)
425 return GetUdsStrValue(pThis, NdkStructId::UDS_FILE_URI_STRUCT_ID, UNIFORM_DATA_TYPE);
428 const char* OH_UdsFileUri_GetFileUri(OH_UdsFileUri* pThis)
430 return GetUdsStrValue(pThis, NdkStructId::UDS_FILE_URI_STRUCT_ID, FILE_URI_PARAM);
433 const char* OH_UdsFileUri_GetFileType(OH_UdsFileUri* pThis)
435 return GetUdsStrValue(pThis, NdkStructId::UDS_FILE_URI_STRUCT_ID, FILE_TYPE);
438 int OH_UdsFileUri_SetFileUri(OH_UdsFileUri* pThis, const char* fileUri)
440 if (fileUri == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_FILE_URI_STRUCT_ID)) {
443 return pThis->SetUdsValue<std::string>(FILE_URI_PARAM, fileUri);
446 int OH_UdsFileUri_SetFileType(OH_UdsFileUri* pThis, const char* fileType)
448 if (fileType == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_FILE_URI_STRUCT_ID)) {
451 return pThis->SetUdsValue<std::string>(FILE_TYPE, fileType);
467 void OH_UdsPixelMap_Destroy(OH_UdsPixelMap* pThis)
469 if (pThis != nullptr && pThis->cid == NdkStructId::UDS_PIXEL_MAP_STRUCT_ID) {
470 delete pThis;
474 const char* OH_UdsPixelMap_GetType(OH_UdsPixelMap* pThis)
476 return GetUdsStrValue(pThis, NdkStructId::UDS_PIXEL_MAP_STRUCT_ID, UNIFORM_DATA_TYPE);
479 void OH_UdsPixelMap_GetPixelMap(OH_UdsPixelMap* pThis, OH_PixelmapNative* pixelmapNative)
481 if (IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_PIXEL_MAP_STRUCT_ID)) {
484 auto pixelMap = pThis->GetUdsValue<std::shared_ptr<OHOS::Media::PixelMap>>(PIXEL_MAP);
492 int OH_UdsPixelMap_SetPixelMap(OH_UdsPixelMap* pThis, OH_PixelmapNative* pixelmapNative)
494 if (pixelmapNative == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_PIXEL_MAP_STRUCT_ID)) {
497 return pThis->SetUdsValue<std::shared_ptr<OHOS::Media::PixelMap>>(PIXEL_MAP, pixelmapNative->GetInnerPixelmap());
569 void OH_UdsContentForm_Destroy(OH_UdsContentForm* pThis)
571 if (pThis != nullptr && pThis->cid == NdkStructId::UDS_CONTENT_FORM_STRUCT_ID) {
572 delete pThis;
576 const char* OH_UdsContentForm_GetType(OH_UdsContentForm* pThis)
578 return GetUdsStrValue(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID, UNIFORM_DATA_TYPE);
581 int OH_UdsContentForm_GetThumbData(OH_UdsContentForm* pThis, unsigned char** thumbData, unsigned int* len)
583 if (IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID)) {
586 return GetUdsUint8Value(pThis, THUMB_DATA, THUMB_DATA_LENGTH, thumbData, len);
589 const char* OH_UdsContentForm_GetDescription(OH_UdsContentForm* pThis)
591 return GetUdsStrValue(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID, DESCRIPTION);
594 const char* OH_UdsContentForm_GetTitle(OH_UdsContentForm* pThis)
596 return GetUdsStrValue(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID, TITLE);
599 int OH_UdsContentForm_GetAppIcon(OH_UdsContentForm* pThis, unsigned char** appIcon, unsigned int* len)
601 if (IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID)) {
604 return GetUdsUint8Value(pThis, APP_ICON, APP_ICON_LENGTH, appIcon, len);
607 const char* OH_UdsContentForm_GetAppName(OH_UdsContentForm* pThis)
609 return GetUdsStrValue(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID, APP_NAME);
612 const char* OH_UdsContentForm_GetLinkUri(OH_UdsContentForm* pThis)
614 return GetUdsStrValue(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID, LINK_URL);
617 int OH_UdsContentForm_SetThumbData(OH_UdsContentForm* pThis, const unsigned char* thumbData, unsigned int len)
619 if (thumbData == nullptr || len == 0 || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID) ||
625 int ret = pThis->SetUdsValue<std::vector<uint8_t>>(THUMB_DATA, data);
630 ret = pThis->SetUdsValue<int>(THUMB_DATA_LENGTH, static_cast<int>(len));
634 int OH_UdsContentForm_SetDescription(OH_UdsContentForm* pThis, const char* description)
636 if (description == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID)) {
639 return pThis->SetUdsValue<std::string>(DESCRIPTION, description);
642 int OH_UdsContentForm_SetTitle(OH_UdsContentForm* pThis, const char* title)
644 if (title == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID)) {
647 return pThis->SetUdsValue<std::string>(TITLE, title);
650 int OH_UdsContentForm_SetAppIcon(OH_UdsContentForm* pThis, const unsigned char* appIcon, unsigned int len)
652 if (appIcon == nullptr || len == 0 || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID) ||
658 int ret = pThis->SetUdsValue<std::vector<uint8_t>>(APP_ICON, data);
663 ret = pThis->SetUdsValue<int>(APP_ICON_LENGTH, static_cast<int>(len));
667 int OH_UdsContentForm_SetAppName(OH_UdsContentForm* pThis, const char* appName)
669 if (appName == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID)) {
672 return pThis->SetUdsValue<std::string>(APP_NAME, appName);
675 int OH_UdsContentForm_SetLinkUri(OH_UdsContentForm* pThis, const char* linkUri)
677 if (linkUri == nullptr || IsInvalidUdsObjectPtr(pThis, NdkStructId::UDS_CONTENT_FORM_STRUCT_ID)) {
680 return pThis->SetUdsValue<std::string>(LINK_URL, linkUri);