1 // Copyright (c) 2003-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 const TUint32 KStyleListExternallyOwned=0x01;
18 const TUint32 KParaTypeIsSingle=0x02;
22 TBool CRichText::StyleListPresent()const
23 /** Tests whether the rich text object uses a style list. The style list may be
24 owned by the object itself, or may be externally owned.
26 @return ETrue if the object uses a style list. EFalse if not */
27 {return iStyleList.IsPtr() && iStyleList.AsPtr();}
31 CStyleList* CRichText::StyleList()const
32 /** Gets a pointer to the style list used by the rich text object.
34 @return The object's style list. NULL if no style list present. */
35 {return (StyleListPresent()) ? iStyleList.AsPtr() : NULL;}
40 TInt CRichText::StyleCount()const
41 /** Gets the number of styles contained in the rich text object's style list. Returns
42 zero if there is no style list present.
44 @return The number of styles in the style list */
45 {return (StyleListPresent()) ? iStyleList->Count():0;}
48 void CRichText::SetStyleListExternallyOwned(TBool aExternallyOwned)
49 /** Sets whether the style list used by this rich text object is owned by
50 the object itself, or is externally owned.
52 @param aExternallyOwned ETrue if the style list should be marked as
53 externally owned, EFalse if not. */
55 if (aExternallyOwned) iFlags|=KStyleListExternallyOwned;
56 else iFlags&=~KStyleListExternallyOwned;
62 TBool CRichText::StyleListExternallyOwned()const
63 /** Tests whether the style list used by this rich text object is owned by the
64 object itself, or is externally owned. This value is set using SetStyleListExternallyOwned().
66 @return ETrue if the rich text object's style list is externally owned. EFalse
67 if it owns its style list, or if it does not use a style list. */
68 {return iFlags&KStyleListExternallyOwned;}
72 void CRichText::NotifyStyleDeletedL(const CParagraphStyle* aStyle)
73 /** Removes a style from all paragraphs to which it applies. The formatting is
74 reset to the global character and paragraph format layers, except that any
75 specific formatting which has been applied to the paragraphs is retained.
79 This function should be called on the text content object after deleting a
80 style in the style list.
82 A panic occurs if the rich text object does not use a style list (this can
83 be tested for using StyleListPresent()).
85 @param aStyle Pointer to the style to remove from the rich text object. */
86 {NotifyStyleChangedL(NULL,aStyle);}
91 MRichTextStoreResolver* CRichText::StoreResolver()const
92 /** Gets the store resolver. A store resolver may be set during construction, or
93 by calling CRichText::SetPictureFactory().
95 @return The store resolver. This determines which file store the picture is
97 {return iStoreResolver;}
102 MPictureFactory* CRichText::PictureFactory()const
103 /** Gets the picture factory. A picture factory may be set during construction,
104 or by calling CRichText::SetPictureFactory().
106 @return The picture factory */
107 {return iPictureFactory;}