• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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_FORM_FWK_FORM_DUMP_MGR_H
17 #define OHOS_FORM_FWK_FORM_DUMP_MGR_H
18 
19 #include <singleton.h>
20 
21 #include "form_db_info.h"
22 #include "form_dump_mgr.h"
23 #include "form_host_record.h"
24 #include "form_info_mgr.h"
25 
26 namespace OHOS {
27 namespace AppExecFwk {
28 /**
29  * @class FormDumpMgr
30  * Form dump mgr.
31  */
32 class FormDumpMgr final : public DelayedRefSingleton<FormDumpMgr> {
33     DECLARE_DELAYED_REF_SINGLETON(FormDumpMgr)
34 public:
35     DISALLOW_COPY_AND_MOVE(FormDumpMgr);
36 
37     /**
38      * @brief Dump all of form storage infos.
39      * @param storageInfos Form storage infos
40      * @param formInfos Form storage dump info.
41      */
42     void DumpStorageFormInfos(const std::vector<FormDBInfo> &storageInfos, std::string &formInfos) const;
43     /**
44      * @brief Dump all of temporary form infos.
45      * @param formRecordInfos Form record infos.
46      * @param formInfos Form dump infos.
47      */
48     void DumpTemporaryFormInfos(const std::vector<FormRecord> &formRecordInfos, std::string &formInfos) const;
49     /**
50      * @brief Dump form infos of all bundles, this is static info.
51      * @param bundleFormInfos Form infos from bundle.
52      * @param formInfos Form dump infos.
53      */
54     void DumpStaticBundleFormInfos(const std::vector<FormInfo> &bundleFormInfos, std::string &formInfos) const;
55     /**
56      * @brief Dump form infos.
57      * @param formRecordInfos Form record infos.
58      * @param formInfos Form dump infos.
59      */
60     void DumpFormInfos(const std::vector<FormRecord> &formRecordInfos, std::string &formInfos) const;
61     /**
62      * @brief Dump form infos.
63      * @param formRecordInfo Form Host record info.
64      * @param formInfo Form dump info.
65      */
66     void DumpFormHostInfo(const FormHostRecord &formHostRecord, std::string &formInfo) const;
67     /**
68      * @brief Dump form infos.
69      * @param formRecordInfo Form record info.
70      * @param formInfo Form dump info.
71      */
72     void DumpFormInfo(const FormRecord &formRecordInfo, std::string &formInfo) const;
73 
74 private:
75     void AppendBundleFormInfo(const FormRecord &formRecordInfo, std::string &formInfo) const;
76 };
77 }  // namespace AppExecFwk
78 }  // namespace OHOS
79 
80 #endif // OHOS_FORM_FWK_FORM_DUMP_MGR_H
81