# pils.h

Go to the documentation of this file.

    00001 /*
    00002  * pils.h
    00003  *
    00004  * Microsoft Internet Location Server Protocol interface class.
    00005  *
    00006  * Portable Windows Library
    00007  *
    00008  * Copyright (c) 1993-2003 Equivalence Pty. Ltd.
    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 Portable Windows Library.
    00021  *
    00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
    00023  *
    00024  * Contributor(s): ______________________________________.
    00025  *
    00026  * $Revision: 21788 $
    00027  * $Author: rjongbloed $
    00028  * $Date: 2008-12-11 23:42:13 -0600 (Thu, 11 Dec 2008) $
    00029  */
    00030
    00031 #ifndef PTLIB_PILS_H
    00032 #define PTLIB_PILS_H
    00033
    00034 #ifdef P_USE_PRAGMA
    00035 #pragma interface
    00036 #endif
    00037
    00038 #if P_LDAP
    00039
    00040 #include <ptlib/sockets.h>
    00041 #include <ptclib/pldap.h>
    00042
    00043
    00046 class PILSSession : public PLDAPSession
    00047 {
    00048   PCLASSINFO(PILSSession, PLDAPSession)
    00049   public:
    00052     PILSSession();
    00053
    00063     class MSIPAddress : public PIPSocket::Address
    00064     {
    00065       public:
    00066         MSIPAddress(DWORD a = 0)                    : Address(a) { }
    00067         MSIPAddress(const PIPSocket::Address & a)   : Address(a) { }
    00068         MSIPAddress(const PString & dotNotation)    : Address(dotNotation) { }
    00069         MSIPAddress(PINDEX len, const BYTE * bytes) : Address(len, bytes) { }
    00070
    00071         MSIPAddress & operator=(DWORD a)                      { Address::operator=(a); return *this; }
    00072         MSIPAddress & operator=(const PIPSocket::Address & a) { Address::operator=(a); return *this; }
    00073         MSIPAddress & operator=(const PString & dotNotation)  { Address::operator=(dotNotation); return *this; }
    00074
    00075       friend istream & operator>>(istream & s, MSIPAddress & a);
    00076       friend ostream & operator<<(ostream & s, MSIPAddress & a);
    00077     };
    00078
    00079     PLDAP_STRUCT_BEGIN(RTPerson)
    00080        PLDAP_ATTR_SIMP(RTPerson, PString,     cn); // Must be non-empty
    00081        PLDAP_ATTR_SIMP(RTPerson, PString,     c);
    00082        PLDAP_ATTR_SIMP(RTPerson, PString,     o);
    00083        PLDAP_ATTR_SIMP(RTPerson, PString,     surname);
    00084        PLDAP_ATTR_SIMP(RTPerson, PString,     givenName);
    00085        PLDAP_ATTR_SIMP(RTPerson, PString,     rfc822Mailbox); // Must be non-empty
    00086        PLDAP_ATTR_SIMP(RTPerson, PString,     location);
    00087        PLDAP_ATTR_SIMP(RTPerson, PString,     comment);
    00088        PLDAP_ATTR_SIMP(RTPerson, MSIPAddress, sipAddress);
    00089        PLDAP_ATTR_SIMP(RTPerson, PWORDArray,  sport);
    00090        PLDAP_ATTR_INIT(RTPerson, unsigned,    sflags,       0);
    00091        PLDAP_ATTR_INIT(RTPerson, unsigned,    ssecurity,    0);
    00092        PLDAP_ATTR_INIT(RTPerson, unsigned,    smodop,       0);
    00093        PLDAP_ATTR_INIT(RTPerson, unsigned,    sttl,         3600);
    00094        PLDAP_ATTR_SIMP(RTPerson, PStringList, sprotid);
    00095        PLDAP_ATTR_SIMP(RTPerson, PStringList, sprotmimetype);
    00096        PLDAP_ATTR_INIT(RTPerson, PString,     sappid,       PProcess::Current().GetName()); // Must be non-empty
    00097        PLDAP_ATTR_INIT(RTPerson, PString,     sappguid,     "none"); // Must be non-empty
    00098        PLDAP_ATTR_SIMP(RTPerson, PStringList, smimetype);
    00099        PLDAP_ATTR_INIT(RTPerson, PBoolean,        ilsa32833566, 0); // 1=audio capable
    00100        PLDAP_ATTR_INIT(RTPerson, PBoolean,        ilsa32964638, 0); // 1=video capable
    00101        PLDAP_ATTR_INIT(RTPerson, PBoolean,        ilsa26214430, 0); // 1=in a call
    00102        PLDAP_ATTR_INIT(RTPerson, unsigned,    ilsa26279966, 0); // unknown
    00103        PLDAP_ATTR_INIT(RTPerson, unsigned,    ilsa39321630, 0); // 1 personal; 2 business user; 4 adults-only
    00104        PLDAP_ATTR_INIT(RTPerson, time_t,      timestamp,    PTime().GetTimeInSeconds());
    00105
    00106       public:
    00107        PString GetDN() const;
    00108
    00109     PLDAP_STRUCT_END();
    00110
    00111     PBoolean AddPerson(
    00112       const RTPerson & person
    00113     );
    00114
    00115     PBoolean ModifyPerson(
    00116       const RTPerson & person
    00117     );
    00118
    00119     PBoolean DeletePerson(
    00120       const RTPerson & person
    00121     );
    00122
    00123     PBoolean SearchPerson(
    00124       const PString & canonicalName,
    00125       RTPerson & person
    00126     );
    00127
    00128     PList<RTPerson> SearchPeople(
    00129       const PString & filter
    00130     );
    00131 };
    00132
    00133 #endif // P_LDAP
    00134
    00135 #endif // PTLIB_PILS_H
    00136
    00137
    00138 // End of file ////////////////////////////////////////////////////////////////