1 /*
2  * Copyright (C) 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 FRAMEWORKS_SERVICES_MEDIA_MULTI_STAGES_CAPTURE_DEFERRED_PHOTO_PROC_ADAPTER_H
17 #define FRAMEWORKS_SERVICES_MEDIA_MULTI_STAGES_CAPTURE_DEFERRED_PHOTO_PROC_ADAPTER_H
18 
19 #include <string>
20 
21 #ifdef ABILITY_CAMERA_SUPPORT
22 #include "deferred_proc_session/deferred_photo_proc_session.h"
23 #endif
24 
25 namespace OHOS {
26 namespace Media {
27 #define EXPORT __attribute__ ((visibility ("default")))
28 #ifdef ABILITY_CAMERA_SUPPORT
29 class DeferredPhotoProcessingAdapter : public RefBase {
30 #else
31 class DeferredPhotoProcessingAdapter {
32 #endif
33 public:
34     EXPORT DeferredPhotoProcessingAdapter();
35     EXPORT virtual ~DeferredPhotoProcessingAdapter();
36 
37     EXPORT virtual void BeginSynchronize();
38     EXPORT virtual void EndSynchronize();
39 #ifdef ABILITY_CAMERA_SUPPORT
40     void AddImage(const std::string &imageId,
41         CameraStandard::DpsMetadata &metadata, const bool isTrashed = false);
42 #endif
43     EXPORT virtual void RemoveImage(const std::string &imageId, const bool isRestorable = true);
44     EXPORT void RestoreImage(const std::string &imageId);
45     EXPORT void ProcessImage(const std::string &appName, const std::string &imageId);
46     EXPORT bool CancelProcessImage(const std::string &imageId);
47 private:
48 #ifdef ABILITY_CAMERA_SUPPORT
49     sptr<CameraStandard::DeferredPhotoProcSession> deferredPhotoProcSession_;
50 #endif
51 };
52 } // namespace Media
53 } // namespace OHOS
54 #endif // FRAMEWORKS_SERVICES_MEDIA_MULTI_STAGES_CAPTURE_DEFERRED_PHOTO_PROC_ADAPTER_H