• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022-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/**
17 * @file The NotificationFlags module implements a NotificationFlags instance.
18 * @kit NotificationKit
19 */
20
21/**
22 * Enumerates the notification flag statuses.
23 *
24 * @enum { number }
25 * @syscap SystemCapability.Notification.Notification
26 * @systemapi
27 * @since 8
28 */
29/**
30 * Enumerates the notification flag statuses.
31 *
32 * @enum { number }
33 * @syscap SystemCapability.Notification.Notification
34 * @since arkts {'1.1':'11', '1.2':'20'}
35 * @arkts 1.1&1.2
36 */
37export enum NotificationFlagStatus {
38  /**
39   * The default flag is used. The effect is the same as that of TYPE_OPEN.
40   *
41   * @syscap SystemCapability.Notification.Notification
42   * @systemapi
43   * @since 8
44   */
45  /**
46   * The default flag is used. The effect is the same as that of TYPE_OPEN.
47   *
48   * @syscap SystemCapability.Notification.Notification
49   * @since arkts {'1.1':'11', '1.2':'20'}
50   * @arkts 1.1&1.2
51   */
52  TYPE_NONE = 0,
53
54  /**
55   * The notification flag is enabled.
56   *
57   * @syscap SystemCapability.Notification.Notification
58   * @systemapi
59   * @since 8
60   */
61  /**
62   * The notification flag is enabled.
63   *
64   * @syscap SystemCapability.Notification.Notification
65   * @since arkts {'1.1':'11', '1.2':'20'}
66   * @arkts 1.1&1.2
67   */
68  TYPE_OPEN = 1,
69
70  /**
71   * The notification flag is disabled.
72   *
73   * @syscap SystemCapability.Notification.Notification
74   * @systemapi
75   * @since 8
76   */
77  /**
78   * The notification flag is disabled.
79   *
80   * @syscap SystemCapability.Notification.Notification
81   * @since arkts {'1.1':'11', '1.2':'20'}
82   * @arkts 1.1&1.2
83   */
84  TYPE_CLOSE = 2
85}
86
87/**
88 * Describes a NotificationFlags instance.
89 *
90 * @typedef NotificationFlags
91 * @syscap SystemCapability.Notification.Notification
92 * @since arkts {'1.1':'8', '1.2':'20'}
93 * @arkts 1.1&1.2
94 */
95export interface NotificationFlags {
96  /**
97   * Whether to enable sound reminder.
98   *
99   * @type { ?NotificationFlagStatus }
100   * @readonly
101   * @syscap SystemCapability.Notification.Notification
102   * @since arkts {'1.1':'8', '1.2':'20'}
103   * @arkts 1.1&1.2
104   */
105  readonly soundEnabled?: NotificationFlagStatus;
106
107  /**
108   * Whether to enable vibration reminder.
109   *
110   * @type { ?NotificationFlagStatus }
111   * @readonly
112   * @syscap SystemCapability.Notification.Notification
113   * @since arkts {'1.1':'8', '1.2':'20'}
114   * @arkts 1.1&1.2
115   */
116  readonly vibrationEnabled?: NotificationFlagStatus;
117
118  /**
119   * Read-only the prompt entry information allowed by the current channel.
120   *
121   * @type { ?number }
122   * @readonly
123   * @syscap SystemCapability.Notification.Notification
124   * @systemapi
125   * @since arkts {'1.1':'11', '1.2':'20'}
126   * @arkts 1.1&1.2
127   */
128  readonly reminderFlags?: number;
129}
130