networkingtestandutils/networkingunittest/tdummyetel/CFAX32.H
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     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 #ifndef __cfax32_h
       
    19 #define __cfax32_h
       
    20 
       
    21 /********************************************************************/
       
    22 
       
    23 /********************************************************************/
       
    24 
       
    25 // These are the other include files used when sending and receiving
       
    26 // faxes.  The order of inclusion should not be changed.  Unfortunately,
       
    27 // the design of the engine means that there's a very close coupling
       
    28 // between the various classes involved, and while each class doesn't
       
    29 // need to know how the other work, they all need to know what the others
       
    30 // have to offer.  The fax settings need to be accessible from modem for
       
    31 // autodetection to work, and since the modem handles the session log
       
    32 // and progress reporting, the the cfaxtransfersource and
       
    33 // cfaxmodemdriver classes need to be able know about that.  The inline
       
    34 // functions at the end of this faxtrans.h file clearly won't compile if
       
    35 // they don't know about cfaxtransfersource either. Ah well. So much for
       
    36 // neat modular encapsulation.
       
    37 
       
    38 
       
    39 #include <f32file.h>
       
    40 
       
    41 #include <c32comm.h>
       
    42 #include <s32file.h>
       
    43 #include <s32mem.h>
       
    44 
       
    45 #include <commdb.h>
       
    46 #include <cdblen.h> 
       
    47 #include <faxstore.h>
       
    48 #include <faxdefn.h>
       
    49 
       
    50 #include "dummyetel.h"
       
    51 #include "faxtsrc.h"
       
    52 #include "faxset.h"
       
    53 #include "FaxStd.h"
       
    54 
       
    55 /********************************************************************/
       
    56 
       
    57 // now the CFaxTransfer class
       
    58 
       
    59 
       
    60 //***************************** comment for 2D faxing****************************
       
    61 // The TFaxCompression parameter required by the AddSourceL() function is an enum type defined as 
       
    62 // enum TFaxCompression
       
    63 //		{
       
    64 //			Prefer1D,Prefer2D
       
    65 //		}
       
    66 // this enum is defined in faxtsrc.h
       
    67 
       
    68 /**
       
    69 @internalAll
       
    70 */
       
    71 enum TFaxClientProgress
       
    72 	{
       
    73 	EProgressConverting,	// Fax Progress Information not yet available
       
    74 	EProgressRxTx			// Refer to Fax Progress Chunck for more detailed information
       
    75 	};
       
    76 
       
    77 class CFaxTransfer : public CBase
       
    78 /**
       
    79 @internalComponent
       
    80 */
       
    81    {
       
    82 	public:
       
    83 		IMPORT_C static CFaxTransfer * NewL (const TFaxSettings &);
       
    84 		IMPORT_C static CFaxTransfer * NewLC (const TFaxSettings &);
       
    85 
       
    86 		IMPORT_C TInt Start (TRequestStatus &);		// starts the Fax Client thread		
       
    87 		IMPORT_C TInt Progress ();					// Gets the progress of the fax session (updates the global progress chunk
       
    88 		IMPORT_C void SetPhoneNumberL (TDesC8 &);	// sets the phone number to dial to
       
    89 		IMPORT_C void Cancel ();					// cancels the fax session
       
    90 		IMPORT_C void Stop ();						// calls Close() to the thread handle
       
    91 		~CFaxTransfer ();							// destructor
       
    92 
       
    93 		IMPORT_C void AddSourceL (const TFileName &,TFaxPreferredCompression=Prefer1D);			// TFaxPreferredCompression can be 
       
    94 		IMPORT_C void AddSourceL (const TFileName &, TInt, TFaxPreferredCompression=Prefer1D);   // one of Prefer1D or Prefer2D
       
    95 		IMPORT_C void AddSourceL (const TFileName &, TInt, TInt, TFaxPreferredCompression=Prefer1D);	// use this function to 
       
    96 																				// indicate the fax document for sending
       
    97 		IMPORT_C void RemoveAllSources ();						// Remove all fax pages from the sent list
       
    98 		inline void SetReceiveFileName (const TFileName &);		// Set the name of the filename for fax reception
       
    99 		inline void SetMode (TFaxMode);
       
   100 		inline void SetPhoneNumber (TDesC8 &);
       
   101 		TInt GetPhoneInfoForTsy(const TDes& aTsyName, RTelServer::TPhoneInfo& aPhoneInfo) const;
       
   102 		void GetPhoneModuleNameL(TDes& aModuleName) const;
       
   103 		void FaxReceiveL ();		
       
   104 		void FaxTransmitL ();
       
   105 		
       
   106 
       
   107 				
       
   108 		TFaxClientProgress iFaxClientProgress;
       
   109 		RTelServer iTelServer;
       
   110 		RLine iLine ;
       
   111 		RCall iCall ;
       
   112 		RPhone iPhone ;
       
   113 		RFax iFax ;
       
   114 		TBool iFaxStarted;
       
   115 		CFaxTransferSource * iSource;
       
   116 		TFaxMode iMode;
       
   117 		RFax::TProgress iProgress ;
       
   118 		RCall::TFaxSessionSettings iFaxSessionSettings;
       
   119 		
       
   120 		
       
   121 	protected:
       
   122 		RThread iDriverThread;						// fax client thread handle
       
   123 //		RThread iConverterThread;
       
   124 		CFaxTransfer();								// CFaxTransfer Constructor
       
   125 		TBool iConverting;							// flag used when preparing the 2D version of the fax document
       
   126 		TRequestStatus iTransferStatus ;			// status of the fax data transfer
       
   127 		TRequestStatus iClientCancel;				// status of the cancel request
       
   128 		TBuf8 < KMaxFaxBuf > iDataBuf;				// buffer to store 
       
   129 		TFaxSettings iFaxSettings;
       
   130 		TFileName iReceiveFileName ;				// only used when receiving
       
   131 		TBuf<KMaxDialString> iPhoneNumber ; 		// only used when dialling
       
   132 		void Convert2dL ();		// convert from 1D to 2D
       
   133 		void Convert1dL ();		// convert from 2D to 1D
       
   134 
       
   135 		
       
   136 		TInt StartThread();
       
   137 		void ConstructL (const TFaxSettings &);
       
   138 		void CancelFaxServerSession ();
       
   139 		void SetFaxSettingsL();
       
   140 	
       
   141      
       
   142    };
       
   143 
       
   144 /********************************************************************/
       
   145 
       
   146 #include "cfax32.inl"
       
   147 
       
   148 #endif