telephonyserverplugins/common_tsy/commontsy/inc/mmfax/CMmTsyFax.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 /*
       
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMMTSYFAX_H
       
    21 #define CMMTSYFAX_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "cmmfaxcompletion.h"
       
    25 #include "et_phone.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CMmFaxExt;
       
    29 
       
    30 //  CLASS DEFINITIONS 
       
    31 
       
    32 /** 
       
    33 *  CMmTsyFax contains Fax operation methods.  
       
    34 */
       
    35 
       
    36 class CMmTsyFax
       
    37         : public CFaxBase
       
    38     {
       
    39     public:
       
    40 
       
    41         /**
       
    42          * Two-phased constructor.
       
    43          */
       
    44         static CMmTsyFax* NewL( CMmFaxExt* aFaxExt );
       
    45 
       
    46         /**
       
    47          * Destructor.
       
    48          */
       
    49         ~CMmTsyFax();
       
    50    
       
    51     public: //New functions
       
    52 
       
    53         /**
       
    54          * Init. Etel server call this. Do nothing.
       
    55          *         
       
    56          *
       
    57          */
       
    58         virtual void Init();
       
    59         
       
    60         /**
       
    61          * Utility to cleanup stack.
       
    62          *         
       
    63          *
       
    64          * @param aObj, pointer to object to be closed
       
    65          */
       
    66         static void CloseFax( TAny* aObj );
       
    67         
       
    68         /**
       
    69          * Request mode check. Etel server calls this.
       
    70          *         
       
    71          *
       
    72          * @param aIpc, IPC value
       
    73          */
       
    74         virtual CTelObject::TReqMode ReqModeL( const TInt aIpc );
       
    75         
       
    76         /**
       
    77          * Read fax data into descriptor, asynchronously.
       
    78          *         
       
    79          *
       
    80          * @param aTsyReqHandle, reqhandle
       
    81          * @param aFaxPage, pointer to object to be read
       
    82          * @return Error value
       
    83          */
       
    84         virtual TInt Read( const TTsyReqHandle aTsyReqHandle,
       
    85             TDes8* aFaxPage );
       
    86         
       
    87         /**
       
    88          * Send fax data in descriptor to fax module, asynchronously.
       
    89          *         
       
    90          *
       
    91          * @param aTsyReqHandle, reqhandle
       
    92          * @param aFaxPage, pointer to object to be read
       
    93          * @return Error value
       
    94          */
       
    95         virtual TInt Write( const TTsyReqHandle aTsyReqHandle,
       
    96             TDesC8* aFaxPage );
       
    97         
       
    98         /**
       
    99          * Send request for notification of end of page to fax module.
       
   100          *         
       
   101          *
       
   102          * @param aTsyReqHandle, reqhandle
       
   103          * @return Error value
       
   104          */
       
   105         virtual TInt WaitForEndOfPage( const TTsyReqHandle aTsyReqHandle );
       
   106         
       
   107         /**
       
   108          * Cancel the entire fax session.
       
   109          *         
       
   110          *
       
   111          * @param aTsyReqHandle, reqhandle
       
   112          * @return Error value
       
   113          */
       
   114         virtual TInt TerminateFaxSession( const TTsyReqHandle aTsyReqHandle );
       
   115         
       
   116         /**
       
   117          * Registers notification in use.
       
   118          *         
       
   119          *
       
   120          * @param aIpc, IPC value
       
   121          * @return Error value
       
   122          */
       
   123        virtual TInt RegisterNotification( const TInt aIpc );
       
   124         
       
   125         /**
       
   126          * Deregisters notification in use.
       
   127          *         
       
   128          *
       
   129          * @param aIpc, IPC value
       
   130          * @return Error value
       
   131          */
       
   132         virtual TInt DeregisterNotification( const TInt aIpc );
       
   133         
       
   134         /**
       
   135           * Setup the terminate fax flag.
       
   136           *         
       
   137           *
       
   138           */
       
   139 		void Terminate();
       
   140     
       
   141     private:
       
   142     
       
   143 		/**
       
   144           * C++ default constructor.
       
   145           */        
       
   146         CMmTsyFax( CMmFaxExt* aFaxExt );
       
   147         
       
   148         /**
       
   149           * By default Symbian 2nd phase constructor is private.
       
   150           */
       
   151         void ConstructL();
       
   152         
       
   153     public: //Data
       
   154     
       
   155         // direction of fax data flow
       
   156     	enum TDataDirection
       
   157         	{
       
   158         	ESendData,
       
   159         	EReceiveData,
       
   160         	EUnknown
       
   161         	};	
       
   162     
       
   163     private: // Data
       
   164 
       
   165         /**
       
   166          * Fax extension object pointer.
       
   167          * Own.         
       
   168          */
       
   169         CMmFaxExt* iFaxExt;
       
   170 
       
   171         /**
       
   172          * Fax call direction.
       
   173          */        
       
   174         TDataDirection iDataDirection;
       
   175 
       
   176         /**
       
   177          * Fax terminate flag.
       
   178          */        
       
   179         TBool iTerminate;
       
   180     };
       
   181 
       
   182 #endif    // CMMTSYFAX_H  
       
   183             
       
   184 // End of File