3 import org
.freedesktop
.dbus
.exceptions
.DBusException
;
4 import org
.freedesktop
.dbus
.exceptions
.DBusExecutionException
;
5 import org
.freedesktop
.dbus
.interfaces
.DBusInterface
;
6 import org
.freedesktop
.dbus
.messages
.DBusSignal
;
11 * DBus interface for the org.asamk.Signal service.
12 * Including emitted Signals and returned Errors.
14 public interface Signal
extends DBusInterface
{
17 String message
, List
<String
> attachments
, String recipient
18 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
21 String message
, List
<String
> attachments
, List
<String
> recipients
22 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
25 String recipient
, boolean stop
26 ) throws Error
.Failure
, Error
.GroupNotFound
, Error
.UntrustedIdentity
;
29 String recipient
, List
<Long
> targetSentTimestamp
30 ) throws Error
.Failure
, Error
.UntrustedIdentity
;
32 long sendRemoteDeleteMessage(
33 long targetSentTimestamp
, String recipient
34 ) throws Error
.Failure
, Error
.InvalidNumber
;
36 long sendRemoteDeleteMessage(
37 long targetSentTimestamp
, List
<String
> recipients
38 ) throws Error
.Failure
, Error
.InvalidNumber
;
40 long sendGroupRemoteDeleteMessage(
41 long targetSentTimestamp
, byte[] groupId
42 ) throws Error
.Failure
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
44 long sendMessageReaction(
45 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, String recipient
46 ) throws Error
.InvalidNumber
, Error
.Failure
;
48 long sendMessageReaction(
49 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, List
<String
> recipients
50 ) throws Error
.InvalidNumber
, Error
.Failure
;
52 void sendContacts() throws Error
.Failure
;
54 void sendSyncRequest() throws Error
.Failure
;
56 long sendNoteToSelfMessage(
57 String message
, List
<String
> attachments
58 ) throws Error
.AttachmentInvalid
, Error
.Failure
;
60 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
62 long sendGroupMessage(
63 String message
, List
<String
> attachments
, byte[] groupId
64 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
, Error
.InvalidGroupId
;
66 long sendGroupMessageReaction(
67 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, byte[] groupId
68 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidNumber
, Error
.InvalidGroupId
;
70 String
getContactName(String number
) throws Error
.InvalidNumber
;
72 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
74 void setExpirationTimer(final String number
, final int expiration
) throws Error
.Failure
;
76 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
78 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
, Error
.InvalidGroupId
;
80 List
<byte[]> getGroupIds();
82 String
getGroupName(byte[] groupId
) throws Error
.InvalidGroupId
;
84 List
<String
> getGroupMembers(byte[] groupId
) throws Error
.InvalidGroupId
;
87 byte[] groupId
, String name
, List
<String
> members
, String avatar
88 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
90 boolean isRegistered();
92 void addDevice(String uri
) throws Error
.InvalidUri
;
94 void removeDevice(int deviceId
) throws Error
.Failure
;
96 List
<String
> listDevices() throws Error
.Failure
;
98 void updateDeviceName(String deviceName
) throws Error
.Failure
;
101 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
102 ) throws Error
.Failure
;
106 void setPin(String registrationLockPin
);
110 List
<String
> listNumbers();
112 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
114 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidGroupId
;
116 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
118 boolean isGroupBlocked(final byte[] groupId
) throws Error
.InvalidGroupId
;
120 boolean isMember(final byte[] groupId
) throws Error
.InvalidGroupId
;
122 byte[] joinGroup(final String groupLink
) throws Error
.Failure
;
124 String
uploadStickerPack(String stickerPackPath
) throws Error
.Failure
;
126 class MessageReceived
extends DBusSignal
{
128 private final long timestamp
;
129 private final String sender
;
130 private final byte[] groupId
;
131 private final String message
;
132 private final List
<String
> attachments
;
134 public MessageReceived(
140 List
<String
> attachments
141 ) throws DBusException
{
142 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
143 this.timestamp
= timestamp
;
144 this.sender
= sender
;
145 this.groupId
= groupId
;
146 this.message
= message
;
147 this.attachments
= attachments
;
150 public long getTimestamp() {
154 public String
getSender() {
158 public byte[] getGroupId() {
162 public String
getMessage() {
166 public List
<String
> getAttachments() {
171 class ReceiptReceived
extends DBusSignal
{
173 private final long timestamp
;
174 private final String sender
;
176 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
177 super(objectpath
, timestamp
, sender
);
178 this.timestamp
= timestamp
;
179 this.sender
= sender
;
182 public long getTimestamp() {
186 public String
getSender() {
191 class SyncMessageReceived
extends DBusSignal
{
193 private final long timestamp
;
194 private final String source
;
195 private final String destination
;
196 private final byte[] groupId
;
197 private final String message
;
198 private final List
<String
> attachments
;
200 public SyncMessageReceived(
207 List
<String
> attachments
208 ) throws DBusException
{
209 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
210 this.timestamp
= timestamp
;
211 this.source
= source
;
212 this.destination
= destination
;
213 this.groupId
= groupId
;
214 this.message
= message
;
215 this.attachments
= attachments
;
218 public long getTimestamp() {
222 public String
getSource() {
226 public String
getDestination() {
230 public byte[] getGroupId() {
234 public String
getMessage() {
238 public List
<String
> getAttachments() {
245 class AttachmentInvalid
extends DBusExecutionException
{
247 public AttachmentInvalid(final String message
) {
252 class InvalidUri
extends DBusExecutionException
{
254 public InvalidUri(final String message
) {
259 class Failure
extends DBusExecutionException
{
261 public Failure(final String message
) {
266 class GroupNotFound
extends DBusExecutionException
{
268 public GroupNotFound(final String message
) {
273 class InvalidGroupId
extends DBusExecutionException
{
275 public InvalidGroupId(final String message
) {
280 class InvalidNumber
extends DBusExecutionException
{
282 public InvalidNumber(final String message
) {
287 class UntrustedIdentity
extends DBusExecutionException
{
289 public UntrustedIdentity(final String message
) {