wvuing/wvuiave/AppSrc/ccainvitationcontainer.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:  Container class for Invitations view
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CCAINVITATIONCONTAINER_H
       
    21 #define CCAINVITATIONCONTAINER_H
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 #include "MCALayoutChangeObserver.h"
       
    26 
       
    27 #include <eiklbo.h>
       
    28 #include <coecntrl.h>
       
    29 #include <aknlists.h>
       
    30 #include <bldvariant.hrh>
       
    31 #include <aknlongtapdetector.h>
       
    32 
       
    33 #include "frmtlay.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class MCAViewSwitcher;
       
    37 class CCABlockingUI;
       
    38 class CCAAppUi;
       
    39 class CCAView;
       
    40 class MCAInvitationPC;
       
    41 class CCAInvitationView;
       
    42 class CCATextViewControl;
       
    43 class CRichText;
       
    44 class CParaFormatLayer;
       
    45 class CCharFormatLayer;
       
    46 class CAknsBasicBackgroundControlContext;
       
    47 class MCARecipientObserver;
       
    48 class CAknLongTapDetector;
       
    49 
       
    50 // CLASS DECLARATION
       
    51 
       
    52 /**
       
    53 *  Container class for private chat list view
       
    54 *
       
    55 *  @lib chat.app
       
    56 *  @since 1.2
       
    57 */
       
    58 class CCAInvitationContainer : public CCoeControl,
       
    59             public MCALayoutChangeObserver,
       
    60             public MAknLongTapDetectorCallBack
       
    61     {
       
    62     public:  // Constructors and destructor
       
    63 
       
    64 
       
    65         /**
       
    66         * Static constructor
       
    67         * Symbian OS default constructor.
       
    68         * @param aRect Frame rectangle for container.
       
    69         * @param aInvitationIndex index of the invitation to be opened
       
    70         * @param aViewSwitcher Handle to view-switcher
       
    71         * @param aEngine Handle to engine
       
    72         */
       
    73         static CCAInvitationContainer* NewL(
       
    74             const TRect& aRect,
       
    75             TInt aInvitationIndex,
       
    76             TPtr aRejectReason,
       
    77             MCAViewSwitcher& aViewSwitcher,
       
    78             CCAView& aView,
       
    79             TInt& aTabId,
       
    80             TBool aContextFlag,
       
    81             MCARecipientObserver& aMenuObserver );
       
    82 
       
    83         /**
       
    84         * Destructor.
       
    85         */
       
    86         virtual ~CCAInvitationContainer();
       
    87 
       
    88         /**
       
    89          * From CCoeControl, Handles key-events
       
    90          * @param aEvent Event that occured
       
    91          * @param aType Type of key-event (EEventKey, EEventKeyUp or EEventKeyDown)
       
    92          * @return Containers response to event (EKeyWasNotConsumed/ EKeyWasConsumed)
       
    93          */
       
    94         TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType );
       
    95 
       
    96     protected:
       
    97 
       
    98         /**
       
    99         * Symbian OS default constructor.
       
   100         */
       
   101         void ConstructL( const TRect& aRect );
       
   102 
       
   103         /*
       
   104         * @param aRect Frame rectangle for container.
       
   105         * @param aViewSwitcher Handle to view-switcher
       
   106         * @param aEngine Handle to engine
       
   107         */
       
   108         CCAInvitationContainer( MCAViewSwitcher& aViewSwitcher,
       
   109                                 TInt aInvitationIndex,
       
   110                                 TPtr aRejectReason,
       
   111                                 CCAView& aView,
       
   112                                 TInt& aTabId,
       
   113                                 TBool aContextflag,
       
   114                                 MCARecipientObserver& aMenuObserver );
       
   115 
       
   116     public: // New functions
       
   117 
       
   118         /**
       
   119          * @returns ETrue if the contact is blocked
       
   120          * Else return EFalse.
       
   121          */
       
   122         TBool IsBlocked( const TDesC& aUserId );
       
   123 
       
   124         /**
       
   125          * Displays Blocked List
       
   126          */
       
   127         void DisplayBlockedListL() const;
       
   128 
       
   129         /**
       
   130          * Displays unblock list query
       
   131          */
       
   132         void DisplayUnblockListQueryL() const;
       
   133 
       
   134         /**
       
   135          * Displays block textquery
       
   136          */
       
   137         void DisplayBlockTextQueryL() const;
       
   138 
       
   139         /**
       
   140          * Adds focused conversation dead end to friendslist
       
   141          */
       
   142         void AddToFriendsL();
       
   143 
       
   144         /**
       
   145          * Switches to the singlelistview
       
   146          */
       
   147         void SwitchToSingleListViewL( );
       
   148 
       
   149         /**
       
   150          * Joins to selected conversation
       
   151          * @param aGroupId Group id
       
   152          */
       
   153         void JoinToGroupL( TInt aInviteIndex );
       
   154 
       
   155         /**
       
   156          * Deletes currently active invitation
       
   157          */
       
   158         void DeleteInvitationL( TInt aInviteindex ) ;
       
   159 
       
   160         /**
       
   161          * RejectInvitationL is called when the active
       
   162          * invitation has been rejected by teh user
       
   163          */
       
   164         void RejectInvitationL( TInt aInviteindex, TPtr aRejectReason );
       
   165 
       
   166         /**
       
   167          * This method tells if selected item is invitation or not
       
   168          * @return ETrue if selected item is invitation,
       
   169          * EFalse if it's conversation
       
   170          */
       
   171         TBool IsInvitation() const;
       
   172 
       
   173         /**
       
   174          * This method switches between the specified
       
   175          * invitation
       
   176          * @param iCurrenntActiveTab, specifies to
       
   177          * which tab  to switch.
       
   178          */
       
   179         void InvitationSwitchTabL( TInt iCurrenntActiveTab );
       
   180 
       
   181         /**
       
   182          * Prepare the text in teh rich text format,
       
   183          * @param aInvitationindex, index of the invitation
       
   184          * whose data needs to prepared int eh richtext format.
       
   185          */
       
   186         void PrepareTextL( TInt aInvitationindex );
       
   187 
       
   188         /**
       
   189          * Displays the formated Data
       
   190          * @param aInvitationindex, index of the invitation
       
   191          * whose data has to be displayed.
       
   192          */
       
   193         void DisplayTextL( TInt aInvitationindex );
       
   194 
       
   195         /**
       
   196          * Search the LAF specified font for invite dialog
       
   197          * @since 3.0
       
   198          * @return LAF specified font
       
   199          */
       
   200         const CFont* GetLayoutFont();
       
   201 
       
   202         /**
       
   203          * Inserts line to rich text object
       
   204          * @since 3.0
       
   205          * @param aTextResourceId Resource for text in line
       
   206          * @param aBold Should text be bolded
       
   207          */
       
   208         void InsertLineL( TInt aTextResourceId, TBool aBold = EFalse );
       
   209 
       
   210         /**
       
   211          * Inserts line to rich text object
       
   212          * @since 3.0
       
   213          * @param aText Text for line
       
   214          * @param aBold Should text be bolded
       
   215          */
       
   216         void InsertLineL( const TDesC& aText, TBool aBold = EFalse );
       
   217 
       
   218         /**
       
   219          * Construct a CAknLongTapDetector object
       
   220          */
       
   221         CAknLongTapDetector& LongTapDetectorL();
       
   222 
       
   223     public: // From MAknLongTapDetectorCallBack
       
   224 
       
   225         /**
       
   226          * From MAknLongTapDetectorCallBack.
       
   227          * Handle long tap event.
       
   228          * @see MAknLongTapDetectorCallBack
       
   229         */
       
   230         void HandleLongTapEventL( const TPoint& aPenEventLocation,
       
   231                                   const TPoint& aPenEventScreenLocation );
       
   232 
       
   233     private: // From MCALayoutChangeObserver
       
   234 
       
   235         /**
       
   236          * Called when layout/skins change
       
   237          * @since 2.1
       
   238          */
       
   239         void LayoutChangedL( TInt aType );
       
   240 
       
   241     private: //From base classes
       
   242 
       
   243         /**
       
   244          * From CoeControl, Handles "size changed"-events..
       
   245          * @since 2.1
       
   246          */
       
   247         void SizeChanged();
       
   248 
       
   249         /**
       
   250          * From CoeControl, Returns the number of control contained by this class.
       
   251          * @return Number of controls contained
       
   252          * @since 2.1
       
   253          */
       
   254         TInt CountComponentControls() const;
       
   255 
       
   256         /**
       
   257          * From CCoeControl, Returns handle to control pointed by aIndex
       
   258          * @param aIndex Wanted control's index [0..n]
       
   259          * @return Handle to wanted control
       
   260          * @since 2.1
       
   261          */
       
   262         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   263 
       
   264         /**
       
   265          * Gets help context
       
   266          * @since 2.1
       
   267          */
       
   268         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   269 
       
   270         /**
       
   271          * From CCoeControl.
       
   272          * Handle pointer event.
       
   273          * @see CCoeControl
       
   274          */
       
   275         void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   276 
       
   277         /**
       
   278          * From CCoeControl.
       
   279          * Handle focus event change.
       
   280          * @see CCoeControl
       
   281          */
       
   282         //void FocusChanged( TDrawNow aDrawNow );
       
   283 
       
   284     private:  // New functions
       
   285 
       
   286         /**
       
   287          * Sets the layout of container
       
   288          * @since 2.1
       
   289          */
       
   290         void SetLayout();
       
   291 
       
   292         /*
       
   293         * Error handler function. Propagates error note, if necessary.
       
   294         * @param aError Error value.
       
   295         * @since 2.1
       
   296         */
       
   297         void HandleError( TInt aError ) const;
       
   298 
       
   299         /**
       
   300          * Updates CBA set, shows label in MSK if there are
       
   301          * items in list.
       
   302          * @since S60 v3.2
       
   303          */
       
   304         void UpdateCbaL();
       
   305 
       
   306     public: // new functions
       
   307 
       
   308         /**
       
   309          *  Checks if invitation is open and processing.
       
   310          *  @return ETrue, if invitation is opened and processing.
       
   311          *	@since 2.1
       
   312          */
       
   313         TBool IsInvitationOpen();
       
   314 
       
   315     private:    // Data
       
   316 
       
   317         // Owns. Array of controls contained
       
   318         CArrayPtrSeg<CCoeControl>* iControlArray;
       
   319 
       
   320         //Doesn't own
       
   321         MCAViewSwitcher& iViewSwitcher;
       
   322 
       
   323         //Owns
       
   324         CCABlockingUI* iBlockingUI;
       
   325 
       
   326         //doesn't own
       
   327         CCAAppUi* iAppUi;
       
   328 
       
   329         // Flag for telling if invitation is opened.
       
   330         TBool iInvitationOpen;
       
   331 
       
   332         // EFalse, if numeric input for WVID fields is wanted
       
   333         TBool iTextualInputMode;
       
   334 
       
   335         // Doesn't own
       
   336         CCAView& iView;
       
   337 
       
   338         // doesn't own
       
   339         CEikButtonGroupContainer* iCba;
       
   340 
       
   341         //Does not Own
       
   342         MCAInvitationPC* iInvitationPC;
       
   343 
       
   344 
       
   345         TInt iInvitationIndex;
       
   346 
       
   347         //pointer to teh reject reason
       
   348         TPtr iRejectReason;
       
   349 
       
   350         // Owns. Text view control
       
   351         CCATextViewControl* iTextView;
       
   352 
       
   353         // Owns. Rich text for invitation view
       
   354         CRichText* iRichText;
       
   355 
       
   356         // Owns. Paragraph formatter
       
   357         CParaFormatLayer* iParaFormatLayer;
       
   358 
       
   359         // Owns. Character formatter
       
   360         CCharFormatLayer* iCharFormatLayer;
       
   361 
       
   362         // Owns. Date and time buffer
       
   363         HBufC* iDateTime;
       
   364 
       
   365         HBufC* iIdentification;
       
   366 
       
   367         // Skin background control context
       
   368         CAknsBasicBackgroundControlContext* iBgContext;
       
   369 
       
   370         //Reference variable required to delete the tab.
       
   371         TInt& iTabId;
       
   372 
       
   373         //Tells whether to show the contxtmenu or not
       
   374         TBool iContextFlag;
       
   375 
       
   376         TCursorSelection iLastSelection;
       
   377 
       
   378 
       
   379         //Doesn't own. Handle to recipient observer
       
   380         MCARecipientObserver& iMenuObserver;
       
   381 
       
   382         // Owns. Long tap the main pane
       
   383         CAknLongTapDetector* iLongTapDetector;
       
   384         TBool iLongTapUsed;
       
   385 
       
   386 
       
   387     };
       
   388 
       
   389 #endif      // CCAINVITATIONCONTAINER_H
       
   390 
       
   391 // End of File