diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 00000000..faa8371f --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,71 @@ +package main + +import ( + "github.com/johnfercher/maroto/pkg/v2" + "github.com/johnfercher/maroto/pkg/v2/code/barcode" + "github.com/johnfercher/maroto/pkg/v2/code/matrixcode" + "github.com/johnfercher/maroto/pkg/v2/code/qrcode" + "github.com/johnfercher/maroto/pkg/v2/col" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/image" + "github.com/johnfercher/maroto/pkg/v2/row" + "github.com/johnfercher/maroto/pkg/v2/text" + "log" +) + +func main() { + pdf := v2.NewDocument("v2.pdf") + + header := buildRow() + content := buildContent() + + pdf.Add(header /*content footer*/) + pdf.Add( + content, content, content, content, content, content, content, content, + content, content, content, content, content, content, content, content, + content, content, content, content, content, content, content, content, + content, content, content, content, content, content, content, content, + ) + + //pdf.Add() + //pdf.ForceAddPage(p) + + err := pdf.Generate() + if err != nil { + log.Fatal(err.Error()) + } +} + +func buildRow() domain.Row { + r := row.New(70) + + //image := image.New("image1") + + col1 := col.New(4) + col1.Add(text.New("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ac condimentum sem. ")) + + col2 := col.New(4) + col2.Add(image.NewFromFile("internal/assets/images/biplane.jpg")) + + col3 := col.New(4) + col3.Add(text.New("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ac condimentum sem. ")) + + r.Add(col1, col2, col3) + return r +} + +func buildContent() domain.Row { + row := row.New(70) + + col1 := col.New(4) + col1.Add(barcode.New("barcode")) + + col2 := col.New(4) + col2.Add(qrcode.New("qrcode")) + + col3 := col.New(4) + col3.Add(matrixcode.New("qrcode")) + + row.Add(col1, col2, col3) + return row +} diff --git a/go.mod b/go.mod index cd133d47..b425b1e9 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,20 @@ module github.com/johnfercher/maroto -go 1.13 +go 1.21.1 require ( github.com/boombuler/barcode v1.0.1 github.com/google/uuid v1.3.0 + github.com/johnfercher/go-tree v1.0.2 github.com/jung-kurt/gofpdf v1.16.2 github.com/pkg/errors v0.9.1 + github.com/stretchr/testify v1.8.4 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245 // indirect - github.com/stretchr/objx v0.2.0 // indirect - github.com/stretchr/testify v1.3.0 + github.com/stretchr/objx v0.5.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 0c170f49..451e813c 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/johnfercher/go-tree v1.0.2 h1:9dZVcUjTAOpjC1Qemuxtl/xJRJjRpc3GOLOc/BOTyo0= +github.com/johnfercher/go-tree v1.0.2/go.mod h1:DUO6QkXIFh1K7jeGBIkLCZaeUgnkdQAsB64FDSoHswg= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.16.2 h1:jgbatWHfRlPYiK85qgevsZTHviWXKwB1TTiKdz5PtRc= github.com/jung-kurt/gofpdf v1.16.2/go.mod h1:1hl7y57EsiPAkLbOwzpzqgx1A30nQCk/YmFV8S2vmK0= @@ -23,8 +25,18 @@ github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/examples/pdfs/imagegrid.pdf b/internal/examples/pdfs/imagegrid.pdf index f5acbc4b..925e66d5 100644 Binary files a/internal/examples/pdfs/imagegrid.pdf and b/internal/examples/pdfs/imagegrid.pdf differ diff --git a/internal/mocks/Fpdf.go b/internal/mocks/Fpdf.go index 2bb79de2..1a0b7eb5 100644 --- a/internal/mocks/Fpdf.go +++ b/internal/mocks/Fpdf.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.2.1. DO NOT EDIT. +// Code generated by mockery v2.33.2. DO NOT EDIT. package mocks @@ -17,21 +17,120 @@ type Fpdf struct { mock.Mock } +type Fpdf_Expecter struct { + mock *mock.Mock +} + +func (_m *Fpdf) EXPECT() *Fpdf_Expecter { + return &Fpdf_Expecter{mock: &_m.Mock} +} + // AddFont provides a mock function with given fields: familyStr, styleStr, fileStr func (_m *Fpdf) AddFont(familyStr string, styleStr string, fileStr string) { _m.Called(familyStr, styleStr, fileStr) } +// Fpdf_AddFont_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFont' +type Fpdf_AddFont_Call struct { + *mock.Call +} + +// AddFont is a helper method to define mock.On call +// - familyStr string +// - styleStr string +// - fileStr string +func (_e *Fpdf_Expecter) AddFont(familyStr interface{}, styleStr interface{}, fileStr interface{}) *Fpdf_AddFont_Call { + return &Fpdf_AddFont_Call{Call: _e.mock.On("AddFont", familyStr, styleStr, fileStr)} +} + +func (_c *Fpdf_AddFont_Call) Run(run func(familyStr string, styleStr string, fileStr string)) *Fpdf_AddFont_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Fpdf_AddFont_Call) Return() *Fpdf_AddFont_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_AddFont_Call) RunAndReturn(run func(string, string, string)) *Fpdf_AddFont_Call { + _c.Call.Return(run) + return _c +} + // AddFontFromBytes provides a mock function with given fields: familyStr, styleStr, jsonFileBytes, zFileBytes func (_m *Fpdf) AddFontFromBytes(familyStr string, styleStr string, jsonFileBytes []byte, zFileBytes []byte) { _m.Called(familyStr, styleStr, jsonFileBytes, zFileBytes) } +// Fpdf_AddFontFromBytes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFontFromBytes' +type Fpdf_AddFontFromBytes_Call struct { + *mock.Call +} + +// AddFontFromBytes is a helper method to define mock.On call +// - familyStr string +// - styleStr string +// - jsonFileBytes []byte +// - zFileBytes []byte +func (_e *Fpdf_Expecter) AddFontFromBytes(familyStr interface{}, styleStr interface{}, jsonFileBytes interface{}, zFileBytes interface{}) *Fpdf_AddFontFromBytes_Call { + return &Fpdf_AddFontFromBytes_Call{Call: _e.mock.On("AddFontFromBytes", familyStr, styleStr, jsonFileBytes, zFileBytes)} +} + +func (_c *Fpdf_AddFontFromBytes_Call) Run(run func(familyStr string, styleStr string, jsonFileBytes []byte, zFileBytes []byte)) *Fpdf_AddFontFromBytes_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].([]byte), args[3].([]byte)) + }) + return _c +} + +func (_c *Fpdf_AddFontFromBytes_Call) Return() *Fpdf_AddFontFromBytes_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_AddFontFromBytes_Call) RunAndReturn(run func(string, string, []byte, []byte)) *Fpdf_AddFontFromBytes_Call { + _c.Call.Return(run) + return _c +} + // AddFontFromReader provides a mock function with given fields: familyStr, styleStr, r func (_m *Fpdf) AddFontFromReader(familyStr string, styleStr string, r io.Reader) { _m.Called(familyStr, styleStr, r) } +// Fpdf_AddFontFromReader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFontFromReader' +type Fpdf_AddFontFromReader_Call struct { + *mock.Call +} + +// AddFontFromReader is a helper method to define mock.On call +// - familyStr string +// - styleStr string +// - r io.Reader +func (_e *Fpdf_Expecter) AddFontFromReader(familyStr interface{}, styleStr interface{}, r interface{}) *Fpdf_AddFontFromReader_Call { + return &Fpdf_AddFontFromReader_Call{Call: _e.mock.On("AddFontFromReader", familyStr, styleStr, r)} +} + +func (_c *Fpdf_AddFontFromReader_Call) Run(run func(familyStr string, styleStr string, r io.Reader)) *Fpdf_AddFontFromReader_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(io.Reader)) + }) + return _c +} + +func (_c *Fpdf_AddFontFromReader_Call) Return() *Fpdf_AddFontFromReader_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_AddFontFromReader_Call) RunAndReturn(run func(string, string, io.Reader)) *Fpdf_AddFontFromReader_Call { + _c.Call.Return(run) + return _c +} + // AddLayer provides a mock function with given fields: name, visible func (_m *Fpdf) AddLayer(name string, visible bool) int { ret := _m.Called(name, visible) @@ -46,6 +145,35 @@ func (_m *Fpdf) AddLayer(name string, visible bool) int { return r0 } +// Fpdf_AddLayer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddLayer' +type Fpdf_AddLayer_Call struct { + *mock.Call +} + +// AddLayer is a helper method to define mock.On call +// - name string +// - visible bool +func (_e *Fpdf_Expecter) AddLayer(name interface{}, visible interface{}) *Fpdf_AddLayer_Call { + return &Fpdf_AddLayer_Call{Call: _e.mock.On("AddLayer", name, visible)} +} + +func (_c *Fpdf_AddLayer_Call) Run(run func(name string, visible bool)) *Fpdf_AddLayer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(bool)) + }) + return _c +} + +func (_c *Fpdf_AddLayer_Call) Return(layerID int) *Fpdf_AddLayer_Call { + _c.Call.Return(layerID) + return _c +} + +func (_c *Fpdf_AddLayer_Call) RunAndReturn(run func(string, bool) int) *Fpdf_AddLayer_Call { + _c.Call.Return(run) + return _c +} + // AddLink provides a mock function with given fields: func (_m *Fpdf) AddLink() int { ret := _m.Called() @@ -60,64 +188,459 @@ func (_m *Fpdf) AddLink() int { return r0 } +// Fpdf_AddLink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddLink' +type Fpdf_AddLink_Call struct { + *mock.Call +} + +// AddLink is a helper method to define mock.On call +func (_e *Fpdf_Expecter) AddLink() *Fpdf_AddLink_Call { + return &Fpdf_AddLink_Call{Call: _e.mock.On("AddLink")} +} + +func (_c *Fpdf_AddLink_Call) Run(run func()) *Fpdf_AddLink_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_AddLink_Call) Return(_a0 int) *Fpdf_AddLink_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_AddLink_Call) RunAndReturn(run func() int) *Fpdf_AddLink_Call { + _c.Call.Return(run) + return _c +} + // AddPage provides a mock function with given fields: func (_m *Fpdf) AddPage() { _m.Called() } +// Fpdf_AddPage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddPage' +type Fpdf_AddPage_Call struct { + *mock.Call +} + +// AddPage is a helper method to define mock.On call +func (_e *Fpdf_Expecter) AddPage() *Fpdf_AddPage_Call { + return &Fpdf_AddPage_Call{Call: _e.mock.On("AddPage")} +} + +func (_c *Fpdf_AddPage_Call) Run(run func()) *Fpdf_AddPage_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_AddPage_Call) Return() *Fpdf_AddPage_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_AddPage_Call) RunAndReturn(run func()) *Fpdf_AddPage_Call { + _c.Call.Return(run) + return _c +} + // AddPageFormat provides a mock function with given fields: orientationStr, size func (_m *Fpdf) AddPageFormat(orientationStr string, size gofpdf.SizeType) { _m.Called(orientationStr, size) } +// Fpdf_AddPageFormat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddPageFormat' +type Fpdf_AddPageFormat_Call struct { + *mock.Call +} + +// AddPageFormat is a helper method to define mock.On call +// - orientationStr string +// - size gofpdf.SizeType +func (_e *Fpdf_Expecter) AddPageFormat(orientationStr interface{}, size interface{}) *Fpdf_AddPageFormat_Call { + return &Fpdf_AddPageFormat_Call{Call: _e.mock.On("AddPageFormat", orientationStr, size)} +} + +func (_c *Fpdf_AddPageFormat_Call) Run(run func(orientationStr string, size gofpdf.SizeType)) *Fpdf_AddPageFormat_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(gofpdf.SizeType)) + }) + return _c +} + +func (_c *Fpdf_AddPageFormat_Call) Return() *Fpdf_AddPageFormat_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_AddPageFormat_Call) RunAndReturn(run func(string, gofpdf.SizeType)) *Fpdf_AddPageFormat_Call { + _c.Call.Return(run) + return _c +} + // AddSpotColor provides a mock function with given fields: nameStr, c, m, y, k func (_m *Fpdf) AddSpotColor(nameStr string, c byte, m byte, y byte, k byte) { _m.Called(nameStr, c, m, y, k) } +// Fpdf_AddSpotColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddSpotColor' +type Fpdf_AddSpotColor_Call struct { + *mock.Call +} + +// AddSpotColor is a helper method to define mock.On call +// - nameStr string +// - c byte +// - m byte +// - y byte +// - k byte +func (_e *Fpdf_Expecter) AddSpotColor(nameStr interface{}, c interface{}, m interface{}, y interface{}, k interface{}) *Fpdf_AddSpotColor_Call { + return &Fpdf_AddSpotColor_Call{Call: _e.mock.On("AddSpotColor", nameStr, c, m, y, k)} +} + +func (_c *Fpdf_AddSpotColor_Call) Run(run func(nameStr string, c byte, m byte, y byte, k byte)) *Fpdf_AddSpotColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(byte), args[2].(byte), args[3].(byte), args[4].(byte)) + }) + return _c +} + +func (_c *Fpdf_AddSpotColor_Call) Return() *Fpdf_AddSpotColor_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_AddSpotColor_Call) RunAndReturn(run func(string, byte, byte, byte, byte)) *Fpdf_AddSpotColor_Call { + _c.Call.Return(run) + return _c +} + // AddUTF8Font provides a mock function with given fields: familyStr, styleStr, fileStr func (_m *Fpdf) AddUTF8Font(familyStr string, styleStr string, fileStr string) { _m.Called(familyStr, styleStr, fileStr) } +// Fpdf_AddUTF8Font_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUTF8Font' +type Fpdf_AddUTF8Font_Call struct { + *mock.Call +} + +// AddUTF8Font is a helper method to define mock.On call +// - familyStr string +// - styleStr string +// - fileStr string +func (_e *Fpdf_Expecter) AddUTF8Font(familyStr interface{}, styleStr interface{}, fileStr interface{}) *Fpdf_AddUTF8Font_Call { + return &Fpdf_AddUTF8Font_Call{Call: _e.mock.On("AddUTF8Font", familyStr, styleStr, fileStr)} +} + +func (_c *Fpdf_AddUTF8Font_Call) Run(run func(familyStr string, styleStr string, fileStr string)) *Fpdf_AddUTF8Font_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Fpdf_AddUTF8Font_Call) Return() *Fpdf_AddUTF8Font_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_AddUTF8Font_Call) RunAndReturn(run func(string, string, string)) *Fpdf_AddUTF8Font_Call { + _c.Call.Return(run) + return _c +} + // AliasNbPages provides a mock function with given fields: aliasStr func (_m *Fpdf) AliasNbPages(aliasStr string) { _m.Called(aliasStr) } +// Fpdf_AliasNbPages_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AliasNbPages' +type Fpdf_AliasNbPages_Call struct { + *mock.Call +} + +// AliasNbPages is a helper method to define mock.On call +// - aliasStr string +func (_e *Fpdf_Expecter) AliasNbPages(aliasStr interface{}) *Fpdf_AliasNbPages_Call { + return &Fpdf_AliasNbPages_Call{Call: _e.mock.On("AliasNbPages", aliasStr)} +} + +func (_c *Fpdf_AliasNbPages_Call) Run(run func(aliasStr string)) *Fpdf_AliasNbPages_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_AliasNbPages_Call) Return() *Fpdf_AliasNbPages_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_AliasNbPages_Call) RunAndReturn(run func(string)) *Fpdf_AliasNbPages_Call { + _c.Call.Return(run) + return _c +} + // Arc provides a mock function with given fields: x, y, rx, ry, degRotate, degStart, degEnd, styleStr func (_m *Fpdf) Arc(x float64, y float64, rx float64, ry float64, degRotate float64, degStart float64, degEnd float64, styleStr string) { _m.Called(x, y, rx, ry, degRotate, degStart, degEnd, styleStr) } +// Fpdf_Arc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Arc' +type Fpdf_Arc_Call struct { + *mock.Call +} + +// Arc is a helper method to define mock.On call +// - x float64 +// - y float64 +// - rx float64 +// - ry float64 +// - degRotate float64 +// - degStart float64 +// - degEnd float64 +// - styleStr string +func (_e *Fpdf_Expecter) Arc(x interface{}, y interface{}, rx interface{}, ry interface{}, degRotate interface{}, degStart interface{}, degEnd interface{}, styleStr interface{}) *Fpdf_Arc_Call { + return &Fpdf_Arc_Call{Call: _e.mock.On("Arc", x, y, rx, ry, degRotate, degStart, degEnd, styleStr)} +} + +func (_c *Fpdf_Arc_Call) Run(run func(x float64, y float64, rx float64, ry float64, degRotate float64, degStart float64, degEnd float64, styleStr string)) *Fpdf_Arc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64), args[5].(float64), args[6].(float64), args[7].(string)) + }) + return _c +} + +func (_c *Fpdf_Arc_Call) Return() *Fpdf_Arc_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Arc_Call) RunAndReturn(run func(float64, float64, float64, float64, float64, float64, float64, string)) *Fpdf_Arc_Call { + _c.Call.Return(run) + return _c +} + // ArcTo provides a mock function with given fields: x, y, rx, ry, degRotate, degStart, degEnd func (_m *Fpdf) ArcTo(x float64, y float64, rx float64, ry float64, degRotate float64, degStart float64, degEnd float64) { _m.Called(x, y, rx, ry, degRotate, degStart, degEnd) } +// Fpdf_ArcTo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ArcTo' +type Fpdf_ArcTo_Call struct { + *mock.Call +} + +// ArcTo is a helper method to define mock.On call +// - x float64 +// - y float64 +// - rx float64 +// - ry float64 +// - degRotate float64 +// - degStart float64 +// - degEnd float64 +func (_e *Fpdf_Expecter) ArcTo(x interface{}, y interface{}, rx interface{}, ry interface{}, degRotate interface{}, degStart interface{}, degEnd interface{}) *Fpdf_ArcTo_Call { + return &Fpdf_ArcTo_Call{Call: _e.mock.On("ArcTo", x, y, rx, ry, degRotate, degStart, degEnd)} +} + +func (_c *Fpdf_ArcTo_Call) Run(run func(x float64, y float64, rx float64, ry float64, degRotate float64, degStart float64, degEnd float64)) *Fpdf_ArcTo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64), args[5].(float64), args[6].(float64)) + }) + return _c +} + +func (_c *Fpdf_ArcTo_Call) Return() *Fpdf_ArcTo_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ArcTo_Call) RunAndReturn(run func(float64, float64, float64, float64, float64, float64, float64)) *Fpdf_ArcTo_Call { + _c.Call.Return(run) + return _c +} + // BeginLayer provides a mock function with given fields: id func (_m *Fpdf) BeginLayer(id int) { _m.Called(id) } +// Fpdf_BeginLayer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BeginLayer' +type Fpdf_BeginLayer_Call struct { + *mock.Call +} + +// BeginLayer is a helper method to define mock.On call +// - id int +func (_e *Fpdf_Expecter) BeginLayer(id interface{}) *Fpdf_BeginLayer_Call { + return &Fpdf_BeginLayer_Call{Call: _e.mock.On("BeginLayer", id)} +} + +func (_c *Fpdf_BeginLayer_Call) Run(run func(id int)) *Fpdf_BeginLayer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Fpdf_BeginLayer_Call) Return() *Fpdf_BeginLayer_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_BeginLayer_Call) RunAndReturn(run func(int)) *Fpdf_BeginLayer_Call { + _c.Call.Return(run) + return _c +} + // Beziergon provides a mock function with given fields: points, styleStr func (_m *Fpdf) Beziergon(points []gofpdf.PointType, styleStr string) { _m.Called(points, styleStr) } +// Fpdf_Beziergon_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Beziergon' +type Fpdf_Beziergon_Call struct { + *mock.Call +} + +// Beziergon is a helper method to define mock.On call +// - points []gofpdf.PointType +// - styleStr string +func (_e *Fpdf_Expecter) Beziergon(points interface{}, styleStr interface{}) *Fpdf_Beziergon_Call { + return &Fpdf_Beziergon_Call{Call: _e.mock.On("Beziergon", points, styleStr)} +} + +func (_c *Fpdf_Beziergon_Call) Run(run func(points []gofpdf.PointType, styleStr string)) *Fpdf_Beziergon_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]gofpdf.PointType), args[1].(string)) + }) + return _c +} + +func (_c *Fpdf_Beziergon_Call) Return() *Fpdf_Beziergon_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Beziergon_Call) RunAndReturn(run func([]gofpdf.PointType, string)) *Fpdf_Beziergon_Call { + _c.Call.Return(run) + return _c +} + // Bookmark provides a mock function with given fields: txtStr, level, y func (_m *Fpdf) Bookmark(txtStr string, level int, y float64) { _m.Called(txtStr, level, y) } +// Fpdf_Bookmark_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bookmark' +type Fpdf_Bookmark_Call struct { + *mock.Call +} + +// Bookmark is a helper method to define mock.On call +// - txtStr string +// - level int +// - y float64 +func (_e *Fpdf_Expecter) Bookmark(txtStr interface{}, level interface{}, y interface{}) *Fpdf_Bookmark_Call { + return &Fpdf_Bookmark_Call{Call: _e.mock.On("Bookmark", txtStr, level, y)} +} + +func (_c *Fpdf_Bookmark_Call) Run(run func(txtStr string, level int, y float64)) *Fpdf_Bookmark_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(int), args[2].(float64)) + }) + return _c +} + +func (_c *Fpdf_Bookmark_Call) Return() *Fpdf_Bookmark_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Bookmark_Call) RunAndReturn(run func(string, int, float64)) *Fpdf_Bookmark_Call { + _c.Call.Return(run) + return _c +} + // Cell provides a mock function with given fields: w, h, txtStr func (_m *Fpdf) Cell(w float64, h float64, txtStr string) { _m.Called(w, h, txtStr) } +// Fpdf_Cell_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cell' +type Fpdf_Cell_Call struct { + *mock.Call +} + +// Cell is a helper method to define mock.On call +// - w float64 +// - h float64 +// - txtStr string +func (_e *Fpdf_Expecter) Cell(w interface{}, h interface{}, txtStr interface{}) *Fpdf_Cell_Call { + return &Fpdf_Cell_Call{Call: _e.mock.On("Cell", w, h, txtStr)} +} + +func (_c *Fpdf_Cell_Call) Run(run func(w float64, h float64, txtStr string)) *Fpdf_Cell_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(string)) + }) + return _c +} + +func (_c *Fpdf_Cell_Call) Return() *Fpdf_Cell_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Cell_Call) RunAndReturn(run func(float64, float64, string)) *Fpdf_Cell_Call { + _c.Call.Return(run) + return _c +} + // CellFormat provides a mock function with given fields: w, h, txtStr, borderStr, ln, alignStr, fill, link, linkStr func (_m *Fpdf) CellFormat(w float64, h float64, txtStr string, borderStr string, ln int, alignStr string, fill bool, link int, linkStr string) { - _m.Called(int(w), int(h), txtStr, borderStr, ln, alignStr, fill, link, linkStr) + _m.Called(w, h, txtStr, borderStr, ln, alignStr, fill, link, linkStr) +} + +// Fpdf_CellFormat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CellFormat' +type Fpdf_CellFormat_Call struct { + *mock.Call +} + +// CellFormat is a helper method to define mock.On call +// - w float64 +// - h float64 +// - txtStr string +// - borderStr string +// - ln int +// - alignStr string +// - fill bool +// - link int +// - linkStr string +func (_e *Fpdf_Expecter) CellFormat(w interface{}, h interface{}, txtStr interface{}, borderStr interface{}, ln interface{}, alignStr interface{}, fill interface{}, link interface{}, linkStr interface{}) *Fpdf_CellFormat_Call { + return &Fpdf_CellFormat_Call{Call: _e.mock.On("CellFormat", w, h, txtStr, borderStr, ln, alignStr, fill, link, linkStr)} +} + +func (_c *Fpdf_CellFormat_Call) Run(run func(w float64, h float64, txtStr string, borderStr string, ln int, alignStr string, fill bool, link int, linkStr string)) *Fpdf_CellFormat_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(string), args[3].(string), args[4].(int), args[5].(string), args[6].(bool), args[7].(int), args[8].(string)) + }) + return _c +} + +func (_c *Fpdf_CellFormat_Call) Return() *Fpdf_CellFormat_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_CellFormat_Call) RunAndReturn(run func(float64, float64, string, string, int, string, bool, int, string)) *Fpdf_CellFormat_Call { + _c.Call.Return(run) + return _c } // Cellf provides a mock function with given fields: w, h, fmtStr, args @@ -128,61 +651,426 @@ func (_m *Fpdf) Cellf(w float64, h float64, fmtStr string, args ...interface{}) _m.Called(_ca...) } +// Fpdf_Cellf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Cellf' +type Fpdf_Cellf_Call struct { + *mock.Call +} + +// Cellf is a helper method to define mock.On call +// - w float64 +// - h float64 +// - fmtStr string +// - args ...interface{} +func (_e *Fpdf_Expecter) Cellf(w interface{}, h interface{}, fmtStr interface{}, args ...interface{}) *Fpdf_Cellf_Call { + return &Fpdf_Cellf_Call{Call: _e.mock.On("Cellf", + append([]interface{}{w, h, fmtStr}, args...)...)} +} + +func (_c *Fpdf_Cellf_Call) Run(run func(w float64, h float64, fmtStr string, args ...interface{})) *Fpdf_Cellf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-3) + for i, a := range args[3:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(float64), args[1].(float64), args[2].(string), variadicArgs...) + }) + return _c +} + +func (_c *Fpdf_Cellf_Call) Return() *Fpdf_Cellf_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Cellf_Call) RunAndReturn(run func(float64, float64, string, ...interface{})) *Fpdf_Cellf_Call { + _c.Call.Return(run) + return _c +} + // Circle provides a mock function with given fields: x, y, r, styleStr func (_m *Fpdf) Circle(x float64, y float64, r float64, styleStr string) { _m.Called(x, y, r, styleStr) } +// Fpdf_Circle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Circle' +type Fpdf_Circle_Call struct { + *mock.Call +} + +// Circle is a helper method to define mock.On call +// - x float64 +// - y float64 +// - r float64 +// - styleStr string +func (_e *Fpdf_Expecter) Circle(x interface{}, y interface{}, r interface{}, styleStr interface{}) *Fpdf_Circle_Call { + return &Fpdf_Circle_Call{Call: _e.mock.On("Circle", x, y, r, styleStr)} +} + +func (_c *Fpdf_Circle_Call) Run(run func(x float64, y float64, r float64, styleStr string)) *Fpdf_Circle_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(string)) + }) + return _c +} + +func (_c *Fpdf_Circle_Call) Return() *Fpdf_Circle_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Circle_Call) RunAndReturn(run func(float64, float64, float64, string)) *Fpdf_Circle_Call { + _c.Call.Return(run) + return _c +} + // ClearError provides a mock function with given fields: func (_m *Fpdf) ClearError() { _m.Called() } +// Fpdf_ClearError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClearError' +type Fpdf_ClearError_Call struct { + *mock.Call +} + +// ClearError is a helper method to define mock.On call +func (_e *Fpdf_Expecter) ClearError() *Fpdf_ClearError_Call { + return &Fpdf_ClearError_Call{Call: _e.mock.On("ClearError")} +} + +func (_c *Fpdf_ClearError_Call) Run(run func()) *Fpdf_ClearError_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_ClearError_Call) Return() *Fpdf_ClearError_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ClearError_Call) RunAndReturn(run func()) *Fpdf_ClearError_Call { + _c.Call.Return(run) + return _c +} + // ClipCircle provides a mock function with given fields: x, y, r, outline func (_m *Fpdf) ClipCircle(x float64, y float64, r float64, outline bool) { _m.Called(x, y, r, outline) } +// Fpdf_ClipCircle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClipCircle' +type Fpdf_ClipCircle_Call struct { + *mock.Call +} + +// ClipCircle is a helper method to define mock.On call +// - x float64 +// - y float64 +// - r float64 +// - outline bool +func (_e *Fpdf_Expecter) ClipCircle(x interface{}, y interface{}, r interface{}, outline interface{}) *Fpdf_ClipCircle_Call { + return &Fpdf_ClipCircle_Call{Call: _e.mock.On("ClipCircle", x, y, r, outline)} +} + +func (_c *Fpdf_ClipCircle_Call) Run(run func(x float64, y float64, r float64, outline bool)) *Fpdf_ClipCircle_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(bool)) + }) + return _c +} + +func (_c *Fpdf_ClipCircle_Call) Return() *Fpdf_ClipCircle_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ClipCircle_Call) RunAndReturn(run func(float64, float64, float64, bool)) *Fpdf_ClipCircle_Call { + _c.Call.Return(run) + return _c +} + // ClipEllipse provides a mock function with given fields: x, y, rx, ry, outline func (_m *Fpdf) ClipEllipse(x float64, y float64, rx float64, ry float64, outline bool) { _m.Called(x, y, rx, ry, outline) } +// Fpdf_ClipEllipse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClipEllipse' +type Fpdf_ClipEllipse_Call struct { + *mock.Call +} + +// ClipEllipse is a helper method to define mock.On call +// - x float64 +// - y float64 +// - rx float64 +// - ry float64 +// - outline bool +func (_e *Fpdf_Expecter) ClipEllipse(x interface{}, y interface{}, rx interface{}, ry interface{}, outline interface{}) *Fpdf_ClipEllipse_Call { + return &Fpdf_ClipEllipse_Call{Call: _e.mock.On("ClipEllipse", x, y, rx, ry, outline)} +} + +func (_c *Fpdf_ClipEllipse_Call) Run(run func(x float64, y float64, rx float64, ry float64, outline bool)) *Fpdf_ClipEllipse_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(bool)) + }) + return _c +} + +func (_c *Fpdf_ClipEllipse_Call) Return() *Fpdf_ClipEllipse_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ClipEllipse_Call) RunAndReturn(run func(float64, float64, float64, float64, bool)) *Fpdf_ClipEllipse_Call { + _c.Call.Return(run) + return _c +} + // ClipEnd provides a mock function with given fields: func (_m *Fpdf) ClipEnd() { _m.Called() } +// Fpdf_ClipEnd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClipEnd' +type Fpdf_ClipEnd_Call struct { + *mock.Call +} + +// ClipEnd is a helper method to define mock.On call +func (_e *Fpdf_Expecter) ClipEnd() *Fpdf_ClipEnd_Call { + return &Fpdf_ClipEnd_Call{Call: _e.mock.On("ClipEnd")} +} + +func (_c *Fpdf_ClipEnd_Call) Run(run func()) *Fpdf_ClipEnd_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_ClipEnd_Call) Return() *Fpdf_ClipEnd_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ClipEnd_Call) RunAndReturn(run func()) *Fpdf_ClipEnd_Call { + _c.Call.Return(run) + return _c +} + // ClipPolygon provides a mock function with given fields: points, outline func (_m *Fpdf) ClipPolygon(points []gofpdf.PointType, outline bool) { _m.Called(points, outline) } +// Fpdf_ClipPolygon_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClipPolygon' +type Fpdf_ClipPolygon_Call struct { + *mock.Call +} + +// ClipPolygon is a helper method to define mock.On call +// - points []gofpdf.PointType +// - outline bool +func (_e *Fpdf_Expecter) ClipPolygon(points interface{}, outline interface{}) *Fpdf_ClipPolygon_Call { + return &Fpdf_ClipPolygon_Call{Call: _e.mock.On("ClipPolygon", points, outline)} +} + +func (_c *Fpdf_ClipPolygon_Call) Run(run func(points []gofpdf.PointType, outline bool)) *Fpdf_ClipPolygon_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]gofpdf.PointType), args[1].(bool)) + }) + return _c +} + +func (_c *Fpdf_ClipPolygon_Call) Return() *Fpdf_ClipPolygon_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ClipPolygon_Call) RunAndReturn(run func([]gofpdf.PointType, bool)) *Fpdf_ClipPolygon_Call { + _c.Call.Return(run) + return _c +} + // ClipRect provides a mock function with given fields: x, y, w, h, outline func (_m *Fpdf) ClipRect(x float64, y float64, w float64, h float64, outline bool) { _m.Called(x, y, w, h, outline) } -// ClipRoundedRect provides a mock function with given fields: x, y, w, h, r, outline -func (_m *Fpdf) ClipRoundedRect(x float64, y float64, w float64, h float64, r float64, outline bool) { - _m.Called(x, y, w, h, r, outline) +// Fpdf_ClipRect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClipRect' +type Fpdf_ClipRect_Call struct { + *mock.Call } -// ClipText provides a mock function with given fields: x, y, txtStr, outline -func (_m *Fpdf) ClipText(x float64, y float64, txtStr string, outline bool) { - _m.Called(x, y, txtStr, outline) +// ClipRect is a helper method to define mock.On call +// - x float64 +// - y float64 +// - w float64 +// - h float64 +// - outline bool +func (_e *Fpdf_Expecter) ClipRect(x interface{}, y interface{}, w interface{}, h interface{}, outline interface{}) *Fpdf_ClipRect_Call { + return &Fpdf_ClipRect_Call{Call: _e.mock.On("ClipRect", x, y, w, h, outline)} } -// Close provides a mock function with given fields: -func (_m *Fpdf) Close() { - _m.Called() +func (_c *Fpdf_ClipRect_Call) Run(run func(x float64, y float64, w float64, h float64, outline bool)) *Fpdf_ClipRect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(bool)) + }) + return _c } -// ClosePath provides a mock function with given fields: -func (_m *Fpdf) ClosePath() { +func (_c *Fpdf_ClipRect_Call) Return() *Fpdf_ClipRect_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ClipRect_Call) RunAndReturn(run func(float64, float64, float64, float64, bool)) *Fpdf_ClipRect_Call { + _c.Call.Return(run) + return _c +} + +// ClipRoundedRect provides a mock function with given fields: x, y, w, h, r, outline +func (_m *Fpdf) ClipRoundedRect(x float64, y float64, w float64, h float64, r float64, outline bool) { + _m.Called(x, y, w, h, r, outline) +} + +// Fpdf_ClipRoundedRect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClipRoundedRect' +type Fpdf_ClipRoundedRect_Call struct { + *mock.Call +} + +// ClipRoundedRect is a helper method to define mock.On call +// - x float64 +// - y float64 +// - w float64 +// - h float64 +// - r float64 +// - outline bool +func (_e *Fpdf_Expecter) ClipRoundedRect(x interface{}, y interface{}, w interface{}, h interface{}, r interface{}, outline interface{}) *Fpdf_ClipRoundedRect_Call { + return &Fpdf_ClipRoundedRect_Call{Call: _e.mock.On("ClipRoundedRect", x, y, w, h, r, outline)} +} + +func (_c *Fpdf_ClipRoundedRect_Call) Run(run func(x float64, y float64, w float64, h float64, r float64, outline bool)) *Fpdf_ClipRoundedRect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64), args[5].(bool)) + }) + return _c +} + +func (_c *Fpdf_ClipRoundedRect_Call) Return() *Fpdf_ClipRoundedRect_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ClipRoundedRect_Call) RunAndReturn(run func(float64, float64, float64, float64, float64, bool)) *Fpdf_ClipRoundedRect_Call { + _c.Call.Return(run) + return _c +} + +// ClipText provides a mock function with given fields: x, y, txtStr, outline +func (_m *Fpdf) ClipText(x float64, y float64, txtStr string, outline bool) { + _m.Called(x, y, txtStr, outline) +} + +// Fpdf_ClipText_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClipText' +type Fpdf_ClipText_Call struct { + *mock.Call +} + +// ClipText is a helper method to define mock.On call +// - x float64 +// - y float64 +// - txtStr string +// - outline bool +func (_e *Fpdf_Expecter) ClipText(x interface{}, y interface{}, txtStr interface{}, outline interface{}) *Fpdf_ClipText_Call { + return &Fpdf_ClipText_Call{Call: _e.mock.On("ClipText", x, y, txtStr, outline)} +} + +func (_c *Fpdf_ClipText_Call) Run(run func(x float64, y float64, txtStr string, outline bool)) *Fpdf_ClipText_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(string), args[3].(bool)) + }) + return _c +} + +func (_c *Fpdf_ClipText_Call) Return() *Fpdf_ClipText_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ClipText_Call) RunAndReturn(run func(float64, float64, string, bool)) *Fpdf_ClipText_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function with given fields: +func (_m *Fpdf) Close() { + _m.Called() +} + +// Fpdf_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Fpdf_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Fpdf_Expecter) Close() *Fpdf_Close_Call { + return &Fpdf_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Fpdf_Close_Call) Run(run func()) *Fpdf_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_Close_Call) Return() *Fpdf_Close_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Close_Call) RunAndReturn(run func()) *Fpdf_Close_Call { + _c.Call.Return(run) + return _c +} + +// ClosePath provides a mock function with given fields: +func (_m *Fpdf) ClosePath() { _m.Called() } +// Fpdf_ClosePath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClosePath' +type Fpdf_ClosePath_Call struct { + *mock.Call +} + +// ClosePath is a helper method to define mock.On call +func (_e *Fpdf_Expecter) ClosePath() *Fpdf_ClosePath_Call { + return &Fpdf_ClosePath_Call{Call: _e.mock.On("ClosePath")} +} + +func (_c *Fpdf_ClosePath_Call) Run(run func()) *Fpdf_ClosePath_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_ClosePath_Call) Return() *Fpdf_ClosePath_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ClosePath_Call) RunAndReturn(run func()) *Fpdf_ClosePath_Call { + _c.Call.Return(run) + return _c +} + // CreateTemplate provides a mock function with given fields: fn func (_m *Fpdf) CreateTemplate(fn func(*gofpdf.Tpl)) gofpdf.Template { ret := _m.Called(fn) @@ -199,6 +1087,34 @@ func (_m *Fpdf) CreateTemplate(fn func(*gofpdf.Tpl)) gofpdf.Template { return r0 } +// Fpdf_CreateTemplate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTemplate' +type Fpdf_CreateTemplate_Call struct { + *mock.Call +} + +// CreateTemplate is a helper method to define mock.On call +// - fn func(*gofpdf.Tpl) +func (_e *Fpdf_Expecter) CreateTemplate(fn interface{}) *Fpdf_CreateTemplate_Call { + return &Fpdf_CreateTemplate_Call{Call: _e.mock.On("CreateTemplate", fn)} +} + +func (_c *Fpdf_CreateTemplate_Call) Run(run func(fn func(*gofpdf.Tpl))) *Fpdf_CreateTemplate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func(*gofpdf.Tpl))) + }) + return _c +} + +func (_c *Fpdf_CreateTemplate_Call) Return(_a0 gofpdf.Template) *Fpdf_CreateTemplate_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_CreateTemplate_Call) RunAndReturn(run func(func(*gofpdf.Tpl)) gofpdf.Template) *Fpdf_CreateTemplate_Call { + _c.Call.Return(run) + return _c +} + // CreateTemplateCustom provides a mock function with given fields: corner, size, fn func (_m *Fpdf) CreateTemplateCustom(corner gofpdf.PointType, size gofpdf.SizeType, fn func(*gofpdf.Tpl)) gofpdf.Template { ret := _m.Called(corner, size, fn) @@ -215,46 +1131,334 @@ func (_m *Fpdf) CreateTemplateCustom(corner gofpdf.PointType, size gofpdf.SizeTy return r0 } +// Fpdf_CreateTemplateCustom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTemplateCustom' +type Fpdf_CreateTemplateCustom_Call struct { + *mock.Call +} + +// CreateTemplateCustom is a helper method to define mock.On call +// - corner gofpdf.PointType +// - size gofpdf.SizeType +// - fn func(*gofpdf.Tpl) +func (_e *Fpdf_Expecter) CreateTemplateCustom(corner interface{}, size interface{}, fn interface{}) *Fpdf_CreateTemplateCustom_Call { + return &Fpdf_CreateTemplateCustom_Call{Call: _e.mock.On("CreateTemplateCustom", corner, size, fn)} +} + +func (_c *Fpdf_CreateTemplateCustom_Call) Run(run func(corner gofpdf.PointType, size gofpdf.SizeType, fn func(*gofpdf.Tpl))) *Fpdf_CreateTemplateCustom_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(gofpdf.PointType), args[1].(gofpdf.SizeType), args[2].(func(*gofpdf.Tpl))) + }) + return _c +} + +func (_c *Fpdf_CreateTemplateCustom_Call) Return(_a0 gofpdf.Template) *Fpdf_CreateTemplateCustom_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_CreateTemplateCustom_Call) RunAndReturn(run func(gofpdf.PointType, gofpdf.SizeType, func(*gofpdf.Tpl)) gofpdf.Template) *Fpdf_CreateTemplateCustom_Call { + _c.Call.Return(run) + return _c +} + // Curve provides a mock function with given fields: x0, y0, cx, cy, x1, y1, styleStr func (_m *Fpdf) Curve(x0 float64, y0 float64, cx float64, cy float64, x1 float64, y1 float64, styleStr string) { _m.Called(x0, y0, cx, cy, x1, y1, styleStr) } +// Fpdf_Curve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Curve' +type Fpdf_Curve_Call struct { + *mock.Call +} + +// Curve is a helper method to define mock.On call +// - x0 float64 +// - y0 float64 +// - cx float64 +// - cy float64 +// - x1 float64 +// - y1 float64 +// - styleStr string +func (_e *Fpdf_Expecter) Curve(x0 interface{}, y0 interface{}, cx interface{}, cy interface{}, x1 interface{}, y1 interface{}, styleStr interface{}) *Fpdf_Curve_Call { + return &Fpdf_Curve_Call{Call: _e.mock.On("Curve", x0, y0, cx, cy, x1, y1, styleStr)} +} + +func (_c *Fpdf_Curve_Call) Run(run func(x0 float64, y0 float64, cx float64, cy float64, x1 float64, y1 float64, styleStr string)) *Fpdf_Curve_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64), args[5].(float64), args[6].(string)) + }) + return _c +} + +func (_c *Fpdf_Curve_Call) Return() *Fpdf_Curve_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Curve_Call) RunAndReturn(run func(float64, float64, float64, float64, float64, float64, string)) *Fpdf_Curve_Call { + _c.Call.Return(run) + return _c +} + // CurveBezierCubic provides a mock function with given fields: x0, y0, cx0, cy0, cx1, cy1, x1, y1, styleStr func (_m *Fpdf) CurveBezierCubic(x0 float64, y0 float64, cx0 float64, cy0 float64, cx1 float64, cy1 float64, x1 float64, y1 float64, styleStr string) { _m.Called(x0, y0, cx0, cy0, cx1, cy1, x1, y1, styleStr) } +// Fpdf_CurveBezierCubic_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurveBezierCubic' +type Fpdf_CurveBezierCubic_Call struct { + *mock.Call +} + +// CurveBezierCubic is a helper method to define mock.On call +// - x0 float64 +// - y0 float64 +// - cx0 float64 +// - cy0 float64 +// - cx1 float64 +// - cy1 float64 +// - x1 float64 +// - y1 float64 +// - styleStr string +func (_e *Fpdf_Expecter) CurveBezierCubic(x0 interface{}, y0 interface{}, cx0 interface{}, cy0 interface{}, cx1 interface{}, cy1 interface{}, x1 interface{}, y1 interface{}, styleStr interface{}) *Fpdf_CurveBezierCubic_Call { + return &Fpdf_CurveBezierCubic_Call{Call: _e.mock.On("CurveBezierCubic", x0, y0, cx0, cy0, cx1, cy1, x1, y1, styleStr)} +} + +func (_c *Fpdf_CurveBezierCubic_Call) Run(run func(x0 float64, y0 float64, cx0 float64, cy0 float64, cx1 float64, cy1 float64, x1 float64, y1 float64, styleStr string)) *Fpdf_CurveBezierCubic_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64), args[5].(float64), args[6].(float64), args[7].(float64), args[8].(string)) + }) + return _c +} + +func (_c *Fpdf_CurveBezierCubic_Call) Return() *Fpdf_CurveBezierCubic_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_CurveBezierCubic_Call) RunAndReturn(run func(float64, float64, float64, float64, float64, float64, float64, float64, string)) *Fpdf_CurveBezierCubic_Call { + _c.Call.Return(run) + return _c +} + // CurveBezierCubicTo provides a mock function with given fields: cx0, cy0, cx1, cy1, x, y func (_m *Fpdf) CurveBezierCubicTo(cx0 float64, cy0 float64, cx1 float64, cy1 float64, x float64, y float64) { _m.Called(cx0, cy0, cx1, cy1, x, y) } +// Fpdf_CurveBezierCubicTo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurveBezierCubicTo' +type Fpdf_CurveBezierCubicTo_Call struct { + *mock.Call +} + +// CurveBezierCubicTo is a helper method to define mock.On call +// - cx0 float64 +// - cy0 float64 +// - cx1 float64 +// - cy1 float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) CurveBezierCubicTo(cx0 interface{}, cy0 interface{}, cx1 interface{}, cy1 interface{}, x interface{}, y interface{}) *Fpdf_CurveBezierCubicTo_Call { + return &Fpdf_CurveBezierCubicTo_Call{Call: _e.mock.On("CurveBezierCubicTo", cx0, cy0, cx1, cy1, x, y)} +} + +func (_c *Fpdf_CurveBezierCubicTo_Call) Run(run func(cx0 float64, cy0 float64, cx1 float64, cy1 float64, x float64, y float64)) *Fpdf_CurveBezierCubicTo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64), args[5].(float64)) + }) + return _c +} + +func (_c *Fpdf_CurveBezierCubicTo_Call) Return() *Fpdf_CurveBezierCubicTo_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_CurveBezierCubicTo_Call) RunAndReturn(run func(float64, float64, float64, float64, float64, float64)) *Fpdf_CurveBezierCubicTo_Call { + _c.Call.Return(run) + return _c +} + // CurveCubic provides a mock function with given fields: x0, y0, cx0, cy0, x1, y1, cx1, cy1, styleStr func (_m *Fpdf) CurveCubic(x0 float64, y0 float64, cx0 float64, cy0 float64, x1 float64, y1 float64, cx1 float64, cy1 float64, styleStr string) { _m.Called(x0, y0, cx0, cy0, x1, y1, cx1, cy1, styleStr) } +// Fpdf_CurveCubic_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurveCubic' +type Fpdf_CurveCubic_Call struct { + *mock.Call +} + +// CurveCubic is a helper method to define mock.On call +// - x0 float64 +// - y0 float64 +// - cx0 float64 +// - cy0 float64 +// - x1 float64 +// - y1 float64 +// - cx1 float64 +// - cy1 float64 +// - styleStr string +func (_e *Fpdf_Expecter) CurveCubic(x0 interface{}, y0 interface{}, cx0 interface{}, cy0 interface{}, x1 interface{}, y1 interface{}, cx1 interface{}, cy1 interface{}, styleStr interface{}) *Fpdf_CurveCubic_Call { + return &Fpdf_CurveCubic_Call{Call: _e.mock.On("CurveCubic", x0, y0, cx0, cy0, x1, y1, cx1, cy1, styleStr)} +} + +func (_c *Fpdf_CurveCubic_Call) Run(run func(x0 float64, y0 float64, cx0 float64, cy0 float64, x1 float64, y1 float64, cx1 float64, cy1 float64, styleStr string)) *Fpdf_CurveCubic_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64), args[5].(float64), args[6].(float64), args[7].(float64), args[8].(string)) + }) + return _c +} + +func (_c *Fpdf_CurveCubic_Call) Return() *Fpdf_CurveCubic_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_CurveCubic_Call) RunAndReturn(run func(float64, float64, float64, float64, float64, float64, float64, float64, string)) *Fpdf_CurveCubic_Call { + _c.Call.Return(run) + return _c +} + // CurveTo provides a mock function with given fields: cx, cy, x, y func (_m *Fpdf) CurveTo(cx float64, cy float64, x float64, y float64) { _m.Called(cx, cy, x, y) } +// Fpdf_CurveTo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurveTo' +type Fpdf_CurveTo_Call struct { + *mock.Call +} + +// CurveTo is a helper method to define mock.On call +// - cx float64 +// - cy float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) CurveTo(cx interface{}, cy interface{}, x interface{}, y interface{}) *Fpdf_CurveTo_Call { + return &Fpdf_CurveTo_Call{Call: _e.mock.On("CurveTo", cx, cy, x, y)} +} + +func (_c *Fpdf_CurveTo_Call) Run(run func(cx float64, cy float64, x float64, y float64)) *Fpdf_CurveTo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64)) + }) + return _c +} + +func (_c *Fpdf_CurveTo_Call) Return() *Fpdf_CurveTo_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_CurveTo_Call) RunAndReturn(run func(float64, float64, float64, float64)) *Fpdf_CurveTo_Call { + _c.Call.Return(run) + return _c +} + // DrawPath provides a mock function with given fields: styleStr func (_m *Fpdf) DrawPath(styleStr string) { _m.Called(styleStr) } +// Fpdf_DrawPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DrawPath' +type Fpdf_DrawPath_Call struct { + *mock.Call +} + +// DrawPath is a helper method to define mock.On call +// - styleStr string +func (_e *Fpdf_Expecter) DrawPath(styleStr interface{}) *Fpdf_DrawPath_Call { + return &Fpdf_DrawPath_Call{Call: _e.mock.On("DrawPath", styleStr)} +} + +func (_c *Fpdf_DrawPath_Call) Run(run func(styleStr string)) *Fpdf_DrawPath_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_DrawPath_Call) Return() *Fpdf_DrawPath_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_DrawPath_Call) RunAndReturn(run func(string)) *Fpdf_DrawPath_Call { + _c.Call.Return(run) + return _c +} + // Ellipse provides a mock function with given fields: x, y, rx, ry, degRotate, styleStr func (_m *Fpdf) Ellipse(x float64, y float64, rx float64, ry float64, degRotate float64, styleStr string) { _m.Called(x, y, rx, ry, degRotate, styleStr) } +// Fpdf_Ellipse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ellipse' +type Fpdf_Ellipse_Call struct { + *mock.Call +} + +// Ellipse is a helper method to define mock.On call +// - x float64 +// - y float64 +// - rx float64 +// - ry float64 +// - degRotate float64 +// - styleStr string +func (_e *Fpdf_Expecter) Ellipse(x interface{}, y interface{}, rx interface{}, ry interface{}, degRotate interface{}, styleStr interface{}) *Fpdf_Ellipse_Call { + return &Fpdf_Ellipse_Call{Call: _e.mock.On("Ellipse", x, y, rx, ry, degRotate, styleStr)} +} + +func (_c *Fpdf_Ellipse_Call) Run(run func(x float64, y float64, rx float64, ry float64, degRotate float64, styleStr string)) *Fpdf_Ellipse_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64), args[5].(string)) + }) + return _c +} + +func (_c *Fpdf_Ellipse_Call) Return() *Fpdf_Ellipse_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Ellipse_Call) RunAndReturn(run func(float64, float64, float64, float64, float64, string)) *Fpdf_Ellipse_Call { + _c.Call.Return(run) + return _c +} + // EndLayer provides a mock function with given fields: func (_m *Fpdf) EndLayer() { _m.Called() } +// Fpdf_EndLayer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EndLayer' +type Fpdf_EndLayer_Call struct { + *mock.Call +} + +// EndLayer is a helper method to define mock.On call +func (_e *Fpdf_Expecter) EndLayer() *Fpdf_EndLayer_Call { + return &Fpdf_EndLayer_Call{Call: _e.mock.On("EndLayer")} +} + +func (_c *Fpdf_EndLayer_Call) Run(run func()) *Fpdf_EndLayer_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_EndLayer_Call) Return() *Fpdf_EndLayer_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_EndLayer_Call) RunAndReturn(run func()) *Fpdf_EndLayer_Call { + _c.Call.Return(run) + return _c +} + // Err provides a mock function with given fields: func (_m *Fpdf) Err() bool { ret := _m.Called() @@ -269,6 +1473,33 @@ func (_m *Fpdf) Err() bool { return r0 } +// Fpdf_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err' +type Fpdf_Err_Call struct { + *mock.Call +} + +// Err is a helper method to define mock.On call +func (_e *Fpdf_Expecter) Err() *Fpdf_Err_Call { + return &Fpdf_Err_Call{Call: _e.mock.On("Err")} +} + +func (_c *Fpdf_Err_Call) Run(run func()) *Fpdf_Err_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_Err_Call) Return(_a0 bool) *Fpdf_Err_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_Err_Call) RunAndReturn(run func() bool) *Fpdf_Err_Call { + _c.Call.Return(run) + return _c +} + // Error provides a mock function with given fields: func (_m *Fpdf) Error() error { ret := _m.Called() @@ -283,18 +1514,48 @@ func (_m *Fpdf) Error() error { return r0 } +// Fpdf_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error' +type Fpdf_Error_Call struct { + *mock.Call +} + +// Error is a helper method to define mock.On call +func (_e *Fpdf_Expecter) Error() *Fpdf_Error_Call { + return &Fpdf_Error_Call{Call: _e.mock.On("Error")} +} + +func (_c *Fpdf_Error_Call) Run(run func()) *Fpdf_Error_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_Error_Call) Return(_a0 error) *Fpdf_Error_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_Error_Call) RunAndReturn(run func() error) *Fpdf_Error_Call { + _c.Call.Return(run) + return _c +} + // GetAlpha provides a mock function with given fields: func (_m *Fpdf) GetAlpha() (float64, string) { ret := _m.Called() var r0 float64 + var r1 string + if rf, ok := ret.Get(0).(func() (float64, string)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() float64); ok { r0 = rf() } else { r0 = ret.Get(0).(float64) } - var r1 string if rf, ok := ret.Get(1).(func() string); ok { r1 = rf() } else { @@ -304,18 +1565,48 @@ func (_m *Fpdf) GetAlpha() (float64, string) { return r0, r1 } +// Fpdf_GetAlpha_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAlpha' +type Fpdf_GetAlpha_Call struct { + *mock.Call +} + +// GetAlpha is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetAlpha() *Fpdf_GetAlpha_Call { + return &Fpdf_GetAlpha_Call{Call: _e.mock.On("GetAlpha")} +} + +func (_c *Fpdf_GetAlpha_Call) Run(run func()) *Fpdf_GetAlpha_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetAlpha_Call) Return(alpha float64, blendModeStr string) *Fpdf_GetAlpha_Call { + _c.Call.Return(alpha, blendModeStr) + return _c +} + +func (_c *Fpdf_GetAlpha_Call) RunAndReturn(run func() (float64, string)) *Fpdf_GetAlpha_Call { + _c.Call.Return(run) + return _c +} + // GetAutoPageBreak provides a mock function with given fields: func (_m *Fpdf) GetAutoPageBreak() (bool, float64) { ret := _m.Called() var r0 bool + var r1 float64 + if rf, ok := ret.Get(0).(func() (bool, float64)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() } else { r0 = ret.Get(0).(bool) } - var r1 float64 if rf, ok := ret.Get(1).(func() float64); ok { r1 = rf() } else { @@ -325,6 +1616,33 @@ func (_m *Fpdf) GetAutoPageBreak() (bool, float64) { return r0, r1 } +// Fpdf_GetAutoPageBreak_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAutoPageBreak' +type Fpdf_GetAutoPageBreak_Call struct { + *mock.Call +} + +// GetAutoPageBreak is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetAutoPageBreak() *Fpdf_GetAutoPageBreak_Call { + return &Fpdf_GetAutoPageBreak_Call{Call: _e.mock.On("GetAutoPageBreak")} +} + +func (_c *Fpdf_GetAutoPageBreak_Call) Run(run func()) *Fpdf_GetAutoPageBreak_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetAutoPageBreak_Call) Return(auto bool, margin float64) *Fpdf_GetAutoPageBreak_Call { + _c.Call.Return(auto, margin) + return _c +} + +func (_c *Fpdf_GetAutoPageBreak_Call) RunAndReturn(run func() (bool, float64)) *Fpdf_GetAutoPageBreak_Call { + _c.Call.Return(run) + return _c +} + // GetCellMargin provides a mock function with given fields: func (_m *Fpdf) GetCellMargin() float64 { ret := _m.Called() @@ -339,6 +1657,33 @@ func (_m *Fpdf) GetCellMargin() float64 { return r0 } +// Fpdf_GetCellMargin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCellMargin' +type Fpdf_GetCellMargin_Call struct { + *mock.Call +} + +// GetCellMargin is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetCellMargin() *Fpdf_GetCellMargin_Call { + return &Fpdf_GetCellMargin_Call{Call: _e.mock.On("GetCellMargin")} +} + +func (_c *Fpdf_GetCellMargin_Call) Run(run func()) *Fpdf_GetCellMargin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetCellMargin_Call) Return(_a0 float64) *Fpdf_GetCellMargin_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_GetCellMargin_Call) RunAndReturn(run func() float64) *Fpdf_GetCellMargin_Call { + _c.Call.Return(run) + return _c +} + // GetConversionRatio provides a mock function with given fields: func (_m *Fpdf) GetConversionRatio() float64 { ret := _m.Called() @@ -353,25 +1698,55 @@ func (_m *Fpdf) GetConversionRatio() float64 { return r0 } +// Fpdf_GetConversionRatio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConversionRatio' +type Fpdf_GetConversionRatio_Call struct { + *mock.Call +} + +// GetConversionRatio is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetConversionRatio() *Fpdf_GetConversionRatio_Call { + return &Fpdf_GetConversionRatio_Call{Call: _e.mock.On("GetConversionRatio")} +} + +func (_c *Fpdf_GetConversionRatio_Call) Run(run func()) *Fpdf_GetConversionRatio_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetConversionRatio_Call) Return(_a0 float64) *Fpdf_GetConversionRatio_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_GetConversionRatio_Call) RunAndReturn(run func() float64) *Fpdf_GetConversionRatio_Call { + _c.Call.Return(run) + return _c +} + // GetDrawColor provides a mock function with given fields: func (_m *Fpdf) GetDrawColor() (int, int, int) { ret := _m.Called() var r0 int + var r1 int + var r2 int + if rf, ok := ret.Get(0).(func() (int, int, int)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() } else { r0 = ret.Get(0).(int) } - var r1 int if rf, ok := ret.Get(1).(func() int); ok { r1 = rf() } else { r1 = ret.Get(1).(int) } - var r2 int if rf, ok := ret.Get(2).(func() int); ok { r2 = rf() } else { @@ -381,39 +1756,69 @@ func (_m *Fpdf) GetDrawColor() (int, int, int) { return r0, r1, r2 } +// Fpdf_GetDrawColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDrawColor' +type Fpdf_GetDrawColor_Call struct { + *mock.Call +} + +// GetDrawColor is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetDrawColor() *Fpdf_GetDrawColor_Call { + return &Fpdf_GetDrawColor_Call{Call: _e.mock.On("GetDrawColor")} +} + +func (_c *Fpdf_GetDrawColor_Call) Run(run func()) *Fpdf_GetDrawColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetDrawColor_Call) Return(_a0 int, _a1 int, _a2 int) *Fpdf_GetDrawColor_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *Fpdf_GetDrawColor_Call) RunAndReturn(run func() (int, int, int)) *Fpdf_GetDrawColor_Call { + _c.Call.Return(run) + return _c +} + // GetDrawSpotColor provides a mock function with given fields: func (_m *Fpdf) GetDrawSpotColor() (string, byte, byte, byte, byte) { ret := _m.Called() var r0 string + var r1 byte + var r2 byte + var r3 byte + var r4 byte + if rf, ok := ret.Get(0).(func() (string, byte, byte, byte, byte)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 byte if rf, ok := ret.Get(1).(func() byte); ok { r1 = rf() } else { r1 = ret.Get(1).(byte) } - var r2 byte if rf, ok := ret.Get(2).(func() byte); ok { r2 = rf() } else { r2 = ret.Get(2).(byte) } - var r3 byte if rf, ok := ret.Get(3).(func() byte); ok { r3 = rf() } else { r3 = ret.Get(3).(byte) } - var r4 byte if rf, ok := ret.Get(4).(func() byte); ok { r4 = rf() } else { @@ -423,25 +1828,55 @@ func (_m *Fpdf) GetDrawSpotColor() (string, byte, byte, byte, byte) { return r0, r1, r2, r3, r4 } -// GetFillColor provides a mock function with given fields: -func (_m *Fpdf) GetFillColor() (int, int, int) { - ret := _m.Called() +// Fpdf_GetDrawSpotColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDrawSpotColor' +type Fpdf_GetDrawSpotColor_Call struct { + *mock.Call +} - var r0 int +// GetDrawSpotColor is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetDrawSpotColor() *Fpdf_GetDrawSpotColor_Call { + return &Fpdf_GetDrawSpotColor_Call{Call: _e.mock.On("GetDrawSpotColor")} +} + +func (_c *Fpdf_GetDrawSpotColor_Call) Run(run func()) *Fpdf_GetDrawSpotColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetDrawSpotColor_Call) Return(name string, c byte, m byte, y byte, k byte) *Fpdf_GetDrawSpotColor_Call { + _c.Call.Return(name, c, m, y, k) + return _c +} + +func (_c *Fpdf_GetDrawSpotColor_Call) RunAndReturn(run func() (string, byte, byte, byte, byte)) *Fpdf_GetDrawSpotColor_Call { + _c.Call.Return(run) + return _c +} + +// GetFillColor provides a mock function with given fields: +func (_m *Fpdf) GetFillColor() (int, int, int) { + ret := _m.Called() + + var r0 int + var r1 int + var r2 int + if rf, ok := ret.Get(0).(func() (int, int, int)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() } else { r0 = ret.Get(0).(int) } - var r1 int if rf, ok := ret.Get(1).(func() int); ok { r1 = rf() } else { r1 = ret.Get(1).(int) } - var r2 int if rf, ok := ret.Get(2).(func() int); ok { r2 = rf() } else { @@ -451,39 +1886,69 @@ func (_m *Fpdf) GetFillColor() (int, int, int) { return r0, r1, r2 } +// Fpdf_GetFillColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFillColor' +type Fpdf_GetFillColor_Call struct { + *mock.Call +} + +// GetFillColor is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetFillColor() *Fpdf_GetFillColor_Call { + return &Fpdf_GetFillColor_Call{Call: _e.mock.On("GetFillColor")} +} + +func (_c *Fpdf_GetFillColor_Call) Run(run func()) *Fpdf_GetFillColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetFillColor_Call) Return(_a0 int, _a1 int, _a2 int) *Fpdf_GetFillColor_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *Fpdf_GetFillColor_Call) RunAndReturn(run func() (int, int, int)) *Fpdf_GetFillColor_Call { + _c.Call.Return(run) + return _c +} + // GetFillSpotColor provides a mock function with given fields: func (_m *Fpdf) GetFillSpotColor() (string, byte, byte, byte, byte) { ret := _m.Called() var r0 string + var r1 byte + var r2 byte + var r3 byte + var r4 byte + if rf, ok := ret.Get(0).(func() (string, byte, byte, byte, byte)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 byte if rf, ok := ret.Get(1).(func() byte); ok { r1 = rf() } else { r1 = ret.Get(1).(byte) } - var r2 byte if rf, ok := ret.Get(2).(func() byte); ok { r2 = rf() } else { r2 = ret.Get(2).(byte) } - var r3 byte if rf, ok := ret.Get(3).(func() byte); ok { r3 = rf() } else { r3 = ret.Get(3).(byte) } - var r4 byte if rf, ok := ret.Get(4).(func() byte); ok { r4 = rf() } else { @@ -493,6 +1958,33 @@ func (_m *Fpdf) GetFillSpotColor() (string, byte, byte, byte, byte) { return r0, r1, r2, r3, r4 } +// Fpdf_GetFillSpotColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFillSpotColor' +type Fpdf_GetFillSpotColor_Call struct { + *mock.Call +} + +// GetFillSpotColor is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetFillSpotColor() *Fpdf_GetFillSpotColor_Call { + return &Fpdf_GetFillSpotColor_Call{Call: _e.mock.On("GetFillSpotColor")} +} + +func (_c *Fpdf_GetFillSpotColor_Call) Run(run func()) *Fpdf_GetFillSpotColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetFillSpotColor_Call) Return(name string, c byte, m byte, y byte, k byte) *Fpdf_GetFillSpotColor_Call { + _c.Call.Return(name, c, m, y, k) + return _c +} + +func (_c *Fpdf_GetFillSpotColor_Call) RunAndReturn(run func() (string, byte, byte, byte, byte)) *Fpdf_GetFillSpotColor_Call { + _c.Call.Return(run) + return _c +} + // GetFontDesc provides a mock function with given fields: familyStr, styleStr func (_m *Fpdf) GetFontDesc(familyStr string, styleStr string) gofpdf.FontDescType { ret := _m.Called(familyStr, styleStr) @@ -507,18 +1999,50 @@ func (_m *Fpdf) GetFontDesc(familyStr string, styleStr string) gofpdf.FontDescTy return r0 } +// Fpdf_GetFontDesc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFontDesc' +type Fpdf_GetFontDesc_Call struct { + *mock.Call +} + +// GetFontDesc is a helper method to define mock.On call +// - familyStr string +// - styleStr string +func (_e *Fpdf_Expecter) GetFontDesc(familyStr interface{}, styleStr interface{}) *Fpdf_GetFontDesc_Call { + return &Fpdf_GetFontDesc_Call{Call: _e.mock.On("GetFontDesc", familyStr, styleStr)} +} + +func (_c *Fpdf_GetFontDesc_Call) Run(run func(familyStr string, styleStr string)) *Fpdf_GetFontDesc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Fpdf_GetFontDesc_Call) Return(_a0 gofpdf.FontDescType) *Fpdf_GetFontDesc_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_GetFontDesc_Call) RunAndReturn(run func(string, string) gofpdf.FontDescType) *Fpdf_GetFontDesc_Call { + _c.Call.Return(run) + return _c +} + // GetFontSize provides a mock function with given fields: func (_m *Fpdf) GetFontSize() (float64, float64) { ret := _m.Called() var r0 float64 + var r1 float64 + if rf, ok := ret.Get(0).(func() (float64, float64)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() float64); ok { r0 = rf() } else { r0 = ret.Get(0).(float64) } - var r1 float64 if rf, ok := ret.Get(1).(func() float64); ok { r1 = rf() } else { @@ -528,6 +2052,33 @@ func (_m *Fpdf) GetFontSize() (float64, float64) { return r0, r1 } +// Fpdf_GetFontSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFontSize' +type Fpdf_GetFontSize_Call struct { + *mock.Call +} + +// GetFontSize is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetFontSize() *Fpdf_GetFontSize_Call { + return &Fpdf_GetFontSize_Call{Call: _e.mock.On("GetFontSize")} +} + +func (_c *Fpdf_GetFontSize_Call) Run(run func()) *Fpdf_GetFontSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetFontSize_Call) Return(ptSize float64, unitSize float64) *Fpdf_GetFontSize_Call { + _c.Call.Return(ptSize, unitSize) + return _c +} + +func (_c *Fpdf_GetFontSize_Call) RunAndReturn(run func() (float64, float64)) *Fpdf_GetFontSize_Call { + _c.Call.Return(run) + return _c +} + // GetImageInfo provides a mock function with given fields: imageStr func (_m *Fpdf) GetImageInfo(imageStr string) *gofpdf.ImageInfoType { ret := _m.Called(imageStr) @@ -544,6 +2095,34 @@ func (_m *Fpdf) GetImageInfo(imageStr string) *gofpdf.ImageInfoType { return r0 } +// Fpdf_GetImageInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetImageInfo' +type Fpdf_GetImageInfo_Call struct { + *mock.Call +} + +// GetImageInfo is a helper method to define mock.On call +// - imageStr string +func (_e *Fpdf_Expecter) GetImageInfo(imageStr interface{}) *Fpdf_GetImageInfo_Call { + return &Fpdf_GetImageInfo_Call{Call: _e.mock.On("GetImageInfo", imageStr)} +} + +func (_c *Fpdf_GetImageInfo_Call) Run(run func(imageStr string)) *Fpdf_GetImageInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_GetImageInfo_Call) Return(info *gofpdf.ImageInfoType) *Fpdf_GetImageInfo_Call { + _c.Call.Return(info) + return _c +} + +func (_c *Fpdf_GetImageInfo_Call) RunAndReturn(run func(string) *gofpdf.ImageInfoType) *Fpdf_GetImageInfo_Call { + _c.Call.Return(run) + return _c +} + // GetLineWidth provides a mock function with given fields: func (_m *Fpdf) GetLineWidth() float64 { ret := _m.Called() @@ -558,32 +2137,62 @@ func (_m *Fpdf) GetLineWidth() float64 { return r0 } +// Fpdf_GetLineWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLineWidth' +type Fpdf_GetLineWidth_Call struct { + *mock.Call +} + +// GetLineWidth is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetLineWidth() *Fpdf_GetLineWidth_Call { + return &Fpdf_GetLineWidth_Call{Call: _e.mock.On("GetLineWidth")} +} + +func (_c *Fpdf_GetLineWidth_Call) Run(run func()) *Fpdf_GetLineWidth_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetLineWidth_Call) Return(_a0 float64) *Fpdf_GetLineWidth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_GetLineWidth_Call) RunAndReturn(run func() float64) *Fpdf_GetLineWidth_Call { + _c.Call.Return(run) + return _c +} + // GetMargins provides a mock function with given fields: func (_m *Fpdf) GetMargins() (float64, float64, float64, float64) { ret := _m.Called() var r0 float64 + var r1 float64 + var r2 float64 + var r3 float64 + if rf, ok := ret.Get(0).(func() (float64, float64, float64, float64)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() float64); ok { r0 = rf() } else { r0 = ret.Get(0).(float64) } - var r1 float64 if rf, ok := ret.Get(1).(func() float64); ok { r1 = rf() } else { r1 = ret.Get(1).(float64) } - var r2 float64 if rf, ok := ret.Get(2).(func() float64); ok { r2 = rf() } else { r2 = ret.Get(2).(float64) } - var r3 float64 if rf, ok := ret.Get(3).(func() float64); ok { r3 = rf() } else { @@ -593,18 +2202,48 @@ func (_m *Fpdf) GetMargins() (float64, float64, float64, float64) { return r0, r1, r2, r3 } +// Fpdf_GetMargins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMargins' +type Fpdf_GetMargins_Call struct { + *mock.Call +} + +// GetMargins is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetMargins() *Fpdf_GetMargins_Call { + return &Fpdf_GetMargins_Call{Call: _e.mock.On("GetMargins")} +} + +func (_c *Fpdf_GetMargins_Call) Run(run func()) *Fpdf_GetMargins_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetMargins_Call) Return(left float64, top float64, right float64, bottom float64) *Fpdf_GetMargins_Call { + _c.Call.Return(left, top, right, bottom) + return _c +} + +func (_c *Fpdf_GetMargins_Call) RunAndReturn(run func() (float64, float64, float64, float64)) *Fpdf_GetMargins_Call { + _c.Call.Return(run) + return _c +} + // GetPageSize provides a mock function with given fields: func (_m *Fpdf) GetPageSize() (float64, float64) { ret := _m.Called() var r0 float64 + var r1 float64 + if rf, ok := ret.Get(0).(func() (float64, float64)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() float64); ok { r0 = rf() } else { r0 = ret.Get(0).(float64) } - var r1 float64 if rf, ok := ret.Get(1).(func() float64); ok { r1 = rf() } else { @@ -614,6 +2253,33 @@ func (_m *Fpdf) GetPageSize() (float64, float64) { return r0, r1 } +// Fpdf_GetPageSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPageSize' +type Fpdf_GetPageSize_Call struct { + *mock.Call +} + +// GetPageSize is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetPageSize() *Fpdf_GetPageSize_Call { + return &Fpdf_GetPageSize_Call{Call: _e.mock.On("GetPageSize")} +} + +func (_c *Fpdf_GetPageSize_Call) Run(run func()) *Fpdf_GetPageSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetPageSize_Call) Return(width float64, height float64) *Fpdf_GetPageSize_Call { + _c.Call.Return(width, height) + return _c +} + +func (_c *Fpdf_GetPageSize_Call) RunAndReturn(run func() (float64, float64)) *Fpdf_GetPageSize_Call { + _c.Call.Return(run) + return _c +} + // GetPageSizeStr provides a mock function with given fields: sizeStr func (_m *Fpdf) GetPageSizeStr(sizeStr string) gofpdf.SizeType { ret := _m.Called(sizeStr) @@ -628,6 +2294,34 @@ func (_m *Fpdf) GetPageSizeStr(sizeStr string) gofpdf.SizeType { return r0 } +// Fpdf_GetPageSizeStr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPageSizeStr' +type Fpdf_GetPageSizeStr_Call struct { + *mock.Call +} + +// GetPageSizeStr is a helper method to define mock.On call +// - sizeStr string +func (_e *Fpdf_Expecter) GetPageSizeStr(sizeStr interface{}) *Fpdf_GetPageSizeStr_Call { + return &Fpdf_GetPageSizeStr_Call{Call: _e.mock.On("GetPageSizeStr", sizeStr)} +} + +func (_c *Fpdf_GetPageSizeStr_Call) Run(run func(sizeStr string)) *Fpdf_GetPageSizeStr_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_GetPageSizeStr_Call) Return(size gofpdf.SizeType) *Fpdf_GetPageSizeStr_Call { + _c.Call.Return(size) + return _c +} + +func (_c *Fpdf_GetPageSizeStr_Call) RunAndReturn(run func(string) gofpdf.SizeType) *Fpdf_GetPageSizeStr_Call { + _c.Call.Return(run) + return _c +} + // GetStringWidth provides a mock function with given fields: s func (_m *Fpdf) GetStringWidth(s string) float64 { ret := _m.Called(s) @@ -642,25 +2336,56 @@ func (_m *Fpdf) GetStringWidth(s string) float64 { return r0 } +// Fpdf_GetStringWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStringWidth' +type Fpdf_GetStringWidth_Call struct { + *mock.Call +} + +// GetStringWidth is a helper method to define mock.On call +// - s string +func (_e *Fpdf_Expecter) GetStringWidth(s interface{}) *Fpdf_GetStringWidth_Call { + return &Fpdf_GetStringWidth_Call{Call: _e.mock.On("GetStringWidth", s)} +} + +func (_c *Fpdf_GetStringWidth_Call) Run(run func(s string)) *Fpdf_GetStringWidth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_GetStringWidth_Call) Return(_a0 float64) *Fpdf_GetStringWidth_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_GetStringWidth_Call) RunAndReturn(run func(string) float64) *Fpdf_GetStringWidth_Call { + _c.Call.Return(run) + return _c +} + // GetTextColor provides a mock function with given fields: func (_m *Fpdf) GetTextColor() (int, int, int) { ret := _m.Called() var r0 int + var r1 int + var r2 int + if rf, ok := ret.Get(0).(func() (int, int, int)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() int); ok { r0 = rf() } else { r0 = ret.Get(0).(int) } - var r1 int if rf, ok := ret.Get(1).(func() int); ok { r1 = rf() } else { r1 = ret.Get(1).(int) } - var r2 int if rf, ok := ret.Get(2).(func() int); ok { r2 = rf() } else { @@ -670,39 +2395,69 @@ func (_m *Fpdf) GetTextColor() (int, int, int) { return r0, r1, r2 } +// Fpdf_GetTextColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTextColor' +type Fpdf_GetTextColor_Call struct { + *mock.Call +} + +// GetTextColor is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetTextColor() *Fpdf_GetTextColor_Call { + return &Fpdf_GetTextColor_Call{Call: _e.mock.On("GetTextColor")} +} + +func (_c *Fpdf_GetTextColor_Call) Run(run func()) *Fpdf_GetTextColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetTextColor_Call) Return(_a0 int, _a1 int, _a2 int) *Fpdf_GetTextColor_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *Fpdf_GetTextColor_Call) RunAndReturn(run func() (int, int, int)) *Fpdf_GetTextColor_Call { + _c.Call.Return(run) + return _c +} + // GetTextSpotColor provides a mock function with given fields: func (_m *Fpdf) GetTextSpotColor() (string, byte, byte, byte, byte) { ret := _m.Called() var r0 string + var r1 byte + var r2 byte + var r3 byte + var r4 byte + if rf, ok := ret.Get(0).(func() (string, byte, byte, byte, byte)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 byte if rf, ok := ret.Get(1).(func() byte); ok { r1 = rf() } else { r1 = ret.Get(1).(byte) } - var r2 byte if rf, ok := ret.Get(2).(func() byte); ok { r2 = rf() } else { r2 = ret.Get(2).(byte) } - var r3 byte if rf, ok := ret.Get(3).(func() byte); ok { r3 = rf() } else { r3 = ret.Get(3).(byte) } - var r4 byte if rf, ok := ret.Get(4).(func() byte); ok { r4 = rf() } else { @@ -712,6 +2467,33 @@ func (_m *Fpdf) GetTextSpotColor() (string, byte, byte, byte, byte) { return r0, r1, r2, r3, r4 } +// Fpdf_GetTextSpotColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTextSpotColor' +type Fpdf_GetTextSpotColor_Call struct { + *mock.Call +} + +// GetTextSpotColor is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetTextSpotColor() *Fpdf_GetTextSpotColor_Call { + return &Fpdf_GetTextSpotColor_Call{Call: _e.mock.On("GetTextSpotColor")} +} + +func (_c *Fpdf_GetTextSpotColor_Call) Run(run func()) *Fpdf_GetTextSpotColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetTextSpotColor_Call) Return(name string, c byte, m byte, y byte, k byte) *Fpdf_GetTextSpotColor_Call { + _c.Call.Return(name, c, m, y, k) + return _c +} + +func (_c *Fpdf_GetTextSpotColor_Call) RunAndReturn(run func() (string, byte, byte, byte, byte)) *Fpdf_GetTextSpotColor_Call { + _c.Call.Return(run) + return _c +} + // GetX provides a mock function with given fields: func (_m *Fpdf) GetX() float64 { ret := _m.Called() @@ -726,18 +2508,48 @@ func (_m *Fpdf) GetX() float64 { return r0 } +// Fpdf_GetX_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetX' +type Fpdf_GetX_Call struct { + *mock.Call +} + +// GetX is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetX() *Fpdf_GetX_Call { + return &Fpdf_GetX_Call{Call: _e.mock.On("GetX")} +} + +func (_c *Fpdf_GetX_Call) Run(run func()) *Fpdf_GetX_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetX_Call) Return(_a0 float64) *Fpdf_GetX_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_GetX_Call) RunAndReturn(run func() float64) *Fpdf_GetX_Call { + _c.Call.Return(run) + return _c +} + // GetXY provides a mock function with given fields: func (_m *Fpdf) GetXY() (float64, float64) { ret := _m.Called() var r0 float64 + var r1 float64 + if rf, ok := ret.Get(0).(func() (float64, float64)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() float64); ok { r0 = rf() } else { r0 = ret.Get(0).(float64) } - var r1 float64 if rf, ok := ret.Get(1).(func() float64); ok { r1 = rf() } else { @@ -747,6 +2559,33 @@ func (_m *Fpdf) GetXY() (float64, float64) { return r0, r1 } +// Fpdf_GetXY_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetXY' +type Fpdf_GetXY_Call struct { + *mock.Call +} + +// GetXY is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetXY() *Fpdf_GetXY_Call { + return &Fpdf_GetXY_Call{Call: _e.mock.On("GetXY")} +} + +func (_c *Fpdf_GetXY_Call) Run(run func()) *Fpdf_GetXY_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetXY_Call) Return(_a0 float64, _a1 float64) *Fpdf_GetXY_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Fpdf_GetXY_Call) RunAndReturn(run func() (float64, float64)) *Fpdf_GetXY_Call { + _c.Call.Return(run) + return _c +} + // GetY provides a mock function with given fields: func (_m *Fpdf) GetY() float64 { ret := _m.Called() @@ -761,6 +2600,33 @@ func (_m *Fpdf) GetY() float64 { return r0 } +// Fpdf_GetY_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetY' +type Fpdf_GetY_Call struct { + *mock.Call +} + +// GetY is a helper method to define mock.On call +func (_e *Fpdf_Expecter) GetY() *Fpdf_GetY_Call { + return &Fpdf_GetY_Call{Call: _e.mock.On("GetY")} +} + +func (_c *Fpdf_GetY_Call) Run(run func()) *Fpdf_GetY_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_GetY_Call) Return(_a0 float64) *Fpdf_GetY_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_GetY_Call) RunAndReturn(run func() float64) *Fpdf_GetY_Call { + _c.Call.Return(run) + return _c +} + // HTMLBasicNew provides a mock function with given fields: func (_m *Fpdf) HTMLBasicNew() gofpdf.HTMLBasicType { ret := _m.Called() @@ -775,9 +2641,72 @@ func (_m *Fpdf) HTMLBasicNew() gofpdf.HTMLBasicType { return r0 } +// Fpdf_HTMLBasicNew_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HTMLBasicNew' +type Fpdf_HTMLBasicNew_Call struct { + *mock.Call +} + +// HTMLBasicNew is a helper method to define mock.On call +func (_e *Fpdf_Expecter) HTMLBasicNew() *Fpdf_HTMLBasicNew_Call { + return &Fpdf_HTMLBasicNew_Call{Call: _e.mock.On("HTMLBasicNew")} +} + +func (_c *Fpdf_HTMLBasicNew_Call) Run(run func()) *Fpdf_HTMLBasicNew_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_HTMLBasicNew_Call) Return(html gofpdf.HTMLBasicType) *Fpdf_HTMLBasicNew_Call { + _c.Call.Return(html) + return _c +} + +func (_c *Fpdf_HTMLBasicNew_Call) RunAndReturn(run func() gofpdf.HTMLBasicType) *Fpdf_HTMLBasicNew_Call { + _c.Call.Return(run) + return _c +} + // Image provides a mock function with given fields: imageNameStr, x, y, w, h, flow, tp, link, linkStr func (_m *Fpdf) Image(imageNameStr string, x float64, y float64, w float64, h float64, flow bool, tp string, link int, linkStr string) { - _m.Called("", int(x), int(y), int(w), int(h)) + _m.Called(imageNameStr, x, y, w, h, flow, tp, link, linkStr) +} + +// Fpdf_Image_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Image' +type Fpdf_Image_Call struct { + *mock.Call +} + +// Image is a helper method to define mock.On call +// - imageNameStr string +// - x float64 +// - y float64 +// - w float64 +// - h float64 +// - flow bool +// - tp string +// - link int +// - linkStr string +func (_e *Fpdf_Expecter) Image(imageNameStr interface{}, x interface{}, y interface{}, w interface{}, h interface{}, flow interface{}, tp interface{}, link interface{}, linkStr interface{}) *Fpdf_Image_Call { + return &Fpdf_Image_Call{Call: _e.mock.On("Image", imageNameStr, x, y, w, h, flow, tp, link, linkStr)} +} + +func (_c *Fpdf_Image_Call) Run(run func(imageNameStr string, x float64, y float64, w float64, h float64, flow bool, tp string, link int, linkStr string)) *Fpdf_Image_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64), args[5].(bool), args[6].(string), args[7].(int), args[8].(string)) + }) + return _c +} + +func (_c *Fpdf_Image_Call) Return() *Fpdf_Image_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Image_Call) RunAndReturn(run func(string, float64, float64, float64, float64, bool, string, int, string)) *Fpdf_Image_Call { + _c.Call.Return(run) + return _c } // ImageOptions provides a mock function with given fields: imageNameStr, x, y, w, h, flow, options, link, linkStr @@ -785,6 +2714,42 @@ func (_m *Fpdf) ImageOptions(imageNameStr string, x float64, y float64, w float6 _m.Called(imageNameStr, x, y, w, h, flow, options, link, linkStr) } +// Fpdf_ImageOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageOptions' +type Fpdf_ImageOptions_Call struct { + *mock.Call +} + +// ImageOptions is a helper method to define mock.On call +// - imageNameStr string +// - x float64 +// - y float64 +// - w float64 +// - h float64 +// - flow bool +// - options gofpdf.ImageOptions +// - link int +// - linkStr string +func (_e *Fpdf_Expecter) ImageOptions(imageNameStr interface{}, x interface{}, y interface{}, w interface{}, h interface{}, flow interface{}, options interface{}, link interface{}, linkStr interface{}) *Fpdf_ImageOptions_Call { + return &Fpdf_ImageOptions_Call{Call: _e.mock.On("ImageOptions", imageNameStr, x, y, w, h, flow, options, link, linkStr)} +} + +func (_c *Fpdf_ImageOptions_Call) Run(run func(imageNameStr string, x float64, y float64, w float64, h float64, flow bool, options gofpdf.ImageOptions, link int, linkStr string)) *Fpdf_ImageOptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64), args[5].(bool), args[6].(gofpdf.ImageOptions), args[7].(int), args[8].(string)) + }) + return _c +} + +func (_c *Fpdf_ImageOptions_Call) Return() *Fpdf_ImageOptions_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_ImageOptions_Call) RunAndReturn(run func(string, float64, float64, float64, float64, bool, gofpdf.ImageOptions, int, string)) *Fpdf_ImageOptions_Call { + _c.Call.Return(run) + return _c +} + // ImageTypeFromMime provides a mock function with given fields: mimeStr func (_m *Fpdf) ImageTypeFromMime(mimeStr string) string { ret := _m.Called(mimeStr) @@ -799,24 +2764,185 @@ func (_m *Fpdf) ImageTypeFromMime(mimeStr string) string { return r0 } +// Fpdf_ImageTypeFromMime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ImageTypeFromMime' +type Fpdf_ImageTypeFromMime_Call struct { + *mock.Call +} + +// ImageTypeFromMime is a helper method to define mock.On call +// - mimeStr string +func (_e *Fpdf_Expecter) ImageTypeFromMime(mimeStr interface{}) *Fpdf_ImageTypeFromMime_Call { + return &Fpdf_ImageTypeFromMime_Call{Call: _e.mock.On("ImageTypeFromMime", mimeStr)} +} + +func (_c *Fpdf_ImageTypeFromMime_Call) Run(run func(mimeStr string)) *Fpdf_ImageTypeFromMime_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_ImageTypeFromMime_Call) Return(tp string) *Fpdf_ImageTypeFromMime_Call { + _c.Call.Return(tp) + return _c +} + +func (_c *Fpdf_ImageTypeFromMime_Call) RunAndReturn(run func(string) string) *Fpdf_ImageTypeFromMime_Call { + _c.Call.Return(run) + return _c +} + // Line provides a mock function with given fields: x1, y1, x2, y2 func (_m *Fpdf) Line(x1 float64, y1 float64, x2 float64, y2 float64) { _m.Called(x1, y1, x2, y2) } -// LineTo provides a mock function with given fields: x, y -func (_m *Fpdf) LineTo(x float64, y float64) { - _m.Called(x, y) +// Fpdf_Line_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Line' +type Fpdf_Line_Call struct { + *mock.Call } -// LinearGradient provides a mock function with given fields: x, y, w, h, r1, g1, b1, r2, g2, b2, x1, y1, x2, y2 -func (_m *Fpdf) LinearGradient(x float64, y float64, w float64, h float64, r1 int, g1 int, b1 int, r2 int, g2 int, b2 int, x1 float64, y1 float64, x2 float64, y2 float64) { - _m.Called(x, y, w, h, r1, g1, b1, r2, g2, b2, x1, y1, x2, y2) +// Line is a helper method to define mock.On call +// - x1 float64 +// - y1 float64 +// - x2 float64 +// - y2 float64 +func (_e *Fpdf_Expecter) Line(x1 interface{}, y1 interface{}, x2 interface{}, y2 interface{}) *Fpdf_Line_Call { + return &Fpdf_Line_Call{Call: _e.mock.On("Line", x1, y1, x2, y2)} } -// Link provides a mock function with given fields: x, y, w, h, link -func (_m *Fpdf) Link(x float64, y float64, w float64, h float64, link int) { - _m.Called(x, y, w, h, link) +func (_c *Fpdf_Line_Call) Run(run func(x1 float64, y1 float64, x2 float64, y2 float64)) *Fpdf_Line_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64)) + }) + return _c +} + +func (_c *Fpdf_Line_Call) Return() *Fpdf_Line_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Line_Call) RunAndReturn(run func(float64, float64, float64, float64)) *Fpdf_Line_Call { + _c.Call.Return(run) + return _c +} + +// LineTo provides a mock function with given fields: x, y +func (_m *Fpdf) LineTo(x float64, y float64) { + _m.Called(x, y) +} + +// Fpdf_LineTo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LineTo' +type Fpdf_LineTo_Call struct { + *mock.Call +} + +// LineTo is a helper method to define mock.On call +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) LineTo(x interface{}, y interface{}) *Fpdf_LineTo_Call { + return &Fpdf_LineTo_Call{Call: _e.mock.On("LineTo", x, y)} +} + +func (_c *Fpdf_LineTo_Call) Run(run func(x float64, y float64)) *Fpdf_LineTo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64)) + }) + return _c +} + +func (_c *Fpdf_LineTo_Call) Return() *Fpdf_LineTo_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_LineTo_Call) RunAndReturn(run func(float64, float64)) *Fpdf_LineTo_Call { + _c.Call.Return(run) + return _c +} + +// LinearGradient provides a mock function with given fields: x, y, w, h, r1, g1, b1, r2, g2, b2, x1, y1, x2, y2 +func (_m *Fpdf) LinearGradient(x float64, y float64, w float64, h float64, r1 int, g1 int, b1 int, r2 int, g2 int, b2 int, x1 float64, y1 float64, x2 float64, y2 float64) { + _m.Called(x, y, w, h, r1, g1, b1, r2, g2, b2, x1, y1, x2, y2) +} + +// Fpdf_LinearGradient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinearGradient' +type Fpdf_LinearGradient_Call struct { + *mock.Call +} + +// LinearGradient is a helper method to define mock.On call +// - x float64 +// - y float64 +// - w float64 +// - h float64 +// - r1 int +// - g1 int +// - b1 int +// - r2 int +// - g2 int +// - b2 int +// - x1 float64 +// - y1 float64 +// - x2 float64 +// - y2 float64 +func (_e *Fpdf_Expecter) LinearGradient(x interface{}, y interface{}, w interface{}, h interface{}, r1 interface{}, g1 interface{}, b1 interface{}, r2 interface{}, g2 interface{}, b2 interface{}, x1 interface{}, y1 interface{}, x2 interface{}, y2 interface{}) *Fpdf_LinearGradient_Call { + return &Fpdf_LinearGradient_Call{Call: _e.mock.On("LinearGradient", x, y, w, h, r1, g1, b1, r2, g2, b2, x1, y1, x2, y2)} +} + +func (_c *Fpdf_LinearGradient_Call) Run(run func(x float64, y float64, w float64, h float64, r1 int, g1 int, b1 int, r2 int, g2 int, b2 int, x1 float64, y1 float64, x2 float64, y2 float64)) *Fpdf_LinearGradient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(int), args[5].(int), args[6].(int), args[7].(int), args[8].(int), args[9].(int), args[10].(float64), args[11].(float64), args[12].(float64), args[13].(float64)) + }) + return _c +} + +func (_c *Fpdf_LinearGradient_Call) Return() *Fpdf_LinearGradient_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_LinearGradient_Call) RunAndReturn(run func(float64, float64, float64, float64, int, int, int, int, int, int, float64, float64, float64, float64)) *Fpdf_LinearGradient_Call { + _c.Call.Return(run) + return _c +} + +// Link provides a mock function with given fields: x, y, w, h, link +func (_m *Fpdf) Link(x float64, y float64, w float64, h float64, link int) { + _m.Called(x, y, w, h, link) +} + +// Fpdf_Link_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Link' +type Fpdf_Link_Call struct { + *mock.Call +} + +// Link is a helper method to define mock.On call +// - x float64 +// - y float64 +// - w float64 +// - h float64 +// - link int +func (_e *Fpdf_Expecter) Link(x interface{}, y interface{}, w interface{}, h interface{}, link interface{}) *Fpdf_Link_Call { + return &Fpdf_Link_Call{Call: _e.mock.On("Link", x, y, w, h, link)} +} + +func (_c *Fpdf_Link_Call) Run(run func(x float64, y float64, w float64, h float64, link int)) *Fpdf_Link_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(int)) + }) + return _c +} + +func (_c *Fpdf_Link_Call) Return() *Fpdf_Link_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Link_Call) RunAndReturn(run func(float64, float64, float64, float64, int)) *Fpdf_Link_Call { + _c.Call.Return(run) + return _c } // LinkString provides a mock function with given fields: x, y, w, h, linkStr @@ -824,21 +2950,143 @@ func (_m *Fpdf) LinkString(x float64, y float64, w float64, h float64, linkStr s _m.Called(x, y, w, h, linkStr) } +// Fpdf_LinkString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkString' +type Fpdf_LinkString_Call struct { + *mock.Call +} + +// LinkString is a helper method to define mock.On call +// - x float64 +// - y float64 +// - w float64 +// - h float64 +// - linkStr string +func (_e *Fpdf_Expecter) LinkString(x interface{}, y interface{}, w interface{}, h interface{}, linkStr interface{}) *Fpdf_LinkString_Call { + return &Fpdf_LinkString_Call{Call: _e.mock.On("LinkString", x, y, w, h, linkStr)} +} + +func (_c *Fpdf_LinkString_Call) Run(run func(x float64, y float64, w float64, h float64, linkStr string)) *Fpdf_LinkString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(string)) + }) + return _c +} + +func (_c *Fpdf_LinkString_Call) Return() *Fpdf_LinkString_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_LinkString_Call) RunAndReturn(run func(float64, float64, float64, float64, string)) *Fpdf_LinkString_Call { + _c.Call.Return(run) + return _c +} + // Ln provides a mock function with given fields: h func (_m *Fpdf) Ln(h float64) { _m.Called(h) } +// Fpdf_Ln_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ln' +type Fpdf_Ln_Call struct { + *mock.Call +} + +// Ln is a helper method to define mock.On call +// - h float64 +func (_e *Fpdf_Expecter) Ln(h interface{}) *Fpdf_Ln_Call { + return &Fpdf_Ln_Call{Call: _e.mock.On("Ln", h)} +} + +func (_c *Fpdf_Ln_Call) Run(run func(h float64)) *Fpdf_Ln_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_Ln_Call) Return() *Fpdf_Ln_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Ln_Call) RunAndReturn(run func(float64)) *Fpdf_Ln_Call { + _c.Call.Return(run) + return _c +} + // MoveTo provides a mock function with given fields: x, y func (_m *Fpdf) MoveTo(x float64, y float64) { _m.Called(x, y) } +// Fpdf_MoveTo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MoveTo' +type Fpdf_MoveTo_Call struct { + *mock.Call +} + +// MoveTo is a helper method to define mock.On call +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) MoveTo(x interface{}, y interface{}) *Fpdf_MoveTo_Call { + return &Fpdf_MoveTo_Call{Call: _e.mock.On("MoveTo", x, y)} +} + +func (_c *Fpdf_MoveTo_Call) Run(run func(x float64, y float64)) *Fpdf_MoveTo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64)) + }) + return _c +} + +func (_c *Fpdf_MoveTo_Call) Return() *Fpdf_MoveTo_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_MoveTo_Call) RunAndReturn(run func(float64, float64)) *Fpdf_MoveTo_Call { + _c.Call.Return(run) + return _c +} + // MultiCell provides a mock function with given fields: w, h, txtStr, borderStr, alignStr, fill func (_m *Fpdf) MultiCell(w float64, h float64, txtStr string, borderStr string, alignStr string, fill bool) { _m.Called(w, h, txtStr, borderStr, alignStr, fill) } +// Fpdf_MultiCell_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MultiCell' +type Fpdf_MultiCell_Call struct { + *mock.Call +} + +// MultiCell is a helper method to define mock.On call +// - w float64 +// - h float64 +// - txtStr string +// - borderStr string +// - alignStr string +// - fill bool +func (_e *Fpdf_Expecter) MultiCell(w interface{}, h interface{}, txtStr interface{}, borderStr interface{}, alignStr interface{}, fill interface{}) *Fpdf_MultiCell_Call { + return &Fpdf_MultiCell_Call{Call: _e.mock.On("MultiCell", w, h, txtStr, borderStr, alignStr, fill)} +} + +func (_c *Fpdf_MultiCell_Call) Run(run func(w float64, h float64, txtStr string, borderStr string, alignStr string, fill bool)) *Fpdf_MultiCell_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(string), args[3].(string), args[4].(string), args[5].(bool)) + }) + return _c +} + +func (_c *Fpdf_MultiCell_Call) Return() *Fpdf_MultiCell_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_MultiCell_Call) RunAndReturn(run func(float64, float64, string, string, string, bool)) *Fpdf_MultiCell_Call { + _c.Call.Return(run) + return _c +} + // Ok provides a mock function with given fields: func (_m *Fpdf) Ok() bool { ret := _m.Called() @@ -853,11 +3101,65 @@ func (_m *Fpdf) Ok() bool { return r0 } +// Fpdf_Ok_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ok' +type Fpdf_Ok_Call struct { + *mock.Call +} + +// Ok is a helper method to define mock.On call +func (_e *Fpdf_Expecter) Ok() *Fpdf_Ok_Call { + return &Fpdf_Ok_Call{Call: _e.mock.On("Ok")} +} + +func (_c *Fpdf_Ok_Call) Run(run func()) *Fpdf_Ok_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_Ok_Call) Return(_a0 bool) *Fpdf_Ok_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_Ok_Call) RunAndReturn(run func() bool) *Fpdf_Ok_Call { + _c.Call.Return(run) + return _c +} + // OpenLayerPane provides a mock function with given fields: func (_m *Fpdf) OpenLayerPane() { _m.Called() } +// Fpdf_OpenLayerPane_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenLayerPane' +type Fpdf_OpenLayerPane_Call struct { + *mock.Call +} + +// OpenLayerPane is a helper method to define mock.On call +func (_e *Fpdf_Expecter) OpenLayerPane() *Fpdf_OpenLayerPane_Call { + return &Fpdf_OpenLayerPane_Call{Call: _e.mock.On("OpenLayerPane")} +} + +func (_c *Fpdf_OpenLayerPane_Call) Run(run func()) *Fpdf_OpenLayerPane_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_OpenLayerPane_Call) Return() *Fpdf_OpenLayerPane_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_OpenLayerPane_Call) RunAndReturn(run func()) *Fpdf_OpenLayerPane_Call { + _c.Call.Return(run) + return _c +} + // Output provides a mock function with given fields: w func (_m *Fpdf) Output(w io.Writer) error { ret := _m.Called(w) @@ -872,6 +3174,34 @@ func (_m *Fpdf) Output(w io.Writer) error { return r0 } +// Fpdf_Output_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Output' +type Fpdf_Output_Call struct { + *mock.Call +} + +// Output is a helper method to define mock.On call +// - w io.Writer +func (_e *Fpdf_Expecter) Output(w interface{}) *Fpdf_Output_Call { + return &Fpdf_Output_Call{Call: _e.mock.On("Output", w)} +} + +func (_c *Fpdf_Output_Call) Run(run func(w io.Writer)) *Fpdf_Output_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(io.Writer)) + }) + return _c +} + +func (_c *Fpdf_Output_Call) Return(_a0 error) *Fpdf_Output_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_Output_Call) RunAndReturn(run func(io.Writer) error) *Fpdf_Output_Call { + _c.Call.Return(run) + return _c +} + // OutputAndClose provides a mock function with given fields: w func (_m *Fpdf) OutputAndClose(w io.WriteCloser) error { ret := _m.Called(w) @@ -886,6 +3216,34 @@ func (_m *Fpdf) OutputAndClose(w io.WriteCloser) error { return r0 } +// Fpdf_OutputAndClose_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OutputAndClose' +type Fpdf_OutputAndClose_Call struct { + *mock.Call +} + +// OutputAndClose is a helper method to define mock.On call +// - w io.WriteCloser +func (_e *Fpdf_Expecter) OutputAndClose(w interface{}) *Fpdf_OutputAndClose_Call { + return &Fpdf_OutputAndClose_Call{Call: _e.mock.On("OutputAndClose", w)} +} + +func (_c *Fpdf_OutputAndClose_Call) Run(run func(w io.WriteCloser)) *Fpdf_OutputAndClose_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(io.WriteCloser)) + }) + return _c +} + +func (_c *Fpdf_OutputAndClose_Call) Return(_a0 error) *Fpdf_OutputAndClose_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_OutputAndClose_Call) RunAndReturn(run func(io.WriteCloser) error) *Fpdf_OutputAndClose_Call { + _c.Call.Return(run) + return _c +} + // OutputFileAndClose provides a mock function with given fields: fileStr func (_m *Fpdf) OutputFileAndClose(fileStr string) error { ret := _m.Called(fileStr) @@ -900,6 +3258,34 @@ func (_m *Fpdf) OutputFileAndClose(fileStr string) error { return r0 } +// Fpdf_OutputFileAndClose_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OutputFileAndClose' +type Fpdf_OutputFileAndClose_Call struct { + *mock.Call +} + +// OutputFileAndClose is a helper method to define mock.On call +// - fileStr string +func (_e *Fpdf_Expecter) OutputFileAndClose(fileStr interface{}) *Fpdf_OutputFileAndClose_Call { + return &Fpdf_OutputFileAndClose_Call{Call: _e.mock.On("OutputFileAndClose", fileStr)} +} + +func (_c *Fpdf_OutputFileAndClose_Call) Run(run func(fileStr string)) *Fpdf_OutputFileAndClose_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_OutputFileAndClose_Call) Return(_a0 error) *Fpdf_OutputFileAndClose_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_OutputFileAndClose_Call) RunAndReturn(run func(string) error) *Fpdf_OutputFileAndClose_Call { + _c.Call.Return(run) + return _c +} + // PageCount provides a mock function with given fields: func (_m *Fpdf) PageCount() int { ret := _m.Called() @@ -914,6 +3300,33 @@ func (_m *Fpdf) PageCount() int { return r0 } +// Fpdf_PageCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PageCount' +type Fpdf_PageCount_Call struct { + *mock.Call +} + +// PageCount is a helper method to define mock.On call +func (_e *Fpdf_Expecter) PageCount() *Fpdf_PageCount_Call { + return &Fpdf_PageCount_Call{Call: _e.mock.On("PageCount")} +} + +func (_c *Fpdf_PageCount_Call) Run(run func()) *Fpdf_PageCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_PageCount_Call) Return(_a0 int) *Fpdf_PageCount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_PageCount_Call) RunAndReturn(run func() int) *Fpdf_PageCount_Call { + _c.Call.Return(run) + return _c +} + // PageNo provides a mock function with given fields: func (_m *Fpdf) PageNo() int { ret := _m.Called() @@ -928,25 +3341,55 @@ func (_m *Fpdf) PageNo() int { return r0 } +// Fpdf_PageNo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PageNo' +type Fpdf_PageNo_Call struct { + *mock.Call +} + +// PageNo is a helper method to define mock.On call +func (_e *Fpdf_Expecter) PageNo() *Fpdf_PageNo_Call { + return &Fpdf_PageNo_Call{Call: _e.mock.On("PageNo")} +} + +func (_c *Fpdf_PageNo_Call) Run(run func()) *Fpdf_PageNo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_PageNo_Call) Return(_a0 int) *Fpdf_PageNo_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_PageNo_Call) RunAndReturn(run func() int) *Fpdf_PageNo_Call { + _c.Call.Return(run) + return _c +} + // PageSize provides a mock function with given fields: pageNum func (_m *Fpdf) PageSize(pageNum int) (float64, float64, string) { ret := _m.Called(pageNum) var r0 float64 + var r1 float64 + var r2 string + if rf, ok := ret.Get(0).(func(int) (float64, float64, string)); ok { + return rf(pageNum) + } if rf, ok := ret.Get(0).(func(int) float64); ok { r0 = rf(pageNum) } else { r0 = ret.Get(0).(float64) } - var r1 float64 if rf, ok := ret.Get(1).(func(int) float64); ok { r1 = rf(pageNum) } else { r1 = ret.Get(1).(float64) } - var r2 string if rf, ok := ret.Get(2).(func(int) string); ok { r2 = rf(pageNum) } else { @@ -956,6 +3399,34 @@ func (_m *Fpdf) PageSize(pageNum int) (float64, float64, string) { return r0, r1, r2 } +// Fpdf_PageSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PageSize' +type Fpdf_PageSize_Call struct { + *mock.Call +} + +// PageSize is a helper method to define mock.On call +// - pageNum int +func (_e *Fpdf_Expecter) PageSize(pageNum interface{}) *Fpdf_PageSize_Call { + return &Fpdf_PageSize_Call{Call: _e.mock.On("PageSize", pageNum)} +} + +func (_c *Fpdf_PageSize_Call) Run(run func(pageNum int)) *Fpdf_PageSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Fpdf_PageSize_Call) Return(wd float64, ht float64, unitStr string) *Fpdf_PageSize_Call { + _c.Call.Return(wd, ht, unitStr) + return _c +} + +func (_c *Fpdf_PageSize_Call) RunAndReturn(run func(int) (float64, float64, string)) *Fpdf_PageSize_Call { + _c.Call.Return(run) + return _c +} + // PointConvert provides a mock function with given fields: pt func (_m *Fpdf) PointConvert(pt float64) float64 { ret := _m.Called(pt) @@ -970,6 +3441,34 @@ func (_m *Fpdf) PointConvert(pt float64) float64 { return r0 } +// Fpdf_PointConvert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PointConvert' +type Fpdf_PointConvert_Call struct { + *mock.Call +} + +// PointConvert is a helper method to define mock.On call +// - pt float64 +func (_e *Fpdf_Expecter) PointConvert(pt interface{}) *Fpdf_PointConvert_Call { + return &Fpdf_PointConvert_Call{Call: _e.mock.On("PointConvert", pt)} +} + +func (_c *Fpdf_PointConvert_Call) Run(run func(pt float64)) *Fpdf_PointConvert_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_PointConvert_Call) Return(u float64) *Fpdf_PointConvert_Call { + _c.Call.Return(u) + return _c +} + +func (_c *Fpdf_PointConvert_Call) RunAndReturn(run func(float64) float64) *Fpdf_PointConvert_Call { + _c.Call.Return(run) + return _c +} + // PointToUnitConvert provides a mock function with given fields: pt func (_m *Fpdf) PointToUnitConvert(pt float64) float64 { ret := _m.Called(pt) @@ -984,36 +3483,252 @@ func (_m *Fpdf) PointToUnitConvert(pt float64) float64 { return r0 } +// Fpdf_PointToUnitConvert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PointToUnitConvert' +type Fpdf_PointToUnitConvert_Call struct { + *mock.Call +} + +// PointToUnitConvert is a helper method to define mock.On call +// - pt float64 +func (_e *Fpdf_Expecter) PointToUnitConvert(pt interface{}) *Fpdf_PointToUnitConvert_Call { + return &Fpdf_PointToUnitConvert_Call{Call: _e.mock.On("PointToUnitConvert", pt)} +} + +func (_c *Fpdf_PointToUnitConvert_Call) Run(run func(pt float64)) *Fpdf_PointToUnitConvert_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_PointToUnitConvert_Call) Return(u float64) *Fpdf_PointToUnitConvert_Call { + _c.Call.Return(u) + return _c +} + +func (_c *Fpdf_PointToUnitConvert_Call) RunAndReturn(run func(float64) float64) *Fpdf_PointToUnitConvert_Call { + _c.Call.Return(run) + return _c +} + // Polygon provides a mock function with given fields: points, styleStr func (_m *Fpdf) Polygon(points []gofpdf.PointType, styleStr string) { _m.Called(points, styleStr) } +// Fpdf_Polygon_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Polygon' +type Fpdf_Polygon_Call struct { + *mock.Call +} + +// Polygon is a helper method to define mock.On call +// - points []gofpdf.PointType +// - styleStr string +func (_e *Fpdf_Expecter) Polygon(points interface{}, styleStr interface{}) *Fpdf_Polygon_Call { + return &Fpdf_Polygon_Call{Call: _e.mock.On("Polygon", points, styleStr)} +} + +func (_c *Fpdf_Polygon_Call) Run(run func(points []gofpdf.PointType, styleStr string)) *Fpdf_Polygon_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]gofpdf.PointType), args[1].(string)) + }) + return _c +} + +func (_c *Fpdf_Polygon_Call) Return() *Fpdf_Polygon_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Polygon_Call) RunAndReturn(run func([]gofpdf.PointType, string)) *Fpdf_Polygon_Call { + _c.Call.Return(run) + return _c +} + // RadialGradient provides a mock function with given fields: x, y, w, h, r1, g1, b1, r2, g2, b2, x1, y1, x2, y2, r func (_m *Fpdf) RadialGradient(x float64, y float64, w float64, h float64, r1 int, g1 int, b1 int, r2 int, g2 int, b2 int, x1 float64, y1 float64, x2 float64, y2 float64, r float64) { _m.Called(x, y, w, h, r1, g1, b1, r2, g2, b2, x1, y1, x2, y2, r) } +// Fpdf_RadialGradient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RadialGradient' +type Fpdf_RadialGradient_Call struct { + *mock.Call +} + +// RadialGradient is a helper method to define mock.On call +// - x float64 +// - y float64 +// - w float64 +// - h float64 +// - r1 int +// - g1 int +// - b1 int +// - r2 int +// - g2 int +// - b2 int +// - x1 float64 +// - y1 float64 +// - x2 float64 +// - y2 float64 +// - r float64 +func (_e *Fpdf_Expecter) RadialGradient(x interface{}, y interface{}, w interface{}, h interface{}, r1 interface{}, g1 interface{}, b1 interface{}, r2 interface{}, g2 interface{}, b2 interface{}, x1 interface{}, y1 interface{}, x2 interface{}, y2 interface{}, r interface{}) *Fpdf_RadialGradient_Call { + return &Fpdf_RadialGradient_Call{Call: _e.mock.On("RadialGradient", x, y, w, h, r1, g1, b1, r2, g2, b2, x1, y1, x2, y2, r)} +} + +func (_c *Fpdf_RadialGradient_Call) Run(run func(x float64, y float64, w float64, h float64, r1 int, g1 int, b1 int, r2 int, g2 int, b2 int, x1 float64, y1 float64, x2 float64, y2 float64, r float64)) *Fpdf_RadialGradient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(int), args[5].(int), args[6].(int), args[7].(int), args[8].(int), args[9].(int), args[10].(float64), args[11].(float64), args[12].(float64), args[13].(float64), args[14].(float64)) + }) + return _c +} + +func (_c *Fpdf_RadialGradient_Call) Return() *Fpdf_RadialGradient_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_RadialGradient_Call) RunAndReturn(run func(float64, float64, float64, float64, int, int, int, int, int, int, float64, float64, float64, float64, float64)) *Fpdf_RadialGradient_Call { + _c.Call.Return(run) + return _c +} + // RawWriteBuf provides a mock function with given fields: r func (_m *Fpdf) RawWriteBuf(r io.Reader) { _m.Called(r) } +// Fpdf_RawWriteBuf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RawWriteBuf' +type Fpdf_RawWriteBuf_Call struct { + *mock.Call +} + +// RawWriteBuf is a helper method to define mock.On call +// - r io.Reader +func (_e *Fpdf_Expecter) RawWriteBuf(r interface{}) *Fpdf_RawWriteBuf_Call { + return &Fpdf_RawWriteBuf_Call{Call: _e.mock.On("RawWriteBuf", r)} +} + +func (_c *Fpdf_RawWriteBuf_Call) Run(run func(r io.Reader)) *Fpdf_RawWriteBuf_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(io.Reader)) + }) + return _c +} + +func (_c *Fpdf_RawWriteBuf_Call) Return() *Fpdf_RawWriteBuf_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_RawWriteBuf_Call) RunAndReturn(run func(io.Reader)) *Fpdf_RawWriteBuf_Call { + _c.Call.Return(run) + return _c +} + // RawWriteStr provides a mock function with given fields: str func (_m *Fpdf) RawWriteStr(str string) { _m.Called(str) } +// Fpdf_RawWriteStr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RawWriteStr' +type Fpdf_RawWriteStr_Call struct { + *mock.Call +} + +// RawWriteStr is a helper method to define mock.On call +// - str string +func (_e *Fpdf_Expecter) RawWriteStr(str interface{}) *Fpdf_RawWriteStr_Call { + return &Fpdf_RawWriteStr_Call{Call: _e.mock.On("RawWriteStr", str)} +} + +func (_c *Fpdf_RawWriteStr_Call) Run(run func(str string)) *Fpdf_RawWriteStr_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_RawWriteStr_Call) Return() *Fpdf_RawWriteStr_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_RawWriteStr_Call) RunAndReturn(run func(string)) *Fpdf_RawWriteStr_Call { + _c.Call.Return(run) + return _c +} + // Rect provides a mock function with given fields: x, y, w, h, styleStr func (_m *Fpdf) Rect(x float64, y float64, w float64, h float64, styleStr string) { _m.Called(x, y, w, h, styleStr) } +// Fpdf_Rect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Rect' +type Fpdf_Rect_Call struct { + *mock.Call +} + +// Rect is a helper method to define mock.On call +// - x float64 +// - y float64 +// - w float64 +// - h float64 +// - styleStr string +func (_e *Fpdf_Expecter) Rect(x interface{}, y interface{}, w interface{}, h interface{}, styleStr interface{}) *Fpdf_Rect_Call { + return &Fpdf_Rect_Call{Call: _e.mock.On("Rect", x, y, w, h, styleStr)} +} + +func (_c *Fpdf_Rect_Call) Run(run func(x float64, y float64, w float64, h float64, styleStr string)) *Fpdf_Rect_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(string)) + }) + return _c +} + +func (_c *Fpdf_Rect_Call) Return() *Fpdf_Rect_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Rect_Call) RunAndReturn(run func(float64, float64, float64, float64, string)) *Fpdf_Rect_Call { + _c.Call.Return(run) + return _c +} + // RegisterAlias provides a mock function with given fields: alias, replacement func (_m *Fpdf) RegisterAlias(alias string, replacement string) { _m.Called(alias, replacement) } +// Fpdf_RegisterAlias_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterAlias' +type Fpdf_RegisterAlias_Call struct { + *mock.Call +} + +// RegisterAlias is a helper method to define mock.On call +// - alias string +// - replacement string +func (_e *Fpdf_Expecter) RegisterAlias(alias interface{}, replacement interface{}) *Fpdf_RegisterAlias_Call { + return &Fpdf_RegisterAlias_Call{Call: _e.mock.On("RegisterAlias", alias, replacement)} +} + +func (_c *Fpdf_RegisterAlias_Call) Run(run func(alias string, replacement string)) *Fpdf_RegisterAlias_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Fpdf_RegisterAlias_Call) Return() *Fpdf_RegisterAlias_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_RegisterAlias_Call) RunAndReturn(run func(string, string)) *Fpdf_RegisterAlias_Call { + _c.Call.Return(run) + return _c +} + // RegisterImage provides a mock function with given fields: fileStr, tp func (_m *Fpdf) RegisterImage(fileStr string, tp string) *gofpdf.ImageInfoType { ret := _m.Called(fileStr, tp) @@ -1030,8 +3745,37 @@ func (_m *Fpdf) RegisterImage(fileStr string, tp string) *gofpdf.ImageInfoType { return r0 } -// RegisterImageOptions provides a mock function with given fields: fileStr, options -func (_m *Fpdf) RegisterImageOptions(fileStr string, options gofpdf.ImageOptions) *gofpdf.ImageInfoType { +// Fpdf_RegisterImage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterImage' +type Fpdf_RegisterImage_Call struct { + *mock.Call +} + +// RegisterImage is a helper method to define mock.On call +// - fileStr string +// - tp string +func (_e *Fpdf_Expecter) RegisterImage(fileStr interface{}, tp interface{}) *Fpdf_RegisterImage_Call { + return &Fpdf_RegisterImage_Call{Call: _e.mock.On("RegisterImage", fileStr, tp)} +} + +func (_c *Fpdf_RegisterImage_Call) Run(run func(fileStr string, tp string)) *Fpdf_RegisterImage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Fpdf_RegisterImage_Call) Return(info *gofpdf.ImageInfoType) *Fpdf_RegisterImage_Call { + _c.Call.Return(info) + return _c +} + +func (_c *Fpdf_RegisterImage_Call) RunAndReturn(run func(string, string) *gofpdf.ImageInfoType) *Fpdf_RegisterImage_Call { + _c.Call.Return(run) + return _c +} + +// RegisterImageOptions provides a mock function with given fields: fileStr, options +func (_m *Fpdf) RegisterImageOptions(fileStr string, options gofpdf.ImageOptions) *gofpdf.ImageInfoType { ret := _m.Called(fileStr, options) var r0 *gofpdf.ImageInfoType @@ -1046,9 +3790,38 @@ func (_m *Fpdf) RegisterImageOptions(fileStr string, options gofpdf.ImageOptions return r0 } +// Fpdf_RegisterImageOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterImageOptions' +type Fpdf_RegisterImageOptions_Call struct { + *mock.Call +} + +// RegisterImageOptions is a helper method to define mock.On call +// - fileStr string +// - options gofpdf.ImageOptions +func (_e *Fpdf_Expecter) RegisterImageOptions(fileStr interface{}, options interface{}) *Fpdf_RegisterImageOptions_Call { + return &Fpdf_RegisterImageOptions_Call{Call: _e.mock.On("RegisterImageOptions", fileStr, options)} +} + +func (_c *Fpdf_RegisterImageOptions_Call) Run(run func(fileStr string, options gofpdf.ImageOptions)) *Fpdf_RegisterImageOptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(gofpdf.ImageOptions)) + }) + return _c +} + +func (_c *Fpdf_RegisterImageOptions_Call) Return(info *gofpdf.ImageInfoType) *Fpdf_RegisterImageOptions_Call { + _c.Call.Return(info) + return _c +} + +func (_c *Fpdf_RegisterImageOptions_Call) RunAndReturn(run func(string, gofpdf.ImageOptions) *gofpdf.ImageInfoType) *Fpdf_RegisterImageOptions_Call { + _c.Call.Return(run) + return _c +} + // RegisterImageOptionsReader provides a mock function with given fields: imgName, options, r func (_m *Fpdf) RegisterImageOptionsReader(imgName string, options gofpdf.ImageOptions, r io.Reader) *gofpdf.ImageInfoType { - ret := _m.Called("", options, "") + ret := _m.Called(imgName, options, r) var r0 *gofpdf.ImageInfoType if rf, ok := ret.Get(0).(func(string, gofpdf.ImageOptions, io.Reader) *gofpdf.ImageInfoType); ok { @@ -1062,6 +3835,36 @@ func (_m *Fpdf) RegisterImageOptionsReader(imgName string, options gofpdf.ImageO return r0 } +// Fpdf_RegisterImageOptionsReader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterImageOptionsReader' +type Fpdf_RegisterImageOptionsReader_Call struct { + *mock.Call +} + +// RegisterImageOptionsReader is a helper method to define mock.On call +// - imgName string +// - options gofpdf.ImageOptions +// - r io.Reader +func (_e *Fpdf_Expecter) RegisterImageOptionsReader(imgName interface{}, options interface{}, r interface{}) *Fpdf_RegisterImageOptionsReader_Call { + return &Fpdf_RegisterImageOptionsReader_Call{Call: _e.mock.On("RegisterImageOptionsReader", imgName, options, r)} +} + +func (_c *Fpdf_RegisterImageOptionsReader_Call) Run(run func(imgName string, options gofpdf.ImageOptions, r io.Reader)) *Fpdf_RegisterImageOptionsReader_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(gofpdf.ImageOptions), args[2].(io.Reader)) + }) + return _c +} + +func (_c *Fpdf_RegisterImageOptionsReader_Call) Return(info *gofpdf.ImageInfoType) *Fpdf_RegisterImageOptionsReader_Call { + _c.Call.Return(info) + return _c +} + +func (_c *Fpdf_RegisterImageOptionsReader_Call) RunAndReturn(run func(string, gofpdf.ImageOptions, io.Reader) *gofpdf.ImageInfoType) *Fpdf_RegisterImageOptionsReader_Call { + _c.Call.Return(run) + return _c +} + // RegisterImageReader provides a mock function with given fields: imgName, tp, r func (_m *Fpdf) RegisterImageReader(imgName string, tp string, r io.Reader) *gofpdf.ImageInfoType { ret := _m.Called(imgName, tp, r) @@ -1078,81 +3881,541 @@ func (_m *Fpdf) RegisterImageReader(imgName string, tp string, r io.Reader) *gof return r0 } +// Fpdf_RegisterImageReader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterImageReader' +type Fpdf_RegisterImageReader_Call struct { + *mock.Call +} + +// RegisterImageReader is a helper method to define mock.On call +// - imgName string +// - tp string +// - r io.Reader +func (_e *Fpdf_Expecter) RegisterImageReader(imgName interface{}, tp interface{}, r interface{}) *Fpdf_RegisterImageReader_Call { + return &Fpdf_RegisterImageReader_Call{Call: _e.mock.On("RegisterImageReader", imgName, tp, r)} +} + +func (_c *Fpdf_RegisterImageReader_Call) Run(run func(imgName string, tp string, r io.Reader)) *Fpdf_RegisterImageReader_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(io.Reader)) + }) + return _c +} + +func (_c *Fpdf_RegisterImageReader_Call) Return(info *gofpdf.ImageInfoType) *Fpdf_RegisterImageReader_Call { + _c.Call.Return(info) + return _c +} + +func (_c *Fpdf_RegisterImageReader_Call) RunAndReturn(run func(string, string, io.Reader) *gofpdf.ImageInfoType) *Fpdf_RegisterImageReader_Call { + _c.Call.Return(run) + return _c +} + // SVGBasicWrite provides a mock function with given fields: sb, scale func (_m *Fpdf) SVGBasicWrite(sb *gofpdf.SVGBasicType, scale float64) { _m.Called(sb, scale) } +// Fpdf_SVGBasicWrite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SVGBasicWrite' +type Fpdf_SVGBasicWrite_Call struct { + *mock.Call +} + +// SVGBasicWrite is a helper method to define mock.On call +// - sb *gofpdf.SVGBasicType +// - scale float64 +func (_e *Fpdf_Expecter) SVGBasicWrite(sb interface{}, scale interface{}) *Fpdf_SVGBasicWrite_Call { + return &Fpdf_SVGBasicWrite_Call{Call: _e.mock.On("SVGBasicWrite", sb, scale)} +} + +func (_c *Fpdf_SVGBasicWrite_Call) Run(run func(sb *gofpdf.SVGBasicType, scale float64)) *Fpdf_SVGBasicWrite_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*gofpdf.SVGBasicType), args[1].(float64)) + }) + return _c +} + +func (_c *Fpdf_SVGBasicWrite_Call) Return() *Fpdf_SVGBasicWrite_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SVGBasicWrite_Call) RunAndReturn(run func(*gofpdf.SVGBasicType, float64)) *Fpdf_SVGBasicWrite_Call { + _c.Call.Return(run) + return _c +} + // SetAcceptPageBreakFunc provides a mock function with given fields: fnc func (_m *Fpdf) SetAcceptPageBreakFunc(fnc func() bool) { _m.Called(fnc) } +// Fpdf_SetAcceptPageBreakFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAcceptPageBreakFunc' +type Fpdf_SetAcceptPageBreakFunc_Call struct { + *mock.Call +} + +// SetAcceptPageBreakFunc is a helper method to define mock.On call +// - fnc func() bool +func (_e *Fpdf_Expecter) SetAcceptPageBreakFunc(fnc interface{}) *Fpdf_SetAcceptPageBreakFunc_Call { + return &Fpdf_SetAcceptPageBreakFunc_Call{Call: _e.mock.On("SetAcceptPageBreakFunc", fnc)} +} + +func (_c *Fpdf_SetAcceptPageBreakFunc_Call) Run(run func(fnc func() bool)) *Fpdf_SetAcceptPageBreakFunc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func() bool)) + }) + return _c +} + +func (_c *Fpdf_SetAcceptPageBreakFunc_Call) Return() *Fpdf_SetAcceptPageBreakFunc_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetAcceptPageBreakFunc_Call) RunAndReturn(run func(func() bool)) *Fpdf_SetAcceptPageBreakFunc_Call { + _c.Call.Return(run) + return _c +} + // SetAlpha provides a mock function with given fields: alpha, blendModeStr func (_m *Fpdf) SetAlpha(alpha float64, blendModeStr string) { _m.Called(alpha, blendModeStr) } +// Fpdf_SetAlpha_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAlpha' +type Fpdf_SetAlpha_Call struct { + *mock.Call +} + +// SetAlpha is a helper method to define mock.On call +// - alpha float64 +// - blendModeStr string +func (_e *Fpdf_Expecter) SetAlpha(alpha interface{}, blendModeStr interface{}) *Fpdf_SetAlpha_Call { + return &Fpdf_SetAlpha_Call{Call: _e.mock.On("SetAlpha", alpha, blendModeStr)} +} + +func (_c *Fpdf_SetAlpha_Call) Run(run func(alpha float64, blendModeStr string)) *Fpdf_SetAlpha_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(string)) + }) + return _c +} + +func (_c *Fpdf_SetAlpha_Call) Return() *Fpdf_SetAlpha_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetAlpha_Call) RunAndReturn(run func(float64, string)) *Fpdf_SetAlpha_Call { + _c.Call.Return(run) + return _c +} + // SetAuthor provides a mock function with given fields: authorStr, isUTF8 func (_m *Fpdf) SetAuthor(authorStr string, isUTF8 bool) { _m.Called(authorStr, isUTF8) } +// Fpdf_SetAuthor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAuthor' +type Fpdf_SetAuthor_Call struct { + *mock.Call +} + +// SetAuthor is a helper method to define mock.On call +// - authorStr string +// - isUTF8 bool +func (_e *Fpdf_Expecter) SetAuthor(authorStr interface{}, isUTF8 interface{}) *Fpdf_SetAuthor_Call { + return &Fpdf_SetAuthor_Call{Call: _e.mock.On("SetAuthor", authorStr, isUTF8)} +} + +func (_c *Fpdf_SetAuthor_Call) Run(run func(authorStr string, isUTF8 bool)) *Fpdf_SetAuthor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(bool)) + }) + return _c +} + +func (_c *Fpdf_SetAuthor_Call) Return() *Fpdf_SetAuthor_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetAuthor_Call) RunAndReturn(run func(string, bool)) *Fpdf_SetAuthor_Call { + _c.Call.Return(run) + return _c +} + // SetAutoPageBreak provides a mock function with given fields: auto, margin func (_m *Fpdf) SetAutoPageBreak(auto bool, margin float64) { _m.Called(auto, margin) } +// Fpdf_SetAutoPageBreak_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAutoPageBreak' +type Fpdf_SetAutoPageBreak_Call struct { + *mock.Call +} + +// SetAutoPageBreak is a helper method to define mock.On call +// - auto bool +// - margin float64 +func (_e *Fpdf_Expecter) SetAutoPageBreak(auto interface{}, margin interface{}) *Fpdf_SetAutoPageBreak_Call { + return &Fpdf_SetAutoPageBreak_Call{Call: _e.mock.On("SetAutoPageBreak", auto, margin)} +} + +func (_c *Fpdf_SetAutoPageBreak_Call) Run(run func(auto bool, margin float64)) *Fpdf_SetAutoPageBreak_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(bool), args[1].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetAutoPageBreak_Call) Return() *Fpdf_SetAutoPageBreak_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetAutoPageBreak_Call) RunAndReturn(run func(bool, float64)) *Fpdf_SetAutoPageBreak_Call { + _c.Call.Return(run) + return _c +} + // SetCatalogSort provides a mock function with given fields: flag func (_m *Fpdf) SetCatalogSort(flag bool) { _m.Called(flag) } +// Fpdf_SetCatalogSort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCatalogSort' +type Fpdf_SetCatalogSort_Call struct { + *mock.Call +} + +// SetCatalogSort is a helper method to define mock.On call +// - flag bool +func (_e *Fpdf_Expecter) SetCatalogSort(flag interface{}) *Fpdf_SetCatalogSort_Call { + return &Fpdf_SetCatalogSort_Call{Call: _e.mock.On("SetCatalogSort", flag)} +} + +func (_c *Fpdf_SetCatalogSort_Call) Run(run func(flag bool)) *Fpdf_SetCatalogSort_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(bool)) + }) + return _c +} + +func (_c *Fpdf_SetCatalogSort_Call) Return() *Fpdf_SetCatalogSort_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetCatalogSort_Call) RunAndReturn(run func(bool)) *Fpdf_SetCatalogSort_Call { + _c.Call.Return(run) + return _c +} + // SetCellMargin provides a mock function with given fields: margin func (_m *Fpdf) SetCellMargin(margin float64) { _m.Called(margin) } +// Fpdf_SetCellMargin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCellMargin' +type Fpdf_SetCellMargin_Call struct { + *mock.Call +} + +// SetCellMargin is a helper method to define mock.On call +// - margin float64 +func (_e *Fpdf_Expecter) SetCellMargin(margin interface{}) *Fpdf_SetCellMargin_Call { + return &Fpdf_SetCellMargin_Call{Call: _e.mock.On("SetCellMargin", margin)} +} + +func (_c *Fpdf_SetCellMargin_Call) Run(run func(margin float64)) *Fpdf_SetCellMargin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetCellMargin_Call) Return() *Fpdf_SetCellMargin_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetCellMargin_Call) RunAndReturn(run func(float64)) *Fpdf_SetCellMargin_Call { + _c.Call.Return(run) + return _c +} + // SetCompression provides a mock function with given fields: compress func (_m *Fpdf) SetCompression(compress bool) { _m.Called(compress) } +// Fpdf_SetCompression_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCompression' +type Fpdf_SetCompression_Call struct { + *mock.Call +} + +// SetCompression is a helper method to define mock.On call +// - compress bool +func (_e *Fpdf_Expecter) SetCompression(compress interface{}) *Fpdf_SetCompression_Call { + return &Fpdf_SetCompression_Call{Call: _e.mock.On("SetCompression", compress)} +} + +func (_c *Fpdf_SetCompression_Call) Run(run func(compress bool)) *Fpdf_SetCompression_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(bool)) + }) + return _c +} + +func (_c *Fpdf_SetCompression_Call) Return() *Fpdf_SetCompression_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetCompression_Call) RunAndReturn(run func(bool)) *Fpdf_SetCompression_Call { + _c.Call.Return(run) + return _c +} + // SetCreationDate provides a mock function with given fields: tm func (_m *Fpdf) SetCreationDate(tm time.Time) { _m.Called(tm) } +// Fpdf_SetCreationDate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCreationDate' +type Fpdf_SetCreationDate_Call struct { + *mock.Call +} + +// SetCreationDate is a helper method to define mock.On call +// - tm time.Time +func (_e *Fpdf_Expecter) SetCreationDate(tm interface{}) *Fpdf_SetCreationDate_Call { + return &Fpdf_SetCreationDate_Call{Call: _e.mock.On("SetCreationDate", tm)} +} + +func (_c *Fpdf_SetCreationDate_Call) Run(run func(tm time.Time)) *Fpdf_SetCreationDate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(time.Time)) + }) + return _c +} + +func (_c *Fpdf_SetCreationDate_Call) Return() *Fpdf_SetCreationDate_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetCreationDate_Call) RunAndReturn(run func(time.Time)) *Fpdf_SetCreationDate_Call { + _c.Call.Return(run) + return _c +} + // SetCreator provides a mock function with given fields: creatorStr, isUTF8 func (_m *Fpdf) SetCreator(creatorStr string, isUTF8 bool) { _m.Called(creatorStr, isUTF8) } +// Fpdf_SetCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCreator' +type Fpdf_SetCreator_Call struct { + *mock.Call +} + +// SetCreator is a helper method to define mock.On call +// - creatorStr string +// - isUTF8 bool +func (_e *Fpdf_Expecter) SetCreator(creatorStr interface{}, isUTF8 interface{}) *Fpdf_SetCreator_Call { + return &Fpdf_SetCreator_Call{Call: _e.mock.On("SetCreator", creatorStr, isUTF8)} +} + +func (_c *Fpdf_SetCreator_Call) Run(run func(creatorStr string, isUTF8 bool)) *Fpdf_SetCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(bool)) + }) + return _c +} + +func (_c *Fpdf_SetCreator_Call) Return() *Fpdf_SetCreator_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetCreator_Call) RunAndReturn(run func(string, bool)) *Fpdf_SetCreator_Call { + _c.Call.Return(run) + return _c +} + // SetDashPattern provides a mock function with given fields: dashArray, dashPhase func (_m *Fpdf) SetDashPattern(dashArray []float64, dashPhase float64) { _m.Called(dashArray, dashPhase) } +// Fpdf_SetDashPattern_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDashPattern' +type Fpdf_SetDashPattern_Call struct { + *mock.Call +} + +// SetDashPattern is a helper method to define mock.On call +// - dashArray []float64 +// - dashPhase float64 +func (_e *Fpdf_Expecter) SetDashPattern(dashArray interface{}, dashPhase interface{}) *Fpdf_SetDashPattern_Call { + return &Fpdf_SetDashPattern_Call{Call: _e.mock.On("SetDashPattern", dashArray, dashPhase)} +} + +func (_c *Fpdf_SetDashPattern_Call) Run(run func(dashArray []float64, dashPhase float64)) *Fpdf_SetDashPattern_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]float64), args[1].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetDashPattern_Call) Return() *Fpdf_SetDashPattern_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetDashPattern_Call) RunAndReturn(run func([]float64, float64)) *Fpdf_SetDashPattern_Call { + _c.Call.Return(run) + return _c +} + // SetDisplayMode provides a mock function with given fields: zoomStr, layoutStr func (_m *Fpdf) SetDisplayMode(zoomStr string, layoutStr string) { _m.Called(zoomStr, layoutStr) } +// Fpdf_SetDisplayMode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDisplayMode' +type Fpdf_SetDisplayMode_Call struct { + *mock.Call +} + +// SetDisplayMode is a helper method to define mock.On call +// - zoomStr string +// - layoutStr string +func (_e *Fpdf_Expecter) SetDisplayMode(zoomStr interface{}, layoutStr interface{}) *Fpdf_SetDisplayMode_Call { + return &Fpdf_SetDisplayMode_Call{Call: _e.mock.On("SetDisplayMode", zoomStr, layoutStr)} +} + +func (_c *Fpdf_SetDisplayMode_Call) Run(run func(zoomStr string, layoutStr string)) *Fpdf_SetDisplayMode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Fpdf_SetDisplayMode_Call) Return() *Fpdf_SetDisplayMode_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetDisplayMode_Call) RunAndReturn(run func(string, string)) *Fpdf_SetDisplayMode_Call { + _c.Call.Return(run) + return _c +} + // SetDrawColor provides a mock function with given fields: r, g, b func (_m *Fpdf) SetDrawColor(r int, g int, b int) { _m.Called(r, g, b) } +// Fpdf_SetDrawColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDrawColor' +type Fpdf_SetDrawColor_Call struct { + *mock.Call +} + +// SetDrawColor is a helper method to define mock.On call +// - r int +// - g int +// - b int +func (_e *Fpdf_Expecter) SetDrawColor(r interface{}, g interface{}, b interface{}) *Fpdf_SetDrawColor_Call { + return &Fpdf_SetDrawColor_Call{Call: _e.mock.On("SetDrawColor", r, g, b)} +} + +func (_c *Fpdf_SetDrawColor_Call) Run(run func(r int, g int, b int)) *Fpdf_SetDrawColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *Fpdf_SetDrawColor_Call) Return() *Fpdf_SetDrawColor_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetDrawColor_Call) RunAndReturn(run func(int, int, int)) *Fpdf_SetDrawColor_Call { + _c.Call.Return(run) + return _c +} + // SetDrawSpotColor provides a mock function with given fields: nameStr, tint func (_m *Fpdf) SetDrawSpotColor(nameStr string, tint byte) { _m.Called(nameStr, tint) } +// Fpdf_SetDrawSpotColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDrawSpotColor' +type Fpdf_SetDrawSpotColor_Call struct { + *mock.Call +} + +// SetDrawSpotColor is a helper method to define mock.On call +// - nameStr string +// - tint byte +func (_e *Fpdf_Expecter) SetDrawSpotColor(nameStr interface{}, tint interface{}) *Fpdf_SetDrawSpotColor_Call { + return &Fpdf_SetDrawSpotColor_Call{Call: _e.mock.On("SetDrawSpotColor", nameStr, tint)} +} + +func (_c *Fpdf_SetDrawSpotColor_Call) Run(run func(nameStr string, tint byte)) *Fpdf_SetDrawSpotColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(byte)) + }) + return _c +} + +func (_c *Fpdf_SetDrawSpotColor_Call) Return() *Fpdf_SetDrawSpotColor_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetDrawSpotColor_Call) RunAndReturn(run func(string, byte)) *Fpdf_SetDrawSpotColor_Call { + _c.Call.Return(run) + return _c +} + // SetError provides a mock function with given fields: err func (_m *Fpdf) SetError(err error) { _m.Called(err) } +// Fpdf_SetError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetError' +type Fpdf_SetError_Call struct { + *mock.Call +} + +// SetError is a helper method to define mock.On call +// - err error +func (_e *Fpdf_Expecter) SetError(err interface{}) *Fpdf_SetError_Call { + return &Fpdf_SetError_Call{Call: _e.mock.On("SetError", err)} +} + +func (_c *Fpdf_SetError_Call) Run(run func(err error)) *Fpdf_SetError_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(error)) + }) + return _c +} + +func (_c *Fpdf_SetError_Call) Return() *Fpdf_SetError_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetError_Call) RunAndReturn(run func(error)) *Fpdf_SetError_Call { + _c.Call.Return(run) + return _c +} + // SetErrorf provides a mock function with given fields: fmtStr, args func (_m *Fpdf) SetErrorf(fmtStr string, args ...interface{}) { var _ca []interface{} @@ -1161,69 +4424,474 @@ func (_m *Fpdf) SetErrorf(fmtStr string, args ...interface{}) { _m.Called(_ca...) } +// Fpdf_SetErrorf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetErrorf' +type Fpdf_SetErrorf_Call struct { + *mock.Call +} + +// SetErrorf is a helper method to define mock.On call +// - fmtStr string +// - args ...interface{} +func (_e *Fpdf_Expecter) SetErrorf(fmtStr interface{}, args ...interface{}) *Fpdf_SetErrorf_Call { + return &Fpdf_SetErrorf_Call{Call: _e.mock.On("SetErrorf", + append([]interface{}{fmtStr}, args...)...)} +} + +func (_c *Fpdf_SetErrorf_Call) Run(run func(fmtStr string, args ...interface{})) *Fpdf_SetErrorf_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *Fpdf_SetErrorf_Call) Return() *Fpdf_SetErrorf_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetErrorf_Call) RunAndReturn(run func(string, ...interface{})) *Fpdf_SetErrorf_Call { + _c.Call.Return(run) + return _c +} + // SetFillColor provides a mock function with given fields: r, g, b func (_m *Fpdf) SetFillColor(r int, g int, b int) { _m.Called(r, g, b) } +// Fpdf_SetFillColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFillColor' +type Fpdf_SetFillColor_Call struct { + *mock.Call +} + +// SetFillColor is a helper method to define mock.On call +// - r int +// - g int +// - b int +func (_e *Fpdf_Expecter) SetFillColor(r interface{}, g interface{}, b interface{}) *Fpdf_SetFillColor_Call { + return &Fpdf_SetFillColor_Call{Call: _e.mock.On("SetFillColor", r, g, b)} +} + +func (_c *Fpdf_SetFillColor_Call) Run(run func(r int, g int, b int)) *Fpdf_SetFillColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *Fpdf_SetFillColor_Call) Return() *Fpdf_SetFillColor_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetFillColor_Call) RunAndReturn(run func(int, int, int)) *Fpdf_SetFillColor_Call { + _c.Call.Return(run) + return _c +} + // SetFillSpotColor provides a mock function with given fields: nameStr, tint func (_m *Fpdf) SetFillSpotColor(nameStr string, tint byte) { _m.Called(nameStr, tint) } +// Fpdf_SetFillSpotColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFillSpotColor' +type Fpdf_SetFillSpotColor_Call struct { + *mock.Call +} + +// SetFillSpotColor is a helper method to define mock.On call +// - nameStr string +// - tint byte +func (_e *Fpdf_Expecter) SetFillSpotColor(nameStr interface{}, tint interface{}) *Fpdf_SetFillSpotColor_Call { + return &Fpdf_SetFillSpotColor_Call{Call: _e.mock.On("SetFillSpotColor", nameStr, tint)} +} + +func (_c *Fpdf_SetFillSpotColor_Call) Run(run func(nameStr string, tint byte)) *Fpdf_SetFillSpotColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(byte)) + }) + return _c +} + +func (_c *Fpdf_SetFillSpotColor_Call) Return() *Fpdf_SetFillSpotColor_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetFillSpotColor_Call) RunAndReturn(run func(string, byte)) *Fpdf_SetFillSpotColor_Call { + _c.Call.Return(run) + return _c +} + // SetFont provides a mock function with given fields: familyStr, styleStr, size func (_m *Fpdf) SetFont(familyStr string, styleStr string, size float64) { _m.Called(familyStr, styleStr, size) } -// SetFontLoader provides a mock function with given fields: loader -func (_m *Fpdf) SetFontLoader(loader gofpdf.FontLoader) { - _m.Called(loader) +// Fpdf_SetFont_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFont' +type Fpdf_SetFont_Call struct { + *mock.Call } -// SetFontLocation provides a mock function with given fields: fontDirStr -func (_m *Fpdf) SetFontLocation(fontDirStr string) { - _m.Called(fontDirStr) +// SetFont is a helper method to define mock.On call +// - familyStr string +// - styleStr string +// - size float64 +func (_e *Fpdf_Expecter) SetFont(familyStr interface{}, styleStr interface{}, size interface{}) *Fpdf_SetFont_Call { + return &Fpdf_SetFont_Call{Call: _e.mock.On("SetFont", familyStr, styleStr, size)} } -// SetFontSize provides a mock function with given fields: size -func (_m *Fpdf) SetFontSize(size float64) { - _m.Called(size) +func (_c *Fpdf_SetFont_Call) Run(run func(familyStr string, styleStr string, size float64)) *Fpdf_SetFont_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(float64)) + }) + return _c } -// SetFontStyle provides a mock function with given fields: styleStr -func (_m *Fpdf) SetFontStyle(styleStr string) { - _m.Called(styleStr) +func (_c *Fpdf_SetFont_Call) Return() *Fpdf_SetFont_Call { + _c.Call.Return() + return _c } -// SetFontUnitSize provides a mock function with given fields: size -func (_m *Fpdf) SetFontUnitSize(size float64) { - _m.Called(size) +func (_c *Fpdf_SetFont_Call) RunAndReturn(run func(string, string, float64)) *Fpdf_SetFont_Call { + _c.Call.Return(run) + return _c } -// SetFooterFunc provides a mock function with given fields: fnc -func (_m *Fpdf) SetFooterFunc(fnc func()) { - _m.Called(fnc) +// SetFontLoader provides a mock function with given fields: loader +func (_m *Fpdf) SetFontLoader(loader gofpdf.FontLoader) { + _m.Called(loader) } -// SetFooterFuncLpi provides a mock function with given fields: fnc -func (_m *Fpdf) SetFooterFuncLpi(fnc func(bool)) { - _m.Called(fnc) +// Fpdf_SetFontLoader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFontLoader' +type Fpdf_SetFontLoader_Call struct { + *mock.Call } -// SetHeaderFunc provides a mock function with given fields: fnc -func (_m *Fpdf) SetHeaderFunc(fnc func()) { - _m.Called(fnc) +// SetFontLoader is a helper method to define mock.On call +// - loader gofpdf.FontLoader +func (_e *Fpdf_Expecter) SetFontLoader(loader interface{}) *Fpdf_SetFontLoader_Call { + return &Fpdf_SetFontLoader_Call{Call: _e.mock.On("SetFontLoader", loader)} } -// SetHeaderFuncMode provides a mock function with given fields: fnc, homeMode -func (_m *Fpdf) SetHeaderFuncMode(fnc func(), homeMode bool) { - _m.Called(fnc, homeMode) +func (_c *Fpdf_SetFontLoader_Call) Run(run func(loader gofpdf.FontLoader)) *Fpdf_SetFontLoader_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(gofpdf.FontLoader)) + }) + return _c } -// SetHomeXY provides a mock function with given fields: -func (_m *Fpdf) SetHomeXY() { - _m.Called() +func (_c *Fpdf_SetFontLoader_Call) Return() *Fpdf_SetFontLoader_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetFontLoader_Call) RunAndReturn(run func(gofpdf.FontLoader)) *Fpdf_SetFontLoader_Call { + _c.Call.Return(run) + return _c +} + +// SetFontLocation provides a mock function with given fields: fontDirStr +func (_m *Fpdf) SetFontLocation(fontDirStr string) { + _m.Called(fontDirStr) +} + +// Fpdf_SetFontLocation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFontLocation' +type Fpdf_SetFontLocation_Call struct { + *mock.Call +} + +// SetFontLocation is a helper method to define mock.On call +// - fontDirStr string +func (_e *Fpdf_Expecter) SetFontLocation(fontDirStr interface{}) *Fpdf_SetFontLocation_Call { + return &Fpdf_SetFontLocation_Call{Call: _e.mock.On("SetFontLocation", fontDirStr)} +} + +func (_c *Fpdf_SetFontLocation_Call) Run(run func(fontDirStr string)) *Fpdf_SetFontLocation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_SetFontLocation_Call) Return() *Fpdf_SetFontLocation_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetFontLocation_Call) RunAndReturn(run func(string)) *Fpdf_SetFontLocation_Call { + _c.Call.Return(run) + return _c +} + +// SetFontSize provides a mock function with given fields: size +func (_m *Fpdf) SetFontSize(size float64) { + _m.Called(size) +} + +// Fpdf_SetFontSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFontSize' +type Fpdf_SetFontSize_Call struct { + *mock.Call +} + +// SetFontSize is a helper method to define mock.On call +// - size float64 +func (_e *Fpdf_Expecter) SetFontSize(size interface{}) *Fpdf_SetFontSize_Call { + return &Fpdf_SetFontSize_Call{Call: _e.mock.On("SetFontSize", size)} +} + +func (_c *Fpdf_SetFontSize_Call) Run(run func(size float64)) *Fpdf_SetFontSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetFontSize_Call) Return() *Fpdf_SetFontSize_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetFontSize_Call) RunAndReturn(run func(float64)) *Fpdf_SetFontSize_Call { + _c.Call.Return(run) + return _c +} + +// SetFontStyle provides a mock function with given fields: styleStr +func (_m *Fpdf) SetFontStyle(styleStr string) { + _m.Called(styleStr) +} + +// Fpdf_SetFontStyle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFontStyle' +type Fpdf_SetFontStyle_Call struct { + *mock.Call +} + +// SetFontStyle is a helper method to define mock.On call +// - styleStr string +func (_e *Fpdf_Expecter) SetFontStyle(styleStr interface{}) *Fpdf_SetFontStyle_Call { + return &Fpdf_SetFontStyle_Call{Call: _e.mock.On("SetFontStyle", styleStr)} +} + +func (_c *Fpdf_SetFontStyle_Call) Run(run func(styleStr string)) *Fpdf_SetFontStyle_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_SetFontStyle_Call) Return() *Fpdf_SetFontStyle_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetFontStyle_Call) RunAndReturn(run func(string)) *Fpdf_SetFontStyle_Call { + _c.Call.Return(run) + return _c +} + +// SetFontUnitSize provides a mock function with given fields: size +func (_m *Fpdf) SetFontUnitSize(size float64) { + _m.Called(size) +} + +// Fpdf_SetFontUnitSize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFontUnitSize' +type Fpdf_SetFontUnitSize_Call struct { + *mock.Call +} + +// SetFontUnitSize is a helper method to define mock.On call +// - size float64 +func (_e *Fpdf_Expecter) SetFontUnitSize(size interface{}) *Fpdf_SetFontUnitSize_Call { + return &Fpdf_SetFontUnitSize_Call{Call: _e.mock.On("SetFontUnitSize", size)} +} + +func (_c *Fpdf_SetFontUnitSize_Call) Run(run func(size float64)) *Fpdf_SetFontUnitSize_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetFontUnitSize_Call) Return() *Fpdf_SetFontUnitSize_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetFontUnitSize_Call) RunAndReturn(run func(float64)) *Fpdf_SetFontUnitSize_Call { + _c.Call.Return(run) + return _c +} + +// SetFooterFunc provides a mock function with given fields: fnc +func (_m *Fpdf) SetFooterFunc(fnc func()) { + _m.Called(fnc) +} + +// Fpdf_SetFooterFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFooterFunc' +type Fpdf_SetFooterFunc_Call struct { + *mock.Call +} + +// SetFooterFunc is a helper method to define mock.On call +// - fnc func() +func (_e *Fpdf_Expecter) SetFooterFunc(fnc interface{}) *Fpdf_SetFooterFunc_Call { + return &Fpdf_SetFooterFunc_Call{Call: _e.mock.On("SetFooterFunc", fnc)} +} + +func (_c *Fpdf_SetFooterFunc_Call) Run(run func(fnc func())) *Fpdf_SetFooterFunc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func())) + }) + return _c +} + +func (_c *Fpdf_SetFooterFunc_Call) Return() *Fpdf_SetFooterFunc_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetFooterFunc_Call) RunAndReturn(run func(func())) *Fpdf_SetFooterFunc_Call { + _c.Call.Return(run) + return _c +} + +// SetFooterFuncLpi provides a mock function with given fields: fnc +func (_m *Fpdf) SetFooterFuncLpi(fnc func(bool)) { + _m.Called(fnc) +} + +// Fpdf_SetFooterFuncLpi_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFooterFuncLpi' +type Fpdf_SetFooterFuncLpi_Call struct { + *mock.Call +} + +// SetFooterFuncLpi is a helper method to define mock.On call +// - fnc func(bool) +func (_e *Fpdf_Expecter) SetFooterFuncLpi(fnc interface{}) *Fpdf_SetFooterFuncLpi_Call { + return &Fpdf_SetFooterFuncLpi_Call{Call: _e.mock.On("SetFooterFuncLpi", fnc)} +} + +func (_c *Fpdf_SetFooterFuncLpi_Call) Run(run func(fnc func(bool))) *Fpdf_SetFooterFuncLpi_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func(bool))) + }) + return _c +} + +func (_c *Fpdf_SetFooterFuncLpi_Call) Return() *Fpdf_SetFooterFuncLpi_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetFooterFuncLpi_Call) RunAndReturn(run func(func(bool))) *Fpdf_SetFooterFuncLpi_Call { + _c.Call.Return(run) + return _c +} + +// SetHeaderFunc provides a mock function with given fields: fnc +func (_m *Fpdf) SetHeaderFunc(fnc func()) { + _m.Called(fnc) +} + +// Fpdf_SetHeaderFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHeaderFunc' +type Fpdf_SetHeaderFunc_Call struct { + *mock.Call +} + +// SetHeaderFunc is a helper method to define mock.On call +// - fnc func() +func (_e *Fpdf_Expecter) SetHeaderFunc(fnc interface{}) *Fpdf_SetHeaderFunc_Call { + return &Fpdf_SetHeaderFunc_Call{Call: _e.mock.On("SetHeaderFunc", fnc)} +} + +func (_c *Fpdf_SetHeaderFunc_Call) Run(run func(fnc func())) *Fpdf_SetHeaderFunc_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func())) + }) + return _c +} + +func (_c *Fpdf_SetHeaderFunc_Call) Return() *Fpdf_SetHeaderFunc_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetHeaderFunc_Call) RunAndReturn(run func(func())) *Fpdf_SetHeaderFunc_Call { + _c.Call.Return(run) + return _c +} + +// SetHeaderFuncMode provides a mock function with given fields: fnc, homeMode +func (_m *Fpdf) SetHeaderFuncMode(fnc func(), homeMode bool) { + _m.Called(fnc, homeMode) +} + +// Fpdf_SetHeaderFuncMode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHeaderFuncMode' +type Fpdf_SetHeaderFuncMode_Call struct { + *mock.Call +} + +// SetHeaderFuncMode is a helper method to define mock.On call +// - fnc func() +// - homeMode bool +func (_e *Fpdf_Expecter) SetHeaderFuncMode(fnc interface{}, homeMode interface{}) *Fpdf_SetHeaderFuncMode_Call { + return &Fpdf_SetHeaderFuncMode_Call{Call: _e.mock.On("SetHeaderFuncMode", fnc, homeMode)} +} + +func (_c *Fpdf_SetHeaderFuncMode_Call) Run(run func(fnc func(), homeMode bool)) *Fpdf_SetHeaderFuncMode_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func()), args[1].(bool)) + }) + return _c +} + +func (_c *Fpdf_SetHeaderFuncMode_Call) Return() *Fpdf_SetHeaderFuncMode_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetHeaderFuncMode_Call) RunAndReturn(run func(func(), bool)) *Fpdf_SetHeaderFuncMode_Call { + _c.Call.Return(run) + return _c +} + +// SetHomeXY provides a mock function with given fields: +func (_m *Fpdf) SetHomeXY() { + _m.Called() +} + +// Fpdf_SetHomeXY_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetHomeXY' +type Fpdf_SetHomeXY_Call struct { + *mock.Call +} + +// SetHomeXY is a helper method to define mock.On call +func (_e *Fpdf_Expecter) SetHomeXY() *Fpdf_SetHomeXY_Call { + return &Fpdf_SetHomeXY_Call{Call: _e.mock.On("SetHomeXY")} +} + +func (_c *Fpdf_SetHomeXY_Call) Run(run func()) *Fpdf_SetHomeXY_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_SetHomeXY_Call) Return() *Fpdf_SetHomeXY_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetHomeXY_Call) RunAndReturn(run func()) *Fpdf_SetHomeXY_Call { + _c.Call.Return(run) + return _c } // SetJavascript provides a mock function with given fields: script @@ -1231,234 +4899,1478 @@ func (_m *Fpdf) SetJavascript(script string) { _m.Called(script) } +// Fpdf_SetJavascript_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetJavascript' +type Fpdf_SetJavascript_Call struct { + *mock.Call +} + +// SetJavascript is a helper method to define mock.On call +// - script string +func (_e *Fpdf_Expecter) SetJavascript(script interface{}) *Fpdf_SetJavascript_Call { + return &Fpdf_SetJavascript_Call{Call: _e.mock.On("SetJavascript", script)} +} + +func (_c *Fpdf_SetJavascript_Call) Run(run func(script string)) *Fpdf_SetJavascript_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_SetJavascript_Call) Return() *Fpdf_SetJavascript_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetJavascript_Call) RunAndReturn(run func(string)) *Fpdf_SetJavascript_Call { + _c.Call.Return(run) + return _c +} + // SetKeywords provides a mock function with given fields: keywordsStr, isUTF8 func (_m *Fpdf) SetKeywords(keywordsStr string, isUTF8 bool) { _m.Called(keywordsStr, isUTF8) } +// Fpdf_SetKeywords_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetKeywords' +type Fpdf_SetKeywords_Call struct { + *mock.Call +} + +// SetKeywords is a helper method to define mock.On call +// - keywordsStr string +// - isUTF8 bool +func (_e *Fpdf_Expecter) SetKeywords(keywordsStr interface{}, isUTF8 interface{}) *Fpdf_SetKeywords_Call { + return &Fpdf_SetKeywords_Call{Call: _e.mock.On("SetKeywords", keywordsStr, isUTF8)} +} + +func (_c *Fpdf_SetKeywords_Call) Run(run func(keywordsStr string, isUTF8 bool)) *Fpdf_SetKeywords_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(bool)) + }) + return _c +} + +func (_c *Fpdf_SetKeywords_Call) Return() *Fpdf_SetKeywords_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetKeywords_Call) RunAndReturn(run func(string, bool)) *Fpdf_SetKeywords_Call { + _c.Call.Return(run) + return _c +} + // SetLeftMargin provides a mock function with given fields: margin func (_m *Fpdf) SetLeftMargin(margin float64) { _m.Called(margin) } -// SetLineCapStyle provides a mock function with given fields: styleStr -func (_m *Fpdf) SetLineCapStyle(styleStr string) { - _m.Called(styleStr) +// Fpdf_SetLeftMargin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLeftMargin' +type Fpdf_SetLeftMargin_Call struct { + *mock.Call +} + +// SetLeftMargin is a helper method to define mock.On call +// - margin float64 +func (_e *Fpdf_Expecter) SetLeftMargin(margin interface{}) *Fpdf_SetLeftMargin_Call { + return &Fpdf_SetLeftMargin_Call{Call: _e.mock.On("SetLeftMargin", margin)} +} + +func (_c *Fpdf_SetLeftMargin_Call) Run(run func(margin float64)) *Fpdf_SetLeftMargin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetLeftMargin_Call) Return() *Fpdf_SetLeftMargin_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetLeftMargin_Call) RunAndReturn(run func(float64)) *Fpdf_SetLeftMargin_Call { + _c.Call.Return(run) + return _c +} + +// SetLineCapStyle provides a mock function with given fields: styleStr +func (_m *Fpdf) SetLineCapStyle(styleStr string) { + _m.Called(styleStr) +} + +// Fpdf_SetLineCapStyle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLineCapStyle' +type Fpdf_SetLineCapStyle_Call struct { + *mock.Call +} + +// SetLineCapStyle is a helper method to define mock.On call +// - styleStr string +func (_e *Fpdf_Expecter) SetLineCapStyle(styleStr interface{}) *Fpdf_SetLineCapStyle_Call { + return &Fpdf_SetLineCapStyle_Call{Call: _e.mock.On("SetLineCapStyle", styleStr)} +} + +func (_c *Fpdf_SetLineCapStyle_Call) Run(run func(styleStr string)) *Fpdf_SetLineCapStyle_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_SetLineCapStyle_Call) Return() *Fpdf_SetLineCapStyle_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetLineCapStyle_Call) RunAndReturn(run func(string)) *Fpdf_SetLineCapStyle_Call { + _c.Call.Return(run) + return _c +} + +// SetLineJoinStyle provides a mock function with given fields: styleStr +func (_m *Fpdf) SetLineJoinStyle(styleStr string) { + _m.Called(styleStr) +} + +// Fpdf_SetLineJoinStyle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLineJoinStyle' +type Fpdf_SetLineJoinStyle_Call struct { + *mock.Call +} + +// SetLineJoinStyle is a helper method to define mock.On call +// - styleStr string +func (_e *Fpdf_Expecter) SetLineJoinStyle(styleStr interface{}) *Fpdf_SetLineJoinStyle_Call { + return &Fpdf_SetLineJoinStyle_Call{Call: _e.mock.On("SetLineJoinStyle", styleStr)} +} + +func (_c *Fpdf_SetLineJoinStyle_Call) Run(run func(styleStr string)) *Fpdf_SetLineJoinStyle_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_SetLineJoinStyle_Call) Return() *Fpdf_SetLineJoinStyle_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetLineJoinStyle_Call) RunAndReturn(run func(string)) *Fpdf_SetLineJoinStyle_Call { + _c.Call.Return(run) + return _c +} + +// SetLineWidth provides a mock function with given fields: width +func (_m *Fpdf) SetLineWidth(width float64) { + _m.Called(width) +} + +// Fpdf_SetLineWidth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLineWidth' +type Fpdf_SetLineWidth_Call struct { + *mock.Call +} + +// SetLineWidth is a helper method to define mock.On call +// - width float64 +func (_e *Fpdf_Expecter) SetLineWidth(width interface{}) *Fpdf_SetLineWidth_Call { + return &Fpdf_SetLineWidth_Call{Call: _e.mock.On("SetLineWidth", width)} +} + +func (_c *Fpdf_SetLineWidth_Call) Run(run func(width float64)) *Fpdf_SetLineWidth_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetLineWidth_Call) Return() *Fpdf_SetLineWidth_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetLineWidth_Call) RunAndReturn(run func(float64)) *Fpdf_SetLineWidth_Call { + _c.Call.Return(run) + return _c +} + +// SetLink provides a mock function with given fields: link, y, page +func (_m *Fpdf) SetLink(link int, y float64, page int) { + _m.Called(link, y, page) +} + +// Fpdf_SetLink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLink' +type Fpdf_SetLink_Call struct { + *mock.Call +} + +// SetLink is a helper method to define mock.On call +// - link int +// - y float64 +// - page int +func (_e *Fpdf_Expecter) SetLink(link interface{}, y interface{}, page interface{}) *Fpdf_SetLink_Call { + return &Fpdf_SetLink_Call{Call: _e.mock.On("SetLink", link, y, page)} +} + +func (_c *Fpdf_SetLink_Call) Run(run func(link int, y float64, page int)) *Fpdf_SetLink_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(float64), args[2].(int)) + }) + return _c +} + +func (_c *Fpdf_SetLink_Call) Return() *Fpdf_SetLink_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetLink_Call) RunAndReturn(run func(int, float64, int)) *Fpdf_SetLink_Call { + _c.Call.Return(run) + return _c +} + +// SetMargins provides a mock function with given fields: left, top, right +func (_m *Fpdf) SetMargins(left float64, top float64, right float64) { + _m.Called(left, top, right) +} + +// Fpdf_SetMargins_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMargins' +type Fpdf_SetMargins_Call struct { + *mock.Call +} + +// SetMargins is a helper method to define mock.On call +// - left float64 +// - top float64 +// - right float64 +func (_e *Fpdf_Expecter) SetMargins(left interface{}, top interface{}, right interface{}) *Fpdf_SetMargins_Call { + return &Fpdf_SetMargins_Call{Call: _e.mock.On("SetMargins", left, top, right)} +} + +func (_c *Fpdf_SetMargins_Call) Run(run func(left float64, top float64, right float64)) *Fpdf_SetMargins_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetMargins_Call) Return() *Fpdf_SetMargins_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetMargins_Call) RunAndReturn(run func(float64, float64, float64)) *Fpdf_SetMargins_Call { + _c.Call.Return(run) + return _c +} + +// SetPage provides a mock function with given fields: pageNum +func (_m *Fpdf) SetPage(pageNum int) { + _m.Called(pageNum) +} + +// Fpdf_SetPage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPage' +type Fpdf_SetPage_Call struct { + *mock.Call +} + +// SetPage is a helper method to define mock.On call +// - pageNum int +func (_e *Fpdf_Expecter) SetPage(pageNum interface{}) *Fpdf_SetPage_Call { + return &Fpdf_SetPage_Call{Call: _e.mock.On("SetPage", pageNum)} +} + +func (_c *Fpdf_SetPage_Call) Run(run func(pageNum int)) *Fpdf_SetPage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Fpdf_SetPage_Call) Return() *Fpdf_SetPage_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetPage_Call) RunAndReturn(run func(int)) *Fpdf_SetPage_Call { + _c.Call.Return(run) + return _c +} + +// SetPageBox provides a mock function with given fields: t, x, y, wd, ht +func (_m *Fpdf) SetPageBox(t string, x float64, y float64, wd float64, ht float64) { + _m.Called(t, x, y, wd, ht) +} + +// Fpdf_SetPageBox_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPageBox' +type Fpdf_SetPageBox_Call struct { + *mock.Call +} + +// SetPageBox is a helper method to define mock.On call +// - t string +// - x float64 +// - y float64 +// - wd float64 +// - ht float64 +func (_e *Fpdf_Expecter) SetPageBox(t interface{}, x interface{}, y interface{}, wd interface{}, ht interface{}) *Fpdf_SetPageBox_Call { + return &Fpdf_SetPageBox_Call{Call: _e.mock.On("SetPageBox", t, x, y, wd, ht)} +} + +func (_c *Fpdf_SetPageBox_Call) Run(run func(t string, x float64, y float64, wd float64, ht float64)) *Fpdf_SetPageBox_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(float64), args[2].(float64), args[3].(float64), args[4].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetPageBox_Call) Return() *Fpdf_SetPageBox_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetPageBox_Call) RunAndReturn(run func(string, float64, float64, float64, float64)) *Fpdf_SetPageBox_Call { + _c.Call.Return(run) + return _c +} + +// SetPageBoxRec provides a mock function with given fields: t, pb +func (_m *Fpdf) SetPageBoxRec(t string, pb gofpdf.PageBox) { + _m.Called(t, pb) +} + +// Fpdf_SetPageBoxRec_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPageBoxRec' +type Fpdf_SetPageBoxRec_Call struct { + *mock.Call +} + +// SetPageBoxRec is a helper method to define mock.On call +// - t string +// - pb gofpdf.PageBox +func (_e *Fpdf_Expecter) SetPageBoxRec(t interface{}, pb interface{}) *Fpdf_SetPageBoxRec_Call { + return &Fpdf_SetPageBoxRec_Call{Call: _e.mock.On("SetPageBoxRec", t, pb)} +} + +func (_c *Fpdf_SetPageBoxRec_Call) Run(run func(t string, pb gofpdf.PageBox)) *Fpdf_SetPageBoxRec_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(gofpdf.PageBox)) + }) + return _c +} + +func (_c *Fpdf_SetPageBoxRec_Call) Return() *Fpdf_SetPageBoxRec_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetPageBoxRec_Call) RunAndReturn(run func(string, gofpdf.PageBox)) *Fpdf_SetPageBoxRec_Call { + _c.Call.Return(run) + return _c +} + +// SetProtection provides a mock function with given fields: actionFlag, userPassStr, ownerPassStr +func (_m *Fpdf) SetProtection(actionFlag byte, userPassStr string, ownerPassStr string) { + _m.Called(actionFlag, userPassStr, ownerPassStr) +} + +// Fpdf_SetProtection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetProtection' +type Fpdf_SetProtection_Call struct { + *mock.Call +} + +// SetProtection is a helper method to define mock.On call +// - actionFlag byte +// - userPassStr string +// - ownerPassStr string +func (_e *Fpdf_Expecter) SetProtection(actionFlag interface{}, userPassStr interface{}, ownerPassStr interface{}) *Fpdf_SetProtection_Call { + return &Fpdf_SetProtection_Call{Call: _e.mock.On("SetProtection", actionFlag, userPassStr, ownerPassStr)} +} + +func (_c *Fpdf_SetProtection_Call) Run(run func(actionFlag byte, userPassStr string, ownerPassStr string)) *Fpdf_SetProtection_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(byte), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Fpdf_SetProtection_Call) Return() *Fpdf_SetProtection_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetProtection_Call) RunAndReturn(run func(byte, string, string)) *Fpdf_SetProtection_Call { + _c.Call.Return(run) + return _c +} + +// SetRightMargin provides a mock function with given fields: margin +func (_m *Fpdf) SetRightMargin(margin float64) { + _m.Called(margin) +} + +// Fpdf_SetRightMargin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRightMargin' +type Fpdf_SetRightMargin_Call struct { + *mock.Call +} + +// SetRightMargin is a helper method to define mock.On call +// - margin float64 +func (_e *Fpdf_Expecter) SetRightMargin(margin interface{}) *Fpdf_SetRightMargin_Call { + return &Fpdf_SetRightMargin_Call{Call: _e.mock.On("SetRightMargin", margin)} +} + +func (_c *Fpdf_SetRightMargin_Call) Run(run func(margin float64)) *Fpdf_SetRightMargin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetRightMargin_Call) Return() *Fpdf_SetRightMargin_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetRightMargin_Call) RunAndReturn(run func(float64)) *Fpdf_SetRightMargin_Call { + _c.Call.Return(run) + return _c +} + +// SetSubject provides a mock function with given fields: subjectStr, isUTF8 +func (_m *Fpdf) SetSubject(subjectStr string, isUTF8 bool) { + _m.Called(subjectStr, isUTF8) +} + +// Fpdf_SetSubject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSubject' +type Fpdf_SetSubject_Call struct { + *mock.Call +} + +// SetSubject is a helper method to define mock.On call +// - subjectStr string +// - isUTF8 bool +func (_e *Fpdf_Expecter) SetSubject(subjectStr interface{}, isUTF8 interface{}) *Fpdf_SetSubject_Call { + return &Fpdf_SetSubject_Call{Call: _e.mock.On("SetSubject", subjectStr, isUTF8)} +} + +func (_c *Fpdf_SetSubject_Call) Run(run func(subjectStr string, isUTF8 bool)) *Fpdf_SetSubject_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(bool)) + }) + return _c +} + +func (_c *Fpdf_SetSubject_Call) Return() *Fpdf_SetSubject_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetSubject_Call) RunAndReturn(run func(string, bool)) *Fpdf_SetSubject_Call { + _c.Call.Return(run) + return _c +} + +// SetTextColor provides a mock function with given fields: r, g, b +func (_m *Fpdf) SetTextColor(r int, g int, b int) { + _m.Called(r, g, b) +} + +// Fpdf_SetTextColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTextColor' +type Fpdf_SetTextColor_Call struct { + *mock.Call +} + +// SetTextColor is a helper method to define mock.On call +// - r int +// - g int +// - b int +func (_e *Fpdf_Expecter) SetTextColor(r interface{}, g interface{}, b interface{}) *Fpdf_SetTextColor_Call { + return &Fpdf_SetTextColor_Call{Call: _e.mock.On("SetTextColor", r, g, b)} +} + +func (_c *Fpdf_SetTextColor_Call) Run(run func(r int, g int, b int)) *Fpdf_SetTextColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(int), args[2].(int)) + }) + return _c +} + +func (_c *Fpdf_SetTextColor_Call) Return() *Fpdf_SetTextColor_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetTextColor_Call) RunAndReturn(run func(int, int, int)) *Fpdf_SetTextColor_Call { + _c.Call.Return(run) + return _c +} + +// SetTextSpotColor provides a mock function with given fields: nameStr, tint +func (_m *Fpdf) SetTextSpotColor(nameStr string, tint byte) { + _m.Called(nameStr, tint) +} + +// Fpdf_SetTextSpotColor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTextSpotColor' +type Fpdf_SetTextSpotColor_Call struct { + *mock.Call +} + +// SetTextSpotColor is a helper method to define mock.On call +// - nameStr string +// - tint byte +func (_e *Fpdf_Expecter) SetTextSpotColor(nameStr interface{}, tint interface{}) *Fpdf_SetTextSpotColor_Call { + return &Fpdf_SetTextSpotColor_Call{Call: _e.mock.On("SetTextSpotColor", nameStr, tint)} +} + +func (_c *Fpdf_SetTextSpotColor_Call) Run(run func(nameStr string, tint byte)) *Fpdf_SetTextSpotColor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(byte)) + }) + return _c +} + +func (_c *Fpdf_SetTextSpotColor_Call) Return() *Fpdf_SetTextSpotColor_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetTextSpotColor_Call) RunAndReturn(run func(string, byte)) *Fpdf_SetTextSpotColor_Call { + _c.Call.Return(run) + return _c +} + +// SetTitle provides a mock function with given fields: titleStr, isUTF8 +func (_m *Fpdf) SetTitle(titleStr string, isUTF8 bool) { + _m.Called(titleStr, isUTF8) +} + +// Fpdf_SetTitle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTitle' +type Fpdf_SetTitle_Call struct { + *mock.Call +} + +// SetTitle is a helper method to define mock.On call +// - titleStr string +// - isUTF8 bool +func (_e *Fpdf_Expecter) SetTitle(titleStr interface{}, isUTF8 interface{}) *Fpdf_SetTitle_Call { + return &Fpdf_SetTitle_Call{Call: _e.mock.On("SetTitle", titleStr, isUTF8)} +} + +func (_c *Fpdf_SetTitle_Call) Run(run func(titleStr string, isUTF8 bool)) *Fpdf_SetTitle_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(bool)) + }) + return _c +} + +func (_c *Fpdf_SetTitle_Call) Return() *Fpdf_SetTitle_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetTitle_Call) RunAndReturn(run func(string, bool)) *Fpdf_SetTitle_Call { + _c.Call.Return(run) + return _c +} + +// SetTopMargin provides a mock function with given fields: margin +func (_m *Fpdf) SetTopMargin(margin float64) { + _m.Called(margin) +} + +// Fpdf_SetTopMargin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTopMargin' +type Fpdf_SetTopMargin_Call struct { + *mock.Call +} + +// SetTopMargin is a helper method to define mock.On call +// - margin float64 +func (_e *Fpdf_Expecter) SetTopMargin(margin interface{}) *Fpdf_SetTopMargin_Call { + return &Fpdf_SetTopMargin_Call{Call: _e.mock.On("SetTopMargin", margin)} +} + +func (_c *Fpdf_SetTopMargin_Call) Run(run func(margin float64)) *Fpdf_SetTopMargin_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetTopMargin_Call) Return() *Fpdf_SetTopMargin_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetTopMargin_Call) RunAndReturn(run func(float64)) *Fpdf_SetTopMargin_Call { + _c.Call.Return(run) + return _c +} + +// SetX provides a mock function with given fields: x +func (_m *Fpdf) SetX(x float64) { + _m.Called(x) +} + +// Fpdf_SetX_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetX' +type Fpdf_SetX_Call struct { + *mock.Call +} + +// SetX is a helper method to define mock.On call +// - x float64 +func (_e *Fpdf_Expecter) SetX(x interface{}) *Fpdf_SetX_Call { + return &Fpdf_SetX_Call{Call: _e.mock.On("SetX", x)} +} + +func (_c *Fpdf_SetX_Call) Run(run func(x float64)) *Fpdf_SetX_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetX_Call) Return() *Fpdf_SetX_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetX_Call) RunAndReturn(run func(float64)) *Fpdf_SetX_Call { + _c.Call.Return(run) + return _c +} + +// SetXY provides a mock function with given fields: x, y +func (_m *Fpdf) SetXY(x float64, y float64) { + _m.Called(x, y) +} + +// Fpdf_SetXY_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetXY' +type Fpdf_SetXY_Call struct { + *mock.Call +} + +// SetXY is a helper method to define mock.On call +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) SetXY(x interface{}, y interface{}) *Fpdf_SetXY_Call { + return &Fpdf_SetXY_Call{Call: _e.mock.On("SetXY", x, y)} +} + +func (_c *Fpdf_SetXY_Call) Run(run func(x float64, y float64)) *Fpdf_SetXY_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetXY_Call) Return() *Fpdf_SetXY_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetXY_Call) RunAndReturn(run func(float64, float64)) *Fpdf_SetXY_Call { + _c.Call.Return(run) + return _c +} + +// SetXmpMetadata provides a mock function with given fields: xmpStream +func (_m *Fpdf) SetXmpMetadata(xmpStream []byte) { + _m.Called(xmpStream) +} + +// Fpdf_SetXmpMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetXmpMetadata' +type Fpdf_SetXmpMetadata_Call struct { + *mock.Call +} + +// SetXmpMetadata is a helper method to define mock.On call +// - xmpStream []byte +func (_e *Fpdf_Expecter) SetXmpMetadata(xmpStream interface{}) *Fpdf_SetXmpMetadata_Call { + return &Fpdf_SetXmpMetadata_Call{Call: _e.mock.On("SetXmpMetadata", xmpStream)} +} + +func (_c *Fpdf_SetXmpMetadata_Call) Run(run func(xmpStream []byte)) *Fpdf_SetXmpMetadata_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *Fpdf_SetXmpMetadata_Call) Return() *Fpdf_SetXmpMetadata_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetXmpMetadata_Call) RunAndReturn(run func([]byte)) *Fpdf_SetXmpMetadata_Call { + _c.Call.Return(run) + return _c +} + +// SetY provides a mock function with given fields: y +func (_m *Fpdf) SetY(y float64) { + _m.Called(y) +} + +// Fpdf_SetY_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetY' +type Fpdf_SetY_Call struct { + *mock.Call +} + +// SetY is a helper method to define mock.On call +// - y float64 +func (_e *Fpdf_Expecter) SetY(y interface{}) *Fpdf_SetY_Call { + return &Fpdf_SetY_Call{Call: _e.mock.On("SetY", y)} +} + +func (_c *Fpdf_SetY_Call) Run(run func(y float64)) *Fpdf_SetY_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_SetY_Call) Return() *Fpdf_SetY_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_SetY_Call) RunAndReturn(run func(float64)) *Fpdf_SetY_Call { + _c.Call.Return(run) + return _c +} + +// SplitLines provides a mock function with given fields: txt, w +func (_m *Fpdf) SplitLines(txt []byte, w float64) [][]byte { + ret := _m.Called(txt, w) + + var r0 [][]byte + if rf, ok := ret.Get(0).(func([]byte, float64) [][]byte); ok { + r0 = rf(txt, w) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([][]byte) + } + } + + return r0 +} + +// Fpdf_SplitLines_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SplitLines' +type Fpdf_SplitLines_Call struct { + *mock.Call +} + +// SplitLines is a helper method to define mock.On call +// - txt []byte +// - w float64 +func (_e *Fpdf_Expecter) SplitLines(txt interface{}, w interface{}) *Fpdf_SplitLines_Call { + return &Fpdf_SplitLines_Call{Call: _e.mock.On("SplitLines", txt, w)} +} + +func (_c *Fpdf_SplitLines_Call) Run(run func(txt []byte, w float64)) *Fpdf_SplitLines_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte), args[1].(float64)) + }) + return _c +} + +func (_c *Fpdf_SplitLines_Call) Return(_a0 [][]byte) *Fpdf_SplitLines_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_SplitLines_Call) RunAndReturn(run func([]byte, float64) [][]byte) *Fpdf_SplitLines_Call { + _c.Call.Return(run) + return _c +} + +// String provides a mock function with given fields: +func (_m *Fpdf) String() string { + ret := _m.Called() + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// Fpdf_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type Fpdf_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *Fpdf_Expecter) String() *Fpdf_String_Call { + return &Fpdf_String_Call{Call: _e.mock.On("String")} +} + +func (_c *Fpdf_String_Call) Run(run func()) *Fpdf_String_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_String_Call) Return(_a0 string) *Fpdf_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Fpdf_String_Call) RunAndReturn(run func() string) *Fpdf_String_Call { + _c.Call.Return(run) + return _c +} + +// Text provides a mock function with given fields: x, y, txtStr +func (_m *Fpdf) Text(x float64, y float64, txtStr string) { + _m.Called(x, y, txtStr) +} + +// Fpdf_Text_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Text' +type Fpdf_Text_Call struct { + *mock.Call +} + +// Text is a helper method to define mock.On call +// - x float64 +// - y float64 +// - txtStr string +func (_e *Fpdf_Expecter) Text(x interface{}, y interface{}, txtStr interface{}) *Fpdf_Text_Call { + return &Fpdf_Text_Call{Call: _e.mock.On("Text", x, y, txtStr)} +} + +func (_c *Fpdf_Text_Call) Run(run func(x float64, y float64, txtStr string)) *Fpdf_Text_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(string)) + }) + return _c +} + +func (_c *Fpdf_Text_Call) Return() *Fpdf_Text_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Text_Call) RunAndReturn(run func(float64, float64, string)) *Fpdf_Text_Call { + _c.Call.Return(run) + return _c +} + +// Transform provides a mock function with given fields: tm +func (_m *Fpdf) Transform(tm gofpdf.TransformMatrix) { + _m.Called(tm) +} + +// Fpdf_Transform_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Transform' +type Fpdf_Transform_Call struct { + *mock.Call +} + +// Transform is a helper method to define mock.On call +// - tm gofpdf.TransformMatrix +func (_e *Fpdf_Expecter) Transform(tm interface{}) *Fpdf_Transform_Call { + return &Fpdf_Transform_Call{Call: _e.mock.On("Transform", tm)} +} + +func (_c *Fpdf_Transform_Call) Run(run func(tm gofpdf.TransformMatrix)) *Fpdf_Transform_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(gofpdf.TransformMatrix)) + }) + return _c +} + +func (_c *Fpdf_Transform_Call) Return() *Fpdf_Transform_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Transform_Call) RunAndReturn(run func(gofpdf.TransformMatrix)) *Fpdf_Transform_Call { + _c.Call.Return(run) + return _c +} + +// TransformBegin provides a mock function with given fields: +func (_m *Fpdf) TransformBegin() { + _m.Called() +} + +// Fpdf_TransformBegin_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformBegin' +type Fpdf_TransformBegin_Call struct { + *mock.Call +} + +// TransformBegin is a helper method to define mock.On call +func (_e *Fpdf_Expecter) TransformBegin() *Fpdf_TransformBegin_Call { + return &Fpdf_TransformBegin_Call{Call: _e.mock.On("TransformBegin")} +} + +func (_c *Fpdf_TransformBegin_Call) Run(run func()) *Fpdf_TransformBegin_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_TransformBegin_Call) Return() *Fpdf_TransformBegin_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_TransformBegin_Call) RunAndReturn(run func()) *Fpdf_TransformBegin_Call { + _c.Call.Return(run) + return _c +} + +// TransformEnd provides a mock function with given fields: +func (_m *Fpdf) TransformEnd() { + _m.Called() +} + +// Fpdf_TransformEnd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformEnd' +type Fpdf_TransformEnd_Call struct { + *mock.Call +} + +// TransformEnd is a helper method to define mock.On call +func (_e *Fpdf_Expecter) TransformEnd() *Fpdf_TransformEnd_Call { + return &Fpdf_TransformEnd_Call{Call: _e.mock.On("TransformEnd")} +} + +func (_c *Fpdf_TransformEnd_Call) Run(run func()) *Fpdf_TransformEnd_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Fpdf_TransformEnd_Call) Return() *Fpdf_TransformEnd_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_TransformEnd_Call) RunAndReturn(run func()) *Fpdf_TransformEnd_Call { + _c.Call.Return(run) + return _c +} + +// TransformMirrorHorizontal provides a mock function with given fields: x +func (_m *Fpdf) TransformMirrorHorizontal(x float64) { + _m.Called(x) +} + +// Fpdf_TransformMirrorHorizontal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformMirrorHorizontal' +type Fpdf_TransformMirrorHorizontal_Call struct { + *mock.Call +} + +// TransformMirrorHorizontal is a helper method to define mock.On call +// - x float64 +func (_e *Fpdf_Expecter) TransformMirrorHorizontal(x interface{}) *Fpdf_TransformMirrorHorizontal_Call { + return &Fpdf_TransformMirrorHorizontal_Call{Call: _e.mock.On("TransformMirrorHorizontal", x)} +} + +func (_c *Fpdf_TransformMirrorHorizontal_Call) Run(run func(x float64)) *Fpdf_TransformMirrorHorizontal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_TransformMirrorHorizontal_Call) Return() *Fpdf_TransformMirrorHorizontal_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_TransformMirrorHorizontal_Call) RunAndReturn(run func(float64)) *Fpdf_TransformMirrorHorizontal_Call { + _c.Call.Return(run) + return _c +} + +// TransformMirrorLine provides a mock function with given fields: angle, x, y +func (_m *Fpdf) TransformMirrorLine(angle float64, x float64, y float64) { + _m.Called(angle, x, y) +} + +// Fpdf_TransformMirrorLine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformMirrorLine' +type Fpdf_TransformMirrorLine_Call struct { + *mock.Call +} + +// TransformMirrorLine is a helper method to define mock.On call +// - angle float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) TransformMirrorLine(angle interface{}, x interface{}, y interface{}) *Fpdf_TransformMirrorLine_Call { + return &Fpdf_TransformMirrorLine_Call{Call: _e.mock.On("TransformMirrorLine", angle, x, y)} +} + +func (_c *Fpdf_TransformMirrorLine_Call) Run(run func(angle float64, x float64, y float64)) *Fpdf_TransformMirrorLine_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64)) + }) + return _c +} + +func (_c *Fpdf_TransformMirrorLine_Call) Return() *Fpdf_TransformMirrorLine_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_TransformMirrorLine_Call) RunAndReturn(run func(float64, float64, float64)) *Fpdf_TransformMirrorLine_Call { + _c.Call.Return(run) + return _c +} + +// TransformMirrorPoint provides a mock function with given fields: x, y +func (_m *Fpdf) TransformMirrorPoint(x float64, y float64) { + _m.Called(x, y) +} + +// Fpdf_TransformMirrorPoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformMirrorPoint' +type Fpdf_TransformMirrorPoint_Call struct { + *mock.Call +} + +// TransformMirrorPoint is a helper method to define mock.On call +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) TransformMirrorPoint(x interface{}, y interface{}) *Fpdf_TransformMirrorPoint_Call { + return &Fpdf_TransformMirrorPoint_Call{Call: _e.mock.On("TransformMirrorPoint", x, y)} +} + +func (_c *Fpdf_TransformMirrorPoint_Call) Run(run func(x float64, y float64)) *Fpdf_TransformMirrorPoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64)) + }) + return _c +} + +func (_c *Fpdf_TransformMirrorPoint_Call) Return() *Fpdf_TransformMirrorPoint_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_TransformMirrorPoint_Call) RunAndReturn(run func(float64, float64)) *Fpdf_TransformMirrorPoint_Call { + _c.Call.Return(run) + return _c +} + +// TransformMirrorVertical provides a mock function with given fields: y +func (_m *Fpdf) TransformMirrorVertical(y float64) { + _m.Called(y) +} + +// Fpdf_TransformMirrorVertical_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformMirrorVertical' +type Fpdf_TransformMirrorVertical_Call struct { + *mock.Call +} + +// TransformMirrorVertical is a helper method to define mock.On call +// - y float64 +func (_e *Fpdf_Expecter) TransformMirrorVertical(y interface{}) *Fpdf_TransformMirrorVertical_Call { + return &Fpdf_TransformMirrorVertical_Call{Call: _e.mock.On("TransformMirrorVertical", y)} +} + +func (_c *Fpdf_TransformMirrorVertical_Call) Run(run func(y float64)) *Fpdf_TransformMirrorVertical_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_TransformMirrorVertical_Call) Return() *Fpdf_TransformMirrorVertical_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_TransformMirrorVertical_Call) RunAndReturn(run func(float64)) *Fpdf_TransformMirrorVertical_Call { + _c.Call.Return(run) + return _c +} + +// TransformRotate provides a mock function with given fields: angle, x, y +func (_m *Fpdf) TransformRotate(angle float64, x float64, y float64) { + _m.Called(angle, x, y) +} + +// Fpdf_TransformRotate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformRotate' +type Fpdf_TransformRotate_Call struct { + *mock.Call +} + +// TransformRotate is a helper method to define mock.On call +// - angle float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) TransformRotate(angle interface{}, x interface{}, y interface{}) *Fpdf_TransformRotate_Call { + return &Fpdf_TransformRotate_Call{Call: _e.mock.On("TransformRotate", angle, x, y)} +} + +func (_c *Fpdf_TransformRotate_Call) Run(run func(angle float64, x float64, y float64)) *Fpdf_TransformRotate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64)) + }) + return _c +} + +func (_c *Fpdf_TransformRotate_Call) Return() *Fpdf_TransformRotate_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_TransformRotate_Call) RunAndReturn(run func(float64, float64, float64)) *Fpdf_TransformRotate_Call { + _c.Call.Return(run) + return _c +} + +// TransformScale provides a mock function with given fields: scaleWd, scaleHt, x, y +func (_m *Fpdf) TransformScale(scaleWd float64, scaleHt float64, x float64, y float64) { + _m.Called(scaleWd, scaleHt, x, y) +} + +// Fpdf_TransformScale_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformScale' +type Fpdf_TransformScale_Call struct { + *mock.Call +} + +// TransformScale is a helper method to define mock.On call +// - scaleWd float64 +// - scaleHt float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) TransformScale(scaleWd interface{}, scaleHt interface{}, x interface{}, y interface{}) *Fpdf_TransformScale_Call { + return &Fpdf_TransformScale_Call{Call: _e.mock.On("TransformScale", scaleWd, scaleHt, x, y)} +} + +func (_c *Fpdf_TransformScale_Call) Run(run func(scaleWd float64, scaleHt float64, x float64, y float64)) *Fpdf_TransformScale_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64)) + }) + return _c +} + +func (_c *Fpdf_TransformScale_Call) Return() *Fpdf_TransformScale_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_TransformScale_Call) RunAndReturn(run func(float64, float64, float64, float64)) *Fpdf_TransformScale_Call { + _c.Call.Return(run) + return _c +} + +// TransformScaleX provides a mock function with given fields: scaleWd, x, y +func (_m *Fpdf) TransformScaleX(scaleWd float64, x float64, y float64) { + _m.Called(scaleWd, x, y) +} + +// Fpdf_TransformScaleX_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformScaleX' +type Fpdf_TransformScaleX_Call struct { + *mock.Call +} + +// TransformScaleX is a helper method to define mock.On call +// - scaleWd float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) TransformScaleX(scaleWd interface{}, x interface{}, y interface{}) *Fpdf_TransformScaleX_Call { + return &Fpdf_TransformScaleX_Call{Call: _e.mock.On("TransformScaleX", scaleWd, x, y)} +} + +func (_c *Fpdf_TransformScaleX_Call) Run(run func(scaleWd float64, x float64, y float64)) *Fpdf_TransformScaleX_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64)) + }) + return _c +} + +func (_c *Fpdf_TransformScaleX_Call) Return() *Fpdf_TransformScaleX_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_TransformScaleX_Call) RunAndReturn(run func(float64, float64, float64)) *Fpdf_TransformScaleX_Call { + _c.Call.Return(run) + return _c +} + +// TransformScaleXY provides a mock function with given fields: s, x, y +func (_m *Fpdf) TransformScaleXY(s float64, x float64, y float64) { + _m.Called(s, x, y) +} + +// Fpdf_TransformScaleXY_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformScaleXY' +type Fpdf_TransformScaleXY_Call struct { + *mock.Call +} + +// TransformScaleXY is a helper method to define mock.On call +// - s float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) TransformScaleXY(s interface{}, x interface{}, y interface{}) *Fpdf_TransformScaleXY_Call { + return &Fpdf_TransformScaleXY_Call{Call: _e.mock.On("TransformScaleXY", s, x, y)} +} + +func (_c *Fpdf_TransformScaleXY_Call) Run(run func(s float64, x float64, y float64)) *Fpdf_TransformScaleXY_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64)) + }) + return _c +} + +func (_c *Fpdf_TransformScaleXY_Call) Return() *Fpdf_TransformScaleXY_Call { + _c.Call.Return() + return _c } -// SetLineJoinStyle provides a mock function with given fields: styleStr -func (_m *Fpdf) SetLineJoinStyle(styleStr string) { - _m.Called(styleStr) +func (_c *Fpdf_TransformScaleXY_Call) RunAndReturn(run func(float64, float64, float64)) *Fpdf_TransformScaleXY_Call { + _c.Call.Return(run) + return _c } -// SetLineWidth provides a mock function with given fields: width -func (_m *Fpdf) SetLineWidth(width float64) { - _m.Called(width) +// TransformScaleY provides a mock function with given fields: scaleHt, x, y +func (_m *Fpdf) TransformScaleY(scaleHt float64, x float64, y float64) { + _m.Called(scaleHt, x, y) } -// SetLink provides a mock function with given fields: link, y, page -func (_m *Fpdf) SetLink(link int, y float64, page int) { - _m.Called(link, y, page) +// Fpdf_TransformScaleY_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformScaleY' +type Fpdf_TransformScaleY_Call struct { + *mock.Call } -// SetMargins provides a mock function with given fields: left, top, right -func (_m *Fpdf) SetMargins(left float64, top float64, right float64) { - _m.Called(left, top, right) +// TransformScaleY is a helper method to define mock.On call +// - scaleHt float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) TransformScaleY(scaleHt interface{}, x interface{}, y interface{}) *Fpdf_TransformScaleY_Call { + return &Fpdf_TransformScaleY_Call{Call: _e.mock.On("TransformScaleY", scaleHt, x, y)} } -// SetPage provides a mock function with given fields: pageNum -func (_m *Fpdf) SetPage(pageNum int) { - _m.Called(pageNum) +func (_c *Fpdf_TransformScaleY_Call) Run(run func(scaleHt float64, x float64, y float64)) *Fpdf_TransformScaleY_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64)) + }) + return _c } -// SetPageBox provides a mock function with given fields: t, x, y, wd, ht -func (_m *Fpdf) SetPageBox(t string, x float64, y float64, wd float64, ht float64) { - _m.Called(t, x, y, wd, ht) +func (_c *Fpdf_TransformScaleY_Call) Return() *Fpdf_TransformScaleY_Call { + _c.Call.Return() + return _c } -// SetPageBoxRec provides a mock function with given fields: t, pb -func (_m *Fpdf) SetPageBoxRec(t string, pb gofpdf.PageBox) { - _m.Called(t, pb) +func (_c *Fpdf_TransformScaleY_Call) RunAndReturn(run func(float64, float64, float64)) *Fpdf_TransformScaleY_Call { + _c.Call.Return(run) + return _c } -// SetProtection provides a mock function with given fields: actionFlag, userPassStr, ownerPassStr -func (_m *Fpdf) SetProtection(actionFlag byte, userPassStr string, ownerPassStr string) { - _m.Called(actionFlag, userPassStr, ownerPassStr) +// TransformSkew provides a mock function with given fields: angleX, angleY, x, y +func (_m *Fpdf) TransformSkew(angleX float64, angleY float64, x float64, y float64) { + _m.Called(angleX, angleY, x, y) } -// SetRightMargin provides a mock function with given fields: margin -func (_m *Fpdf) SetRightMargin(margin float64) { - _m.Called(margin) +// Fpdf_TransformSkew_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformSkew' +type Fpdf_TransformSkew_Call struct { + *mock.Call } -// SetSubject provides a mock function with given fields: subjectStr, isUTF8 -func (_m *Fpdf) SetSubject(subjectStr string, isUTF8 bool) { - _m.Called(subjectStr, isUTF8) +// TransformSkew is a helper method to define mock.On call +// - angleX float64 +// - angleY float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) TransformSkew(angleX interface{}, angleY interface{}, x interface{}, y interface{}) *Fpdf_TransformSkew_Call { + return &Fpdf_TransformSkew_Call{Call: _e.mock.On("TransformSkew", angleX, angleY, x, y)} } -// SetTextColor provides a mock function with given fields: r, g, b -func (_m *Fpdf) SetTextColor(r int, g int, b int) { - _m.Called(r, g, b) +func (_c *Fpdf_TransformSkew_Call) Run(run func(angleX float64, angleY float64, x float64, y float64)) *Fpdf_TransformSkew_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64), args[3].(float64)) + }) + return _c } -// SetTextSpotColor provides a mock function with given fields: nameStr, tint -func (_m *Fpdf) SetTextSpotColor(nameStr string, tint byte) { - _m.Called(nameStr, tint) +func (_c *Fpdf_TransformSkew_Call) Return() *Fpdf_TransformSkew_Call { + _c.Call.Return() + return _c } -// SetTitle provides a mock function with given fields: titleStr, isUTF8 -func (_m *Fpdf) SetTitle(titleStr string, isUTF8 bool) { - _m.Called(titleStr, isUTF8) +func (_c *Fpdf_TransformSkew_Call) RunAndReturn(run func(float64, float64, float64, float64)) *Fpdf_TransformSkew_Call { + _c.Call.Return(run) + return _c } -// SetTopMargin provides a mock function with given fields: margin -func (_m *Fpdf) SetTopMargin(margin float64) { - _m.Called(margin) +// TransformSkewX provides a mock function with given fields: angleX, x, y +func (_m *Fpdf) TransformSkewX(angleX float64, x float64, y float64) { + _m.Called(angleX, x, y) } -// SetX provides a mock function with given fields: x -func (_m *Fpdf) SetX(x float64) { - _m.Called(x) +// Fpdf_TransformSkewX_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformSkewX' +type Fpdf_TransformSkewX_Call struct { + *mock.Call } -// SetXY provides a mock function with given fields: x, y -func (_m *Fpdf) SetXY(x float64, y float64) { - _m.Called(x, y) +// TransformSkewX is a helper method to define mock.On call +// - angleX float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) TransformSkewX(angleX interface{}, x interface{}, y interface{}) *Fpdf_TransformSkewX_Call { + return &Fpdf_TransformSkewX_Call{Call: _e.mock.On("TransformSkewX", angleX, x, y)} } -// SetXmpMetadata provides a mock function with given fields: xmpStream -func (_m *Fpdf) SetXmpMetadata(xmpStream []byte) { - _m.Called(xmpStream) +func (_c *Fpdf_TransformSkewX_Call) Run(run func(angleX float64, x float64, y float64)) *Fpdf_TransformSkewX_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64)) + }) + return _c } -// SetY provides a mock function with given fields: y -func (_m *Fpdf) SetY(y float64) { - _m.Called(y) +func (_c *Fpdf_TransformSkewX_Call) Return() *Fpdf_TransformSkewX_Call { + _c.Call.Return() + return _c } -// SplitLines provides a mock function with given fields: txt, w -func (_m *Fpdf) SplitLines(txt []byte, w float64) [][]byte { - ret := _m.Called(txt, w) +func (_c *Fpdf_TransformSkewX_Call) RunAndReturn(run func(float64, float64, float64)) *Fpdf_TransformSkewX_Call { + _c.Call.Return(run) + return _c +} - var r0 [][]byte - if rf, ok := ret.Get(0).(func([]byte, float64) [][]byte); ok { - r0 = rf(txt, w) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([][]byte) - } - } +// TransformSkewY provides a mock function with given fields: angleY, x, y +func (_m *Fpdf) TransformSkewY(angleY float64, x float64, y float64) { + _m.Called(angleY, x, y) +} - return r0 +// Fpdf_TransformSkewY_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformSkewY' +type Fpdf_TransformSkewY_Call struct { + *mock.Call } -// String provides a mock function with given fields: -func (_m *Fpdf) String() string { - ret := _m.Called() +// TransformSkewY is a helper method to define mock.On call +// - angleY float64 +// - x float64 +// - y float64 +func (_e *Fpdf_Expecter) TransformSkewY(angleY interface{}, x interface{}, y interface{}) *Fpdf_TransformSkewY_Call { + return &Fpdf_TransformSkewY_Call{Call: _e.mock.On("TransformSkewY", angleY, x, y)} +} - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } +func (_c *Fpdf_TransformSkewY_Call) Run(run func(angleY float64, x float64, y float64)) *Fpdf_TransformSkewY_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(float64)) + }) + return _c +} - return r0 +func (_c *Fpdf_TransformSkewY_Call) Return() *Fpdf_TransformSkewY_Call { + _c.Call.Return() + return _c } -// Text provides a mock function with given fields: x, y, txtStr -func (_m *Fpdf) Text(x float64, y float64, txtStr string) { - _m.Called(x, y, txtStr) +func (_c *Fpdf_TransformSkewY_Call) RunAndReturn(run func(float64, float64, float64)) *Fpdf_TransformSkewY_Call { + _c.Call.Return(run) + return _c } -// Transform provides a mock function with given fields: tm -func (_m *Fpdf) Transform(tm gofpdf.TransformMatrix) { - _m.Called(tm) +// TransformTranslate provides a mock function with given fields: tx, ty +func (_m *Fpdf) TransformTranslate(tx float64, ty float64) { + _m.Called(tx, ty) } -// TransformBegin provides a mock function with given fields: -func (_m *Fpdf) TransformBegin() { - _m.Called() +// Fpdf_TransformTranslate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformTranslate' +type Fpdf_TransformTranslate_Call struct { + *mock.Call } -// TransformEnd provides a mock function with given fields: -func (_m *Fpdf) TransformEnd() { - _m.Called() +// TransformTranslate is a helper method to define mock.On call +// - tx float64 +// - ty float64 +func (_e *Fpdf_Expecter) TransformTranslate(tx interface{}, ty interface{}) *Fpdf_TransformTranslate_Call { + return &Fpdf_TransformTranslate_Call{Call: _e.mock.On("TransformTranslate", tx, ty)} } -// TransformMirrorHorizontal provides a mock function with given fields: x -func (_m *Fpdf) TransformMirrorHorizontal(x float64) { - _m.Called(x) +func (_c *Fpdf_TransformTranslate_Call) Run(run func(tx float64, ty float64)) *Fpdf_TransformTranslate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64)) + }) + return _c } -// TransformMirrorLine provides a mock function with given fields: angle, x, y -func (_m *Fpdf) TransformMirrorLine(angle float64, x float64, y float64) { - _m.Called(angle, x, y) +func (_c *Fpdf_TransformTranslate_Call) Return() *Fpdf_TransformTranslate_Call { + _c.Call.Return() + return _c } -// TransformMirrorPoint provides a mock function with given fields: x, y -func (_m *Fpdf) TransformMirrorPoint(x float64, y float64) { - _m.Called(x, y) +func (_c *Fpdf_TransformTranslate_Call) RunAndReturn(run func(float64, float64)) *Fpdf_TransformTranslate_Call { + _c.Call.Return(run) + return _c } -// TransformMirrorVertical provides a mock function with given fields: y -func (_m *Fpdf) TransformMirrorVertical(y float64) { - _m.Called(y) +// TransformTranslateX provides a mock function with given fields: tx +func (_m *Fpdf) TransformTranslateX(tx float64) { + _m.Called(tx) } -// TransformRotate provides a mock function with given fields: angle, x, y -func (_m *Fpdf) TransformRotate(angle float64, x float64, y float64) { - _m.Called(angle, x, y) +// Fpdf_TransformTranslateX_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformTranslateX' +type Fpdf_TransformTranslateX_Call struct { + *mock.Call } -// TransformScale provides a mock function with given fields: scaleWd, scaleHt, x, y -func (_m *Fpdf) TransformScale(scaleWd float64, scaleHt float64, x float64, y float64) { - _m.Called(scaleWd, scaleHt, x, y) +// TransformTranslateX is a helper method to define mock.On call +// - tx float64 +func (_e *Fpdf_Expecter) TransformTranslateX(tx interface{}) *Fpdf_TransformTranslateX_Call { + return &Fpdf_TransformTranslateX_Call{Call: _e.mock.On("TransformTranslateX", tx)} } -// TransformScaleX provides a mock function with given fields: scaleWd, x, y -func (_m *Fpdf) TransformScaleX(scaleWd float64, x float64, y float64) { - _m.Called(scaleWd, x, y) +func (_c *Fpdf_TransformTranslateX_Call) Run(run func(tx float64)) *Fpdf_TransformTranslateX_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c } -// TransformScaleXY provides a mock function with given fields: s, x, y -func (_m *Fpdf) TransformScaleXY(s float64, x float64, y float64) { - _m.Called(s, x, y) +func (_c *Fpdf_TransformTranslateX_Call) Return() *Fpdf_TransformTranslateX_Call { + _c.Call.Return() + return _c } -// TransformScaleY provides a mock function with given fields: scaleHt, x, y -func (_m *Fpdf) TransformScaleY(scaleHt float64, x float64, y float64) { - _m.Called(scaleHt, x, y) +func (_c *Fpdf_TransformTranslateX_Call) RunAndReturn(run func(float64)) *Fpdf_TransformTranslateX_Call { + _c.Call.Return(run) + return _c } -// TransformSkew provides a mock function with given fields: angleX, angleY, x, y -func (_m *Fpdf) TransformSkew(angleX float64, angleY float64, x float64, y float64) { - _m.Called(angleX, angleY, x, y) +// TransformTranslateY provides a mock function with given fields: ty +func (_m *Fpdf) TransformTranslateY(ty float64) { + _m.Called(ty) } -// TransformSkewX provides a mock function with given fields: angleX, x, y -func (_m *Fpdf) TransformSkewX(angleX float64, x float64, y float64) { - _m.Called(angleX, x, y) +// Fpdf_TransformTranslateY_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TransformTranslateY' +type Fpdf_TransformTranslateY_Call struct { + *mock.Call } -// TransformSkewY provides a mock function with given fields: angleY, x, y -func (_m *Fpdf) TransformSkewY(angleY float64, x float64, y float64) { - _m.Called(angleY, x, y) +// TransformTranslateY is a helper method to define mock.On call +// - ty float64 +func (_e *Fpdf_Expecter) TransformTranslateY(ty interface{}) *Fpdf_TransformTranslateY_Call { + return &Fpdf_TransformTranslateY_Call{Call: _e.mock.On("TransformTranslateY", ty)} } -// TransformTranslate provides a mock function with given fields: tx, ty -func (_m *Fpdf) TransformTranslate(tx float64, ty float64) { - _m.Called(tx, ty) +func (_c *Fpdf_TransformTranslateY_Call) Run(run func(ty float64)) *Fpdf_TransformTranslateY_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c } -// TransformTranslateX provides a mock function with given fields: tx -func (_m *Fpdf) TransformTranslateX(tx float64) { - _m.Called(tx) +func (_c *Fpdf_TransformTranslateY_Call) Return() *Fpdf_TransformTranslateY_Call { + _c.Call.Return() + return _c } -// TransformTranslateY provides a mock function with given fields: ty -func (_m *Fpdf) TransformTranslateY(ty float64) { - _m.Called(ty) +func (_c *Fpdf_TransformTranslateY_Call) RunAndReturn(run func(float64)) *Fpdf_TransformTranslateY_Call { + _c.Call.Return(run) + return _c } // UnicodeTranslatorFromDescriptor provides a mock function with given fields: cpStr @@ -1477,6 +6389,34 @@ func (_m *Fpdf) UnicodeTranslatorFromDescriptor(cpStr string) func(string) strin return r0 } +// Fpdf_UnicodeTranslatorFromDescriptor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnicodeTranslatorFromDescriptor' +type Fpdf_UnicodeTranslatorFromDescriptor_Call struct { + *mock.Call +} + +// UnicodeTranslatorFromDescriptor is a helper method to define mock.On call +// - cpStr string +func (_e *Fpdf_Expecter) UnicodeTranslatorFromDescriptor(cpStr interface{}) *Fpdf_UnicodeTranslatorFromDescriptor_Call { + return &Fpdf_UnicodeTranslatorFromDescriptor_Call{Call: _e.mock.On("UnicodeTranslatorFromDescriptor", cpStr)} +} + +func (_c *Fpdf_UnicodeTranslatorFromDescriptor_Call) Run(run func(cpStr string)) *Fpdf_UnicodeTranslatorFromDescriptor_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Fpdf_UnicodeTranslatorFromDescriptor_Call) Return(rep func(string) string) *Fpdf_UnicodeTranslatorFromDescriptor_Call { + _c.Call.Return(rep) + return _c +} + +func (_c *Fpdf_UnicodeTranslatorFromDescriptor_Call) RunAndReturn(run func(string) func(string) string) *Fpdf_UnicodeTranslatorFromDescriptor_Call { + _c.Call.Return(run) + return _c +} + // UnitToPointConvert provides a mock function with given fields: u func (_m *Fpdf) UnitToPointConvert(u float64) float64 { ret := _m.Called(u) @@ -1491,36 +6431,242 @@ func (_m *Fpdf) UnitToPointConvert(u float64) float64 { return r0 } +// Fpdf_UnitToPointConvert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnitToPointConvert' +type Fpdf_UnitToPointConvert_Call struct { + *mock.Call +} + +// UnitToPointConvert is a helper method to define mock.On call +// - u float64 +func (_e *Fpdf_Expecter) UnitToPointConvert(u interface{}) *Fpdf_UnitToPointConvert_Call { + return &Fpdf_UnitToPointConvert_Call{Call: _e.mock.On("UnitToPointConvert", u)} +} + +func (_c *Fpdf_UnitToPointConvert_Call) Run(run func(u float64)) *Fpdf_UnitToPointConvert_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64)) + }) + return _c +} + +func (_c *Fpdf_UnitToPointConvert_Call) Return(pt float64) *Fpdf_UnitToPointConvert_Call { + _c.Call.Return(pt) + return _c +} + +func (_c *Fpdf_UnitToPointConvert_Call) RunAndReturn(run func(float64) float64) *Fpdf_UnitToPointConvert_Call { + _c.Call.Return(run) + return _c +} + // UseTemplate provides a mock function with given fields: t func (_m *Fpdf) UseTemplate(t gofpdf.Template) { _m.Called(t) } +// Fpdf_UseTemplate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UseTemplate' +type Fpdf_UseTemplate_Call struct { + *mock.Call +} + +// UseTemplate is a helper method to define mock.On call +// - t gofpdf.Template +func (_e *Fpdf_Expecter) UseTemplate(t interface{}) *Fpdf_UseTemplate_Call { + return &Fpdf_UseTemplate_Call{Call: _e.mock.On("UseTemplate", t)} +} + +func (_c *Fpdf_UseTemplate_Call) Run(run func(t gofpdf.Template)) *Fpdf_UseTemplate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(gofpdf.Template)) + }) + return _c +} + +func (_c *Fpdf_UseTemplate_Call) Return() *Fpdf_UseTemplate_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_UseTemplate_Call) RunAndReturn(run func(gofpdf.Template)) *Fpdf_UseTemplate_Call { + _c.Call.Return(run) + return _c +} + // UseTemplateScaled provides a mock function with given fields: t, corner, size func (_m *Fpdf) UseTemplateScaled(t gofpdf.Template, corner gofpdf.PointType, size gofpdf.SizeType) { _m.Called(t, corner, size) } +// Fpdf_UseTemplateScaled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UseTemplateScaled' +type Fpdf_UseTemplateScaled_Call struct { + *mock.Call +} + +// UseTemplateScaled is a helper method to define mock.On call +// - t gofpdf.Template +// - corner gofpdf.PointType +// - size gofpdf.SizeType +func (_e *Fpdf_Expecter) UseTemplateScaled(t interface{}, corner interface{}, size interface{}) *Fpdf_UseTemplateScaled_Call { + return &Fpdf_UseTemplateScaled_Call{Call: _e.mock.On("UseTemplateScaled", t, corner, size)} +} + +func (_c *Fpdf_UseTemplateScaled_Call) Run(run func(t gofpdf.Template, corner gofpdf.PointType, size gofpdf.SizeType)) *Fpdf_UseTemplateScaled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(gofpdf.Template), args[1].(gofpdf.PointType), args[2].(gofpdf.SizeType)) + }) + return _c +} + +func (_c *Fpdf_UseTemplateScaled_Call) Return() *Fpdf_UseTemplateScaled_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_UseTemplateScaled_Call) RunAndReturn(run func(gofpdf.Template, gofpdf.PointType, gofpdf.SizeType)) *Fpdf_UseTemplateScaled_Call { + _c.Call.Return(run) + return _c +} + // Write provides a mock function with given fields: h, txtStr func (_m *Fpdf) Write(h float64, txtStr string) { _m.Called(h, txtStr) } +// Fpdf_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' +type Fpdf_Write_Call struct { + *mock.Call +} + +// Write is a helper method to define mock.On call +// - h float64 +// - txtStr string +func (_e *Fpdf_Expecter) Write(h interface{}, txtStr interface{}) *Fpdf_Write_Call { + return &Fpdf_Write_Call{Call: _e.mock.On("Write", h, txtStr)} +} + +func (_c *Fpdf_Write_Call) Run(run func(h float64, txtStr string)) *Fpdf_Write_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(string)) + }) + return _c +} + +func (_c *Fpdf_Write_Call) Return() *Fpdf_Write_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Write_Call) RunAndReturn(run func(float64, string)) *Fpdf_Write_Call { + _c.Call.Return(run) + return _c +} + // WriteAligned provides a mock function with given fields: width, lineHeight, textStr, alignStr func (_m *Fpdf) WriteAligned(width float64, lineHeight float64, textStr string, alignStr string) { _m.Called(width, lineHeight, textStr, alignStr) } +// Fpdf_WriteAligned_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteAligned' +type Fpdf_WriteAligned_Call struct { + *mock.Call +} + +// WriteAligned is a helper method to define mock.On call +// - width float64 +// - lineHeight float64 +// - textStr string +// - alignStr string +func (_e *Fpdf_Expecter) WriteAligned(width interface{}, lineHeight interface{}, textStr interface{}, alignStr interface{}) *Fpdf_WriteAligned_Call { + return &Fpdf_WriteAligned_Call{Call: _e.mock.On("WriteAligned", width, lineHeight, textStr, alignStr)} +} + +func (_c *Fpdf_WriteAligned_Call) Run(run func(width float64, lineHeight float64, textStr string, alignStr string)) *Fpdf_WriteAligned_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(float64), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *Fpdf_WriteAligned_Call) Return() *Fpdf_WriteAligned_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_WriteAligned_Call) RunAndReturn(run func(float64, float64, string, string)) *Fpdf_WriteAligned_Call { + _c.Call.Return(run) + return _c +} + // WriteLinkID provides a mock function with given fields: h, displayStr, linkID func (_m *Fpdf) WriteLinkID(h float64, displayStr string, linkID int) { _m.Called(h, displayStr, linkID) } +// Fpdf_WriteLinkID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteLinkID' +type Fpdf_WriteLinkID_Call struct { + *mock.Call +} + +// WriteLinkID is a helper method to define mock.On call +// - h float64 +// - displayStr string +// - linkID int +func (_e *Fpdf_Expecter) WriteLinkID(h interface{}, displayStr interface{}, linkID interface{}) *Fpdf_WriteLinkID_Call { + return &Fpdf_WriteLinkID_Call{Call: _e.mock.On("WriteLinkID", h, displayStr, linkID)} +} + +func (_c *Fpdf_WriteLinkID_Call) Run(run func(h float64, displayStr string, linkID int)) *Fpdf_WriteLinkID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(string), args[2].(int)) + }) + return _c +} + +func (_c *Fpdf_WriteLinkID_Call) Return() *Fpdf_WriteLinkID_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_WriteLinkID_Call) RunAndReturn(run func(float64, string, int)) *Fpdf_WriteLinkID_Call { + _c.Call.Return(run) + return _c +} + // WriteLinkString provides a mock function with given fields: h, displayStr, targetStr func (_m *Fpdf) WriteLinkString(h float64, displayStr string, targetStr string) { _m.Called(h, displayStr, targetStr) } +// Fpdf_WriteLinkString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteLinkString' +type Fpdf_WriteLinkString_Call struct { + *mock.Call +} + +// WriteLinkString is a helper method to define mock.On call +// - h float64 +// - displayStr string +// - targetStr string +func (_e *Fpdf_Expecter) WriteLinkString(h interface{}, displayStr interface{}, targetStr interface{}) *Fpdf_WriteLinkString_Call { + return &Fpdf_WriteLinkString_Call{Call: _e.mock.On("WriteLinkString", h, displayStr, targetStr)} +} + +func (_c *Fpdf_WriteLinkString_Call) Run(run func(h float64, displayStr string, targetStr string)) *Fpdf_WriteLinkString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Fpdf_WriteLinkString_Call) Return() *Fpdf_WriteLinkString_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_WriteLinkString_Call) RunAndReturn(run func(float64, string, string)) *Fpdf_WriteLinkString_Call { + _c.Call.Return(run) + return _c +} + // Writef provides a mock function with given fields: h, fmtStr, args func (_m *Fpdf) Writef(h float64, fmtStr string, args ...interface{}) { var _ca []interface{} @@ -1528,3 +6674,54 @@ func (_m *Fpdf) Writef(h float64, fmtStr string, args ...interface{}) { _ca = append(_ca, args...) _m.Called(_ca...) } + +// Fpdf_Writef_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Writef' +type Fpdf_Writef_Call struct { + *mock.Call +} + +// Writef is a helper method to define mock.On call +// - h float64 +// - fmtStr string +// - args ...interface{} +func (_e *Fpdf_Expecter) Writef(h interface{}, fmtStr interface{}, args ...interface{}) *Fpdf_Writef_Call { + return &Fpdf_Writef_Call{Call: _e.mock.On("Writef", + append([]interface{}{h, fmtStr}, args...)...)} +} + +func (_c *Fpdf_Writef_Call) Run(run func(h float64, fmtStr string, args ...interface{})) *Fpdf_Writef_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]interface{}, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(interface{}) + } + } + run(args[0].(float64), args[1].(string), variadicArgs...) + }) + return _c +} + +func (_c *Fpdf_Writef_Call) Return() *Fpdf_Writef_Call { + _c.Call.Return() + return _c +} + +func (_c *Fpdf_Writef_Call) RunAndReturn(run func(float64, string, ...interface{})) *Fpdf_Writef_Call { + _c.Call.Return(run) + return _c +} + +// NewFpdf creates a new instance of Fpdf. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewFpdf(t interface { + mock.TestingT + Cleanup(func()) +}) *Fpdf { + mock := &Fpdf{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internal/signature_test.go b/internal/signature_test.go index 163ec096..d72cbc1a 100644 --- a/internal/signature_test.go +++ b/internal/signature_test.go @@ -30,7 +30,7 @@ func TestSignature_AddSpaceFor_DefaultMargins(t *testing.T) { math.On("GetWidthPerCol", mock.Anything).Return(50.0) text := &mocks.Text{} - text.On("Add", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + text.On("AddRenderable", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) signature := internal.NewSignature(pdf, math, text) @@ -40,8 +40,8 @@ func TestSignature_AddSpaceFor_DefaultMargins(t *testing.T) { // Assert pdf.AssertNumberOfCalls(t, "Line", 1) pdf.AssertCalled(t, "Line", 19.0, 15.0, 13.0, 15.0) - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "label", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "label", internal.Cell{ 5.0, 7.0, 2.0, @@ -67,7 +67,7 @@ func TestSignature_AddSpaceFor_NotDefaultMargins(t *testing.T) { math.On("GetWidthPerCol", mock.Anything).Return(50.0) text := &mocks.Text{} - text.On("Add", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + text.On("AddRenderable", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) signature := internal.NewSignature(pdf, math, text) @@ -77,8 +77,8 @@ func TestSignature_AddSpaceFor_NotDefaultMargins(t *testing.T) { // Assert pdf.AssertNumberOfCalls(t, "Line", 1) pdf.AssertCalled(t, "Line", 26.0, 15.0, 23.0, 15.0) - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "label", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "label", internal.Cell{ 2.0, 7.0, 5.0, diff --git a/pkg/pdf/example_test.go b/pkg/pdf/example_test.go index 6f51d0f3..87f8a5bc 100644 --- a/pkg/pdf/example_test.go +++ b/pkg/pdf/example_test.go @@ -36,10 +36,10 @@ func ExampleNewMarotoCustomSize() { func ExamplePdfMaroto_AddPage() { m := pdf.NewMaroto(consts.Portrait, consts.A4) - // Add rows, cols and components + // AddRenderable rows, cols and components m.AddPage() - // Add rows, col and components in a new page + // AddRenderable rows, col and components in a new page // Do more things and save... } @@ -51,14 +51,14 @@ func ExamplePdfMaroto_Row() { // Warning: There is no way to use a row inside a row or a row inside a col. m.Row(rowHeight, func() { m.Col(12, func() { - // Add a component + // AddRenderable a component }) }) // Warning: There is no way to use a row inside a row or a row inside a col. m.Row(rowHeight, func() { m.Col(12, func() { - // Add another component + // AddRenderable another component }) }) @@ -75,7 +75,7 @@ func ExamplePdfMaroto_Col() { // Warning: There is no way to use a row inside a row or a row inside a col. m.Row(rowHeight, func() { m.Col(12, func() { - // Add Image, Text, Signature, QrCode or Barcode... + // AddRenderable Image, Text, Signature, QrCode or Barcode... }) }) @@ -83,10 +83,10 @@ func ExamplePdfMaroto_Col() { // Warning: There is no way to use a row inside a row or a row inside a col. m.Row(rowHeight, func() { m.Col(6, func() { - // Add Image, Text, Signature, QrCode or Barcode... + // AddRenderable Image, Text, Signature, QrCode or Barcode... }) m.Col(6, func() { - // Add Image, Text, Signature, QrCode or Barcode... + // AddRenderable Image, Text, Signature, QrCode or Barcode... }) }) @@ -240,7 +240,7 @@ func ExamplePdfMaroto_TableList() { // TableList have to be used at same level as row m.Row(10, func() { m.Col(12, func() { - // Add a component + // AddRenderable a component }) }) @@ -507,12 +507,12 @@ func ExamplePdfMaroto_SetBorder() { m := pdf.NewMaroto(consts.Portrait, consts.A4) m.SetBorder(true) - // Add some Rows, Cols, Lines and etc... + // AddRenderable some Rows, Cols, Lines and etc... // Here will be drawn borders in every cell. m.SetBorder(false) - // Add some Rows, Cols, Lines and etc... + // AddRenderable some Rows, Cols, Lines and etc... // Here will not be drawn borders. // Do more things and save... @@ -557,7 +557,7 @@ func ExamplePdfMaroto_SetBackgroundColor() { // This Row will be filled with the color. m.Row(20, func() { m.Col(12, func() { - // Add components. + // AddRenderable components. }) }) @@ -567,7 +567,7 @@ func ExamplePdfMaroto_SetBackgroundColor() { // This Row will not be filled with the color. m.Row(20, func() { m.Col(12, func() { - // Add components. + // AddRenderable components. }) }) @@ -609,7 +609,7 @@ func ExamplePdfMaroto_GetCurrentPage() { // Index here will be 0. _ = m.GetCurrentPage() - // Add Rows, Cols and Components. + // AddRenderable Rows, Cols and Components. // Index here will not be 0. _ = m.GetCurrentPage() @@ -625,12 +625,12 @@ func ExamplePdfMaroto_GetCurrentOffset() { // Offset here will be 0. _ = m.GetCurrentOffset() - // Add Rows, Cols and Components until maroto add a new page. + // AddRenderable Rows, Cols and Components until maroto add a new page. // Offset here will not be 0. _ = m.GetCurrentOffset() - // Add Rows, Cols and Components to maroto add a new page. + // AddRenderable Rows, Cols and Components to maroto add a new page. // Offset here will be 0. _ = m.GetCurrentOffset() diff --git a/pkg/pdf/pdf_test.go b/pkg/pdf/pdf_test.go index 42b08d64..31e38316 100644 --- a/pkg/pdf/pdf_test.go +++ b/pkg/pdf/pdf_test.go @@ -533,8 +533,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "One text inside one column, inside a row, without props", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "Text1", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "Text1", internal.Cell{ X: 0.0, Y: 0.0, Width: 80.0, @@ -559,8 +559,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "Two different text inside one colum, inside one row", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 2) - text.AssertCalled(t, "Add", "Text2", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 2) + text.AssertCalled(t, "AddRenderable", "Text2", internal.Cell{ X: 0.0, Y: 0.0, Width: 80.0, @@ -573,7 +573,7 @@ func TestFpdfMaroto_Text(t *testing.T) { Extrapolate: false, Size: 10.0, }) - text.AssertCalled(t, "Add", "Text3", internal.Cell{ + text.AssertCalled(t, "AddRenderable", "Text3", internal.Cell{ X: 0.0, Y: 5.0, Width: 80.0, @@ -605,8 +605,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "Two different text with different columns, inside one row", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 2) - text.AssertCalled(t, "Add", "Text4", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 2) + text.AssertCalled(t, "AddRenderable", "Text4", internal.Cell{ X: 0.0, Y: 0.0, Width: 80.0, @@ -619,7 +619,7 @@ func TestFpdfMaroto_Text(t *testing.T) { Extrapolate: false, Size: 10.0, }) - text.AssertCalled(t, "Add", "Text5", internal.Cell{ + text.AssertCalled(t, "AddRenderable", "Text5", internal.Cell{ X: 80.0, Y: 4.4, Width: 80.0, @@ -653,8 +653,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "Two different text with different columns, inside one row", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 2) - text.AssertCalled(t, "Add", "Text6", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 2) + text.AssertCalled(t, "AddRenderable", "Text6", internal.Cell{ X: 0.0, Y: 0.0, Width: 80.0, @@ -667,7 +667,7 @@ func TestFpdfMaroto_Text(t *testing.T) { Extrapolate: false, Size: 10.0, }) - text.AssertCalled(t, "Add", "Text7", internal.Cell{ + text.AssertCalled(t, "AddRenderable", "Text7", internal.Cell{ X: 0.0, Y: 40.0, Width: 80.0, @@ -701,8 +701,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "Left-indented text", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "Text", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "Text", internal.Cell{ X: 10.0, Y: 0.0, Width: 70.0, @@ -728,8 +728,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "Right-indented text", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "Text", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "Text", internal.Cell{ X: 0.0, Y: 0.0, Width: 70.0, @@ -755,8 +755,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "Left- and right-indented text", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "Text", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "Text", internal.Cell{ X: 10.0, Y: 0.0, Width: 60.0, @@ -784,8 +784,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "Left-indent larger than col width", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "Text", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "Text", internal.Cell{ X: 80.0, Y: 0.0, Width: 0.0, @@ -811,8 +811,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "Right-indent larger than col width", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "Text", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "Text", internal.Cell{ X: 0.0, Y: 0.0, Width: 0.0, @@ -838,8 +838,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "Indents larger than col width", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "Text", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "Text", internal.Cell{ X: 40.0, Y: 0.0, Width: 0.0, @@ -867,8 +867,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "When top is greater than row height", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "Text8", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "Text8", internal.Cell{ X: 0.0, Y: 40.0, Width: 80.0, @@ -894,8 +894,8 @@ func TestFpdfMaroto_Text(t *testing.T) { { "custom color", func(t *testing.T, text *mocks.Text) { - text.AssertNumberOfCalls(t, "Add", 1) - text.AssertCalled(t, "Add", "Text1", internal.Cell{ + text.AssertNumberOfCalls(t, "AddRenderable", 1) + text.AssertCalled(t, "AddRenderable", "Text1", internal.Cell{ X: 0.0, Y: 0.0, Width: 80.0, @@ -2307,7 +2307,7 @@ func baseMathTest() *mocks.Math { func baseTextTest() *mocks.Text { text := &mocks.Text{} - text.On("Add", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) + text.On("AddRenderable", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything) text.On("GetLinesQuantity", mock.Anything, mock.Anything, mock.Anything).Return(1) return text } diff --git a/pkg/v2/code/barcode/barcode.go b/pkg/v2/code/barcode/barcode.go new file mode 100644 index 00000000..d573b760 --- /dev/null +++ b/pkg/v2/code/barcode/barcode.go @@ -0,0 +1,69 @@ +package barcode + +import ( + "fmt" + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/props" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/text" + "github.com/johnfercher/maroto/pkg/v2/types" +) + +type barcode struct { + code string + _type types.DocumentType + components []domain.Node + prop props.Barcode +} + +func New(code string, barcodeProps ...props.Barcode) domain.Component { + prop := props.Barcode{} + if len(barcodeProps) > 0 { + prop = barcodeProps[0] + } + prop.MakeValid() + + return &barcode{ + _type: types.Barcode, + code: code, + prop: prop, + } +} + +func (b *barcode) Render(fpdf fpdf.Fpdf, ctx context.Context) { + math := internal.NewMath(fpdf) + + code := internal.NewCode(fpdf, math) + x := fpdf.GetX() - ctx.Margins.Left - ctx.Dimensions.Width + y := fpdf.GetY() - ctx.Margins.Top + fmt.Println(x, y) + err := code.AddBar(b.code, + internal.Cell{x, y, ctx.Dimensions.Width, ctx.Dimensions.Height}, + b.prop) + + if err != nil { + fpdf.ClearError() + txt := text.New("Failed to render code") + txt.Render(fpdf, ctx) + } +} + +func (b *barcode) GetType() string { + return b._type.String() +} + +func (b *barcode) Add(component ...domain.Node) domain.Node { + return b +} + +func (b *barcode) GetStructure() *tree.Node[domain.Structure] { + str := domain.Structure{ + Type: string(b._type), + Value: b.code, + } + + return tree.NewNode(0, str) +} diff --git a/pkg/v2/code/matrixcode/matrixcode.go b/pkg/v2/code/matrixcode/matrixcode.go new file mode 100644 index 00000000..8502560c --- /dev/null +++ b/pkg/v2/code/matrixcode/matrixcode.go @@ -0,0 +1,60 @@ +package matrixcode + +import ( + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/props" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/types" +) + +type matrixCode struct { + code string + _type types.DocumentType + components []domain.Node + prop props.Rect +} + +func New(code string, barcodeProps ...props.Rect) domain.Component { + prop := props.Rect{} + if len(barcodeProps) > 0 { + prop = barcodeProps[0] + } + prop.MakeValid() + + return &matrixCode{ + _type: types.MatrixCode, + code: code, + prop: prop, + } +} + +func (m *matrixCode) Render(fpdf fpdf.Fpdf, ctx context.Context) { + math := internal.NewMath(fpdf) + + code := internal.NewCode(fpdf, math) + x := fpdf.GetX() - ctx.Margins.Left - ctx.Dimensions.Width + y := fpdf.GetY() - ctx.Margins.Top + code.AddDataMatrix(m.code, + internal.Cell{x, y, ctx.Dimensions.Width, ctx.Dimensions.Height}, + m.prop) +} + +func (m *matrixCode) GetType() string { + return m._type.String() +} + +func (m *matrixCode) Add(component ...domain.Node) domain.Node { + return m +} + +func (m *matrixCode) GetStructure() *tree.Node[domain.Structure] { + str := domain.Structure{ + Type: string(m._type), + Value: m.code, + } + + return tree.NewNode(0, str) +} diff --git a/pkg/v2/code/qrcode/qrcode.go b/pkg/v2/code/qrcode/qrcode.go new file mode 100644 index 00000000..aba82143 --- /dev/null +++ b/pkg/v2/code/qrcode/qrcode.go @@ -0,0 +1,60 @@ +package qrcode + +import ( + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/props" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/types" +) + +type qrCode struct { + code string + _type types.DocumentType + components []domain.Node + prop props.Rect +} + +func New(code string, barcodeProps ...props.Rect) domain.Component { + prop := props.Rect{} + if len(barcodeProps) > 0 { + prop = barcodeProps[0] + } + prop.MakeValid() + + return &qrCode{ + _type: types.QrCode, + code: code, + prop: prop, + } +} + +func (q *qrCode) Render(fpdf fpdf.Fpdf, ctx context.Context) { + math := internal.NewMath(fpdf) + + code := internal.NewCode(fpdf, math) + x := fpdf.GetX() - ctx.Margins.Left - ctx.Dimensions.Width + y := fpdf.GetY() - ctx.Margins.Top + code.AddQr(q.code, + internal.Cell{x, y, ctx.Dimensions.Width, ctx.Dimensions.Height}, + q.prop) +} + +func (q *qrCode) GetType() string { + return q._type.String() +} + +func (q *qrCode) Add(component ...domain.Node) domain.Node { + return q +} + +func (q *qrCode) GetStructure() *tree.Node[domain.Structure] { + str := domain.Structure{ + Type: string(q._type), + Value: q.code, + } + + return tree.NewNode(0, str) +} diff --git a/pkg/v2/col/col.go b/pkg/v2/col/col.go new file mode 100644 index 00000000..6d2e5192 --- /dev/null +++ b/pkg/v2/col/col.go @@ -0,0 +1,80 @@ +package col + +import ( + "fmt" + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/types" +) + +const ( + defaultGridSize = 12.0 +) + +type col struct { + size int + _type types.DocumentType + components []domain.Component + rows []domain.Row +} + +func New(size int) domain.Col { + return &col{ + _type: types.Col, + size: size, + } +} + +func (c *col) GetType() string { + return c._type.String() +} + +func (c *col) Add(components ...domain.Component) domain.Col { + c.components = append(c.components, components...) + return c +} + +func (c *col) AddInner(rows ...domain.Row) domain.Col { + c.rows = append(c.rows, rows...) + return c +} + +func (c *col) GetStructure() *tree.Node[domain.Structure] { + str := domain.Structure{ + Type: string(c._type), + Value: fmt.Sprintf("%d", c.size), + } + + node := tree.NewNode(0, str) + + for _, c := range c.components { + inner := c.GetStructure() + node.AddNext(inner) + } + + return node +} + +func (c *col) Render(fpdf fpdf.Fpdf, ctx context.Context) { + //ctx.Print(c.size) + ctx = c.setRelativeDimension(ctx) + c.render(fpdf, ctx) + for _, component := range c.components { + component.Render(fpdf, ctx) + } + + return +} + +func (c *col) render(fpdf fpdf.Fpdf, ctx context.Context) { + fpdf.CellFormat(ctx.GetXOffset(), ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") +} + +func (c *col) setRelativeDimension(ctx context.Context) context.Context { + parentWidth := ctx.Dimensions.Width + percent := float64(c.size) / defaultGridSize + colDimension := parentWidth * percent + return ctx.WithDimension(colDimension, ctx.Dimensions.Height) +} diff --git a/pkg/v2/col/col_test.go b/pkg/v2/col/col_test.go new file mode 100644 index 00000000..c9e2e241 --- /dev/null +++ b/pkg/v2/col/col_test.go @@ -0,0 +1,370 @@ +package col + +import ( + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/internal/mocks" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/text" + "github.com/johnfercher/maroto/pkg/v2/types" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestNew(t *testing.T) { + t.Run("should success create a new col", func(t *testing.T) { + // arrange + size := 12 + // act + col := New(size) + + // assert + assert.NotNil(t, col) + assert.Equal(t, size, col.size) + assert.Equal(t, "col", col._type.String()) + }) +} + +func TestCol_GetType(t *testing.T) { + t.Run("should success get type", func(t *testing.T) { + // arrange + size := 12 + col := New(size) + + // act + _type := col.GetType() + + // assert + assert.Equal(t, "col", _type) + }) +} + +func TestCol_Add(t *testing.T) { + t.Run("should add component when is a valid child", func(t *testing.T) { + // arrange + size := 12 + col := New(size) + txt := text.New("test") + + // act + col.AddRenderable(txt) + + // assert + assert.Equal(t, 1, len(col.components)) + assert.Equal(t, txt, col.components[0]) + }) + t.Run("should not add component when is not a valid child", func(t *testing.T) { + // arrange + size := 12 + col := New(size) + invalid := &invalidComponent{_type: types.Page} + + // act + col.AddRenderable(invalid) + + // assert + assert.Equal(t, 0, len(col.components)) + }) +} + +func TestCol_Render(t *testing.T) { + t.Run("should render col with 100% parent width when col size is 12", func(t *testing.T) { + // arrange + col := New(12) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 80.0 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + + }) + t.Run("should render col with 91% parent width when col size is 11", func(t *testing.T) { + // arrange + col := New(11) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 73.33333333333333 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + }) + t.Run("should render col with 83% parent width when col size is 10", func(t *testing.T) { + // arrange + col := New(10) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 66.66666666666667 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + }) + t.Run("should render col with 75% parent width when col size is 9", func(t *testing.T) { + // arrange + col := New(9) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 60.0 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + }) + t.Run("should render col with 66% parent width when col size is 8", func(t *testing.T) { + // arrange + col := New(8) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 53.33333333333333 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + }) + t.Run("should render col with 60% parent width when col size is 7", func(t *testing.T) { + // arrange + col := New(7) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 46.66666666666667 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + }) + t.Run("should render col with 50% parent width when col size is 6", func(t *testing.T) { + // arrange + col := New(6) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 40.0 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + + }) + t.Run("should render col with 40% parent width when col size is 5", func(t *testing.T) { + // arrange + col := New(5) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 33.333333333333336 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + }) + t.Run("should render col with 30% parent width when col size is 4", func(t *testing.T) { + // arrange + col := New(4) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 26.666666666666664 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + + }) + t.Run("should render col with 25% parent width when col size is 3", func(t *testing.T) { + // arrange + col := New(3) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 20.0 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + + }) + t.Run("should render col with 20% parent width when col size is 2", func(t *testing.T) { + // arrange + col := New(2) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 13.333333333333332 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + + }) + t.Run("should render col with 10% parent width when col size is 1", func(t *testing.T) { + // arrange + col := New(1) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + + expectedSizeX := 6.666666666666666 + pdf.EXPECT().CellFormat(expectedSizeX, ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + + // act + col.Render(pdf, ctx) + + // assert + + }) + t.Run("should render child components with width matching col width", func(t *testing.T) { + // arrange + col := New(12) + child := text.New("test") + col.AddRenderable(child) + pdf := mocks.NewFpdf(t) + + ctx := context.NewRootContext(100, 100, &context.Margins{ + Left: 10, + Right: 10, + Top: 10, + Bottom: 10, + }).WithDimension(80, 80) + pdf.EXPECT().SetDrawColor(255, 0, 0) + pdf.EXPECT().CellFormat(ctx.GetXOffset(), ctx.GetYOffset(), "", "1", 0, "C", false, 0, "") + pdf.EXPECT().Text(ctx.GetXOffset(), ctx.GetYOffset(), "test") + // act + col.Render(pdf, ctx) + + // assert + + }) +} + +// region Test Support +type invalidComponent struct { + _type types.DocumentType +} + +func (i *invalidComponent) Render(fpdf fpdf.Fpdf, ctx context.Context) { + return +} + +func (i *invalidComponent) GetType() string { + return i._type.String() +} + +func (i *invalidComponent) Add(component ...domain.Node) domain.Node { + return nil +} + +// endregion diff --git a/pkg/v2/context/context.go b/pkg/v2/context/context.go new file mode 100644 index 00000000..63d7903d --- /dev/null +++ b/pkg/v2/context/context.go @@ -0,0 +1,99 @@ +package context + +import ( + "fmt" + "math" +) + +const LineHeight = 20 + +// region Types +type Context struct { + Coordinate *Coordinate + Dimensions *Dimensions + Margins *Margins + CurrentPage int + pageDimensions *Dimensions +} + +// endregion + +func NewRootContext(pageWidth, pageHeight float64, margins *Margins) Context { + return Context{ + Coordinate: &Coordinate{0, 0}, + Dimensions: &Dimensions{0, 0}, + pageDimensions: &Dimensions{pageWidth, pageHeight}, + Margins: margins, + CurrentPage: 1, + } +} + +func (c Context) MaxHeight() float64 { + return c.pageDimensions.Height - c.Margins.Top - c.Margins.Bottom +} + +func (c Context) MaxWidth() float64 { + return c.pageDimensions.Width - c.Margins.Left - c.Margins.Right +} + +func (c Context) WithDimension(width, height float64) Context { + ctx := c.copy() + ctx.Dimensions.Width = width + ctx.Dimensions.Height = height + return ctx +} + +func (c Context) WithCoordinates(x, y float64) Context { + ctx := c.copy() + ctx.Coordinate.X = x + ctx.Coordinate.Y = y + return ctx +} + +func (c Context) GetXOffset() float64 { + baseX := c.Coordinate.X + c.Dimensions.Width + if baseX > c.MaxWidth() { + c.Coordinate.Y = c.Coordinate.Y + LineHeight + return c.Coordinate.X + } + return baseX +} + +func (c Context) GetYOffset() float64 { + baseY := c.Coordinate.Y + c.Dimensions.Height + if baseY > c.MaxHeight() { + c.CurrentPage = c.CurrentPage + 1 + return 0 + } + return baseY +} + +func (c Context) NewPage(pageCount int) Context { + ctx := c.copy() + ctx.CurrentPage = int(math.Max(float64(pageCount), float64(c.CurrentPage+1))) + ctx.Coordinate.X = 0 + ctx.Coordinate.Y = 0 + return ctx +} + +func (c Context) GetCurrentPage() int { + return c.CurrentPage +} +func (c Context) Print(label interface{}) { + fmt.Println(label) + + c.Coordinate.Print() + c.Dimensions.Print() + c.pageDimensions.Print() + c.Margins.Print() +} + +func (c Context) copy() Context { + return Context{ + Coordinate: &Coordinate{c.Coordinate.X, c.Coordinate.Y}, + Dimensions: &Dimensions{c.Dimensions.Width, c.Dimensions.Height}, + Margins: c.Margins, + CurrentPage: c.CurrentPage, + pageDimensions: c.pageDimensions, + } +} diff --git a/pkg/v2/context/context_test.go b/pkg/v2/context/context_test.go new file mode 100644 index 00000000..30d7fa85 --- /dev/null +++ b/pkg/v2/context/context_test.go @@ -0,0 +1,350 @@ +package context + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +const ( + SideSize = 1100.0 + MarginSize = 50.0 +) + +func TestNewRootContext(t *testing.T) { + t.Run("Should create a new root context without dimensions, and with correctly set page dimensions", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + // Act + ctx := NewRootContext(width, height, margins) + + // Assert + assert.NotNil(t, ctx) + assert.Equal(t, width, ctx.pageDimensions.Width) + assert.Equal(t, height, ctx.pageDimensions.Height) + assert.Zerof(t, ctx.Dimensions.Width, "Dimensions.Width should be zero") + assert.Zerof(t, ctx.Dimensions.Height, "Dimensions.Height should be zero") + assert.Zerof(t, ctx.Coordinate.X, "Coordinate.X should be zero") + assert.Zerof(t, ctx.Coordinate.Y, "Coordinate.Y should be zero") + }) +} + +func TestContext_MaxWidth(t *testing.T) { + t.Run("Should return the maximum available space inside margins", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins) + + // Act + maxWidth := ctx.MaxWidth() + + // Assert + assert.Equal(t, width-MarginSize-MarginSize, maxWidth) + }) + t.Run("Should return the maximum available space inside margins when child context is modified", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins) + + // Act + childCtx := ctx.WithDimension(100, 100) + maxWidth := childCtx.MaxWidth() + + // Assert + assert.Equal(t, width-MarginSize-MarginSize, maxWidth) + }) +} + +func TestContext_MaxHeight(t *testing.T) { + t.Run("Should return the maximum available space inside margins", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins) + + // Act_ + maxHeight := ctx.MaxHeight() + + // Assert + assert.Equal(t, height-MarginSize-MarginSize, maxHeight) + }) + t.Run("Should return the maximum available space inside margins when child context is modified", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins) + + // Act + childCtx := ctx.WithDimension(100, 100) + maxHeight := childCtx.MaxHeight() + + // Assert + assert.Equal(t, height-MarginSize-MarginSize, maxHeight) + }) +} + +func TestContext_WithCoordinateOffset(t *testing.T) { + t.Run("Should return a new context with the correct coordinate offset", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins) + + // Act + childCtx := ctx.WithCoordinates(100, 100) + + // Assert + assert.Equal(t, 100.0, childCtx.Coordinate.X) + assert.Equal(t, 100.0, childCtx.Coordinate.Y) + }) + t.Run("Should not modify the base context when creating a child context", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins) + + // Act + childCtx := ctx.WithCoordinates(100, 100) + + // Assert + // region Base Context Assertions + assert.Equal(t, 0.0, ctx.Coordinate.X) + assert.Equal(t, 0.0, ctx.Coordinate.Y) + assert.Equal(t, 0.0, ctx.Dimensions.Width) + assert.Equal(t, 0.0, ctx.Dimensions.Height) + assert.Equal(t, width, ctx.pageDimensions.Width) + assert.Equal(t, height, ctx.pageDimensions.Height) + assert.Equal(t, margins, ctx.Margins) + // endregion + // region Child Context Assertions + assert.Equal(t, margins, childCtx.Margins) + assert.Equal(t, width, childCtx.pageDimensions.Width) + assert.Equal(t, height, childCtx.pageDimensions.Height) + assert.Equal(t, 100.0, childCtx.Coordinate.X) + assert.Equal(t, 100.0, childCtx.Coordinate.Y) + assert.Equal(t, 0.0, childCtx.Dimensions.Width) + assert.Equal(t, 0.0, childCtx.Dimensions.Height) + // endregion + + }) +} + +func TestContext_WithDimension(t *testing.T) { + t.Run("Should return a new context with the correct dimensions", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins) + childWidth := 100.0 + childHeight := 100.0 + + // Act + childCtx := ctx.WithDimension(childWidth, childHeight) + + // Assert + assert.Equal(t, childWidth, childCtx.Dimensions.Width) + assert.Equal(t, childHeight, childCtx.Dimensions.Height) + }) + t.Run("Should not modify the base context when creating a child context", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins) + childWidth := 100.0 + childHeight := 100.0 + + // Act + childCtx := ctx.WithDimension(childWidth, childHeight) + + // Assert + // region Base Context Assertions + assert.Equal(t, 0.0, ctx.Coordinate.X) + assert.Equal(t, 0.0, ctx.Coordinate.Y) + assert.Equal(t, 0.0, ctx.Dimensions.Width) + assert.Equal(t, 0.0, ctx.Dimensions.Height) + assert.Equal(t, width, ctx.pageDimensions.Width) + assert.Equal(t, height, ctx.pageDimensions.Height) + assert.Equal(t, margins, ctx.Margins) + // endregion + // region Child Context Assertions + assert.Equal(t, margins, childCtx.Margins) + assert.Equal(t, width, childCtx.pageDimensions.Width) + assert.Equal(t, height, childCtx.pageDimensions.Height) + assert.Equal(t, 0.0, childCtx.Coordinate.X) + assert.Equal(t, 0.0, childCtx.Coordinate.Y) + assert.Equal(t, childWidth, childCtx.Dimensions.Width) + assert.Equal(t, childHeight, childCtx.Dimensions.Height) + // endregion + }) +} + +func TestContext_GetXOffset(t *testing.T) { + t.Run("Should return the maximum possible offset when smaller than max width", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + xOffset := 100.0 + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins) + ctx = ctx.WithCoordinates(xOffset, 0.0) + + // Act + result := ctx.GetXOffset() + + // Assert + assert.Equal(t, xOffset, result) + assert.Zerof(t, ctx.Coordinate.Y, "Y coordinate should be 0") + }) + t.Run("Should return parent coordinate and break to the next line when larger than max width", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + xOffset := 100.0 + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins).WithDimension(1100, 1100).WithCoordinates(xOffset, 0.0) + + // Act + result := ctx.GetXOffset() + + // Assert + assert.Equal(t, xOffset, result) + assert.Equal(t, float64(LineHeight), ctx.Coordinate.Y) + }) +} + +func TestContext_GetYOffset(t *testing.T) { + t.Run("Should return the maximum possible offset when smaller than max height", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + yOffset := 100.0 + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins) + ctx = ctx.WithCoordinates(0.0, yOffset) + + // Act + result := ctx.GetYOffset() + + // Assert + assert.Equal(t, yOffset, result) + assert.Zerof(t, ctx.Coordinate.X, "X coordinate should be 0") + }) + t.Run("Should return 0 and break to the next page when larger than max height", func(t *testing.T) { + // Arrange + width := SideSize + height := SideSize + yOffset := 100.0 + + margins := &Margins{ + Left: MarginSize, + Right: MarginSize, + Top: MarginSize, + Bottom: MarginSize, + } + + ctx := NewRootContext(width, height, margins).WithDimension(1100, 1100).WithCoordinates(0.0, yOffset) + + // Act + result := ctx.GetYOffset() + + // Assert + assert.Equal(t, float64(0), result) + assert.Equal(t, float64(0), ctx.Coordinate.X) + assert.Equal(t, 1, ctx.CurrentPage) + }) +} diff --git a/pkg/v2/context/coordinate.go b/pkg/v2/context/coordinate.go new file mode 100644 index 00000000..f9b15a20 --- /dev/null +++ b/pkg/v2/context/coordinate.go @@ -0,0 +1,16 @@ +package context + +import "fmt" + +type Coordinate struct { + X float64 + Y float64 +} + +func (c *Coordinate) Print() { + if c == nil { + return + } + + fmt.Printf("(%1.f, %1.f)\n", c.X, c.Y) +} diff --git a/pkg/v2/context/dimensions.go b/pkg/v2/context/dimensions.go new file mode 100644 index 00000000..d6da7d6a --- /dev/null +++ b/pkg/v2/context/dimensions.go @@ -0,0 +1,16 @@ +package context + +import "fmt" + +type Dimensions struct { + Width float64 + Height float64 +} + +func (d *Dimensions) Print() { + if d == nil { + return + } + + fmt.Printf("Width: %1.f, Height: %1.f\n", d.Width, d.Height) +} diff --git a/pkg/v2/context/margins.go b/pkg/v2/context/margins.go new file mode 100644 index 00000000..b3255e21 --- /dev/null +++ b/pkg/v2/context/margins.go @@ -0,0 +1,18 @@ +package context + +import "fmt" + +type Margins struct { + Left float64 + Right float64 + Top float64 + Bottom float64 +} + +func (m *Margins) Print() { + if m == nil { + return + } + + fmt.Printf("Left: %1.f, Right: %1.f, Top: %1.f, Bottom: %1.f\n", m.Left, m.Right, m.Left, m.Bottom) +} diff --git a/pkg/v2/document.go b/pkg/v2/document.go new file mode 100644 index 00000000..50d4622f --- /dev/null +++ b/pkg/v2/document.go @@ -0,0 +1,124 @@ +package v2 + +import ( + "fmt" + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/color" + "github.com/johnfercher/maroto/pkg/v2/col" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/page" + "github.com/johnfercher/maroto/pkg/v2/row" + "github.com/johnfercher/maroto/pkg/v2/types" + "github.com/jung-kurt/gofpdf" +) + +type document struct { + file string + ctx context.Context + _type types.DocumentType + fpdf fpdf.Fpdf + pages []domain.Page + rows []domain.Row +} + +func NewDocument(file string) *document { + fpdf := gofpdf.NewCustom(&gofpdf.InitType{ + OrientationStr: "P", + UnitStr: "mm", + SizeStr: "A4", + FontDirStr: "", + }) + + fpdf.SetFont("Arial", "B", 16) + + width, height := fpdf.GetPageSize() + left, top, right, bottom := fpdf.GetMargins() + fpdf.AddPage() + + return &document{ + file: file, + fpdf: fpdf, + _type: types.Document, + ctx: context.NewRootContext(width, height, &context.Margins{ + Left: left, + Top: top, + Right: right, + Bottom: bottom, + }), + } +} + +func (d *document) ForceAddPage(pages ...domain.Page) { + d.pages = append(d.pages, pages...) +} + +func (d *document) Add(rows ...domain.Row) { + d.rows = append(d.rows, rows...) +} + +func (d *document) Generate() error { + //d.ctx.Print(d._type) + ctx := d.ctx.WithDimension(d.ctx.MaxWidth(), d.ctx.MaxHeight()) + + maxHeight := d.ctx.MaxHeight() + currentHeight := 0.0 + var buf []domain.Row + for _, dRow := range d.rows { + height := dRow.GetHeight() + if currentHeight+height >= maxHeight { + p := page.New() + p.Add(buf...) + + c := col.New(12) + lastRowHeight := maxHeight - currentHeight + fmt.Printf("lastrow: %f, maxHeight: %f, currentHeight: %f, x: %f, y: %f\n", lastRowHeight, maxHeight, currentHeight, d.fpdf.GetX(), d.fpdf.GetY()) + r := row.New(lastRowHeight, color.Color{255, 0, 0}) + r.Add(c) + p.Add(r) + + d.pages = append(d.pages, p) + buf = nil + currentHeight = 0 + } + + currentHeight += height + buf = append(buf, dRow) + } + + p := page.New() + p.Add(buf...) + d.pages = append(d.pages, p) + + for _, page := range d.pages { + page.Render(d.fpdf, ctx) + } + + fmt.Println(len(d.pages)) + + /*for _, dRow := range d.rows { + dRow.Render(d.fpdf, ctx) + } + + for _, page := range d.pages { + page.Render(d.fpdf, ctx) + }*/ + + return d.fpdf.OutputFileAndClose(d.file) +} + +func (d *document) GetStructure() *tree.Node[domain.Structure] { + str := domain.Structure{ + Type: string(d._type), + Value: d.file, + } + node := tree.NewNode(0, str) + + for _, r := range d.rows { + inner := r.GetStructure() + node.AddNext(inner) + } + + return node +} diff --git a/pkg/v2/document_test.go b/pkg/v2/document_test.go new file mode 100644 index 00000000..40e6ee85 --- /dev/null +++ b/pkg/v2/document_test.go @@ -0,0 +1,58 @@ +package v2_test + +import ( + "fmt" + "github.com/johnfercher/maroto/pkg/consts" + v2 "github.com/johnfercher/maroto/pkg/v2" + "github.com/johnfercher/maroto/pkg/v2/code/barcode" + "github.com/johnfercher/maroto/pkg/v2/code/matrixcode" + "github.com/johnfercher/maroto/pkg/v2/code/qrcode" + "github.com/johnfercher/maroto/pkg/v2/col" + "github.com/johnfercher/maroto/pkg/v2/image" + "github.com/johnfercher/maroto/pkg/v2/row" + "github.com/johnfercher/maroto/pkg/v2/signature" + "github.com/johnfercher/maroto/pkg/v2/text" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestNewDocument(t *testing.T) { + // Act + sut := v2.NewDocument("file.pdf") + + // Assert + assert.NotNil(t, sut) + assert.Equal(t, "*v2.document", fmt.Sprintf("%T", sut)) +} + +func TestDocument_GetStructure(t *testing.T) { + // Arrange + p := v2.NewDocument("file.txt") + + r1 := row.New(10) + r1c1 := col.New(4).Add(barcode.New("barcode")) + r1c2 := col.New(4).Add(matrixcode.New("matrixcode")) + r1c3 := col.New(4).Add(qrcode.New("qrcode")) + r1.Add(r1c1, r1c2, r1c3) + + r2 := row.New(10) + r2c1 := col.New(3).Add(image.NewFromFile("file.png")) + r2c2 := col.New(3).Add(image.NewFromBase64("base64string", consts.Png)) + r2c3 := col.New(3).Add(signature.New("signature")) + r2c4 := col.New(3).Add(text.New("text")) + r2.Add(r2c1, r2c2, r2c3, r2c4) + + p.Add(r1, r2) + + // Act + nodeDocument := p.GetStructure() + + // Assert Document + assert.NotNil(t, nodeDocument) + _, document := nodeDocument.Get() + assert.Equal(t, "document", document.Type) + assert.Equal(t, "file.txt", document.Value) + + nodeRows := nodeDocument.GetNexts() + assert.Equal(t, 2, len(nodeRows)) +} diff --git a/pkg/v2/domain/domain.go b/pkg/v2/domain/domain.go new file mode 100644 index 00000000..e618a5a6 --- /dev/null +++ b/pkg/v2/domain/domain.go @@ -0,0 +1,47 @@ +package domain + +import ( + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/v2/context" +) + +type Maroto interface { + Generate() error + ForceAddPage(pages ...Page) + Add(rows ...Row) + GetStructure() *tree.Node[Structure] +} + +type Node interface { + Render(fpdf fpdf.Fpdf, ctx context.Context) + GetStructure() *tree.Node[Structure] +} + +type Component interface { + Node + GetType() string // Just to differentiate from Node +} + +type Page interface { + Node + Add(rows ...Row) Page +} + +type Row interface { + Node + Add(cols ...Col) + GetHeight() float64 +} + +type Col interface { + Node + Add(component ...Component) Col + AddInner(rows ...Row) Col +} + +type Structure struct { + Type string + Value string + Props map[string]string +} diff --git a/pkg/v2/image/base64image.go b/pkg/v2/image/base64image.go new file mode 100644 index 00000000..2c7e3124 --- /dev/null +++ b/pkg/v2/image/base64image.go @@ -0,0 +1,72 @@ +package image + +import ( + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/consts" + "github.com/johnfercher/maroto/pkg/props" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/text" + "github.com/johnfercher/maroto/pkg/v2/types" +) + +type base64Image struct { + base64 string + extension consts.Extension + _type types.DocumentType + components []domain.Node + prop props.Rect +} + +func NewFromBase64(path string, extension consts.Extension, imageProps ...props.Rect) domain.Component { + prop := props.Rect{} + if len(imageProps) > 0 { + prop = imageProps[0] + } + prop.MakeValid() + + return &base64Image{ + _type: types.Image, + base64: path, + prop: prop, + extension: extension, + } +} + +func (b *base64Image) Render(fpdf fpdf.Fpdf, ctx context.Context) { + math := internal.NewMath(fpdf) + img := internal.NewImage(fpdf, math) + x := fpdf.GetX() - ctx.Margins.Left - ctx.Dimensions.Width + y := fpdf.GetY() - ctx.Margins.Top + err := img.AddFromBase64( + b.base64, + internal.Cell{x, y, ctx.Dimensions.Width, ctx.Dimensions.Height}, + b.prop, + b.extension, + ) + if err != nil { + fpdf.ClearError() + txt := text.New("Failed to render fileImage") + txt.Render(fpdf, ctx) + } +} + +func (b *base64Image) GetType() string { + return b._type.String() +} + +func (b *base64Image) GetStructure() *tree.Node[domain.Structure] { + trimLength := 10 + if len(b.base64) < trimLength { + trimLength = len(b.base64) + } + + str := domain.Structure{ + Type: string(b._type), + Value: b.base64[:trimLength], + } + + return tree.NewNode(0, str) +} diff --git a/pkg/v2/image/fileimage.go b/pkg/v2/image/fileimage.go new file mode 100644 index 00000000..5fe0ac37 --- /dev/null +++ b/pkg/v2/image/fileimage.go @@ -0,0 +1,66 @@ +package image + +import ( + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/props" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/text" + "github.com/johnfercher/maroto/pkg/v2/types" +) + +type fileImage struct { + path string + _type types.DocumentType + components []domain.Node + prop props.Rect +} + +func NewFromFile(path string, imageProps ...props.Rect) domain.Component { + prop := props.Rect{} + if len(imageProps) > 0 { + prop = imageProps[0] + } + prop.MakeValid() + + return &fileImage{ + _type: types.Image, + path: path, + prop: prop, + } +} + +func (f *fileImage) Render(fpdf fpdf.Fpdf, ctx context.Context) { + math := internal.NewMath(fpdf) + img := internal.NewImage(fpdf, math) + x := fpdf.GetX() - ctx.Margins.Left - ctx.Dimensions.Width + y := fpdf.GetY() - ctx.Margins.Top + err := img.AddFromFile( + f.path, + internal.Cell{x, y, ctx.Dimensions.Width, ctx.Dimensions.Height}, + f.prop) + if err != nil { + fpdf.ClearError() + txt := text.New("Failed to render fileImage") + txt.Render(fpdf, ctx) + } +} + +func (f *fileImage) GetType() string { + return f._type.String() +} + +func (f *fileImage) Add(_ ...domain.Node) domain.Node { + return f +} + +func (f *fileImage) GetStructure() *tree.Node[domain.Structure] { + str := domain.Structure{ + Type: string(f._type), + Value: f.path, + } + + return tree.NewNode(0, str) +} diff --git a/pkg/v2/page/page.go b/pkg/v2/page/page.go new file mode 100644 index 00000000..07be7a5f --- /dev/null +++ b/pkg/v2/page/page.go @@ -0,0 +1,54 @@ +package page + +import ( + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/types" +) + +type page struct { + _type types.DocumentType + rows []domain.Row +} + +func New() domain.Page { + return &page{ + _type: types.Page, + } +} + +func (p *page) Render(fpdf fpdf.Fpdf, ctx context.Context) { + //ctx = ctx.NewPage(fpdf.PageNo()) + + for _, row := range p.rows { + row.Render(fpdf, ctx) + } + //fpdf.AddPage() + +} + +func (p *page) GetType() string { + return p._type.String() +} + +func (p *page) Add(rows ...domain.Row) domain.Page { + p.rows = append(p.rows, rows...) + return p +} + +func (p *page) GetStructure() *tree.Node[domain.Structure] { + str := domain.Structure{ + Type: string(p._type), + } + + node := tree.NewNode(0, str) + + for _, r := range p.rows { + inner := r.GetStructure() + node.AddNext(inner) + } + + return node +} diff --git a/pkg/v2/row/row.go b/pkg/v2/row/row.go new file mode 100644 index 00000000..52cbca1f --- /dev/null +++ b/pkg/v2/row/row.go @@ -0,0 +1,77 @@ +package row + +import ( + "fmt" + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/color" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/types" +) + +type row struct { + height float64 + _type types.DocumentType + cols []domain.Col + color color.Color +} + +func (r *row) GetHeight() float64 { + return r.height +} + +func (r *row) Add(cols ...domain.Col) { + r.cols = append(r.cols, cols...) +} + +func New(height float64, c ...color.Color) domain.Row { + cx := color.NewBlack() + if len(c) > 0 { + cx = c[0] + } + + return &row{ + _type: types.Row, + height: height, + color: cx, + } +} + +func (r *row) GetType() string { + return r._type.String() +} + +func (r *row) GetStructure() *tree.Node[domain.Structure] { + str := domain.Structure{ + Type: string(r._type), + Value: fmt.Sprintf("%2.f", r.height), + } + + node := tree.NewNode(0, str) + + for _, c := range r.cols { + inner := c.GetStructure() + node.AddNext(inner) + } + + return node +} + +func (r *row) Render(fpdf fpdf.Fpdf, ctx context.Context) { + //ctx.Print(r.height) + ctx = ctx.WithDimension(ctx.Dimensions.Width, r.height) + fpdf.SetDrawColor(r.color.Red, r.color.Green, r.color.Blue) + + for _, col := range r.cols { + col.Render(fpdf, ctx) + } + r.render(fpdf, ctx) + + return +} + +func (r *row) render(fpdf fpdf.Fpdf, ctx context.Context) { + //x, y := ctx.GetXOffset(), ctx.GetYOffset() + fpdf.Ln(ctx.Dimensions.Height) +} diff --git a/pkg/v2/signature/signature.go b/pkg/v2/signature/signature.go new file mode 100644 index 00000000..3557b12a --- /dev/null +++ b/pkg/v2/signature/signature.go @@ -0,0 +1,63 @@ +package signature + +import ( + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/consts" + "github.com/johnfercher/maroto/pkg/props" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/types" +) + +type signature struct { + value string + _type types.DocumentType + components []domain.Node + prop props.Text +} + +func New(value string, textProps ...props.Text) domain.Component { + prop := props.Text{} + if len(textProps) > 0 { + prop = textProps[0] + } + prop.MakeValid(consts.Arial) + + return &signature{ + _type: types.Signature, + value: value, + prop: prop, + } +} + +func (s *signature) Render(fpdf fpdf.Fpdf, ctx context.Context) { + font := internal.NewFont(fpdf, 2, consts.Arial, consts.Normal) + math := internal.NewMath(fpdf) + text := internal.NewText(fpdf, math, font) + signature := internal.NewSignature(fpdf, math, text) + x := fpdf.GetX() - ctx.Margins.Left - ctx.Dimensions.Width + y := fpdf.GetY() - ctx.Margins.Top + signature.AddSpaceFor( + s.value, + internal.Cell{x, y, ctx.Dimensions.Width, ctx.Dimensions.Height}, + s.prop) +} + +func (s *signature) GetType() string { + return s._type.String() +} + +func (s *signature) Add(_ ...domain.Node) domain.Node { + return s +} + +func (s *signature) GetStructure() *tree.Node[domain.Structure] { + str := domain.Structure{ + Type: string(s._type), + Value: s.value, + } + + return tree.NewNode(0, str) +} diff --git a/pkg/v2/text/text.go b/pkg/v2/text/text.go new file mode 100644 index 00000000..5276e579 --- /dev/null +++ b/pkg/v2/text/text.go @@ -0,0 +1,68 @@ +package text + +import ( + "github.com/johnfercher/go-tree/tree" + "github.com/johnfercher/maroto/internal" + "github.com/johnfercher/maroto/internal/fpdf" + "github.com/johnfercher/maroto/pkg/consts" + "github.com/johnfercher/maroto/pkg/props" + "github.com/johnfercher/maroto/pkg/v2/context" + "github.com/johnfercher/maroto/pkg/v2/domain" + "github.com/johnfercher/maroto/pkg/v2/types" +) + +type text struct { + value string + _type types.DocumentType + components []domain.Node + prop props.Text +} + +func New(value string, textProps ...props.Text) domain.Component { + prop := props.Text{} + if len(textProps) > 0 { + prop = textProps[0] + } + prop.MakeValid(consts.Arial) + + return &text{ + _type: types.Text, + value: value, + prop: prop, + } +} + +func (t *text) GetType() string { + return t._type.String() +} + +func (t *text) Add(_ ...domain.Node) domain.Node { + return t +} + +func (t *text) GetStructure() *tree.Node[domain.Structure] { + str := domain.Structure{ + Type: string(t._type), + Value: t.value, + } + + return tree.NewNode(0, str) +} + +func (t *text) Render(fpdf fpdf.Fpdf, ctx context.Context) { + //ctx.Print(t.value) + t.render(fpdf, ctx) + return +} + +func (t *text) render(fpdf fpdf.Fpdf, ctx context.Context) { + font := internal.NewFont(fpdf, 2, consts.Arial, consts.Normal) + math := internal.NewMath(fpdf) + text := internal.NewText(fpdf, math, font) + x := fpdf.GetX() - ctx.Margins.Left - ctx.Dimensions.Width + y := fpdf.GetY() - ctx.Margins.Top + text.Add( + t.value, + internal.Cell{x, y, ctx.Dimensions.Width, ctx.Dimensions.Height}, + t.prop) +} diff --git a/pkg/v2/types/types.go b/pkg/v2/types/types.go new file mode 100644 index 00000000..df25b5d8 --- /dev/null +++ b/pkg/v2/types/types.go @@ -0,0 +1,38 @@ +package types + +import "slices" + +const ( + Document = "document" + Row = "row" + Page = "page" + Col = "col" + Image = "image" + Text = "text" + Signature = "signature" + Barcode = "barcode" + QrCode = "qrcode" + MatrixCode = "matrixcode" +) + +type DocumentType string + +func (t DocumentType) String() string { + return string(t) +} + +func (t DocumentType) Accept(dt string) bool { + if val, ok := buildAcceptedMap()[t.String()]; ok { + return slices.Contains(val, dt) + } + return false +} + +func buildAcceptedMap() map[string][]string { + return map[string][]string{ + Document: {Row, Page}, + Page: {Row}, + Row: {Col}, + Col: {Row, Image, Text, Signature, Barcode, QrCode, MatrixCode}, + } +} diff --git a/v2.pdf b/v2.pdf new file mode 100644 index 00000000..421c1487 Binary files /dev/null and b/v2.pdf differ