1 /* 2 * Copyright (C) 2024-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 OHOS_MEDIALIBRARY_ANALYSIS_ALBUM_OPERATIONS_H 17 #define OHOS_MEDIALIBRARY_ANALYSIS_ALBUM_OPERATIONS_H 18 19 #include <memory> 20 #include <mutex> 21 #include <securec.h> 22 #include <string> 23 24 #include "abs_shared_result_set.h" 25 #include "datashare_predicates.h" 26 #include "datashare_values_bucket.h" 27 #include "medialibrary_album_operations.h" 28 #include "medialibrary_command.h" 29 #include "medialibrary_async_worker.h" 30 #include "native_album_asset.h" 31 #include "rdb_predicates.h" 32 #include "rdb_result_set_bridge.h" 33 #include "vision_column.h" 34 35 namespace OHOS { 36 namespace Media { 37 #define EXPORT __attribute__ ((visibility ("default"))) 38 struct GroupPhotoAlbumInfo { 39 int32_t albumId; 40 std::string tagId; 41 std::string coverUri; 42 int32_t isCoverSatisfied; 43 int32_t count; 44 int32_t fileId; 45 std::string candidateUri; 46 int32_t isMe; 47 std::string albumName; 48 int32_t isRemoved; 49 int32_t renameOperation; 50 }; 51 class MediaLibraryAnalysisAlbumOperations { 52 public: 53 EXPORT static int32_t UpdateMergeGroupAlbumsInfo(const vector<MergeAlbumInfo> &mergeAlbumInfo); 54 EXPORT static int32_t HandleGroupPhotoAlbum(const OperationType &opType, const NativeRdb::ValuesBucket &values, 55 const DataShare::DataSharePredicates &predicates); 56 EXPORT static std::shared_ptr<NativeRdb::ResultSet> QueryGroupPhotoAlbum(MediaLibraryCommand &cmd, 57 const std::vector<std::string> &columns); 58 EXPORT static void UpdateGroupPhotoAlbumById(int32_t albumId); 59 EXPORT static void UpdatePortraitAlbumCoverSatisfied(int32_t fileId); 60 }; 61 } // namespace Media 62 } // namespace OHOS 63 #endif // OHOS_MEDIALIBRARY_ANALYSIS_ALBUM_OPERATIONS_H 64