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 givenName
, String familyName
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
106 ) throws Error
.Failure
;
109 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
110 ) throws Error
.Failure
;
114 void setPin(String registrationLockPin
);
118 List
<String
> listNumbers();
120 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
122 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidGroupId
;
124 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
126 boolean isGroupBlocked(final byte[] groupId
) throws Error
.InvalidGroupId
;
128 boolean isMember(final byte[] groupId
) throws Error
.InvalidGroupId
;
130 byte[] joinGroup(final String groupLink
) throws Error
.Failure
;
132 String
uploadStickerPack(String stickerPackPath
) throws Error
.Failure
;
134 class MessageReceived
extends DBusSignal
{
136 private final long timestamp
;
137 private final String sender
;
138 private final byte[] groupId
;
139 private final String message
;
140 private final List
<String
> attachments
;
142 public MessageReceived(
148 List
<String
> attachments
149 ) throws DBusException
{
150 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
151 this.timestamp
= timestamp
;
152 this.sender
= sender
;
153 this.groupId
= groupId
;
154 this.message
= message
;
155 this.attachments
= attachments
;
158 public long getTimestamp() {
162 public String
getSender() {
166 public byte[] getGroupId() {
170 public String
getMessage() {
174 public List
<String
> getAttachments() {
179 class ReceiptReceived
extends DBusSignal
{
181 private final long timestamp
;
182 private final String sender
;
184 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
185 super(objectpath
, timestamp
, sender
);
186 this.timestamp
= timestamp
;
187 this.sender
= sender
;
190 public long getTimestamp() {
194 public String
getSender() {
199 class SyncMessageReceived
extends DBusSignal
{
201 private final long timestamp
;
202 private final String source
;
203 private final String destination
;
204 private final byte[] groupId
;
205 private final String message
;
206 private final List
<String
> attachments
;
208 public SyncMessageReceived(
215 List
<String
> attachments
216 ) throws DBusException
{
217 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
218 this.timestamp
= timestamp
;
219 this.source
= source
;
220 this.destination
= destination
;
221 this.groupId
= groupId
;
222 this.message
= message
;
223 this.attachments
= attachments
;
226 public long getTimestamp() {
230 public String
getSource() {
234 public String
getDestination() {
238 public byte[] getGroupId() {
242 public String
getMessage() {
246 public List
<String
> getAttachments() {
253 class AttachmentInvalid
extends DBusExecutionException
{
255 public AttachmentInvalid(final String message
) {
260 class InvalidUri
extends DBusExecutionException
{
262 public InvalidUri(final String message
) {
267 class Failure
extends DBusExecutionException
{
269 public Failure(final String message
) {
274 class GroupNotFound
extends DBusExecutionException
{
276 public GroupNotFound(final String message
) {
281 class InvalidGroupId
extends DBusExecutionException
{
283 public InvalidGroupId(final String message
) {
288 class InvalidNumber
extends DBusExecutionException
{
290 public InvalidNumber(final String message
) {
295 class UntrustedIdentity
extends DBusExecutionException
{
297 public UntrustedIdentity(final String message
) {