• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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_NWEB_NATIVE_COMMON_WEB_HISTORY_LIST_H
17 #define OHOS_NWEB_NATIVE_COMMON_WEB_HISTORY_LIST_H
18 #include "nweb.h"
19 #include "web_errors.h"
20 #include "nweb_helper.h"
21 #include "nweb_log.h"
22 #include "transfer_referenced_count.h"
23 
24 namespace OHOS {
25 namespace NWeb {
26 
27 class WebHistoryList : public TransferReferencedCount {
28 public:
WebHistoryList(std::shared_ptr<NWebHistoryList> sptrHistoryList)29     explicit WebHistoryList(std::shared_ptr<NWebHistoryList> sptrHistoryList) : sptrHistoryList_(sptrHistoryList) {};
30     ~WebHistoryList() = default;
31 
32     int32_t GetCurrentIndex();
33 
34     std::shared_ptr<NWebHistoryItem> GetItem(int32_t index);
35 
36     int32_t GetListSize();
37 
38 private:
39     OHOS::NWeb::NWeb* nweb_ = nullptr;
40     std::shared_ptr<NWebHistoryList> sptrHistoryList_ = nullptr;
41 };
42 
43 } // namespace NWeb
44 } // namespace OHOS
45 #endif // OHOS_NWEB_NATIVE_COMMON_WEB_HISTORY_LIST_H