connectivitymodules/SeCon/services/pcd/inc/sconpcd.h
branchRCL_3
changeset 19 0aa8cc770c8a
parent 18 453dfc402455
child 20 4a793f564d72
equal deleted inserted replaced
18:453dfc402455 19:0aa8cc770c8a
     1 /*
       
     2 * Copyright (c) 2005-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:  CSConPCD service header
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _SCONPCD_H_
       
    20 #define _SCONPCD_H_
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32cons.h>
       
    26 #include <s32strm.h>
       
    27 
       
    28 #include "sconconmltask.h"
       
    29 
       
    30 class CSConInstallerQueue;
       
    31 class CSConBackupRestoreQueue;
       
    32 class CSconSyncHandler;
       
    33 
       
    34 enum TSConLastConMLOperation
       
    35     {
       
    36     ENoTask = 0,
       
    37     EPutTask,
       
    38     EGetReply
       
    39     };
       
    40 
       
    41 //============================================================
       
    42 // Class CSConPCD declaration
       
    43 //============================================================
       
    44 class CSConPCD : public CBase
       
    45     {
       
    46     public:
       
    47         /**
       
    48          * Two-phase constructor
       
    49          * @return CSConPCD instance
       
    50          */
       
    51         static CSConPCD* NewL();
       
    52         /**
       
    53          * Destructor
       
    54          * @return none
       
    55          */
       
    56         ~CSConPCD();
       
    57         /**
       
    58          * Receives a new task
       
    59          * @param aTask A new task
       
    60          * @return KErrNone if no errors, else system wide error codes
       
    61          */
       
    62         virtual TInt PutTaskL( CSConTask*& aTask );
       
    63         /**
       
    64          * Returns a reply to previous PutTaskL operation
       
    65          * @return CSConStatusReply if reply exists, else return NULL
       
    66          */
       
    67         virtual CSConStatusReply* GetReply();
       
    68         /**
       
    69          * Resets the module to the initial state
       
    70          * @return none
       
    71          */
       
    72         virtual void ResetPCD();
       
    73         
       
    74         virtual void HandleGetSyncRequestL( const TDesC8& aRequest, RWriteStream& aResult, TInt aMaxObjectSize );
       
    75         virtual void HandlePutSyncRequestL( const TDesC8& aRequest, RReadStream& aResult );
       
    76     
       
    77     private:        
       
    78         /**
       
    79          * Collects a status of a specified task / all tasks
       
    80          * @param aTask The number of the specified task
       
    81          * @param aAll If ETrue => receive status of all tasks
       
    82          * @return KErrNone if no errors, else system wide error codes
       
    83          */
       
    84         TInt GetStatusL( TInt aTask, TBool aAll );
       
    85         
       
    86         /**
       
    87          * Cancels a specified task / all tasks
       
    88          * @param aTask The number of the specified task
       
    89          * @param aAll If ETrue => receive status of all tasks
       
    90          * @return KErrNone if no errors, else system wide error codes
       
    91          */
       
    92         TInt CancelL( TInt aTask, TBool aAll );
       
    93         
       
    94         /**
       
    95          * Fills a reply with predefined supported task -information
       
    96          * @param aTask The task
       
    97          * @return KErrNone if no errors, else system wide error codes
       
    98          */
       
    99         TInt SupportedInstTaskL( CSConTask* aTask );
       
   100         
       
   101         /**
       
   102          * Fills a reply with predefined supported task -information
       
   103          * @param aTask The task
       
   104          * @return KErrNone if no errors, else system wide error codes
       
   105          */
       
   106         TInt SupportedBRTaskL( CSConTask* aTask );
       
   107         
       
   108         /**
       
   109          * Fills a reply with predefined Reboot task -information
       
   110          * @param aTask The task
       
   111          * @return KErrNone if no errors, else system wide error codes
       
   112          */
       
   113         TInt RebootTaskL( const CSConTask* aTask );
       
   114         
       
   115         /**
       
   116          * Fills a reply with predefined GetMetadata task -information
       
   117          * @param aTask The task
       
   118          * @return none
       
   119          */
       
   120         void GetMetadataTaskL( CSConTask& aTask );
       
   121         
       
   122         /**
       
   123          * Creates a reply for UpdateDeviceInfo task
       
   124          * @param aMaxObjectSize A max object size to be used
       
   125          * @return none
       
   126          */
       
   127         TInt UpdateDeviceInfoL( TInt aMaxObjectSize );
       
   128         /**
       
   129          * Gets the current max object size
       
   130          * @param aClientObjectSize The object size of the client
       
   131          * @return the max object size
       
   132          */
       
   133         TInt GetMaxObjectSize( TInt aClientObjectSize ) const;
       
   134         
       
   135         /**
       
   136          * Stores a reply
       
   137          * @param aReply The reply to be stored
       
   138          * @return none
       
   139          */
       
   140         void StoreReply( CSConStatusReply*& aReply );
       
   141         
       
   142         /**
       
   143          * Constructor
       
   144          * @return none
       
   145          */
       
   146         CSConPCD();
       
   147         /**
       
   148          * Initializes member data
       
   149          * @return none
       
   150          */
       
   151         virtual void ConstructL();
       
   152         
       
   153     private:
       
   154         CSConInstallerQueue*        iInstallerQueue;
       
   155         CSConBackupRestoreQueue*    iBackupRestoreQueue;
       
   156         CSConStatusReply*           iLatestReply;
       
   157         TInt                        iTaskNumber;
       
   158         TInt                        iMaxObjectSize;
       
   159         TSConLastConMLOperation     iLastOperation;
       
   160         RFs                         iFs;
       
   161         CSconSyncHandler*           iSyncHandler;
       
   162     }; 
       
   163     
       
   164     IMPORT_C CSConPCD* CreateCSConPCDL();
       
   165     typedef CSConPCD* (*TSConCreateCSConPCDFunc) (); 
       
   166 
       
   167 #endif // SCONPCD
       
   168 
       
   169 // End of file