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

« back to all changes in this revision

Viewing changes to plugins/contacts/symbian/contactsmodel/cntplsql/inc/ckoreankeymap.h

  • 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:
 
1
/*
 
2
* Copyright (c) 2010 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 to hold the character to key mappings and provide
 
15
*   conversion of strings to their numerical mappings. 
 
16
*
 
17
*/
 
18
 
 
19
#ifndef __CKOREANKEYMAP_H__
 
20
#define __CKOREANKEYMAP_H__
 
21
 
 
22
// INCLUDES
 
23
#include "mlanguagespecifickeymap.h"
 
24
#include <QList>
 
25
#include <QMap.h>
 
26
#include <QChar>
 
27
#include <e32base.h>
 
28
 
 
29
// FORWARD DECLARATIONS
 
30
class QString;
 
31
class QTextCodec;
 
32
 
 
33
 
 
34
// CLASS DECLARATION
 
35
NONSHARABLE_CLASS(CKoreanKeyMap) : public CBase, public MLanguageSpecificKeymap
 
36
        {
 
37
    public: // Constructors and destructor
 
38
                static CKoreanKeyMap* NewL();
 
39
 
 
40
        /**
 
41
         * Destructor
 
42
         */
 
43
                virtual ~CKoreanKeyMap();
 
44
 
 
45
        public: // From MLanguageSpecificKeymap
 
46
                QString GetMappedString(QString aSource) const;
 
47
 
 
48
    public: // New functions
 
49
                /**
 
50
         * Returns ETrue if aSource contains one or more Korean characters.
 
51
         */
 
52
                TBool IsLanguageSupported(QString aSource) const;
 
53
 
 
54
        protected: // Constructors
 
55
                /**
 
56
         * Constructor
 
57
         */
 
58
                CKoreanKeyMap();
 
59
 
 
60
                /**
 
61
                 * Second phase constructor
 
62
                 */
 
63
                void ConstructL();
 
64
 
 
65
        private: // New functions
 
66
                void GetTextCodecs();
 
67
 
 
68
                void FillKeyPressMap();
 
69
 
 
70
                void MapCharacters(QString aKeySequence,
 
71
                                                   QChar aJamoChar,
 
72
                                                   QChar aCompatibilityJamoChar = 0,
 
73
                                                   QChar aOtherJamoChar = 0);
 
74
 
 
75
                TBool IsSyllable(QChar aChar) const;
 
76
 
 
77
        /**
 
78
         * Extracts the Jamos from the complete Korean character (Hangeul).
 
79
                 *
 
80
                 * Returned string contains the Jamos
 
81
         */
 
82
                const QString ExtractJamos(QChar aChar) const;
 
83
 
 
84
                const QString MapJamoToKeySequence(QChar aChar) const;
 
85
 
 
86
        private: // Data
 
87
                // Mapping between those Korean unicode characters (Naratgeul logic) and
 
88
                // the keypresses used to produce the character.
 
89
                QMap<QChar, QString> iKeyPressMap;
 
90
 
 
91
 
 
92
                // Not owned
 
93
                QTextCodec* iLatinCodec;
 
94
                QTextCodec* iKoreanCodec;
 
95
 
 
96
 
 
97
                // For unit testing
 
98
                friend class UT_CKoreanKeyMap;
 
99
        };
 
100
 
 
101
#endif // __CKOREANKEYMAP_H__
 
102
 
 
103
// End of file