2019-07-25 19:43:46 +03:00
|
|
|
// Copyright 2017 FoxyUtils ehf. All rights reserved.
|
2017-09-04 17:16:05 -05:00
|
|
|
//
|
|
|
|
// 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
|
Functions2 (#348)
* MATCH, IFS, MAXA, MINA
* OFFSET fixed
* ISBLANK, ISERR, ISERROR, ISEVEN ,ISFORMULA, ISNONTEXT, ISNUMBER, ISODD, ISTEXT
* ISLEAPYEAR, ISLOGICAL, ISNA, ISREF
* FIND, FINDB
* SEARCH, SEARCHB
* CONCAT, CONCATENATE
* YEAR, YEARFRAC
* CONCAT is fixed, now TRUE and FALSE are concatenated instead of 1 and 0 in case of boolean results
* NOW, TODAY, TIME, TIMEVALUE
* DATE
* DATEDIF
2019-11-21 02:21:00 +03:00
|
|
|
// commercial license can be purchased on https://unidoc.io.
|
2017-09-04 17:16:05 -05:00
|
|
|
|
|
|
|
package spreadsheet
|
|
|
|
|
2017-09-11 18:31:29 -05:00
|
|
|
import (
|
2019-05-04 11:18:06 +03:00
|
|
|
"github.com/unidoc/unioffice/measurement"
|
2017-09-11 18:31:29 -05:00
|
|
|
)
|
|
|
|
|
2017-09-04 17:16:05 -05:00
|
|
|
// Anchor is the interface implemented by anchors. It's modeled after the most
|
|
|
|
// common anchor (Two cell variant with a from/to position), but will also be
|
|
|
|
// used for one-cell anchors. In that case the only non-noop methods are
|
2017-09-11 18:31:29 -05:00
|
|
|
// TopLeft/MoveTo/SetColOffset/SetRowOffset.
|
2017-09-04 17:16:05 -05:00
|
|
|
type Anchor interface {
|
2017-09-11 18:31:29 -05:00
|
|
|
// BottomRight returns the CellMaker for the bottom right corner of the
|
|
|
|
// anchor.
|
2017-09-04 17:16:05 -05:00
|
|
|
BottomRight() CellMarker
|
2017-09-11 18:31:29 -05:00
|
|
|
// TopLeft returns the CellMaker for the top left corner of the anchor.
|
2017-09-04 17:16:05 -05:00
|
|
|
TopLeft() CellMarker
|
2017-09-11 18:31:29 -05:00
|
|
|
// MoveTo repositions the anchor without changing the objects size.
|
2017-09-04 17:16:05 -05:00
|
|
|
MoveTo(col, row int32)
|
2017-09-11 18:31:29 -05:00
|
|
|
|
|
|
|
// SetWidth sets the width of the anchored object. It is not compatible with
|
|
|
|
// SetWidthCells.
|
|
|
|
SetWidth(w measurement.Distance)
|
|
|
|
// SetWidthCells sets the height the anchored object by moving the right
|
|
|
|
// hand side. It is not compatible with SetWidth.
|
|
|
|
SetWidthCells(w int32)
|
|
|
|
|
|
|
|
// SetHeight sets the height of the anchored object. It is not compatible
|
|
|
|
// with SetHeightCells.
|
|
|
|
SetHeight(w measurement.Distance)
|
|
|
|
// SetHeightCells sets the height the anchored object by moving the bottom.
|
|
|
|
// It is not compatible with SetHeight.
|
|
|
|
SetHeightCells(h int32)
|
|
|
|
|
|
|
|
// SetColOffset sets the column offset of the top-left anchor.
|
|
|
|
SetColOffset(m measurement.Distance)
|
|
|
|
// SetRowOffset sets the row offset of the top-left anchor.
|
|
|
|
SetRowOffset(m measurement.Distance)
|
|
|
|
|
|
|
|
// Type returns the type of anchor
|
|
|
|
Type() AnchorType
|
2017-09-04 17:16:05 -05:00
|
|
|
}
|
2017-09-11 18:31:29 -05:00
|
|
|
|
|
|
|
// AnchorType is the type of anchor.
|
|
|
|
type AnchorType byte
|
|
|
|
|
|
|
|
// AnchorType constants
|
|
|
|
const (
|
|
|
|
AnchorTypeAbsolute AnchorType = iota
|
|
|
|
AnchorTypeOneCell
|
|
|
|
AnchorTypeTwoCell
|
|
|
|
)
|