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 SIMCARD_SETTING_ASSET_H 17 #define SIMCARD_SETTING_ASSET_H 18 19 #include <mutex> 20 #include <string> 21 22 namespace OHOS { 23 namespace Media { 24 #define EXPORT __attribute__ ((visibility ("default"))) 25 26 class SimcardSettingAsset { 27 public: 28 EXPORT SimcardSettingAsset(); 29 EXPORT virtual ~SimcardSettingAsset() = default; 30 31 EXPORT int32_t GetMode() const; 32 EXPORT void SetMode(int32_t mode); 33 34 EXPORT int32_t GetVibrateMode() const; 35 EXPORT void SetVibrateMode(int32_t mode); 36 37 EXPORT const std::string &GetToneFile() const; 38 EXPORT void SetToneFile(const std::string &path); 39 40 EXPORT const std::string &GetVibrateFile() const; 41 EXPORT void SetVibrateFile(const std::string &path); 42 43 EXPORT int32_t GetRingtoneType() const; 44 EXPORT void SetRingtoneType(int32_t mode); 45 46 EXPORT int32_t GetRingMode() const; 47 EXPORT void SetRingMode(int32_t mode); 48 49 EXPORT std::unordered_map<std::string, std::variant<int32_t, int64_t, std::string, double>> &GetMemberMap(); 50 51 private: 52 int32_t GetInt32Member(const std::string &name) const; 53 const std::string &GetStrMember(const std::string &name) const; 54 55 std::unordered_map<std::string, std::variant<int32_t, int64_t, std::string, double>> member_; 56 }; 57 } // namespace Media 58 } // namespace OHOS 59 60 #endif // SIMCARD_SETTING_ASSET_H 61