im.h

Go to the documentation of this file.
00001 /*
00002  * im_mf.h
00003  *
00004  * Media formats for Instant Messaging
00005  *
00006  * Open Phone Abstraction Library (OPAL)
00007  *
00008  * Copyright (c) 2008 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: 22675 $
00027  * $Author: rjongbloed $
00028  * $Date: 2009-05-20 04:23:29 +0000 (Wed, 20 May 2009) $
00029  */
00030 
00031 #ifndef OPAL_IM_IM_H
00032 #define OPAL_IM_IM_H
00033 
00034 #include <ptlib.h>
00035 #include <opal/buildopts.h>
00036 
00037 #if OPAL_HAS_IM
00038 
00039 #include <opal/mediastrm.h>
00040 
00041 #include <im/rfc4103.h>
00042 
00043 class OpalIMMediaType : public OpalMediaTypeDefinition 
00044 {
00045   public:
00046     OpalIMMediaType(
00047       const char * mediaType,          
00048       const char * sdpType,            
00049       unsigned     preferredSessionId  
00050     )
00051       : OpalMediaTypeDefinition(mediaType, sdpType, preferredSessionId, OpalMediaType::DontOffer)
00052     { }
00053 
00054     PString GetRTPEncoding() const { return PString::Empty(); }
00055     RTP_UDP * CreateRTPSession(OpalRTPConnection & , unsigned , bool ) { return NULL; }
00056     virtual bool UsesRTP() const { return false; }
00057 };
00058 
00059 
00060 class OpalIMMediaStream : public OpalMediaStream
00061 {
00062   public:
00063     OpalIMMediaStream(
00064       OpalConnection & conn,
00065       const OpalMediaFormat & mediaFormat, 
00066       unsigned sessionID,                  
00067       bool isSource                        
00068     );
00069 
00070     virtual PBoolean IsSynchronous() const         { return false; }
00071     virtual PBoolean RequiresPatchThread() const   { return false; }
00072 
00073     /*
00074      * called to send IM to remote connection
00075      */
00076     virtual bool PushIM(const T140String & text);
00077     virtual bool PushIM(RTP_DataFrame & frame);
00078 
00079   protected:
00080     RFC4103Context rfc4103;
00081 };
00082 
00083 
00084 #endif // OPAL_HAS_IM
00085 
00086 #endif // OPAL_IM_IM_H

Generated on Mon Feb 1 00:25:49 2010 for OPAL by  doxygen 1.5.1