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 22 #include "nweb_export.h" 23 24 namespace OHOS::NWeb { 25 26 enum class ImageColorType; 27 enum class ImageAlphaType; 28 class OHOS_NWEB_EXPORT NWebHistoryItem { 29 public: 30 virtual ~NWebHistoryItem() = default; 31 32 virtual std::string GetHistoryRawUrl() = 0; 33 34 virtual std::string GetHistoryTitle() = 0; 35 36 virtual std::string GetHistoryUrl() = 0; 37 38 virtual bool GetFavicon( 39 void** data, int& width, int& height, ImageColorType& colorType, ImageAlphaType& alphaType) = 0; 40 }; 41 42 class OHOS_NWEB_EXPORT NWebHistoryList { 43 public: 44 virtual ~NWebHistoryList() = default; 45 46 virtual int32_t GetCurrentIndex() = 0; 47 48 virtual std::shared_ptr<NWebHistoryItem> GetItem(int32_t index) = 0; 49 50 virtual int32_t GetListSize() = 0; 51 }; 52 53 } // namespace OHOS::NWeb 54 55 #endif