|
1 /* |
|
2 * Copyright (c) 2003-2009 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: Class for single text link |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CESMRRICHTEXTLINK_H |
|
19 #define CESMRRICHTEXTLINK_H |
|
20 |
|
21 #include <cntitem.h> |
|
22 |
|
23 /** |
|
24 * Class for single text link object |
|
25 */ |
|
26 NONSHARABLE_CLASS( CESMRRichTextLink ): public CBase |
|
27 { |
|
28 public: |
|
29 // Enumerations for the higlighted item type |
|
30 enum TType |
|
31 { |
|
32 ETypeEmail, |
|
33 ETypePhoneNumber, |
|
34 ETypeURL, |
|
35 ETypeAttachment, |
|
36 ETypeShowAll, |
|
37 ETypeLocationUrl |
|
38 }; |
|
39 |
|
40 // Enumerations for the action trigger key |
|
41 enum TTriggerKey |
|
42 { |
|
43 ETriggerKeyRight, |
|
44 ETriggerKeyOk |
|
45 }; |
|
46 |
|
47 /** |
|
48 * Creates new rich text link instance. |
|
49 * |
|
50 * @param aStartPos - Start position of the link |
|
51 * @param aLength - Length of the link |
|
52 * @param aValue - Actual value of the link (e.g. email address) |
|
53 * @param aType - Type of the link |
|
54 * @param aTriggerKey - Key that triggers the action |
|
55 * @return New rich text link object |
|
56 */ |
|
57 IMPORT_C static CESMRRichTextLink* NewL( |
|
58 TInt aStartPos, |
|
59 TInt aLength, |
|
60 const TDesC& aValue, |
|
61 TType aType, |
|
62 TTriggerKey aTriggerKey ); |
|
63 |
|
64 // Destructor |
|
65 IMPORT_C ~CESMRRichTextLink( ); |
|
66 |
|
67 /** |
|
68 * Getter for start position |
|
69 * |
|
70 * @return Start postion of the link |
|
71 */ |
|
72 IMPORT_C TInt StartPos( ) const; |
|
73 |
|
74 /** |
|
75 * Getter for link length |
|
76 * |
|
77 * @return Length of the link |
|
78 */ |
|
79 IMPORT_C TInt Length( ) const; |
|
80 |
|
81 /** |
|
82 * Getter for link actual value |
|
83 * |
|
84 * @return Value of the link |
|
85 */ |
|
86 IMPORT_C TDesC& Value( ) const; |
|
87 |
|
88 /** |
|
89 * Getter for link type |
|
90 * |
|
91 * @return Type of the link |
|
92 */ |
|
93 IMPORT_C TType Type( ) const; |
|
94 |
|
95 /** |
|
96 * Getter for trigger key |
|
97 * |
|
98 * @return Key that triggers the event |
|
99 */ |
|
100 IMPORT_C TTriggerKey TriggerKey( ) const; |
|
101 |
|
102 /** |
|
103 * Setter for start position |
|
104 * |
|
105 * @param aPos New start position of the link |
|
106 */ |
|
107 IMPORT_C void SetStartPos( TInt aPos ); |
|
108 |
|
109 private: // Implementation |
|
110 CESMRRichTextLink( |
|
111 TInt aStartPos, |
|
112 TInt aLength, |
|
113 TType aType, |
|
114 TTriggerKey aTriggerKey ); |
|
115 void ConstructL(const TDesC& aValue ); |
|
116 |
|
117 private: |
|
118 /// Own: |
|
119 TInt iStartPos; |
|
120 /// Own: |
|
121 TInt iLength; |
|
122 /// Own: |
|
123 HBufC* iValue; |
|
124 /// Own: |
|
125 TType iType; |
|
126 /// Own: |
|
127 TTriggerKey iTriggerKey; |
|
128 }; |
|
129 |
|
130 #endif |