PECengine/AttributeLibrary2/SrcTransactions/CPEngSubscribedUsers.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 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:  List of subscribed users.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPENGSUBSCRIBEDUSERS_H
       
    19 #define CPENGSUBSCRIBEDUSERS_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include <BaMDesCA.H>
       
    24 
       
    25 
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CPEngSubscribedUser;
       
    29 
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33  * List of subscribed users.
       
    34  *
       
    35  * @since 3.0
       
    36  */
       
    37 NONSHARABLE_CLASS( CPEngSubscribedUsers ) : public CBase,
       
    38         public MDesCArray
       
    39     {
       
    40 public:  // Constructors and destructor
       
    41 
       
    42     /**
       
    43      * Two-phased constructor.
       
    44      */
       
    45     static CPEngSubscribedUsers* NewL();
       
    46 
       
    47 
       
    48     /**
       
    49      * Destructor.
       
    50      */
       
    51     ~CPEngSubscribedUsers();
       
    52 
       
    53 
       
    54 private:
       
    55 
       
    56     /**
       
    57      * C++ default constructor.
       
    58      */
       
    59     CPEngSubscribedUsers();
       
    60 
       
    61     /**
       
    62      * Symbian OS constructor.
       
    63      */
       
    64     void ConstructL();
       
    65 
       
    66 
       
    67 
       
    68 public: //  From MDesCArray
       
    69 
       
    70 
       
    71     /**
       
    72      * Gets the count of users in subscribed users array.
       
    73      * @since 3.0
       
    74      */
       
    75     TInt MdcaCount() const;
       
    76 
       
    77 
       
    78     /**
       
    79      * Indexes the subscribed users array.
       
    80      *
       
    81      * @since 3.0
       
    82      * @param aIndex The position of the user id to get from the
       
    83      * subscribed users array.
       
    84      * @return User ID.
       
    85      */
       
    86     TPtrC16 MdcaPoint( TInt aIndex ) const;
       
    87 
       
    88 
       
    89 
       
    90 public: //  New functions
       
    91 
       
    92 
       
    93     /**
       
    94      * Adds a new subscribed user.
       
    95      *
       
    96      * @since 3.0
       
    97      * @param aUser The new user to add.
       
    98      * Takes the ownership in success.
       
    99      */
       
   100     void AddSubscribedUserL( CPEngSubscribedUser* aUser );
       
   101 
       
   102 
       
   103     /**
       
   104      * Locates a user by user id.
       
   105      *
       
   106      * @since 3.0
       
   107      * @param aUserID
       
   108      * @return User entrys index or KErrNotFound.
       
   109      */
       
   110     TInt FindSubscribedUser( const TDesC& aUserID ) const;
       
   111 
       
   112 
       
   113     /**
       
   114      * Gets the count of subscribed users.
       
   115      *
       
   116      * @since 3.0
       
   117      * @return The subscribed users count.
       
   118      */
       
   119     TInt SubscribedUserCount() const;
       
   120 
       
   121 
       
   122     /**
       
   123      * Gets the subscribed user by index.
       
   124      *
       
   125      * @since 3.0
       
   126      * @param aIndex The index to get.
       
   127      * @return  The user entry. No ownership returned.
       
   128      */
       
   129     CPEngSubscribedUser& SubscribedUser( TInt aIndex );
       
   130 
       
   131 
       
   132     /**
       
   133      * Deletes a subscribed user by index.
       
   134      *
       
   135      * @since 3.0
       
   136      * @param aIndex The index to delete.
       
   137      */
       
   138     void DeleteSubscribeUser( TInt aIndex );
       
   139 
       
   140 
       
   141 private:    // Data
       
   142 
       
   143 
       
   144     //OWN: The subscribed users.
       
   145     RPointerArray< CPEngSubscribedUser > iUsers;
       
   146 
       
   147     };
       
   148 
       
   149 #endif      // CPENGSUBSCRIBEDUSERS_H
       
   150 
       
   151 // End of File