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