Package org.linphone.core

# Interface PresenceService

public interface PresenceService
Presence service type holding information about a presence service.

## Method Summary

Modifier and Type
Method
Description
`int`
`addNote(PresenceNote note)`
Adds a note to a presence service.
`int`
`clearNotes()`
Clears the notes of a presence service.
`PresenceBasicStatus`
`getBasicStatus()`
Gets the basic status of a presence service.
`String`
`getContact()`
Gets the contact of a presence service.
`String`
`getId()`
Gets the id of a presence service.
`long`
`getNativePointer()`
Gets the native pointer used by this class to make native method calls.
`int`
`getNbNotes()`
Gets the number of notes included in the presence service.
`PresenceNote`
`getNthNote(int index)`
Gets the nth note of a presence service.
`String[]`
`getServiceDescriptions()`
Gets the service descriptions of a presence service.
`Object`
`getUserData()`
Gets the object stored in this object user's data
`int`
`setBasicStatus(PresenceBasicStatus basicStatus)`
Sets the basic status of a presence service.
`int`
`setContact(String contact)`
Sets the contact of a presence service.
`int`
`setId(String id)`
Sets the id of a presence service.
`int`
`setServiceDescriptions(String[] descriptions)`
Sets the service descriptions of a presence service.
`void`
`setUserData(Object data)`
Sets the object to store in this object user's data
`String`
`toString()`

## Method Details

### getBasicStatus

PresenceBasicStatus getBasicStatus()
Gets the basic status of a presence service.

Returns:
  The `PresenceBasicStatus` of the `PresenceService` object
  given as parameter.

### setBasicStatus

int setBasicStatus(PresenceBasicStatus basicStatus)
Sets the basic status of a presence service.

Parameters:
  `basicStatus` - The `PresenceBasicStatus` to set for the `PresenceService`
  object.
Returns:
  0 if successful, a value < 0 in case of error.

### getContact

@Nullable String getContact()
Gets the contact of a presence service.

Returns:
  A pointer to a dynamically allocated string containing the contact, or
  null if no contact is found.
  The returned string is to be freed by calling ms_free().

### setContact

int setContact(@Nullable String contact)
Sets the contact of a presence service.

Parameters:
  `contact` - The contact string to set.
Returns:
  0 if successful, a value < 0 in case of error.

### getId

@Nullable String getId()
Gets the id of a presence service.

Returns:
  A pointer to a dynamically allocated string containing the id, or null
  in case of error.
  The returned string is to be freed by calling ms_free().

### setId

int setId(@Nullable String id)
Sets the id of a presence service.

Parameters:
  `id` - The id string to set. Can be null to generate it automatically.
Returns:
  0 if successful, a value < 0 in case of error.

### getNbNotes

int getNbNotes()
Gets the number of notes included in the presence service.

Returns:
  The number of notes included in the `PresenceService` object.

### getServiceDescriptions

@NonNull String[] getServiceDescriptions()
Gets the service descriptions of a presence service.

Returns:
  A A list of char * objects. containing the services descriptions.
  The returned string is to be freed.

### setServiceDescriptions

int setServiceDescriptions(@Nullable String[] descriptions)
Sets the service descriptions of a presence service.

Parameters:
  `descriptions` - The service descriptions. A list of char * objects.
Returns:
  0 if successful, a value < 0 in case of error.

### addNote

int addNote(@NonNull PresenceNote note)
Adds a note to a presence service.

Parameters:
  `note` - The `PresenceNote` object to add to the service.
Returns:
  0 if successful, a value < 0 in case of error.

### clearNotes

int clearNotes()
Clears the notes of a presence service.

Returns:
  0 if successful, a value < 0 in case of error.

### getNthNote

@Nullable PresenceNote getNthNote(int index)
Gets the nth note of a presence service.

Parameters:
  `index` - The index of the note to get (the first note having the index 0).
Returns:
  A pointer to a `PresenceNote` object if successful, null
  otherwise.

### setUserData

void setUserData(Object data)
Sets the object to store in this object user's data

Parameters:
  `data` - the object to store

### getUserData

Object getUserData()
Gets the object stored in this object user's data

Returns:
  the object store if any, null otherwise

### getNativePointer

long getNativePointer()
Gets the native pointer used by this class to make native method calls.

Returns:
  the nativer pointer, as long

### toString

String toString()

Overrides:
  `toString` in class `Object`