wvuing/wvuiprocess/Inc/MCAGroupUtilsPC.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:  Interface for group operations
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MCAGROUPUTILSPC_H
       
    20 #define MCAGROUPUTILSPC_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 
       
    25 #include "TEnumsPC.h"
       
    26 #include "badesca.h"
       
    27 #include "ChatDefinitions.h"
       
    28 
       
    29 
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 
       
    33 class MCAGroupChatObserverPC;
       
    34 class MCAGroupEventObserverPC;
       
    35 class MCAGroupMsgErrorObserverPC;
       
    36 class CCAChatInfoArray;
       
    37 class MCAServerContactsArrayPC;
       
    38 class MCAGroupOperations;
       
    39 class CImpsCommonGroupProps;
       
    40 class CImpsPrivateGroupProps;
       
    41 
       
    42 
       
    43 /**
       
    44  *  Group interface process component for UI and Engine.
       
    45  *
       
    46  *  @lib wvuiprocessng.lib
       
    47  *  @since 3.2
       
    48  */
       
    49 class MCAGroupUtilsPC
       
    50 
       
    51     {
       
    52     public:
       
    53 
       
    54 
       
    55 
       
    56         /*
       
    57         * Get the created chat room's information on joined users
       
    58         */
       
    59         virtual TInt GetCreatedChatRoomListL( CDesCArray& aTempArray,
       
    60                                               CDesCArray& aGroupIds ) = 0;
       
    61 
       
    62         /*
       
    63         *
       
    64         */
       
    65         virtual TInt SwitchToJoinedGroupL( const TDesC& aGroupID,
       
    66                                            TCADnlChatViewBuf& aViewDnl ,
       
    67                                            const MCAConversationMessage* aFwdMessage,
       
    68                                            TBool aInviteQuery ) = 0;
       
    69 
       
    70 
       
    71         /*
       
    72         *
       
    73         */
       
    74         virtual void CreateOrJoinGroupL( const TDesC& aGroupId,
       
    75                                          TBool& aIsJoined, TBool& aIsFavourite ) = 0;
       
    76 
       
    77 
       
    78 
       
    79 
       
    80         /*
       
    81         * Deletes the group
       
    82         * @param aGroupId: id of the group
       
    83         * @param aDeleteFromNetwork: Deletes this group from network and phone if true.
       
    84         */
       
    85         virtual TInt DeleteGroupL( const TDesC& aGroupId,
       
    86                                    TBool aDeleteFromNetwork ) = 0;
       
    87 
       
    88         /*
       
    89         *
       
    90         * @param aGroupId: id of the group
       
    91         * @param aDeleteFromNetwork: Deletes this group from network and phone if true.
       
    92         */
       
    93         virtual TInt DeleteChatGroupFromNetworkL( const TDesC& aGroupId,
       
    94                                                   TBool aDeleteFromNetwork ) = 0;
       
    95 
       
    96         /*
       
    97         *
       
    98         * @param aGroupId: id of the group
       
    99         * @param aDeleteFromNetwork: Deletes this group from network and phone if true.
       
   100         */
       
   101         virtual void DeleteFailedGroupL( const TDesC& aGroupId,
       
   102                                          TBool aDeleteFromNetwork ) = 0;
       
   103 
       
   104 
       
   105         /*
       
   106         *
       
   107         * @param aGroupId: id of the group
       
   108         */
       
   109         virtual TPtrC GetEngineDefaultGroupName( const TDesC& aGroupId ) const = 0;
       
   110 
       
   111 
       
   112         /*
       
   113         *
       
   114         * @param aGroupId: id of the group
       
   115         */
       
   116         virtual TPtrC GetGroupNameForJoinedGroupL( const TDesC& aGroupId ) = 0;
       
   117 
       
   118         /**
       
   119         * Create a simple group
       
   120         * @param aScreenName: screen name of the user creating to the group
       
   121         * @param aJoinGroup: Join to the group after creating
       
   122         * @param aIsWhisperingEnabled: is provate messages allowed
       
   123         * @param aErrorCode: returnt he error code during creating groups
       
   124         */
       
   125         virtual HBufC* CreateGroupSimpleL( const TDesC& aScreenName,
       
   126                                            TBool aJoinGroup,
       
   127                                            TBool aIsWhisperingEnabled,
       
   128                                            TInt& aErrorCode )  = 0;
       
   129 
       
   130 
       
   131         /**
       
   132         * To show the screen name query with given group name
       
   133         * @param aScreenName: display name
       
   134         */
       
   135         virtual void ScreenNameQueryL( TDes& aScreenName ) = 0;
       
   136 
       
   137         /**
       
   138          * Helper function for EditChatGroupPropertiesL and CreateNewChat.
       
   139          * Moves own user id to first in list.
       
   140          * @param aList Reference to a list where own user id is removed and moved to
       
   141          * the first position.
       
   142          */
       
   143         virtual void MoveOwnIdToFirstL( CDesCArray& aList ) = 0;
       
   144 
       
   145         /**
       
   146         * Updates the group member status. Leaves on errors.
       
   147         * This method will calculate delta lists based on previous and new
       
   148         * lists
       
   149         * @param aGroupId GroupID
       
   150         * @param aOldAdmins List of previous admins
       
   151         * @param aAdmins List of new admins
       
   152         * @param aOldUserList List of previous users
       
   153         * @param aUserList List of new users
       
   154         * @param aOldRejected List of previous rejected users
       
   155         * @param aRejected List of new rejected users.
       
   156         */
       
   157 
       
   158         virtual void UpdateGroupMembersL( const TDesC& aGroupId,
       
   159                                           const CDesCArray& aOldAdmins, const CDesCArray& aAdmins,
       
   160                                           const CDesCArray& aOldUserList, const CDesCArray& aUserList,
       
   161                                           const CDesCArray& aOldRejected, const CDesCArray& aRejected ) = 0;
       
   162 
       
   163 
       
   164         /**
       
   165         * Adds members to the group. Leaves on errors
       
   166         * @param aGroupId GroupID
       
   167         * @param aAdmins Admins
       
   168         * @param aUserList Users
       
   169         * @param aRejected Rejected users
       
   170         */
       
   171         virtual void AddGroupMembersL( const TDesC& aGroupId, CDesCArray& aAdmins,
       
   172                                        const CDesCArray& aUserList, const CDesCArray& aRejected ) = 0;
       
   173 
       
   174 
       
   175         /**
       
   176         * Gets the banned users of group
       
   177         * @param aRejectList List of rejected users
       
   178         * @return CSP error code
       
   179         */
       
   180         virtual TInt GetRejectListL( CDesCArray& aRejectList , const TDesC& aGroup ) = 0;
       
   181 
       
   182         /**
       
   183          * Gets the members of group
       
   184          * @param aUserList List of users
       
   185          * @param aScreenNames List of screen names
       
   186          * @param aModers List of moderators
       
   187          * @param aAdmins List of administrators
       
   188          * @return CSP error code
       
   189          */
       
   190         virtual TInt GetMembersL( CDesCArray& aUserList,
       
   191                                   CDesCArray& aScreenNames,
       
   192                                   CDesCArray& aModers,
       
   193                                   CDesCArray& aAdmins, const TDesC& aGroup ) = 0;
       
   194 
       
   195 
       
   196         /**
       
   197          * Identification of contact. This is resolved from known
       
   198          * identifications.
       
   199          * Alias, nickname and contactId.
       
   200          * Nickname is shown if set.
       
   201          * @param aContactId Id of contact which identification needed.
       
   202          * @return Identification of contact.
       
   203          *      Alias if nickname is not set and alias is enabled.
       
   204          *      Wvid without domain and prefix if nickname does not
       
   205                 exists and alias is not enabled or not exists.
       
   206          */
       
   207         virtual const TPtrC GetIdentificationL( const TDesC& aContactId ) = 0;
       
   208 
       
   209         /**
       
   210         * Creates new group to server
       
   211         * @param aScreenName screen name
       
   212         * @param aJoinGroup Should the group be joined after creation
       
   213         * @return CSP error code
       
   214         */
       
   215         virtual HBufC* CreateGroupL( const TDesC& aScreenName,
       
   216                                      const TDesC& aGroupName,
       
   217                                      TInt& aError ) = 0;
       
   218 
       
   219         /**
       
   220         * Join a group.
       
   221         * Leaves if out of memory before sending a message to the Symbian OS server.
       
   222         * @param aGroupId group id
       
   223         * @param aScreenName screen name for the user, optional (may be zero length)
       
   224         * @param aUsers ETrue if a user wants to get list of joined users in a reponse,
       
   225         * @param aIsFavourite : if the group is saved as favourite
       
   226         * @return operation-id (positive)
       
   227         */
       
   228         virtual TInt JoinGroupL( const TDesC& aGroupId,
       
   229                                  const TDesC& aScreenName,
       
   230                                  TBool aUsers, TBool aIsFavourite )  = 0;
       
   231 
       
   232 
       
   233         /**
       
   234         * To fetch the data of a group
       
   235         * @param aGroupId: id of the group whose data has to be fetched
       
   236         * @param aUserList: list of users allowed access to the group
       
   237         * @param aScreenNames: screen names of all the users joined to the group
       
   238         * @param aModerators: the users given moderator privileges to the group
       
   239         * @param aAdmins: the users who have been given admin privileges to the list
       
   240         * @param aRejected: list of users banned from entering the group
       
   241         * @return errorcode
       
   242         */
       
   243         virtual TInt GetGroupDataL( const TDesC& aGroupId,
       
   244                                     CDesCArray& aUserList, CDesCArray& aScreenNames,
       
   245                                     CDesCArray& aModerators, CDesCArray& aAdmins,
       
   246                                     CDesCArray& aRejected ) = 0;
       
   247 
       
   248         /**
       
   249          * Helper function for EditChatGroupPropertiesL.
       
   250          * Processes edited group properties.
       
   251          * @param aGroupId Reference to group ID.
       
   252          * @param aGroupOps Reference to group operations interface.
       
   253          * @param aOldAdmins Reference to list of old administrators.
       
   254          * @param aNewAdmins Reference to list of new administrators.
       
   255          * @param aOldUsers Reference to list of old users.
       
   256          * @param aNewUsers Reference to list of new users.
       
   257          * @param aOldRejected Reference to list of old rejected users.
       
   258          * @param aNewRejected Reference to list of new users.
       
   259          * @param aNewCommonProps Reference to new group properties.
       
   260          * @param aNewPrivateProps Reference to new group private properties.
       
   261          * @return Error code
       
   262          */
       
   263         virtual TInt ProcessEditedGroupPropertiesL( const TDesC& aGroupId,
       
   264                                                     CDesCArray& aOldAdmins,
       
   265                                                     CDesCArray& aNewAdmins,
       
   266                                                     CDesCArray& aOldUsers,
       
   267                                                     CDesCArray& aNewUsers,
       
   268                                                     CDesCArray& aOldRejected,
       
   269                                                     CDesCArray& aNewRejected ) = 0;
       
   270 
       
   271         /*
       
   272         * Get the alias of user
       
   273         */
       
   274         virtual HBufC* GetAliasL() = 0;
       
   275 
       
   276         /**
       
   277         * Saves the specified group as favourite
       
   278         * @param aGroupId: group id of the group to be saved as persistent type
       
   279         */
       
   280         virtual void SaveAsFavouriteL( const TDesC& aGroupId ) = 0;
       
   281 
       
   282         virtual void GetDefaultGroupNameL( TPtr& aChatGroupName,
       
   283                                            TEnumsPC::TListSelectionType aSelType )  = 0;
       
   284 
       
   285         /*
       
   286         * Get the information to be shown in show chat info options in signlelist view
       
   287         * and group view.
       
   288         * @param aGroupId: Id of group whose information has to be returned
       
   289         * @return chatinfor array instance
       
   290         */
       
   291         virtual CCAChatInfoArray* GetChatInfoArrayL(
       
   292             const TDesC& aGroupId ) = 0;
       
   293 
       
   294 
       
   295 
       
   296         /**
       
   297         * Set the group name property of the specified group
       
   298         * @param aGroupId: group id of the group whose name has to be changed
       
   299         */
       
   300         virtual void SetGroupNameL( const TDesC& aGroupId ) = 0;
       
   301 
       
   302         /**
       
   303         * To send invitations from the group view to selected contacts
       
   304         * @param aUserIDs: list of users to whom the invites have to be sent
       
   305         * @param aGroupId: id of the group from which the invite is being sent
       
   306         * @param aMessage: the message that has to be sent to the invitees
       
   307         * @return int: error code
       
   308         */
       
   309         virtual TInt SendInvitationsL( const CDesCArray& aUserIDs,
       
   310                                        const TDesC& aGroupID, const TDesC& aMessage ) = 0;
       
   311 
       
   312 
       
   313         /**
       
   314          * Find a group from the store
       
   315          * @param aId the ID of the group to find
       
   316          * @return The group
       
   317          */
       
   318         virtual TBool FindGroup( const TDesC& aId ) = 0;
       
   319 
       
   320         /**
       
   321          * Get the User Ids of participants of the group (joined users)
       
   322          * Makes copies of the descriptors.
       
   323          * @param aParticipantList
       
   324          */
       
   325         virtual void GetParticipantsL( CDesCArray& aParticipantList,
       
   326                                        const TDesC& aGroupId ) const = 0;
       
   327 
       
   328         /**
       
   329          * Check if the user has joined this group
       
   330          * @param aGroupId the groupid for which to know if user has joined
       
   331          * @return ETrue if user is joined to the group with group id aGroupId
       
   332          */
       
   333         virtual TBool IsJoined( const TDesC& aGroupId ) const = 0;
       
   334 
       
   335         /**
       
   336          * See if this is the user's group
       
   337          * @param aGroupId the groupid for which to know if user is owner
       
   338          * @return ETrue if this group is the user's group
       
   339          */
       
   340         virtual TBool IsOwnGroup( const TDesC& aGroupId ) const = 0;
       
   341 
       
   342         /**
       
   343          * Check if the user is administrator in this group
       
   344          * @param aGroupId the groupid for which to know if user is administrator
       
   345          * @return ETrue if the user is administrator
       
   346          */
       
   347         virtual TBool IsAdmin( const TDesC& aGroupId ) const = 0;
       
   348 
       
   349         /**
       
   350          * Leave the given group. Use this method instead of
       
   351          * calling the wrapper directly (to avoid race
       
   352          * conditions). This method also does cleanup and
       
   353          * removes the group wrapper, if necessary.
       
   354          * Wraps the LeaveL in MCAGroupOperations.
       
   355          * @param aGroupId The group to leave
       
   356          * @return IMPS error code from LeaveL
       
   357          */
       
   358         virtual TInt LeaveGroupL( const TDesC& aGroupId ) = 0;
       
   359 
       
   360         /**
       
   361          * Checks if chat group is favourite or not
       
   362          * @param aGroupId The group for which to know if user has saved has favorite
       
   363          * @return ETrue if favourite EFalse if not
       
   364          */
       
   365         virtual TBool IsFavouriteChatGroup(
       
   366             const TDesC& aGroupId ) const = 0;
       
   367 
       
   368     public:
       
   369 
       
   370         /**
       
   371          * Destructor.
       
   372          */
       
   373         virtual ~MCAGroupUtilsPC()
       
   374             {
       
   375 
       
   376             };
       
   377 
       
   378 
       
   379     };
       
   380 
       
   381 #endif      // MCAGROUPUTILSPC_H
       
   382 
       
   383 // End of File