wvuing/wvuiave/AppSrc/MCAMessageExtension.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     1 /*
       
     2 * Copyright (c) 2004-2005 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:  Message extension interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MCAMESSAGEEXTENSION_H
       
    20 #define MCAMESSAGEEXTENSION_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CEikRichTextEditor;
       
    27 class TCursorSelection;
       
    28 class CRichText;
       
    29 
       
    30 // Type definitions for different smiley types
       
    31 enum TMessageExtensionTypes
       
    32     {
       
    33     EMessageExtensionSmiley = 0
       
    34     };
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  Interface class for message extension classes
       
    40 *
       
    41 *  @lib chat.app
       
    42 *  @since 2.1
       
    43 */
       
    44 class MCAMessageExtension
       
    45     {
       
    46     public:
       
    47         /**
       
    48          * Return type of Extension. Inherited message extension does not need
       
    49          * information of type. It is only needed by handler of extensions and
       
    50          * user of extension. That is why implementation is created in here.
       
    51          * @since 2.1
       
    52          * @return Type of extension
       
    53          */
       
    54         virtual TMessageExtensionTypes Type() const
       
    55             {
       
    56             return iType;
       
    57             }
       
    58 
       
    59         /**
       
    60          * Destructor
       
    61          * @since 2.1
       
    62          */
       
    63         virtual ~MCAMessageExtension() {};
       
    64 
       
    65     protected:
       
    66 
       
    67         /**
       
    68          *	Constructor Inherited message extension does not need
       
    69          *  information of type. It is only needed by handler of extensions and
       
    70          *  user of extension. That is why implementation is created in here.
       
    71          *  @since 2.1
       
    72          *  @param aType Type of extension
       
    73          */
       
    74         MCAMessageExtension( TMessageExtensionTypes aType ) : iType( aType ) {}
       
    75 
       
    76     public: //Interface methods
       
    77         /**
       
    78         * Adds extension to current position in Editor
       
    79         * @param aEditor used editor
       
    80         * @param aCancelled
       
    81         * @since 2.1
       
    82         */
       
    83         virtual void InsertExtensionL( CEikRichTextEditor& aEditor,
       
    84                                        TBool& aCancelled ) = 0;
       
    85 
       
    86         /**
       
    87         * Removes extension from given position in Editor
       
    88         * @param aEditor used editor
       
    89         * @param aPos    extension position in Editor
       
    90         * @since 2.1
       
    91         */
       
    92         virtual void DeleteExtensionL( CEikRichTextEditor& aEditor,
       
    93                                        TInt aPos ) = 0;
       
    94 
       
    95         /**
       
    96         * Converts smiley icons to string smileys
       
    97         * @since 2.1
       
    98         * @param aEditor    used editor
       
    99         * @param aDes       Text from editor
       
   100         */
       
   101         virtual void ExtensionToStringL( CEikRichTextEditor& aEditor,
       
   102                                          TDes& aDes ) = 0;
       
   103 
       
   104         /**
       
   105          *  Converts extension in selection area from strings to extensions.
       
   106          *  Used for example for cut, copy, paste features.
       
   107          *  @since 2.6
       
   108          *  @param aEditor, Used editor
       
   109          */
       
   110         virtual void ConvertSelectionToExtensionL(
       
   111             CEikRichTextEditor& aEditor ) = 0;
       
   112 
       
   113         /**
       
   114          *  Converts all the extensions in selection area from
       
   115          *  strings to extensions.
       
   116          *  @since 3.0
       
   117          *  @param aRichText Rich text to be converted
       
   118          *  @param aSelection Selection area
       
   119          */
       
   120         virtual void ConvertSelectionToExtensionL( CRichText& aRichText,
       
   121                                                    TCursorSelection& aSelection ) = 0;
       
   122 
       
   123         /**
       
   124          *  Converts extension in selection area from extensions to strings.
       
   125          *  Used for example for cut, copy, paste features.
       
   126          *  @since 2.6
       
   127          *  @param aEditor, Used editor
       
   128          *  @param aPreserve, Preserve original status of extension
       
   129          */
       
   130         virtual void ConvertSelectionToStringL( CEikRichTextEditor& aEditor,
       
   131                                                 TBool aPreserve ) = 0;
       
   132 
       
   133         /**
       
   134          *  Reset extension counters.
       
   135          *  @sinze 2.6
       
   136          */
       
   137         virtual void Reset() = 0;
       
   138 
       
   139         /**
       
   140          * Informs the extensions about changed size
       
   141          * @param aSize
       
   142          * @since 3.0
       
   143          */
       
   144         virtual void SizeChanged( TSize& aSize ) = 0;
       
   145 
       
   146         /**
       
   147          * Converts all the extensions in selection area from
       
   148          * extensions to strings.
       
   149          * @since S60 v3.1
       
   150          * @param aEditor Used editor.
       
   151          * @param aResultString Descriptor for converted string,
       
   152          *                      caller is responsible to provide
       
   153          *                      large enough descriptor.
       
   154          * @param aSelectionAfterConversion Cursor selection after
       
   155          *                      extensions are converted to strings.
       
   156          * @param aPreserve Should we preserve original extension status.
       
   157          */
       
   158         virtual void ConvertSelectionToStringL(
       
   159             CEikRichTextEditor& aEditor,
       
   160             TDes& aResultString,
       
   161             TCursorSelection& aSelectionAfterConversion,
       
   162             TBool aPreserve ) = 0;
       
   163 
       
   164     private:
       
   165 
       
   166         // Type of extension
       
   167         TMessageExtensionTypes iType;
       
   168     };
       
   169 
       
   170 #endif      // MCAMESSAGEEXTENSION_H
       
   171 
       
   172 // End of File