fep/aknfep/src/AknFepThaiSCTSelector.cpp
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     1 /*
       
     2 * Copyright (c) 2003-2004 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:           
       
    15 *       Provides the CAknFepThaiSCTSelector methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #include "AknFepThaiSCTSelector.h"
       
    31 #include "AknFepUIManagerStateInterface.h"      //MAknFepUIManagerStateInterface
       
    32 
       
    33 #include "AknFepCaseManager.h"
       
    34 
       
    35 #include <uikon.hrh>
       
    36 #include <PtiEngine.h>
       
    37 #include <PtiDefs.h>
       
    38 #include <aknSctDialog.h>
       
    39 #include <avkon.rsg>
       
    40 #include <aknfep.rsg>
       
    41 #include <e32std.h>
       
    42 
       
    43 #include <AknFepManager.h>
       
    44 CAknFepThaiSCTSelector::CAknFepThaiSCTSelector()
       
    45     {
       
    46     }
       
    47 
       
    48 CAknFepThaiSCTSelector::~CAknFepThaiSCTSelector()
       
    49     {
       
    50     }
       
    51 
       
    52 TInt CAknFepThaiSCTSelector::ThaiSCRResourceId(TUint aPrevGlyph, TInt aKey)//TInt aResID)
       
    53     {
       
    54     return(ThaiSctCharMap(ThaiGlyphType(aPrevGlyph), aKey));
       
    55     }
       
    56 
       
    57 
       
    58 CAknFepThaiSCTSelector *CAknFepThaiSCTSelector::NewL()
       
    59     {
       
    60     
       
    61     CAknFepThaiSCTSelector *self = new(ELeave)CAknFepThaiSCTSelector;
       
    62     return (self);
       
    63     
       
    64     }
       
    65 
       
    66 TInt CAknFepThaiSCTSelector::ThaiSctCharMap(enum AknFepSCTThaiGlyphTypes aGlyphType, TInt aKey)
       
    67     {
       
    68     switch (aGlyphType)
       
    69         {
       
    70         case EAknFepThaiCharNonThai:
       
    71         case EAknFepThaiCharNon:
       
    72         case EAknFepThaiCharLV:
       
    73         case EAknFepThaiCharFV1:
       
    74         case EAknFepThaiCharFV2:
       
    75         case EAknFepThaiCharFV3:
       
    76         case EAknFepThaiCharBD:
       
    77         case EAknFepThaiCharTone:
       
    78         case EAknFepThaiCharAD1:
       
    79         case EAknFepThaiCharAD2:
       
    80         case EAknFepThaiCharAD3:
       
    81             return((aKey==EPtiKeyStar) ? R_AKNFEP_SCT_THAI_STAR_COMMON : 
       
    82                                          R_AKNFEP_SCT_THAI_0_COMMON);
       
    83                 
       
    84         case EAknFepThaiCharCons:
       
    85             return((aKey==EPtiKeyStar) ? R_AKNFEP_SCT_THAI_STAR_CONS : 
       
    86                                          R_AKNFEP_SCT_THAI_0_CONS );
       
    87             
       
    88         case EAknFepThaiCharAV1:
       
    89         case EAknFepThaiCharBV1:
       
    90             return((aKey==EPtiKeyStar) ? R_AKNFEP_SCT_THAI_STAR_AV1_BV1 : 
       
    91                                          R_AKNFEP_SCT_THAI_0_AV1_BV1);
       
    92             
       
    93         case EAknFepThaiCharAV2:
       
    94         case EAknFepThaiCharBV2:
       
    95             return((aKey==EPtiKeyStar) ? R_AKNFEP_SCT_THAI_STAR_AV2_BV2 : 
       
    96                                          R_AKNFEP_SCT_THAI_0_AV2_BV2);
       
    97             
       
    98         case EAknFepThaiCharAV3:
       
    99             return((aKey==EPtiKeyStar) ? R_AKNFEP_SCT_THAI_STAR_AV3 : 
       
   100                                          R_AKNFEP_SCT_THAI_0_AV3);
       
   101             
       
   102         default:
       
   103             return(0);
       
   104         }
       
   105     }
       
   106 
       
   107 AknFepSCTThaiGlyphTypes CAknFepThaiSCTSelector::ThaiGlyphType(TUint aGlyph)
       
   108     {
       
   109     if (aGlyph >= 0x0E01 && aGlyph <= 0x0E2E && aGlyph != 0x0E24 && aGlyph != 0x0E26 )
       
   110         {
       
   111         return(EAknFepThaiCharCons);
       
   112         }
       
   113     else if (aGlyph >= 0x0E40 && aGlyph <= 0x0E44)
       
   114         {
       
   115         return(EAknFepThaiCharLV);
       
   116         }
       
   117     else if (aGlyph == 0x0E30 || aGlyph == 0x0E32 || aGlyph == 0x0E33)
       
   118         {
       
   119         return(EAknFepThaiCharFV1);
       
   120         }
       
   121     else if (aGlyph == 0x0E45)
       
   122         {
       
   123         return(EAknFepThaiCharFV2);
       
   124         }
       
   125     else if (aGlyph == 0x0E24 || aGlyph == 0x0E26)
       
   126         {
       
   127         return(EAknFepThaiCharFV3);
       
   128         }
       
   129     else if (aGlyph == 0x0E38)
       
   130         {
       
   131         return(EAknFepThaiCharBV1);
       
   132         }
       
   133     else if (aGlyph == 0x0E39)
       
   134         {
       
   135         return(EAknFepThaiCharBV2);
       
   136         }
       
   137     else if (aGlyph == 0x0E3A)
       
   138         {
       
   139         return(EAknFepThaiCharBD);
       
   140         }
       
   141     else if (aGlyph >= 0x0E48 && aGlyph <= 0x0E4B)
       
   142         {
       
   143         return(EAknFepThaiCharTone);
       
   144         }
       
   145     else if (aGlyph == 0x0E4C || aGlyph == 0x0E4D)
       
   146         {
       
   147         return(EAknFepThaiCharAD1);
       
   148         }
       
   149     else if (aGlyph == 0x0E47)
       
   150         {
       
   151         return(EAknFepThaiCharAD2);
       
   152         }
       
   153     else if (aGlyph == 0x0E4E)
       
   154         {
       
   155         return(EAknFepThaiCharAD3);
       
   156         }
       
   157     else if (aGlyph == 0x0E34)
       
   158         {
       
   159         return(EAknFepThaiCharAV1);
       
   160         }
       
   161     else if (aGlyph == 0x0E31 || aGlyph == 0x0E36)
       
   162         {
       
   163         return(EAknFepThaiCharAV2);
       
   164         }
       
   165     else if (aGlyph == 0x0E35 || aGlyph == 0x0E37)
       
   166         {
       
   167         return(EAknFepThaiCharAV3);
       
   168         }
       
   169     else
       
   170         {
       
   171         return(EAknFepThaiCharNonThai);
       
   172         }
       
   173     
       
   174     
       
   175     }
       
   176 
       
   177 
       
   178 // End of file
       
   179 
       
   180