Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: SHGAPI.H
Link against: sheng.lib

This item is not part of the S60 3rd Edition SDK for Symbian OS, Feature Pack 2.

Class CShgWorkSheet

class CShgWorkSheet : public CBase, public MShgCellReader;

Description

A spreadsheet engine worksheet.

Derivation

Members

Defined in CShgWorkSheet:
AddCellInsideEditOperationL(), BottomRight(), CellWasChangedByLastEditOperation(), ClearL(), ClearL(), CopyL(), CopyL(), DefaultAdditionalData(), DeleteCellInsideEditOperationL(), EClearAdditionalData, EClearAll, EClearContents, EDeleteCellsInRangeObliterated, EDisallowCellsInRangeObliterated, EPasteActionAdd, EPasteActionDivide, EPasteActionMultiply, EPasteActionOverwrite, EPasteActionSubtract, EPasteAdditionalData, EPasteAll, EPasteFormula, EPasteValue, ESearchDirectionBackwards, ESearchDirectionForwards, ESearchOrderByColumn, ESearchOrderByRow, ESearchThroughAll, ESearchThroughFormulae, ESearchThroughValues, EShiftHorizontally, EShiftVertically, ESortOrientationLeftToRight, ESortOrientationTopToBottom, EffectiveCharFormat(), EffectiveCharFormatRead(), EffectiveNumberFormat(), EffectiveNumberFormatRead(), EffectiveParaFormat(), EffectiveParaFormatRead(), GridLay(), GridTable(), IsAnyCellInRangeProtected(), IsCellProtected(), IsLocked(), Lock(), MShgReadCell(), Name(), PasteL(), ProtectL(), ProtectL(), ReadFormulaCellTextL(), ReadShgCell(), SSortKey, SearchL(), SearchL(), SetCellL(), SetNameL(), SetShowZeros(), SheetEngine(), ShiftCellsL(), ShowZeros(), SortL(), TClearParameters, TPasteAction, TPasteWhat, TSearchDirection, TSearchOrder, TSearchThroughWhat, TShiftDirection, TShiftRule, TSortOrientation, UpdateAdditionalDataL(), UpdateAdditionalDataL(), WorkSheetNo(), ~CShgWorkSheet()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CShgWorkSheet()

virtual ~CShgWorkSheet();

Description

Destructor.

[Top]


Member functions


SortL()

IMPORT_C TShgError SortL(const TRangeRef &aRangeRef, const CArrayFix< SSortKey > *aArrayOfSortKeys, TSortOrientation aSortOrientation);

Description

Sorts a range of cells.

Parameters

const TRangeRef &aRangeRef

Range of cells to sort

const CArrayFix< SSortKey > *aArrayOfSortKeys

Array of keys by which to sort. The function applies the first key in the array to the first column/row in the range, the second key to the second column/row, etc.

TSortOrientation aSortOrientation

Sort orientation (columns or rows)

Return value

TShgError

EShgNoError if successful, otherwise an error code


SearchL()

IMPORT_C const TShgCell *SearchL(const TDesC &aTextToFind, const CArrayFix< TRangeRef > *aRangeArrayToSearchIn, const TCellRef &aStartCell, TBool aIncludeStartCell, TBool aSearchCyclically, TSearchOrder aSearchOrder, TSearchDirection aSearchDirection, TUint32 aWhatToSearchThrough, TBool aMatchCase, TBool aFindEntireCellOnly) const;

Description

Searches an array of ranges for some specified text.

Parameters

const TDesC &aTextToFind

Text to search for

const CArrayFix< TRangeRef > *aRangeArrayToSearchIn

Array of cell ranges that defines the search area

const TCellRef &aStartCell

Cell at which to start the search

TBool aIncludeStartCell

If true, include aStartCell in the search

TBool aSearchCyclically

If true, wrap around from end of search area to the beginning

TSearchOrder aSearchOrder

Search by row or column

TSearchDirection aSearchDirection

Search forwards or backwards

TUint32 aWhatToSearchThrough

Search cells values and/or formulae. This is a bitmask of TSearchThroughWhat values.

TBool aMatchCase

If true, match case

TBool aFindEntireCellOnly

If true, only match with entire cells

Return value

const TShgCell *

If successful, a cell matching the search criteria, else NULL


SearchL()

IMPORT_C const TShgCell *SearchL(const TDesC &aTextToFind, const TRangeRef &aRangeToSearchIn, const TCellRef &aStartCell, TBool aIncludeStartCell, TBool aSearchCyclically, TSearchOrder aSearchOrder, TSearchDirection aSearchDirection, TUint32 aWhatToSearchThrough, TBool aMatchCase, TBool aFindEntireCellOnly) const;

Description

Searches a range for some specified text.

Parameters

const TDesC &aTextToFind

Text to search for

const TRangeRef &aRangeToSearchIn

Cell range that defines the search area

const TCellRef &aStartCell

Cell at which to start the search

TBool aIncludeStartCell

If true, include aStartCell in the search

TBool aSearchCyclically

If true, wrap around from end of search area to the beginning

TSearchOrder aSearchOrder

Search by row or column

TSearchDirection aSearchDirection

Search forwards or backwards

TUint32 aWhatToSearchThrough

Search cells values and/or formulae. This is a bitmask of TSearchThroughWhat values.

TBool aMatchCase

If true, match case

TBool aFindEntireCellOnly

If true, only match with entire cells

Return value

const TShgCell *

If successful, a cell matching the search criteria, else NULL


ShiftCellsL()

IMPORT_C TShgError ShiftCellsL(const TCellRef &aReferenceCell, TInt aShiftAmount, TInt aExtentOfBlockShifted, TShiftDirection aShiftDirection, TShiftRule aShiftRule);

Description

Shifts some specified rows or columns.

The rows/columns to move are specified by an origin cell, plus the number of rows/columns from this point. The movement is specified by an amount and a direction.

!! disable undo until the grid-lay part can be undone too (V1.1?)

Parameters

const TCellRef &aReferenceCell

Origin of cells to move

TInt aShiftAmount

Amount of rows/columns to move the cells

TInt aExtentOfBlockShifted

Number of rows/columns to shift

TShiftDirection aShiftDirection

Shift direction

TShiftRule aShiftRule

Flag to decide whether to allow existing cells to be overwritten

Return value

TShgError

EShgNoError if successful, otherwise an error code


ClearL()

IMPORT_C TShgError ClearL(const TCellRef &aCell, TUint32 aWhatToClear=EClearAll);

Description

Clears a cell.

Parameters

const TCellRef &aCell

Cell to clear

TUint32 aWhatToClear

Clear contents and/or additional data flag. This is a bitmask of TClearParameters values.

Return value

TShgError

EShgNoError if successful, otherwise an error code


ClearL()

IMPORT_C TShgError ClearL(const CArrayFix< TRangeRef > *aRangeArray, TUint32 aWhatToClear=EClearAll);

Description

Clears an array of ranges.

Parameters

const CArrayFix< TRangeRef > *aRangeArray

Array of ranges to clear

TUint32 aWhatToClear

Clear contents and/or additional data flag. This is a bitmask of TClearParameters values.

Return value

TShgError

EShgNoError if successful, otherwise an error code


CellWasChangedByLastEditOperation()

IMPORT_C TBool CellWasChangedByLastEditOperation(const TCellRef &aCellRef) const;

Description

Tests if a specified cell was changed by the last edit operation.

Parameters

const TCellRef &aCellRef

Cell to test

Return value

TBool

True if cell was changed, else false


UpdateAdditionalDataL()

IMPORT_C TShgError UpdateAdditionalDataL(const TCellRef &aCell, const CShgCellAdditionalData *aData);

Description

Updates additional data (formatting information) for a specified cell.

Parameters

const TCellRef &aCell

Cell to update

const CShgCellAdditionalData *aData

New additional data

Return value

TShgError

EShgNoError if successful, otherwise an error code


UpdateAdditionalDataL()

IMPORT_C TShgError UpdateAdditionalDataL(const CArrayFix< TRangeRef > *aRangeArray, const CShgCellAdditionalData *aData);

Description

Updates additional data for a specified array of ranges.

Parameters

const CArrayFix< TRangeRef > *aRangeArray

Array of ranges to update

const CShgCellAdditionalData *aData

New additional data

Return value

TShgError

EShgNoError if successful, otherwise an error code


EffectiveParaFormatRead()

IMPORT_C const CParaFormatLayer *EffectiveParaFormatRead(const TCellRef &aCell) const;

Description

Gets the paragraph layer formatting that applies to a specified cell.

Parameters

const TCellRef &aCell

Cell to query

Return value

const CParaFormatLayer *

Cell's paragraph layer formatting


EffectiveParaFormat()

IMPORT_C const CParaFormatLayer *EffectiveParaFormat(const TCellRef &aCell, const TShgCell *aShgCell) const;

Description

Gets the paragraph layer formatting that applies to a cell, specified by reference or by object.

Parameters

const TCellRef &aCell

Cell to query if aShgCell is NULL

const TShgCell *aShgCell

Cell to query. This can be NULL.

Return value

const CParaFormatLayer *

Cell's paragraph layer formatting


EffectiveCharFormatRead()

IMPORT_C const CCharFormatLayer *EffectiveCharFormatRead(const TCellRef &aCell) const;

Description

Gets the character layer formatting that applies to a specified cell.

Parameters

const TCellRef &aCell

Cell to query

Return value

const CCharFormatLayer *

Cell's character layer formatting


EffectiveCharFormat()

IMPORT_C const CCharFormatLayer *EffectiveCharFormat(const TCellRef &aCell, const TShgCell *aShgCell) const;

Description

Gets the character layer formatting that applies to a cell, specified by reference or by object.

Parameters

const TCellRef &aCell

Cell to query if aShgCell is NULL

const TShgCell *aShgCell

Cell to query. This can be NULL.

Return value

const CCharFormatLayer *

Cell's character layer formatting


EffectiveNumberFormatRead()

IMPORT_C TShgNumberFormat EffectiveNumberFormatRead(const TCellRef &aCell) const;

Description

Gets the number format for a specified cell.

Parameters

const TCellRef &aCell

Cell to query

Return value

TShgNumberFormat

Cell's number format


EffectiveNumberFormat()

IMPORT_C TShgNumberFormat EffectiveNumberFormat(const TCellRef &aCell, const TShgCell *aShgCell) const;

Description

Gets the number format for a cell, specified by reference or by object.

Parameters

const TCellRef &aCell

Cell to query if aShgCell is NULL

const TShgCell *aShgCell

Cell to query. This can be NULL.

Return value

TShgNumberFormat

Cell's number format


ProtectL()

IMPORT_C TShgError ProtectL(const TCellRef &aCell, TBool aProtected);

Description

Sets a specified cell to be protected.

Parameters

const TCellRef &aCell

Cell to set

TBool aProtected

True to set the cell to protected, false to set it to unprotected

Return value

TShgError

EShgNoError if successful, otherwise an error code


ProtectL()

IMPORT_C TShgError ProtectL(const CArrayFix< TRangeRef > *aRangeArray, TBool aProtected);

Description

Protects a specified array of ranges.

Parameters

const CArrayFix< TRangeRef > *aRangeArray

Ranges to set

TBool aProtected

True to set the ranges to protected, false to set them to unprotected

Return value

TShgError

EShgNoError if successful, otherwise an error code


IsCellProtected()

IMPORT_C TBool IsCellProtected(const TCellRef &aCell) const;

Description

Tests if a specified cell is protected.

Parameters

const TCellRef &aCell

Cell to query.

Return value

TBool

True if the cell is protected, otherwise false.


IsAnyCellInRangeProtected()

IMPORT_C TBool IsAnyCellInRangeProtected(const TRangeRef &aRange) const;

Description

Tests if any cell in a specified range is protected.

Parameters

const TRangeRef &aRange

Range to query

Return value

TBool

True if any cell is protected, otherwise false


Lock()

IMPORT_C void Lock(TBool aLocked);

Description

Locks/unlocks the worksheet.

Parameters

TBool aLocked

True to lock the worksheet, false to unlock


IsLocked()

IMPORT_C TBool IsLocked() const;

Description

Tests if the worksheet is locked.

Return value

TBool

True if the worksheet is locked, false if unlocked


SetShowZeros()

IMPORT_C void SetShowZeros(TBool aShowZeros);

Description

Sets whether zero values should be displayed.

Parameters

TBool aShowZeros

True if zero values should be displayed


ShowZeros()

IMPORT_C TBool ShowZeros() const;

Description

Gets whether zero values should be displayed.

Return value

TBool

True if zero values should be displayed


GridTable()

IMPORT_C MGridTable *GridTable() const;

Description

Gets the worksheet as a Grid API table.

Return value

MGridTable *

Grid API table


SheetEngine()

IMPORT_C CSheetEngine *SheetEngine() const;

Description

Gets the spreadsheet engine used by the worksheet.

Return value

CSheetEngine *

Spreadsheet engine


ReadShgCell()

IMPORT_C TShgCell *ReadShgCell(const TCellRef &aCellRef) const;

Description

Gets a specified cell.

Parameters

const TCellRef &aCellRef

Cell reference

Return value

TShgCell *

The cell identified by aCellRef


ReadFormulaCellTextL()

IMPORT_C TPtrC ReadFormulaCellTextL(const TShgCell &aCell) const;

Description

Gets the formula text for a specified cell.

The function panics if the cell does not contain a formula.

Parameters

const TShgCell &aCell

Cell to query

Return value

TPtrC

Formula text


SetCellL()

IMPORT_C TShgError SetCellL(const TCellRef &aCellRef, const TDesC &aText);

Description

Sets cell contents.

Parameters

const TCellRef &aCellRef

Cell to set

const TDesC &aText

New cell contents

Return value

TShgError

EShgNoError if successful, otherwise an error code


AddCellInsideEditOperationL()

IMPORT_C TShgError AddCellInsideEditOperationL(const TShgCell &aCell);

Description

Adds a cell to a worksheet, assuming an edit operation is in progress.

It assumes that CSheetEngine::StartEditOperation() and CSheetEngine::EndEditOperationL() are called around this.

Parameters

const TShgCell &aCell

Cell to add

Return value

TShgError

EShgNoError if successful, otherwise an error code


DeleteCellInsideEditOperationL()

IMPORT_C TShgError DeleteCellInsideEditOperationL(const TCellRef &aCellRef);

Description

Deletes a cell from a worksheet, assuming an edit operation is in progress.

Parameters

const TCellRef &aCellRef

Cell to delete

Return value

TShgError

EShgNoError if successful, otherwise an error code


SetNameL()

IMPORT_C void SetNameL(const TDesC &aName);

Description

Sets the worksheet name.

Parameters

const TDesC &aName

Worksheet name


Name()

IMPORT_C const TPtrC Name() const;

Description

Gets the worksheet name.

Return value

const TPtrC

Worksheet name


WorkSheetNo()

IMPORT_C TInt WorkSheetNo() const;

Description

Gets the worksheet number.

Return value

TInt

Worksheet number


BottomRight()

IMPORT_C TCellRef BottomRight() const;

Description

Gets the cell at the bottom right of the worksheet.

Return value

TCellRef

Cell at the bottom right of the worksheet


GridLay()

IMPORT_C CGridLay *GridLay() const;

Description

Gets the worksheet as a Grid API layer object.

Return value

CGridLay *

Grid layer object


DefaultAdditionalData()

IMPORT_C const CShgCellAdditionalData *DefaultAdditionalData() const;

Description

Gets default additional data for the worksheet.

Return value

const CShgCellAdditionalData *

Default additional data


PasteL()

IMPORT_C TShgError PasteL(TRangeRef &aBounds, const TRangeRef &aDestination, const CStreamStore &aStore, const CStreamDictionary &aDictionary, TBool aSkipBlanks=EFalse, TUint32 aWhatToPaste=EPasteAll, TPasteAction aPasteAction=EPasteActionOverwrite);

Description

Paste data from the clipboard into the worksheet.

The data can be plain text or spreadsheet engine cells.

Parameters

TRangeRef &aBounds

On return, range affected by the paste operation

const TRangeRef &aDestination

Destination range

const CStreamStore &aStore

Store from which to read data

const CStreamDictionary &aDictionary

Dictionary from which to read stream IDs

TBool aSkipBlanks

If true, do not paste blank cells

TUint32 aWhatToPaste

Flag to control which of values/formulae/additional data are pasted. This is a bitmask of TPasteWhat flags.

TPasteAction aPasteAction

Flag to control whether pasting overwrites or manipulates existing data

Return value

TShgError

EShgNoError if successful, otherwise an error code


CopyL()

IMPORT_C void CopyL(CStreamStore &aStore, CStreamDictionary &aDictionary, const TCellRef &aCell) const;

Description

Copies a cell to the clipboard.

Parameters

CStreamStore &aStore

Store to write to

CStreamDictionary &aDictionary

Stream dictionary to write to

const TCellRef &aCell

Cell to copy


CopyL()

IMPORT_C void CopyL(CStreamStore &aStore, CStreamDictionary &aDictionary, const CArrayFix< TRangeRef > *aRangeArray) const;

Description

Copies an array of ranges to the clipboard.

Parameters

CStreamStore &aStore

Store to write to

CStreamDictionary &aDictionary

Stream dictionary to write to

const CArrayFix< TRangeRef > *aRangeArray

Ranges to copy


MShgReadCell()

virtual TShgCell *MShgReadCell(const TCellRef &aCellRef) const;

Description

Gets a specified cell.

Parameters

const TCellRef &aCellRef

Cell reference

Return value

TShgCell *

The cell identified by aCellRef

[Top]


Member structures


Struct SSortKey

struct SSortKey;

Description

Defines keys for sorting operations.

Members

Defined in CShgWorkSheet::SSortKey:
EDirectionAscending, EDirectionDescending, TDirection, iCaseSensitive, iCellRefDimensionPerpendicularToSort, iDirection

Member enumerations


Enum TDirection

TDirection

Description

Sort order.

EDirectionAscending

Ascending sort order.

EDirectionDescending

Descending sort order.

Member data


iCellRefDimensionPerpendicularToSort

TInt iCellRefDimensionPerpendicularToSort;

Description

Number of row or column, depending on which is perpendicular to the sort.


iDirection

TDirection iDirection;

Description

Sort order.


iCaseSensitive

TBool iCaseSensitive;

Description

If true, sorting is case-sensitive

[Top]


Member enumerations


Enum TSearchOrder

TSearchOrder

Description

Search order.

ESearchOrderByRow

Search by rows.

ESearchOrderByColumn

Search by columns.


Enum TSearchDirection

TSearchDirection

Description

Search direction.

ESearchDirectionForwards

Search forwards.

ESearchDirectionBackwards

Search backwards.


Enum TSearchThroughWhat

TSearchThroughWhat

Description

Search content flags.

ESearchThroughFormulae

Search formulae only.

ESearchThroughValues

Search values only.

ESearchThroughAll

Search formulae and values.


Enum TShiftDirection

TShiftDirection

Description

Cell shift operation directions.

EShiftVertically

Shift vertically.

EShiftHorizontally

Shift horizontally.


Enum TShiftRule

TShiftRule

Description

Cell shift operation rules.

EDeleteCellsInRangeObliterated

Allow existing cells to be overwritten.

EDisallowCellsInRangeObliterated

Do not allow existing cells to be overwritten.


Enum TClearParameters

TClearParameters

Description

Cell clear operation flags.

EClearContents

Clear cell contents.

EClearAdditionalData

Clear cell additional data.

EClearAll

Clear cell contents and additional data.


Enum TPasteWhat

TPasteWhat

Description

Cell paste operation content flags.

EPasteFormula

Paste formula only.

EPasteValue

Paste value only.

EPasteAdditionalData

Paste additional data only.

EPasteAll

Paste all.


Enum TPasteAction

TPasteAction

Description

Cell paste action flags.

EPasteActionOverwrite

Overwrite existing data.

EPasteActionAdd

Result is the addition of the copied values to the existing values.

EPasteActionSubtract

Result is the subtraction of the copied values from the existing values.

EPasteActionMultiply

Result is the multiplication of the copied values by the existing values.

EPasteActionDivide

Result is the division of the existing values by the copied values.


Enum TSortOrientation

TSortOrientation

Description

Sort orientation flags.

ESortOrientationTopToBottom

Sort vertically.

ESortOrientationLeftToRight

Sort horizontally.