1 /* 2 * Copyright (c) 2024 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 META_INTERFACE_LOADERS_FILE_CONTENT_LOADER_H 17 #define META_INTERFACE_LOADERS_FILE_CONTENT_LOADER_H 18 19 #include <base/containers/string.h> 20 #include <core/io/intf_file.h> 21 22 #include <meta/interface/loaders/intf_dynamic_content_loader.h> 23 #include <meta/interface/property/intf_property.h> 24 25 META_BEGIN_NAMESPACE() 26 27 META_REGISTER_INTERFACE(IFileContentLoader, "4bcb1a14-9022-4f5c-91fd-67ad36a87a4e") 28 29 /** 30 * @brief The IFileContentLoader interface defines an interface for content loaders 31 * which load their content from a file. 32 */ 33 class IFileContentLoader : public IDynamicContentLoader { 34 public: 35 META_INTERFACE(IDynamicContentLoader, IFileContentLoader) 36 public: 37 /** 38 * @brief File to load. 39 */ 40 virtual bool SetFile(CORE_NS::IFile::Ptr) = 0; 41 /** 42 * @brief If true, content loader should implement caching of the source file. 43 * The default value is false. 44 */ 45 META_PROPERTY(bool, Cached) 46 }; 47 48 META_END_NAMESPACE() 49 50 #endif 51