fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/inc/AknFepUIAvkonCtrlJapaneseKutenQueryDialog.h
branchRCL_3
changeset 44 ecbabf52600f
parent 0 eb1f2e154e89
equal deleted inserted replaced
43:ebd48d2de13c 44:ecbabf52600f
       
     1 /*
       
     2 * Copyright (c) 2002-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:            Kuten code query dialog
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 #ifndef AKNFEPUICTRLJAPANESEKUTENQUERYDIALOG_H
       
    30 #define AKNFEPUICTRLJAPANESEKUTENQUERYDIALOG_H
       
    31 
       
    32 // INCLUDES
       
    33 #include <AknQueryDialog.h> // CAknTextQueryDialog
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 
       
    37 // CONSTANTS
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  CAknFepUICtrlJapaneseKutenQueryDialog class.
       
    43 *
       
    44 *  @lib AknFep.lib
       
    45 *  @since 2.6
       
    46 */
       
    47 NONSHARABLE_CLASS(CAknFepUICtrlJapaneseKutenQueryDialog) : public CAknTextQueryDialog
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         */
       
    53         static CAknFepUICtrlJapaneseKutenQueryDialog* NewL(
       
    54                         TInt& aCharCode, const TTone& aTone = ENoTone);
       
    55 
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         virtual ~CAknFepUICtrlJapaneseKutenQueryDialog();
       
    60         TInt ExecuteLD(TInt aResourceId);
       
    61 
       
    62         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
    63     protected:  // Functions from CEikDialog
       
    64         /**
       
    65         * From CEikdialog   This function is called by the EIKON framework
       
    66         *                   if the user activates a button in the button panel.
       
    67         *                   It is not called if the Cancel button is activated,
       
    68         *                   unless the EEikDialogFlagNotifyEsc flag is set.
       
    69         * @since 2.6
       
    70         * @param aButtonId  The ID of the button that was activated
       
    71         * @return           Should return ETrue if the dialog should exit,
       
    72         *                   and EFalse if it should not.
       
    73         */
       
    74         virtual TBool OkToExitL(TInt aButtonId);
       
    75 
       
    76     protected:  // Functions from CAknQueryDialog
       
    77         /**
       
    78         * If the query text is ok (retrieved form query control) then display the
       
    79         * left soft key, otherwise hide it.
       
    80         * @since 2.6
       
    81         */
       
    82         virtual void  UpdateLeftSoftKeyL();
       
    83 
       
    84     private:
       
    85         /**
       
    86         * constructor.
       
    87         */
       
    88         CAknFepUICtrlJapaneseKutenQueryDialog(
       
    89                         TInt& aCharCode, const TTone& aTone = ENoTone);
       
    90 
       
    91         /**
       
    92         * Set visibility of the left softkey.
       
    93         * Softkey is hidden when data in the query is not acceptable.
       
    94         * @since 2.6
       
    95         */
       
    96         void MakeLeftSoftkeyVisibleL();
       
    97 
       
    98         enum TJisElementsCharMap
       
    99             {
       
   100             EJisFirstMin = 0x21,
       
   101             EJisFirstMax = 0x74,
       
   102             EJisSecondMin = 0x21,
       
   103             EJisSecondMax = 0x7E,
       
   104             EJisLastSecondMax = 0x2F
       
   105             };
       
   106 
       
   107         enum TSjisElements
       
   108             {
       
   109             ESjisFirstMin1   = 0x81,
       
   110             ESjisFirstMax1   = 0x9F,
       
   111             ESjisFirstMin2   = 0xE0,
       
   112             ESjisFirstMax2   = 0xEA,
       
   113 //          ESjisFirstMax2   = 0xEE,                // NEC extended kanji code
       
   114 //          ESjisFirstMax2   = 0xFC,                // IBM extended kanji code
       
   115             ESjisFirstCount  = (ESjisFirstMax2 - ESjisFirstMin2 + 1
       
   116                                 + ESjisFirstMax1 - ESjisFirstMin1 + 1),
       
   117             ESjisSecondMin1  = 0x40,
       
   118             ESjisSecondMax1  = 0x7E,
       
   119             ESjisSecondMin2  = 0x80,
       
   120             ESjisSecondMax2  = 0xFC,
       
   121             ESjisSecondCount = (ESjisSecondMax2 - ESjisSecondMin2 + 1
       
   122                                 + ESjisSecondMax1 - ESjisSecondMin1 + 1)
       
   123             };
       
   124 
       
   125         /**
       
   126         * Convert from Kuten code to unicode, Kuten code is 4 characters which inputted in query dialog.
       
   127         * @since 2.6
       
   128         * @return unicode, it is one character.
       
   129         */
       
   130         TText   ConvertKutenCode2Unicode();
       
   131 
       
   132         /**
       
   133         * Convert to valid jis code. If inputting invalid code, this function converts nearly valid code.
       
   134         * @since 2.6
       
   135         */
       
   136         void    AdjustJisCode(TText& aJisCode);
       
   137 
       
   138         /**
       
   139         * Convert to valid s-jis code. If inputting invalid code, this function converts nearly valid code.
       
   140         * @since 2.6
       
   141         * @return ETrue: s-jis code EFalse: none s-jis code
       
   142         */
       
   143         TBool   AdjustSjisCode(TText& aSjisCode);
       
   144 
       
   145         /**
       
   146         * Convert from JIS to S-JIS
       
   147         * @since 2.6
       
   148         * @return s-jis code as inputting jis code
       
   149         */
       
   150         TText   JisToSjis(TText aJisCode);
       
   151 
       
   152         /**
       
   153         * Check a s-jis code inputted in dialog
       
   154         * @since 2.6
       
   155         * @return ETrue: s-jis code EFalse: none s-jis code
       
   156         */
       
   157         TBool   CheckSjisCode(TText aSjisCode);
       
   158 
       
   159         /**
       
   160         * Convert from s-jis to unicode
       
   161         * @since 2.6
       
   162         * @return unicode code as inputting s-jis code
       
   163         */
       
   164         TText   ConvSjisToUnicode(TText aSjisCode);
       
   165 
       
   166     private:
       
   167         TInt&       iCharCode;
       
   168         TBuf<5>     iBuffer;
       
   169         TUint       iCbaResId;
       
   170     };
       
   171 
       
   172 #endif  // AKNFEPUICTRLJAPANESEKUTENQUERYDIALOG_H
       
   173 
       
   174 // End of File