messagingfw/msgurlhandler/urlhandler/src/MSGBASE.CPP
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This file contains the implementation for the class defined in MsgBase.h
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @see	MsgBase.h
       
    21 */
       
    22 
       
    23 // System includes
       
    24 //
       
    25 #include <txtrich.h>
       
    26 #include <mturutils.h>
       
    27 #include <inetprottextutils.h>
       
    28 
       
    29 // Local includes
       
    30 //
       
    31 #include "MSGBASE.H"
       
    32 
       
    33 // Constants
       
    34 //
       
    35 const TInt KColonChar = ':';
       
    36 
       
    37 CMsgSchemeHandlerBase::CMsgSchemeHandlerBase()
       
    38 	{
       
    39 	}
       
    40 
       
    41 void CMsgSchemeHandlerBase::ConstructL()
       
    42 	{
       
    43 	// Create a rich text
       
    44 	iPfl = CParaFormatLayer::NewL();
       
    45 	iCfl = CCharFormatLayer::NewL();
       
    46 	iRtBody = CRichText::NewL(iPfl, iCfl);
       
    47 	}
       
    48 
       
    49 CMsgSchemeHandlerBase::~CMsgSchemeHandlerBase()
       
    50 	{
       
    51 	delete iRtBody;
       
    52 	delete iCfl;
       
    53 	delete iPfl;
       
    54 	}
       
    55 
       
    56 void CMsgSchemeHandlerBase::ParseUrlAndSendL(const TDesC& aUrl)
       
    57 	{
       
    58 	// Parse the url
       
    59 	ParseUrlL(aUrl);
       
    60 
       
    61 	// Launch the editor
       
    62 	SendL();
       
    63 	}
       
    64 
       
    65 void CMsgSchemeHandlerBase::GetSchemeSpecificPartL(const TDesC& aUrl, TPtrC& aSchemePart)
       
    66 	{
       
    67 	// Look for scheme separator 
       
    68 	TInt schemePos = aUrl.Locate(KColonChar);
       
    69 	if (schemePos == KErrNotFound)
       
    70 		{
       
    71 		User::Leave(KErrNotFound);
       
    72 		}
       
    73 
       
    74 	// Set the scheme specific part i.e everything after the colon.  
       
    75 	aSchemePart.Set(aUrl.Mid(schemePos+1));
       
    76 	InetProtTextUtils::RemoveWhiteSpace(aSchemePart, InetProtTextUtils::ERemoveBoth);
       
    77 	}
       
    78 
       
    79 void CMsgSchemeHandlerBase::LaunchEditorL(const TMsvId& aId)
       
    80 	{
       
    81 	MturUtils::LaunchEditorAndWaitL(aId);
       
    82 	}
       
    83