deviceupdatesui/cpqtsp/inc/CWPNameValue.h
changeset 18 7d11f9a6646f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deviceupdatesui/cpqtsp/inc/CWPNameValue.h	Fri Apr 16 14:53:31 2010 +0300
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2002 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: 
+*     This class encapsulates a name and value pair.
+*
+*/
+
+
+
+#ifndef _CWPNameValue_H_
+#define _CWPNameValue_H_
+
+// INCLUDES
+
+#include <e32base.h>                    // CBase
+
+// CLASS DECLARATION
+
+/**
+ * Class holds name and value text pairs.
+ */
+class CWPNameValue : public CBase
+    {
+    public: // construction
+
+         /**
+         * Two phased constructor.
+         * @param aName The field name.
+         * @param aValue The field value.
+         * @return The newly constructed object.
+         */
+        IMPORT_C static CWPNameValue* NewL( HBufC* aName, HBufC* aValue );
+        IMPORT_C static CWPNameValue* NewL(const TDesC& aName, const TDesC& aValue);
+        IMPORT_C static CWPNameValue* NewLC(const TDesC& aName, const TDesC& aValue);
+
+        /// Destructor
+        ~CWPNameValue();
+    
+    public: // new functions
+
+        /// @return Name or KNullDesC
+        IMPORT_C const TDesC& Name() const;
+        /// @return Value or KNullDesC
+        IMPORT_C const TDesC& Value() const;
+
+    private: // construction
+
+        /**
+         * Second phase constructor.
+         * @param aName The field name.
+         * @param aValue The field value.
+         */
+        void ConstructL( const TDesC& aName, const TDesC& aValue );
+
+        /**
+         * Second phase constructor.
+         * @param aName The field name.
+         * @param aValue The field value.
+         */
+        void ConstructL( HBufC* aName, HBufC* aValue );
+
+    private: // hidden	
+
+        /// Default constructor.
+        CWPNameValue();
+
+        /// Another constructor
+        CWPNameValue( HBufC* aName, HBufC* aValue );
+
+        /// Copy contructor prohibited.
+        CWPNameValue(const CWPNameValue& aSource);
+
+        /// Assignment operator prohibited.
+        const CWPNameValue& operator=(const CWPNameValue& aSource);
+
+    private:
+    
+        /// Own. Pointer to the name.
+        HBufC* iName;
+
+        /// Own. Pointer to the value.
+        HBufC* iValue;
+    };
+
+#endif // _CWPNameValue_H_
+
+// End of file