dbcreator/commsdatcreator/inc/cdcprocessorpacketdata.h
changeset 56 dd6aaa97e7b1
parent 0 5a93021fdf25
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dbcreator/commsdatcreator/inc/cdcprocessorpacketdata.h	Mon Aug 23 13:40:12 2010 +0300
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declaration of the class CProcessorPacketData.
+*
+*/
+
+
+
+
+#ifndef PROCESSOR_PACKET_DATA_H
+#define PROCESSOR_PACKET_DATA_H
+
+
+// INCLUDE FILES
+
+#include <e32base.h>
+#include <cmmanagerext.h>
+#include <cmconnectionmethodext.h>
+
+#include "cdcprocessorbase.h"
+
+
+// FORWARD DECLARATION
+
+// CLASS DECLARATION
+
+/**
+ * CLingerElement is array element for linger value end corresponding CM name.
+ */ 
+NONSHARABLE_CLASS( CLingerElement ) : public CBase 
+        {
+        public: 
+        ~CLingerElement();
+        HBufC* iName;
+        HBufC* iLinger; 
+        };
+
+/**
+* CProcessorPacketData
+* Inhertits from the class CProcessorBase.
+* Creates internet Access Point Item from CTagContainer and 
+* adds AP item to database.
+*/
+class CProcessorPacketData : public CProcessorBase
+    {
+    public:
+        /**
+        * Two-phase constructor.
+        * @param aFileReader pointer to the file reader
+        * @param aCmManager Connection Method Manager
+        * @param aPluginArray Array that stores the processed plugins
+        * @param aLingerSettings stores processed GPRS linger values
+        * @return CProcessorPacketData instance.
+        */
+        static CProcessorPacketData* NewL( 
+                        CReaderBase* aFileReader,
+                        RCmManagerExt& aCmMnaager,
+                        RPointerArray< RCmConnectionMethodExt >& aPluginArray,
+                        RPointerArray< HBufC >& aPluginNames,
+                        RPointerArray< CLingerElement >& aLingerSettings);
+        /**
+        * Destructor.
+        */
+        virtual ~CProcessorPacketData();
+        
+        /**
+        * Maps previously stored linger values with connection ID's 
+        * and writes them to repository.
+        */
+        void SaveLingerSettingsL();
+
+    protected:
+        /**
+        * Second phase constructor. Leaves on failure.
+        */
+        void ConstructL();
+
+        /**
+        * Constructor.
+        * @param aFileReader pointer to the file reader
+        * @param aCmManager Connection Method Manager
+        * @param aPluginArray Array that stores the processed plugins
+        * @param aLingerSettings stores processed GPRS linger values
+        */
+        CProcessorPacketData( CReaderBase* aFileReader,
+                              RCmManagerExt& aCmManager,
+                              RPointerArray< RCmConnectionMethodExt >& aPluginArray,
+                              RPointerArray< HBufC >& aPluginNames,
+                              RPointerArray< CLingerElement >& aLingerSettings);
+        
+        /**
+        * From CProcessorBase. Processes the actual tag.
+        * @param aFieldIDPresent shows if field id is read from input file
+        * @return the result of the process, KErrNone if the actual tag is
+        * valid.
+        */
+        virtual void ProcessSpecialFieldsL( TInt aField, HBufC* aTagPtr, TInt aDx );
+        
+        /**
+         * Writes connections linger value to repository.
+         * @param aIapId is the id of connection to which linger value is set.
+         * @param aLingerInterval linger value to set to connection.
+         */
+        void AddLingerL( const TInt aIapId, const TInt aLingerInterval);
+        
+    private:
+        
+        // @var Stores linger values
+        RPointerArray< CLingerElement >* iLingerSettings;
+    };
+
+
+#endif PROCESSOR_PACKET_DATA_H
+
+
+// End of File.