williamr@4: /* williamr@4: * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@4: * All rights reserved. williamr@4: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@4: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: * williamr@4: * Initial Contributors: williamr@4: * Nokia Corporation - initial contribution. williamr@4: * williamr@4: * Contributors: williamr@4: * williamr@4: * Description: williamr@4: * williamr@4: */ williamr@4: williamr@2: williamr@2: williamr@2: const TUint32 KStyleListExternallyOwned=0x01; williamr@2: const TUint32 KParaTypeIsSingle=0x02; williamr@2: williamr@2: williamr@2: williamr@2: TBool CRichText::StyleListPresent()const williamr@2: /** Tests whether the rich text object uses a style list. The style list may be williamr@2: owned by the object itself, or may be externally owned. williamr@2: williamr@2: @return ETrue if the object uses a style list. EFalse if not */ williamr@2: {return iStyleList.IsPtr() && iStyleList.AsPtr();} williamr@2: williamr@2: williamr@2: williamr@2: CStyleList* CRichText::StyleList()const williamr@2: /** Gets a pointer to the style list used by the rich text object. williamr@2: williamr@2: @return The object's style list. NULL if no style list present. */ williamr@2: {return (StyleListPresent()) ? iStyleList.AsPtr() : NULL;} williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: TInt CRichText::StyleCount()const williamr@2: /** Gets the number of styles contained in the rich text object's style list. Returns williamr@2: zero if there is no style list present. williamr@2: williamr@2: @return The number of styles in the style list */ williamr@2: {return (StyleListPresent()) ? iStyleList->Count():0;} williamr@2: williamr@2: williamr@2: void CRichText::SetStyleListExternallyOwned(TBool aExternallyOwned) williamr@2: /** Sets whether the style list used by this rich text object is owned by williamr@2: the object itself, or is externally owned. williamr@2: williamr@2: @param aExternallyOwned ETrue if the style list should be marked as williamr@2: externally owned, EFalse if not. */ williamr@2: { williamr@2: if (aExternallyOwned) iFlags|=KStyleListExternallyOwned; williamr@2: else iFlags&=~KStyleListExternallyOwned; williamr@2: } williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: TBool CRichText::StyleListExternallyOwned()const williamr@2: /** Tests whether the style list used by this rich text object is owned by the williamr@2: object itself, or is externally owned. This value is set using SetStyleListExternallyOwned(). williamr@2: williamr@2: @return ETrue if the rich text object's style list is externally owned. EFalse williamr@2: if it owns its style list, or if it does not use a style list. */ williamr@2: {return iFlags&KStyleListExternallyOwned;} williamr@2: williamr@2: williamr@2: williamr@2: void CRichText::NotifyStyleDeletedL(const CParagraphStyle* aStyle) williamr@2: /** Removes a style from all paragraphs to which it applies. The formatting is williamr@2: reset to the global character and paragraph format layers, except that any williamr@2: specific formatting which has been applied to the paragraphs is retained. williamr@2: williamr@2: Notes: williamr@2: williamr@2: This function should be called on the text content object after deleting a williamr@2: style in the style list. williamr@2: williamr@2: A panic occurs if the rich text object does not use a style list (this can williamr@2: be tested for using StyleListPresent()). williamr@2: williamr@2: @param aStyle Pointer to the style to remove from the rich text object. */ williamr@2: {NotifyStyleChangedL(NULL,aStyle);} williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: MRichTextStoreResolver* CRichText::StoreResolver()const williamr@2: /** Gets the store resolver. A store resolver may be set during construction, or williamr@2: by calling CRichText::SetPictureFactory(). williamr@2: williamr@2: @return The store resolver. This determines which file store the picture is williamr@2: stored in. */ williamr@2: {return iStoreResolver;} williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: MPictureFactory* CRichText::PictureFactory()const williamr@2: /** Gets the picture factory. A picture factory may be set during construction, williamr@2: or by calling CRichText::SetPictureFactory(). williamr@2: williamr@2: @return The picture factory */ williamr@2: {return iPictureFactory;} williamr@4: williamr@4: