1 /* 2 * Copyright (C) 2023 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 MEDIALIBRARY_AUDIO_OPERATIONS_H 17 #define MEDIALIBRARY_AUDIO_OPERATIONS_H 18 19 #include <memory> 20 #include <string> 21 #include <vector> 22 23 #include "abs_shared_result_set.h" 24 #include "medialibrary_asset_operations.h" 25 #include "medialibrary_command.h" 26 27 28 namespace OHOS { 29 namespace Media { 30 class MediaLibraryAudioOperations : public MediaLibraryAssetOperations { 31 public: 32 static int32_t Create(MediaLibraryCommand &cmd); 33 static std::shared_ptr<NativeRdb::ResultSet> Query(MediaLibraryCommand &cmd, 34 const std::vector<std::string> &columns); 35 static int32_t Update(MediaLibraryCommand &cmd); 36 static int32_t Delete(MediaLibraryCommand &cmd); 37 static int32_t Open(MediaLibraryCommand &cmd, const std::string &mode); 38 static int32_t Close(MediaLibraryCommand &cmd); 39 static int32_t TrashAging(); 40 41 private: 42 static int32_t CreateV9(MediaLibraryCommand &cmd); 43 static int32_t CreateV10(MediaLibraryCommand &cmd); 44 static int32_t DeleteAudio(const std::shared_ptr<FileAsset> &fileAsset, MediaLibraryApi api); 45 static int32_t UpdateV9(MediaLibraryCommand &cmd); 46 static int32_t UpdateV10(MediaLibraryCommand &cmd); 47 }; 48 49 } // namespace Media 50 } // namespace OHOS 51 52 #endif // MEDIALIBRARY_AUDIO_OPERATIONS_H