wvuing/wvuiprocess/Inc/CCAInvitationPC.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     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:  Represents the search data for UI
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CCAINVITATIONPC_H
       
    20 #define CCAINVITATIONPC_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include	"MCAInvitationPC.h"
       
    25 #include 	"MCAInviteObserver.h"
       
    26 //Platform includes
       
    27 #include	"e32base.h"
       
    28 
       
    29 //Forward Declaration
       
    30 class MCAInvitationObserverPC;
       
    31 class MCAChatInterface;
       
    32 class MCAStoredContacts;
       
    33 class MCAMainViewArrayPC;
       
    34 class MCAInvitation;
       
    35 class CCAEngine;
       
    36 class MCAInvite;
       
    37 //CLASS DECLARATION
       
    38 /**
       
    39 *  Invitation dialog  representation for the UI.
       
    40 *
       
    41 *  @lib wvuiprocessng.lib
       
    42 *  @since 3.2
       
    43 */
       
    44 class CCAInvitationPC: public CBase,
       
    45             public MCAInvitationPC,
       
    46             public MCAInviteObserver
       
    47 
       
    48     {
       
    49 
       
    50     public:
       
    51 
       
    52         /**
       
    53          * Symbian Two Phase Constructor
       
    54          *
       
    55          */
       
    56         static CCAInvitationPC* NewL( CCAEngine& aEngine, MCAChatInterface& aChatInterface );
       
    57 
       
    58         /**
       
    59          * Symbian Two Phase Constructor
       
    60          *
       
    61          */
       
    62         void ConstructL( );
       
    63         /**
       
    64          * virtual destructor
       
    65          */
       
    66         virtual ~CCAInvitationPC( );
       
    67 
       
    68     public:// From MCAInviteObserver
       
    69 
       
    70         /**
       
    71          * Gets called when invite event occurs.
       
    72          * @param aEvent Type of event.
       
    73          * @param aInvitation specifies the invitation message.
       
    74          */
       
    75         virtual void HandleInvitationEventL( TInviteEventType aEvent,
       
    76                                              const MCAInvitation* aInvitation );
       
    77 
       
    78         /**
       
    79          * Gets called when we received response to our invitation
       
    80          * @since 2.1
       
    81          * @param aAcceptance Accepted or rejected
       
    82          * @param aUserId User Id of the response sender
       
    83          * @param aGroupName group name
       
    84          * @param aResponse response text
       
    85          */
       
    86         virtual void HandleInvitationResponse( TBool aAcceptance,
       
    87                                                const TDesC& aUserId,
       
    88                                                const TDesC& aGroupName,
       
    89                                                const TDesC& aResponse );
       
    90     public://New Methods
       
    91         /**
       
    92          *
       
    93          *
       
    94          */
       
    95         void RegisterObserver( MCAInvitationObserverPC* aObserver );
       
    96 
       
    97         /**
       
    98          *
       
    99          *
       
   100          */
       
   101         void UnRegisterObserver();
       
   102 
       
   103         /**
       
   104          * Gets the const reference to the UserID of the give invitaton index
       
   105          * @param aIndex: invitation index
       
   106          */
       
   107         const TDesC& InvitationUserIDL( TInt aIndex );
       
   108 
       
   109         /**
       
   110          * Gets the time this invite was received
       
   111          * @param aIndex is the invitation index.
       
   112          * @return Time and date of creation
       
   113          */
       
   114         TTime ReceivedAt( TInt aIndex );
       
   115 
       
   116         /**
       
   117          * Gets the invitation message.
       
   118          * @param aIndex is the invitation index.
       
   119          * @return Message.
       
   120          */
       
   121         const TDesC& Message( TInt aIndex );
       
   122 
       
   123         /**
       
   124          * Gets the group name.
       
   125          * @return Group name.
       
   126          */
       
   127         const TDesC& GroupName( TInt aIndex );
       
   128 
       
   129         /**
       
   130          * Sets the active invitation index
       
   131          */
       
   132         void SetActiveInvitation( const TInt aIndex );
       
   133 
       
   134         /**
       
   135          * Gets the active invitation index
       
   136          */
       
   137         TInt GetActiveInvitationIndex( );
       
   138 
       
   139 
       
   140         TBool IsInvitationUnread( TInt aIndex );
       
   141 
       
   142         /**
       
   143          * Set invitation as read.
       
   144          * @param aIndex is the tabindex of
       
   145          * the current active invitation
       
   146          */
       
   147         void SetInvitationAsReadL( TInt aIndex );
       
   148 
       
   149         /**
       
   150          * Maps the given tabindex to invitationindex
       
   151          * in mainviewarraypc
       
   152          * @return invitationindex
       
   153          */
       
   154         TInt GetInvitationIndex( TInt aTabIndex );
       
   155 
       
   156         /**
       
   157          * Returns the Count of Invitations.
       
   158          */
       
   159         TInt InvitationCount( );
       
   160 
       
   161         /**
       
   162          * Deletes the invitation
       
   163          * @param aInvitationIndex: index of the
       
   164          * invitation to be deleted
       
   165          */
       
   166         void DeleteInvitationL( TInt aInvitationIndex );
       
   167 
       
   168         /**
       
   169          * This is the reply to an invitation.
       
   170          * Note that invitation gets removed by this call, so do not try to use
       
   171          * it after calling this!!!
       
   172          * @param aInvitationIndex is the invitation index in teh array.
       
   173          * @param aInviteAccepted specifies if the invite was accepted or not.
       
   174          * @param aResponse is the response
       
   175          * @param aScreenName is our own screenname
       
   176          */
       
   177         void ReplyInvitationL( TInt aInvitationIndex,
       
   178                                const TBool aInviteAccepted,
       
   179                                const TDesC& aResponse,
       
   180                                const TDesC& aScreenName );
       
   181 
       
   182         /**
       
   183          * Gets the buffer holding the reject reason
       
   184          * This is stored in the engine side because the last written
       
   185          * reason must be remembered
       
   186          * @return The buffer to reject reason, which can be modified
       
   187          */
       
   188         HBufC* RejectReason();
       
   189 
       
   190         /**
       
   191          * Deletes the invitation at aIndex
       
   192          * @param aIndex Index of the invitation to be deleted
       
   193          */
       
   194         void DeleteSingleListViewInvitationL( const TDesC& aInviteID/*TInt aIndex*/ );
       
   195 
       
   196         /**
       
   197         * Finds an invitation
       
   198         * @param aWvId - contatc wv
       
   199         * @param aInviteTime - Invite Time
       
   200         * @return TInt - Index of the found invitation else -1
       
   201         */
       
   202         TInt FindInvitationIndex( const TDesC& aWvId, TTime aInviteTime );
       
   203 
       
   204         /**
       
   205         * Finds an invitation
       
   206         * @param aInviteId: id of the invitation
       
   207         * @return TInt - Index of the found invitation else -1
       
   208         */
       
   209         TInt FindInvitationIndex( const TDesC& aInviteId );
       
   210 
       
   211         /**
       
   212         * Unread Invites Counts
       
   213            * return no of unread inviation
       
   214         */
       
   215         TInt UnreadInvitesCount() const;
       
   216 
       
   217         /**
       
   218         * Unresd Invitation Info
       
   219            * return Invitation Id
       
   220         */
       
   221 
       
   222         const TDesC& UnresdInvitationInfo() ;
       
   223         const TDesC& GetInviteID( TInt aInvitationIndex );
       
   224 
       
   225         /**
       
   226          * @param aIndex : invitation index
       
   227         	* return identification of the sender of the invitation
       
   228          */
       
   229         TPtrC InvUserIdentificationL( TInt aIndex );
       
   230     private:
       
   231 
       
   232         /**
       
   233          * default constructor
       
   234          * @param
       
   235          */
       
   236         CCAInvitationPC( CCAEngine& aEngine, MCAChatInterface& aChatInterface );
       
   237 
       
   238         /**
       
   239          * Returns index for given invitation
       
   240          * @param aInvitation
       
   241          * @return index of invitation
       
   242          */
       
   243         TInt FindIndexForInvitation( const MCAInvitation* aInvitation ) const;
       
   244 
       
   245         /**
       
   246          * Deletes item from Invitationarray
       
   247          * @param aIndex Item index
       
   248          */
       
   249         void Delete( TInt aIndex );
       
   250     private:
       
   251 
       
   252         //DoesNot own.
       
   253         CCAEngine& iEngine;
       
   254 
       
   255         MCAChatInterface& iChatInterface;
       
   256 
       
   257         // Doesn't own. Handle to contacts interface
       
   258         MCAStoredContacts* iContacts;
       
   259 
       
   260         //Owns. Contact id
       
   261         HBufC* iWvId;
       
   262 
       
   263         //Doesnot own
       
   264         MCAInvite& iInviteInterface;
       
   265 
       
   266         //Owns. Maintains the invitations
       
   267         RPointerArray<MCAInvitation> iInvitationArray;
       
   268 
       
   269         TInt iCurrentActiveInvitation;
       
   270 
       
   271         MCAInvitationObserverPC* iObserver;
       
   272 
       
   273     };
       
   274 
       
   275 #endif      // CCAINVITATIONPC_H
       
   276 
       
   277 // End of File