• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 NWEB_HISTORY_LIST_H
17 #define NWEB_HISTORY_LIST_H
18 
19 #include <memory>
20 #include <string>
21 #include "nweb_export.h"
22 
23 namespace OHOS::NWeb {
24 enum class ImageColorType;
25 enum class ImageAlphaType;
26 class OHOS_NWEB_EXPORT NWebHistoryItem {
27 public:
28     virtual ~NWebHistoryItem() = default;
29 
30     virtual std::string GetHistoryRawUrl() = 0;
31 
32     virtual std::string GetHistoryTitle() = 0;
33 
34     virtual std::string GetHistoryUrl() = 0;
35 
36     virtual bool GetFavicon(void** data, int& width, int& height,
37         ImageColorType& colorType, ImageAlphaType& alphaType) = 0;
38 };
39 
40 class OHOS_NWEB_EXPORT NWebHistoryList {
41 public:
42     virtual ~NWebHistoryList() = default;
43 
44     virtual int32_t GetCurrentIndex() = 0;
45 
46     virtual std::shared_ptr<NWebHistoryItem> GetItem(int32_t index) = 0;
47 
48     virtual int32_t GetListSize() = 0;
49 };
50 }
51 #endif