epoc32/include/txtstyle.inl
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// 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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
 
williamr@2
    17
williamr@2
    18
RParagraphStyleInfo::RParagraphStyleInfo()
williamr@2
    19
	: iStyle(NULL),iStyleForNextPara(NULL)
williamr@2
    20
/** This default C++ constructor is used to construct the object, initializing 
williamr@2
    21
both style pointers to NULL. */
williamr@2
    22
	{}
williamr@2
    23
williamr@2
    24
RParagraphStyleInfo::RParagraphStyleInfo(CParagraphStyle* aStyle,CParagraphStyle* aStyleForNextPara)
williamr@2
    25
	: iStyle(aStyle),iStyleForNextPara(aStyleForNextPara)
williamr@2
    26
/** The C++ constructor is used to construct the object with a pointer to the style 
williamr@2
    27
information for the current paragraph and optionally a pointer to the style 
williamr@2
    28
information for the next paragraph.
williamr@2
    29
williamr@2
    30
@param aStyle The style to apply to the current paragraph. 
williamr@2
    31
@param aStyleForNextPara Optionally, the style to apply to the next paragraph. 
williamr@2
    32
By default, NULL. */
williamr@2
    33
	{}
williamr@2
    34
williamr@2
    35
 
williamr@2
    36
williamr@2
    37
void RParagraphStyleInfo::Discard()
williamr@2
    38
/** Deletes the style pointer owned by the object. The pointer to the style for 
williamr@2
    39
the following paragraph is not deleted. */
williamr@2
    40
	{delete iStyle;}
williamr@2
    41
williamr@2
    42
williamr@2
    43
 
williamr@2
    44
williamr@2
    45
CCharFormatLayer* CParagraphStyle::CharFormatLayer()const
williamr@2
    46
/** Gets a pointer to the character format layer owned by the object.
williamr@2
    47
williamr@2
    48
Note
williamr@2
    49
williamr@2
    50
The style's character formatting is set and retrieved using this pointer.
williamr@2
    51
williamr@2
    52
@return Pointer to the style's global character format layer. */
williamr@2
    53
	{return iCharFormatLayer;}
williamr@2
    54
williamr@2
    55
 
williamr@2
    56
TInt CParagraphStyle::OutlineLevel()const
williamr@2
    57
/** Gets the style's outline level.
williamr@2
    58
williamr@2
    59
@return The style's outline level. */
williamr@2
    60
	{return iOutlineLevel;}
williamr@2
    61
williamr@2
    62
williamr@2
    63
 
williamr@2
    64
williamr@2
    65
void CParagraphStyle::SetOutlineLevel(TInt aOutlineLevel)
williamr@2
    66
/** Sets the style's outline level.
williamr@2
    67
williamr@2
    68
@param aOutlineLevel The style's new outline level. */
williamr@2
    69
	{iOutlineLevel=aOutlineLevel;}
williamr@2
    70
williamr@2
    71
williamr@2
    72
 
williamr@2
    73
williamr@2
    74
void CParagraphStyle::SetType(TUid aType)
williamr@2
    75
/** Sets the style's type UID. On construction, the style's type UID is initialized 
williamr@2
    76
to KUserDefinedParagraphStyleUid to distinguish it from ordinary paragraph 
williamr@2
    77
format layers, which have a type of KNormalParagraphStyleUid. This function 
williamr@2
    78
can be used to change it to another value.
williamr@2
    79
williamr@2
    80
@param aType The style's type UID. */
williamr@2
    81
	{iType=aType;}
williamr@2
    82
williamr@2
    83
williamr@2
    84
 
williamr@2
    85
CParagraphStyle* CParagraphStyle::CloneL()const
williamr@2
    86
/** Creates and returns a CParagraphStyle object which is a clone of the current 
williamr@2
    87
style.
williamr@2
    88
williamr@2
    89
@return Pointer to a clone of the current style. */
williamr@2
    90
	{return STATIC_CAST(CParagraphStyle*,DoCloneL());}
williamr@2
    91
williamr@2
    92
williamr@2
    93
 
williamr@2
    94
williamr@2
    95
const RParagraphStyleInfo& CStyleList::operator[](TInt aIndex)const
williamr@2
    96
/** Gets a style from the style list, from its index into the array. Two versions 
williamr@2
    97
are supplied. The compiler chooses the appropriate version based on the use 
williamr@2
    98
made of the returned reference. If it is used in an expression where the reference 
williamr@2
    99
can be modified, then the non-const version is chosen.
williamr@2
   100
williamr@2
   101
@param aIndex The index of the style into the list. The first style is at 
williamr@2
   102
position zero. Must be within the bounds of the array or a panic occurs. 
williamr@2
   103
@return A const reference to the style at position aIndex in the array. 
williamr@2
   104
@return A non-const reference to the style at position aIndex in the array. */
williamr@2
   105
/** Gets a style from the style list, from its index into the array. Two versions 
williamr@2
   106
are supplied. The compiler chooses the appropriate version based on the use 
williamr@2
   107
made of the returned reference. If it is used in an expression where the reference 
williamr@2
   108
can be modified, then the non-const version is chosen.
williamr@2
   109
williamr@2
   110
@param aIndex The index of the style into the list. The first style is at 
williamr@2
   111
position zero. Must be within the bounds of the array or a panic occurs. 
williamr@2
   112
@return A const reference to the style at position aIndex in the array. 
williamr@2
   113
@return A non-const reference to the style at position aIndex in the array. */
williamr@2
   114
	{return iList->At(aIndex);}
williamr@2
   115
williamr@2
   116
williamr@2
   117
RParagraphStyleInfo& CStyleList::operator[](TInt aIndex)
williamr@2
   118
	{return iList->At(aIndex);}
williamr@2
   119
williamr@2
   120
 
williamr@2
   121
williamr@2
   122
TInt CStyleList::Count()const
williamr@2
   123
/** Gets the number of styles in the style list.
williamr@2
   124
williamr@2
   125
@return The number of styles in the style list */
williamr@2
   126
	{return (iList) ? iList->Count() : 0;}