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