phoneapp/phoneuiview/inc/cphonedialerview.h
changeset 0 5f000ab63145
child 9 8871b09be73b
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 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:  Phone UI Dialer View
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CPHONEDIALERVIEW_H
       
    19 #define __CPHONEDIALERVIEW_H
       
    20 
       
    21 //  INCLUDES
       
    22 
       
    23 #include <coecntrl.h>
       
    24 #include <coeview.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CAknsLayeredBackgroundControlContext;
       
    28 class TPhoneCommandParam;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *   View for dialer control
       
    34 */
       
    35 class CPhoneDialerView : public CCoeControl, public MCoeView
       
    36     {
       
    37     public:  // Constructors and destructor        
       
    38 
       
    39         static CPhoneDialerView *NewL( TRect aRect );
       
    40 
       
    41         virtual ~CPhoneDialerView();
       
    42 
       
    43     public: // Functions from base classes
       
    44 
       
    45         /**
       
    46         * Returns a TVwsViewId uniquely identifying the view.
       
    47         * @return Represents a view in the server
       
    48         */
       
    49         TVwsViewId ViewId() const;
       
    50 
       
    51         void ActivateL();
       
    52 
       
    53         /**
       
    54         * From CCoeControl; notifier for resource changes
       
    55         * @param aType : Type of resource change
       
    56         */
       
    57         void HandleResourceChange( TInt aType );
       
    58 
       
    59     public: // New functions
       
    60 
       
    61         /**
       
    62         * Sets the control as component.
       
    63         * @param aControl It is the new component.
       
    64         */
       
    65         void SetControl( CCoeControl* aControl );
       
    66         
       
    67         /**
       
    68         * Returns the control in the view.
       
    69         * @return aControl The control.
       
    70         */
       
    71         CCoeControl* Control() const;
       
    72        
       
    73         /**
       
    74         * Sets the security mode flag ETrue or EFalse
       
    75         * @param aStatus ETrue for the security mode. EFalse for the 
       
    76         * normal mode.
       
    77         */ 
       
    78         void SetSecurityMode ( TBool aStatus );
       
    79         
       
    80         /**
       
    81         * Get state of the security mode flag
       
    82         * @return aStatus ETrue for the security mode. EFalse for the 
       
    83         * normal mode.
       
    84         */         
       
    85         TBool IsSecurityMode();
       
    86         
       
    87     public:  // Functions from base classes
       
    88         
       
    89         /**
       
    90         * From CCoeControl
       
    91         */
       
    92         void SetRect( const TRect &aRect );        
       
    93 
       
    94     protected:  // Functions from base classes
       
    95         
       
    96         /**
       
    97         * From CCoeControl
       
    98         */
       
    99         void HandlePointerEventL(
       
   100             const TPointerEvent& aPointerEvent );
       
   101 
       
   102         /**
       
   103         * From CCoeControl
       
   104         */
       
   105         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   106 
       
   107         /**
       
   108         * From CCoeControl
       
   109         */
       
   110         TInt CountComponentControls() const;
       
   111 
       
   112         /**
       
   113         * From CCoeControl
       
   114         */
       
   115         void Draw( const TRect& aRect ) const;
       
   116 
       
   117         /**
       
   118         * From CCoeControl, informs that the size is changed to update
       
   119         * the sizes of component controls appropriately.
       
   120         */
       
   121         void SizeChanged();
       
   122 
       
   123         /**
       
   124         * From CCoeControl, informs that the position has been changed.
       
   125         */
       
   126         void PositionChanged();
       
   127 
       
   128         /**
       
   129         * From CCoeControl, MopSupplyObject
       
   130         */
       
   131         TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
       
   132 
       
   133         /**
       
   134         * From CCoeControl
       
   135         */        
       
   136         void FocusChanged( TDrawNow aDrawNow );
       
   137         
       
   138     private: // Functions from base classes
       
   139 
       
   140         /**
       
   141         * Takes any action required on activation of the view. 
       
   142         * Reimplemented versions should read the message text
       
   143         * @param aCustomMessage message for any message type 
       
   144         *                       identified by aCustomMessageId
       
   145         * @param aCustomMessageId message ID that the view understands
       
   146         * @param aPrevViewId The id of the previously active view 
       
   147         *                    so that the view may switch back to its caller
       
   148         *                    at some later stage
       
   149         */
       
   150         void ViewActivatedL( 
       
   151             const TVwsViewId& aPrevViewId, 
       
   152             TUid aCustomMessageId, 
       
   153             const TDesC8& aCustomMessage );
       
   154 
       
   155         /**
       
   156         * Takes any action required on deactivation of the view e.g. to 
       
   157         * make the controls owned by the view non-visible
       
   158         * (thereby saving the window server uneccessary work).
       
   159         */
       
   160         void ViewDeactivated();
       
   161 
       
   162     private:
       
   163 
       
   164         CPhoneDialerView();
       
   165 
       
   166         void ConstructL( TRect aRect );
       
   167 
       
   168     private:
       
   169 
       
   170         /**
       
   171         * Updates size of the control.
       
   172         */
       
   173         void UpdateControlRect();
       
   174 
       
   175     private:
       
   176 
       
   177         // Region type.
       
   178         typedef RRegionBuf< KPhoneRegionAmount > RPhoneRegionBuf;
       
   179 
       
   180         // Control rectangle
       
   181         TRect iControlRect;
       
   182         
       
   183         // Owned: region
       
   184         RPhoneRegionBuf iRegion;
       
   185         
       
   186         // Pointer to active control.
       
   187         CCoeControl* iControl;
       
   188 
       
   189         // Owned: background context.
       
   190         CAknsLayeredBackgroundControlContext* iBgContext;
       
   191 
       
   192         // Top left coordinate.
       
   193         TPoint iTopLeftCoord;
       
   194         
       
   195         // Owned: Status area use status.
       
   196         TBool iStatusAreaUsed;
       
   197         
       
   198         //Id of the fullscreen AI plugin
       
   199         TInt iFsAiId;
       
   200         
       
   201         //MainPane
       
   202         TRect iMainPane;
       
   203         
       
   204         //Is security mode or not
       
   205         TBool iSecurityMode;
       
   206         };
       
   207 
       
   208 #endif // __CPHONEDIALERVIEW_H
       
   209