phoneuis/easydialing/tsrc/edta/inc/edta_screentextbuffer.h
branchRCL_3
changeset 3 8871b09be73b
equal deleted inserted replaced
2:c84cf270c54f 3:8871b09be73b
       
     1 /*
       
     2 * Copyright (c) 2010 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:  Easy dialing test application.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __EDTA_SCREENTEXTBUFFER_H__
       
    19 #define __EDTA_SCREENTEXTBUFFER_H__
       
    20 
       
    21 // INCLUDES
       
    22 #include <coecntrl.h>
       
    23 #include <eiklabel.h>
       
    24 #include <coecntrl.h>
       
    25 #include <gdi.h>
       
    26 #include <eiksbobs.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CEikScrollBarFrame;
       
    30 class CFont;
       
    31 class TBidiText;
       
    32 class CAknsBasicBackgroundControlContext;
       
    33 
       
    34 // CONSTANTS
       
    35 const TInt KEdtaMaxLineWidth = 200;
       
    36 
       
    37 
       
    38 // CLASS DECLARATION
       
    39 class CEdtaScreenTextBuffer : public CCoeControl, public MEikScrollBarObserver
       
    40     {
       
    41     
       
    42 public:
       
    43     static CEdtaScreenTextBuffer* NewL( const TRect& aRect );
       
    44     static CEdtaScreenTextBuffer* NewLC( const TRect& aRect );
       
    45     
       
    46 public:
       
    47     CEdtaScreenTextBuffer();
       
    48     ~CEdtaScreenTextBuffer();
       
    49 
       
    50     void ConstructL( const TRect& aRect );
       
    51     void HandleResourceChange(TInt aType);
       
    52     void WriteLineL( TRefByValue<const TDesC> aText,... ); // text wrapping, was: const TDesC& aText
       
    53     void DeleteLastLine(TInt aCount = 1);
       
    54     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aModifiers );
       
    55     
       
    56 protected:
       
    57     
       
    58     virtual void FocusChanged(TDrawNow aDrawNow);
       
    59     
       
    60 private:
       
    61     
       
    62     void SizeChanged();
       
    63 
       
    64     void Draw( const TRect& aRect ) const;
       
    65     void ActivateL();
       
    66     void HandleScrollEventL ( CEikScrollBar* aScrollBar, TEikScrollEvent aEventType);
       
    67     TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
       
    68     
       
    69 private:
       
    70     void CalculateL(const TRect& aRect);
       
    71     void UpdateScrollIndicatorL();
       
    72 
       
    73     
       
    74     
       
    75 private: // Data
       
    76 
       
    77     CArrayPtr<HBufC>* iText;
       
    78     CArrayFixFlat<TInt>* iScreenStarts;
       
    79     TInt iCurrentScreen;
       
    80     TBool iDoNotShowLastLineAgain;
       
    81     CGraphicsContext::TTextAlign iTextAlign;
       
    82     CEikScrollBarFrame* iSBFrame;
       
    83     const CFont* iFont; // not owned
       
    84     
       
    85     TInt iLineWidth;
       
    86     TInt iBaseLineDelta;
       
    87     TInt iTopBaseLineX;
       
    88     TInt iTopBaseLineY;
       
    89     TInt iLinesPerScreen;
       
    90     
       
    91     };
       
    92 
       
    93 
       
    94 #endif // __EDTA_SCREENTEXTBUFFER_H__
       
    95 
       
    96 // End of File