package de.uka.ipd.consensus.foundation.ontology;

import java.util.EventListener;

/**
 * The listener interface for receiving events that signal a change in the ontology.
 * @author Thomas Much
 * @version 2006-06-14
 * @see de.uka.ipd.consensus.foundation.ontology.OntologyManager#addOntologyListener(OntologyListener)
 * @see de.uka.ipd.consensus.foundation.evolution.EvolutionListener
 */
public interface OntologyListener extends EventListener {

	/**
	 * Called by the OntologyManager when a topic is created.
	 * <p><code>OntologyEvent.getConcept()</code> returns the newly created topic.</p>
	 * @param event the OntologyEvent object containing the user and the newly created topic
	 */
	public void topicCreated(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when an association is created.
	 * <p><code>OntologyEvent.getConcept()</code> returns the newly created association.</p>
	 * @param event the OntologyEvent object containing the user and the newly created association
	 */
	public void associationCreated(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when an occurrence is created.
	 * <p><code>OntologyEvent.getConcept()</code> returns the base topic,
	 * <code>OntologyEvent.getOccurrence()</code> the newly created occurrence.</p>
	 * @param event the OntologyEvent object containing the user, the topic and the newly created occurrence
	 */
	public void occurrenceCreated(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when the comment of a concept has changed.
	 * <p><code>OntologyEvent.getConcept()</code> returns the base concept,
	 * <code>OntologyEvent.getOldValue()</code> the comment's old value.</p>
	 * @param event the OntologyEvent object containing the user, the concept and the comment's old value
	 */
	public void conceptCommentChanged(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when the name of a concept has changed.
	 * <p><code>OntologyEvent.getConcept()</code> returns the base concept,
	 * <code>OntologyEvent.getOldValue()</code> the concept's old name.</p>
	 * @param event the OntologyEvent object containing the user, the concept and the concept's old name
	 */
	public void conceptNameChanged(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when a type is added to or removed from a concept.
	 * <p><code>OntologyEvent.getConcept()</code> returns the base concept,
	 * <code>OntologyEvent.getOldType()</code> the concept's old type. For topics, the old type is <code>null</code> if a new type is added.</p>
	 * @param event the OntologyEvent object containing the user, the concept and the concept's old type
	 */
	public void conceptTypeChanged(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when a superclass is added to or removed from a topic.
	 * <p><code>OntologyEvent.getConcept()</code> returns the base topic.
	 * <code>OntologyEvent.getOldType()</code> returns the topic's old superclass if it was removed, or <code>null</code> if a superclass was added.</p>
	 * @param event the OntologyEvent object containing the user, the concept and the concept's old superclass
	 */
	public void topicClassChanged(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when topic is added as a player to an association.
	 * <p><code>OntologyEvent.getConcept()</code> returns the association,
	 * <code>OntologyEvent.getTopic()</code> the added topic.</p>
	 * @param event the OntologyEvent object containing the user, the association and the added topic
	 */
	public void associationTopicAdded(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when player topic is removed from an association.
	 * <p><code>OntologyEvent.getConcept()</code> returns the association,
	 * <code>OntologyEvent.getTopic()</code> the removed topic.</p>
	 * @param event the OntologyEvent object containing the user, the association and the removed topic
	 */
	public void associationTopicRemoved(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when an attribute is added to a topic.
	 * <p><code>OntologyEvent.getConcept()</code> returns the added attribute,
	 * <code>OntologyEvent.getTopic()</code> the base topic.</p>
	 * @param event the OntologyEvent object containing the user, the topic and the added attribute
	 */
	public void attributeAdded(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when an attribute's value is changed.
	 * <p><code>OntologyEvent.getConcept()</code> returns the attribute,
	 * <code>OntologyEvent.getOldValue()</code> the attribute's old value.</p>
	 * @param event the OntologyEvent object containing the user, the attribute and its old value
	 */
	public void attributeValueChanged(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when an attribute is removed from a topic.
	 * <p><code>OntologyEvent.getConcept()</code> returns the removed attribute,
	 * <code>OntologyEvent.getTopic()</code> the base topic.</p>
	 * @param event the OntologyEvent object containing the user, the topic and the removed attribute
	 */
	public void attributeRemoved(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when an occurrence's value is changed.
	 * <p><code>OntologyEvent.getConcept()</code> returns the base topic,
	 * <code>OntologyEvent.getOccurrence()</code> the occurrence and
	 * <code>OntologyEvent.getOldValue()</code> the occurrence's old value.</p>
	 * @param event the OntologyEvent object containing the user, the topic, the occurrence and its old value
	 */
	public void occurrenceChanged(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when an occurrence is removed from a topic.
	 * <p><code>OntologyEvent.getConcept()</code> returns the base topic,
	 * <code>OntologyEvent.getOccurrence()</code> the removed occurrence.</p>
	 * @param event the OntologyEvent object containing the user, the topic and the removed occurrence
	 */
	public void occurrenceRemoved(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when a synonym is added to a base topic.
	 * <p><code>OntologyEvent.getConcept()</code> returns the base topic,
	 * <code>OntologyEvent.getSynonym()</code> the Synonym object that contains both synonymous topics.</p>
	 * @param event the OntologyEvent object containing the user, the topic and the synonym
	 */
	public void synonymAdded(OntologyEvent event);
	
	
	/**
	 * Called by the OntologyManager when a synonym is removed from a base topic.
	 * <p><code>OntologyEvent.getConcept()</code> returns the base topic,
	 * <code>OntologyEvent.getSynonym()</code> the removed Synonym object that contains both synonymous topics.</p>
	 * @param event the OntologyEvent object containing the user, the topic and the synonym
	 */
	public void synonymRemoved(OntologyEvent event);

}
