1<?php
2
3namespace PhpOffice\PhpSpreadsheet\Writer;
4
5use PhpOffice\PhpSpreadsheet\Spreadsheet;
6
7interface IWriter
8{
9    /**
10     * IWriter constructor.
11     */
12    public function __construct(Spreadsheet $spreadsheet);
13
14    /**
15     * Write charts in workbook?
16     *        If this is true, then the Writer will write definitions for any charts that exist in the PhpSpreadsheet object.
17     *        If false (the default) it will ignore any charts defined in the PhpSpreadsheet object.
18     *
19     * @return bool
20     */
21    public function getIncludeCharts();
22
23    /**
24     * Set write charts in workbook
25     *        Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object.
26     *        Set to false (the default) to ignore charts.
27     *
28     * @param bool $pValue
29     *
30     * @return IWriter
31     */
32    public function setIncludeCharts($pValue);
33
34    /**
35     * Get Pre-Calculate Formulas flag
36     *     If this is true (the default), then the writer will recalculate all formulae in a workbook when saving,
37     *        so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet
38     *        viewer when opening the file
39     *     If false, then formulae are not calculated on save. This is faster for saving in PhpSpreadsheet, but slower
40     *        when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself.
41     *
42     * @return bool
43     */
44    public function getPreCalculateFormulas();
45
46    /**
47     * Set Pre-Calculate Formulas
48     *        Set to true (the default) to advise the Writer to calculate all formulae on save
49     *        Set to false to prevent precalculation of formulae on save.
50     *
51     * @param bool $pValue Pre-Calculate Formulas?
52     *
53     * @return IWriter
54     */
55    public function setPreCalculateFormulas($pValue);
56
57    /**
58     * Save PhpSpreadsheet to file.
59     *
60     * @param resource|string $pFilename Name of the file to save
61     */
62    public function save($pFilename);
63
64    /**
65     * Get use disk caching where possible?
66     *
67     * @return bool
68     */
69    public function getUseDiskCaching();
70
71    /**
72     * Set use disk caching where possible?
73     *
74     * @param bool $pValue
75     * @param string $pDirectory Disk caching directory
76     *
77     * @return IWriter
78     */
79    public function setUseDiskCaching($pValue, $pDirectory = null);
80
81    /**
82     * Get disk caching directory.
83     *
84     * @return string
85     */
86    public function getDiskCachingDirectory();
87}
88