cmmanager/cmmgr/cmmserver/inc/cmmconnmethoditem.h
branchRCL_3
changeset 58 83ca720e2b9a
parent 57 05bc53fe583b
child 62 bb1f80fb7db2
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
     1 /*
       
     2 * Copyright (c) 2009-2010 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 * Class representing any kind on connection method, including embedded
       
    16 * destination. Used for priority based ordering of connection methods inside
       
    17 * destinations.
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef CMMCONNMETHODITEM_H_
       
    23 #define CMMCONNMETHODITEM_H_
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 
       
    28 NONSHARABLE_CLASS( TCmmConnMethodItem )
       
    29     {
       
    30 public:
       
    31     TCmmConnMethodItem();
       
    32 
       
    33     TCmmConnMethodItem(
       
    34             TUint32 aId,
       
    35             TUint32 aBearerType,
       
    36             TUint aBearerPriority,
       
    37             TUint aPriority,
       
    38             TBool aIsVirtual = 0,
       
    39             TUint32 aLinkedIapId = 0,
       
    40             TUint32 aLinkedSnapId = 0 );
       
    41 
       
    42     /**
       
    43      * A comparison function. Uses priority since items are in priority order.
       
    44      */
       
    45     static TInt Compare(
       
    46             const TCmmConnMethodItem& aFirst,
       
    47             const TCmmConnMethodItem& aSecond );
       
    48 
       
    49     /**
       
    50      * A comparison function to find a specific item by ID. (Items are not
       
    51      * sorted by ID in the array.)
       
    52      */
       
    53     static TBool FindCompare(
       
    54             const TUint32* aKey,
       
    55             const TCmmConnMethodItem& aEntry );
       
    56 
       
    57     /**
       
    58      * Return ETrue if this connection method item represents a virtual
       
    59      * destination.
       
    60      */
       
    61     TBool IsVirtual() const; 
       
    62 
       
    63     /**
       
    64      * Return ETrue if this connection method item represents an embedded
       
    65      * destination.
       
    66      */
       
    67     TBool IsEmbedded() const;
       
    68 
       
    69     /**
       
    70      * If this is a virtual IAP that points to an IAP, returns the ID of that
       
    71      * IAP, 0 otherwise.
       
    72      */
       
    73     TUint32 LinkedIapId() const;
       
    74 
       
    75     /**
       
    76      * If this is a virtual IAP that points to a SNAP, returns the ID of that
       
    77      * SNAP, 0 otherwise.
       
    78      */
       
    79     TUint32 LinkedSnapId() const;
       
    80 
       
    81 public:
       
    82     // Connection method ID.
       
    83     TUint32 iId;
       
    84 
       
    85     // Connection method bearer type.
       
    86     TUint32 iBearerType;
       
    87 
       
    88     // Priority value of the bearer type.
       
    89     TUint iBearerPriority;
       
    90 
       
    91     // Priority value in the CCDDataMobilitySelectionPolicy-record. Only used
       
    92     // for sorting purposes when building an array of TCmmConnMethodItem-objects.
       
    93     TUint iPriority;
       
    94 
       
    95 private:
       
    96     // ETrue if this connection method is virtual.
       
    97     TBool iIsVirtual;
       
    98 
       
    99     // If not 0, this is a virtual IAP that points to IAP with ID iLinkedIapId.
       
   100     TUint32 iLinkedIapId;
       
   101 
       
   102     // If not 0, this is a virtual IAP that points to SNAP with ID iLinkedSnapId.
       
   103     TUint32 iLinkedSnapId;
       
   104     };
       
   105 
       
   106 #endif // CMMCONNMETHODITEM_H_
       
   107 
       
   108 // End of file