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 FRAMEWORKS_INNERKITSIMPL_ACCESSOR_INCLUDE_METADATA_ACCESSOR_H
17 #define FRAMEWORKS_INNERKITSIMPL_ACCESSOR_INCLUDE_METADATA_ACCESSOR_H
18 
19 #include <memory>
20 
21 #include "data_buf.h"
22 #include "exif_metadata.h"
23 #include "metadata_stream.h"
24 #include "ext_wstream.h"
25 
26 namespace OHOS {
27 namespace Media {
28 static constexpr int E_NO_EXIF_TAG = 1;
29 
30 class MetadataAccessor {
31 public:
32     virtual uint32_t Read() = 0;
33     virtual uint32_t Write() = 0;
34     virtual bool Create() = 0;
35     virtual uint32_t WriteBlob(DataBuf &blob) = 0;
36     virtual bool ReadBlob(DataBuf &blob) = 0;
37     virtual bool WriteToOutput(SkWStream &output) = 0;
38     virtual std::shared_ptr<MetadataStream> GetOutputStream() = 0;
39     virtual std::shared_ptr<ExifMetadata> Get() = 0;
40     virtual void Set(std::shared_ptr<ExifMetadata> &ptr) = 0;
41     virtual uint32_t GetFilterArea(const std::vector<std::string> &exifKeys,
42                                    std::vector<std::pair<uint32_t, uint32_t>> &ranges) = 0;
43     virtual bool IsFileChanged() = 0;
44 };
45 } // namespace Media
46 } // namespace OHOS
47 
48 #endif // FRAMEWORKS_INNERKITSIMPL_ACCESSOR_INCLUDE_METADATA_ACCESSOR_H
49