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 RINGTONE_DEFAULT_SETTING_H
17 #define RINGTONE_DEFAULT_SETTING_H
18 
19 #include <memory>
20 #include <string>
21 
22 #include "rdb_store.h"
23 #include "result_set.h"
24 #include "ringtone_metadata.h"
25 #include "ringtone_setting_manager.h"
26 
27 namespace OHOS {
28 namespace Media {
29 #define EXPORT __attribute__ ((visibility ("default")))
30 class RingtoneDefaultSetting {
31 public:
32     EXPORT static std::unique_ptr<RingtoneDefaultSetting> GetObj(std::shared_ptr<NativeRdb::RdbStore> &rdb);
33     EXPORT RingtoneDefaultSetting(std::shared_ptr<NativeRdb::RdbStore> &rdb);
34     ~RingtoneDefaultSetting() = default;
35     EXPORT void Update();
36     EXPORT void UpdateDefaultSystemTone();
37 private:
38     EXPORT void ShotToneDefaultSettings();
39     EXPORT void NotificationToneDefaultSettings();
40     EXPORT void RingToneDefaultSettings();
41     EXPORT void AlarmToneDefaultSettings();
42     EXPORT std::string GetTonePathByDisplayName(std::string &name);
43 
44     std::unique_ptr<RingtoneSettingManager> settingMgr_ = nullptr;
45 };
46 } // namespace Media
47 } // namespace OHOS
48 
49 #endif // RINGTONE_DEFAULT_SETTING_H
50