OPAL  Version 3.10.10
t140.h
Go to the documentation of this file.
1 /*
2  * t140.h
3  *
4  * Declarations for implementation of T.140 Protocol for Multimedia Application Text Conversation
5  *
6  * Open Phone Abstraction Library (OPAL)
7  *
8  * Copyright (c) 2008 Post Increment
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Open Phone Abstraction Library.
21  *
22  * The Initial Developer of the Original Code is Post Increment
23  *
24  * Contributor(s): ______________________________________.
25  *
26  * $Revision: 23400 $
27  * $Author: csoutheren $
28  * $Date: 2009-09-09 11:42:23 -0500 (Wed, 09 Sep 2009) $
29  */
30 
31 #ifndef OPAL_IM_T140_H
32 #define OPAL_IM_T140_H
33 
34 #include <ptlib.h>
35 #include <opal/buildopts.h>
36 #include <opal/mediatype.h>
37 
39 {
40  public:
42 
43  static const OpalMediaType & MediaType();
44 
45 #if OPAL_SIP
47 #endif
48 };
49 
50 
51 class T140String : public PBYTEArray
52 {
53  public:
54  enum {
55  ZERO_WIDTH_NO_BREAK = 0xfeff,
56  UTF_NEWLINE = 0x2028,
57  };
58 
59  T140String();
60  T140String(const BYTE * data, PINDEX len);
61  T140String(const PBYTEArray & bytes);
62  T140String(const char * chars);
63  T140String(const PString & str);
64 
65  PINDEX GetLength() const { return length; }
66 
67  PINDEX GetUTFLen(WORD c);
68  PINDEX GetUTF(const BYTE * ptr, PINDEX len, WORD & ch);
69  PINDEX GetUTF(PINDEX pos, WORD & ch);
70 
71  PINDEX AppendUnicode16(WORD c);
72  PINDEX AppendUTF(const BYTE * utf, PINDEX utfLen);
73 
74  bool AsString(PString & str);
75 
76  protected:
77  PINDEX SetUTF(BYTE * ptr, WORD c);
78  PINDEX length;
79 };
80 
81 #endif // OPAL_IM_T140_H
static const OpalMediaType & MediaType()
Definition: mediatype.h:57
SDPMediaDescription * CreateSDPMediaDescription(const OpalTransportAddress &localAddress)
Definition: t140.h:38
Definition: mediatype.h:271
PINDEX length
Definition: t140.h:78
PINDEX GetLength() const
Definition: t140.h:65
Definition: sdp.h:119
Definition: transports.h:149
Definition: t140.h:51