menucontentsrv/enginc/menuengobjectattr.h
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MENUENGOBJECTATTR_H__
       
    19 #define __MENUENGOBJECTATTR_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 /**
       
    24 * Menu Engine Object attribute.
       
    25 */
       
    26 NONSHARABLE_CLASS( CMenuEngObjectAttr ): public CBase
       
    27     {
       
    28 
       
    29 public:     // construction
       
    30 
       
    31     /**
       
    32     * Destructor.
       
    33     */
       
    34     virtual ~CMenuEngObjectAttr();
       
    35 
       
    36     /**
       
    37     * Two-phased constructor.
       
    38     * @param aName Name.
       
    39     * @return The created object.
       
    40     */
       
    41     static CMenuEngObjectAttr* NewL( const TDesC& aName );
       
    42 
       
    43     /**
       
    44     * Two-phased constructor.
       
    45     * @param aName Name.
       
    46     * @return The created object.
       
    47     */
       
    48     static CMenuEngObjectAttr* NewLC( const TDesC& aName );
       
    49 
       
    50 protected:  // construction
       
    51 
       
    52     /**
       
    53      * Constructor
       
    54      */
       
    55     CMenuEngObjectAttr();
       
    56     
       
    57     /**
       
    58      * 2nd phase constructor.
       
    59      * @param aName Name.
       
    60      */
       
    61     void ConstructL( const TDesC& aName );
       
    62 
       
    63 public:     // new methods
       
    64 
       
    65     /**
       
    66     * Get name.
       
    67     * @return Name.
       
    68     */
       
    69     TPtrC Name() const { return iName; }
       
    70 
       
    71     /**
       
    72     * Get value.
       
    73     * @return Value.
       
    74     */
       
    75     TPtrC Value() const { return iValue; }
       
    76 
       
    77     /**
       
    78     * Set (or replace) value.
       
    79     * @param aValue Value.
       
    80     */
       
    81     void SetValueL( const TDesC& aValue );
       
    82 
       
    83     /**
       
    84     * Get localized status.
       
    85     * @return ETrue if localized.
       
    86     */
       
    87     TBool Localized() const { return iLocalized; }
       
    88 
       
    89     /**
       
    90     * Set localized status.
       
    91     * @param aLocalized ETrue if localized.
       
    92     */
       
    93     void SetLocalized( TBool aLocalized ) { iLocalized = aLocalized; }
       
    94 
       
    95 private:    // data
       
    96     
       
    97     RBuf iName; ///< Name. Own.
       
    98     RBuf iValue; ///< Value. Own.
       
    99     TBool iLocalized; ///< Localized status.
       
   100 
       
   101     };
       
   102 
       
   103 /**
       
   104 * Array of CMenuEngObjectAttr-s.
       
   105 */
       
   106 NONSHARABLE_CLASS( RMenuEngObjectAttrArray )
       
   107 : public RPointerArray<CMenuEngObjectAttr>
       
   108     {
       
   109 
       
   110 public:     // new methods
       
   111 
       
   112     /**
       
   113     * Find attribute by name.
       
   114     * @param aName Name.
       
   115     * @return Index of attribute, or KErrNotFound.
       
   116     */
       
   117     TInt Find( const TDesC& aName ) const;
       
   118 
       
   119     };
       
   120 
       
   121 #endif // __MENU_ENG_OBJECT_ATTR_H__