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