|
1 /* |
|
2 * Copyright (c) 2005-2006 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 for wrapper for CEikLabel |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <coecntrl.h> |
|
21 #include <barsread.h> |
|
22 #include "xncomponent.h" |
|
23 #include "xntext.h" |
|
24 #include "xntextadapter.h" |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CXnText::NewL |
|
33 // Symbian static 1st phase constructor |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 CXnText* CXnText::NewL() |
|
37 { |
|
38 CXnText* self = new( ELeave ) CXnText; |
|
39 |
|
40 CleanupStack::PushL( self ); |
|
41 self->ConstructL(); |
|
42 CleanupStack::Pop(); |
|
43 |
|
44 return self; |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CXnText::ConstructL |
|
49 // Symbian 2nd phase constructor can leave. |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 void CXnText::ConstructL() |
|
53 { |
|
54 CXnComponent::ConstructL(); |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CXnText::ConstructL |
|
59 // C++ default constructor |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 CXnText::CXnText() |
|
63 { |
|
64 } |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // CXnText::ConstructL |
|
68 // C++ destructor |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 CXnText::~CXnText() |
|
72 { |
|
73 } |
|
74 |
|
75 // --------------------------------------------------------- |
|
76 // CXnText::SetTextL |
|
77 // --------------------------------------------------------- |
|
78 // |
|
79 void CXnText::SetTextL(const TDesC& aText) |
|
80 { |
|
81 (static_cast<CXnTextAdapter*>(ControlAdapter()))->SetTextL(aText); |
|
82 } |
|
83 |
|
84 // --------------------------------------------------------- |
|
85 // CXnText::Text |
|
86 // --------------------------------------------------------- |
|
87 // |
|
88 const TDesC* CXnText::Text() |
|
89 { |
|
90 return (static_cast<CXnTextAdapter*>(ControlAdapter()))->Text(); |
|
91 } |
|
92 |
|
93 // --------------------------------------------------------- |
|
94 // --------------------------------------------------------- |
|
95 XnComponentInterface::MXnComponentInterface* CXnText::MakeInterfaceL(const TDesC8& aType) |
|
96 { |
|
97 if (aType != XnTextInterface::KType) |
|
98 { |
|
99 return NULL; |
|
100 } |
|
101 XnTextInterface::MXnTextInterface* textintr = static_cast<XnTextInterface::MXnTextInterface*>(this); |
|
102 return textintr; |
|
103 } |