Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2017 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
19 *
20 */
21
22namespace oat\tao\model\theme;
23
24interface ThemeServiceInterface
25{
26    /** Service identifier in the ServiceManager. */
27    public const SERVICE_ID = 'tao/theming';
28
29    /** The option of the theme collection. */
30    public const OPTION_AVAILABLE = 'available';
31
32    /** The option of the current theme name. */
33    public const OPTION_CURRENT = 'current';
34
35    /** The class name offset in the stored version. */
36    public const THEME_CLASS_OFFSET = 'class';
37
38    /** The options offset in the stored version. */
39    public const THEME_OPTIONS_OFFSET = 'options';
40
41    public const OPTION_THEME_DETAILS_PROVIDERS = 'themeDetailsProviders';
42
43    public const OPTION_HEADLESS_PAGE = 'headless_page';
44
45    /**
46     * Returns the identifier of the current Theme.
47     *
48     * @return string
49     */
50    public function getCurrentThemeId();
51
52    /**
53     * Returns the current Theme.
54     *
55     * @return Theme
56     */
57    public function getTheme();
58
59    /**
60     * Returns the Theme identified by the requested identifier.
61     *
62     * @param string $themeId
63     *
64     * @return Theme
65     *
66     * @throws \common_exception_InconsistentData
67     */
68    public function getThemeById($themeId);
69
70    /**
71     * Returns all the available Themes.
72     *
73     * @return Theme[]
74     */
75    public function getAllThemes();
76
77    /**
78     * Adds and sets a theme as default.
79     *
80     * @param Theme $theme
81     * @param bool  $protectAlreadyExistingThemes
82     *
83     * @throws \common_exception_Error
84     */
85    public function setTheme(Theme $theme, $protectAlreadyExistingThemes = true);
86
87    /**
88     * Adds a Theme.
89     *
90     * @param Theme $theme
91     * @param bool  $protectAlreadyExistingThemes
92     *
93     * @return string
94     */
95    public function addTheme(Theme $theme, $protectAlreadyExistingThemes = true);
96
97    /**
98     * Returns TRUE if the Theme exists.
99     *
100     * @param string $themeId
101     *
102     * @return bool
103     */
104    public function hasTheme($themeId);
105
106    /**
107     * Sets the current Theme.
108     *
109     * @param string $themeId
110     *
111     * @throws \common_exception_Error
112     */
113    public function setCurrentTheme($themeId);
114
115    /**
116     * Removes the Theme identified by the requested identifier.
117     *
118     * @param string $themeId
119     *
120     * @return bool
121     */
122    public function removeThemeById($themeId);
123
124    /**
125     * Tells if the page has to be headless: without header and footer.
126     *
127     * @return bool|mixed
128     */
129    public function isHeadless();
130}