epoc32/include/txtrich.inl
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
williamr@2
    17
const TUint32 KStyleListExternallyOwned=0x01;
williamr@2
    18
const TUint32 KParaTypeIsSingle=0x02;
williamr@2
    19
williamr@2
    20
 
williamr@2
    21
williamr@2
    22
TBool CRichText::StyleListPresent()const
williamr@2
    23
/** Tests whether the rich text object uses a style list. The style list may be 
williamr@2
    24
owned by the object itself, or may be externally owned.
williamr@2
    25
williamr@2
    26
@return ETrue if the object uses a style list. EFalse if not */
williamr@2
    27
	{return iStyleList.IsPtr() && iStyleList.AsPtr();}
williamr@2
    28
williamr@2
    29
williamr@2
    30
 
williamr@2
    31
CStyleList* CRichText::StyleList()const
williamr@2
    32
/** Gets a pointer to the style list used by the rich text object.
williamr@2
    33
williamr@2
    34
@return The object's style list. NULL if no style list present. */
williamr@2
    35
	{return (StyleListPresent()) ? iStyleList.AsPtr() : NULL;}
williamr@2
    36
williamr@2
    37
williamr@2
    38
 
williamr@2
    39
williamr@2
    40
TInt CRichText::StyleCount()const
williamr@2
    41
/** Gets the number of styles contained in the rich text object's style list. Returns 
williamr@2
    42
zero if there is no style list present.
williamr@2
    43
williamr@2
    44
@return The number of styles in the style list */
williamr@2
    45
	{return (StyleListPresent()) ? iStyleList->Count():0;}
williamr@2
    46
williamr@2
    47
williamr@2
    48
void CRichText::SetStyleListExternallyOwned(TBool aExternallyOwned)
williamr@2
    49
/** Sets whether the style list used by this rich text object is owned by 
williamr@2
    50
the object itself, or is externally owned.
williamr@2
    51
williamr@2
    52
@param aExternallyOwned ETrue if the style list should be marked as 
williamr@2
    53
externally owned, EFalse if not. */
williamr@2
    54
	{
williamr@2
    55
	if (aExternallyOwned) iFlags|=KStyleListExternallyOwned;
williamr@2
    56
	else iFlags&=~KStyleListExternallyOwned;
williamr@2
    57
	}
williamr@2
    58
williamr@2
    59
williamr@2
    60
 
williamr@2
    61
williamr@2
    62
TBool CRichText::StyleListExternallyOwned()const
williamr@2
    63
/** Tests whether the style list used by this rich text object is owned by the 
williamr@2
    64
object itself, or is externally owned. This value is set using SetStyleListExternallyOwned().
williamr@2
    65
williamr@2
    66
@return ETrue if the rich text object's style list is externally owned. EFalse 
williamr@2
    67
if it owns its style list, or if it does not use a style list. */
williamr@2
    68
	{return iFlags&KStyleListExternallyOwned;}
williamr@2
    69
williamr@2
    70
williamr@2
    71
 
williamr@2
    72
void CRichText::NotifyStyleDeletedL(const CParagraphStyle* aStyle)
williamr@2
    73
/** Removes a style from all paragraphs to which it applies. The formatting is 
williamr@2
    74
reset to the global character and paragraph format layers, except that any 
williamr@2
    75
specific formatting which has been applied to the paragraphs is retained.
williamr@2
    76
williamr@2
    77
Notes:
williamr@2
    78
williamr@2
    79
This function should be called on the text content object after deleting a 
williamr@2
    80
style in the style list.
williamr@2
    81
williamr@2
    82
A panic occurs if the rich text object does not use a style list (this can 
williamr@2
    83
be tested for using StyleListPresent()).
williamr@2
    84
williamr@2
    85
@param aStyle Pointer to the style to remove from the rich text object. */
williamr@2
    86
	{NotifyStyleChangedL(NULL,aStyle);}
williamr@2
    87
williamr@2
    88
williamr@2
    89
 
williamr@2
    90
williamr@2
    91
MRichTextStoreResolver* CRichText::StoreResolver()const
williamr@2
    92
/** Gets the store resolver. A store resolver may be set during construction, or 
williamr@2
    93
by calling CRichText::SetPictureFactory().
williamr@2
    94
williamr@2
    95
@return The store resolver. This determines which file store the picture is 
williamr@2
    96
stored in. */
williamr@2
    97
	{return iStoreResolver;}
williamr@2
    98
williamr@2
    99
williamr@2
   100
 
williamr@2
   101
williamr@2
   102
MPictureFactory* CRichText::PictureFactory()const
williamr@2
   103
/** Gets the picture factory. A picture factory may be set during construction, 
williamr@2
   104
or by calling CRichText::SetPictureFactory().
williamr@2
   105
williamr@2
   106
@return The picture factory */
williamr@2
   107
	{return iPictureFactory;}