• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_AAFWK_PENDING_WANT_KEY_H
17 #define OHOS_AAFWK_PENDING_WANT_KEY_H
18 
19 #include <vector>
20 #include <string>
21 
22 #include "want.h"
23 #include "ability_record.h"
24 #include "wants_info.h"
25 
26 namespace OHOS {
27 namespace AAFwk {
28 #define ODD_PRIME_NUMBER (37)
29 
30 class PendingWantKey {
31 public:
32     PendingWantKey() = default;
33     virtual ~PendingWantKey() = default;
34     void SetType(const int32_t type);
35     void SetBundleName(const std::string &bundleName);
36     void SetRequestWho(const std::string &requestWho);
37     void SetRequestCode(int32_t requestCode);
38     void SetRequestWant(const Want &requestWant);
39     void SetRequestResolvedType(const std::string &requestResolvedType);
40     void SetAllWantsInfos(const std::vector<WantsInfo> &allWantsInfos);
41     void SetFlags(int32_t flags);
42     void SetCode(int32_t code);
43     void SetUserId(int32_t userId);
44 
45     int32_t GetType();
46     std::string GetBundleName();
47     std::string GetRequestWho();
48     int32_t GetRequestCode();
49     Want GetRequestWant();
50     std::string GetRequestResolvedType();
51     std::vector<WantsInfo> GetAllWantsInfos();
52     int32_t GetFlags();
53     int32_t GetCode();
54     int32_t GetUserId();
55 
56 private:
57     int32_t type_ = {};
58     std::string bundleName_ = {};
59     std::string requestWho_ = {};
60     int32_t requestCode_ = {};
61     Want requestWant_ = {};
62     std::string requestResolvedType_ = {};
63     std::vector<WantsInfo> allWantsInfos_ = {};
64     int32_t flags_ = {};
65     int32_t code_ = {};
66     int32_t userId_ = {};
67 };
68 }  // namespace AAFwk
69 }  // namespace OHOS
70 #endif  // OHOS_AAFWK_PENDING_WANT_KEY_H