1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.support.v4.app;
18 
19 import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP;
20 
21 import android.app.PendingIntent;
22 import android.os.Bundle;
23 import android.support.annotation.RestrictTo;
24 
25 /**
26  * @hide
27  */
28 @RestrictTo(LIBRARY_GROUP)
29 public class NotificationCompatBase {
30     public abstract static class Action {
getIcon()31         public abstract int getIcon();
getTitle()32         public abstract CharSequence getTitle();
getActionIntent()33         public abstract PendingIntent getActionIntent();
getExtras()34         public abstract Bundle getExtras();
getRemoteInputs()35         public abstract RemoteInputCompatBase.RemoteInput[] getRemoteInputs();
36         /** Returns RemoteInputs that ONLY accept data results, not text. */
getDataOnlyRemoteInputs()37         public abstract RemoteInputCompatBase.RemoteInput[] getDataOnlyRemoteInputs();
getAllowGeneratedReplies()38         public abstract boolean getAllowGeneratedReplies();
39 
40         public interface Factory {
build(int icon, CharSequence title, PendingIntent actionIntent, Bundle extras, RemoteInputCompatBase.RemoteInput[] remoteInputs, RemoteInputCompatBase.RemoteInput[] dataOnlyRemoteInputs, boolean allowGeneratedReplies)41             Action build(int icon, CharSequence title, PendingIntent actionIntent,
42                     Bundle extras, RemoteInputCompatBase.RemoteInput[] remoteInputs,
43                     RemoteInputCompatBase.RemoteInput[] dataOnlyRemoteInputs,
44                     boolean allowGeneratedReplies);
newArray(int length)45             Action[] newArray(int length);
46         }
47     }
48 
49     public abstract static class UnreadConversation {
getParticipants()50         abstract String[] getParticipants();
getParticipant()51         abstract String getParticipant();
getMessages()52         abstract String[] getMessages();
getRemoteInput()53         abstract RemoteInputCompatBase.RemoteInput getRemoteInput();
getReplyPendingIntent()54         abstract PendingIntent getReplyPendingIntent();
getReadPendingIntent()55         abstract PendingIntent getReadPendingIntent();
getLatestTimestamp()56         abstract long getLatestTimestamp();
57 
58         public interface Factory {
build(String[] messages, RemoteInputCompatBase.RemoteInput remoteInput, PendingIntent replyPendingIntent, PendingIntent readPendingIntent, String[] participants, long latestTimestamp)59             UnreadConversation build(String[] messages,
60                     RemoteInputCompatBase.RemoteInput remoteInput,
61                     PendingIntent replyPendingIntent, PendingIntent readPendingIntent,
62                     String[] participants, long latestTimestamp);
63         }
64     }
65 }
66