mtpdataproviders/mtppictbridgedp/pictbridgeengine/inc/dpsoperation.h
branchRCL_3
changeset 19 0aa8cc770c8a
equal deleted inserted replaced
18:453dfc402455 19:0aa8cc770c8a
       
     1 /*
       
     2 * Copyright (c) 2006, 2007 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:  This classes define dps operations requests and replys. 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DPSOPERATION_H
       
    20 #define DPSOPERATION_H
       
    21 
       
    22 #include <s32file.h>
       
    23 #include "dpsparam.h"
       
    24 
       
    25 class CDpsTransaction;
       
    26 /**
       
    27 *   This is the base class for all dps operations. 
       
    28 */
       
    29 class TMDpsOperation
       
    30     {
       
    31     friend class CDpsTransaction;
       
    32     public:
       
    33         inline TMDpsOperation();
       
    34         /**
       
    35         *   Fills in dps operation request parameters. Dps engine must
       
    36         *   call this function to fill the dps operation request parameters.
       
    37         *   @param aArgs the dps operation request arguments
       
    38         *   @param aElems the dps operation elements
       
    39         *   @param aAttrib the dps operation attributes
       
    40         *   @param aTrader the pointer to CDpsTransaction object for filling 
       
    41         *   the request arguments for Dps Engine
       
    42         *   @return TInt KErrNone if successful or other system error if failed
       
    43         */
       
    44     
       
    45     protected:
       
    46         inline virtual TInt FillReqArgs(TDpsArgArray& aArgs, 
       
    47                                         TDpsEleArray& aElems,
       
    48                                         TDpsAttribute& aAttrib, 
       
    49                                         CDpsTransaction* aTrader);
       
    50             
       
    51        
       
    52         /**
       
    53         *   Fills in the dps operation reply parameters. Dps engine uses this
       
    54         *   function after the dps operation gets responsed. After this call,
       
    55         *   dps engine will call RequestComplete() to inform the client the
       
    56         *   completion of the dps operation.
       
    57         *   @param aArgs dps operation reply arguments.
       
    58         *   @param aParam the pointer to CDpsTransacton object for filling 
       
    59         *   the reply arguments for the client (print UI engine)
       
    60         *   @return TInt KErrNone if successful or other system error if failed
       
    61         */    
       
    62         inline virtual TInt FillRepArgs(const TDpsArgArray& aArguments, 
       
    63                                         CDpsTransaction* aTrader);
       
    64                                         
       
    65            
       
    66         /**
       
    67         *   Creates the Dps request script
       
    68         *   @param aArgs the arguments of the Dps request
       
    69         *   @param aElements the elements of the Dps request
       
    70         *   @param aAttribute the attribute of the Dps request
       
    71         *   @param aScript the buffer of the script
       
    72         *   @param aTrader the pointer to the CDpsTransaction object for 
       
    73         *   creating the Dps script
       
    74         */
       
    75         IMPORT_C virtual void CreateReqScriptL(const TDpsArgArray& aArguments, 
       
    76                                               const TDpsEleArray& aElements,
       
    77                                               TDpsAttribute aAttribute, 
       
    78                                               RWriteStream& aScript, 
       
    79                                               CDpsTransaction* aTrader); 
       
    80         
       
    81         
       
    82     public:
       
    83         // the dps operation result
       
    84         TDpsResult iResult;
       
    85         // the dps operaton enumeration
       
    86         TDpsSupportedOp iOperation;
       
    87     };
       
    88 
       
    89 /**
       
    90 *   The class for dps startJob operation
       
    91 */
       
    92 class TDpsStartJob : public TMDpsOperation
       
    93     {
       
    94     friend class CDpsTransaction;
       
    95     public:
       
    96         /**
       
    97         *   Default constructor
       
    98         */
       
    99         inline TDpsStartJob();
       
   100             
       
   101     private:
       
   102         /**
       
   103         *   @see TMDpsOperation 
       
   104         */
       
   105         IMPORT_C TInt FillReqArgs(TDpsArgArray& aArgs, TDpsEleArray& aElems,
       
   106                                   TDpsAttribute& aAttrib, 
       
   107                                   CDpsTransaction* aTrader);
       
   108         
       
   109         /**
       
   110         *   @see TMDpsOperation 
       
   111         */                          
       
   112         IMPORT_C void CreateReqScriptL(const TDpsArgArray& aArgs, 
       
   113                                       const TDpsEleArray& aElements, 
       
   114                                       TDpsAttribute aAttribute, 
       
   115                                       RWriteStream& aScript, 
       
   116                                       CDpsTransaction* aTrader); 
       
   117         
       
   118     public:    
       
   119         // the request operation parameter which needed to be filled by 
       
   120         // the client    
       
   121         TDpsStartJobReq iReqParam;
       
   122         
       
   123     };
       
   124 
       
   125 /**
       
   126 *   The class for dps abortJob operation
       
   127 */    
       
   128 class TDpsAbortJob : public TMDpsOperation
       
   129     {
       
   130     friend class CDpsTransaction;
       
   131     public:
       
   132         /**
       
   133         *   Default constructor
       
   134         */
       
   135         inline TDpsAbortJob();
       
   136         
       
   137     private:
       
   138         /**
       
   139         *   @see TMDpsOperation 
       
   140         */
       
   141         IMPORT_C TInt FillReqArgs(TDpsArgArray& aArgs, TDpsEleArray& aElems,
       
   142                                  TDpsAttribute& aAttrib, 
       
   143                                  CDpsTransaction* aTrader);
       
   144         
       
   145     public:    
       
   146         // the request operation parameter which needed to be filled by 
       
   147         // the client        
       
   148         TDpsAbortJobReq iReqParam;
       
   149         
       
   150     };
       
   151 
       
   152 /**
       
   153 *   The class for dps continueJob operation
       
   154 */        
       
   155 class TDpsContinueJob : public TMDpsOperation
       
   156     {
       
   157     friend class CDpsTransaction;
       
   158     public:
       
   159         /**
       
   160         *   Default constructor
       
   161         */
       
   162         inline TDpsContinueJob();           
       
   163     };
       
   164 
       
   165 /**
       
   166 *   The class for dps continueJob operation
       
   167 */    
       
   168 class TDpsGetJobStatus : public TMDpsOperation
       
   169     {
       
   170     friend class CDpsTransaction;
       
   171     public:    
       
   172         /**
       
   173         *   Default constructor
       
   174         */
       
   175         inline TDpsGetJobStatus();
       
   176         
       
   177     private:        
       
   178         /**
       
   179         *   @see TMDpsOperation 
       
   180         */    
       
   181         IMPORT_C TInt FillRepArgs(const TDpsArgArray& aArgs, 
       
   182                                   CDpsTransaction* aTrader);
       
   183         
       
   184     public:    
       
   185         // the request operation parameter which needed to be filled by 
       
   186         // the client
       
   187         TDpsJobStatusRep iRepParam;
       
   188         
       
   189     };
       
   190  
       
   191 /**
       
   192 *   The class for dps continueJob operation
       
   193 */    
       
   194 class TDpsGetPrinterStatus : public TMDpsOperation
       
   195     {
       
   196     friend class CDpsTransaction;
       
   197     public:    
       
   198         /**
       
   199         *   Default constructor
       
   200         */
       
   201         inline TDpsGetPrinterStatus();
       
   202         
       
   203     private:        
       
   204         /**
       
   205         *   @see TMDpsOperation 
       
   206         */    
       
   207         IMPORT_C TInt FillRepArgs(const TDpsArgArray& aArgs, 
       
   208                                   CDpsTransaction* aTrader);
       
   209         
       
   210     public:    
       
   211         // the request operation parameter which needed to be filled by 
       
   212         // the client
       
   213         TDpsPrinterStatusRep iRepParam;
       
   214         
       
   215     };
       
   216     
       
   217 /**
       
   218 *   The class for dps continueJob operation
       
   219 */
       
   220 class TDpsGetCapability : public TMDpsOperation
       
   221     {
       
   222     friend class CDpsTransaction;
       
   223     public:
       
   224         /**
       
   225         *   Default constructor
       
   226         */
       
   227         inline TDpsGetCapability();
       
   228         
       
   229     private:        
       
   230         /**
       
   231         *   @see TMDpsOperation 
       
   232         */
       
   233         IMPORT_C TInt FillReqArgs(TDpsArgArray& aArgs, TDpsEleArray& aElems,
       
   234                                  TDpsAttribute& aAttrib, 
       
   235                                  CDpsTransaction* aTrader);
       
   236         /**
       
   237         *   @see TMDpsOperation 
       
   238         */                                 
       
   239         IMPORT_C TInt FillRepArgs(const TDpsArgArray& aArgs, 
       
   240                                   CDpsTransaction* aParam);
       
   241         
       
   242         /**
       
   243         *   @see TMDpsOperation 
       
   244         */                          
       
   245         IMPORT_C void CreateReqScriptL(const TDpsArgArray& aArgs, 
       
   246                                        const TDpsEleArray& aElements,
       
   247                                        TDpsAttribute aAttribute, 
       
   248                                        RWriteStream& aScript, 
       
   249                                        CDpsTransaction* aTrader);
       
   250         
       
   251     public:    
       
   252         // the request operation parameter which needed to be filled by 
       
   253         // the client
       
   254         TDpsCapReq iReqParam;
       
   255         // the request operation parameter which needed to be filled by 
       
   256         // the client
       
   257         TDpsCapRep iRepParam;
       
   258         
       
   259     };
       
   260 
       
   261 /**
       
   262 *   The class for dps continueJob operation
       
   263 */    
       
   264 class TDpsConfigPrintService : public TMDpsOperation
       
   265     {
       
   266     friend class CDpsTransaction;
       
   267     public:
       
   268         /**
       
   269         *   Default constructor
       
   270         */
       
   271         inline TDpsConfigPrintService();
       
   272         
       
   273     private:        
       
   274         /**
       
   275         *   @see TMDpsOperation 
       
   276         */
       
   277         IMPORT_C TInt FillReqArgs(TDpsArgArray& aArgs, TDpsEleArray& aElems,
       
   278                                  TDpsAttribute& aAttrib, 
       
   279                                  CDpsTransaction* aTrader);
       
   280         /**
       
   281         *   @see TMDpsOperation 
       
   282         */                                 
       
   283         IMPORT_C TInt FillRepArgs(const TDpsArgArray& aArgs, 
       
   284                                   CDpsTransaction* aTrader);
       
   285                                                                            
       
   286     public:    
       
   287         // the request operation parameter which needed to be filled by 
       
   288         // the client
       
   289         TDpsConfigPrintReq iReqParam;
       
   290         
       
   291         // the request operation parameter which needed to be filled by 
       
   292         // the client
       
   293         TDpsConfigPrintRep iRepParam;
       
   294 
       
   295     };
       
   296 
       
   297 /**
       
   298 *   The class defines dps events
       
   299 */    
       
   300 NONSHARABLE_CLASS(TDpsEvents) 
       
   301 	{
       
   302 	public:
       
   303 	    // the event enumeration
       
   304 		TDpsEvent iEvent;
       
   305 		// jobStatus event
       
   306 		TDpsGetJobStatus iJobEvent;
       
   307 		// printerStatus event
       
   308 		TDpsGetPrinterStatus iPrinterEvent;
       
   309 	};    
       
   310 	
       
   311 #include "dpsoperation.inl"	
       
   312 #endif