emailuis/emailui/inc/ncscontrol.h
changeset 0 8466d47a6819
child 2 5253a20d2a1e
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007 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:  virtual class for compose view
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __NCS_CONTROL_H__
       
    21 #define __NCS_CONTROL_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <eiklabel.h>
       
    25 
       
    26 #include "ncsfieldsizeobserver.h"
       
    27 
       
    28 class CNcsEditor;
       
    29 class CCoeControl;
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 *  CNcsControl container control class.
       
    36 *
       
    37 *  @lib -
       
    38 *  @since S60 v3.0
       
    39 */
       
    40 class MNcsControl
       
    41     {
       
    42 
       
    43 public: // constructor
       
    44 
       
    45     MNcsControl( MNcsFieldSizeObserver* aObserver );
       
    46 
       
    47 public: // new functions
       
    48 
       
    49 	virtual TInt LineCount() const = 0;
       
    50 	virtual TInt ScrollableLines() const = 0;
       
    51 	virtual TInt GetNumChars() const = 0;
       
    52 	virtual TInt CursorLineNumber() const = 0;
       
    53 	virtual TInt CursorPosition() const = 0;
       
    54 	virtual void Reposition(TPoint& aPt, TInt aWidth) = 0;
       
    55     virtual const TDesC& GetLabelText() const = 0;
       
    56     // <cmail> Platform layout change    
       
    57     virtual TInt LayoutLineCount() const = 0;
       
    58     // </cmail> Platform layout change    
       
    59 
       
    60 protected:
       
    61     
       
    62     MNcsFieldSizeObserver* iSizeObserver;
       
    63 
       
    64     };
       
    65 
       
    66 class CNcsLabel : public CEikLabel, public MNcsControl
       
    67     {
       
    68 public:
       
    69 
       
    70     // <cmail> Plaform layout change
       
    71 	CNcsLabel( const CCoeControl& aParent, MNcsFieldSizeObserver* aSizeObserver );
       
    72 	// </cmail> Plaform layout change
       
    73 
       
    74 public:
       
    75 
       
    76 	inline virtual TInt LineCount() const;
       
    77 	inline virtual TInt ScrollableLines() const;
       
    78 	inline virtual TInt GetNumChars() const;
       
    79 	inline virtual TInt CursorLineNumber() const;
       
    80 	inline virtual TInt CursorPosition() const;
       
    81 	virtual void Reposition( TPoint& aPt, TInt aWidth );    
       
    82     inline virtual const TDesC& GetLabelText() const;
       
    83     // <cmail> Platform layout change       
       
    84     TInt LayoutLineCount() const;
       
    85     // </cmail> Platform layout change    
       
    86 
       
    87     virtual void FocusChanged( TDrawNow aDrawNow );
       
    88     
       
    89 protected: // methods from base class
       
    90 
       
    91     virtual void HandleResourceChange( TInt aType );    
       
    92 private: // methods used internally
       
    93 
       
    94 // <cmail> Plaform layout change
       
    95 private: // data
       
    96     
       
    97     void UpdateTextColor();
       
    98        
       
    99     const CCoeControl& iParent;
       
   100     
       
   101 // </cmail> Plaform layout change
       
   102     };
       
   103 
       
   104 #include "ncscontrol.inl"
       
   105 
       
   106 #endif // __NCS_CONTROL_H__
       
   107 
       
   108 
       
   109 // End of File