uiservicetab/vimpstcmdprocess/inc/cvimpstprocessfriendrequestitem.h
changeset 0 5e5d6b214f4f
child 7 bef90b82da71
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2008 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: Friend request item, stores all the information regarding *the ERactive authorization 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CVIMPSTPROCESSFRIENDREQUESTITEM_H_
       
    21 #define CVIMPSTPROCESSFRIENDREQUESTITEM_H_
       
    22 
       
    23 #include <e32base.h>
       
    24 #include "TVIMPSTEnums.h"
       
    25 #include "cvimpstprocessarrayitem.h"
       
    26 
       
    27 //  CLASS DECLARATION
       
    28 
       
    29 /**
       
    30  * Friend request item, stores all the information regarding the ERactive authorization.
       
    31  * Responsible for handling feriend requests.
       
    32  * @lib vimpstcmdprocess.dll
       
    33  * @since 5.0
       
    34  */
       
    35 class CVIMPSTProcessFriendRequestItem:public CBase,
       
    36                                       public MVIMPSTProcessArrayItem
       
    37     {
       
    38     public: // symbain constructor , destructor
       
    39         
       
    40         /**
       
    41         * Returns the instance of tis class.
       
    42         * @param aRequesterId, requestor id.
       
    43         * @return CVIMPSTProcessFriendRequestItem, instance of this class.
       
    44         */
       
    45         static CVIMPSTProcessFriendRequestItem* NewL(CVIMPSTProcessArray& aParent, const TDesC& aRequesterId, const TDesC& aRequestorDisplayName);
       
    46         
       
    47         /**
       
    48          * symbain way of construction
       
    49          * @param aRequesterId, requestor id.
       
    50          */
       
    51         void ConstructL(const TDesC& aRequesterId, const TDesC& aRequestorDisplayName);
       
    52         
       
    53         /**
       
    54          * destructor
       
    55          */
       
    56         virtual ~CVIMPSTProcessFriendRequestItem();
       
    57         
       
    58     private:
       
    59 
       
    60          /**
       
    61           * C++ default constructor
       
    62           */
       
    63         CVIMPSTProcessFriendRequestItem(CVIMPSTProcessArray& aParent);
       
    64         
       
    65     public: //From MImArrayItem
       
    66     
       
    67         /**
       
    68          * Returns the name of the contact item 
       
    69          * @return TPtrC, name of the contact item to be displayed
       
    70          */
       
    71         TPtrC GetItemNameText();
       
    72         
       
    73        /**
       
    74         * Returns the default type of the contact item 
       
    75         * @return TEnumsPC::TItem: type of the contact item as either 
       
    76         * EContactitem, EContactListItem etc
       
    77         */
       
    78         TVIMPSTEnums::TItem Type();
       
    79     
       
    80         
       
    81         /**
       
    82          * Get the index of the contact item from engine side model
       
    83          * @return TInt: index
       
    84          */
       
    85         inline TInt GetItemIndex()   
       
    86             {   
       
    87             return iIndex;    
       
    88             }
       
    89         
       
    90         /**
       
    91          * Set the index of the contact item from engine side model
       
    92          * @param TInt: aIndex
       
    93          */
       
    94         inline void SetItemIndex(TInt aIndex)   
       
    95             {  
       
    96             iIndex  = aIndex;
       
    97             }
       
    98         
       
    99         /**
       
   100          * @return the VPBK Contact Link
       
   101          */
       
   102         inline MVPbkContactLink* ContactLink()
       
   103             {
       
   104             return NULL;
       
   105             }
       
   106             
       
   107         
       
   108         
       
   109         /**
       
   110          * Returns the user id of the listbox item 
       
   111          * @return TPtrC, user id of the listbox item.
       
   112          */
       
   113         inline TPtrC GetItemUserId();
       
   114 
       
   115         /**
       
   116          * Returns the avatar index of the listbox item 
       
   117          * @return TInt: avatar index of the listbox item.
       
   118          */
       
   119         inline TInt  AvatarIndex() 
       
   120             {
       
   121             return KErrNone; // always return zero
       
   122             }
       
   123 
       
   124         /**
       
   125          * sets the avatar index of the listbox item 
       
   126          * @param aAvatarIndex: avatar index to be set 
       
   127          */
       
   128         inline void  SetAvatarIndex(TInt /*aAvatarIndex*/ ) 
       
   129             {
       
   130             // dummy not used
       
   131             }
       
   132        
       
   133         /**
       
   134          * Sets the messages pending status of the contact item 
       
   135          * @param aPendingMessageStatus: true if the contact has pending messages 
       
   136          * else false
       
   137          */
       
   138         void SetMsgPending(TBool aPendingMessageStatus);
       
   139 
       
   140         /**
       
   141          * gets the messages pending status of the contact item 
       
   142          * @return iSMsgPending: true if the contact has pending messages 
       
   143          * else false
       
   144          */
       
   145         TBool IsMsgPending();
       
   146 
       
   147         /**
       
   148          * Sets the name of the listbox item 
       
   149          * @param aName: Name of the listbox item to be set
       
   150          * @return void
       
   151          */
       
   152 
       
   153         void SetConversationOpen(TBool aConvOpen ) ;
       
   154 
       
   155         /**
       
   156          * gets the messages pending status of the contact item 
       
   157          * @return iSMsgPending: true if the contact has pending messages 
       
   158          * else false
       
   159          */
       
   160         TBool IsConversationOpen() ;
       
   161         
       
   162         /**
       
   163          * returns status text of the contact
       
   164          */
       
   165         const TDesC& StatusText()
       
   166             {
       
   167             //NA
       
   168             return KNullDesC;
       
   169             }
       
   170         
       
   171         /**
       
   172          * returns online status of the contact
       
   173          */
       
   174         TVIMPSTEnums::TOnlineStatus OnlineStatus()
       
   175             {
       
   176             //NA
       
   177             return TVIMPSTEnums::EUnknown;
       
   178             }
       
   179         
       
   180         /*
       
   181          * Format and Reformat the string for listbox
       
   182          */
       
   183         void DoFormatStringL();
       
   184         
       
   185         /**
       
   186          * return formatted string needed for listbox for this item
       
   187          */
       
   188         TPtrC16 FormattedItemString();
       
   189         
       
   190     private://member variables.
       
   191         
       
   192         //Process Array
       
   193         CVIMPSTProcessArray& iParent;
       
   194         
       
   195         /**
       
   196          * Index of the item in engines model class
       
   197          */
       
   198          TInt iIndex;
       
   199          
       
   200          // Owns, user id of item.
       
   201          HBufC* iUesrId;
       
   202          
       
   203          // Owns, user id of item.
       
   204          HBufC* iDisplayName;
       
   205          
       
   206          // ETrue if it has a pending message, else EFalse.
       
   207          TBool iSMsgPending;
       
   208          // is conversation open
       
   209          TBool iIsConversationOpen;
       
   210          
       
   211          // for listbox
       
   212          HBufC* iFormattedString;
       
   213     };
       
   214 
       
   215 #endif /*CVIMPSTPROCESSFRIENDREQUESTITEM_H_*/
       
   216