messagingappbase/schemeplugin/inc/SmsHandler.h
changeset 79 2981cb3aa489
parent 0 72b543305e3a
equal deleted inserted replaced
25:84d9eb65b26f 79:2981cb3aa489
       
     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 *      Declaration of Scheme handler interface implementation 
       
    16 *      for "sms:"scheme
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef SMS_HANDLER_H
       
    23 #define SMS_HANDLER_H
       
    24 
       
    25 // INCLUDES
       
    26 
       
    27 #include "BaseHandler.h"
       
    28 #include <e32base.h>
       
    29 #include <eikdoc.h>
       
    30 #include <apparc.h>
       
    31 
       
    32 
       
    33 // FORWARD DECLARATION
       
    34 class CSendUi;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  Scheme Handler IF implementation class for sms uri scheme
       
    40 *  @since Series60_2.6
       
    41 */
       
    42 class CSmsHandler : public CBaseHandler
       
    43     {
       
    44 
       
    45     public:     // Constructors and destructor
       
    46 
       
    47         /**
       
    48         * Two phased constructor. Leaves on failure.
       
    49         * @param - aUrl
       
    50         * @return The created object.
       
    51         */      
       
    52 		static CSmsHandler* NewL( const TDesC& aUrl );
       
    53 
       
    54        /**
       
    55         * Destructor.
       
    56         */      
       
    57         virtual ~CSmsHandler();
       
    58 
       
    59         /**
       
    60 		* Url Handler with embedding
       
    61 		* @param -
       
    62 		*/
       
    63 		void HandleUrlEmbeddedL();
       
    64 
       
    65 		/**
       
    66 		* Url Handler without embedding
       
    67 		* @param -
       
    68 		*/
       
    69 		void HandleUrlStandaloneL();
       
    70         
       
    71 	private: // Constructors
       
    72 
       
    73         enum TSchemeSmsFields           //<Possible sms fields
       
    74             {
       
    75             ESchemeSms,                   ///< Sms.
       
    76             ESchemeMsgBody,               ///< Message Body
       
    77             ESchemeTo,                    ///< TO.
       
    78 			ESchemeNoMore
       
    79             };
       
    80 
       
    81         /**
       
    82         * Constructor.
       
    83         */      
       
    84 		CSmsHandler();
       
    85 
       
    86         /**
       
    87         * Second phase constructor. Leaves on failure.
       
    88 		* @param - aUrl
       
    89         */      
       
    90 		void ConstructL( const TDesC& aUrl );
       
    91 
       
    92     private:
       
    93 
       
    94         /**
       
    95 		* Url Handler
       
    96 		* @param aLaunchEmbedded
       
    97 		*/
       
    98 		void HandleUrlL(TBool aLaunchEmbedded);
       
    99 
       
   100 		/**
       
   101 		* Get the appropriate filed from the url
       
   102 		* @param aHeader the name of the field
       
   103         * @return Value of the header
       
   104 		*/
       
   105 		TPtrC GetField(const TDesC& aHeader);
       
   106 
       
   107 		/**
       
   108 		* Check if the field is in the url
       
   109 		* @param aHeader the name of the field
       
   110 		* @return TBool
       
   111 		*/
       
   112 		TBool IsHeader(const TDesC& aHeader);
       
   113 
       
   114 		/**
       
   115 		* Starting position of the specific field
       
   116 		* @param aHeader the name of the field
       
   117 		* @return TInt Starting position of the specific field
       
   118 		*/
       
   119         TInt FieldStart(const TDesC& aHeader);
       
   120 
       
   121 		/**
       
   122 		* Ending position of the specific field
       
   123 		* @param aHeader the name of the field
       
   124 		* @return TInt Ending position of the specific field
       
   125 		*/
       
   126 		TInt FieldEnd(const TDesC& aHeader);
       
   127 
       
   128 		/**
       
   129 		* Get the enumerated position of the specific field
       
   130 		* @param aHeader the name of the field
       
   131 		* @return TSchemeSmsToFields
       
   132 		*/
       
   133 		TSchemeSmsFields GetHeaderPos(const TDesC& aHeader);
       
   134 
       
   135 		/**
       
   136 		* Get the next enumerated position of the specific field
       
   137 		* @param aPos enumerated position of the field
       
   138         * @return Start position of the next field.
       
   139 		*/
       
   140         TInt GetNextField( TInt aStart );
       
   141 
       
   142 	private: // Data
       
   143 
       
   144         CSendUi* iSendUi;
       
   145 	};
       
   146 
       
   147 #endif /* def SMS_HANDLER_H */