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 #include "smart_album_asset.h" 17 18 #include "medialibrary_type_const.h" 19 20 using namespace std; 21 22 namespace OHOS { 23 namespace Media { SmartAlbumAsset()24SmartAlbumAsset::SmartAlbumAsset() 25 { 26 albumId_ = DEFAULT_ALBUM_ID; 27 albumName_ = DEFAULT_ALBUM_NAME; 28 albumUri_ = DEFAULT_ALBUM_URI; 29 albumTag_ = DEFAULT_SMART_ALBUM_TAG; 30 albumPrivateType_ = DEFAULT_SMART_ALBUM_PRIVATE_TYPE; 31 albumCapacity_ = DEFAULT_SMART_ALBUM_ALBUMCAPACITY; 32 categoryId_ = DEFAULT_SMART_ALBUM_CATEGORYID; 33 albumDateModified_ = DEFAULT_SMART_ALBUM_DATE_MODIFIED; 34 categoryName_ = DEFAULT_SMART_ALBUM_CATEGORYNAME; 35 coverUri_ = DEFAULT_COVERURI; 36 resultNapiType_ = ResultNapiType::TYPE_MEDIALIBRARY; 37 } 38 39 SmartAlbumAsset::~SmartAlbumAsset() = default; 40 41 SetAlbumId(const int32_t albumId)42void SmartAlbumAsset::SetAlbumId(const int32_t albumId) 43 { 44 albumId_ = albumId; 45 } 46 SetAlbumName(const string albumName)47void SmartAlbumAsset::SetAlbumName(const string albumName) 48 { 49 albumName_ = albumName; 50 } 51 SetAlbumUri(const string albumUri)52void SmartAlbumAsset::SetAlbumUri(const string albumUri) 53 { 54 albumUri_ = albumUri; 55 } 56 SetAlbumTag(const string albumTag)57void SmartAlbumAsset::SetAlbumTag(const string albumTag) 58 { 59 albumTag_ = albumTag; 60 } 61 SetAlbumCapacity(const int32_t albumCapacity)62void SmartAlbumAsset::SetAlbumCapacity(const int32_t albumCapacity) 63 { 64 albumCapacity_ = albumCapacity; 65 } 66 SetCategoryId(const int32_t categoryId)67void SmartAlbumAsset::SetCategoryId(const int32_t categoryId) 68 { 69 categoryId_ = categoryId; 70 } 71 SetAlbumDateModified(const int64_t albumDateModified)72void SmartAlbumAsset::SetAlbumDateModified(const int64_t albumDateModified) 73 { 74 albumDateModified_ = albumDateModified; 75 } 76 SetCategoryName(const string categoryName)77void SmartAlbumAsset::SetCategoryName(const string categoryName) 78 { 79 categoryName_ = categoryName; 80 } 81 SetCoverUri(const string coverUri)82void SmartAlbumAsset::SetCoverUri(const string coverUri) 83 { 84 coverUri_ = coverUri; 85 } 86 SetTypeMask(const string & typeMask)87void SmartAlbumAsset::SetTypeMask(const string &typeMask) 88 { 89 typeMask_ = typeMask; 90 } 91 SetAlbumPrivateType(const PrivateAlbumType albumPrivateType)92void SmartAlbumAsset::SetAlbumPrivateType(const PrivateAlbumType albumPrivateType) 93 { 94 albumPrivateType_ = albumPrivateType; 95 } 96 SetResultNapiType(const ResultNapiType type)97void SmartAlbumAsset::SetResultNapiType(const ResultNapiType type) 98 { 99 resultNapiType_ = type; 100 } 101 GetAlbumId() const102int32_t SmartAlbumAsset::GetAlbumId() const 103 { 104 return albumId_; 105 } 106 GetAlbumName() const107string SmartAlbumAsset::GetAlbumName() const 108 { 109 return albumName_; 110 } 111 GetAlbumUri() const112string SmartAlbumAsset::GetAlbumUri() const 113 { 114 return albumUri_; 115 } 116 GetAlbumTag() const117string SmartAlbumAsset::GetAlbumTag() const 118 { 119 return albumTag_; 120 } 121 GetAlbumCapacity() const122int32_t SmartAlbumAsset::GetAlbumCapacity() const 123 { 124 return albumCapacity_; 125 } 126 GetCategoryId() const127int32_t SmartAlbumAsset::GetCategoryId() const 128 { 129 return categoryId_; 130 } 131 GetAlbumDateModified() const132int64_t SmartAlbumAsset::GetAlbumDateModified() const 133 { 134 return albumDateModified_; 135 } 136 GetCategoryName() const137string SmartAlbumAsset::GetCategoryName() const 138 { 139 return categoryName_; 140 } 141 GetCoverUri() const142string SmartAlbumAsset::GetCoverUri() const 143 { 144 return coverUri_; 145 } 146 GetTypeMask() const147string SmartAlbumAsset::GetTypeMask() const 148 { 149 return typeMask_; 150 } 151 GetAlbumPrivateType() const152PrivateAlbumType SmartAlbumAsset::GetAlbumPrivateType() const 153 { 154 return albumPrivateType_; 155 } 156 GetResultNapiType() const157ResultNapiType SmartAlbumAsset::GetResultNapiType() const 158 { 159 return resultNapiType_; 160 } 161 } // namespace Media 162 } // namespace OHOS 163