• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 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
16import notification from '../@ohos.notification';
17import image from '../@ohos.multimedia.image';
18/**
19 * Describes a normal text notification.
20 *
21 * @name NotificationBasicContent
22 * @since 7
23 * @syscap SystemCapability.Notification.Notification
24 * @permission N/A
25 */
26export interface NotificationBasicContent {
27  /**
28   * Title of the normal text notification.
29   */
30  title: string;
31
32  /**
33   * Content of the normal text notification.
34   */
35  text: string;
36
37  /**
38   * Additional information of the normal text notification.
39   */
40  additionalText?: string;
41}
42
43/**
44 * Describes a long text notification.
45 *
46 * @name NotificationLongTextContent
47 * @since 7
48 * @syscap SystemCapability.Notification.Notification
49 * @permission N/A
50 */
51export interface NotificationLongTextContent extends NotificationBasicContent {
52  /**
53   * Long text content of the notification.
54   */
55  longText: string;
56
57  /**
58   * Brief text of the long text notification.
59   */
60  briefText: string;
61
62  /**
63   * Title that will be displayed for the long text notification when it is expanded.
64   */
65  expandedTitle: string;
66}
67
68/**
69 * Describes a multi-line text notification.
70 *
71 * @name NotificationMultiLineContent
72 * @since 7
73 * @syscap SystemCapability.Notification.Notification
74 * @permission N/A
75 */
76export interface NotificationMultiLineContent extends NotificationBasicContent {
77  /**
78   * Brief text of the multi-line text notification.
79   */
80  briefText: string;
81
82  /**
83   * Brief text of the multi-line text notification.
84   */
85  longTitle: string;
86
87  /**
88   * Multi-line content of the multi-line text notification.
89   */
90  lines: Array<string>;
91}
92
93/**
94 * Describes a picture-attached notification.
95 *
96 * @name NotificationPictureContent
97 * @since 7
98 * @syscap SystemCapability.Notification.Notification
99 * @permission N/A
100 */
101export interface NotificationPictureContent extends NotificationBasicContent {
102  /**
103   * Multi-line content of the multi-line text notification.
104   */
105  briefText: string;
106
107  /**
108   * Title that will be displayed for the picture-attached notification when it is expanded.
109   */
110  expandedTitle: string;
111
112  /**
113   * Picture to be included in a notification.
114   */
115  picture: image.PixelMap;
116}
117
118/**
119 * Describes notification types.
120 *
121 * @name NotificationContent
122 * @since 7
123 * @syscap SystemCapability.Notification.Notification
124 * @permission N/A
125 */
126export interface NotificationContent {
127  /**
128   * Notification content type.
129   */
130  contentType: notification.ContentType;
131
132  /**
133   * Normal text notification.
134   */
135  normal?: NotificationBasicContent;
136
137  /**
138   * Long text notification.
139   */
140  longText?: NotificationLongTextContent;
141
142  /**
143   * Multi-line text notification.
144   */
145  multiLine?: NotificationMultiLineContent;
146
147  /**
148   * Picture-attached notification.
149   */
150  picture?: NotificationPictureContent;
151}
152