| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.ui.api.themes; |
| |
| import java.io.InputStream; |
| import java.util.Locale; |
| |
| import org.eclipse.equinox.app.IApplicationContext; |
| |
| import com.vaadin.server.Resource; |
| |
| public interface IThemeResourceService { |
| |
| /** The id. */ |
| public static String ID = IThemeResourceService.class.getName(); |
| |
| /** all available theme resource types */ |
| static public enum ThemeResourceType { |
| /** any "big" images like background images */ |
| IMAGE, |
| /** any "small" icons, mostly 16x16 px */ |
| ICON, |
| /** flag icon, mostly 16x16 px */ |
| FLAG, |
| /** html resource */ |
| HTML, |
| /** sound resource. */ |
| SOUND, |
| /** video resource */ |
| VIDEO |
| } |
| |
| /** |
| * Inits the themeResourceService. |
| * |
| * @param appContext the app context |
| * @param themeEngine the theme engine |
| * @param themeManager the theme manager |
| */ |
| void init(IApplicationContext appContext, Object themeEngine, Object themeManager); |
| /** |
| * Resets the base paths of the theme resource |
| */ |
| void reset(); |
| /** |
| * @param themeResourceType |
| * @return the file extension defined for the theme resource type |
| */ |
| String getThemeResourceTypeExtension(ThemeResourceType themeResourceType); |
| |
| /** |
| * @param themeResourceType |
| * @return the path defined for the theme resource type |
| */ |
| String getThemeResourceTypePath(ThemeResourceType themeResourceType); |
| |
| /** |
| * @param resourceID |
| * @param themeResourceType |
| * @return the full qualified uri for the resource id of the theme resource type |
| */ |
| String getThemeURI(String resourceID, ThemeResourceType themeResourceType); |
| |
| /** |
| * @param resourceID |
| * @param themeResourceType |
| * @return the resource for the resource id of the theme resource type |
| */ |
| Resource getThemeResource(String resourceID, ThemeResourceType themeResourceType); |
| |
| /** |
| * Gets the theme resource input stream. |
| * |
| * @param resourceURL the resource URL |
| * @return the theme resource input stream |
| */ |
| InputStream getThemeResourceInputStream(String resourceURL); |
| |
| /** |
| * Gets the theme resource HTML. The resource must have TRANSLATABLE in its name to be translated. |
| * |
| * @param subject the subject |
| * @param locale the locale |
| * @return the theme resource HTML |
| */ |
| String getThemeResourceHTML(String subject, Locale locale); |
| } |