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() throws Error
.Failure
, Error
.InvalidNumber
;
92 boolean isRegistered(String number
) throws Error
.Failure
, Error
.InvalidNumber
;
94 List
<Boolean
> isRegistered(List
<String
> numbers
) throws Error
.Failure
, Error
.InvalidNumber
;
96 void addDevice(String uri
) throws Error
.InvalidUri
;
98 void removeDevice(int deviceId
) throws Error
.Failure
;
100 List
<String
> listDevices() throws Error
.Failure
;
102 void updateDeviceName(String deviceName
) throws Error
.Failure
;
105 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
106 ) throws Error
.Failure
;
110 void setPin(String registrationLockPin
);
114 List
<String
> listNumbers();
116 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
118 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidGroupId
;
120 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
122 boolean isGroupBlocked(final byte[] groupId
) throws Error
.InvalidGroupId
;
124 boolean isMember(final byte[] groupId
) throws Error
.InvalidGroupId
;
126 byte[] joinGroup(final String groupLink
) throws Error
.Failure
;
128 String
uploadStickerPack(String stickerPackPath
) throws Error
.Failure
;
130 class MessageReceived
extends DBusSignal
{
132 private final long timestamp
;
133 private final String sender
;
134 private final byte[] groupId
;
135 private final String message
;
136 private final List
<String
> attachments
;
138 public MessageReceived(
144 List
<String
> attachments
145 ) throws DBusException
{
146 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
147 this.timestamp
= timestamp
;
148 this.sender
= sender
;
149 this.groupId
= groupId
;
150 this.message
= message
;
151 this.attachments
= attachments
;
154 public long getTimestamp() {
158 public String
getSender() {
162 public byte[] getGroupId() {
166 public String
getMessage() {
170 public List
<String
> getAttachments() {
175 class ReceiptReceived
extends DBusSignal
{
177 private final long timestamp
;
178 private final String sender
;
180 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
181 super(objectpath
, timestamp
, sender
);
182 this.timestamp
= timestamp
;
183 this.sender
= sender
;
186 public long getTimestamp() {
190 public String
getSender() {
195 class SyncMessageReceived
extends DBusSignal
{
197 private final long timestamp
;
198 private final String source
;
199 private final String destination
;
200 private final byte[] groupId
;
201 private final String message
;
202 private final List
<String
> attachments
;
204 public SyncMessageReceived(
211 List
<String
> attachments
212 ) throws DBusException
{
213 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
214 this.timestamp
= timestamp
;
215 this.source
= source
;
216 this.destination
= destination
;
217 this.groupId
= groupId
;
218 this.message
= message
;
219 this.attachments
= attachments
;
222 public long getTimestamp() {
226 public String
getSource() {
230 public String
getDestination() {
234 public byte[] getGroupId() {
238 public String
getMessage() {
242 public List
<String
> getAttachments() {
249 class AttachmentInvalid
extends DBusExecutionException
{
251 public AttachmentInvalid(final String message
) {
256 class InvalidUri
extends DBusExecutionException
{
258 public InvalidUri(final String message
) {
263 class Failure
extends DBusExecutionException
{
265 public Failure(final String message
) {
270 class GroupNotFound
extends DBusExecutionException
{
272 public GroupNotFound(final String message
) {
277 class InvalidGroupId
extends DBusExecutionException
{
279 public InvalidGroupId(final String message
) {
284 class InvalidNumber
extends DBusExecutionException
{
286 public InvalidNumber(final String message
) {
291 class UntrustedIdentity
extends DBusExecutionException
{
293 public UntrustedIdentity(final String message
) {