javacommons/security/legacysupport/midp2userpreferences/inc/MMIDletSuiteCustomAttributes.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2003-2004 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 
       
    19 /**
       
    20  *
       
    21  * @file    MMIDletSuiteCustomAttributes.h
       
    22  *
       
    23  * @internalComponent
       
    24  *
       
    25  */
       
    26 
       
    27 #ifndef MMIDLETSUITECUSTOMATTRIBUTES_H
       
    28 #define MMIDLETSUITECUSTOMATTRIBUTES_H
       
    29 
       
    30 #include <e32std.h>
       
    31 
       
    32 namespace MIDP
       
    33 {
       
    34 
       
    35 /**
       
    36  *
       
    37  * The abstract interface to the modifiable custom attributes
       
    38  * of an individual MIDlet suite.
       
    39  *
       
    40  */
       
    41 
       
    42 /**
       
    43  * The names of the known common custom attributes
       
    44  */
       
    45 _LIT(KOnScreenKeyboardAttribute, "Nokia-MIDlet-On-Screen-Keypad");
       
    46 
       
    47 /**
       
    48  * The valid values of custom attribute KOnScreenKeyboardAttribute
       
    49  */
       
    50 _LIT(KValueNo, "no");
       
    51 _LIT(KValueGameactions,    "gameactions");
       
    52 _LIT(KValueNavigationkeys, "navigationkeys");
       
    53 
       
    54 /**
       
    55  * The known flags for the values of the custom attributes.
       
    56  */
       
    57 const TUint32 KFlagUserModifiable    = 0x00000000;
       
    58 const TUint32 KFlagNonUserModifiable = 0x00000001;
       
    59 
       
    60 class MMIDletSuiteCustomAttributes
       
    61 {
       
    62 public:
       
    63 
       
    64     virtual ~MMIDletSuiteCustomAttributes() = 0;
       
    65 
       
    66     /**
       
    67      * Add new custom attribute for the MIDlet suite.
       
    68      *
       
    69      * @param aName     the name of the attribute
       
    70      * @param aValue    the value of the attribute
       
    71      * @param aFlag     any 32 bit flag, e.g. KFlagNonUserModifiable or 0x12345678
       
    72      *
       
    73      */
       
    74     virtual void AddL(const TDesC& aName, const TDesC& aValue, const TUint32 aFlag) = 0;
       
    75 
       
    76     /**
       
    77      * Get the value of custom attribute aName.
       
    78      *
       
    79      * @param aName     the name of the attribute
       
    80      * @param aValue    the returned value of the attribute, ownership is transferred to caller
       
    81      * @param aFlag     used to return the flag, e.g. KFlagNonUserModifiable
       
    82      *
       
    83      * @return          the value of the attribute
       
    84      *
       
    85      * @throws KErrNotFound if attribute does exist
       
    86      *
       
    87      * [Ownership of the returned object is transferred to the caller].
       
    88      *
       
    89      */
       
    90     virtual HBufC* GetL(const TDesC& aName, TUint32& aFlag) = 0;
       
    91 
       
    92     /**
       
    93      * Update the value of an existing custom attribute for the MIDlet suite.
       
    94      *
       
    95      * @param aName     the name of the attribute
       
    96      * @param aValue    the value of the attribute
       
    97      * @param aFlag     flag, e.g. KFlagNonUserModifiable
       
    98      */
       
    99     virtual void UpdateL(const TDesC& aName, const TDesC& aValue, const TUint32 aFlag) = 0;
       
   100 
       
   101     /**
       
   102      * Removes all custom attributes of the MIDlet suite.
       
   103      * Call only when removing MIDlet suite.
       
   104      */
       
   105     virtual void RemoveAllL() = 0;
       
   106 
       
   107 };
       
   108 
       
   109 inline MMIDletSuiteCustomAttributes::~MMIDletSuiteCustomAttributes()
       
   110 {
       
   111 }
       
   112 
       
   113 } // end of namespace MIDP
       
   114 
       
   115 #endif // MMIDLETSUITECUSTOMATTRIBUTES_H