• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifdef NOTIFICATION_ENABLE
30 static const std::string PREDICATES_CAMERA_BEAUTY_STATUS = "settings.camera.beauty_status";
31 static const std::string PREDICATES_CAMERA_BEAUTY_TIMES = "settings.camera.beauty_times";
32 #endif
33 class CameraDataShareHelper : public RefBase {
34 public:
35     CameraDataShareHelper() = default;
36     ~CameraDataShareHelper() = default;
37     int32_t QueryOnce(const std::string key, std::string &value);
38     int32_t UpdateOnce(const std::string key, std::string value);
39     bool IsDataShareReady();
40 private:
41     bool isDataShareReady_ = false;
42     std::shared_ptr<DataShare::DataShareHelper> CreateCameraDataShareHelper();
43 };
44 } // namespace CameraStandard
45 } // namespace OHOS
46 #endif // CAMERA_DATASHARE_HELPER_H
47