1686862fbSopenharmony_ci/* 2686862fbSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 3686862fbSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4686862fbSopenharmony_ci * you may not use this file except in compliance with the License. 5686862fbSopenharmony_ci * You may obtain a copy of the License at 6686862fbSopenharmony_ci * 7686862fbSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8686862fbSopenharmony_ci * 9686862fbSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10686862fbSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11686862fbSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12686862fbSopenharmony_ci * See the License for the specific language governing permissions and 13686862fbSopenharmony_ci * limitations under the License. 14686862fbSopenharmony_ci */ 15686862fbSopenharmony_ci 16686862fbSopenharmony_ci#ifndef OHOS_DISTRIBUTEDWANT_WANT_H 17686862fbSopenharmony_ci#define OHOS_DISTRIBUTEDWANT_WANT_H 18686862fbSopenharmony_ci 19686862fbSopenharmony_ci#include <algorithm> 20686862fbSopenharmony_ci#include <string> 21686862fbSopenharmony_ci#include <vector> 22686862fbSopenharmony_ci#include "distributedWant/distributed_operation.h" 23686862fbSopenharmony_ci#include "distributedWant/distributed_want_params.h" 24686862fbSopenharmony_ci#include "element_name.h" 25686862fbSopenharmony_ci#include "nlohmann/json.hpp" 26686862fbSopenharmony_ci#include "parcel.h" 27686862fbSopenharmony_ci#include "uri.h" 28686862fbSopenharmony_ci#include "want.h" 29686862fbSopenharmony_ci 30686862fbSopenharmony_ciusing DistributedOperation = OHOS::DistributedSchedule::DistributedOperation; 31686862fbSopenharmony_ci 32686862fbSopenharmony_cinamespace OHOS { 33686862fbSopenharmony_cinamespace DistributedSchedule { 34686862fbSopenharmony_ciclass DistributedWant final : public Parcelable { 35686862fbSopenharmony_cipublic: 36686862fbSopenharmony_ci /** 37686862fbSopenharmony_ci * Indicates the grant to perform read operations on the URI. 38686862fbSopenharmony_ci */ 39686862fbSopenharmony_ci static constexpr unsigned int FLAG_AUTH_READ_URI_PERMISSION = 0x00000001; 40686862fbSopenharmony_ci /** 41686862fbSopenharmony_ci * Indicates the grant to perform write operations on the URI. 42686862fbSopenharmony_ci */ 43686862fbSopenharmony_ci static constexpr unsigned int FLAG_AUTH_WRITE_URI_PERMISSION = 0x00000002; 44686862fbSopenharmony_ci /** 45686862fbSopenharmony_ci * Returns the result to the source ability. 46686862fbSopenharmony_ci */ 47686862fbSopenharmony_ci static constexpr unsigned int FLAG_ABILITY_FORWARD_RESULT = 0x00000004; 48686862fbSopenharmony_ci /** 49686862fbSopenharmony_ci * Determines whether an ability on the local device can be migrated to a remote device. 50686862fbSopenharmony_ci */ 51686862fbSopenharmony_ci static constexpr unsigned int FLAG_ABILITY_CONTINUATION = 0x00000008; 52686862fbSopenharmony_ci /** 53686862fbSopenharmony_ci * Specifies whether a component does not belong to OHOS. 54686862fbSopenharmony_ci */ 55686862fbSopenharmony_ci static constexpr unsigned int FLAG_NOT_OHOS_COMPONENT = 0x00000010; 56686862fbSopenharmony_ci /** 57686862fbSopenharmony_ci * Specifies whether an ability is started. 58686862fbSopenharmony_ci */ 59686862fbSopenharmony_ci static constexpr unsigned int FLAG_ABILITY_FORM_ENABLED = 0x00000020; 60686862fbSopenharmony_ci /** 61686862fbSopenharmony_ci * Indicates the grant for possible persisting on the URI. 62686862fbSopenharmony_ci */ 63686862fbSopenharmony_ci static constexpr unsigned int FLAG_AUTH_PERSISTABLE_URI_PERMISSION = 0x00000040; 64686862fbSopenharmony_ci /** 65686862fbSopenharmony_ci * Returns the result to the source ability slice. 66686862fbSopenharmony_ci */ 67686862fbSopenharmony_ci static constexpr unsigned int FLAG_AUTH_PREFIX_URI_PERMISSION = 0x00000080; 68686862fbSopenharmony_ci /** 69686862fbSopenharmony_ci * Supports multi-device startup in the distributed scheduling system. 70686862fbSopenharmony_ci */ 71686862fbSopenharmony_ci static constexpr unsigned int FLAG_ABILITYSLICE_MULTI_DEVICE = 0x00000100; 72686862fbSopenharmony_ci /** 73686862fbSopenharmony_ci * Indicates that an ability using the Service template is started regardless of whether the host application has 74686862fbSopenharmony_ci * been started. 75686862fbSopenharmony_ci */ 76686862fbSopenharmony_ci static constexpr unsigned int FLAG_START_FOREGROUND_ABILITY = 0x00000200; 77686862fbSopenharmony_ci 78686862fbSopenharmony_ci /** 79686862fbSopenharmony_ci * Indicates the continuation is reversible. 80686862fbSopenharmony_ci */ 81686862fbSopenharmony_ci static constexpr unsigned int FLAG_ABILITY_CONTINUATION_REVERSIBLE = 0x00000400; 82686862fbSopenharmony_ci 83686862fbSopenharmony_ci /** 84686862fbSopenharmony_ci * Install the specified ability if it's not installed. 85686862fbSopenharmony_ci */ 86686862fbSopenharmony_ci static constexpr unsigned int FLAG_INSTALL_ON_DEMAND = 0x00000800; 87686862fbSopenharmony_ci /** 88686862fbSopenharmony_ci * Returns the result to the source ability slice. 89686862fbSopenharmony_ci */ 90686862fbSopenharmony_ci static constexpr unsigned int FLAG_ABILITYSLICE_FORWARD_RESULT = 0x04000000; 91686862fbSopenharmony_ci /** 92686862fbSopenharmony_ci * Install the specifiedi ability with background mode if it's not installed. 93686862fbSopenharmony_ci */ 94686862fbSopenharmony_ci static constexpr unsigned int FLAG_INSTALL_WITH_BACKGROUND_MODE = 0x80000000; 95686862fbSopenharmony_ci 96686862fbSopenharmony_ci /** 97686862fbSopenharmony_ci * @description: Default construcotr of DistributedWant class, which is used to initialzie flags and URI. 98686862fbSopenharmony_ci * @param None 99686862fbSopenharmony_ci * @return None 100686862fbSopenharmony_ci */ 101686862fbSopenharmony_ci DistributedWant(); 102686862fbSopenharmony_ci 103686862fbSopenharmony_ci /** 104686862fbSopenharmony_ci * @description: Default deconstructor of DistributedWant class 105686862fbSopenharmony_ci * @param None 106686862fbSopenharmony_ci * @return None 107686862fbSopenharmony_ci */ 108686862fbSopenharmony_ci ~DistributedWant(); 109686862fbSopenharmony_ci 110686862fbSopenharmony_ci /** 111686862fbSopenharmony_ci * @description: Copy construcotr of DistributedWant class, which is used to initialzie flags, URI, etc. 112686862fbSopenharmony_ci * @param want the source instance of DistributedWant. 113686862fbSopenharmony_ci * @return None 114686862fbSopenharmony_ci */ 115686862fbSopenharmony_ci DistributedWant(const DistributedWant& want); 116686862fbSopenharmony_ci DistributedWant& operator=(const DistributedWant&); 117686862fbSopenharmony_ci DistributedWant(const AAFwk::Want& want); 118686862fbSopenharmony_ci 119686862fbSopenharmony_ci /** 120686862fbSopenharmony_ci * @description: Sets a flag in a DistributedWant. 121686862fbSopenharmony_ci * @param flags Indicates the flag to set. 122686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the flag. 123686862fbSopenharmony_ci */ 124686862fbSopenharmony_ci DistributedWant& SetFlags(unsigned int flags); 125686862fbSopenharmony_ci 126686862fbSopenharmony_ci /** 127686862fbSopenharmony_ci * @description: Obtains the description of flags in a DistributedWant. 128686862fbSopenharmony_ci * @return Returns the flag description in the DistributedWant. 129686862fbSopenharmony_ci */ 130686862fbSopenharmony_ci unsigned int GetFlags() const; 131686862fbSopenharmony_ci 132686862fbSopenharmony_ci /** 133686862fbSopenharmony_ci * @description: Adds a flag to a DistributedWant. 134686862fbSopenharmony_ci * @param flags Indicates the flag to add. 135686862fbSopenharmony_ci * @return Returns the DistributedWant object with the added flag. 136686862fbSopenharmony_ci */ 137686862fbSopenharmony_ci DistributedWant& AddFlags(unsigned int flags); 138686862fbSopenharmony_ci 139686862fbSopenharmony_ci /** 140686862fbSopenharmony_ci * @description: Removes the description of a flag from a DistributedWant. 141686862fbSopenharmony_ci * @param flags Indicates the flag to remove. 142686862fbSopenharmony_ci * @return Removes the description of a flag from a DistributedWant. 143686862fbSopenharmony_ci */ 144686862fbSopenharmony_ci void RemoveFlags(unsigned int flag); 145686862fbSopenharmony_ci 146686862fbSopenharmony_ci /** 147686862fbSopenharmony_ci * @description: Sets the bundleName and abilityName attributes for this DistributedWant object. 148686862fbSopenharmony_ci * @param bundleName Indicates the bundleName to set for the operation attribute in the DistributedWant. 149686862fbSopenharmony_ci * @param abilityName Indicates the abilityName to set for the operation attribute in the DistributedWant. 150686862fbSopenharmony_ci * @return Returns this DistributedWant object that contains the specified bundleName and abilityName attributes. 151686862fbSopenharmony_ci */ 152686862fbSopenharmony_ci DistributedWant& SetElementName(const std::string& bundleName, const std::string& abilityName); 153686862fbSopenharmony_ci 154686862fbSopenharmony_ci /** 155686862fbSopenharmony_ci * @description: Sets the bundleName and abilityName attributes for this DistributedWant object. 156686862fbSopenharmony_ci * @param deviceId Indicates the deviceId to set for the operation attribute in the DistributedWant. 157686862fbSopenharmony_ci * @param bundleName Indicates the bundleName to set for the operation attribute in the DistributedWant. 158686862fbSopenharmony_ci * @param abilityName Indicates the abilityName to set for the operation attribute in the DistributedWant. 159686862fbSopenharmony_ci * @return Returns this DistributedWant object that contains the specified bundleName and abilityName attributes. 160686862fbSopenharmony_ci */ 161686862fbSopenharmony_ci DistributedWant& SetElementName( 162686862fbSopenharmony_ci const std::string& deviceId, const std::string& bundleName, const std::string& abilityName); 163686862fbSopenharmony_ci 164686862fbSopenharmony_ci /** 165686862fbSopenharmony_ci * @description: Sets an ElementName object in a DistributedWant. 166686862fbSopenharmony_ci * @param element Indicates the ElementName description. 167686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the ElementName 168686862fbSopenharmony_ci */ 169686862fbSopenharmony_ci DistributedWant& SetElement(const OHOS::AppExecFwk::ElementName& element); 170686862fbSopenharmony_ci 171686862fbSopenharmony_ci /** 172686862fbSopenharmony_ci * @description: Obtains the description of the ElementName object in a DistributedWant. 173686862fbSopenharmony_ci * @return Returns the ElementName description in the DistributedWant. 174686862fbSopenharmony_ci */ 175686862fbSopenharmony_ci OHOS::AppExecFwk::ElementName GetElement() const; 176686862fbSopenharmony_ci 177686862fbSopenharmony_ci /** 178686862fbSopenharmony_ci * @description: Obtains the description of a URI in a DistributedWant. 179686862fbSopenharmony_ci * @return Returns the URI description in the DistributedWant. 180686862fbSopenharmony_ci */ 181686862fbSopenharmony_ci OHOS::Uri GetUri() const; 182686862fbSopenharmony_ci 183686862fbSopenharmony_ci /** 184686862fbSopenharmony_ci * @description: Obtains the string representation of the URI in this DistributedWant. 185686862fbSopenharmony_ci * @return Returns the string of the URI. 186686862fbSopenharmony_ci */ 187686862fbSopenharmony_ci std::string GetUriString() const; 188686862fbSopenharmony_ci 189686862fbSopenharmony_ci /** 190686862fbSopenharmony_ci * @description: Sets the description of a URI in a DistributedWant. 191686862fbSopenharmony_ci * @param uri Indicates the URI description. 192686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the URI. 193686862fbSopenharmony_ci */ 194686862fbSopenharmony_ci DistributedWant& SetUri(const std::string& uri); 195686862fbSopenharmony_ci 196686862fbSopenharmony_ci /** 197686862fbSopenharmony_ci * @description: Sets the description of a URI in a DistributedWant. 198686862fbSopenharmony_ci * @param uri Indicates the URI description. 199686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the URI. 200686862fbSopenharmony_ci */ 201686862fbSopenharmony_ci DistributedWant& SetUri(const OHOS::Uri& uri); 202686862fbSopenharmony_ci 203686862fbSopenharmony_ci /** 204686862fbSopenharmony_ci * @description: Sets the description of a URI and a type in this DistributedWant. 205686862fbSopenharmony_ci * @param uri Indicates the URI description. 206686862fbSopenharmony_ci * @param type Indicates the type description. 207686862fbSopenharmony_ci * @return Returns the DistributedWant object containing the URI and the type by setting. 208686862fbSopenharmony_ci */ 209686862fbSopenharmony_ci DistributedWant& SetUriAndType(const OHOS::Uri& uri, const std::string& type); 210686862fbSopenharmony_ci 211686862fbSopenharmony_ci /** 212686862fbSopenharmony_ci * @description: Formats a specified URI. 213686862fbSopenharmony_ci * This method uses the Uri.getLowerCaseScheme() method to format a URI and then saves 214686862fbSopenharmony_ci * the formatted URI to this DistributedWant object. 215686862fbSopenharmony_ci * @param uri Indicates the string of URI to format. 216686862fbSopenharmony_ci * @return Returns this DistributedWant object that contains the formatted uri attribute. 217686862fbSopenharmony_ci */ 218686862fbSopenharmony_ci DistributedWant& FormatUri(const std::string& uri); 219686862fbSopenharmony_ci 220686862fbSopenharmony_ci /** 221686862fbSopenharmony_ci * @description: Formats a specified URI. 222686862fbSopenharmony_ci * This method uses the Uri.getLowerCaseScheme() method to format a URI and then saves 223686862fbSopenharmony_ci * the formatted URI to this DistributedWant object. 224686862fbSopenharmony_ci * @param uri Indicates the URI to format. 225686862fbSopenharmony_ci * @return Returns this DistributedWant object that contains the formatted URI attribute. 226686862fbSopenharmony_ci */ 227686862fbSopenharmony_ci DistributedWant& FormatUri(const OHOS::Uri& uri); 228686862fbSopenharmony_ci 229686862fbSopenharmony_ci /** 230686862fbSopenharmony_ci * @description: Obtains the description of an action in a DistributedWant. 231686862fbSopenharmony_ci * @return Returns a DistributedWant object that contains the action description. 232686862fbSopenharmony_ci */ 233686862fbSopenharmony_ci std::string GetAction() const; 234686862fbSopenharmony_ci 235686862fbSopenharmony_ci /** 236686862fbSopenharmony_ci * @description: Sets the description of an action in a DistributedWant. 237686862fbSopenharmony_ci * @param action Indicates the action description to set. 238686862fbSopenharmony_ci * @return Returns a DistributedWant object that contains the action description. 239686862fbSopenharmony_ci */ 240686862fbSopenharmony_ci DistributedWant& SetAction(const std::string& action); 241686862fbSopenharmony_ci 242686862fbSopenharmony_ci /** 243686862fbSopenharmony_ci * @description: Obtains the name of the specified bundle in a DistributedWant. 244686862fbSopenharmony_ci * @return Returns the specified bundle name in the DistributedWant. 245686862fbSopenharmony_ci */ 246686862fbSopenharmony_ci std::string GetBundle() const; 247686862fbSopenharmony_ci 248686862fbSopenharmony_ci /** 249686862fbSopenharmony_ci * @description: Sets a bundle name in this DistributedWant. 250686862fbSopenharmony_ci * If a bundle name is specified in a DistributedWant, the DistributedWant will match only 251686862fbSopenharmony_ci * the abilities in the specified bundle. You cannot use this method and 252686862fbSopenharmony_ci * setPicker(ohos.aafwk.content.DistributedWant) on the same DistributedWant. 253686862fbSopenharmony_ci * @param bundleName Indicates the bundle name to set. 254686862fbSopenharmony_ci * @return Returns a DistributedWant object containing the specified bundle name. 255686862fbSopenharmony_ci */ 256686862fbSopenharmony_ci DistributedWant& SetBundle(const std::string& bundleName); 257686862fbSopenharmony_ci 258686862fbSopenharmony_ci /** 259686862fbSopenharmony_ci * @description: Obtains the description of all entities in a DistributedWant 260686862fbSopenharmony_ci * @return Returns a set of entities 261686862fbSopenharmony_ci */ 262686862fbSopenharmony_ci const std::vector<std::string>& GetEntities() const; 263686862fbSopenharmony_ci 264686862fbSopenharmony_ci /** 265686862fbSopenharmony_ci * @description: Adds the description of an entity to a DistributedWant 266686862fbSopenharmony_ci * @param entity Indicates the entity description to add 267686862fbSopenharmony_ci * @return {DistributedWant} Returns this DistributedWant object containing the entity. 268686862fbSopenharmony_ci */ 269686862fbSopenharmony_ci DistributedWant& AddEntity(const std::string& entity); 270686862fbSopenharmony_ci 271686862fbSopenharmony_ci /** 272686862fbSopenharmony_ci * @description: Removes the description of an entity from a DistributedWant 273686862fbSopenharmony_ci * @param entity Indicates the entity description to remove. 274686862fbSopenharmony_ci * @return void 275686862fbSopenharmony_ci */ 276686862fbSopenharmony_ci void RemoveEntity(const std::string& entity); 277686862fbSopenharmony_ci 278686862fbSopenharmony_ci /** 279686862fbSopenharmony_ci * @description: Checks whether a DistributedWant contains the given entity 280686862fbSopenharmony_ci * @param entity Indicates the entity to check 281686862fbSopenharmony_ci * @return Returns true if the given entity is contained; returns false otherwise 282686862fbSopenharmony_ci */ 283686862fbSopenharmony_ci bool HasEntity(const std::string& key) const; 284686862fbSopenharmony_ci 285686862fbSopenharmony_ci /** 286686862fbSopenharmony_ci * @description: Obtains the number of entities in a DistributedWant 287686862fbSopenharmony_ci * @return Returns the entity quantity 288686862fbSopenharmony_ci */ 289686862fbSopenharmony_ci int CountEntities(); 290686862fbSopenharmony_ci 291686862fbSopenharmony_ci /** 292686862fbSopenharmony_ci * @description: Obtains the description of the URI scheme in this DistributedWant. 293686862fbSopenharmony_ci * @return Returns the URI scheme description in this DistributedWant. 294686862fbSopenharmony_ci */ 295686862fbSopenharmony_ci const std::string GetScheme() const; 296686862fbSopenharmony_ci 297686862fbSopenharmony_ci /** 298686862fbSopenharmony_ci * @description: Obtains the description of the type in this DistributedWant 299686862fbSopenharmony_ci * @return Returns the type description in this DistributedWant 300686862fbSopenharmony_ci */ 301686862fbSopenharmony_ci std::string GetType() const; 302686862fbSopenharmony_ci 303686862fbSopenharmony_ci /** 304686862fbSopenharmony_ci * @description: Sets the description of a type in this DistributedWant 305686862fbSopenharmony_ci * @param type Indicates the type description 306686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the type 307686862fbSopenharmony_ci */ 308686862fbSopenharmony_ci DistributedWant& SetType(const std::string& type); 309686862fbSopenharmony_ci 310686862fbSopenharmony_ci /** 311686862fbSopenharmony_ci * @description: clear the specific DistributedWant object. 312686862fbSopenharmony_ci * @param want Indicates the DistributedWant to clear 313686862fbSopenharmony_ci */ 314686862fbSopenharmony_ci static void ClearWant(DistributedWant* want); 315686862fbSopenharmony_ci 316686862fbSopenharmony_ci /** 317686862fbSopenharmony_ci * @description: Obtains the description of the DistributedWantParams object in a DistributedWant 318686862fbSopenharmony_ci * @return Returns the DistributedWantParams description in the DistributedWant 319686862fbSopenharmony_ci */ 320686862fbSopenharmony_ci const DistributedWantParams& GetParams() const; 321686862fbSopenharmony_ci 322686862fbSopenharmony_ci /** 323686862fbSopenharmony_ci * @description: Sets a DistributedWantParams object in a want. 324686862fbSopenharmony_ci * @param wantParams Indicates the DistributedWantParams description. 325686862fbSopenharmony_ci * @return Returns this want object containing the DistributedWantParams. 326686862fbSopenharmony_ci */ 327686862fbSopenharmony_ci DistributedWant& SetParams(const DistributedWantParams& wantParams); 328686862fbSopenharmony_ci 329686862fbSopenharmony_ci /** 330686862fbSopenharmony_ci * @description: Obtains a bool-type value matching the given key. 331686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 332686862fbSopenharmony_ci * @param defaultValue Indicates the default bool-type value. 333686862fbSopenharmony_ci * @return Returns the bool-type value of the parameter matching the given key; 334686862fbSopenharmony_ci * returns the default value if the key does not exist. 335686862fbSopenharmony_ci */ 336686862fbSopenharmony_ci bool GetBoolParam(const std::string& key, bool defaultValue) const; 337686862fbSopenharmony_ci 338686862fbSopenharmony_ci /** 339686862fbSopenharmony_ci * @description: Obtains a bool-type array matching the given key. 340686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 341686862fbSopenharmony_ci * @return Returns the bool-type array of the parameter matching the given key; 342686862fbSopenharmony_ci * returns null if the key does not exist. 343686862fbSopenharmony_ci */ 344686862fbSopenharmony_ci std::vector<bool> GetBoolArrayParam(const std::string& key) const; 345686862fbSopenharmony_ci 346686862fbSopenharmony_ci /** 347686862fbSopenharmony_ci * @description: Sets a parameter value of the IRemoteObject type. 348686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 349686862fbSopenharmony_ci * @param value Indicates the IRemoteObject value of the parameter. 350686862fbSopenharmony_ci * @return Returns this want object containing the parameter value. 351686862fbSopenharmony_ci */ 352686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const sptr<IRemoteObject>& remoteObject); 353686862fbSopenharmony_ci 354686862fbSopenharmony_ci /** 355686862fbSopenharmony_ci * @description: Sets a parameter value of the boolean type. 356686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 357686862fbSopenharmony_ci * @param value Indicates the boolean value of the parameter. 358686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 359686862fbSopenharmony_ci */ 360686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, bool value); 361686862fbSopenharmony_ci 362686862fbSopenharmony_ci /** 363686862fbSopenharmony_ci * @description: Sets a parameter value of the boolean array type. 364686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 365686862fbSopenharmony_ci * @param value Indicates the boolean array of the parameter. 366686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 367686862fbSopenharmony_ci */ 368686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const std::vector<bool>& value); 369686862fbSopenharmony_ci 370686862fbSopenharmony_ci /** 371686862fbSopenharmony_ci * @description: Obtains a byte-type value matching the given key. 372686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 373686862fbSopenharmony_ci * @param defaultValue Indicates the default byte-type value. 374686862fbSopenharmony_ci * @return Returns the byte-type value of the parameter matching the given key; 375686862fbSopenharmony_ci * returns the default value if the key does not exist. 376686862fbSopenharmony_ci */ 377686862fbSopenharmony_ci AAFwk::byte GetByteParam(const std::string& key, AAFwk::byte defaultValue) const; 378686862fbSopenharmony_ci 379686862fbSopenharmony_ci /** 380686862fbSopenharmony_ci * @description: Obtains a byte-type array matching the given key. 381686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 382686862fbSopenharmony_ci * @return Returns the byte-type array of the parameter matching the given key; 383686862fbSopenharmony_ci * returns null if the key does not exist. 384686862fbSopenharmony_ci */ 385686862fbSopenharmony_ci std::vector<AAFwk::byte> GetByteArrayParam(const std::string& key) const; 386686862fbSopenharmony_ci 387686862fbSopenharmony_ci /** 388686862fbSopenharmony_ci * @description: Sets a parameter value of the byte type. 389686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 390686862fbSopenharmony_ci * @param value Indicates the byte-type value of the parameter. 391686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 392686862fbSopenharmony_ci */ 393686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, AAFwk::byte value); 394686862fbSopenharmony_ci 395686862fbSopenharmony_ci /** 396686862fbSopenharmony_ci * @description: Sets a parameter value of the byte array type. 397686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 398686862fbSopenharmony_ci * @param value Indicates the byte array of the parameter. 399686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 400686862fbSopenharmony_ci */ 401686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const std::vector<AAFwk::byte>& value); 402686862fbSopenharmony_ci 403686862fbSopenharmony_ci /** 404686862fbSopenharmony_ci * @description: Obtains a char value matching the given key. 405686862fbSopenharmony_ci * @param key Indicates the key of wnatParams. 406686862fbSopenharmony_ci * @param value Indicates the default char value. 407686862fbSopenharmony_ci * @return Returns the char value of the parameter matching the given key; 408686862fbSopenharmony_ci * returns the default value if the key does not exist. 409686862fbSopenharmony_ci */ 410686862fbSopenharmony_ci AAFwk::zchar GetCharParam(const std::string& key, AAFwk::zchar defaultValue) const; 411686862fbSopenharmony_ci 412686862fbSopenharmony_ci /** 413686862fbSopenharmony_ci * @description: Obtains a char array matching the given key. 414686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 415686862fbSopenharmony_ci * @return Returns the char array of the parameter matching the given key; 416686862fbSopenharmony_ci * returns null if the key does not exist. 417686862fbSopenharmony_ci */ 418686862fbSopenharmony_ci std::vector<AAFwk::zchar> GetCharArrayParam(const std::string& key) const; 419686862fbSopenharmony_ci 420686862fbSopenharmony_ci /** 421686862fbSopenharmony_ci * @description: Sets a parameter value of the char type. 422686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 423686862fbSopenharmony_ci * @param value Indicates the char value of the parameter. 424686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 425686862fbSopenharmony_ci */ 426686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, AAFwk::zchar value); 427686862fbSopenharmony_ci 428686862fbSopenharmony_ci /** 429686862fbSopenharmony_ci * @description: Sets a parameter value of the char array type. 430686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 431686862fbSopenharmony_ci * @param value Indicates the char array of the parameter. 432686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 433686862fbSopenharmony_ci */ 434686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const std::vector<AAFwk::zchar>& value); 435686862fbSopenharmony_ci 436686862fbSopenharmony_ci /** 437686862fbSopenharmony_ci * @description: Obtains an int value matching the given key. 438686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 439686862fbSopenharmony_ci * @param value Indicates the default int value. 440686862fbSopenharmony_ci * @return Returns the int value of the parameter matching the given key; 441686862fbSopenharmony_ci * returns the default value if the key does not exist. 442686862fbSopenharmony_ci */ 443686862fbSopenharmony_ci int GetIntParam(const std::string& key, int defaultValue) const; 444686862fbSopenharmony_ci 445686862fbSopenharmony_ci /** 446686862fbSopenharmony_ci * @description: Obtains an int array matching the given key. 447686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 448686862fbSopenharmony_ci * @return Returns the int array of the parameter matching the given key; 449686862fbSopenharmony_ci * returns null if the key does not exist. 450686862fbSopenharmony_ci */ 451686862fbSopenharmony_ci std::vector<int> GetIntArrayParam(const std::string& key) const; 452686862fbSopenharmony_ci 453686862fbSopenharmony_ci /** 454686862fbSopenharmony_ci * @description: Sets a parameter value of the int type. 455686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 456686862fbSopenharmony_ci * @param value Indicates the int value of the parameter. 457686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 458686862fbSopenharmony_ci */ 459686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, int value); 460686862fbSopenharmony_ci 461686862fbSopenharmony_ci /** 462686862fbSopenharmony_ci * @description: Sets a parameter value of the int array type. 463686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 464686862fbSopenharmony_ci * @param value Indicates the int array of the parameter. 465686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 466686862fbSopenharmony_ci */ 467686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const std::vector<int>& value); 468686862fbSopenharmony_ci 469686862fbSopenharmony_ci /** 470686862fbSopenharmony_ci * @description: Obtains a double value matching the given key. 471686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 472686862fbSopenharmony_ci * @param defaultValue Indicates the default double value. 473686862fbSopenharmony_ci * @return Returns the double value of the parameter matching the given key; 474686862fbSopenharmony_ci * returns the default value if the key does not exist. 475686862fbSopenharmony_ci */ 476686862fbSopenharmony_ci double GetDoubleParam(const std::string& key, double defaultValue) const; 477686862fbSopenharmony_ci 478686862fbSopenharmony_ci /** 479686862fbSopenharmony_ci * @description: Obtains a double array matching the given key. 480686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 481686862fbSopenharmony_ci * @return Returns the double array of the parameter matching the given key; 482686862fbSopenharmony_ci * returns null if the key does not exist. 483686862fbSopenharmony_ci */ 484686862fbSopenharmony_ci std::vector<double> GetDoubleArrayParam(const std::string& key) const; 485686862fbSopenharmony_ci 486686862fbSopenharmony_ci /** 487686862fbSopenharmony_ci * @description: Sets a parameter value of the double type. 488686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 489686862fbSopenharmony_ci * @param value Indicates the int value of the parameter. 490686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 491686862fbSopenharmony_ci */ 492686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, double value); 493686862fbSopenharmony_ci 494686862fbSopenharmony_ci /** 495686862fbSopenharmony_ci * @description: Sets a parameter value of the double array type. 496686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 497686862fbSopenharmony_ci * @param value Indicates the double array of the parameter. 498686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 499686862fbSopenharmony_ci */ 500686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const std::vector<double>& value); 501686862fbSopenharmony_ci 502686862fbSopenharmony_ci /** 503686862fbSopenharmony_ci * @description: Obtains a float value matching the given key. 504686862fbSopenharmony_ci * @param key Indicates the key of wnatParams. 505686862fbSopenharmony_ci * @param value Indicates the default float value. 506686862fbSopenharmony_ci * @return Returns the float value of the parameter matching the given key; 507686862fbSopenharmony_ci * returns the default value if the key does not exist. 508686862fbSopenharmony_ci */ 509686862fbSopenharmony_ci float GetFloatParam(const std::string& key, float defaultValue) const; 510686862fbSopenharmony_ci 511686862fbSopenharmony_ci /** 512686862fbSopenharmony_ci * @description: Obtains a float array matching the given key. 513686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 514686862fbSopenharmony_ci * @return Obtains a float array matching the given key. 515686862fbSopenharmony_ci */ 516686862fbSopenharmony_ci std::vector<float> GetFloatArrayParam(const std::string& key) const; 517686862fbSopenharmony_ci 518686862fbSopenharmony_ci /** 519686862fbSopenharmony_ci * @description: Sets a parameter value of the float type. 520686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 521686862fbSopenharmony_ci * @param value Indicates the byte-type value of the parameter. 522686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 523686862fbSopenharmony_ci */ 524686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, float value); 525686862fbSopenharmony_ci 526686862fbSopenharmony_ci /** 527686862fbSopenharmony_ci * @description: Sets a parameter value of the float array type. 528686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 529686862fbSopenharmony_ci * @param value Indicates the byte-type value of the parameter. 530686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 531686862fbSopenharmony_ci */ 532686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const std::vector<float>& value); 533686862fbSopenharmony_ci 534686862fbSopenharmony_ci /** 535686862fbSopenharmony_ci * @description: Obtains a long value matching the given key. 536686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 537686862fbSopenharmony_ci * @param value Indicates the default long value. 538686862fbSopenharmony_ci * @return Returns the long value of the parameter matching the given key; 539686862fbSopenharmony_ci * returns the default value if the key does not exist. 540686862fbSopenharmony_ci */ 541686862fbSopenharmony_ci long GetLongParam(const std::string& key, long defaultValue) const; 542686862fbSopenharmony_ci 543686862fbSopenharmony_ci /** 544686862fbSopenharmony_ci * @description: Obtains a long array matching the given key. 545686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 546686862fbSopenharmony_ci * @return Returns the long array of the parameter matching the given key; 547686862fbSopenharmony_ci * returns null if the key does not exist. 548686862fbSopenharmony_ci */ 549686862fbSopenharmony_ci std::vector<long> GetLongArrayParam(const std::string& key) const; 550686862fbSopenharmony_ci 551686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, long long value); 552686862fbSopenharmony_ci 553686862fbSopenharmony_ci /** 554686862fbSopenharmony_ci * @description: Sets a parameter value of the long type. 555686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 556686862fbSopenharmony_ci * @param value Indicates the byte-type value of the parameter. 557686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 558686862fbSopenharmony_ci */ 559686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, long value); 560686862fbSopenharmony_ci 561686862fbSopenharmony_ci /** 562686862fbSopenharmony_ci * @description: Sets a parameter value of the long array type. 563686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 564686862fbSopenharmony_ci * @param value Indicates the byte-type value of the parameter. 565686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 566686862fbSopenharmony_ci */ 567686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const std::vector<long>& value); 568686862fbSopenharmony_ci 569686862fbSopenharmony_ci /** 570686862fbSopenharmony_ci * @description: a short value matching the given key. 571686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 572686862fbSopenharmony_ci * @param defaultValue Indicates the default short value. 573686862fbSopenharmony_ci * @return Returns the short value of the parameter matching the given key; 574686862fbSopenharmony_ci * returns the default value if the key does not exist. 575686862fbSopenharmony_ci */ 576686862fbSopenharmony_ci short GetShortParam(const std::string& key, short defaultValue) const; 577686862fbSopenharmony_ci 578686862fbSopenharmony_ci /** 579686862fbSopenharmony_ci * @description: Obtains a short array matching the given key. 580686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 581686862fbSopenharmony_ci * @return Returns the short array of the parameter matching the given key; 582686862fbSopenharmony_ci * returns null if the key does not exist. 583686862fbSopenharmony_ci */ 584686862fbSopenharmony_ci std::vector<short> GetShortArrayParam(const std::string& key) const; 585686862fbSopenharmony_ci 586686862fbSopenharmony_ci /** 587686862fbSopenharmony_ci * @description: Sets a parameter value of the short type. 588686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 589686862fbSopenharmony_ci * @param value Indicates the byte-type value of the parameter. 590686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 591686862fbSopenharmony_ci */ 592686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, short value); 593686862fbSopenharmony_ci 594686862fbSopenharmony_ci /** 595686862fbSopenharmony_ci * @description: Sets a parameter value of the short array type. 596686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 597686862fbSopenharmony_ci * @param value Indicates the byte-type value of the parameter. 598686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 599686862fbSopenharmony_ci */ 600686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const std::vector<short>& value); 601686862fbSopenharmony_ci 602686862fbSopenharmony_ci /** 603686862fbSopenharmony_ci * @description: Obtains a string value matching the given key. 604686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 605686862fbSopenharmony_ci * @return Returns the string value of the parameter matching the given key; 606686862fbSopenharmony_ci * returns null if the key does not exist. 607686862fbSopenharmony_ci */ 608686862fbSopenharmony_ci std::string GetStringParam(const std::string& key) const; 609686862fbSopenharmony_ci 610686862fbSopenharmony_ci /** 611686862fbSopenharmony_ci * @description: Obtains a string array matching the given key. 612686862fbSopenharmony_ci * @param key Indicates the key of DistributedWantParams. 613686862fbSopenharmony_ci * @return Returns the string array of the parameter matching the given key; 614686862fbSopenharmony_ci * returns null if the key does not exist. 615686862fbSopenharmony_ci */ 616686862fbSopenharmony_ci std::vector<std::string> GetStringArrayParam(const std::string& key) const; 617686862fbSopenharmony_ci 618686862fbSopenharmony_ci /** 619686862fbSopenharmony_ci * @description: Sets a parameter value of the string type. 620686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 621686862fbSopenharmony_ci * @param value Indicates the byte-type value of the parameter. 622686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 623686862fbSopenharmony_ci */ 624686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const std::string& value); 625686862fbSopenharmony_ci 626686862fbSopenharmony_ci /** 627686862fbSopenharmony_ci * @description: Sets a parameter value of the string array type. 628686862fbSopenharmony_ci * @param key Indicates the key matching the parameter. 629686862fbSopenharmony_ci * @param value Indicates the byte-type value of the parameter. 630686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the parameter value. 631686862fbSopenharmony_ci */ 632686862fbSopenharmony_ci DistributedWant& SetParam(const std::string& key, const std::vector<std::string>& value); 633686862fbSopenharmony_ci 634686862fbSopenharmony_ci /** 635686862fbSopenharmony_ci * @description: Checks whether a DistributedWant contains the parameter matching a given key. 636686862fbSopenharmony_ci * @param key Indicates the key. 637686862fbSopenharmony_ci * @return Returns true if the DistributedWant contains the parameter; returns false otherwise. 638686862fbSopenharmony_ci */ 639686862fbSopenharmony_ci bool HasParameter(const std::string& key) const; 640686862fbSopenharmony_ci 641686862fbSopenharmony_ci /** 642686862fbSopenharmony_ci * @description: Replaces parameters in this Want object with those in the given DistributedWantParams object. 643686862fbSopenharmony_ci * @param wantParams Indicates the DistributedWantParams object containing the new parameters. 644686862fbSopenharmony_ci * @return Returns this Want object containing the new parameters. 645686862fbSopenharmony_ci */ 646686862fbSopenharmony_ci DistributedWant* ReplaceParams(DistributedWantParams& wantParams); 647686862fbSopenharmony_ci 648686862fbSopenharmony_ci /** 649686862fbSopenharmony_ci * @description: Replaces parameters in this DistributedWant object with those in the given Want object. 650686862fbSopenharmony_ci * @param want Indicates the DistributedWant object containing the new parameters. 651686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the new parameters. 652686862fbSopenharmony_ci */ 653686862fbSopenharmony_ci DistributedWant* ReplaceParams(DistributedWant& want); 654686862fbSopenharmony_ci 655686862fbSopenharmony_ci /** 656686862fbSopenharmony_ci * @description: Removes the parameter matching the given key. 657686862fbSopenharmony_ci * @param key Indicates the key matching the parameter to be removed. 658686862fbSopenharmony_ci */ 659686862fbSopenharmony_ci void RemoveParam(const std::string& key); 660686862fbSopenharmony_ci 661686862fbSopenharmony_ci /** 662686862fbSopenharmony_ci * @description: Gets the description of an operation in a DistributedWant. 663686862fbSopenharmony_ci * @return Returns the operation included in this DistributedWant. 664686862fbSopenharmony_ci */ 665686862fbSopenharmony_ci DistributedOperation GetOperation() const; 666686862fbSopenharmony_ci 667686862fbSopenharmony_ci /** 668686862fbSopenharmony_ci * @description: Sets the description of an operation in a DistributedWant. 669686862fbSopenharmony_ci * @param operation Indicates the operation description. 670686862fbSopenharmony_ci */ 671686862fbSopenharmony_ci void SetOperation(const DistributedOperation& operation); 672686862fbSopenharmony_ci 673686862fbSopenharmony_ci /** 674686862fbSopenharmony_ci * @description: Sets the description of an operation in a DistributedWant. 675686862fbSopenharmony_ci * @param want Indicates the DistributedWant object to compare. 676686862fbSopenharmony_ci * @return Returns true if the operation components of the two objects are equal; returns false otherwise. 677686862fbSopenharmony_ci */ 678686862fbSopenharmony_ci bool OperationEquals(const DistributedWant& want); 679686862fbSopenharmony_ci 680686862fbSopenharmony_ci /** 681686862fbSopenharmony_ci * @description: Marshals a DistributedWant into a Parcel. 682686862fbSopenharmony_ci * Fields in the DistributedWant are marshalled separately. If any field fails to be marshalled, false is returned. 683686862fbSopenharmony_ci * @param parcel Indicates the Parcel object for marshalling. 684686862fbSopenharmony_ci * @return Returns true if the marshalling is successful; returns false otherwise. 685686862fbSopenharmony_ci */ 686686862fbSopenharmony_ci virtual bool Marshalling(Parcel& parcel) const; 687686862fbSopenharmony_ci 688686862fbSopenharmony_ci /** 689686862fbSopenharmony_ci * @description: Unmarshals a DistributedWant from a Parcel. 690686862fbSopenharmony_ci * Fields in the DistributedWant are unmarshalled separately. 691686862fbSopenharmony_ci * If any field fails to be unmarshalled, false is returned. 692686862fbSopenharmony_ci * @param parcel Indicates the Parcel object for unmarshalling. 693686862fbSopenharmony_ci * @return Returns true if the unmarshalling is successful; returns false otherwise. 694686862fbSopenharmony_ci */ 695686862fbSopenharmony_ci static DistributedWant* Unmarshalling(Parcel& parcel); 696686862fbSopenharmony_ci 697686862fbSopenharmony_ci std::string ToString() const; 698686862fbSopenharmony_ci 699686862fbSopenharmony_ci static DistributedWant* FromString(std::string& string); 700686862fbSopenharmony_ci 701686862fbSopenharmony_ci std::shared_ptr<AAFwk::Want> ToWant(); 702686862fbSopenharmony_ci 703686862fbSopenharmony_ci /** 704686862fbSopenharmony_ci * @description: Sets a device id in a DistributedWant. 705686862fbSopenharmony_ci * @param deviceId Indicates the device id to set. 706686862fbSopenharmony_ci * @return Returns this DistributedWant object containing the flag. 707686862fbSopenharmony_ci */ 708686862fbSopenharmony_ci DistributedWant& SetDeviceId(const std::string& deviceId); 709686862fbSopenharmony_cipublic: 710686862fbSopenharmony_ci static const std::string ACTION_PLAY; 711686862fbSopenharmony_ci static const std::string ACTION_HOME; 712686862fbSopenharmony_ci static const std::string ENTITY_HOME; 713686862fbSopenharmony_ci static const std::string ENTITY_VIDEO; 714686862fbSopenharmony_ci static const std::string FLAG_HOME_INTENT_FROM_SYSTEM; 715686862fbSopenharmony_ci static const std::string ENTITY_MUSIC; 716686862fbSopenharmony_ci static const std::string ENTITY_EMAIL; 717686862fbSopenharmony_ci static const std::string ENTITY_CONTACTS; 718686862fbSopenharmony_ci static const std::string ENTITY_MAPS; 719686862fbSopenharmony_ci static const std::string ENTITY_BROWSER; 720686862fbSopenharmony_ci static const std::string ENTITY_CALENDAR; 721686862fbSopenharmony_ci static const std::string ENTITY_MESSAGING; 722686862fbSopenharmony_ci static const std::string ENTITY_FILES; 723686862fbSopenharmony_ci static const std::string ENTITY_GALLERY; 724686862fbSopenharmony_ci static unsigned int FLAG_ABILITY_NEW_MISSION; 725686862fbSopenharmony_ci static unsigned int FLAG_ABILITY_CLEAR_MISSION; 726686862fbSopenharmony_ci static constexpr int HEX_STRING_BUF_LEN = 36; 727686862fbSopenharmony_ci static constexpr int HEX_STRING_LEN = 10; 728686862fbSopenharmony_ci static const std::string PARAM_RESV_WINDOW_MODE; 729686862fbSopenharmony_ci static const std::string PARAM_RESV_DISPLAY_ID; 730686862fbSopenharmony_ci static const std::string PARAM_RESV_CALLER_TOKEN; 731686862fbSopenharmony_ci static const std::string PARAM_RESV_CALLER_UID; 732686862fbSopenharmony_ci static const std::string PARAM_RESV_CALLER_PID; 733686862fbSopenharmony_ci 734686862fbSopenharmony_ciprivate: 735686862fbSopenharmony_ci DistributedWantParams parameters_; 736686862fbSopenharmony_ci DistributedOperation operation_; 737686862fbSopenharmony_ci 738686862fbSopenharmony_ci static const std::string OCT_EQUALSTO; 739686862fbSopenharmony_ci static const std::string OCT_SEMICOLON; 740686862fbSopenharmony_ci static const std::string MIME_TYPE; 741686862fbSopenharmony_ci static const std::string WANT_HEADER; 742686862fbSopenharmony_ci 743686862fbSopenharmony_ci static constexpr int VALUE_NULL = -1; 744686862fbSopenharmony_ci static constexpr int VALUE_OBJECT = 1; 745686862fbSopenharmony_ci 746686862fbSopenharmony_ciprivate: 747686862fbSopenharmony_ci bool ReadFromParcel(Parcel& parcel); 748686862fbSopenharmony_ci OHOS::Uri GetLowerCaseScheme(const OHOS::Uri& uri); 749686862fbSopenharmony_ci nlohmann::json ToJson() const; 750686862fbSopenharmony_ci bool ReadFromJson(nlohmann::json& wantJson); 751686862fbSopenharmony_ci bool CanReadFromJson(nlohmann::json& wantJson); 752686862fbSopenharmony_ci bool MarshallingWriteEntities(Parcel& parcel) const; 753686862fbSopenharmony_ci bool MarshallingWriteElement(Parcel& parcel) const; 754686862fbSopenharmony_ci bool MarshallingWriteParameters(Parcel& parcel) const; 755686862fbSopenharmony_ci bool MarshallingWriteUri(Parcel& parcel) const; 756686862fbSopenharmony_ci bool ReadUriFromParcel(Parcel& parcel); 757686862fbSopenharmony_ci bool ReadEntitiesFromParcel(Parcel& parcel); 758686862fbSopenharmony_ci bool ReadElementFromParcel(Parcel& parcel); 759686862fbSopenharmony_ci bool ReadParametersFromParcel(Parcel& parcel); 760686862fbSopenharmony_ci}; 761686862fbSopenharmony_ci} // namespace DistributedSchedule 762686862fbSopenharmony_ci} // namespace OHOS 763686862fbSopenharmony_ci#endif // OHOS_DISTRIBUTEDWANT_WANT_H 764