2017-09-14 18:59:07 -05:00
|
|
|
// Copyright 2017 Baliance. All rights reserved.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by the terms of the Affero GNU General
|
|
|
|
// Public License version 3.0 as published by the Free Software Foundation and
|
|
|
|
// appearing in the file LICENSE included in the packaging of this file. A
|
|
|
|
// commercial license can be purchased by contacting sales@baliance.com.
|
|
|
|
|
|
|
|
package formula
|
|
|
|
|
|
|
|
// Context is a formula execution context. Formula evaluation uses the context
|
|
|
|
// to retreive information from sheets.
|
|
|
|
type Context interface {
|
|
|
|
// Cell returns the result of evaluating a cell.
|
|
|
|
Cell(ref string, ev Evaluator) Result
|
2017-09-16 10:25:01 -05:00
|
|
|
|
|
|
|
// Sheet returns an evaluation context for a given sheet name. This is used
|
|
|
|
// when evaluating cells that pull data from other sheets (e.g. ='Sheet 2'!A1)
|
|
|
|
Sheet(name string) Context
|
2017-09-17 12:59:57 -05:00
|
|
|
|
|
|
|
// NamedRange returns a named range.
|
|
|
|
NamedRange(name string) Reference
|
2017-10-01 19:16:11 -05:00
|
|
|
|
|
|
|
// SetOffset is used so that the Context can evaluate cell references
|
|
|
|
// differently when they are not absolute (e.g. not like '$A$5'). See the
|
|
|
|
// shared formula support in Cell for usage.
|
|
|
|
SetOffset(col, row uint32)
|
2017-09-14 18:59:07 -05:00
|
|
|
}
|