phoneapp/phoneuiview/src/cphoneuidisablednote.cpp
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2005 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 CPhoneUIDisabledNote class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "cphoneuidisablednote.h"
       
    21 #include "aknnotedialog.h"
       
    22 #include "phoneui.hrh"
       
    23 #include <featmgr.h>
       
    24 #include <aknnotedialog.h>
       
    25 #include <eikdialg.h>
       
    26 #include <aknnotecontrol.h>
       
    27 
       
    28 
       
    29 // ================= MEMBER FUNCTIONS =======================
       
    30 // C++ default constructor can NOT contain any code, that
       
    31 // might leave.
       
    32 //
       
    33 CPhoneUIDisabledNote::CPhoneUIDisabledNote( CEikDialog** aSelfPtr, MEikCommandObserver& aCommandObserver )
       
    34     : CPhoneNote( aSelfPtr, aCommandObserver ) 
       
    35     {
       
    36     }
       
    37 
       
    38 // ---------------------------------------------------------
       
    39 // Destructor
       
    40 // ---------------------------------------------------------
       
    41 // 
       
    42 CPhoneUIDisabledNote::~CPhoneUIDisabledNote()
       
    43     {
       
    44     }
       
    45 
       
    46 // ---------------------------------------------------------
       
    47 // CPhoneUIDisabledNote::OfferKeyEventL
       
    48 // ---------------------------------------------------------
       
    49 //
       
    50 TKeyResponse CPhoneUIDisabledNote::OfferKeyEventL( 
       
    51     const TKeyEvent& aKeyEvent,
       
    52     TEventCode /*aType*/ )
       
    53     {
       
    54     // Let key events be handled by the application
       
    55 	return EKeyWasNotConsumed;
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------
       
    59 // CPhoneUIDisabledNote::OkToExitL
       
    60 // ---------------------------------------------------------
       
    61 //
       
    62 TBool CPhoneUIDisabledNote::OkToExitL( TInt aCommand )
       
    63     {
       
    64     // Let the command observer process the command
       
    65     iCommandObserver.ProcessCommandL( aCommand );
       
    66 
       
    67     return EFalse; // so that the dialog will not disappear
       
    68     }
       
    69     
       
    70 // ---------------------------------------------------------
       
    71 // CPhoneUIDisabledNote::SetNoteType
       
    72 // ---------------------------------------------------------
       
    73 //
       
    74 void CPhoneUIDisabledNote::SetNoteType( TPhoneNoteType aNoteType )
       
    75     {
       
    76     iNoteType = aNoteType;
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------
       
    80 // CPhoneUIDisabledNote::NoteType
       
    81 // ---------------------------------------------------------
       
    82 //
       
    83 TPhoneNoteType CPhoneUIDisabledNote::NoteType()
       
    84     {
       
    85     return iNoteType;
       
    86     }
       
    87 
       
    88 // ---------------------------------------------------------
       
    89 // CPhoneUIDisabledNote::HandlePointerEventL
       
    90 // ---------------------------------------------------------
       
    91 //
       
    92 void CPhoneUIDisabledNote::HandlePointerEventL( 
       
    93     const TPointerEvent& /* aPointerEvent */ )
       
    94     {
       
    95     }
       
    96 
       
    97 // ---------------------------------------------------------
       
    98 // CPhoneUIDisabledNote::UpdateSoftkeysL
       
    99 // ---------------------------------------------------------
       
   100 //
       
   101 void CPhoneUIDisabledNote::UpdateSoftkeysL( TInt aResourceId )
       
   102     {
       
   103     CEikButtonGroupContainer& buttonGroup = ButtonGroupContainer();
       
   104     buttonGroup.SetCommandSetL( aResourceId );
       
   105     
       
   106     buttonGroup.DrawDeferred();
       
   107     }
       
   108 
       
   109 // ---------------------------------------------------------
       
   110 // CPhoneUIDisabledNote::SetSizeAndPosition
       
   111 // ---------------------------------------------------------
       
   112 //
       
   113 void CPhoneUIDisabledNote::SetSizeAndPosition( const TSize& aSize )
       
   114     {
       
   115     CAknNoteDialog::SetSizeAndPosition( aSize );
       
   116     
       
   117 	// Override the original layout position to prevent note to hide the call bubble
       
   118 	// Will be changed when layout is available	
       
   119     TRect clientRect = CEikonEnv::Static()->EikAppUi()->ClientRect();
       
   120     TRect noteRect;
       
   121     TInt leftMargin = (TInt) ( (clientRect.Width() - aSize.iWidth) / 2);    // Set note to center
       
   122 
       
   123     noteRect.SetRect( leftMargin,                // iTl.iX
       
   124             clientRect.iBr.iY - aSize.iHeight,   // iTl.iY
       
   125             leftMargin + aSize.iWidth,           // iBr.iX
       
   126             clientRect.iBr.iY );                 // iBr.iY
       
   127     
       
   128     SetRect( noteRect );
       
   129     }
       
   130 
       
   131 // End of File