classicui_plat/japanese_reading_api/inc/AknReadingConverter.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AKNREADINGCONVERTER_H
       
    20 #define AKNREADINGCONVERTER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <fepbase.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CEikEdwin;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *
       
    33 * This utility class is used for updating reading fields in the Japanese Series 60 platform. 
       
    34 * Class binds two editors together: user enters kanji characters to the "main" editor. 
       
    35 * When a kanji character entry is completed this object updates the "reading" editor.
       
    36 *
       
    37 * This class is not intended for further derivation.
       
    38 *
       
    39 * @since 2.6
       
    40 *
       
    41 * @internal
       
    42 */
       
    43 NONSHARABLE_CLASS(CReadingConverter) : public CBase, MCoeFepObserver
       
    44     {
       
    45     public: // Constructors and destructor
       
    46 
       
    47         /**
       
    48         * Two-phased constructor.
       
    49         *
       
    50         * @since 2.6
       
    51         * @param aMainEditor      Reference to main editor. Ownership is not transferred.  
       
    52         * @param aReadingEditor   Reference to reading editor. Ownership is not transferred.  
       
    53         *
       
    54         * @return Newly constructed object.
       
    55         */
       
    56         IMPORT_C static CReadingConverter* NewL(CEikEdwin& aMainEditor, CEikEdwin& aReadingEditor);
       
    57 
       
    58         /**
       
    59         * Two-phased constructor.
       
    60         *
       
    61         * @since 2.6
       
    62         * @return Newly constructed object.
       
    63         */
       
    64         IMPORT_C static CReadingConverter* NewL();
       
    65 
       
    66         /**
       
    67         * Destructor.
       
    68         */
       
    69         virtual ~CReadingConverter();
       
    70 
       
    71     public: // From MCoeFepObserver
       
    72 
       
    73         /**
       
    74         * This method is the main method of this class. It is called by the FEP and
       
    75         * it checks that main editor has focus, requests reading text from CAknJapaneseReading
       
    76         * class and sets the received text into reading editor.
       
    77         *
       
    78         * @since 2.6
       
    79         */
       
    80         IMPORT_C virtual void HandleCompletionOfTransactionL(); 
       
    81 
       
    82     public: // New functions
       
    83 
       
    84         /**
       
    85         * Set method for setting main editor.
       
    86         *
       
    87         * @since 2.6
       
    88         * @param aReadingEditor   Reference to main editor. Ownership is not transferred.
       
    89         *
       
    90         */
       
    91         IMPORT_C void SetMainEditor(CEikEdwin& aMainEditor);
       
    92 
       
    93         /**
       
    94         * Get method for main editor.
       
    95         *
       
    96         * @since 2.6
       
    97         * @return Reference to main editor
       
    98         *
       
    99         */
       
   100         IMPORT_C CEikEdwin& MainEditor() const;
       
   101 
       
   102         /**
       
   103         * Set method for setting reading editor.
       
   104         *
       
   105         * @since 2.6
       
   106         * @param aReadingEditor   Reference to reading editor. Ownership is not transferred.
       
   107         *
       
   108         */
       
   109         IMPORT_C void SetReadingEditor(CEikEdwin& aReadingEditor);
       
   110 
       
   111         /**
       
   112         * Get method for reading editor.
       
   113         *
       
   114         * @since 2.6
       
   115         * @return Reference to reading editor
       
   116         *
       
   117         */
       
   118         IMPORT_C CEikEdwin& ReadingEditor() const;
       
   119 
       
   120     private:
       
   121 
       
   122         /**
       
   123         * C++ default constructor.
       
   124         */
       
   125         CReadingConverter(CEikEdwin* aMainEditor, CEikEdwin* aReadingEditor);
       
   126 
       
   127         /**
       
   128         * By default Symbian 2nd phase constructor is private.
       
   129         */
       
   130         void ConstructL();
       
   131 
       
   132     private: // Data
       
   133 
       
   134         CEikEdwin*      iMainEditor;      // Not owned
       
   135         CEikEdwin*      iReadingEditor;   // Not owned  
       
   136         HBufC*          iPreviousMainText; // own
       
   137     };
       
   138 
       
   139 #endif // AKNREADINGCONVERTER_H