|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This file contains the header file of the Sms socket Buffers. |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 */ |
|
23 |
|
24 |
|
25 #if !defined (__SMSUSTRM_H__) |
|
26 #define __SMSUSTRM_H__ |
|
27 |
|
28 #if !defined(__E32STD_H__) |
|
29 #include <e32std.h> |
|
30 #endif |
|
31 |
|
32 #if !defined(__S32BUF_H__) |
|
33 #include <s32buf.h> |
|
34 #endif |
|
35 |
|
36 #if !defined(__S32STRM_H__) |
|
37 #include <s32strm.h> |
|
38 #endif |
|
39 |
|
40 |
|
41 class RSocket; |
|
42 |
|
43 /** |
|
44 * @publishedAll |
|
45 * @released |
|
46 */ |
|
47 const TInt KSmsMaxSegmentLength=0x100; |
|
48 |
|
49 |
|
50 /** |
|
51 * An SMS stream buffer to read and write over a socket. |
|
52 * @publishedAll |
|
53 * @released |
|
54 */ |
|
55 class RSmsSocketBuf : public TStreamBuf |
|
56 { |
|
57 public: |
|
58 RSmsSocketBuf(RSocket& aSocket); |
|
59 private: |
|
60 // from TStreamBuf |
|
61 TInt UnderflowL(TInt aMaxLength); |
|
62 void OverflowL(); |
|
63 void DoSynchL(); |
|
64 private: |
|
65 void SocketWriteL(); |
|
66 // |
|
67 inline TInt Lag(TRead) const; |
|
68 inline TInt Lag(TWrite) const; |
|
69 private: |
|
70 RSocket& iSocket; |
|
71 TUint8 iBuffer[KSmsMaxSegmentLength]; |
|
72 }; |
|
73 |
|
74 |
|
75 /** |
|
76 * Stream that reads a CSmsMessage object across a socket. |
|
77 * @publishedAll |
|
78 * @released |
|
79 */ |
|
80 class RSmsSocketReadStream : public RReadStream |
|
81 { |
|
82 public: |
|
83 IMPORT_C RSmsSocketReadStream(RSocket& aSocket); |
|
84 private: |
|
85 RSmsSocketBuf iBuf; |
|
86 }; |
|
87 |
|
88 /** |
|
89 * Stream that writes a CSmsMessage object across a socket. |
|
90 * @publishedAll |
|
91 * @released |
|
92 */ |
|
93 class RSmsSocketWriteStream : public RWriteStream |
|
94 { |
|
95 public: |
|
96 IMPORT_C RSmsSocketWriteStream(RSocket& aSocket); |
|
97 private: |
|
98 RSmsSocketBuf iBuf; |
|
99 }; |
|
100 |
|
101 #include "smsustrm.inl" |
|
102 |
|
103 #endif // !defined __SMSUSTRM_H__ |