uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsheadercontrol.h
changeset 0 5e5d6b214f4f
child 3 3aab497fdbb7
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     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:  Implementation of the header part control(s) of the details view layout
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CVIMPSTDETAILSHEADERCONTROL_H
       
    20 #define CVIMPSTDETAILSHEADERCONTROL_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <coecntrl.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CEikImage;
       
    28 class CEikLabel;
       
    29 class CVIMPSTDetailsViewBrandHandler;
       
    30 class MVPbkStoreContact;
       
    31 class MVPbkStoreContactField;
       
    32 class CVIMPSTDetailsImageDecoder;
       
    33 class MVIMPSTDetailsPresenceHandler;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37  *  Class implementing the header part control of vimpstdetailsviewplugin
       
    38  *
       
    39  *  @lib vimpstdetailsviewplugin.dll
       
    40  *  @since S60 v5.0
       
    41  */
       
    42  
       
    43 class CVIMPSTDetailsHeaderControl : public CCoeControl
       
    44     {
       
    45 public:
       
    46     // Construction & destruction
       
    47     /**
       
    48      * Two-phased constructor
       
    49      * @param aBrandHandler, Reference to brand handler class
       
    50      * @param aPresenceHandler , reference presence handler
       
    51      * @return a instance of this class
       
    52      * @since S60 v5.0
       
    53      */
       
    54     static CVIMPSTDetailsHeaderControl* NewL(CVIMPSTDetailsViewBrandHandler& aBrandHandler,
       
    55     										 MVIMPSTDetailsPresenceHandler& aPresenceHandler );
       
    56     
       
    57     /**
       
    58      * Destructor.
       
    59      * @since S60 v5.0
       
    60      */
       
    61     ~CVIMPSTDetailsHeaderControl();
       
    62 
       
    63 public: // FROM CCoeControl    
       
    64     // Functions from base classes 
       
    65     /**
       
    66      * From CCoeControl
       
    67      * Component control handling (compound control)
       
    68      * @since S60 v5.0
       
    69      */
       
    70     TInt CountComponentControls() const;
       
    71     
       
    72     /**
       
    73      * From CCoeControl
       
    74      * Component control handling (compound control)
       
    75      * @since S60 v5.0
       
    76      */
       
    77     CCoeControl* ComponentControl(TInt aIndex) const;
       
    78     
       
    79     /**
       
    80      * From CoeControl
       
    81      * Called by framework when the view size is changed.
       
    82      * @since S60 v5.0
       
    83      */
       
    84     void SizeChanged();
       
    85     
       
    86     /**
       
    87      * From CoeControl
       
    88      * Overridden to set the container window for child controls
       
    89      * @since S60 v5.0
       
    90     */
       
    91     void SetContainerWindowL(const CCoeControl& aContainer);
       
    92     
       
    93      /**
       
    94      * Sets the bitmap shown in the header image 
       
    95      * Ownership is transferred
       
    96      * 
       
    97      * @param aBmp The bitmap
       
    98      * @param aMask The bitmap mask
       
    99      * @since S60 v5.0
       
   100      */
       
   101     void SetBitmap(CFbsBitmap* aBmp, CFbsBitmap* aMask );
       
   102     
       
   103     /**
       
   104      * Clears the texts & the image
       
   105      * @since S60 v5.0
       
   106      */
       
   107     void ClearL();
       
   108 
       
   109 public:
       
   110     
       
   111    
       
   112     /**
       
   113      * create the presentation for given contact 
       
   114      * @param aContactStore the contact store
       
   115      * @since S60 v5.0
       
   116      */
       
   117      void CreateHeaderPresentationL( MVPbkStoreContact& aContact );
       
   118      
       
   119   	/**
       
   120      * Helper function for the leaving part of changing labels size
       
   121      * @since S60 v5.0
       
   122      */
       
   123     void LabelsSizeChangedL();
       
   124     /**
       
   125      * Helper function for changing avatar icon in the header 
       
   126      * @since S60 v5.0
       
   127      */
       
   128     void HeaderSizeChangedL();
       
   129     
       
   130 private:
       
   131 
       
   132     /**
       
   133      * Constructor for performing 1st stage construction
       
   134      * @param aBrandHandler , reference brand handlere
       
   135      * @param aPresenceHandler , reference presence handler
       
   136      * @since S60 v5.0
       
   137      */
       
   138     CVIMPSTDetailsHeaderControl(CVIMPSTDetailsViewBrandHandler& aBrandHandler, 
       
   139     						 MVIMPSTDetailsPresenceHandler& aPresenceHandler );
       
   140 
       
   141     /**
       
   142      * Constructor for performing 2nd stage construction
       
   143      * @since S60 v5.0
       
   144      */
       
   145     void ConstructL();
       
   146   
       
   147 	    
       
   148 private:  // data member
       
   149 
       
   150  	/**
       
   151      * not Owned : The label controls
       
   152      */  
       
   153    	CVIMPSTDetailsViewBrandHandler& iBrandHandler;
       
   154    	
       
   155 	/**
       
   156      * Not owned : reference to presence handler
       
   157      */  
       
   158 	MVIMPSTDetailsPresenceHandler& iPresenceHandler;  
       
   159       
       
   160       
       
   161     /**
       
   162      * Owns : The image control
       
   163      */
       
   164     CEikImage* iImage;
       
   165     
       
   166     /**
       
   167      * Owns : The bitmap
       
   168      */
       
   169     CFbsBitmap* iBitmap;
       
   170     
       
   171     /**
       
   172      * Owns : The mask
       
   173      */
       
   174     CFbsBitmap* iMask;
       
   175     
       
   176     /**
       
   177      * Owns : The label controls
       
   178      */    
       
   179     RPointerArray<CEikLabel> iLabels;
       
   180        
       
   181   
       
   182    
       
   183 	/**
       
   184      * Owns : virtual pbk field
       
   185      */  
       
   186 	MVPbkStoreContactField* iHeaderField;
       
   187 
       
   188 	/**
       
   189      * Owns : image decoder
       
   190      */  
       
   191 	CVIMPSTDetailsImageDecoder* iImageDecoder;
       
   192 	
       
   193 
       
   194     };
       
   195 
       
   196 #endif // CVIMPSTDETAILSHEADERCONTROL_H