3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
11 namespace Civi\Report
;
14 * @package Civi\Report
16 interface OutputHandlerInterface
{
21 * It's suggested to extend \Civi\Report\OutputHandlerBase and then this will
24 * @return \CRM_Report_Form
26 public function getForm():\CRM_Report_Form
;
31 * It's suggested to extend \Civi\Report\OutputHandlerBase and then this will
34 * @param \CRM_Report_Form $form
36 public function setForm(\CRM_Report_Form
$form);
39 * Are we a suitable output handler based on the given form?
41 * The class member $form isn't set yet at this point since we don't
42 * even know if we're in play yet, so the form is a parameter.
44 * @param \CRM_Report_Form $form
48 public function isOutputHandlerFor(\CRM_Report_Form
$form):bool;
51 * Return the download filename. This should be the "clean" name, not
52 * a munged temporary filename.
56 public function getFileName():string;
59 * Return the html body of the email.
63 public function getMailBody():string;
66 * Return the report contents as a string.
70 public function getOutputString():string;
73 * Set headers as appropriate and send the output to the browser.
75 public function download();
78 * Mime type of the attachment.
82 public function getMimeType():string;
85 * Charset of the attachment.
87 * The default of '' means charset is not specified in the mimepart,
88 * which is normal for binary attachments, but for text attachments you
89 * should specify something like 'utf-8'.
93 public function getCharset():string;
96 * Hide/show various elements in the output, but generally for a handler
97 * this is always set to TRUE.
101 public function isPrintOnly():bool;
104 * Use a pager, but for a handler this would be FALSE since paging
109 public function isAddPaging():bool;
112 * Create absolute urls for links. Generally for a handler
113 * this is always set to TRUE, but for example for 'print' it's displayed
114 * on the site so it can be relative.
115 * @todo Couldn't it just always be absolute?
119 public function isAbsoluteUrl():bool;