wvuing/wvuistorage/inc/MCAStoredContact.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Stored contact data interface (getters)
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MCASTOREDCONTACT_H
       
    21 #define MCASTOREDCONTACT_H
       
    22 
       
    23 #include "impsbuilddefinitions.h"
       
    24 
       
    25 #include <e32std.h>
       
    26 #include <cntdef.h>
       
    27 
       
    28 #include "TStorageManagerGlobals.h"
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33  *  Getter interface for contacts.
       
    34  *
       
    35  *  @lib CAStorage.dll
       
    36  *  @since 3.0
       
    37  */
       
    38 class MCAStoredContact
       
    39     {
       
    40     public: // Definitions
       
    41 
       
    42         enum TSortAlgorithm
       
    43             {
       
    44             ECompareAlphabetically,
       
    45             ECompareByPresence
       
    46             };
       
    47 
       
    48     public: // Interface
       
    49 
       
    50         /**
       
    51          * User id
       
    52          * @return User ID of this contact
       
    53          */
       
    54         virtual const TDesC& UserId() const = 0;
       
    55 
       
    56         virtual const TDesC& Nickname() const = 0;
       
    57 
       
    58         virtual const TDesC& Alias() const = 0;
       
    59 
       
    60         /**
       
    61          * Returns the text used to identify this contact in the UI.
       
    62          * If there is no identification, returns the WV User Id.
       
    63          * Make a copy of the returned string for usage, as it can be destroyed
       
    64          * at any point following a call to SetIdentification.
       
    65          * @return String based on rules presented above.
       
    66          */
       
    67         virtual const TDesC& Identification() const = 0;
       
    68 
       
    69         /**
       
    70          * Online status
       
    71          * @return On-line status of this contact
       
    72          */
       
    73         virtual TStorageManagerGlobals::TPresenceStatus OnlineStatus() const = 0;
       
    74 
       
    75         /**
       
    76          * Check if this contact is blocked.
       
    77          * @return ETrue if the contact is blocked
       
    78          */
       
    79         virtual TBool IsBlocked() const = 0;
       
    80 
       
    81         /**
       
    82          * Check if this contact is watched
       
    83          * @return ETrue if the contact is watched
       
    84          */
       
    85         virtual TBool IsWatched() const = 0;
       
    86 
       
    87         /**
       
    88          * Client type
       
    89          * @return Client type of this contact
       
    90          */
       
    91         virtual TStorageManagerGlobals::TClientType ClientType() const = 0;
       
    92 
       
    93         /**
       
    94          * Set Client type
       
    95          */
       
    96         virtual void SetClientType( TStorageManagerGlobals::TClientType aType ) = 0;
       
    97 
       
    98         /**
       
    99          * Set online status
       
   100          */
       
   101         virtual void SetOnlineStatus( TStorageManagerGlobals::TPresenceStatus aOnlineStatus ) = 0;
       
   102 
       
   103         /**
       
   104          * Set block status
       
   105          */
       
   106         virtual void SetBlocked( TBool aBlocked ) = 0;
       
   107 
       
   108         /**
       
   109          * Set watch status
       
   110          */
       
   111         virtual void SetWatched( TBool aWatched ) = 0;
       
   112 
       
   113         /**
       
   114          * Set amount of pending messages
       
   115          * @param aAmount Amount of pending messages
       
   116          */
       
   117         virtual void SetPendingMessages( TInt aAmount ) = 0;
       
   118 
       
   119         /**
       
   120          * Inform observers about changes
       
   121          */
       
   122         virtual void SignalChanges() = 0;
       
   123 
       
   124         virtual void SetUserIdL( const TDesC& aUserId ) = 0;
       
   125 
       
   126         virtual void SetAliasL( const TDesC& aAlias ) = 0;
       
   127 
       
   128         virtual void SetNicknameL( const TDesC& aNickname ) = 0;
       
   129 
       
   130         virtual TBool Selected() const = 0;
       
   131 
       
   132         virtual void SetSelected( TBool aSelected ) = 0;
       
   133 
       
   134         virtual TInt PendingMessages() const = 0;
       
   135 
       
   136         virtual const TDesC& StatusText() const = 0;
       
   137 
       
   138         virtual void SetStatusTextL( const TDesC& aStatusText ) = 0;
       
   139 
       
   140         /**
       
   141          * Destruction.
       
   142          */
       
   143         virtual ~MCAStoredContact() {};
       
   144     };
       
   145 
       
   146 #endif      // MCASTOREDCONTACT_H
       
   147 
       
   148 // End of File