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
;
111 ) throws Error
.Failure
;
114 String name
, String about
, String aboutEmoji
, String avatarPath
, boolean removeAvatar
115 ) throws Error
.Failure
;
119 void setPin(String registrationLockPin
);
123 List
<String
> listNumbers();
125 List
<String
> getContactNumber(final String name
) throws Error
.Failure
;
127 void quitGroup(final byte[] groupId
) throws Error
.GroupNotFound
, Error
.Failure
, Error
.InvalidGroupId
;
129 boolean isContactBlocked(final String number
) throws Error
.InvalidNumber
;
131 boolean isGroupBlocked(final byte[] groupId
) throws Error
.InvalidGroupId
;
133 boolean isMember(final byte[] groupId
) throws Error
.InvalidGroupId
;
135 byte[] joinGroup(final String groupLink
) throws Error
.Failure
;
137 String
uploadStickerPack(String stickerPackPath
) throws Error
.Failure
;
139 class MessageReceived
extends DBusSignal
{
141 private final long timestamp
;
142 private final String sender
;
143 private final byte[] groupId
;
144 private final String message
;
145 private final List
<String
> attachments
;
147 public MessageReceived(
153 List
<String
> attachments
154 ) throws DBusException
{
155 super(objectpath
, timestamp
, sender
, groupId
, message
, attachments
);
156 this.timestamp
= timestamp
;
157 this.sender
= sender
;
158 this.groupId
= groupId
;
159 this.message
= message
;
160 this.attachments
= attachments
;
163 public long getTimestamp() {
167 public String
getSender() {
171 public byte[] getGroupId() {
175 public String
getMessage() {
179 public List
<String
> getAttachments() {
184 class ReceiptReceived
extends DBusSignal
{
186 private final long timestamp
;
187 private final String sender
;
189 public ReceiptReceived(String objectpath
, long timestamp
, String sender
) throws DBusException
{
190 super(objectpath
, timestamp
, sender
);
191 this.timestamp
= timestamp
;
192 this.sender
= sender
;
195 public long getTimestamp() {
199 public String
getSender() {
204 class SyncMessageReceived
extends DBusSignal
{
206 private final long timestamp
;
207 private final String source
;
208 private final String destination
;
209 private final byte[] groupId
;
210 private final String message
;
211 private final List
<String
> attachments
;
213 public SyncMessageReceived(
220 List
<String
> attachments
221 ) throws DBusException
{
222 super(objectpath
, timestamp
, source
, destination
, groupId
, message
, attachments
);
223 this.timestamp
= timestamp
;
224 this.source
= source
;
225 this.destination
= destination
;
226 this.groupId
= groupId
;
227 this.message
= message
;
228 this.attachments
= attachments
;
231 public long getTimestamp() {
235 public String
getSource() {
239 public String
getDestination() {
243 public byte[] getGroupId() {
247 public String
getMessage() {
251 public List
<String
> getAttachments() {
258 class AttachmentInvalid
extends DBusExecutionException
{
260 public AttachmentInvalid(final String message
) {
265 class InvalidUri
extends DBusExecutionException
{
267 public InvalidUri(final String message
) {
272 class Failure
extends DBusExecutionException
{
274 public Failure(final String message
) {
279 class GroupNotFound
extends DBusExecutionException
{
281 public GroupNotFound(final String message
) {
286 class InvalidGroupId
extends DBusExecutionException
{
288 public InvalidGroupId(final String message
) {
293 class InvalidNumber
extends DBusExecutionException
{
295 public InvalidNumber(final String message
) {
300 class UntrustedIdentity
extends DBusExecutionException
{
302 public UntrustedIdentity(final String message
) {