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