sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef __FRMVIS_H__ sl@0: #define __FRMVIS_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: class RReadStream; sl@0: class RWriteStream; sl@0: sl@0: /** sl@0: A set of flags to indicate which non-printing characters (e.g. space, tab, sl@0: paragraph break, etc.) should be drawn using symbols. By default, all sl@0: non-printing characters are hidden. sl@0: sl@0: An instance of this class is used in sl@0: CTextLayout::SetNonPrintingCharsVisibility(). sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class TNonPrintingCharVisibility sl@0: sl@0: { sl@0: private: sl@0: enum TShowFormatChars sl@0: { sl@0: EFNothingVisible=0x000, sl@0: EFTabsVisible=0x001, sl@0: EFSpacesVisible=0x002, sl@0: EFParagraphDelimitersVisible=0x004, sl@0: EFLineBreaksVisible=0x008, sl@0: EFPotentialHyphensVisible=0x010, sl@0: EFNonBreakingHyphensVisible=0x020, sl@0: EFNonBreakingSpacesVisible=0x040, sl@0: EFPageBreaksVisible=0x080, sl@0: EFEverythingVisible=0xffffffff sl@0: }; sl@0: public: sl@0: IMPORT_C TNonPrintingCharVisibility(); sl@0: IMPORT_C TNonPrintingCharVisibility(const TNonPrintingCharVisibility& aVisibility); sl@0: IMPORT_C TNonPrintingCharVisibility& operator=(const TNonPrintingCharVisibility& aVisibility); sl@0: IMPORT_C void ExternalizeL(RWriteStream& aStream)const; sl@0: IMPORT_C void InternalizeL(RReadStream& aStream); sl@0: IMPORT_C void SetAllVisible(); sl@0: IMPORT_C void SetNoneVisible(); sl@0: IMPORT_C void SetTabsVisible(TBool aVisible); sl@0: IMPORT_C void SetSpacesVisible(TBool aVisible); sl@0: IMPORT_C void SetParagraphDelimitersVisible(TBool aVisible); sl@0: IMPORT_C void SetLineBreaksVisible(TBool aVisible); sl@0: IMPORT_C void SetPotentialHyphensVisible(TBool aVisible); sl@0: IMPORT_C void SetNonBreakingHyphensVisible(TBool aVisible); sl@0: IMPORT_C void SetNonBreakingSpacesVisible(TBool aVisible); sl@0: IMPORT_C void SetPageBreaksVisible(TBool aVisible); sl@0: sl@0: /** Tests whether all non-printing characters are visible. sl@0: @return ETrue if all non-printing characters are visible. EFalse if any or sl@0: all hidden. */ sl@0: inline TBool AllVisible()const{return iVisible==EFEverythingVisible;}; sl@0: sl@0: /** Tests whether all non-printing characters are hidden. sl@0: @return ETrue if all non-printing characters are hidden. EFalse if any are sl@0: visible. */ sl@0: inline TBool NoneVisible()const{return iVisible==EFNothingVisible;}; sl@0: sl@0: /** Tests whether tab stop characters are visible. sl@0: @return ETrue if tab stop characters are visible. EFalse if hidden. */ sl@0: inline TBool TabsVisible()const{return iVisible&EFTabsVisible;}; sl@0: sl@0: /** Tests whether space characters are visible. sl@0: sl@0: Note: To get the the visibility of non-breaking space characters, use sl@0: NonBreakingSpacesVisible() instead. sl@0: @return ETrue if space characters are visible. EFalse if hidden. */ sl@0: inline TBool SpacesVisible()const{return iVisible&EFSpacesVisible;}; sl@0: sl@0: /** Tests whether paragraph delimiters are visible. sl@0: @return ETrue if paragraph delimiters are visible. EFalse if hidden. */ sl@0: inline TBool ParagraphDelimitersVisible()const{return iVisible&EFParagraphDelimitersVisible;}; sl@0: sl@0: /** Tests whether forced line break characters are visible. sl@0: @return ETrue if forced line break characters are visible. EFalse if hidden. sl@0: */ sl@0: inline TBool LineBreaksVisible()const{return iVisible&EFLineBreaksVisible;}; sl@0: sl@0: /** Tests whether potential hyphen characters (inserted before a line break sl@0: within a word) are visible. sl@0: sl@0: @return ETrue if potential hyphen characters are visible. EFalse if hidden. sl@0: */ sl@0: inline TBool PotentialHyphensVisible()const{return iVisible&EFPotentialHyphensVisible;}; sl@0: sl@0: /** Tests whether non-breaking hyphens (enclosing word is always kept on sl@0: the same line) are visible. sl@0: @return ETrue if non-breaking hyphens are visible. EFalse if hidden. */ sl@0: inline TBool NonBreakingHyphensVisible()const{return iVisible&EFNonBreakingHyphensVisible;}; sl@0: sl@0: /** Tests whether non-breaking spaces are visible. sl@0: @return ETrue if non-breaking spaces are visible. EFalse if hidden. */ sl@0: inline TBool NonBreakingSpacesVisible()const{return iVisible&EFNonBreakingSpacesVisible;}; sl@0: sl@0: /** Tests whether page break characters are visible. sl@0: @return ETrue if page break characters are visible. EFalse if hidden. */ sl@0: inline TBool PageBreaksVisible()const{return iVisible&EFPageBreaksVisible;}; sl@0: sl@0: private: sl@0: TUint32 iVisible; sl@0: }; sl@0: sl@0: #endif sl@0: sl@0: