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