1 /* 2 * Copyright (c) 2025-2025 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 CAMERA_DATASHARE_HELPER_H 17 #define CAMERA_DATASHARE_HELPER_H 18 19 #include "datashare_helper.h" 20 21 namespace OHOS { 22 namespace CameraStandard { 23 static const std::string SETTINGS_DATA_BASE_URI = 24 "datashare:///com.ohos.settingsdata/entry/settingsdata/SETTINGSDATA?Proxy=true"; 25 static const std::string SETTINGS_DATA_EXT_URI = "datashare:///com.ohos.settingsdata.DataAbility"; 26 static const std::string SETTINGS_DATA_FIELD_KEYWORD = "KEYWORD"; 27 static const std::string SETTINGS_DATA_FIELD_VALUE = "VALUE"; 28 static const std::string PREDICATES_STRING = "settings.camera.mute_persist"; 29 static const std::string CONTROL_CENTER_DATA = "settings.camera.control_center"; 30 #ifdef NOTIFICATION_ENABLE 31 static const std::string PREDICATES_CAMERA_BEAUTY_STATUS = "settings.camera.beauty_status"; 32 static const std::string PREDICATES_CAMERA_BEAUTY_TIMES = "settings.camera.beauty_times"; 33 #endif 34 class CameraDataShareHelper : public RefBase { 35 public: 36 CameraDataShareHelper() = default; 37 ~CameraDataShareHelper() = default; 38 int32_t QueryOnce(const std::string key, std::string &value); 39 int32_t UpdateOnce(const std::string key, std::string value); 40 bool IsDataShareReady(); 41 private: 42 bool isDataShareReady_ = false; 43 std::shared_ptr<DataShare::DataShareHelper> CreateCameraDataShareHelper(); 44 }; 45 } // namespace CameraStandard 46 } // namespace OHOS 47 #endif // CAMERA_DATASHARE_HELPER_H 48