wvuing/wvuiave/AppSrc/CCABlockingUI.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     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:  This class is UI side blocking handler
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CCABLOCKINGUI_H
       
    21 #define CCABLOCKINGUI_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "MCABlocking.h"
       
    25 #include "MCABlockingBackgroundObserverPC.h"
       
    26 #include "MCABlockingPC.h"
       
    27 #include "MCAMainViewArrayPC.h"
       
    28 
       
    29 #include <EIKCMOBS.H> //MEikCommandObserver
       
    30 
       
    31 // CLASS DECLARATION
       
    32 class MCABackgroundInterface;
       
    33 class CCAAppUi;
       
    34 class MCAServerContactsArrayPC;
       
    35 class CCABlockingDialog;
       
    36 /**
       
    37  *  This class provides blocking functions to UI side
       
    38  *
       
    39  *  @lib chat.app
       
    40  *  @since 1.2
       
    41  */
       
    42 
       
    43 
       
    44 class CCABlockingUI : public CBase,
       
    45             MCABlockingBackgroundObserverPC, MEikCommandObserver
       
    46     {
       
    47     private:
       
    48         enum TCAOperationWaiting
       
    49             {
       
    50             //add or removed
       
    51             EUnknown = 0,
       
    52             EShowBlockList,
       
    53             EShowUnblockList
       
    54             };
       
    55 
       
    56     public:  // Constructors and destructor
       
    57 
       
    58         /**
       
    59          * Two-phased constructor.
       
    60          * @param aBlockingPC Pointer to blockinginterfacee
       
    61          * @return Instance of the class
       
    62          */
       
    63         static CCABlockingUI* NewL( MCABlockingPC* aBlockingPC );
       
    64 
       
    65         /**
       
    66          * Two-phased constructor. Leaving pointer to stack
       
    67          * @param aBlockingPC Pointer to blockinginterface
       
    68          * @return Instance of the class
       
    69          */
       
    70         static CCABlockingUI* NewLC( MCABlockingPC* aBlockingPC );
       
    71 
       
    72         /**
       
    73          * Destructor.
       
    74          */
       
    75         virtual ~CCABlockingUI();
       
    76 
       
    77     public: // New functions
       
    78 
       
    79         /**
       
    80          * Displays blocked list
       
    81          * @param aDontShowTabGroup. For handling navipane.
       
    82          * @since 1.2
       
    83          */
       
    84         void DisplayBlockedListL( TBool aDontShowTabGroup = EFalse );
       
    85 
       
    86         /**
       
    87          * Displays selection list of blocked members.
       
    88          */
       
    89         void DisplayUnblockListQueryL();
       
    90 
       
    91         /**
       
    92          * Displays text query dialog where user can set blocked WV ID
       
    93          */
       
    94         void DisplayBlockTextQueryL();
       
    95 
       
    96         /**
       
    97          * Blocks given user
       
    98          * @param aUserId user id of blocked member
       
    99          */
       
   100         void BlockUserL( const TDesC& aUserId );
       
   101 
       
   102         /**
       
   103          * Blocks given users
       
   104          * @param aUserIds array of user id of blocked members
       
   105          */
       
   106         void BlockMultipleUsersL( const CDesCArray* aUserIds );
       
   107 
       
   108         /**
       
   109          * Restore teh title
       
   110          */
       
   111         static void RestoreTitle( TAny* aInstance );
       
   112 
       
   113         void DoRestoreTitleL();
       
   114 
       
   115         /**
       
   116          * Displays selection list of blocked members.
       
   117          */
       
   118         void DisplayBlockListQueryL();
       
   119 
       
   120         /**
       
   121          * Unblocks one user, aUserId.
       
   122          * @since S60 v3.1
       
   123          * @param aUserId WV id of contact to be unblocked.
       
   124          */
       
   125         void UnblockUserL( const TDesC& aUserId );
       
   126 
       
   127         // ---------------------------------------------------------
       
   128         // void CCASingleListContainer::GetHelpContext()
       
   129         // Gets help context
       
   130         // ---------------------------------------------------------
       
   131         //
       
   132         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   133 
       
   134     public: //From MCABlockingBackgroundObserverPC
       
   135 
       
   136         /**
       
   137          * From MCABlockingBackgroundObserverPC
       
   138          * @see MCABlockingBackgroundObserverPC
       
   139          */
       
   140         void HandleBackgroundEventPC(
       
   141             TEnumsPC::TCABackgroundTasks aEventSource,
       
   142             TEnumsPC::TCABackgroundStatus aStatus,
       
   143             TInt aSubTaskNumber,
       
   144             TInt aLeaveCode );
       
   145 
       
   146     public:	//from MEikCommandObserver
       
   147         /**
       
   148          * From MEikCommandObserver
       
   149          * @see MEikCommandObserver
       
   150          */
       
   151         void ProcessCommandL( TInt aCommandId );
       
   152 
       
   153         /**
       
   154          * From MEikCommandObserver
       
   155          * @see MEikCommandObserver
       
   156          */
       
   157         CCoeControl* CreateCustomCommandControlL( TInt aControlType );
       
   158 
       
   159     private:
       
   160 
       
   161         /**
       
   162          * C++ default constructor.
       
   163          * @param aBlockingInterface Reference to blocking interface
       
   164          * @param aBackgroundInterface Reference to aBackgroundInterface
       
   165          */
       
   166         CCABlockingUI( MCABlockingPC* aBlockingPC ); //MCABlocking& aBlockingInterface,
       
   167         //	MCABackgroundInterface&  aBackgroundInterface );
       
   168 
       
   169         /**
       
   170          * By default Symbian 2nd phase constructor is private.
       
   171          */
       
   172         void ConstructL();
       
   173 
       
   174         /**
       
   175          * UnBlocks a SINGLE CONTACT
       
   176          */
       
   177         void UnBlockL();
       
   178 
       
   179         /**
       
   180          * Takes the backup of title.
       
   181          */
       
   182         void BackupTitleL();
       
   183 
       
   184         /**
       
   185          * Displays text query dialog where user can set blocked WV ID
       
   186          * for ProcessCommandL
       
   187          */
       
   188         void DisplayBlockTextQuery2L();
       
   189 
       
   190         /**
       
   191          * Removed user ids from all lists.
       
   192          * @param aUserIds array of ids to remove.
       
   193          */
       
   194         void RemoveIDsL( const CDesCArray* aUserIds ) const;
       
   195 
       
   196         /**
       
   197          * Sets correct list box index after blocking of new
       
   198          * contact(s).
       
   199          * @since S60 v3.1
       
   200          * @param aMultipleBlocked If ETrue focus is set to first
       
   201          *                         list box item.
       
   202          * @param aBlockedId If aMultipleBlocked is EFalse and
       
   203          *                   aBlockedId is given focus is set to that.
       
   204          */
       
   205         void SetIndexAfterBlocking( TBool aMultipleBlocked = EFalse,
       
   206                                     const TDesC& aBlockedId = KNullDesC );
       
   207 
       
   208     private:    // Data
       
   209 
       
   210         //Operation waiting to complete
       
   211         TCAOperationWaiting iFetchOperation;
       
   212 
       
   213         //Doesn't own
       
   214         MCABlockingPC* iBlockingPC;
       
   215 
       
   216         //Doesn't own
       
   217         CCAAppUi* iAppUi;
       
   218 
       
   219 
       
   220         TBool iWaiting;
       
   221 
       
   222         //Owns. Pointer to BlockingDialog
       
   223         CCABlockingDialog* iBlockingDialog;
       
   224 
       
   225 
       
   226         TInt iSelectedItem;
       
   227 
       
   228         //owns
       
   229         HBufC* iOldTitle;
       
   230 
       
   231         // EFalse, if numeric input for WVID fields is wanted
       
   232         TBool iTextualInputMode;
       
   233 
       
   234         //Does not own. pointer to MainViewArrayPC
       
   235         MCAMainViewArrayPC* iMainViewArrayPC;
       
   236 
       
   237         //Does not own
       
   238         MCAServerContactsArrayPC* iBlockingArray;
       
   239 
       
   240         // to avoid application crash when  bolck dialog closed
       
   241         // by AknDialogShutter::ShutDialogsL( *iEikonEnv )
       
   242         TBool iDialogShutter;
       
   243 
       
   244     };
       
   245 
       
   246 #endif      // CCABLOCKINGUI_H
       
   247 
       
   248 // End of File