1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.icon

File IconManager.java

 

Code metrics

0
0
0
1
116
15
0
-
-
0
-

Classes

Class Line # Actions
IconManager 33 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.icon;
21   
22    import java.util.List;
23   
24    import org.xwiki.component.annotation.Role;
25   
26    /**
27    * Component to render an icon, depending on the current icon theme set on the preferences.
28    *
29    * @since 6.2M1
30    * @version $Id: 0268f4e3769ef3f442aef7b158edd730fbb3fa7e $
31    */
32    @Role
 
33    public interface IconManager
34    {
35    /**
36    * Generate the wiki syntax to display an icon with the current icon theme.
37    * @param iconName name of the icon to render
38    * @return the wiki syntax that displays the icon or an empty string if the icon does not exist
39    * @throws IconException if problems occur
40    */
41    String render(String iconName) throws IconException;
42   
43    /**
44    * Generate the wiki syntax to display an icon with the specified icon theme.
45    * @param iconName name of the icon to render
46    * @param iconSetName name of the icon set to use
47    * @return the wiki syntax that displays the icon or an empty string if the icon does not exist
48    * @throws IconException if problems occur
49    *
50    * @since 6.3RC1
51    */
52    String render(String iconName, String iconSetName) throws IconException;
53   
54    /**
55    * Generate the wiki syntax to display an icon with the specified icon theme.
56    * @param iconName name of the icon to render
57    * @param iconSetName name of the icon set to use
58    * @param fallback enable the fallback to the default icon theme if the icon does not exist
59    * @return the wiki syntax that displays the icon or an empty string if the icon does not exist
60    * @throws IconException if problems occur
61    *
62    * @since 6.3RC1
63    */
64    String render(String iconName, String iconSetName, boolean fallback) throws IconException;
65   
66    /**
67    * Generate the HTML code to display an icon.
68    * @param iconName name of the icon to render
69    * @return the HTML code that displays the icon or an empty string if the icon does not exist
70    * @throws IconException if problems occur
71    */
72    String renderHTML(String iconName) throws IconException;
73   
74    /**
75    * Generate the HTML code to display an icon with the specified icon theme.
76    * @param iconName name of the icon to render
77    * @param iconSetName name of the icon set to use
78    * @return the HTML code that displays the icon or an empty string if the icon does not exist
79    * @throws IconException if problems occur
80    *
81    * @since 6.3RC1
82    */
83    String renderHTML(String iconName, String iconSetName) throws IconException;
84   
85    /**
86    * Generate the HTML code to display an icon with the specified icon theme.
87    * @param iconName name of the icon to render
88    * @param iconSetName name of the icon set to use
89    * @param fallback enable the fallback to the default icon theme if the icon does not exist
90    * @return the HTML code that displays the icon or an empty string if the icon does not exist
91    * @throws IconException if problems occur
92    *
93    * @since 6.3RC1
94    */
95    String renderHTML(String iconName, String iconSetName, boolean fallback) throws IconException;
96   
97    /**
98    * Get the list of the names of all available icons in the current icon set.
99    * @return the icon names
100    * @throws IconException if problem occurs
101    *
102    * @since 6.4M1
103    */
104    List<String> getIconNames() throws IconException;
105   
106    /**
107    * Get the list of the names of all available icons in the specified icon set.
108    * @param iconSetName name of the icon set
109    * @return the icon names
110    * @throws IconException if problem occurs
111    *
112    * @since 6.4M1
113    */
114    List<String> getIconNames(String iconSetName) throws IconException;
115   
116    }