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