64
|
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 |
virtual TInt LayoutLineCount() const = 0;
|
|
57 |
|
|
58 |
protected:
|
|
59 |
|
|
60 |
MNcsFieldSizeObserver* iSizeObserver;
|
|
61 |
|
|
62 |
};
|
|
63 |
|
|
64 |
class CNcsLabel : public CEikLabel, public MNcsControl
|
|
65 |
{
|
|
66 |
public:
|
|
67 |
|
|
68 |
CNcsLabel( const CCoeControl& aParent, MNcsFieldSizeObserver* aSizeObserver );
|
|
69 |
|
|
70 |
public:
|
|
71 |
|
|
72 |
inline virtual TInt LineCount() const;
|
|
73 |
inline virtual TInt ScrollableLines() const;
|
|
74 |
inline virtual TInt GetNumChars() const;
|
|
75 |
inline virtual TInt CursorLineNumber() const;
|
|
76 |
inline virtual TInt CursorPosition() const;
|
|
77 |
virtual void Reposition( TPoint& aPt, TInt aWidth );
|
|
78 |
inline virtual const TDesC& GetLabelText() const;
|
|
79 |
TInt LayoutLineCount() const;
|
|
80 |
virtual void FocusChanged( TDrawNow aDrawNow );
|
|
81 |
TRect TextHitAreaRect();
|
|
82 |
|
|
83 |
protected: // methods from base class
|
|
84 |
|
|
85 |
virtual void HandleResourceChange( TInt aType );
|
|
86 |
private: // methods used internally
|
|
87 |
|
|
88 |
private: // data
|
|
89 |
|
|
90 |
void UpdateTextColor();
|
|
91 |
const CCoeControl& iParent;
|
|
92 |
};
|
|
93 |
|
|
94 |
#include "ncscontrol.inl"
|
|
95 |
|
|
96 |
#endif // __NCS_CONTROL_H__
|
|
97 |
|
|
98 |
// End of File
|