os/textandloc/textrendering/texthandling/inc/TXTRICH.INL
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/textrendering/texthandling/inc/TXTRICH.INL	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,112 @@
     1.4 +/*
     1.5 +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +const TUint32 KStyleListExternallyOwned=0x01;
    1.24 +const TUint32 KParaTypeIsSingle=0x02;
    1.25 +
    1.26 + 
    1.27 +
    1.28 +TBool CRichText::StyleListPresent()const
    1.29 +/** Tests whether the rich text object uses a style list. The style list may be 
    1.30 +owned by the object itself, or may be externally owned.
    1.31 +
    1.32 +@return ETrue if the object uses a style list. EFalse if not */
    1.33 +	{return iStyleList.IsPtr() && iStyleList.AsPtr();}
    1.34 +
    1.35 +
    1.36 + 
    1.37 +CStyleList* CRichText::StyleList()const
    1.38 +/** Gets a pointer to the style list used by the rich text object.
    1.39 +
    1.40 +@return The object's style list. NULL if no style list present. */
    1.41 +	{return (StyleListPresent()) ? iStyleList.AsPtr() : NULL;}
    1.42 +
    1.43 +
    1.44 + 
    1.45 +
    1.46 +TInt CRichText::StyleCount()const
    1.47 +/** Gets the number of styles contained in the rich text object's style list. Returns 
    1.48 +zero if there is no style list present.
    1.49 +
    1.50 +@return The number of styles in the style list */
    1.51 +	{return (StyleListPresent()) ? iStyleList->Count():0;}
    1.52 +
    1.53 +
    1.54 +void CRichText::SetStyleListExternallyOwned(TBool aExternallyOwned)
    1.55 +/** Sets whether the style list used by this rich text object is owned by 
    1.56 +the object itself, or is externally owned.
    1.57 +
    1.58 +@param aExternallyOwned ETrue if the style list should be marked as 
    1.59 +externally owned, EFalse if not. */
    1.60 +	{
    1.61 +	if (aExternallyOwned) iFlags|=KStyleListExternallyOwned;
    1.62 +	else iFlags&=~KStyleListExternallyOwned;
    1.63 +	}
    1.64 +
    1.65 +
    1.66 + 
    1.67 +
    1.68 +TBool CRichText::StyleListExternallyOwned()const
    1.69 +/** Tests whether the style list used by this rich text object is owned by the 
    1.70 +object itself, or is externally owned. This value is set using SetStyleListExternallyOwned().
    1.71 +
    1.72 +@return ETrue if the rich text object's style list is externally owned. EFalse 
    1.73 +if it owns its style list, or if it does not use a style list. */
    1.74 +	{return iFlags&KStyleListExternallyOwned;}
    1.75 +
    1.76 +
    1.77 + 
    1.78 +void CRichText::NotifyStyleDeletedL(const CParagraphStyle* aStyle)
    1.79 +/** Removes a style from all paragraphs to which it applies. The formatting is 
    1.80 +reset to the global character and paragraph format layers, except that any 
    1.81 +specific formatting which has been applied to the paragraphs is retained.
    1.82 +
    1.83 +Notes:
    1.84 +
    1.85 +This function should be called on the text content object after deleting a 
    1.86 +style in the style list.
    1.87 +
    1.88 +A panic occurs if the rich text object does not use a style list (this can 
    1.89 +be tested for using StyleListPresent()).
    1.90 +
    1.91 +@param aStyle Pointer to the style to remove from the rich text object. */
    1.92 +	{NotifyStyleChangedL(NULL,aStyle);}
    1.93 +
    1.94 +
    1.95 + 
    1.96 +
    1.97 +MRichTextStoreResolver* CRichText::StoreResolver()const
    1.98 +/** Gets the store resolver. A store resolver may be set during construction, or 
    1.99 +by calling CRichText::SetPictureFactory().
   1.100 +
   1.101 +@return The store resolver. This determines which file store the picture is 
   1.102 +stored in. */
   1.103 +	{return iStoreResolver;}
   1.104 +
   1.105 +
   1.106 + 
   1.107 +
   1.108 +MPictureFactory* CRichText::PictureFactory()const
   1.109 +/** Gets the picture factory. A picture factory may be set during construction, 
   1.110 +or by calling CRichText::SetPictureFactory().
   1.111 +
   1.112 +@return The picture factory */
   1.113 +	{return iPictureFactory;}
   1.114 +
   1.115 +