imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileicondialog.h
changeset 0 5e5d6b214f4f
child 20 6b620215f837
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Dialog for selecting smile icon.
       
    15 *  Description : Handles statuspane, context pane, navi pane
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CIMCVAPPSMILEICONDIALOG_H
       
    21 #define CIMCVAPPSMILEICONDIALOG_H
       
    22 
       
    23 // INCLUDES
       
    24 #include "mimcvtapeventobserver.h"
       
    25 #include <AknDialog.h>
       
    26 #include <aknlists.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CGulIcon;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 * CIMCVAppSmileIconDialog
       
    35 *
       
    36 * Dialog for selecting smile icon.
       
    37 */
       
    38 class CIMCVAppSmileIconDialog : public CAknDialog,
       
    39                            public MIMCVTapEventObserver
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         * @param aIconArray      : Reference to smile icon array.
       
    45         * @param aSelectedIconId : For getting selected bitmap number.
       
    46         */
       
    47         static CIMCVAppSmileIconDialog* NewL( 
       
    48                         const RPointerArray<CGulIcon>& aIconArray,
       
    49 						TInt& aSelectedIconId );
       
    50 
       
    51         /**
       
    52         * Destructor.
       
    53         */
       
    54         virtual ~CIMCVAppSmileIconDialog();
       
    55 
       
    56     private:  // New functions
       
    57 
       
    58         /**
       
    59         * C++ constructor.
       
    60         */
       
    61         CIMCVAppSmileIconDialog( const RPointerArray<CGulIcon>& aIconArray,
       
    62 							TInt& aSelectedIconId );
       
    63 
       
    64     private: // Functions from base classes
       
    65 
       
    66 	    /**
       
    67         * From CEikDialog : Handle key events.
       
    68         */
       
    69         TKeyResponse OfferKeyEventL(
       
    70             const TKeyEvent& aKeyEvent,TEventCode aType );
       
    71 
       
    72 	    /**
       
    73         * From CEikDialog : Prepare for opening dialog.
       
    74         */
       
    75 		void HandleResourceChange( TInt aType );
       
    76 
       
    77         /**
       
    78         * From CEikDialog : Handle CBA-keys.
       
    79         */
       
    80         TBool OkToExitL( TInt aButtonId );
       
    81 
       
    82 	    /**
       
    83         * From CEikDialog : Prepare for opening dialog.
       
    84         */
       
    85         void PreLayoutDynInitL();
       
    86 
       
    87         /**
       
    88         * From CCoeControl : Control size is set.
       
    89         */
       
    90         void SetSizeAndPosition( const TSize& aSize );
       
    91 
       
    92         /**
       
    93         * From CCoeControl : Create custom control.
       
    94         */
       
    95         SEikControlInfo CreateCustomControlL( TInt aControlType );
       
    96 
       
    97         /**
       
    98         * From CCoeControl : Event handler
       
    99         */
       
   100     	void HandleDialogPageEventL(TInt aEventID);
       
   101 
       
   102         /**
       
   103         * Check if dialog is suitable for Smile Icon.
       
   104 		* @param aDialogRect Dialog inside which smile are shown.
       
   105 		* @param aRect Rectangle for top left smile icon.
       
   106         * @return ViewableArea if all smile can fit in viewable area other wise return 0.
       
   107         */
       
   108     	TInt CheckDialog(TAknLayoutRect aDialogRect,TRect aRect);
       
   109     	
       
   110     private: // From MIMCVTapEventObserver
       
   111         
       
   112         void HandleTapEventL( TTapEvent aEvent, TUint aControlId );
       
   113 
       
   114 	private: // helpers
       
   115 
       
   116         /**
       
   117         * Set dialog layout.
       
   118         */
       
   119 		void SetLayout();
       
   120         
       
   121         /**
       
   122         * Calculates variety used for popup_grid_graphic_window
       
   123         * according to rows in grid.
       
   124         * @return Variety value.
       
   125         */
       
   126         TInt CalculatePopupVariety();
       
   127 
       
   128 
       
   129     private:
       
   130 
       
   131 		// Reference to smile icon array.
       
   132 		const RPointerArray<CGulIcon>& iIconArray;
       
   133 
       
   134         // Selected icon id reference.
       
   135         TInt&  iIconId;
       
   136         
       
   137         // Has user selected a smiley with pen
       
   138         TBool iSmileyPointed;
       
   139         
       
   140         TBool iIsMirrored;
       
   141     };
       
   142 
       
   143 #endif  // CIMCVAPPSMILEICONDIALOG_H