messagingappbase/smartmessaging/msgeditorutils/inc/MsgNameValue.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002 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:  
       
    15 *     This class encapsulates a name and value pair.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef _CMSGNAMEVALUE_H_
       
    23 #define _CMSGNAMEVALUE_H_
       
    24 
       
    25 // INCLUDES
       
    26 
       
    27 #include <e32base.h>                    // CBase
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32  * Class holds name and value text pairs.
       
    33  */
       
    34 class CMsgNameValue : public CBase
       
    35     {
       
    36     public: // construction
       
    37 
       
    38          /**
       
    39          * Two phased constructor.
       
    40          * @param aName The field name.
       
    41          * @param aValue The field value.
       
    42          * @return The newly constructed object.
       
    43          */
       
    44         IMPORT_C static CMsgNameValue* NewL( HBufC* aName, HBufC* aValue );
       
    45         IMPORT_C static CMsgNameValue* NewL(const TDesC& aName, const TDesC& aValue);
       
    46         IMPORT_C static CMsgNameValue* NewLC(const TDesC& aName, const TDesC& aValue);
       
    47 
       
    48         /// Destructor
       
    49         IMPORT_C ~CMsgNameValue();
       
    50     
       
    51     public: // new functions
       
    52 
       
    53         /// @return Name or KNullDesC
       
    54         IMPORT_C const TDesC& Name() const;
       
    55         /// @return Value or KNullDesC
       
    56         IMPORT_C const TDesC& Value() const;
       
    57 
       
    58     private: // construction
       
    59 
       
    60         /**
       
    61          * Second phase constructor.
       
    62          * @param aName The field name.
       
    63          * @param aValue The field value.
       
    64          */
       
    65         void ConstructL( const TDesC& aName, const TDesC& aValue );
       
    66 
       
    67         /**
       
    68          * Second phase constructor.
       
    69          * @param aName The field name.
       
    70          * @param aValue The field value.
       
    71          */
       
    72         void ConstructL( HBufC* aName, HBufC* aValue );
       
    73 
       
    74     private: // hidden
       
    75 
       
    76         /// Default constructor.
       
    77         CMsgNameValue();
       
    78 
       
    79         /// Another constructor
       
    80         CMsgNameValue( HBufC* aName, HBufC* aValue );
       
    81 
       
    82         /// Copy contructor prohibited.
       
    83         CMsgNameValue(const CMsgNameValue& aSource);
       
    84 
       
    85         /// Assignment operator prohibited.
       
    86         const CMsgNameValue& operator=(const CMsgNameValue& aSource);
       
    87 
       
    88     private:
       
    89     
       
    90         /// Own. Pointer to the name.
       
    91         HBufC* iName;
       
    92 
       
    93         /// Own. Pointer to the value.
       
    94         HBufC* iValue;
       
    95     };
       
    96 
       
    97 #endif // _CMSGNAMEVALUE_H_
       
    98 
       
    99 // End of file