|
1 /* |
|
2 * Copyright (c) 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: trigger string implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDES |
|
19 #include "peninputfingerhwrtriggerstr.h" |
|
20 |
|
21 // --------------------------------------------------------- |
|
22 // destructor |
|
23 // --------------------------------------------------------- |
|
24 // |
|
25 CAknFepHwrTriggerStr::~CAknFepHwrTriggerStr() |
|
26 { |
|
27 } |
|
28 |
|
29 // --------------------------------------------------------- |
|
30 // Append the char code to trigger string |
|
31 // --------------------------------------------------------- |
|
32 // |
|
33 void CAknFepHwrTriggerStr::Append( const TDesC& aChar ) |
|
34 { |
|
35 const TInt len = aChar.Length()+ iString.Length(); |
|
36 if ( len <= iString.MaxLength()) |
|
37 { |
|
38 iString.Append( aChar ); |
|
39 } |
|
40 } |
|
41 |
|
42 // --------------------------------------------------------- |
|
43 // Set the char code to trigger string |
|
44 // --------------------------------------------------------- |
|
45 // |
|
46 void CAknFepHwrTriggerStr::Set( const TDesC& aChar ) |
|
47 { |
|
48 if ( aChar.Length() <= iString.MaxLength() ) |
|
49 { |
|
50 iString.Zero(); |
|
51 iString.Append( aChar ); |
|
52 } |
|
53 } |
|
54 |
|
55 |
|
56 // --------------------------------------------------------- |
|
57 // Get trigger string |
|
58 // --------------------------------------------------------- |
|
59 // |
|
60 TDesC& CAknFepHwrTriggerStr::GetString() |
|
61 { |
|
62 return iString; |
|
63 } |
|
64 |
|
65 // --------------------------------------------------------- |
|
66 // Delete the last char |
|
67 // --------------------------------------------------------- |
|
68 // |
|
69 void CAknFepHwrTriggerStr::DeleteLast() |
|
70 { |
|
71 if (iString.Length() > 0) |
|
72 { |
|
73 iString.Delete(iString.Length() - 1, 1); |
|
74 } |
|
75 } |
|
76 |
|
77 // --------------------------------------------------------- |
|
78 // Reset the trigger string |
|
79 // --------------------------------------------------------- |
|
80 // |
|
81 void CAknFepHwrTriggerStr::DeleteAll() |
|
82 { |
|
83 iString.Zero(); |
|
84 } |
|
85 |
|
86 // --------------------------------------------------------- |
|
87 // Is empty for the tringger string |
|
88 // --------------------------------------------------------- |
|
89 // |
|
90 TBool CAknFepHwrTriggerStr::IsEmpty() |
|
91 { |
|
92 return (iString.Length() == 0); |
|
93 } |
|
94 |
|
95 // End Of File |