• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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_FILE_OPERATIONS_H
17 #define OHOS_MEDIALIBRARY_FILE_OPERATIONS_H
18 
19 #include <string>
20 
21 #include "file_asset.h"
22 #include "media_data_ability_const.h"
23 #include "medialibrary_data_ability_utils.h"
24 #include "medialibrary_file_db.h"
25 #include "imedia_scanner_client.h"
26 #include "native_album_asset.h"
27 #include "rdb_store.h"
28 #include "values_bucket.h"
29 #include "value_object.h"
30 #include "medialibrary_thumbnail.h"
31 
32 namespace OHOS {
33 namespace Media {
34 class MediaLibraryFileOperations {
35 public:
36     int32_t HandleCreateAsset(const NativeRdb::ValuesBucket &values,
37                               const std::shared_ptr<NativeRdb::RdbStore> &rdbStore);
38     int32_t HandleCloseAsset(std::string &actualUri, std::string &srcPath, const NativeRdb::ValuesBucket &values,
39                              const std::shared_ptr<NativeRdb::RdbStore> &rdbStore);
40     int32_t HandleGetAlbumCapacity(const NativeRdb::ValuesBucket &values,
41                                 const std::shared_ptr<RdbStore> &rdbStore);
42     int32_t HandleFileOperation(const std::string &oprn, const NativeRdb::ValuesBucket &values,
43                                 const std::shared_ptr<NativeRdb::RdbStore> &rdbStore,
44                                 const std::shared_ptr<MediaLibraryThumbnail> &mediaThumbnail);
45     int32_t HandleModifyAsset(const std::string &rowNum, const std::string &srcPath,
46                               const NativeRdb::ValuesBucket &values,
47                               const std::shared_ptr<NativeRdb::RdbStore> &rdbStore);
48     int32_t HandleDeleteAsset(const std::string &rowNum, const std::string &srcPath,
49                               const std::shared_ptr<NativeRdb::RdbStore> &rdbStore);
50     int32_t HandleIsDirectoryAsset(const NativeRdb::ValuesBucket &values,
51                                    const std::shared_ptr<NativeRdb::RdbStore> &rdbStore);
52     NativeRdb::ValuesBucket UpdateBasicAssetDetails(int32_t mediaType,
53                                                     const std::string &fileName,
54                                                     const std::string &relPath,
55                                                     const std::string &path);
56 };
57 } // namespace Media
58 } // namespace OHOS
59 #endif // OHOS_MEDIALIBRARY_FILE_OPERATIONS_H