blob: ea6ed34599b99a71de0fe82a56274f1b2d5be480 [file] [log] [blame]
/**
*
* 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 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* 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);
}