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