31 #ifndef OPAL_IM_PRES_ENT_H
32 #define OPAL_IM_PRES_ENT_H
37 #include <ptlib/pfactory.h>
38 #include <ptlib/safecoll.h>
39 #include <ptclib/url.h>
40 #include <ptclib/guid.h>
41 #include <ptclib/vcard.h>
114 Comparison
Compare(
const PObject & other)
const;
154 const PString & scheme = PString::Empty()
177 virtual bool Close();
213 const PURL & presentity,
214 bool subscribe =
true,
215 const PString & note = PString::Empty()
227 const PURL & presentity
251 const PURL & presentity,
264 const PString & note = PString::Empty()
321 #define PDECLARE_AuthorisationRequestNotifier(cls, fn) PDECLARE_NOTIFIER2(OpalPresentity, cls, fn, const OpalPresentity::AuthorisationRequest &)
322 #define PCREATE_AuthorisationRequestNotifier(fn) PCREATE_NOTIFIER2(fn, const OpalPresentity::AuthorisationRequest &)
342 #define PDECLARE_PresenceChangeNotifier(cls, fn) PDECLARE_NOTIFIER2(OpalPresentity, cls, fn, const OpalPresenceInfo &)
343 #define PCREATE_PresenceChangeNotifier(fn) PCREATE_NOTIFIER2(fn, const OpalPresenceInfo &)
359 const PURL & presentity = PString::Empty(),
360 const PString & displayName = PString::Empty()
446 const BuddyInfo & buddy
456 const PURL & presentity
459 const PURL & presentity
469 PINDEX & successfulCount,
470 bool subscribe =
true
473 bool subscribe =
true
503 #define PDECLARE_ReceivedMessageNotifier(cls, fn) PDECLARE_NOTIFIER2(OpalPresentity, cls, fn, const OpalIM &)
504 #define PCREATE_ReceivedMessageNotifier(fn) PCREATE_NOTIFIER2(fn, const OpalIM &)
596 bool startQueue =
true
609 bool startQueue =
true
654 #define OPAL_DEFINE_COMMAND(command, entity, func) \
655 class entity##_##command : public command \
657 public: virtual void Process(OpalPresentity & presentity) { dynamic_cast<entity &>(presentity).func(*this); } \
659 static PFactory<OpalPresentityCommand>::Worker<entity##_##command> \
660 s_##entity##_##command(PDefaultPFactoryKey(entity::Class())+typeid(command).name())
713 #if OPAL_SIP && OPAL_PTLIB_EXPAT
718 #endif // OPAL_IM_PRES_ENT_H
State m_state
New state for presentity.
Definition: pres_ent.h:102
BuddyInfo(const PURL &presentity=PString::Empty(), const PString &displayName=PString::Empty())
Definition: pres_ent.h:358
bool m_temporarilyUnavailable
Definition: pres_ent.h:536
Definition: pres_ent.h:66
ReceivedMessageNotifier m_onReceivedMessageNotifier
Definition: pres_ent.h:532
OpalSubscribeToPresenceCommand(bool subscribe=true)
Definition: pres_ent.h:667
Definition: pres_ent.h:396
ostream & operator<<(ostream &strm, OpalPresenceInfo::State state)
void Internal_SendMessageToCommand(const OpalSendMessageToCommand &cmd)
void SetReceivedMessageNotifier(const ReceivedMessageNotifier ¬ifier)
Set the notifier for the OnPresenceChange() function.
Definition: pres_ent.h:61
virtual bool SetBuddy(const BuddyInfo &buddy)
Definition: pres_ent.h:448
virtual bool SendMessageTo(const OpalIM &message)
virtual bool SetLocalPresence(OpalPresenceInfo::State state, const PString ¬e=PString::Empty())
Definition: pres_ent.h:84
Definition: pres_ent.h:397
OpalPresentityCommand(bool responseNeeded=false)
Definition: pres_ent.h:634
PURL m_presentity
Other presentity requesting our presence.
Definition: pres_ent.h:305
virtual BuddyStatus DeleteBuddyListEx()
void StartThread(bool startQueue=true)
virtual void Process(OpalPresentity &presentity)=0
virtual bool UnsubscribeFromPresence(const PURL &presentity)
static OpalPresentity * Create(OpalManager &manager, const PURL &url, const PString &scheme=PString::Empty())
Definition: pres_ent.h:394
Definition: pres_ent.h:81
Definition: pres_ent.h:680
Comparison Compare(const PObject &other) const
Definition: pres_ent.h:96
virtual bool SetPresenceAuthorisation(const PURL &presentity, Authorisation authorisation)
Definition: pres_ent.h:234
virtual void SetAOR(const PURL &aor)
~OpalPresentityWithCommandThread()
Definition: pres_ent.h:72
__inline cls * CreateCommand()
Definition: pres_ent.h:280
Definition: pres_ent.h:73
CommandQueue m_commandQueue
Definition: pres_ent.h:618
virtual bool SendCommand(OpalPresentityCommand *cmd)
virtual bool UnsubscribeBuddyList()
Definition: pres_ent.h:483
PvCard m_vCard
Definition: pres_ent.h:370
Definition: pres_ent.h:237
virtual BuddyStatus SetBuddyListEx(const BuddyList &buddies)
virtual bool GetBuddy(BuddyInfo &buddy)
Definition: pres_ent.h:438
PStringOptions & GetAttributes()
< Get the attributes for this presentity.
Definition: pres_ent.h:183
Definition: pres_ent.h:303
const PURL & GetAOR() const
Definition: pres_ent.h:199
BuddyStatus
Definition: pres_ent.h:393
PString m_note
Optional extra note attached to request.
Definition: pres_ent.h:306
Definition: pres_ent.h:76
Definition: pres_ent.h:85
bool m_queueRunning
Definition: pres_ent.h:624
Definition: pres_ent.h:357
PString m_note
Optional extra note attached to subscription request.
Definition: pres_ent.h:685
OpalPresentityWithCommandThread()
Construct the presentity class that uses a command thread.
Definition: pres_ent.h:75
virtual bool SendCommand(OpalPresentityCommand *cmd)
PURL m_homePage
Home page for buddy.
Definition: pres_ent.h:384
PFACTORY_LOAD(OpalPluginCodecManager)
virtual BuddyStatus DeleteBuddyEx(const PURL &presentity)
Definition: pres_ent.h:74
std::queue< OpalPresentityCommand * > CommandQueue
Definition: pres_ent.h:617
PString m_rawXML
Raw XML of buddy list entry.
Definition: pres_ent.h:388
PString m_note
Optional extra note attached to subscription request.
Definition: pres_ent.h:670
CmdSeqType m_sequence
Definition: pres_ent.h:647
OpalIM m_message
Definition: pres_ent.h:707
Definition: pres_ent.h:86
PresenceChangeNotifier m_onPresenceChangeNotifier
Definition: pres_ent.h:531
virtual bool SetBuddyList(const BuddyList &buddies)
Definition: pres_ent.h:420
virtual bool IsOpen() const
Definition: pres_ent.h:173
virtual BuddyStatus GetBuddyEx(BuddyInfo &buddy)
bool m_responseNeeded
Definition: pres_ent.h:648
PURL m_map
Definition: pres_ent.h:378
Definition: pres_ent.h:236
PSyncPoint m_commandQueueSync
Definition: pres_ent.h:621
PString m_displayName
Human readable name.
Definition: pres_ent.h:366
virtual bool GetBuddyList(BuddyList &buddies)
Definition: pres_ent.h:410
Definition: pres_ent.h:233
Definition: pres_ent.h:665
PURL m_presentity
Definition: pres_ent.h:649
Definition: pres_ent.h:77
PAtomicBoolean m_open
Definition: pres_ent.h:534
Definition: pres_ent.h:83
static const PCaselessString & AuthNameKey()
Key for authentication name attribute.
PString m_contentType
MIME type code for XML.
Definition: pres_ent.h:387
Definition: pres_ent.h:398
Definition: pres_ent.h:135
OpalPresenceInfo::State m_localState
our presentity state
Definition: pres_ent.h:537
Definition: pres_ent.h:62
virtual bool DeleteBuddy(const PURL &presentity)
Definition: pres_ent.h:458
PMutex m_commandQueueMutex
Definition: pres_ent.h:619
OpalSetLocalPresenceCommand(State state=NoPresence)
Definition: pres_ent.h:696
virtual bool DeleteBuddyList()
Definition: pres_ent.h:429
State
Presence states.
Definition: pres_ent.h:60
virtual BuddyStatus GetBuddyListEx(BuddyList &buddies)
Definition: pres_ent.h:92
PString m_note
Additional information about state change.
Definition: pres_ent.h:103
Definition: pres_ent.h:68
PURL m_icon
Definition: pres_ent.h:374
Definition: pres_ent.h:80
virtual BuddyStatus SetBuddyEx(const BuddyInfo &buddy)
Definition: pres_ent.h:547
virtual ~OpalPresentityCommand()
Definition: pres_ent.h:637
virtual BuddyStatus SubscribeBuddyListEx(PINDEX &successfulCount, bool subscribe=true)
Definition: pres_ent.h:90
PURL m_sound
Definition: pres_ent.h:380
Definition: pres_ent.h:79
virtual void OnPresenceChange(const OpalPresenceInfo &info)
PURL m_target
The presentity that is being informed about the state change.
Definition: pres_ent.h:105
Definition: pres_ent.h:694
PMutex m_notificationMutex
Definition: pres_ent.h:535
Definition: pres_ent.h:400
OpalAuthorisationRequestCommand()
Definition: pres_ent.h:682
Definition: pres_ent.h:401
void SetPresenceChangeNotifier(const PresenceChangeNotifier ¬ifier)
Set the notifier for the OnPresenceChange() function.
std::list< BuddyInfo > BuddyList
Definition: pres_ent.h:391
void SetAuthorisationRequestNotifier(const AuthorisationRequestNotifier ¬ifier)
Set the notifier for the OnAuthorisationRequest() function.
Definition: pres_ent.h:87
Definition: pres_ent.h:99
virtual BuddyStatus UnsubscribeBuddyListEx()
PURL m_presentity
Typicall URI address-of-record.
Definition: pres_ent.h:365
PAtomicInteger::IntegerType CmdSeqType
Definition: pres_ent.h:646
Definition: pres_ent.h:63
Definition: pres_ent.h:78
OpalManager * m_manager
Definition: pres_ent.h:525
static State FromString(const PString &str)
Definition: pres_ent.h:399
OpalPresentity()
Construct the presentity class.
Definition: pres_ent.h:88
virtual void OnReceivedMessage(const OpalIM &message)
Definition: pres_ent.h:89
PURL m_aor
Definition: pres_ent.h:527
static const PCaselessString & AuthPasswordKey()
Key for authentication password attribute.
Definition: pres_ent.h:232
Definition: pres_ent.h:402
void StartQueue(bool startQueue=true)
OpalPresentity::Authorisation m_authorisation
Authorisation mode to indicate to remote.
Definition: pres_ent.h:684
PGloballyUniqueID m_guid
Definition: pres_ent.h:526
bool m_subscribe
Flag to indicate subscribing/unsubscribing.
Definition: pres_ent.h:669
virtual PStringArray GetAttributeNames() const =0
Get all attribute types for this presentity class.
virtual bool SubscribeBuddyList(bool subscribe=true)
Definition: pres_ent.h:472
Definition: pres_ent.h:98
PNotifierTemplate< const OpalIM & > ReceivedMessageNotifier
Definition: pres_ent.h:502
OpalPresenceInfo(State state=Unchanged)
Definition: pres_ent.h:108
Definition: pres_ent.h:94
PURL m_entity
The presentity whose state had changed.
Definition: pres_ent.h:104
Definition: pres_ent.h:67
Definition: pres_ent.h:632
Definition: pres_ent.h:235
Definition: pres_ent.h:702
static const PCaselessString & TimeToLiveKey()
Key for Time-To-Live attribute, in seconds for underlying protocol.
Definition: pres_ent.h:56
OpalSendMessageToCommand()
Definition: pres_ent.h:705
virtual bool SubscribeToPresence(const PURL &presentity, bool subscribe=true, const PString ¬e=PString::Empty())
bool m_threadRunning
Definition: pres_ent.h:623
Definition: pres_ent.h:395
OpalPresentityCommand * InternalCreateCommand(const char *cmdName)
Definition: pres_ent.h:95
PNotifierTemplate< const AuthorisationRequest & > AuthorisationRequestNotifier
Definition: pres_ent.h:320
virtual PStringArray GetAttributeTypes() const =0
virtual bool GetLocalPresence(OpalPresenceInfo::State &state, PString ¬e)
Authorisation
Authorisation modes for SetPresenceAuthorisation()
Definition: pres_ent.h:231
PStringOptions m_attributes
Definition: pres_ent.h:528
Definition: pres_ent.h:82
PThread * m_thread
Definition: pres_ent.h:625
Definition: pres_ent.h:93
AuthorisationRequestNotifier m_onAuthorisationRequestNotifier
Definition: pres_ent.h:530
PNotifierTemplate< const OpalPresenceInfo & > PresenceChangeNotifier
Definition: pres_ent.h:341
PString m_localStateNote
Additional note attached to the.
Definition: pres_ent.h:538
Definition: pres_ent.h:97
Definition: pres_ent.h:91
PAtomicInteger m_commandSequence
Definition: pres_ent.h:620
PTime m_when
Time/date of state change.
Definition: pres_ent.h:106
virtual void OnAuthorisationRequest(const AuthorisationRequest &request)