1 /*
2 PresenceService.java
3 Copyright (C) 2010-2013  Belledonne Communications, Grenoble, France
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 */
19 
20 package org.linphone.core;
21 
22 public interface PresenceService {
23 
24 	/**
25 	 * Gets the id of a presence service.
26 	 * @return A string containing the id.
27 	 */
getId()28 	String getId();
29 
30 	/**
31 	 * Sets the id of a presence service.
32 	 * @param id The id string to set. Can be null to generate it automatically.
33 	 * @return 0 if successful, a value < 0 in case of error.
34 	 */
setId(String id)35 	int setId(String id);
36 
37 	/**
38 	 * Gets the basic status of a presence service.
39 	 * @return The #PresenceBasicStatus of the #PresenceService object.
40 	 */
getBasicStatus()41 	PresenceBasicStatus getBasicStatus();
42 
43 	/**
44 	 * Sets the basic status of a presence service.
45 	 * @param status The #PresenceBasicStatus to set for the #PresenceService object.
46 	 * @return 0 if successful, a value < 0 in case of error.
47 	 */
setBasicStatus(PresenceBasicStatus status)48 	int setBasicStatus(PresenceBasicStatus status);
49 
50 	/**
51 	 * Gets the contact of a presence service.
52 	 * @return A string containing the contact, or null if no contact is found.
53 	 */
getContact()54 	String getContact();
55 
56 	 /**
57 	 * Sets the contact of a presence service.
58 	 * @param contact The contact string to set.
59 	 * @return 0 if successful, a value < 0 in case of error.
60 	 */
setContact(String contact)61 	int setContact(String contact);
62 
63 	/**
64 	 * Gets the number of notes included in the presence service.
65 	 * @return The number of notes included in the #PresenceService object.
66 	 */
getNbNotes()67 	long getNbNotes();
68 
69 	/**
70 	 * Gets the nth note of a presence service.
71 	 * @param idx The index of the note to get (the first note having the index 0).
72 	 * @return A pointer to a #PresenceNote object if successful, null otherwise.
73 	 */
getNthNote(long idx)74 	PresenceNote getNthNote(long idx);
75 
76 	/**
77 	 * Adds a note to a presence service.
78 	 * @param note The #PresenceNote object to add to the service.
79 	 * @return 0 if successful, a value < 0 in case of error.
80 	 */
addNote(PresenceNote note)81 	int addNote(PresenceNote note);
82 
83 	/**
84 	 * Clears the notes of a presence service.
85 	 * @return 0 if successful, a value < 0 in case of error.
86 	 */
clearNotes()87 	int clearNotes();
88 
89 	/**
90 	 * Gets the native pointer for this object.
91 	 */
getNativePtr()92 	long getNativePtr();
93 
94 }
95