1.1 --- a/epoc32/include/txtglobl.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/txtglobl.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,118 @@
1.4 -txtglobl.h
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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 +#ifndef __TXTGLOBL_H__
1.21 +#define __TXTGLOBL_H__
1.22 +
1.23 +#include <e32std.h>
1.24 +#include <e32base.h>
1.25 +#include <txtlaydc.h>
1.26 +#include <txtmfmtx.h>
1.27 +#include <txtetext.h>
1.28 +
1.29 +
1.30 +// forward declarations
1.31 +class CParaFormatLayer;
1.32 +class CCharFormatLayer;
1.33 +class TCharFormatX;
1.34 +class TCharFormatXMask;
1.35 +
1.36 +
1.37 +// Globally formatted text.
1.38 +// Uses one instance of each a paragraph format and character format class; Each presents
1.39 +// the formatting applied to the total document contents. Both of the format classes used
1.40 +// may utilise layering of formats through 'based on' links to achieve full format specification.
1.41 +// These global layers are *never* owned by global text, merely referenced.
1.42 +
1.43 +/**
1.44 +Text with globally applied formatting.
1.45 +
1.46 +Global text uses a single set of paragraph format attributes to describe the
1.47 +appearance of every paragraph and a single set of character format attributes
1.48 +to describe the appearance of every character.
1.49 +
1.50 +The paragraph formatting is stored in a CParaFormatLayer and the character
1.51 +formatting is stored in a CCharFormatLayer. A format layer is a set of character
1.52 +or paragraph format attributes, which may own a pointer to another format
1.53 +layer. This pointer is called a based-on link. The effective formatting of
1.54 +a global text object is the set of attributes specified in its two format
1.55 +layers, as well as any attributes inherited from the layers' chain of based-on
1.56 +links. To get the effective formatting, the links are read in turn, so that
1.57 +each attribute's value is taken from the first layer in the chain in which
1.58 +it has been set. Use GetCharFormat() and GetParaFormatL() to get the text
1.59 +object's effective formatting.
1.60 +
1.61 +A global text object references the two format layers; it does not own them.
1.62 +This allows more than one global text object to use the same formatting. The
1.63 +format layers may be modified (see ApplyParaFormatL() and ApplyCharFormatL())
1.64 +or replaced (see SetGlobalParaFormat() and SetGlobalCharFormat()) during the
1.65 +text object's lifetime.
1.66 +@publishedAll
1.67 +@released
1.68 +*/
1.69 +class CGlobalText : public CPlainText,public MLayDoc,public MFormatText
1.70 + {
1.71 +public:
1.72 +// Special member functions
1.73 + // Create new global text component whose sole content is an end-of-document character.
1.74 + IMPORT_C static CGlobalText* NewL(const CParaFormatLayer* aGlobalParaLayer,const CCharFormatLayer* aGlobalCharLayer,
1.75 + TDocumentStorage aStorage=ESegmentedStorage,TInt aDefaultTextGranularity=EDefaultTextGranularity);
1.76 + // Restore a new global text, that uses the specified global layers.
1.77 + IMPORT_C static CGlobalText* NewL(const CStreamStore& aStore,TStreamId aStreamId,
1.78 + const CParaFormatLayer* aGlobalParaLayer,const CCharFormatLayer* aGlobalCharLayer,
1.79 + MTextFieldFactory* aFieldFactory=NULL,
1.80 + TDocumentStorage=ESegmentedStorage);
1.81 + IMPORT_C ~CGlobalText();
1.82 +// Global Format Layers
1.83 + IMPORT_C void SetGlobalParaFormat(const CParaFormatLayer* aParaFormatLayer);
1.84 + IMPORT_C void SetGlobalCharFormat(const CCharFormatLayer* aCharFormatLayer);
1.85 + inline const CParaFormatLayer* GlobalParaFormatLayer()const;
1.86 + inline const CCharFormatLayer* GlobalCharFormatLayer()const;
1.87 +// MLayDoc implementation
1.88 + IMPORT_C virtual TInt LdDocumentLength()const;
1.89 + IMPORT_C virtual TInt LdToParagraphStart(TInt& aCurrentPos)const;
1.90 + IMPORT_C virtual void GetParagraphFormatL(CParaFormat* aFormat,TInt aPos)const;
1.91 + IMPORT_C virtual void GetChars(TPtrC& aView,TCharFormat& aFormat,TInt aStartPos)const;
1.92 + IMPORT_C virtual TInt GetPictureSizeInTwips(TSize& aSize, TInt aPos)const;
1.93 + IMPORT_C virtual CPicture* PictureHandleL(TInt aPos,MLayDoc::TForcePictureLoad aForceLoad)const;
1.94 + IMPORT_C virtual TBool EnquirePageBreak(TInt aPos,TInt aLength=0)const;
1.95 + IMPORT_C virtual TBool SelectParagraphLabel(TInt aPos);
1.96 + IMPORT_C virtual void CancelSelectLabel();
1.97 +// MFormatText implementation
1.98 + IMPORT_C virtual void GetParaFormatL(CParaFormat* aFormat,TParaFormatMask& aVaries,TInt aPos,TInt aLength,
1.99 + CParaFormat::TParaFormatGetMode aMode=CParaFormat::EAllAttributes)const;
1.100 + IMPORT_C virtual void ApplyParaFormatL(const CParaFormat* aFormat,const TParaFormatMask& aMask,TInt aPos,TInt aLength);
1.101 + IMPORT_C virtual void GetCharFormat(TCharFormat& aFormat,TCharFormatMask& aVaries,TInt aPos,TInt aLength)const;
1.102 + IMPORT_C virtual void ApplyCharFormatL(const TCharFormat& aFormat,const TCharFormatMask& aMask,TInt aPos,TInt aLength);
1.103 +protected:
1.104 + IMPORT_C CGlobalText();
1.105 + IMPORT_C CGlobalText(const CParaFormatLayer* aGlobalParaLayer,
1.106 + const CCharFormatLayer* aGlobalCharLayer);
1.107 +private:
1.108 + CGlobalText(const CGlobalText& aGlobalText);
1.109 + CGlobalText& operator=(const CGlobalText& aGlobalText);
1.110 +protected:
1.111 + const CParaFormatLayer* iGlobalParaFormatLayer; // the global paragraph format layer; not owned
1.112 + const CCharFormatLayer* iGlobalCharFormatLayer; // the global character format layer; not owned
1.113 + __DECLARE_TEST;
1.114 +private:
1.115 + void* iReserved_2;
1.116 + };
1.117 +
1.118 +
1.119 +#include <txtglobl.inl>
1.120 +
1.121 +
1.122 +#endif