charconvfw/Charconv/ongoing/Include/CnvPictographShared.h
changeset 0 1fb32624e06b
child 16 56cd22a7a1cb
equal deleted inserted replaced
-1:000000000000 0:1fb32624e06b
       
     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:        This class is a utitlity class for conversion of Vodafone
       
    15 *                pictograph.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 #ifndef CNVPICTOGRAPHSHARED_H
       
    28 #define CNVPICTOGRAPHSHARED_H
       
    29 
       
    30 //  INCLUDES
       
    31 #include <e32std.h>
       
    32 #include <charconv.h>
       
    33 #include <convutils.h>
       
    34 #include <PictographObserver.h>
       
    35 
       
    36 
       
    37 // CONSTANTS
       
    38 // Count of Vodafone pictograph's pages
       
    39 const TInt KCountOfPictoPages(6);
       
    40 
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 /**
       
    45 *  This class is a utitlity class for conversion of Vodafone pictograph.
       
    46 *  The conversion data are in each CnvPctograph1 - 6 dll.
       
    47 *  CnvPictographShared only to be used by ISO2022Jp.cpl, SHIFTJIS_SHARED.dll or
       
    48 *  something. For example, when CCnvCharacterSetConverter::ConvertFromUnicode()
       
    49 *  is called, and ConvertFromUnicode() of ISO2022Jp.cpl is called. After that,
       
    50 *  ISO2022Jp.cpl sets some parameters for the conversion. At that time,
       
    51 *  CnvPictographShared::SetCharacterSetsForPictograph() is called.
       
    52 *  In a nut shell, CnvPictographShared is chaind from Japanese conversion
       
    53 *  plug-ins.
       
    54 *
       
    55 *  @lib CnvPictograph1.dll
       
    56 *  @lib CnvPictograph2.dll
       
    57 *  @lib CnvPictograph3.dll
       
    58 *  @lib CnvPictograph4.dll
       
    59 *  @lib CnvPictograph5.dll
       
    60 *  @lib CnvPictograph6.dll
       
    61 *  @since 2.6
       
    62 */
       
    63 class CnvPictographShared
       
    64     {
       
    65     public:
       
    66         /**
       
    67         * It sets parameters to SCharacterSet array.
       
    68         * It called in ConvertFromUnicode().
       
    69         * It makes possible that pictograph conversion is called from other
       
    70         * conversion plug-ins.
       
    71         * @since 2.6
       
    72         * @param aArrayOfCharacterSets The conversion table array
       
    73         */
       
    74         static void SetCharacterSetsForPictograph(
       
    75             RArray<CnvUtilities::SCharacterSet>& aArrayOfCharacterSets);
       
    76         /**
       
    77         * It sets parameters to SCharacterSet array.
       
    78         * It called in ConvertFromUnicode().
       
    79         * It makes possible that pictograph conversion is called from other
       
    80         * conversion plug-ins.
       
    81         * @since 2.6
       
    82         * @param aArrayOfCharacterSets The conversion table array
       
    83         * @param aOriginalCharset The character set
       
    84         */
       
    85         static void SetCharacterSetsForPictograph(
       
    86             RArray<CnvUtilities::SCharacterSet>& aArrayOfCharacterSets,
       
    87             TOriginalCharset aOriginalCharset);
       
    88         /**
       
    89         * It sets parameters to SMethod array.
       
    90         * It called in ConvertToUnicode().
       
    91         * It makes possible that pictograph conversion is called from other
       
    92         * conversion plug-ins.
       
    93         * @since 2.6
       
    94         * @param aArrayOfMethods The conversion table array
       
    95         * @param aOriginalCharset The character set
       
    96         */
       
    97         static void SetMethodsForPictograph(
       
    98             RArray<CnvUtilities::SMethod>& aArrayOfMethods,
       
    99             TOriginalCharset aOriginalCharset);
       
   100         /**
       
   101         * It sets parameters to SState array.
       
   102         * It called in ConvertToUnicode().
       
   103         * It makes possible that pictograph conversion is called from other
       
   104         * conversion plug-ins.
       
   105         * @since 2.6
       
   106         * @param aArrayOfMethods The conversion table array
       
   107         */
       
   108         static void SetStatesForPictograph(
       
   109             RArray<CnvUtilities::SState>& aArrayOfStates);
       
   110 
       
   111     private:
       
   112         /**
       
   113         * It converts from an intermediate buffer to a pictograph code.
       
   114         * After that, it adds shift-in code(0x0F).
       
   115         * @since 2.6
       
   116         * @param aStartPositionInDescriptor The start postion for checking
       
   117         * @param aDescriptor The descripter has intermidiate buffer.
       
   118         * @param aNumberOfCharactersThatDroppedOut The number of characters
       
   119         *                                          that it's dropped out
       
   120         */
       
   121         static void ConvertToPictograph1InPlace(
       
   122             TInt aStartPositionInDescriptor,
       
   123             TDes8& aDescriptor, TInt& aNumberOfCharactersThatDroppedOut);
       
   124         /**
       
   125         * It converts from an intermediate buffer to a pictograph code.
       
   126         * After that, it adds shift-in code(0x0F).
       
   127         * @since 2.6
       
   128         * @param aStartPositionInDescriptor The start postion for checking
       
   129         * @param aDescriptor The descripter has intermidiate buffer.
       
   130         * @param aNumberOfCharactersThatDroppedOut The number of characters
       
   131         *                                          that it's dropped out
       
   132         */
       
   133         static void ConvertToPictograph2InPlace(
       
   134             TInt aStartPositionInDescriptor,
       
   135             TDes8& aDescriptor, TInt& aNumberOfCharactersThatDroppedOut);
       
   136         /**
       
   137         * It converts from an intermediate buffer to a pictograph code.
       
   138         * After that, it adds shift-in code(0x0F).
       
   139         * @since 2.6
       
   140         * @param aStartPositionInDescriptor The start postion for checking
       
   141         * @param aDescriptor The descripter has intermidiate buffer.
       
   142         * @param aNumberOfCharactersThatDroppedOut The number of characters
       
   143         *                                          that it's dropped out
       
   144         */
       
   145         static void ConvertToPictograph3InPlace(
       
   146             TInt aStartPositionInDescriptor,
       
   147             TDes8& aDescriptor, TInt& aNumberOfCharactersThatDroppedOut);
       
   148         /**
       
   149         * It converts from an intermediate buffer to a pictograph code.
       
   150         * After that, it adds shift-in code(0x0F).
       
   151         * @since 2.6
       
   152         * @param aStartPositionInDescriptor The start postion for checking
       
   153         * @param aDescriptor The descripter has intermidiate buffer.
       
   154         * @param aNumberOfCharactersThatDroppedOut The number of characters
       
   155         *                                          that it's dropped out
       
   156         */
       
   157         static void ConvertToPictograph4InPlace(
       
   158             TInt aStartPositionInDescriptor,
       
   159             TDes8& aDescriptor, TInt& aNumberOfCharactersThatDroppedOut);
       
   160         /**
       
   161         * It converts from an intermediate buffer to a pictograph code.
       
   162         * After that, it adds shift-in code(0x0F).
       
   163         * @since 2.6
       
   164         * @param aStartPositionInDescriptor The start postion for checking
       
   165         * @param aDescriptor The descripter has intermidiate buffer.
       
   166         * @param aNumberOfCharactersThatDroppedOut The number of characters
       
   167         *                                          that it's dropped out
       
   168         */
       
   169         static void ConvertToPictograph5InPlace(
       
   170             TInt aStartPositionInDescriptor,
       
   171             TDes8& aDescriptor, TInt& aNumberOfCharactersThatDroppedOut);
       
   172         /**
       
   173         * It converts from an intermediate buffer to a pictograph code.
       
   174         * After that, it adds shift-in code(0x0F).
       
   175         * @since 2.6
       
   176         * @param aStartPositionInDescriptor The start postion for checking
       
   177         * @param aDescriptor The descripter has intermidiate buffer.
       
   178         * @param aNumberOfCharactersThatDroppedOut The number of characters
       
   179         *                                          that it's dropped out
       
   180         */
       
   181         static void ConvertToPictograph6InPlace(
       
   182             TInt aStartPositionInDescriptor,
       
   183             TDes8& aDescriptor, TInt& aNumberOfCharactersThatDroppedOut);
       
   184 
       
   185         /**
       
   186         * It returns a number of bytes that the conversion to pictograph is
       
   187         * possible in the descriptor.
       
   188         * @since 2.6
       
   189         * @param aDescriptor A descriptor has any character code.
       
   190         * @return Number of bytes that the conversion is possible
       
   191         */
       
   192         static TInt NumberOfBytesAbleToConvertSJisDirectMap(const TDesC8& aDescriptor);
       
   193 
       
   194         /**
       
   195         * It returns a number of bytes that the conversion to pictograph is
       
   196         * possible in the descriptor.
       
   197         * @since 2.6
       
   198         * @param aDescriptor A descriptor has any character code.
       
   199         * @return Number of bytes that the conversion is possible
       
   200         */
       
   201         static TInt NumberOfBytesAbleToConvertToEucJpDirectMap1(const TDesC8& aDescriptor);
       
   202 
       
   203         /**
       
   204         * It returns a number of bytes that the conversion to pictograph is
       
   205         * possible in the descriptor.
       
   206         * @since 2.6
       
   207         * @param aDescriptor A descriptor has any character code.
       
   208         * @return Number of bytes that the conversion is possible
       
   209         */
       
   210         static TInt NumberOfBytesAbleToConvertToEucJpDirectMap2(const TDesC8& aDescriptor);
       
   211 
       
   212         /**
       
   213         * It returns a number of bytes that the conversion to pictograph is
       
   214         * possible in the descriptor.
       
   215         * @since 2.6
       
   216         * @param aDescriptor A descriptor has any character code.
       
   217         * @return Number of bytes that the conversion is possible
       
   218         */
       
   219         static TInt NumberOfBytesAbleToConvertToPicto1(
       
   220             const TDesC8& aDescriptor);
       
   221         /**
       
   222         * It returns a number of bytes that the conversion to pictograph is
       
   223         * possible in the descriptor.
       
   224         * @since 2.6
       
   225         * @param aDescriptor A descriptor has any character code.
       
   226         * @return Number of bytes that the conversion is possible
       
   227         */
       
   228         static TInt NumberOfBytesAbleToConvertToPicto2(
       
   229             const TDesC8& aDescriptor);
       
   230         /**
       
   231         * It returns a number of bytes that the conversion to pictograph is
       
   232         * possible in the descriptor.
       
   233         * @since 2.6
       
   234         * @param aDescriptor A descriptor has any character code.
       
   235         * @return Number of bytes that the conversion is possible
       
   236         */
       
   237         static TInt NumberOfBytesAbleToConvertToPicto3(
       
   238             const TDesC8& aDescriptor);
       
   239         /**
       
   240         * It returns a number of bytes that the conversion to pictograph is
       
   241         * possible in the descriptor.
       
   242         * @since 2.6
       
   243         * @param aDescriptor A descriptor has any character code.
       
   244         * @return Number of bytes that the conversion is possible
       
   245         */
       
   246         static TInt NumberOfBytesAbleToConvertToPicto4(
       
   247             const TDesC8& aDescriptor);
       
   248         /**
       
   249         * It returns a number of bytes that the conversion to pictograph is
       
   250         * possible in the descriptor.
       
   251         * @since 2.6
       
   252         * @param aDescriptor A descriptor has any character code.
       
   253         * @return Number of bytes that the conversion is possible
       
   254         */
       
   255         static TInt NumberOfBytesAbleToConvertToPicto5(
       
   256             const TDesC8& aDescriptor);
       
   257         /**
       
   258         * It returns a number of bytes that the conversion to pictograph is
       
   259         * possible in the descriptor.
       
   260         * @since 2.6
       
   261         * @param aDescriptor A descriptor has any character code.
       
   262         * @return Number of bytes that the conversion is possible
       
   263         */
       
   264         static TInt NumberOfBytesAbleToConvertToPicto6(
       
   265             const TDesC8& aDescriptor);
       
   266         /**
       
   267         * It's a common function for checking the number of bytes that
       
   268         * the conversion to pictograph
       
   269         * @since 2.6
       
   270         * @param aDescriptor A descriptor has any character code.
       
   271         * @param aIntermidiateCode An intermidiate buffer
       
   272         * @return Number of bytes that the conversion is possible
       
   273         */
       
   274         static TInt NumberOfBytesAbleToConvertToPictograph(
       
   275             const TDesC8& aDescriptor, TInt aIntermidiateCode);
       
   276         /**
       
   277         * It converts the string which includes a pictograph's escape sequence
       
   278         * to unicode.
       
   279         * @since 2.6
       
   280         * @param aDescriptor It includes a pictograph's escape sequence
       
   281         */
       
   282         static void ConvertToPictographFromUnicode(TDes8& aDescriptor);
       
   283 
       
   284         /**
       
   285         * It converts the string which has Unicode with pictograph to EUC-jp
       
   286         * with direct mapped pictograph
       
   287         * @since 2.6
       
   288         * @param aDescriptor It includes a pictograph's escape sequence
       
   289         */
       
   290         static void ConvertToPictographFromEucJpPackedInPlace(TDes8& aDescriptor);
       
   291         /**
       
   292         * It appends a shift-in code to the descriptor.
       
   293         * @since 2.6
       
   294         * @param aDescriptor It's append a shift-in code.
       
   295         * @param aNumberOfCharactersThatDroppedOut The number of characters
       
   296         *                                          that it's dropped out
       
   297         */
       
   298         static void AppendShiftIn(TDes8& aDescriptor,
       
   299             TInt& aNumberOfCharactersThatDroppedOut);
       
   300     };
       
   301 
       
   302 #endif // CNVPICTOGRAPHSHARED_H
       
   303 
       
   304 // End of File