|
1 /* |
|
2 * Copyright (c) 1997-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 * Definitions of non-printing characters' visibility classes. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <s32strm.h> |
|
21 #include "FRMVIS.H" |
|
22 |
|
23 EXPORT_C TNonPrintingCharVisibility::TNonPrintingCharVisibility() |
|
24 :iVisible(EFNothingVisible) |
|
25 {} |
|
26 |
|
27 |
|
28 EXPORT_C TNonPrintingCharVisibility::TNonPrintingCharVisibility(const TNonPrintingCharVisibility& aVisibility) |
|
29 :iVisible(aVisibility.iVisible) |
|
30 {} |
|
31 |
|
32 EXPORT_C TNonPrintingCharVisibility& TNonPrintingCharVisibility::operator=(const TNonPrintingCharVisibility& aVisibility) |
|
33 { |
|
34 iVisible=aVisibility.iVisible; |
|
35 return *this; |
|
36 } |
|
37 |
|
38 /** Externalises a TNonPrintingCharVisibility object to a write stream. The |
|
39 presence of this function means that the standard templated operator<<() |
|
40 (defined in s32strm.h) is available to externalise objects of this class. |
|
41 |
|
42 @param aStream Stream to which the object should be externalised. */ |
|
43 EXPORT_C void TNonPrintingCharVisibility::ExternalizeL(RWriteStream& aStream)const |
|
44 { |
|
45 aStream.WriteUint32L(iVisible); |
|
46 } |
|
47 |
|
48 /** Internalises a TNonPrintingCharVisibility object from a read stream. The |
|
49 presence of this function means that the standard templated operator>>() |
|
50 (defined in s32strm.h) is available to internalise objects of this class. |
|
51 |
|
52 @param aStream Stream from which the object should be internalised. */ |
|
53 EXPORT_C void TNonPrintingCharVisibility::InternalizeL(RReadStream& aStream) |
|
54 { |
|
55 iVisible=aStream.ReadUint32L(); |
|
56 } |
|
57 |
|
58 /** Sets all non-printing characters to be drawn using symbols. */ |
|
59 EXPORT_C void TNonPrintingCharVisibility::SetAllVisible() |
|
60 { |
|
61 iVisible=(TUint32)EFEverythingVisible; |
|
62 } |
|
63 |
|
64 /** Sets all non-printing characters to be hidden. */ |
|
65 EXPORT_C void TNonPrintingCharVisibility::SetNoneVisible() |
|
66 { |
|
67 iVisible=EFNothingVisible; |
|
68 } |
|
69 |
|
70 /** Sets the visibility of tab stops. |
|
71 |
|
72 @param aVisible True for visible tab stops. False for hidden. */ |
|
73 EXPORT_C void TNonPrintingCharVisibility::SetTabsVisible(TBool aVisible) |
|
74 { |
|
75 iVisible = aVisible? |
|
76 iVisible | EFTabsVisible : iVisible & ~EFTabsVisible; |
|
77 } |
|
78 |
|
79 /** Sets the visibility of space characters. |
|
80 |
|
81 @param aVisible True for visible space characters. False for hidden. */ |
|
82 EXPORT_C void TNonPrintingCharVisibility::SetSpacesVisible(TBool aVisible) |
|
83 { |
|
84 iVisible = aVisible? |
|
85 iVisible | EFSpacesVisible : iVisible & ~EFSpacesVisible; |
|
86 } |
|
87 |
|
88 /** Sets the visibility of paragraph delimiters. |
|
89 |
|
90 @param aVisible True for visible paragraph delimiters, false for hidden. */ |
|
91 EXPORT_C void TNonPrintingCharVisibility::SetParagraphDelimitersVisible(TBool aVisible) |
|
92 { |
|
93 iVisible = aVisible? |
|
94 iVisible | EFParagraphDelimitersVisible |
|
95 : iVisible & ~EFParagraphDelimitersVisible; |
|
96 } |
|
97 |
|
98 /** Sets the visibility of line breaks (force a new line without beginning a |
|
99 new paragraph). |
|
100 |
|
101 @param aVisible True for visible line breaks. False for hidden. */ |
|
102 EXPORT_C void TNonPrintingCharVisibility::SetLineBreaksVisible(TBool aVisible) |
|
103 { |
|
104 iVisible = aVisible? |
|
105 iVisible | EFLineBreaksVisible : iVisible & ~EFLineBreaksVisible; |
|
106 } |
|
107 |
|
108 /** Sets the visibility of potential hyphens (inserted before a line break |
|
109 within a word). |
|
110 |
|
111 @param aVisible True for visible potential hyphens, false for hidden. */ |
|
112 EXPORT_C void TNonPrintingCharVisibility::SetPotentialHyphensVisible(TBool aVisible) |
|
113 { |
|
114 iVisible = aVisible? |
|
115 iVisible | EFPotentialHyphensVisible |
|
116 : iVisible & ~EFPotentialHyphensVisible; |
|
117 } |
|
118 |
|
119 /** Sets the visibility of non-breaking hyphens (enclosing word is always kept |
|
120 on the same line). |
|
121 |
|
122 @param aVisible True for visible non-breaking hyphens, false for hidden. */ |
|
123 EXPORT_C void TNonPrintingCharVisibility::SetNonBreakingHyphensVisible(TBool aVisible) |
|
124 { |
|
125 iVisible = aVisible? |
|
126 iVisible | EFNonBreakingHyphensVisible |
|
127 : iVisible & ~EFNonBreakingHyphensVisible; |
|
128 } |
|
129 |
|
130 /** Sets the visibility of non-breaking spaces. |
|
131 |
|
132 @param aVisible True for visible non-breaking spaces, false for hidden. */ |
|
133 EXPORT_C void TNonPrintingCharVisibility::SetNonBreakingSpacesVisible(TBool aVisible) |
|
134 { |
|
135 iVisible = aVisible? |
|
136 iVisible | EFNonBreakingSpacesVisible |
|
137 : iVisible & ~EFNonBreakingSpacesVisible; |
|
138 } |
|
139 |
|
140 /** Sets the visibility of page breaks. |
|
141 |
|
142 @param aVisible True for visible page breaks, false for hidden. */ |
|
143 EXPORT_C void TNonPrintingCharVisibility::SetPageBreaksVisible(TBool aVisible) |
|
144 { |
|
145 iVisible = aVisible? |
|
146 iVisible | EFPageBreaksVisible |
|
147 : iVisible & ~EFPageBreaksVisible; |
|
148 } |