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 Linphone.PresenceActivity object if successful, null otherwise. @maybenil |
BasicStatus
Gets the basic status of a presence model.
Declaration
public PresenceBasicStatus BasicStatus { get; set; }
Property Value
| Type | Description |
|---|---|
| PresenceBasicStatus | The Linphone.PresenceBasicStatus of the Linphone.PresenceModel object given as parameter. |
Capabilities
Gets the capabilities of a Linphone.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 Linphone.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. @maybenil |
IsOnline
Tells whether a presence model is considered online.
It is any of theses cases: -basic status is'open' and no activities -explicit 'online' tag in the status
Declaration
public bool IsOnline { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LatestActivityTimestamp
Gets the latest activity timestamp of a presence model.
Declaration
public long LatestActivityTimestamp { get; }
Property Value
| Type | Description |
|---|---|
| System.Int64 | The activity timestamp of the Linphone.PresenceModel object or -1 if there is no activity (such as when status is Online). |
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 Linphone.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 Linphone.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 Linphone.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 Linphone.Address, or null if no contact is found. @maybenil |
Timestamp
Gets the timestamp of a presence model.
Declaration
public long Timestamp { get; }
Property Value
| Type | Description |
|---|---|
| System.Int64 | The timestamp of the Linphone.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 Linphone.PresenceActivity object to add to the model. @notnil |
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. @notnil |
| System.String | lang | The language of the note to be added. Can be null if no language is to be specified for the note. @maybenil |
AddPerson(PresencePerson)
Adds a person to a presence model.
Declaration
public void AddPerson(PresencePerson person)
Parameters
| Type | Name | Description |
|---|---|---|
| PresencePerson | person | The Linphone.PresencePerson object to add to the model. @notnil |
AddService(PresenceService)
Adds a service to a presence model.
Declaration
public void AddService(PresenceService service)
Parameters
| Type | Name | Description |
|---|---|---|
| PresenceService | service | The Linphone.PresenceService object to add to the model. @notnil |
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 Linphone.PresenceModel.
Declaration
public float GetCapabilityVersion(FriendCapability capability)
Parameters
| Type | Name | Description |
|---|---|---|
| FriendCapability | capability | The Linphone.FriendCapability to test. |
Returns
| Type | Description |
|---|---|
| System.Single | the version of the capability of a Linphone.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. @maybenil |
Returns
| Type | Description |
|---|---|
| PresenceNote | A pointer to a Linphone.PresenceNote object if successful, null otherwise. @maybenil |
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 Linphone.PresenceActivity object if successful, null otherwise. @maybenil |
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 Linphone.PresencePerson object if successful, null otherwise. @maybenil |
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 Linphone.PresenceService object if successful, null otherwise. @maybenil |
HasCapability(FriendCapability)
Returns whether or not the Linphone.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 Linphone.PresenceModel object has a given capability. |
HasCapabilityWithVersion(FriendCapability, Single)
Returns whether or not the Linphone.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 Linphone.FriendCapability to test. |
| System.Single | version | The wanted version to test. |
Returns
| Type | Description |
|---|---|
| System.Boolean | whether or not the Linphone.PresenceModel object has a given capability with a certain version. |
HasCapabilityWithVersionOrMore(FriendCapability, Single)
Returns whether or not the Linphone.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 Linphone.FriendCapability to test. |
| System.Single | version | The wanted version to test. |
Returns
| Type | Description |
|---|---|
| System.Boolean | whether or not the Linphone.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 Linphone.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. @maybenil |
Returns
| Type | Description |
|---|---|
| PresenceModel | The created Linphone.PresenceModel, or null if an error occured. @maybenil |
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 Linphone.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. @maybenil |
| System.String | note | An additional note giving additional information about the contact presence. @notnil |
| 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. @maybenil |
Returns
| Type | Description |
|---|---|
| PresenceModel | The created Linphone.PresenceModel, or null if an error occured. @maybenil |
Remarks
See : linphone_presence_model_new,
NewWithConsolidatedPresence(ConsolidatedPresence)
Creates a presence model with a consolidated presence.
Declaration
public static PresenceModel NewWithConsolidatedPresence(ConsolidatedPresence presence)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsolidatedPresence | presence | The Linphone.ConsolidatedPresence to set for the created presence model. |
Returns
| Type | Description |
|---|---|
| PresenceModel | The created Linphone.PresenceModel, or null if an error occured. @maybenil |
Remarks
Warning : This function will set the basic status of the model and it may create an activity depending on the Linphone.ConsolidatedPresence
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 Linphone.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. @maybenil |
Remarks
Warning : This function will modify the basic status of the model
according to the activity being set. If you don't want the basic status to
be modified automatically, you can use the combination of
Linphone.PresenceModel.BasicStatus,
Linphone.PresenceModel.ClearActivities() and