codhandler/roapapp/inc/RoapAppView.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2004 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 the License "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: 
       
    15 *      Declaration of class CRoapAppView.   
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef ROAP_APP_VIEW_H
       
    22 #define ROAP_APP_VIEW_H
       
    23 
       
    24 // INCLUDES
       
    25 
       
    26 #include <coecntrl.h>
       
    27 #include <AknsBasicBackgroundControlContext.h>
       
    28 #include <AknsDrawUtils.h> 
       
    29 
       
    30 // FORWARD DECLARATION
       
    31 
       
    32 class CCodData;
       
    33 class CEikLabel;
       
    34 class MObjectProvider;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 * Application's main view.
       
    40 */
       
    41 class CRoapAppView: public CCoeControl
       
    42     {
       
    43 
       
    44     public:     // Constructors and destructor
       
    45 
       
    46         /**
       
    47         * Two phased constructor. Leaves on failure.
       
    48         * @param aRect Rectangle to draw.
       
    49         * @param aMopParent MOP Parent.
       
    50         * @return The constructed view.
       
    51         */      
       
    52         static CRoapAppView* NewL
       
    53             ( const TRect& aRect, MObjectProvider* aMopParent );
       
    54 
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         virtual ~CRoapAppView();
       
    59 
       
    60     public:     // from CCoeControl
       
    61 
       
    62         /**
       
    63         * Size changed. Lay out and draw components.
       
    64         */
       
    65         void SizeChanged();
       
    66 
       
    67         /**
       
    68         * Count component controls.
       
    69         * @return Number of component controls.
       
    70         */
       
    71         TInt CountComponentControls() const;
       
    72 
       
    73         /**
       
    74         * Return component control.
       
    75         * @param aIndex Index of component control.
       
    76         * @param Component control.
       
    77         */
       
    78         CCoeControl* ComponentControl( TInt aIndex ) const;
       
    79 
       
    80         /**
       
    81         * Handle key event.
       
    82         * @param aKeyEvent Key event.
       
    83         * @param aType Event type.
       
    84         * @return Key response.
       
    85         */
       
    86         TKeyResponse OfferKeyEventL
       
    87             ( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    88 
       
    89         /**
       
    90         * Draw this control.
       
    91         * @param aRect Rectangle to draw.
       
    92         */
       
    93         void Draw( const TRect& aRect ) const;
       
    94         
       
    95       	/** 
       
    96       	* Gets an object whose type is encapsulated by the specified TTypeUid object.
       
    97         * @param aId Encapsulates the Uid that identifies the type of object required.
       
    98 	    * @return Encapsulates the pointer to the object provided. 
       
    99 	    * Note that the encapsulated pointer may be NULL.
       
   100         */
       
   101         TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
       
   102 
       
   103     protected:  // Constructors
       
   104 
       
   105         /**
       
   106         * Constructor.
       
   107         * @param aMopParent MOP Parent.
       
   108         */
       
   109         CRoapAppView( MObjectProvider* aMopParent );
       
   110 
       
   111         /**
       
   112         * Second phase constructor. Leaves on failure.
       
   113         * @param aRect Rectangle to draw.
       
   114         */      
       
   115         void ConstructL( const TRect& aRect );
       
   116 
       
   117     private:    // data
       
   118 
       
   119         CEikLabel* iLabel;  ///< Label. Owned.
       
   120         
       
   121         CAknsBasicBackgroundControlContext* iBgContext;  ///<BgContext. Owned.
       
   122 
       
   123     };
       
   124 
       
   125 #endif /* def ROAP_APP_VIEW_H */