1 /* 2 * Copyright (c) 2021-2023 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 NOTIFICATION_CONFIG_FILE_H 17 #define NOTIFICATION_CONFIG_FILE_H 18 19 #include <iostream> 20 #include <map> 21 22 namespace OHOS { 23 namespace Notification { 24 static enum ReminderModeFlag : unsigned int { 25 kRMFRing = 0x01, // Ring 26 kRMFLockScreen = 0x02, // LockScreen 27 kRMFHangUp = 0x04, // HangUp 28 kRMFLight = 0x08, // Light 29 kRMFVibration = 0x10, // Vibration 30 } ReminderModeFlag; 31 32 class NotificationConfigFile { 33 public: 34 NotificationConfigFile(); 35 NotificationConfigFile(const std::string &filePath); 36 ~NotificationConfigFile(); 37 38 private: 39 static int binaryToDecimal(const char *binaryString); 40 41 public: 42 static void getDefaultSlotFlagsMap(std::map<std::string, uint32_t> &slotFlagsMap); 43 static bool getNotificationSlotFlagConfig(std::string &filePath, 44 std::map<std::string, uint32_t> &slotFlagsMap); 45 static bool parseNotificationConfigCcmFile(std::string &filePath, 46 std::map<std::string, uint32_t> &slotFlagsMap); 47 }; 48 } // namespace Notification 49 } // namespace OHOS 50 51 #endif 52