Class PresenceModel
Presence model type holding information about the presence of a person.
Inherited Members
Namespace: Linphone
Assembly: cs.temp.dll.dll
Syntax
public class PresenceModel : LinphoneObject
Properties
Activity
Gets the first activity of a presence model (there is usually only one).
Declaration
public PresenceActivity Activity { get; }
Property Value
Type | Description |
---|---|
PresenceActivity | A PresenceActivity object if successful, null otherwise. |
BasicStatus
Gets the basic status of a presence model.
Declaration
public PresenceBasicStatus BasicStatus { get; set; }
Property Value
Type | Description |
---|---|
PresenceBasicStatus | The PresenceBasicStatus of the PresenceModel object given as parameter. |
Capabilities
Gets the capabilities of a PresenceModel object.
Declaration
public int Capabilities { get; }
Property Value
Type | Description |
---|---|
System.Int32 | the capabilities. |
ConsolidatedPresence
Get the consolidated presence from a presence model.
Declaration
public ConsolidatedPresence ConsolidatedPresence { get; }
Property Value
Type | Description |
---|---|
ConsolidatedPresence | The ConsolidatedPresence corresponding to the presence model |
Contact
Gets the contact of a presence model.
Declaration
public string Contact { get; set; }
Property Value
Type | Description |
---|---|
System.String | A pointer to a dynamically allocated string containing the contact, or null if no contact is found. |
IsOnline
Tells whether a presence model is considered online.
It is any of theses cases:
Declaration
public bool IsOnline { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
NbActivities
Gets the number of activities included in the presence model.
Declaration
public uint NbActivities { get; }
Property Value
Type | Description |
---|---|
System.UInt32 | The number of activities included in the PresenceModel object. |
NbPersons
Gets the number of persons included in the presence model.
Declaration
public uint NbPersons { get; }
Property Value
Type | Description |
---|---|
System.UInt32 | The number of persons included in the PresenceModel object. |
NbServices
Gets the number of services included in the presence model.
Declaration
public uint NbServices { get; }
Property Value
Type | Description |
---|---|
System.UInt32 | The number of services included in the PresenceModel object. |
Presentity
Gets the presentity of a presence model.
Declaration
public Address Presentity { get; set; }
Property Value
Type | Description |
---|---|
Address | A pointer to a const Address, or null if no contact is found. |
Timestamp
Gets the timestamp of a presence model.
Declaration
public long Timestamp { get; }
Property Value
Type | Description |
---|---|
System.Int64 | The timestamp of the PresenceModel object or -1 on error. |
Methods
AddActivity(PresenceActivity)
Adds an activity to a presence model.
Declaration
public void AddActivity(PresenceActivity activity)
Parameters
Type | Name | Description |
---|---|---|
PresenceActivity | activity | The PresenceActivity object to add to the model. |
AddNote(String, String)
Adds a note to a presence model.
Declaration
public void AddNote(string noteContent, string lang)
Parameters
Type | Name | Description |
---|---|---|
System.String | noteContent | The note to be added to the presence model. |
System.String | lang | The language of the note to be added. Can be null if no language is to be specified for the note. |
AddPerson(PresencePerson)
Adds a person to a presence model.
Declaration
public void AddPerson(PresencePerson person)
Parameters
Type | Name | Description |
---|---|---|
PresencePerson | person | The PresencePerson object to add to the model. |
AddService(PresenceService)
Adds a service to a presence model.
Declaration
public void AddService(PresenceService service)
Parameters
Type | Name | Description |
---|---|---|
PresenceService | service | The PresenceService object to add to the model. |
ClearActivities()
Clears the activities of a presence model.
Declaration
public void ClearActivities()
ClearNotes()
Clears all the notes of a presence model.
Declaration
public void ClearNotes()
ClearPersons()
Clears the persons of a presence model.
Declaration
public void ClearPersons()
ClearServices()
Clears the services of a presence model.
Declaration
public void ClearServices()
GetCapabilityVersion(FriendCapability)
Returns the version of the capability of a PresenceModel.
Declaration
public float GetCapabilityVersion(FriendCapability capability)
Parameters
Type | Name | Description |
---|---|---|
FriendCapability | capability | The FriendCapability to test. |
Returns
Type | Description |
---|---|
System.Single | the version of the capability of a PresenceModel or -1.0 if the model has not the capability. |
GetNote(String)
Gets the first note of a presence model (there is usually only one).
Declaration
public PresenceNote GetNote(string lang)
Parameters
Type | Name | Description |
---|---|---|
System.String | lang | The language of the note to get. Can be null to get a note that has no language specified or to get the first note whatever language it is written into. |
Returns
Type | Description |
---|---|
PresenceNote | A pointer to a PresenceNote object if successful, null otherwise. |
GetNthActivity(UInt32)
Gets the nth activity of a presence model.
Declaration
public PresenceActivity GetNthActivity(uint index)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The index of the activity to get (the first activity having the index 0). |
Returns
Type | Description |
---|---|
PresenceActivity | A pointer to a PresenceActivity object if successful, null otherwise. |
GetNthPerson(UInt32)
Gets the nth person of a presence model.
Declaration
public PresencePerson GetNthPerson(uint index)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The index of the person to get (the first person having the index 0). |
Returns
Type | Description |
---|---|
PresencePerson | A pointer to a PresencePerson object if successful, null otherwise. |
GetNthService(UInt32)
Gets the nth service of a presence model.
Declaration
public PresenceService GetNthService(uint index)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The index of the service to get (the first service having the index 0). |
Returns
Type | Description |
---|---|
PresenceService | A pointer to a PresenceService object if successful, null otherwise. |
HasCapability(FriendCapability)
Returns whether or not the PresenceModel object has a given capability.
Declaration
public bool HasCapability(FriendCapability capability)
Parameters
Type | Name | Description |
---|---|---|
FriendCapability | capability | The capability to test. |
Returns
Type | Description |
---|---|
System.Boolean | whether or not the PresenceModel object has a given capability. |
HasCapabilityWithVersion(FriendCapability, Single)
Returns whether or not the PresenceModel object has a given capability with a certain version.
Declaration
public bool HasCapabilityWithVersion(FriendCapability capability, float version)
Parameters
Type | Name | Description |
---|---|---|
FriendCapability | capability | The FriendCapability to test. |
System.Single | version | The wanted version to test. |
Returns
Type | Description |
---|---|
System.Boolean | whether or not the PresenceModel object has a given capability with a certain version. |
HasCapabilityWithVersionOrMore(FriendCapability, Single)
Returns whether or not the PresenceModel object has a given capability with a certain version or more.
Declaration
public bool HasCapabilityWithVersionOrMore(FriendCapability capability, float version)
Parameters
Type | Name | Description |
---|---|---|
FriendCapability | capability | The FriendCapability to test. |
System.Single | version | The wanted version to test. |
Returns
Type | Description |
---|---|
System.Boolean | whether or not the PresenceModel object has a given capability with a certain version or more. |
NewWithActivity(PresenceActivityType, String)
Creates a presence model specifying an activity.
Declaration
public static PresenceModel NewWithActivity(PresenceActivityType activity, string description)
Parameters
Type | Name | Description |
---|---|---|
PresenceActivityType | activity | The PresenceActivityType to set for the created presence model. |
System.String | description | An additional description of the activity (mainly useful for the 'other' activity). Set it to null to not add a description. |
Returns
Type | Description |
---|---|
PresenceModel | The created PresenceModel, or null if an error occured. |
Remarks
See : linphone_presence_model_new,
NewWithActivityAndNote(PresenceActivityType, String, String, String)
Creates a presence model specifying an activity and adding a note.
Declaration
public static PresenceModel NewWithActivityAndNote(PresenceActivityType activity, string description, string note, string lang)
Parameters
Type | Name | Description |
---|---|---|
PresenceActivityType | activity | The PresenceActivityType to set for the created presence model. |
System.String | description | An additional description of the activity (mainly useful for the 'other' activity). Set it to null to not add a description. |
System.String | note | An additional note giving additional information about the contact presence. |
System.String | lang | The language the note is written in. It can be set to null in order to not specify the language of the note. |
Returns
Type | Description |
---|---|
PresenceModel | The created PresenceModel, or null if an error occured. |
Remarks
See :
SetActivity(PresenceActivityType, String)
Sets the activity of a presence model (limits to only one activity).
Declaration
public void SetActivity(PresenceActivityType activity, string description)
Parameters
Type | Name | Description |
---|---|---|
PresenceActivityType | activity | The PresenceActivityType to set for the model. |
System.String | description | An additional description of the activity to set for the model. Can be null if no additional description is to be added. |