• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-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 
17 #ifndef BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_NOTIFICATION_APP_PRIVILEGES_H
18 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_NOTIFICATION_APP_PRIVILEGES_H
19 
20 #include <string>
21 
22 namespace OHOS {
23 namespace Notification {
24 class NotificationAppPrivileges {
25 public:
26     NotificationAppPrivileges(const std::string &flagStr);
27     ~NotificationAppPrivileges() = default;
28 
29     bool IsLiveViewEnabled() const;
30     bool IsBannerEnabled() const;
31     bool IsReminderEnabled() const;
32     bool IsDistributedReplyEnabled() const;
33 
34 private:
35     static constexpr int32_t DISTRIBUTED_REPLY_SEQ = 4;
36     static constexpr int32_t REMINDER_ENABLED_SEQ = 2;
37     static constexpr int32_t BANNER_ENABLED_SEQ = 1;
38     static constexpr int32_t LIVE_VIEW_ENABLED_SEQ = 0;
39 
40     static constexpr char DISTRIBUTED_REPLY_ENABLE = '1';
41     static constexpr char REMINDER_ENABLE = '1';
42     static constexpr char BANNER_ENABLE = '1';
43     static constexpr char LIVE_VIEW_ENABLE = '1';
44 
45     uint32_t privileges_ = 0;
46 };
47 } // namespace Notification
48 } // namespace OHOS
49 
50 #endif  // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_NOTIFICATION_APP_PRIVILEGES_H
51