~ubuntu-branches/ubuntu/quantal/qtmobility/quantal

« back to all changes in this revision

Viewing changes to plugins/contacts/symbian/contactsmodel/cntplsql/src/cpcskeymap.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-16 16:18:07 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20101116161807-k2dzt2nyse975r3l
Tags: 1.1.0-0ubuntu1
* New upstream release
* Syncronise with Debian, no remaining changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <hbinputkeymap.h>
22
22
#include <hbinputkeymapfactory.h>
23
23
 
 
24
#include "mlanguagespecifickeymap.h"
 
25
#include "predictivesearchkeymapdefs.h"
24
26
// This macro suppresses log writes
25
27
// #define NO_PRED_SEARCH_LOGS
26
28
#include "predictivesearchlog.h"
27
29
 
28
 
const QChar KSpaceChar = ' ';
29
 
 
30
 
// Separator character stored in predictive search table columns
31
 
const QChar KSeparatorChar = ' ';
32
 
 
33
30
 
34
31
// ============================== MEMBER FUNCTIONS ============================
35
32
 
74
71
#endif
75
72
 
76
73
        QString destination;
77
 
        TBool skipHashStar = DetermineSpecialCharBehaviour(aSource);
78
 
        TInt length = aSource.length();
 
74
        MLanguageSpecificKeymap* keymap = CheckLanguage(aSource);
 
75
        if (keymap)
 
76
                {
 
77
                destination = keymap->GetMappedString(aSource);
 
78
                }
 
79
        else
 
80
                {
 
81
                TBool skipHashStar = DetermineSpecialCharBehaviour(aSource);
79
82
 
80
 
    for (int i = 0; i < length; ++i)
81
 
        {
82
 
        if (aSource[i] == KSpaceChar)
83
 
            {
84
 
            destination.append(KSeparatorChar);
85
 
            }
86
 
        else
 
83
                TInt length = aSource.length();
 
84
                for (int i = 0; i < length; ++i)
87
85
                        {
88
 
                        QChar ch(0);
89
 
            ch = MappedKeyForChar(aSource[i]);
90
 
                        if (!ShouldSkipChar(ch, skipHashStar))
91
 
                                {
92
 
                                destination.append(ch);
 
86
                        if (aSource[i] == KSpaceChar)
 
87
                                {
 
88
                                destination.append(KSeparatorChar);
 
89
                                }
 
90
                        else
 
91
                                {
 
92
                                QChar ch(0);
 
93
                                ch = MappedKeyForChar(aSource[i]);
 
94
                                if (!ShouldSkipChar(ch, skipHashStar))
 
95
                                        {
 
96
                                        destination.append(ch);
 
97
                                        }
93
98
                                }
94
99
                        }
95
100
                }
174
179
        }
175
180
 
176
181
// ----------------------------------------------------------------------------
177
 
// CPcsKeyMap::ReadExtraCharacters
178
 
// Default implementation does nothing
 
182
// CPcsKeyMap::CheckLanguage
 
183
// Default implementation
179
184
// ----------------------------------------------------------------------------
180
 
TInt CPcsKeyMap::ReadExtraCharacters(const HbInputLanguage& /*aLanguage*/)
 
185
MLanguageSpecificKeymap* CPcsKeyMap::CheckLanguage(QString /*aSource*/) const
181
186
        {
182
 
        return 0;
 
187
        return NULL;
183
188
        }
184
189
 
185
190
// ----------------------------------------------------------------------------
239
244
            if (ascChar == 0) // ch can't be represented in ASCII
240
245
                {
241
246
                PRINT2(_L("CPcsKeyMap: map key(%c) <-> char=0x%x"),
242
 
                       logChar, ch);
 
247
                       logChar, ch.unicode());
243
248
                }
244
249
            else
245
250
                {