phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/inc/ccappcommlauncherheadercontrol.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2008-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:  The header part control(s) of the commlauncher plugin UI
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CCCAPPCOMMLAUNCHERHEADERCONTROL_H
       
    20 #define CCCAPPCOMMLAUNCHERHEADERCONTROL_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <eikmobs.h>
       
    24 #include "ccappcommlauncherheaders.h"
       
    25 #include <ccappimagedecoding.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CEikImage;
       
    29 class CEikLabel;
       
    30 class CCCAppCommLauncherImageDecoding;
       
    31 class CCCAppCommLauncherHeaderTextOrder;
       
    32 class CAknStylusPopUpMenu;
       
    33 class CCCAppCommLauncherPbkCmd;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37  * Class implementing the header part control of commlauncherplugin
       
    38  *
       
    39  *  @code
       
    40  *   ?good_class_usage_example(s)
       
    41  *  @endcode
       
    42  *
       
    43  *  @lib ccappcommlauncherplugin.dll
       
    44  *  @since S60 v5.0
       
    45  */
       
    46 class CCCAppCommLauncherHeaderControl : 
       
    47             public CCoeControl,  
       
    48             public MEikMenuObserver, 
       
    49             public MCCAppImageDecodingObserver
       
    50     {
       
    51 public:
       
    52     // Construction & destruction
       
    53     /**
       
    54      * Two-phased constructor.
       
    55      */
       
    56     static CCCAppCommLauncherHeaderControl* NewL( CCCAppCommLauncherPlugin& aPlugin );
       
    57     
       
    58     /**
       
    59      * Destructor.
       
    60      */
       
    61     ~CCCAppCommLauncherHeaderControl();
       
    62     
       
    63     // Functions from base classes 
       
    64     /**
       
    65      * From CCoeControl
       
    66      * Component control handling (compound control)
       
    67      */
       
    68     TInt CountComponentControls() const;
       
    69     
       
    70     /**
       
    71      * From CCoeControl
       
    72      * Component control handling (compound control)
       
    73      */
       
    74     CCoeControl* ComponentControl(TInt aIndex) const;
       
    75     
       
    76     /**
       
    77      * From CoeControl
       
    78      * Called by framework when the view size is changed.
       
    79      */
       
    80     void SizeChanged();
       
    81     
       
    82     /**
       
    83      * From CoeControl
       
    84      * Overridden to set the container window for child controls
       
    85     */
       
    86     void SetContainerWindowL(const CCoeControl& aContainer);
       
    87     
       
    88     /**
       
    89      * From CoeControl
       
    90      * Overridden to receive pointer events
       
    91     */
       
    92     void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
    93 
       
    94     /**
       
    95      * Contact data info is given through this
       
    96      */
       
    97     void ContactInfoFetchedNotifyL( 
       
    98         const CCmsContactFieldInfo& aContactFieldInfo );
       
    99     
       
   100     /**
       
   101      * Contact data is given through this
       
   102      */
       
   103     void ContactFieldFetchedNotifyL( 
       
   104             const CCmsContactField& aContactField );
       
   105     
       
   106     /**
       
   107      * Notification of completed fetching is given through this
       
   108      */
       
   109     void ContactFieldFetchingCompletedL();
       
   110     
       
   111     /**
       
   112      * Sets the bitmap shown in the header image 
       
   113      * Ownership is transferred
       
   114      * 
       
   115      * @param aBmp The bitmap
       
   116      */
       
   117     void SetBitmap(CFbsBitmap* aBmp);
       
   118     
       
   119     /**
       
   120      * Clears the texts & the image
       
   121      */
       
   122     void ClearL();
       
   123     
       
   124     /**
       
   125      * Set contact store information
       
   126      * @param aContactStore the contact store
       
   127      */
       
   128     void SetContactStoreL(TCmsContactStore aContactStore);
       
   129     
       
   130     /**
       
   131      * From CCoeControl
       
   132      * (see details from baseclass )
       
   133      */
       
   134     TKeyResponse OfferKeyEventL(
       
   135         const TKeyEvent& aKeyEvent, TEventCode aType);
       
   136 
       
   137     inline void SetStatusButtonVisibility( TBool aVisible )
       
   138         { iStatusButtonVisibility = aVisible; }
       
   139     
       
   140 public: // MEikMenuObserver
       
   141      virtual void ProcessCommandL(TInt aCommandId);
       
   142      virtual void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis);
       
   143 
       
   144 private:    // from MCCAppImageDecodingObserver
       
   145      void BitmapReadyL( CFbsBitmap* aBitmap );
       
   146      
       
   147 private:
       
   148 
       
   149     /**
       
   150      * Constructor for performing 1st stage construction
       
   151      */
       
   152     CCCAppCommLauncherHeaderControl( CCCAppCommLauncherPlugin& aPlugin );
       
   153 
       
   154     /**
       
   155      * Constructor for performing 2nd stage construction
       
   156      */
       
   157     void ConstructL();
       
   158     
       
   159     /**
       
   160      * Helper function for the leaving part of changing labels size
       
   161      */
       
   162     void LabelsSizeChangedL();
       
   163        
       
   164     /**
       
   165      * Updates the number/address popup
       
   166      */
       
   167     void UpdatePopupL();
       
   168 
       
   169     /** 
       
   170       * Converts point's relative coordinaters into absolute screen coordinates 
       
   171       */  
       
   172     void PosToScreenCoordinates( CCoeControl* aControl, TPoint& aPos );
       
   173     
       
   174     /** 
       
   175       * Launches contact image selection stylus popup menu 
       
   176       */  
       
   177     void LaunchStylusPopupL( const TPointerEvent& aPointerEvent );
       
   178     
       
   179     /** 
       
   180       * Launches view image command 
       
   181       */  
       
   182     void DoViewImageCmdL();
       
   183     
       
   184     /** 
       
   185       * Launches change image command 
       
   186       */  
       
   187     void DoChangeImageCmdL();
       
   188     
       
   189     /** 
       
   190       * Launches remove image command 
       
   191       */  
       
   192     void DoRemoveImageCmdL();
       
   193     
       
   194     /** 
       
   195       * Launches add image command 
       
   196       */  
       
   197     void DoAddImageCmdL();
       
   198     
       
   199     /** 
       
   200       * Does the configuration contain phone memory  
       
   201       */  
       
   202     TBool IsPhoneMemoryInConfigurationL();
       
   203     
       
   204     /** 
       
   205       * Displays contact image if available  
       
   206       */  
       
   207     void ProcessContactImageDisplayL();
       
   208     
       
   209     /**
       
   210      * Helper function for changing Favorite Icon size
       
   211      */
       
   212     void FavoriteIconSizeChanged();
       
   213     
       
   214     /**
       
   215      * The image control
       
   216      * Own.
       
   217      */
       
   218     CEikImage* iImage;
       
   219     
       
   220     /**
       
   221      * The bitmap
       
   222      * Own.
       
   223      */
       
   224     CFbsBitmap* iBitmap;
       
   225     CFbsBitmap* iMask;
       
   226     
       
   227     /**
       
   228      * The label controls
       
   229      * Own.
       
   230      */    
       
   231     RPointerArray<CEikLabel> iLabels;
       
   232         
       
   233     /**
       
   234      * Active listener to make asynchronic operation synchronic
       
   235      * Own.
       
   236      */    
       
   237     CCCAppImageDecoding* iImageDecoding;
       
   238     
       
   239     /**
       
   240      * Helper for ordering the texts
       
   241      * Own.
       
   242      */
       
   243     CCCAppCommLauncherHeaderTextOrder* iTextOrder;
       
   244     
       
   245     /** 
       
   246       * Contact image selection stylus popup menu 
       
   247       * Own. 
       
   248       */  
       
   249     CAknStylusPopUpMenu* iImageSelectionPopup;
       
   250     
       
   251     /** 
       
   252       * Contact image selection stylus popup menu position 
       
   253       *  
       
   254       */  
       
   255     TPoint iPos;
       
   256     
       
   257     /** 
       
   258       * Contact has an image 
       
   259       *  
       
   260       */ 
       
   261     TBool iHasContactImage;
       
   262     
       
   263     /** 
       
   264       * Command launcher to start Pbk commands 
       
   265       * Own 
       
   266       */  
       
   267     CCCAppCommLauncherPbkCmd* iPbkCmd;
       
   268     
       
   269     /**
       
   270      * Ref to plugin.
       
   271      * Not own.
       
   272      */
       
   273     CCCAppCommLauncherPlugin& iPlugin;
       
   274 
       
   275     /**
       
   276      * Pointers to contact fields.
       
   277      * Pointed contact fields not own.
       
   278      */    
       
   279     RArray<CCmsContactField> iCmsContactFields;
       
   280     
       
   281     /** 
       
   282       * Contact image size 
       
   283       */ 
       
   284     TSize iContactImageSize;
       
   285     
       
   286     /** 
       
   287       * Contact image path
       
   288       * Own
       
   289       */ 
       
   290     HBufC* iContactImageFullName;
       
   291 
       
   292     /** 
       
   293       * Contact thumbnail data
       
   294       * Own
       
   295       */ 
       
   296     HBufC8* iContactThumbnailData;
       
   297 
       
   298     /** 
       
   299       * Store contact image path
       
   300       * Own
       
   301       */ 
       
   302     HBufC* iStoreContactImageFullName;
       
   303     
       
   304     TBool iStatusButtonVisibility;
       
   305     
       
   306     /**
       
   307      * The Favorite Icon control
       
   308      * Own.
       
   309      */
       
   310     CEikImage* iFavContactIcon;
       
   311     };
       
   312 
       
   313 #endif // CCCAPPCOMMLAUNCHERHEADERCONTROL_H