iaupdate/IAD/engine/inc/iaupdatependingnodesfile.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2007-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:   CIAUpdatePendingNodesFile
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef IA_UPDATE_PENDING_NODES_FILE_H
       
    22 #define IA_UPDATE_PENDING_NODES_FILE_H
       
    23 
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <s32strm.h>
       
    27 #include <e32cmn.h>
       
    28 #include <f32file.h>
       
    29 
       
    30 class CIAUpdaterIdentifier;
       
    31 
       
    32 
       
    33 /**
       
    34  *
       
    35  *
       
    36  * @since S60 v3.2
       
    37  */
       
    38 class CIAUpdatePendingNodesFile : public CBase
       
    39     {
       
    40 
       
    41 public:
       
    42 
       
    43     /**
       
    44      * @note ReadDataL should be called to get the values from the file.
       
    45      * Otherwise, default values are used.
       
    46      *
       
    47      * @note The default path to the file where ReadDataL gets its data
       
    48      * is set to the private directory file of the UI and the default
       
    49      * name of the file is used. If the file path should be changed, 
       
    50      * then use SetFilePathL for this.
       
    51      *
       
    52      * @since S60 v3.2
       
    53      */
       
    54     IMPORT_C static CIAUpdatePendingNodesFile* NewL();
       
    55 
       
    56     IMPORT_C static CIAUpdatePendingNodesFile* NewLC();
       
    57     
       
    58     
       
    59     IMPORT_C virtual ~CIAUpdatePendingNodesFile();
       
    60 
       
    61 
       
    62     IMPORT_C void Reset();
       
    63 
       
    64 
       
    65     IMPORT_C TInt Index() const;
       
    66     
       
    67     IMPORT_C void SetIndex( TInt aIndex );    
       
    68     
       
    69 
       
    70     IMPORT_C RPointerArray< CIAUpdaterIdentifier >& PendingNodes();
       
    71     
       
    72 
       
    73     /**
       
    74      * @return const TDesC& File path that is used for ReadDataL, WriteDataL
       
    75      * and RemoveFile.
       
    76      *
       
    77      * @since S60 v3.2
       
    78      */
       
    79     IMPORT_C const TDesC& FilePath() const;
       
    80 
       
    81     /**
       
    82      * @param aPath The full path of the data file that is used when
       
    83      * ReadDataL, WriteDataL and RemoveFile are used.
       
    84      *
       
    85      * @since S60 v3.2
       
    86      */
       
    87     IMPORT_C void SetFilePathL( const TDesC& aPath );
       
    88 
       
    89 
       
    90     /**
       
    91      * @exception Leaves with KErrNotFound if the file was not found.
       
    92      * Otherwise system wide error code.
       
    93      *
       
    94      * @since S60 v3.2
       
    95      */
       
    96     IMPORT_C TBool ReadDataL();
       
    97 
       
    98     IMPORT_C void WriteDataL();
       
    99 
       
   100 
       
   101     IMPORT_C TInt RemoveFile();    
       
   102 
       
   103 
       
   104 private:
       
   105 
       
   106     // Prevent these if not implemented
       
   107     CIAUpdatePendingNodesFile( const CIAUpdatePendingNodesFile& aObject );
       
   108     CIAUpdatePendingNodesFile& operator =( const CIAUpdatePendingNodesFile& aObject );
       
   109 
       
   110 
       
   111     CIAUpdatePendingNodesFile();
       
   112     
       
   113     void ConstructL();
       
   114 
       
   115 
       
   116     void InternalizeL( RReadStream& aStream );
       
   117 
       
   118     void ExternalizeL( RWriteStream& aStream );
       
   119 
       
   120 
       
   121 private: // data
       
   122 
       
   123 	// file server session
       
   124 	RFs iFsSession;
       
   125 	
       
   126 	// controller data file path
       
   127 	TFileName iPath;
       
   128 
       
   129 
       
   130     // Array of node identifiers that inform what nodes have been set as pending
       
   131     // nodes.
       
   132     RPointerArray< CIAUpdaterIdentifier > iPendingNodes;
       
   133     
       
   134     // This index can be used to divide the pending nodes array
       
   135     // into two parts. Its up to the user to decide the purpose.
       
   136     TInt iIndex;
       
   137 
       
   138     };
       
   139 		
       
   140 #endif // IA_UPDATE_PENDING_NODES_FILE_H
       
   141