001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.ui;
029
030import com.vaadin.server.FontIcon;
031import com.vaadin.server.GenericFontIcon;
032
033/**
034 * The available OpenCms workplace icons.<p>
035 */
036public enum FontOpenCms implements FontIcon {
037
038    /** The add icon. */
039    ADD_SMALL(0xe90c),
040
041    /** The apps icon. */
042    APPS(0xe617),
043
044    /** The bookmarks icon. */
045    BOOKMARKS(0xe654),
046
047    /** The brackets icon. */
048    BRACKETS(0xe64f),
049
050    /** The broadcast icon. */
051    BROADCAST(0xe650),
052
053    /** The cache icon. */
054    CACHE(0xe62f),
055
056    /** The check icon. */
057    CHECK_SMALL(0xe917),
058
059    /** The circle icon. */
060    CIRCLE(0xe62a),
061
062    /** The circle cancel icon. */
063    CIRCLE_CANCEL(0x622),
064
065    /** The circle check icon. */
066    CIRCLE_CHECK(0xe61e),
067
068    /** The circle info icon. */
069    CIRCLE_INFO(0xe640),
070
071    /** The circle invert icon. */
072    CIRCLE_INV(0xe62b),
073
074    /** The circle invert cancel icon. */
075    CIRCLE_INV_CANCEL(0xe623),
076
077    /** The circle invert check icon. */
078    CIRCLE_INV_CHECK(0xe61f),
079
080    /** The circle invert minus icon. */
081    CIRCLE_INV_MINUS(0xe629),
082
083    /** The circle invert pause icon. */
084    CIRCLE_INV_PAUSE(0x0621),
085
086    /** The circle invert play icon. */
087    CIRCLE_INV_PLAY(0xe625),
088
089    /** The circle invert plus icon. */
090    CIRCLE_INV_PLUS(0xe627),
091
092    /** The circle minus icon. */
093    CIRCLE_MINUS(0xe628),
094
095    /** The circle pause icon. */
096    CIRCLE_PAUSE(0xe620),
097
098    /** The circle play icon. */
099    CIRCLE_PLAY(0xe624),
100
101    /** The circle plus icon. */
102    CIRCLE_PLUS(0xe626),
103
104    /** The circle help icon. */
105    CIRCLE_HELP(0xe900),
106
107    /** The clipboard icon. */
108    CLIPBOARD(0xe60f),
109
110    /** The context menu icon. */
111    CONTEXT_MENU(0xe616),
112
113    /** The context menu dots icon. */
114    CONTEXT_MENU_DOTS(0xe64a),
115
116    /** The context menu icon. */
117    CONTEXT_MENU_SMALL(0xe90a),
118
119    /** The copy locale icon. */
120    COPY_LOCALE(0xe61a),
121
122    /** The crop icon. */
123    CROP(0xe641),
124
125    /** The crop remove icon. */
126    CROP_REMOVE(0xe642),
127
128    /** The cut icon. */
129    CUT_SMALL(0xe907),
130
131    /** The database icon. */
132    DATABASE(0xe62c),
133
134    /** The delete icon. */
135    DELETE_SMALL(0xe90d),
136
137    /** The download icon. */
138    DOWNLOAD(0xe605),
139
140    /** The edit down icon. */
141    EDIT_DOWN_SMALL(0xe910),
142
143    /** The bulls eye edit icon. */
144    EDIT_POINT(0xe600),
145
146    /** The disabled bulls eye edit icon. */
147    EDIT_POINT_DISABLED(0xe601),
148
149    /** The bulls eye edit icon. */
150    EDIT_POINT_SMALL(0xe901),
151
152    /** The edit up icon. */
153    EDIT_UP_SMALL(0xe913),
154
155    /** The error icon. */
156    ERROR(0xe63f),
157
158    /** The exit icon. */
159    EXIT(0xe615),
160
161    /** The favorite icon. */
162    FAVORITE_SMALL(0xe906),
163
164    /** The file icon. */
165    FILE(0xe63b),
166
167    /** The inverse file icon. */
168    FILE_INV(0xe63c),
169
170    /** The filter icon. */
171    FILTER(0xe60c),
172
173    /** The folder icon. */
174    FOLDER(0xe63d),
175
176    /** The gallery icon. */
177    GALLERY(0xe611),
178
179    /** The git icon. */
180    GIT(0xe633),
181
182    /** The help icon. */
183    HELP(0xe602),
184
185    /** The disabled help icon. */
186    HELP_DISABLED(0xe603),
187
188    /** The hide icon. */
189    HIDE(0xe609),
190
191    /** The highlight icon. */
192    HIGHLIGHT(0xe64c),
193
194    /** The history icon. */
195    HISTORY(0xe631),
196
197    /** The image icon. */
198    IMAGE(0xe632),
199
200    /** The info icon. */
201    INFO(0xe612),
202
203    /** The info icon. */
204    INFO_SMALL(0xe904),
205
206    /** The invisible chars icon. */
207    INVISIBLE_CHARS(0xe64d),
208
209    /** The link icon. */
210    LINK(0xe636),
211
212    /** The list icon. */
213    LIST(0xe634),
214
215    /** The lock closed icon. */
216    LOCK_CLOSED(0xe644),
217
218    /** The lock opened icon. */
219    LOCK_OPEN(0xe645),
220
221    /** The lock icon. */
222    LOCK_SMALL(0xe90e),
223
224    /** The log icon. */
225    LOG(0xe637),
226
227    /** The log icon. */
228    LOGIN(0xe653),
229
230    /** The help icon. */
231    HELP_SMALL(0xe919),
232
233    /** The module icon. */
234    MODULE(0xe638),
235
236    /** The move icon. */
237    MOVE_SMALL(0xe903),
238
239    /** The pen/edit icon. */
240    PEN(0xe614),
241
242    /** The pen/edit icon. */
243    PEN_SMALL(0xe902),
244
245    /** The preview icon. */
246    PREVIEW_SMALL(0xe90f),
247
248    /** The project icon. */
249    PROJECT(0xe62e),
250
251    /** The publish icon. */
252    PUBLISH(0xe60e),
253
254    /** The quick launch editor icon. */
255    QUICKLAUNCH_EDITOR(0xe63a),
256
257    /** The redo icon. */
258    REDO(0xe607),
259
260    /** The remove locale icon. */
261    REMOVE_LOCALE(0xe619),
262
263    /** The reset icon. */
264    RESET(0xe643),
265
266    /** The save icon. */
267    SAVE(0xe60b),
268
269    /** The save and exit icon. */
270    SAVE_EXIT(0xe60a),
271
272    /** The scheduler icon. */
273    SCHEDULER(0xe630),
274
275    /** The search icon. */
276    SEARCH(0xe60d),
277
278    /** The search replace icon. */
279    SEARCH_REPLACE(0xe64b),
280
281    /** The search icon. */
282    SEARCH_SMALL(0xe908),
283
284    /** The settings icon. */
285    SETTINGS(0xe618),
286
287    /** The settings icon. */
288    SETTINGS_SMALL(0xe905),
289
290    /** The show icon. */
291    SHOW(0xe608),
292
293    /** The site icon. */
294    SITE(0xe62d),
295
296    /** The sitemap icon. */
297    SITEMAP(0xe613),
298
299    /** The sitemap icon. */
300    SITEMAP_SMALL(0xe90b),
301
302    /** An empty icon. */
303    SPACE(0x0020),
304
305    /** The sphere icon. */
306    SPHERE(0xe635),
307
308    /** The trash icon. */
309    TRASH_SMALL(0xe916),
310
311    /** 'minus' state icon for tree opener. */
312    TREE_MINUS(0xe649),
313
314    /** 'plus' state icon for tree opener. */
315    TREE_PLUS(0xe648),
316
317    /** The triangle down icon. */
318    TRIANGLE_DOWN(0xe647),
319
320    /** The triangle right icon. */
321    TRIANGLE_RIGHT(0xe646),
322
323    /** The undo icon. */
324    UNDO(0xe606),
325
326    /** The upload icon. */
327    UPLOAD(0xe604),
328
329    /** The upload icon. */
330    UPLOAD_SMALL(0xe909),
331
332    /** The users icon. */
333    USERS(0xe639),
334
335    /** The wand icon. */
336    WAND(0xe610),
337
338    /** The warning icon. */
339    WARNING(0xe63e),
340
341    /** The wrap lines icon. */
342    WRAP_LINES(0xe64e);
343
344    /** The font family. */
345    public static final String FONT_FAMILY = "opencms-font";
346
347    /** The icon code point. */
348    private int m_codepoint;
349
350    /**
351     * Constructor.<p>
352     *
353     * @param codepoint the icon code point
354     */
355    FontOpenCms(int codepoint) {
356
357        m_codepoint = codepoint;
358    }
359
360    /**
361     * Returns the button overlay style classes for the icon.<p>
362     *
363     * @return the button overlay style
364     */
365    public String getButtonOverlayStyle() {
366
367        return "o-button-overlay o-button-overlay-" + name().toLowerCase().replace("_", "-");
368    }
369
370    /**
371     * @see com.vaadin.server.FontIcon#getCodepoint()
372     */
373    @Override
374    public int getCodepoint() {
375
376        return m_codepoint;
377    }
378
379    /**
380     * @see com.vaadin.server.FontIcon#getFontFamily()
381     */
382    @Override
383    public String getFontFamily() {
384
385        return FONT_FAMILY;
386    }
387
388    /**
389     * @see com.vaadin.server.FontIcon#getHtml()
390     */
391    @Override
392    public String getHtml() {
393
394        return GenericFontIcon.getHtml(getFontFamily(), getCodepoint());
395    }
396
397    /**
398     * @see com.vaadin.server.Resource#getMIMEType()
399     */
400    @Override
401    public String getMIMEType() {
402
403        throw new UnsupportedOperationException(
404            FontIcon.class.getSimpleName() + " should not be used where a MIME type is needed.");
405    }
406}