cmmanager/cmmgr/Framework/Inc/cmlistitem.h
branchRCL_3
changeset 58 83ca720e2b9a
parent 0 5a93021fdf25
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Declaration of the CCmListItem class.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CCMLISTITEM_H
       
    19 #define CCMLISTITEM_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 
       
    24 /**
       
    25  *  Representation of a list item.
       
    26  *  This class is used to hold the main information of a connection method.
       
    27  *  It is used in CCmSelect.
       
    28  *  @lib cmmanager.lib
       
    29  *  @since S60 v3.2
       
    30  */
       
    31 NONSHARABLE_CLASS( CCmListItem ) :public CBase
       
    32     {
       
    33     public:  // Constructors and destructor
       
    34 
       
    35         /**
       
    36         * Two-phased constructor. Leaves on failure, places instance
       
    37         * on cleanup stack.
       
    38         * @param aUid The ID of the connection method
       
    39         * @param aName The name of the connection method
       
    40         * @param aPriority The priority of the connection method
       
    41         * @param aIconIndex The icon index of the connection method's 
       
    42         * bearer's icon
       
    43         * @param aIsProtected Whether the given item is read-only or not
       
    44         * @param aIsSingleLine Whether the given item has one line only      
       
    45         * @return The constructed CCmListItem.
       
    46         */
       
    47         static CCmListItem* NewLC( TUint32 aUid,
       
    48                                     HBufC* aName,
       
    49                                     TInt aPriority, 
       
    50                                     TUint aIconIndex, 
       
    51                                     TBool aIsProtected, 
       
    52                                     TBool aIsVPNOverDestination,
       
    53                                     TBool aIsSingleLine, 
       
    54                                     TBool aIsDefault);
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         virtual ~CCmListItem();
       
    59 
       
    60     protected:      // Constructors
       
    61     
       
    62         /**
       
    63         * C++ default constructor.
       
    64         */
       
    65         CCmListItem( HBufC* aName );
       
    66 
       
    67         /**
       
    68         * Second-phase constructor.
       
    69         * @param aUid The ID of the connection method
       
    70         * @param aPriority The priority of the connection method
       
    71         * @param aIconIndex The icon index of the connection method's 
       
    72         * bearer's icon
       
    73         * @param aIsProtected Whether the given item is read-only or not
       
    74         * @param aIsSingleLine Whether the given item has one line only
       
    75         */
       
    76         void ConstructL( TUint32 aUid,
       
    77                          TInt aPriority, 
       
    78                          TUint aIconIndex, 
       
    79                          TBool aIsProtected, 
       
    80                          TBool aIsVPNOverDestination,
       
    81                          TBool aIsSingleLine, 
       
    82                          TBool aIsDefault);
       
    83     
       
    84     public: // New functions
       
    85 
       
    86         /**
       
    87         * Gets the name of the 'current' connection method
       
    88         * Ownership of the returned text is not passed.
       
    89         * @return The name of the current connection method
       
    90         */
       
    91         const TDesC& Name();
       
    92 
       
    93         /**
       
    94         * Gets the UID of the current connection method
       
    95         * @return The UID of the current connection method
       
    96         */
       
    97         TUint32 Uid();
       
    98 
       
    99         /**
       
   100         * Gets the Priority of the current connection method
       
   101         * @return The Priority of the current connection method
       
   102         */
       
   103         TInt Priority();
       
   104          
       
   105         /**
       
   106         * Gets the IconIndex of the current connection method's bearer icon
       
   107         * @return The IconIndex of the current connection method's bearer icon
       
   108         */
       
   109         TUint IconIndex();
       
   110         
       
   111         /**
       
   112         * Returns the connection method's protected flag
       
   113         * @return ETrue if the connection method is protected
       
   114         */       
       
   115         TBool IsProtected();
       
   116         
       
   117         /**
       
   118         * Returns the connection method's destination flag
       
   119         * @return ETrue if the item has one line only
       
   120         */       
       
   121         TBool IsSingleLine();
       
   122 
       
   123         /**
       
   124         * Returns the connection method's default flag
       
   125         * @return ETrue if the item is the default connection
       
   126         */       
       
   127         TBool IsDefault();
       
   128 
       
   129         /**
       
   130         * Used to figure out whether connection is VPN over destination.
       
   131         * @return ETrue if the item is VPN over destination
       
   132         */       
       
   133         TBool IsVpnOverDestination();
       
   134                 
       
   135     private:    // Data
       
   136 
       
   137         TUint32         iUid;            // The ID of the access point
       
   138         HBufC*          iName;           // The name of the access point
       
   139         TInt            iPriority;       // The Priority of the access point
       
   140         TUint           iIconIndex;      // The IconIndex of the access point
       
   141         TBool           iIsProtected;    // The IsProtected flag of the access point
       
   142         TBool           iIsSingleLine;   // ETrue if the item has one line only
       
   143         TBool           iIsDefault;      // ETrue if the item is the default connection
       
   144         TBool           iIsVpnOverDestination; // ETrue if the item is VPN over destination
       
   145     };
       
   146 
       
   147 #endif      // CCMLISTITEM_H