epoc32/include/smsustrm.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/smsustrm.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,103 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// 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
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// This file contains the header file of the Sms socket Buffers.
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file
    1.25 +*/
    1.26 +
    1.27 +
    1.28 +#if !defined (__SMSUSTRM_H__)
    1.29 +#define __SMSUSTRM_H__
    1.30 +
    1.31 +#if !defined(__E32STD_H__)
    1.32 +#include <e32std.h>
    1.33 +#endif
    1.34 +
    1.35 +#if !defined(__S32BUF_H__)
    1.36 +#include <s32buf.h>
    1.37 +#endif
    1.38 +
    1.39 +#if !defined(__S32STRM_H__)
    1.40 +#include <s32strm.h>
    1.41 +#endif
    1.42 +
    1.43 +
    1.44 +class RSocket;
    1.45 +
    1.46 +/**
    1.47 + *  @publishedAll
    1.48 + *  @released
    1.49 + */
    1.50 +const TInt KSmsMaxSegmentLength=0x100;
    1.51 +
    1.52 +
    1.53 +/**
    1.54 + *  An SMS stream buffer to read and write over a socket.
    1.55 + *  @publishedAll
    1.56 + *  @released 
    1.57 + */
    1.58 +class RSmsSocketBuf : public TStreamBuf
    1.59 +	{
    1.60 +public:
    1.61 +	RSmsSocketBuf(RSocket& aSocket);
    1.62 +private:
    1.63 +// from TStreamBuf
    1.64 +	TInt UnderflowL(TInt aMaxLength);
    1.65 +	void OverflowL();
    1.66 +	void DoSynchL();
    1.67 +private:
    1.68 +	void SocketWriteL();
    1.69 +//
    1.70 +	inline TInt Lag(TRead) const;
    1.71 +	inline TInt Lag(TWrite) const;
    1.72 +private:
    1.73 +	RSocket& iSocket;
    1.74 +	TUint8 iBuffer[KSmsMaxSegmentLength];
    1.75 +	};
    1.76 +
    1.77 +
    1.78 +/**
    1.79 + *  Stream that reads a CSmsMessage object across a socket.
    1.80 + *  @publishedAll
    1.81 + *  @released 
    1.82 + */
    1.83 +class RSmsSocketReadStream : public RReadStream
    1.84 +	{
    1.85 +public:
    1.86 +	IMPORT_C RSmsSocketReadStream(RSocket& aSocket);
    1.87 +private:
    1.88 +	RSmsSocketBuf iBuf;
    1.89 +	};
    1.90 +
    1.91 +/**
    1.92 + *  Stream that writes a CSmsMessage object across a socket.
    1.93 + *  @publishedAll
    1.94 + *  @released 
    1.95 + */
    1.96 +class RSmsSocketWriteStream : public RWriteStream
    1.97 +	{
    1.98 +public:
    1.99 +	IMPORT_C RSmsSocketWriteStream(RSocket& aSocket);
   1.100 +private:
   1.101 +	RSmsSocketBuf iBuf;
   1.102 +	};
   1.103 +
   1.104 +#include "smsustrm.inl"
   1.105 +
   1.106 +#endif // !defined __SMSUSTRM_H__