textrendering/textformatting/inc/FRMVIS.H
changeset 0 1fb32624e06b
equal deleted inserted replaced
-1:000000000000 0:1fb32624e06b
       
     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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __FRMVIS_H__
       
    20 #define __FRMVIS_H__
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 class RReadStream;
       
    26 class RWriteStream;
       
    27 
       
    28 /** 
       
    29 A set of flags to indicate which non-printing characters (e.g. space, tab,
       
    30 paragraph break, etc.) should be drawn using symbols. By default, all
       
    31 non-printing characters are hidden.
       
    32 
       
    33 An instance of this class is used in
       
    34 CTextLayout::SetNonPrintingCharsVisibility().
       
    35 @publishedAll
       
    36 @released
       
    37 */
       
    38 class TNonPrintingCharVisibility
       
    39 
       
    40 	{
       
    41 private:
       
    42 	enum TShowFormatChars
       
    43 		{
       
    44 		EFNothingVisible=0x000,
       
    45 		EFTabsVisible=0x001,
       
    46 		EFSpacesVisible=0x002,
       
    47 		EFParagraphDelimitersVisible=0x004,
       
    48 		EFLineBreaksVisible=0x008,
       
    49 		EFPotentialHyphensVisible=0x010,
       
    50 		EFNonBreakingHyphensVisible=0x020,
       
    51 		EFNonBreakingSpacesVisible=0x040,
       
    52 		EFPageBreaksVisible=0x080,
       
    53 		EFEverythingVisible=0xffffffff
       
    54 		};
       
    55 public:
       
    56 	IMPORT_C TNonPrintingCharVisibility();
       
    57 	IMPORT_C TNonPrintingCharVisibility(const TNonPrintingCharVisibility& aVisibility);
       
    58 	IMPORT_C TNonPrintingCharVisibility& operator=(const TNonPrintingCharVisibility& aVisibility);
       
    59 	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
       
    60 	IMPORT_C void InternalizeL(RReadStream& aStream);
       
    61 	IMPORT_C void SetAllVisible();
       
    62 	IMPORT_C void SetNoneVisible();
       
    63 	IMPORT_C void SetTabsVisible(TBool aVisible);
       
    64 	IMPORT_C void SetSpacesVisible(TBool aVisible);
       
    65 	IMPORT_C void SetParagraphDelimitersVisible(TBool aVisible);
       
    66 	IMPORT_C void SetLineBreaksVisible(TBool aVisible);
       
    67 	IMPORT_C void SetPotentialHyphensVisible(TBool aVisible);
       
    68 	IMPORT_C void SetNonBreakingHyphensVisible(TBool aVisible);
       
    69 	IMPORT_C void SetNonBreakingSpacesVisible(TBool aVisible);
       
    70 	IMPORT_C void SetPageBreaksVisible(TBool aVisible);
       
    71 
       
    72 	/** Tests whether all non-printing characters are visible.
       
    73 	@return ETrue if all non-printing characters are visible. EFalse if any or
       
    74 	all hidden. */
       
    75 	inline TBool AllVisible()const{return iVisible==EFEverythingVisible;};
       
    76 
       
    77 	/** Tests whether all non-printing characters are hidden.
       
    78 	@return ETrue if all non-printing characters are hidden. EFalse if any are
       
    79 	visible. */
       
    80 	inline TBool NoneVisible()const{return iVisible==EFNothingVisible;};
       
    81 
       
    82 	/** Tests whether tab stop characters are visible.
       
    83 	@return ETrue if tab stop characters are visible. EFalse if hidden. */
       
    84 	inline TBool TabsVisible()const{return iVisible&EFTabsVisible;};
       
    85 
       
    86 	/** Tests whether space characters are visible.
       
    87 
       
    88 	Note: To get the the visibility of non-breaking space characters, use
       
    89 	NonBreakingSpacesVisible() instead.
       
    90 	@return ETrue if space characters are visible. EFalse if hidden. */
       
    91 	inline TBool SpacesVisible()const{return iVisible&EFSpacesVisible;};
       
    92 
       
    93 	/** Tests whether paragraph delimiters are visible.
       
    94 	@return ETrue if paragraph delimiters are visible. EFalse if hidden. */
       
    95 	inline TBool ParagraphDelimitersVisible()const{return iVisible&EFParagraphDelimitersVisible;};
       
    96 	
       
    97 	/** Tests whether forced line break characters are visible.
       
    98 	@return ETrue if forced line break characters are visible. EFalse if hidden.
       
    99 	*/
       
   100 	inline TBool LineBreaksVisible()const{return iVisible&EFLineBreaksVisible;};
       
   101 	
       
   102 	/** Tests whether potential hyphen characters (inserted before a line break
       
   103 	within a word) are visible.
       
   104 
       
   105 	@return ETrue if potential hyphen characters are visible. EFalse if hidden.
       
   106 	*/
       
   107 	inline TBool PotentialHyphensVisible()const{return iVisible&EFPotentialHyphensVisible;};
       
   108 	
       
   109 	/** Tests whether non-breaking hyphens (enclosing word is always kept on
       
   110 	the same line) are visible.
       
   111 	@return ETrue if non-breaking hyphens are visible. EFalse if hidden. */
       
   112 	inline TBool NonBreakingHyphensVisible()const{return iVisible&EFNonBreakingHyphensVisible;};
       
   113 	
       
   114 	/** Tests whether non-breaking spaces are visible.
       
   115 	@return ETrue if non-breaking spaces are visible. EFalse if hidden. */
       
   116 	inline TBool NonBreakingSpacesVisible()const{return iVisible&EFNonBreakingSpacesVisible;};
       
   117 
       
   118 	/** Tests whether page break characters are visible.
       
   119 	@return ETrue if page break characters are visible. EFalse if hidden. */
       
   120 	inline TBool PageBreaksVisible()const{return iVisible&EFPageBreaksVisible;};
       
   121 
       
   122 private:
       
   123 	TUint32 iVisible;
       
   124 	};
       
   125 
       
   126 #endif
       
   127 
       
   128