1eace7efcSopenharmony_ci/* 2eace7efcSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 3eace7efcSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4eace7efcSopenharmony_ci * you may not use this file except in compliance with the License. 5eace7efcSopenharmony_ci * You may obtain a copy of the License at 6eace7efcSopenharmony_ci * 7eace7efcSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8eace7efcSopenharmony_ci * 9eace7efcSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10eace7efcSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11eace7efcSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12eace7efcSopenharmony_ci * See the License for the specific language governing permissions and 13eace7efcSopenharmony_ci * limitations under the License. 14eace7efcSopenharmony_ci */ 15eace7efcSopenharmony_ci 16eace7efcSopenharmony_ci#ifndef OHOS_ABILITY_RUNTIME_PENDING_WANT_KEY_H 17eace7efcSopenharmony_ci#define OHOS_ABILITY_RUNTIME_PENDING_WANT_KEY_H 18eace7efcSopenharmony_ci 19eace7efcSopenharmony_ci#include <mutex> 20eace7efcSopenharmony_ci#include <vector> 21eace7efcSopenharmony_ci#include <string> 22eace7efcSopenharmony_ci 23eace7efcSopenharmony_ci#include "want.h" 24eace7efcSopenharmony_ci#include "wants_info.h" 25eace7efcSopenharmony_ci 26eace7efcSopenharmony_cinamespace OHOS { 27eace7efcSopenharmony_cinamespace AAFwk { 28eace7efcSopenharmony_ci#define ODD_PRIME_NUMBER (37) 29eace7efcSopenharmony_ci 30eace7efcSopenharmony_ciclass PendingWantKey { 31eace7efcSopenharmony_cipublic: 32eace7efcSopenharmony_ci PendingWantKey() = default; 33eace7efcSopenharmony_ci virtual ~PendingWantKey() = default; 34eace7efcSopenharmony_ci void SetType(const int32_t type); 35eace7efcSopenharmony_ci void SetBundleName(const std::string &bundleName); 36eace7efcSopenharmony_ci void SetRequestWho(const std::string &requestWho); 37eace7efcSopenharmony_ci void SetRequestCode(int32_t requestCode); 38eace7efcSopenharmony_ci void SetRequestWant(const Want &requestWant); 39eace7efcSopenharmony_ci void SetRequestResolvedType(const std::string &requestResolvedType); 40eace7efcSopenharmony_ci void SetAllWantsInfos(const std::vector<WantsInfo> &allWantsInfos); 41eace7efcSopenharmony_ci void SetFlags(int32_t flags); 42eace7efcSopenharmony_ci void SetCode(int32_t code); 43eace7efcSopenharmony_ci void SetUserId(int32_t userId); 44eace7efcSopenharmony_ci void SetAppIndex(int32_t appIndex); 45eace7efcSopenharmony_ci 46eace7efcSopenharmony_ci int32_t GetType(); 47eace7efcSopenharmony_ci std::string GetBundleName(); 48eace7efcSopenharmony_ci std::string GetRequestWho(); 49eace7efcSopenharmony_ci int32_t GetRequestCode(); 50eace7efcSopenharmony_ci Want GetRequestWant(); 51eace7efcSopenharmony_ci Want& GetRequestWantRef(); 52eace7efcSopenharmony_ci std::string GetRequestResolvedType(); 53eace7efcSopenharmony_ci std::vector<WantsInfo> GetAllWantsInfos(); 54eace7efcSopenharmony_ci int32_t GetFlags(); 55eace7efcSopenharmony_ci int32_t GetCode(); 56eace7efcSopenharmony_ci int32_t GetUserId(); 57eace7efcSopenharmony_ci bool IsEqualsRequestWant(const Want &otherWant); 58eace7efcSopenharmony_ci int32_t GetAppIndex(); 59eace7efcSopenharmony_ci 60eace7efcSopenharmony_ciprivate: 61eace7efcSopenharmony_ci int32_t type_ = {}; 62eace7efcSopenharmony_ci std::string bundleName_ = {}; 63eace7efcSopenharmony_ci std::string requestWho_ = {}; 64eace7efcSopenharmony_ci int32_t requestCode_ = {}; 65eace7efcSopenharmony_ci Want requestWant_ = {}; 66eace7efcSopenharmony_ci std::string requestResolvedType_ = {}; 67eace7efcSopenharmony_ci std::vector<WantsInfo> allWantsInfos_ = {}; 68eace7efcSopenharmony_ci int32_t flags_ = {}; 69eace7efcSopenharmony_ci int32_t code_ = {}; 70eace7efcSopenharmony_ci int32_t userId_ = {}; 71eace7efcSopenharmony_ci int32_t appIndex_ = 0; 72eace7efcSopenharmony_ci std::mutex wantsInfosMutex_; 73eace7efcSopenharmony_ci std::mutex requestWantMutex_; 74eace7efcSopenharmony_ci}; 75eace7efcSopenharmony_ci} // namespace AAFwk 76eace7efcSopenharmony_ci} // namespace OHOS 77eace7efcSopenharmony_ci#endif // OHOS_ABILITY_RUNTIME_PENDING_WANT_KEY_H 78