IGnunetChat.aidl (4283B)
1 package org.gnunet.gnunetmessenger.ipc; 2 3 import org.gnunet.gnunetmessenger.ipc.ChatAccountDto; 4 import org.gnunet.gnunetmessenger.ipc.ChatContactDto; 5 import org.gnunet.gnunetmessenger.ipc.ChatGroupDto; 6 import org.gnunet.gnunetmessenger.ipc.ChatUriDto; 7 import org.gnunet.gnunetmessenger.ipc.IChatCallback; 8 import org.gnunet.gnunetmessenger.ipc.IAccountCallback; 9 import org.gnunet.gnunetmessenger.ipc.IContactCallback; 10 import org.gnunet.gnunetmessenger.ipc.IGroupCallback; 11 import org.gnunet.gnunetmessenger.ipc.IGroupContactCallback; 12 import org.gnunet.gnunetmessenger.ipc.IAttributeCallback; 13 import org.gnunet.gnunetmessenger.ipc.ILobbyCallback; 14 import org.gnunet.gnunetmessenger.ipc.IMessageIterateCallback; 15 import org.gnunet.gnunetmessenger.ipc.ChatContextDto; 16 import org.gnunet.gnunetmessenger.ipc.ChatMessageDto; 17 18 interface IGnunetChat { 19 // Core chat operations 20 int getApiVersion(); 21 long startChat(String messengerApp, IChatCallback cb); 22 void reset(); 23 void iterateAccounts(long handle, IAccountCallback cb); 24 int createAccount(long handle, String name); 25 void connect(long handle, in ChatAccountDto account); 26 void disconnect(long handle); 27 void stopChat(long handle); 28 String getProfileName(long handle); 29 void setProfileName(long handle, String name); 30 31 // Contact operations 32 String getProfileKey(long handle); 33 boolean isContactBlocked(in ChatContactDto contact); 34 void setContactBlocked(in ChatContactDto contact, boolean isBlocked); 35 void setAttribute(long handle, String key, String value); 36 void getAttributes(long handle, IAttributeCallback cb); 37 38 // Lobby operations 39 void lobbyOpen(long handle, ILobbyCallback cb); 40 void lobbyJoin(long handle, String uri); 41 42 // Group operations 43 void setGroupName(in ChatGroupDto group, String name); 44 ChatGroupDto createGroup(long handle, String topic); 45 46 // URI operations 47 ChatUriDto parseUri(String uri); 48 void destroyUri(in ChatUriDto uri); 49 50 // Group contact operations 51 void inviteContactToGroup(in ChatGroupDto group, in ChatContactDto contact); 52 String getUserPointerForContext(in ChatContextDto context); 53 void setUserPointerForContext(in ChatContextDto context, String userPointer); 54 55 // Message operations 56 ChatContactDto getSenderFromMessage(in ChatMessageDto message); 57 ChatGroupDto getGroupFromContext(in ChatContextDto context); 58 ChatMessageDto getMessageForGroupContact(in ChatGroupDto group, in ChatContactDto contact); 59 int getMessageKind(in ChatMessageDto message); 60 int isMessageRecent(in ChatMessageDto message); 61 long getMessageTimestamp(in ChatMessageDto message); 62 void setMessageForGroupContact(in ChatGroupDto group, in ChatContactDto contact, in ChatMessageDto message); 63 64 // Iteration operations 65 void iterateContacts(long handle, IContactCallback cb); 66 void iterateGroups(long handle, IGroupCallback cb); 67 68 // Context operations 69 ChatContextDto getContactContext(in ChatContactDto chatContact); 70 ChatContextDto getGroupContext(in ChatGroupDto chatGroup); 71 String getContactUserPointer(in ChatContactDto chatContact); 72 void setContactUserPointer(in ChatContactDto chatContact, String userPointer); 73 String getGroupUserPointer(in ChatGroupDto chatGroup); 74 void setGroupUserPointer(in ChatGroupDto chatGroup, String userPointer); 75 76 // Messaging operations 77 void sendText(in ChatContextDto chatContext, String text); 78 String getContactKey(in ChatContactDto chatContact); 79 ChatContactDto getContextContact(in ChatContextDto context); 80 void deleteContact(in ChatContactDto chatContact); 81 boolean isGroup(in ChatContextDto context); 82 boolean isPlatform(in ChatContextDto context); 83 84 // Group contact iteration 85 void iterateGroupContacts(in ChatGroupDto chatGroup, IGroupContactCallback cb); 86 87 // Utility operations 88 String randomUUID(); 89 void getContactAttributes(in ChatContactDto contact, IAttributeCallback cb); 90 void shareAttributes(long handle, in ChatContactDto contact, String key); 91 void unshareAttributes(long handle, in ChatContactDto contact, String key); 92 93 // Message iteration 94 void iterateContextMessages(in ChatContextDto context, IMessageIterateCallback cb); 95 }