os/textandloc/textrendering/textformatting/inc/FRMVIS.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/textrendering/textformatting/inc/FRMVIS.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,128 @@
     1.4 +/*
     1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef __FRMVIS_H__
    1.23 +#define __FRMVIS_H__
    1.24 +
    1.25 +#include <e32std.h>
    1.26 +#include <e32base.h>
    1.27 +
    1.28 +class RReadStream;
    1.29 +class RWriteStream;
    1.30 +
    1.31 +/** 
    1.32 +A set of flags to indicate which non-printing characters (e.g. space, tab,
    1.33 +paragraph break, etc.) should be drawn using symbols. By default, all
    1.34 +non-printing characters are hidden.
    1.35 +
    1.36 +An instance of this class is used in
    1.37 +CTextLayout::SetNonPrintingCharsVisibility().
    1.38 +@publishedAll
    1.39 +@released
    1.40 +*/
    1.41 +class TNonPrintingCharVisibility
    1.42 +
    1.43 +	{
    1.44 +private:
    1.45 +	enum TShowFormatChars
    1.46 +		{
    1.47 +		EFNothingVisible=0x000,
    1.48 +		EFTabsVisible=0x001,
    1.49 +		EFSpacesVisible=0x002,
    1.50 +		EFParagraphDelimitersVisible=0x004,
    1.51 +		EFLineBreaksVisible=0x008,
    1.52 +		EFPotentialHyphensVisible=0x010,
    1.53 +		EFNonBreakingHyphensVisible=0x020,
    1.54 +		EFNonBreakingSpacesVisible=0x040,
    1.55 +		EFPageBreaksVisible=0x080,
    1.56 +		EFEverythingVisible=0xffffffff
    1.57 +		};
    1.58 +public:
    1.59 +	IMPORT_C TNonPrintingCharVisibility();
    1.60 +	IMPORT_C TNonPrintingCharVisibility(const TNonPrintingCharVisibility& aVisibility);
    1.61 +	IMPORT_C TNonPrintingCharVisibility& operator=(const TNonPrintingCharVisibility& aVisibility);
    1.62 +	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
    1.63 +	IMPORT_C void InternalizeL(RReadStream& aStream);
    1.64 +	IMPORT_C void SetAllVisible();
    1.65 +	IMPORT_C void SetNoneVisible();
    1.66 +	IMPORT_C void SetTabsVisible(TBool aVisible);
    1.67 +	IMPORT_C void SetSpacesVisible(TBool aVisible);
    1.68 +	IMPORT_C void SetParagraphDelimitersVisible(TBool aVisible);
    1.69 +	IMPORT_C void SetLineBreaksVisible(TBool aVisible);
    1.70 +	IMPORT_C void SetPotentialHyphensVisible(TBool aVisible);
    1.71 +	IMPORT_C void SetNonBreakingHyphensVisible(TBool aVisible);
    1.72 +	IMPORT_C void SetNonBreakingSpacesVisible(TBool aVisible);
    1.73 +	IMPORT_C void SetPageBreaksVisible(TBool aVisible);
    1.74 +
    1.75 +	/** Tests whether all non-printing characters are visible.
    1.76 +	@return ETrue if all non-printing characters are visible. EFalse if any or
    1.77 +	all hidden. */
    1.78 +	inline TBool AllVisible()const{return iVisible==EFEverythingVisible;};
    1.79 +
    1.80 +	/** Tests whether all non-printing characters are hidden.
    1.81 +	@return ETrue if all non-printing characters are hidden. EFalse if any are
    1.82 +	visible. */
    1.83 +	inline TBool NoneVisible()const{return iVisible==EFNothingVisible;};
    1.84 +
    1.85 +	/** Tests whether tab stop characters are visible.
    1.86 +	@return ETrue if tab stop characters are visible. EFalse if hidden. */
    1.87 +	inline TBool TabsVisible()const{return iVisible&EFTabsVisible;};
    1.88 +
    1.89 +	/** Tests whether space characters are visible.
    1.90 +
    1.91 +	Note: To get the the visibility of non-breaking space characters, use
    1.92 +	NonBreakingSpacesVisible() instead.
    1.93 +	@return ETrue if space characters are visible. EFalse if hidden. */
    1.94 +	inline TBool SpacesVisible()const{return iVisible&EFSpacesVisible;};
    1.95 +
    1.96 +	/** Tests whether paragraph delimiters are visible.
    1.97 +	@return ETrue if paragraph delimiters are visible. EFalse if hidden. */
    1.98 +	inline TBool ParagraphDelimitersVisible()const{return iVisible&EFParagraphDelimitersVisible;};
    1.99 +	
   1.100 +	/** Tests whether forced line break characters are visible.
   1.101 +	@return ETrue if forced line break characters are visible. EFalse if hidden.
   1.102 +	*/
   1.103 +	inline TBool LineBreaksVisible()const{return iVisible&EFLineBreaksVisible;};
   1.104 +	
   1.105 +	/** Tests whether potential hyphen characters (inserted before a line break
   1.106 +	within a word) are visible.
   1.107 +
   1.108 +	@return ETrue if potential hyphen characters are visible. EFalse if hidden.
   1.109 +	*/
   1.110 +	inline TBool PotentialHyphensVisible()const{return iVisible&EFPotentialHyphensVisible;};
   1.111 +	
   1.112 +	/** Tests whether non-breaking hyphens (enclosing word is always kept on
   1.113 +	the same line) are visible.
   1.114 +	@return ETrue if non-breaking hyphens are visible. EFalse if hidden. */
   1.115 +	inline TBool NonBreakingHyphensVisible()const{return iVisible&EFNonBreakingHyphensVisible;};
   1.116 +	
   1.117 +	/** Tests whether non-breaking spaces are visible.
   1.118 +	@return ETrue if non-breaking spaces are visible. EFalse if hidden. */
   1.119 +	inline TBool NonBreakingSpacesVisible()const{return iVisible&EFNonBreakingSpacesVisible;};
   1.120 +
   1.121 +	/** Tests whether page break characters are visible.
   1.122 +	@return ETrue if page break characters are visible. EFalse if hidden. */
   1.123 +	inline TBool PageBreaksVisible()const{return iVisible&EFPageBreaksVisible;};
   1.124 +
   1.125 +private:
   1.126 +	TUint32 iVisible;
   1.127 +	};
   1.128 +
   1.129 +#endif
   1.130 +
   1.131 +