wvuing/wvuiprocess/Inc/MCAContactEditPC.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 settings related operations
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MCACONTACTEDITPC_H
       
    20 #define MCACONTACTEDITPC_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <badesca.h>
       
    26 
       
    27 #include "TEnumsPC.h"
       
    28 
       
    29 class MCAMainViewArrayPC;
       
    30 class MCAPresenceError;
       
    31 
       
    32 
       
    33 // INTERFACE DECLARATION
       
    34 /*
       
    35 * MCAContactEditPC: This is main interface of contact editor on
       
    36 * Process component side.
       
    37 *
       
    38 * @lib wvuiprocessng.lib
       
    39 * @since 3.2
       
    40 */
       
    41 
       
    42 class MCAContactEditPC
       
    43     {
       
    44     public:
       
    45         /**
       
    46          *
       
    47          * Used to get the info of the current contact details
       
    48          * Before calling this function Initialise function should have been called.
       
    49          * Caller is responsible for the data allocated to pointers.
       
    50          * @Param aAliasEnabled - Flag to denote alias is enabled or not
       
    51          * @Param aNicknameEnabled - Flag to denote nickname was enabled or not
       
    52          * @Param iOwnData - ETrue denotes the contact to be edited is owndata
       
    53          * @Param iOrigId - Returns the allocated pointer for UserId
       
    54          * @Param iAlias -  Returns the allocated pointer for Alias
       
    55          * @Param iNickname - Returns the allocated pointer for Nickname
       
    56          * @Param iUserId - Returns the allocated pointer for UserId
       
    57          * @Param iIdentification - Returns the allocated pointer for Identification
       
    58          * @since 3.2
       
    59          */
       
    60         virtual void GetContactDetailsL(
       
    61             const TBool aAliasEnabled,
       
    62             const TBool aNicknameEnabled,
       
    63             TBool&  aOwnData,
       
    64             HBufC*& aOrigId,
       
    65             HBufC*& aAlias,
       
    66             HBufC*& aNickname,
       
    67             HBufC*& aUserId,
       
    68             HBufC*& aIdentification ) = 0;
       
    69 
       
    70         /**
       
    71          *
       
    72          * Used to initialise the contact which is to be edited
       
    73          * @Param aCCAMainViewArrayPC - Ptr to the process component of Main ViewArray
       
    74          * @Param aIndex - Current Index of the contact that is to be edited in
       
    75          *						the Main View Array
       
    76          * @Param aOwnStatus - Reference to the caller variable - Etrue
       
    77          *
       
    78          * @since 3.2
       
    79          */
       
    80         virtual void InitialiseL(
       
    81             MCAMainViewArrayPC& aMainViewArrayPC,
       
    82             const TInt aIndex, TBool& aOwnStatus ) = 0 ;
       
    83 
       
    84 
       
    85         /**
       
    86          *
       
    87          * Used to initialise the contact which is to be edited
       
    88          * @Param aWVID - wvid
       
    89          * @Param aListId - ListID
       
    90          * @Param aOwnStatus - Reference to the caller variable - Etrue
       
    91          * @since 3.2
       
    92          */
       
    93         virtual void InitialiseL( const TDesC& aWVID,
       
    94                                   const TDesC& aListId, TBool& aOwnStatus ) = 0;
       
    95 
       
    96         /**
       
    97          *
       
    98          * Used to Find whether a WVUID is availble and valid
       
    99          * @Param aCreateNew - EFalse if Edit contact and ETrue if add new contact
       
   100          * @Param aListId - List id
       
   101          * @Param aWVID - WVID of the contact to be edited
       
   102          * @Param aContactInList - Returns ETrue/EFalse if the aWVID is available
       
   103          * @Param aUserId - returns the user id that s avilable in the store.
       
   104          * @Return ETrue/EFalse
       
   105          * @since 3.2
       
   106          */
       
   107         virtual TBool IsWVIDAvailableAndValidL( TBool aCreateNew, const TDesC& aListId,
       
   108                                                 const TDesC& aWVID,
       
   109                                                 TBool& aContactInList, TDesC*& aUserID ) = 0;
       
   110 
       
   111 
       
   112         /**
       
   113          *
       
   114          * Used to Find whether any other contact has the same nickname
       
   115          * @Param aNickName - Nickname
       
   116          * @Return ETrue/EFalse
       
   117          * @since 3.2
       
   118          */
       
   119         virtual TBool FindAnyContactByNickL( const TDesC& aNickName ) = 0 ;
       
   120 
       
   121 
       
   122         /**
       
   123          * Add new contact to contact list (server)
       
   124          * @param aListId List id
       
   125          * @param aWVID WVID of the contact to be added
       
   126          * @param aNickName Nick name
       
   127          * @param aAlias AliasName
       
   128          * @return error code
       
   129          * @since 3.2
       
   130          */
       
   131         virtual TInt AddContactL( const TDesC& aListId,
       
   132                                   const TDesC& aWVID, const TDesC& aNickName,
       
   133                                   const TDesC& aAlias ) = 0;
       
   134 
       
   135 
       
   136         /**
       
   137          * Update contact to contact list (server)
       
   138          * @param aListId List id
       
   139          * @param aWVID WVID of the contact to be updated
       
   140          * @param aNickName Nick name
       
   141          * @return error code
       
   142          * @since 3.2
       
   143          */
       
   144         virtual TInt UpdateContactL( const TDesC& aListId,
       
   145                                      const TDesC& aWVID,
       
   146                                      const TDesC& aNickName ) = 0;
       
   147 
       
   148         /**
       
   149          * Remove contact from contact list (server)
       
   150          * @param aListId List id
       
   151          * @param aWVID WVID of the contact to be added
       
   152          * @return error code
       
   153          * @since 3.2
       
   154          */
       
   155         virtual TInt RemoveContactL( const TDesC& aListId,
       
   156                                      const TDesC& aWVID ) = 0;
       
   157 
       
   158 
       
   159         /**
       
   160         * Sets the iContact to the contact found using aListId, aWVId
       
   161         * @param aListId List id
       
   162         * @param aWVID WVID of the contact
       
   163         * @since 3.2
       
   164         */
       
   165         virtual void SetContactL( const TDesC& aListId,
       
   166                                   const TDesC& aWVID ) = 0;
       
   167 
       
   168         /**
       
   169          * Sets the iContact to the contact found using aWVId
       
   170          * @param aWVID WVID of the contact
       
   171          * @since 3.2
       
   172          */
       
   173         virtual void SetAnyContactL( const TDesC& aWVID ) = 0;
       
   174 
       
   175         /**
       
   176          * GetCurrentContactNickname
       
   177          * @return Nickname of this contact
       
   178          * @since 3.2
       
   179          */
       
   180         virtual const TDesC& GetCurrentContactNickname() const = 0;
       
   181 
       
   182         /**
       
   183          * GetCurrentUserId
       
   184          * @return UserId of this contact
       
   185          * @since 3.2
       
   186          */
       
   187         virtual const TDesC& GetCurrentContactUserId() const = 0;
       
   188 
       
   189         /**
       
   190          * Online status of user.
       
   191          * @param aContactId Id which status is wanted.
       
   192          * @return Onlinestatus of user.
       
   193          * @since 3.2
       
   194          */
       
   195         virtual TEnumsPC::TOnlineStatus GetOnlineStatus() const = 0;
       
   196 
       
   197         /**
       
   198          * Client type
       
   199          * @return Client type of this contact
       
   200          * @since 3.2
       
   201          */
       
   202         virtual TEnumsPC::TClientType GetClientType() const = 0;
       
   203 
       
   204         /**
       
   205          * Status Text
       
   206          * @return StatusText of the current contact
       
   207          * @since 3.2
       
   208          */
       
   209         virtual const TDesC& GetStatusText() const = 0;
       
   210 
       
   211         /**
       
   212          * Identification Name
       
   213          * @return Identification of the current contact
       
   214          * @since 3.2
       
   215          */
       
   216         virtual const TDesC& GetCurrentContactIdentification() const = 0;
       
   217 
       
   218         /**
       
   219          * Alias Name
       
   220          * @return Alias of the current contact
       
   221          * @since 3.2
       
   222          */
       
   223         virtual const TDesC& GetCurrentContactAlias() const = 0;
       
   224 
       
   225 
       
   226         /**
       
   227          * allocates and returns a pointer to the aliasname
       
   228          * @param aWVID WVID of the contact
       
   229          * @return pointer - This must be freed by the caller.
       
   230          * @since 3.2
       
   231          */
       
   232         virtual HBufC* GetAliasFromPresenceL( const TDesC& aWVID ) = 0;
       
   233 
       
   234         /**
       
   235          * Deletes currently viewed contact.
       
   236          * @return General error code or KErrNone.
       
   237          * @since 3.2
       
   238          */
       
   239         virtual TInt DeleteCurrentContactL( const TDesC& aListId,
       
   240                                             const TDesC& aOrigId ) = 0;
       
   241 
       
   242         /**
       
   243          * Is Contact
       
   244          * @return ETrue - if contact available else EFalse.
       
   245          * @since 3.2
       
   246          */
       
   247         virtual TBool IsContact() const = 0;
       
   248 
       
   249         /**
       
   250          * Allocates and returns the ListId for the given UserId
       
   251          * @param aId - Current User Id in case of operation other than move
       
   252          *				- Current listid in case the operation is move
       
   253          * @param aNoListsResource
       
   254          * @param aItemCount - returns itemcount of the found listId's
       
   255          * @param aListIdArray - returns a pointer to the array of listId's
       
   256          * @param aMoveOperation - Bool to represent whether it is a Move operation/not
       
   257          * @return Pointer to the list id if exists else NULL.
       
   258          * The return pointer has to be freed by the caller.
       
   259          * @since 3.2
       
   260          */
       
   261         virtual HBufC* GetListIdL( const TDesC& aId, TInt aNoListsResource,
       
   262                                    TInt &aItemCount, CDesCArrayFlat*& aListIdArray,
       
   263                                    RArray< TInt > 	&aIndexArray,
       
   264                                    const TBool aMoveOperation = EFalse ) = 0;
       
   265 
       
   266         /**
       
   267          * Allocates and returns the ListId for the given UserId
       
   268          * This function should be preceded by GetListIdL
       
   269          * Do not call this fnction without calling GetListIdL and item count > 1
       
   270          * @param aSelectedIndex - Selected index
       
   271          * @return Pointer to the list id
       
   272          * The return pointer has to be freed by the caller.
       
   273          * @since 3.2
       
   274          */
       
   275         virtual HBufC* GetListIdAtIndexL( TInt aSelectedIndex ) const = 0 ;
       
   276 
       
   277         /**
       
   278         * Changes own alias to aAlias
       
   279         * @param aAlias New own alias
       
   280         * @return error code
       
   281         * @since 3.2
       
   282         */
       
   283 
       
   284         virtual TInt UpdateOwnAliasL( const TDesC & aAlias ) = 0;
       
   285 
       
   286         /**
       
   287         * Verify that contact is still valid.
       
   288         * @param aListId - List ID
       
   289         * @return ETrue - valid user
       
   290         *         EFalse - invalid user
       
   291         * @since 3.2
       
   292         */
       
   293 
       
   294         virtual TBool IsContactValidL( const TDesC& aListId ) = 0;
       
   295 
       
   296         /**
       
   297         * ReleaseResources
       
   298         * @Reset the iContact and iOwnData
       
   299         */
       
   300         virtual void ReleaseResources() = 0 ;
       
   301 
       
   302         /**
       
   303         * IsOwnData
       
   304         * return ETrue if the current contact is OwnData
       
   305         */
       
   306         virtual TBool IsOwnData() const = 0;
       
   307 
       
   308         /**
       
   309          * Is list collapsed or not.
       
   310          * @return ETrue, if collapsed, EFalse if expanded
       
   311          */
       
   312         virtual TBool IsCollapsedL( const TDesC& aListId ) = 0;
       
   313 
       
   314         /**
       
   315          * DeleteContactL: Deletes a contact
       
   316          * @Param aBlockedContact: WVID of the contact to be deleted
       
   317          * retruns errorcode.
       
   318          */
       
   319         virtual TInt DeleteContactL( const TDesC& aBlockedContact ) = 0;
       
   320         //DTor
       
   321         virtual ~MCAContactEditPC() {};
       
   322     };
       
   323 
       
   324 
       
   325 #endif // MCACONTACTEDITPC_H
       
   326 
       
   327 // End of File