1 /* 2 * Copyright (C) 2021-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 INTERFACES_INNERKITS_NATIVE_INCLUDE_ALBUM_ASSET_H_ 17 #define INTERFACES_INNERKITS_NATIVE_INCLUDE_ALBUM_ASSET_H_ 18 19 #include <memory> 20 #include <string> 21 #include <vector> 22 #include "userfile_manager_types.h" 23 24 namespace OHOS { 25 namespace Media { 26 #define EXPORT __attribute__ ((visibility ("default"))) 27 using namespace std; 28 /** 29 * @brief Data class for album details 30 * 31 * @since 1.0 32 * @version 1.0 33 */ 34 class AlbumAsset { 35 public: 36 EXPORT AlbumAsset(); 37 EXPORT virtual ~AlbumAsset(); 38 39 EXPORT void SetAlbumId(const int32_t albumId); 40 EXPORT void SetAlbumName(const string albumName); 41 EXPORT void SetAlbumUri(const string albumUri); 42 EXPORT void SetAlbumDateModified(const int64_t albumDateModified); 43 EXPORT void SetCount(const int32_t count); 44 EXPORT void SetAlbumRelativePath(const string albumRelativePath); 45 EXPORT void SetCoverUri(const string &coverUri); 46 47 EXPORT void SetAlbumPath(const string albumPath); 48 EXPORT void SetAlbumVirtual(const bool albumVirtual); 49 EXPORT int32_t GetAlbumId() const; 50 EXPORT string GetAlbumName() const; 51 EXPORT string GetAlbumUri() const; 52 EXPORT int64_t GetAlbumDateModified() const; 53 EXPORT int32_t GetCount() const; 54 EXPORT string GetAlbumRelativePath() const; 55 EXPORT string GetCoverUri() const; 56 EXPORT string GetAlbumPath() const; 57 EXPORT bool GetAlbumVirtual() const; 58 59 EXPORT void SetResultNapiType(const ResultNapiType type); 60 EXPORT ResultNapiType GetResultNapiType() const; 61 62 #ifdef MEDIALIBRARY_COMPATIBILITY 63 EXPORT void SetAlbumType(const PhotoAlbumType albumType); 64 EXPORT void SetAlbumSubType(const PhotoAlbumSubType albumSubType); 65 EXPORT PhotoAlbumType GetAlbumType() const; 66 EXPORT PhotoAlbumSubType GetAlbumSubType() const; 67 #endif 68 69 private: 70 int32_t albumId_; 71 std::string albumName_; 72 string albumUri_; 73 int64_t albumDateModified_; 74 int32_t count_; 75 string albumRelativePath_; 76 string coverUri_; 77 78 string albumPath_; 79 bool albumVirtual_; 80 ResultNapiType resultNapiType_; 81 82 #ifdef MEDIALIBRARY_COMPATIBILITY 83 PhotoAlbumType albumType_ = PhotoAlbumType::USER; 84 PhotoAlbumSubType albumSubType_ = PhotoAlbumSubType::USER_GENERIC; 85 #endif 86 }; 87 } // namespace Media 88 } // namespace OHOS 89 90 #endif // INTERFACES_INNERKITS_NATIVE_INCLUDE_ALBUM_ASSET_H_ 91