sippres.h

Go to the documentation of this file.
00001 /*
00002  * sippres.h
00003  *
00004  * SIP Presence classes for Opal
00005  *
00006  * Open Phone Abstraction Library (OPAL)
00007  *
00008  * Copyright (c) 2009 Post Increment
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Open Phone Abstraction Library.
00021  *
00022  * The Initial Developer of the Original Code is Post Increment
00023  *
00024  * Contributor(s): ______________________________________.
00025  *
00026  * $Revision: 22858 $
00027  * $Author: csoutheren $
00028  * $Date: 2009-06-12 22:50:19 +1000 (Fri, 12 Jun 2009) $
00029  */
00030 
00031 #ifndef OPAL_SIP_SIPPRES_H
00032 #define OPAL_SIP_SIPPRES_H
00033 
00034 #include <ptlib.h>
00035 #include <opal/buildopts.h>
00036 
00037 #include <opal/pres_ent.h>
00038 
00039 class SIP_PresEntity : public OpalPresEntity
00040 {
00041   public:
00042     static const char * DefaultPresenceServerKey;
00043     static const char * PresenceServerKey;
00044     static const char * ProfileKey;
00045 
00046     class Profile {
00047       public:
00048         Profile();
00049 
00050         virtual bool Open(SIP_PresEntity * presEntity);
00051 
00052         virtual bool Close() = 0;
00053 
00054         virtual bool SetNotifySubscriptions(bool on) = 0;
00055 
00056         virtual bool SetPresence(State state, const PString & note) = 0;
00057 
00058         virtual bool RemovePresence() = 0;
00059   
00060       protected:
00061         SIP_PresEntity * m_presEntity;
00062     };
00063 
00064     SIP_PresEntity();
00065     ~SIP_PresEntity();
00066 
00067     virtual bool IsOpen() const { return m_endpoint != NULL; }
00068 
00069     virtual bool Open(OpalManager & manager, const OpalGloballyUniqueID & uid);
00070 
00071     virtual bool Close();
00072 
00073     virtual bool SetPresence(
00074       State state,
00075       const PString & note = PString::Empty()
00076     );
00077 
00078     virtual bool RemovePresence();
00079   
00080     SIPURL GetSIPAOR() const { return SIPURL(GetAttribute(AddressOfRecordKey));  }
00081 
00082     SIPEndPoint & GetEndpoint() { return *m_endpoint; }
00083 
00084   protected:
00085     SIPEndPoint * m_endpoint;
00086     Profile * m_profile;
00087 };
00088 
00089 #endif // OPAL_SIP_SIPPRES_H

Generated on Mon Aug 3 20:50:25 2009 for OPAL by  doxygen 1.5.1