3 import org
.freedesktop
.dbus
.DBusPath
;
4 import org
.freedesktop
.dbus
.annotations
.DBusProperty
;
5 import org
.freedesktop
.dbus
.exceptions
.DBusException
;
6 import org
.freedesktop
.dbus
.exceptions
.DBusExecutionException
;
7 import org
.freedesktop
.dbus
.interfaces
.DBusInterface
;
8 import org
.freedesktop
.dbus
.interfaces
.Properties
;
9 import org
.freedesktop
.dbus
.messages
.DBusSignal
;
11 import java
.util
.List
;
14 * DBus interface for the org.asamk.Signal service.
15 * Including emitted Signals and returned Errors.
17 public interface Signal
extends DBusInterface
{
19 String
getSelfNumber();
22 String message
, List
<String
> attachments
, String recipient
23 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
26 String message
, List
<String
> attachments
, List
<String
> recipients
27 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
30 String recipient
, boolean stop
31 ) throws Error
.Failure
, Error
.GroupNotFound
, Error
.UntrustedIdentity
;
34 String recipient
, List
<Long
> messageIds
35 ) throws Error
.Failure
, Error
.UntrustedIdentity
;
37 void sendViewedReceipt(
38 String recipient
, List
<Long
> messageIds
39 ) throws Error
.Failure
, Error
.UntrustedIdentity
;
41 long sendRemoteDeleteMessage(
42 long targetSentTimestamp
, String recipient
43 ) throws Error
.Failure
, Error
.InvalidNumber
;
45 long sendRemoteDeleteMessage(
46 long targetSentTimestamp
, List
<String
> recipients
47 ) throws Error
.Failure
, Error
.InvalidNumber
;
49 long sendGroupRemoteDeleteMessage(
50 long targetSentTimestamp
, byte[] groupId
51 ) throws Error
.Failure
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
53 long sendMessageReaction(
54 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, String recipient
55 ) throws Error
.InvalidNumber
, Error
.Failure
;
57 long sendMessageReaction(
58 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, List
<String
> recipients
59 ) throws Error
.InvalidNumber
, Error
.Failure
;
61 void sendContacts() throws Error
.Failure
;
63 void sendSyncRequest() throws Error
.Failure
;
65 long sendNoteToSelfMessage(
66 String message
, List
<String
> attachments
67 ) throws Error
.AttachmentInvalid
, Error
.Failure
;
69 void sendEndSessionMessage(List
<String
> recipients
) throws Error
.Failure
, Error
.InvalidNumber
, Error
.UntrustedIdentity
;
71 long sendGroupMessage(
72 String message
, List
<String
> attachments
, byte[] groupId
73 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.AttachmentInvalid
, Error
.InvalidGroupId
;
75 long sendGroupMessageReaction(
76 String emoji
, boolean remove
, String targetAuthor
, long targetSentTimestamp
, byte[] groupId
77 ) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidNumber
, Error
.InvalidGroupId
;
79 String
getContactName(String number
) throws Error
.InvalidNumber
;
81 void setContactName(String number
, String name
) throws Error
.InvalidNumber
;
83 void setExpirationTimer(final String number
, final int expiration
) throws Error
.Failure
;
85 void setContactBlocked(String number
, boolean blocked
) throws Error
.InvalidNumber
;
87 void setGroupBlocked(byte[] groupId
, boolean blocked
) throws Error
.GroupNotFound
, Error
.InvalidGroupId
;
89 List
<byte[]> getGroupIds();
91 String
getGroupName(byte[] groupId
) throws Error
.InvalidGroupId
;
93 List
<String
> getGroupMembers(byte[] groupId
) throws Error
.InvalidGroupId
;
96 byte[] groupId
, String name
, List
<String
> members
, String avatar
97 ) throws Error
.AttachmentInvalid
, Error
.Failure
, Error
.InvalidNumber
, Error
.GroupNotFound
, Error
.InvalidGroupId
;
99 boolean isRegistered() throws Error
.Failure
, Error
.InvalidNumber
;
101 boolean isRegistered(String number
) throws Error
.Failure
, Error
.InvalidNumber
;
103 List
<Boolean
> isRegistered(List
<String
> numbers
) throws Error
.Failure
, Error
.InvalidNumber
;
105 void addDevice(String uri
) throws Error
.InvalidUri
;
107 DBusPath
getDevice(long deviceId
);
109 List
<DBusPath
> listDevices() throws Error
.Failure
;
111 DBusPath
getThisDevice();
120 ) throws Error
.Failure
;
123 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
124 ) throws Error
.Failure
;
128 void setPin(String registrationLockPin
);
132 List
<String
> listNumbers();
134 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
136 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidGroupId
;
138 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
140 boolean isGroupBlocked(final byte[] groupId
) throws Error
.InvalidGroupId
;
142 boolean isMember(final byte[] groupId
) throws Error
.InvalidGroupId
;
144 byte[] joinGroup(final String groupLink
) throws Error
.Failure
;
146 String
uploadStickerPack(String stickerPackPath
) throws Error
.Failure
;
148 class MessageReceived
extends DBusSignal
{
150 private final long timestamp
;
151 private final String sender
;
152 private final byte[] groupId
;
153 private final String message
;
154 private final List
<String
> attachments
;
156 public MessageReceived(
162 List
<String
> attachments
163 ) throws DBusException
{
164 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
165 this.timestamp
= timestamp
;
166 this.sender
= sender
;
167 this.groupId
= groupId
;
168 this.message
= message
;
169 this.attachments
= attachments
;
172 public long getTimestamp() {
176 public String
getSender() {
180 public byte[] getGroupId() {
184 public String
getMessage() {
188 public List
<String
> getAttachments() {
193 class ReceiptReceived
extends DBusSignal
{
195 private final long timestamp
;
196 private final String sender
;
198 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
199 super(objectpath
, timestamp
, sender
);
200 this.timestamp
= timestamp
;
201 this.sender
= sender
;
204 public long getTimestamp() {
208 public String
getSender() {
213 class SyncMessageReceived
extends DBusSignal
{
215 private final long timestamp
;
216 private final String source
;
217 private final String destination
;
218 private final byte[] groupId
;
219 private final String message
;
220 private final List
<String
> attachments
;
222 public SyncMessageReceived(
229 List
<String
> attachments
230 ) throws DBusException
{
231 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
232 this.timestamp
= timestamp
;
233 this.source
= source
;
234 this.destination
= destination
;
235 this.groupId
= groupId
;
236 this.message
= message
;
237 this.attachments
= attachments
;
240 public long getTimestamp() {
244 public String
getSource() {
248 public String
getDestination() {
252 public byte[] getGroupId() {
256 public String
getMessage() {
260 public List
<String
> getAttachments() {
265 @DBusProperty(name
= "Id", type
= Integer
.class, access
= DBusProperty
.Access
.READ
)
266 @DBusProperty(name
= "Name", type
= String
.class)
267 @DBusProperty(name
= "Created", type
= String
.class, access
= DBusProperty
.Access
.READ
)
268 @DBusProperty(name
= "LastSeen", type
= String
.class, access
= DBusProperty
.Access
.READ
)
269 interface Device
extends DBusInterface
, Properties
{
271 void removeDevice() throws Error
.Failure
;
276 class AttachmentInvalid
extends DBusExecutionException
{
278 public AttachmentInvalid(final String message
) {
283 class InvalidUri
extends DBusExecutionException
{
285 public InvalidUri(final String message
) {
290 class Failure
extends DBusExecutionException
{
292 public Failure(final String message
) {
297 class GroupNotFound
extends DBusExecutionException
{
299 public GroupNotFound(final String message
) {
304 class InvalidGroupId
extends DBusExecutionException
{
306 public InvalidGroupId(final String message
) {
311 class InvalidNumber
extends DBusExecutionException
{
313 public InvalidNumber(final String message
) {
318 class UntrustedIdentity
extends DBusExecutionException
{
320 public UntrustedIdentity(final String message
) {