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