fax/faxclientandserver/FAXSVR/FAXMODEM.H
branchRCL_3
changeset 65 630d2f34d719
parent 61 17af172ffa5f
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Contents :  fax s/r header file
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent 
       
    21 */
       
    22 
       
    23 #ifndef __FAXMODEM_H
       
    24 #define __FAXMODEM_H
       
    25 
       
    26 #include "FAXLOG.H"
       
    27 // high level modem control functions
       
    28 
       
    29 class CFaxModem : public CBase
       
    30 /**
       
    31 @internalComponent
       
    32 */
       
    33 	{
       
    34 public:
       
    35 	static CFaxModem * NewL (TFaxServerSessionSettings *,RFax::TProgress& aProgress);
       
    36 	static CFaxModem * NewLC (TFaxServerSessionSettings *,RFax::TProgress& aProgress);
       
    37 	CFaxModem (RFax::TProgress& aProgress);	// added by MattS
       
    38 	~CFaxModem ();
       
    39 
       
    40 private:
       
    41 	void ConstructL (TFaxServerSessionSettings *);
       
    42 	TInt SubImportL (TDes8 &, TInt);	// chop up long timeouts
       
    43 	void Dropdtr (void);				// drop DTR for a second
       
    44 	void LowerDTR (void);				// do this to hang up modem
       
    45 	void RaiseDTR (void);				// normal port state
       
    46 	void Speed (TBps);					// set port speed
       
    47 	void SendL (const TDesC8 &);		// Send a descriptor
       
    48 	void HangupProcedureL();			// Destructor Hangup procedure
       
    49 	void SetModemCommandModeL(void);	// Switch modem into command mode and clear its buffer.
       
    50 
       
    51 public:
       
    52 	TInt GetMatchL (const TDesC8 &, TInt);
       
    53 	TInt ImportL (TDes8 &, TInt);
       
    54 	TInt ExportL (const TDesC8 &);
       
    55 	TInt clock (void);					// get ticks since start
       
    56 	void Silence (void);
       
    57 	void Silence (TInt) const;
       
    58 	void Xonon (void);					// set Kxon/Kxoff
       
    59 	void Xonoff (void);					// no handshaking, normal port state
       
    60 	TInt Rxstat (void);					// Any character waiting to be read ?
       
    61 	TInt Txstat (void);					// Any characters waiting to be sent ?
       
    62 	void TxcharL (TUint8);				// this sends a byte
       
    63 	inline void SendTransmitBufferL (void);
       
    64 	void CommitTransmitBufferL (void);
       
    65 	TInt RxcharWaitL (TInt &);
       
    66 	void ProgressUpdateL ();
       
    67 
       
    68 	TInt iVerbose;
       
    69 	TInt iCancel;
       
    70 	RFax::TProgress& iProgress;			// was TFaxTransferProgress. MattS.
       
    71 	TBuf8 < 256 > iOurMessage;			// for feedback
       
    72 
       
    73 	TInt iGranularity;					// for looking up timer granularity
       
    74 	TInt iCalls;						// call calibration for high granularity
       
    75 	TBuf8 < 1 > iReadone;				// for single character reads
       
    76 	TBuf8 < KBufSize+16 > iTransmitBuffer;	// send data i/o buffer
       
    77 	TBuf8 < KBufSize > iReceiveBuffer;		// read data i/o buffer
       
    78 
       
    79 protected:									// all these will default to EFalse
       
    80 	TBool iFileSessionOpen;
       
    81 	TBool iFileOpen;
       
    82 	TBool iPortOpen;
       
    83 	TBool iModemSet;
       
    84 	TBool iTimingLoopDelay;
       
    85 
       
    86 	TCommConfig iRS232Settings;
       
    87 
       
    88 	TRequestStatus iRecstat;				// for reads
       
    89 	TRequestStatus iTranstat;				// for sends
       
    90 	TBuf8 < 1 > iSendone;					// for single character sends
       
    91 	TTime iStartTime;						// time we started at
       
    92 
       
    93 	RComm iCommSession;
       
    94 	RFs iFileSession;
       
    95 	RFile iFile;
       
    96 	};
       
    97 
       
    98 /********************************************************************/
       
    99 
       
   100 #include "FAXMODEM.INL"
       
   101 
       
   102 #endif
       
   103