diff -r ebe688cedc25 -r 7fdbb852d323 messagingappbase/smilengine/xhtml/inc/xhtmlstack.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingappbase/smilengine/xhtml/inc/xhtmlstack.inl Wed Sep 01 12:31:54 2010 +0100 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Provides CXhtmlStack Class inline member functions. +* +*/ + + + +#ifndef XHTMLSTACK_INL +#define XHTMLSTACK_INL + + +// --------------------------------------------------------- +// CXhtmlStack::NewL +// --------------------------------------------------------- +// +template inline CXhtmlStack* CXhtmlStack::NewL() + { + CXhtmlStack* self = new( ELeave ) CXhtmlStack; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + + +// --------------------------------------------------------- +// CXhtmlStack::ConstructL +// --------------------------------------------------------- +// +template inline void CXhtmlStack::ConstructL() + { + iStack = new (ELeave) RPointerArray( 16 ); + } + +// --------------------------------------------------------- +// CXhtmlStack::~CXhtmlStack +// --------------------------------------------------------- +// +template CXhtmlStack::~CXhtmlStack() + { + if( iStack ) + { + iStack->ResetAndDestroy(); + } + delete iStack; + } + +// --------------------------------------------------------- +// CXhtmlStack::CXhtmlStack +// --------------------------------------------------------- +// +template CXhtmlStack::CXhtmlStack() + { + } + +// --------------------------------------------------------- +// CXhtmlStack::Top +// --------------------------------------------------------- +// +template inline T* CXhtmlStack::Top() + { + TInt index = iStack->Count(); + if (index > 0) + { + return (*iStack)[--index]; + } + return 0; + } + +// --------------------------------------------------------- +// CXhtmlStack::Pop +// --------------------------------------------------------- +// +template inline void CXhtmlStack::Pop() + { + TInt index = iStack->Count(); + if( index > 0 ) + { + T* ptr = (*iStack)[--index]; + iStack->Remove( index ); + delete ptr; + } + } + +// --------------------------------------------------------- +// CXhtmlStack::Push +// --------------------------------------------------------- +// +template inline void CXhtmlStack::PushL( T* aStyle ) + { + iStack->InsertL( aStyle, iStack->Count()); + } + + +#endif + +