epoc32/include/txtglobl.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h) This is the epoc32/include tree with the "platform" subtrees removed, and all but a selected few mbg and rsg files removed.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
     1
/*
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
     2
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
     3
* All rights reserved.
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
     4
* This component and the accompanying materials are made available
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
     6
* which accompanies this distribution, and is available
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
     8
*
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
     9
* Initial Contributors:
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    10
* Nokia Corporation - initial contribution.
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    11
*
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    12
* Contributors:
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    13
*
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    14
* Description: 
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    15
*
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    16
*/
837f303aceeb Current Symbian^3 public API header files (from PDK 3.0.h)
William Roberts <williamr@symbian.org>
parents: 2
diff changeset
    17
2
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    18
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    19
#ifndef __TXTGLOBL_H__
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    20
#define __TXTGLOBL_H__
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    21
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    22
#include <e32std.h>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    23
#include <e32base.h>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    24
#include <txtlaydc.h>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    25
#include <txtmfmtx.h>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    26
#include <txtetext.h>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    27
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    28
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    29
// forward declarations
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    30
class CParaFormatLayer;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    31
class CCharFormatLayer;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    32
class TCharFormatX;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    33
class TCharFormatXMask;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    34
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    35
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    36
// Globally formatted text.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    37
// Uses one instance of each a paragraph format and character format class; Each presents
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    38
// the formatting applied to the total document contents.  Both of the format classes used
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    39
// may utilise layering of formats through 'based on' links to achieve full format specification.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    40
// These global layers are *never* owned by global text, merely referenced.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    41
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    42
/** 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    43
Text with globally applied formatting. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    44
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    45
Global text uses a single set of paragraph format attributes to describe the 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    46
appearance of every paragraph and a single set of character format attributes 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    47
to describe the appearance of every character.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    48
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    49
The paragraph formatting is stored in a CParaFormatLayer and the character 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    50
formatting is stored in a CCharFormatLayer. A format layer is a set of character 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    51
or paragraph format attributes, which may own a pointer to another format 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    52
layer. This pointer is called a based-on link. The effective formatting of 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    53
a global text object is the set of attributes specified in its two format 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    54
layers, as well as any attributes inherited from the layers' chain of based-on 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    55
links. To get the effective formatting, the links are read in turn, so that 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    56
each attribute's value is taken from the first layer in the chain in which 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    57
it has been set. Use GetCharFormat() and GetParaFormatL() to get the text 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    58
object's effective formatting.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    59
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    60
A global text object references the two format layers; it does not own them. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    61
This allows more than one global text object to use the same formatting. The 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    62
format layers may be modified (see ApplyParaFormatL() and ApplyCharFormatL()) 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    63
or replaced (see SetGlobalParaFormat() and SetGlobalCharFormat()) during the 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    64
text object's lifetime. 
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    65
@publishedAll
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    66
@released
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    67
*/
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    68
class CGlobalText : public CPlainText,public MLayDoc,public MFormatText
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    69
	{
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    70
public:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    71
//	Special member functions
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    72
	// Create new global text component whose sole content is an end-of-document character.	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    73
	IMPORT_C static CGlobalText* NewL(const CParaFormatLayer* aGlobalParaLayer,const CCharFormatLayer* aGlobalCharLayer,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    74
									 TDocumentStorage aStorage=ESegmentedStorage,TInt aDefaultTextGranularity=EDefaultTextGranularity);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    75
	// Restore a new global text, that uses the specified global layers.
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    76
	IMPORT_C static CGlobalText* NewL(const CStreamStore& aStore,TStreamId aStreamId,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    77
									  const CParaFormatLayer* aGlobalParaLayer,const CCharFormatLayer* aGlobalCharLayer,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    78
									  MTextFieldFactory* aFieldFactory=NULL,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    79
									  TDocumentStorage=ESegmentedStorage);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    80
	IMPORT_C ~CGlobalText();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    81
//	Global Format Layers
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    82
	IMPORT_C void SetGlobalParaFormat(const CParaFormatLayer* aParaFormatLayer);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    83
	IMPORT_C void SetGlobalCharFormat(const CCharFormatLayer* aCharFormatLayer);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    84
	inline const CParaFormatLayer* GlobalParaFormatLayer()const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    85
	inline const CCharFormatLayer* GlobalCharFormatLayer()const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    86
//	MLayDoc implementation
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    87
	IMPORT_C virtual TInt LdDocumentLength()const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    88
	IMPORT_C virtual TInt LdToParagraphStart(TInt& aCurrentPos)const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    89
	IMPORT_C virtual void GetParagraphFormatL(CParaFormat* aFormat,TInt aPos)const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    90
	IMPORT_C virtual void GetChars(TPtrC& aView,TCharFormat& aFormat,TInt aStartPos)const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    91
	IMPORT_C virtual TInt GetPictureSizeInTwips(TSize& aSize, TInt aPos)const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    92
	IMPORT_C virtual CPicture* PictureHandleL(TInt aPos,MLayDoc::TForcePictureLoad aForceLoad)const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    93
	IMPORT_C virtual TBool EnquirePageBreak(TInt aPos,TInt aLength=0)const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    94
	IMPORT_C virtual TBool SelectParagraphLabel(TInt aPos);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    95
	IMPORT_C virtual void CancelSelectLabel();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    96
//  MFormatText implementation	
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    97
	IMPORT_C virtual void GetParaFormatL(CParaFormat* aFormat,TParaFormatMask& aVaries,TInt aPos,TInt aLength,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    98
										CParaFormat::TParaFormatGetMode aMode=CParaFormat::EAllAttributes)const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
    99
	IMPORT_C virtual void ApplyParaFormatL(const CParaFormat* aFormat,const TParaFormatMask& aMask,TInt aPos,TInt aLength);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   100
	IMPORT_C virtual void GetCharFormat(TCharFormat& aFormat,TCharFormatMask& aVaries,TInt aPos,TInt aLength)const;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   101
	IMPORT_C virtual void ApplyCharFormatL(const TCharFormat& aFormat,const TCharFormatMask& aMask,TInt aPos,TInt aLength);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   102
protected:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   103
	IMPORT_C CGlobalText();
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   104
	IMPORT_C CGlobalText(const CParaFormatLayer* aGlobalParaLayer,
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   105
						 const CCharFormatLayer* aGlobalCharLayer);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   106
private:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   107
	CGlobalText(const CGlobalText& aGlobalText);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   108
	CGlobalText& operator=(const CGlobalText& aGlobalText);
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   109
protected:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   110
	const CParaFormatLayer* iGlobalParaFormatLayer;  // the global paragraph format layer; not owned
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   111
	const CCharFormatLayer* iGlobalCharFormatLayer;  // the global character format layer; not owned
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   112
	__DECLARE_TEST;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   113
private:
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   114
	void* iReserved_2;
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   115
	};
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   116
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   117
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   118
#include <txtglobl.inl>
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   119
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   120
2fe1408b6811 Final list of Symbian^2 public API header files
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   121
#endif