/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.gwt.wysiwyg.client.plugin.macro;

import java.util.Map;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * Describes a macro and its parameters.
 * <p>
 * NOTE: This class is a serializable, GWT-supported <em>clone</em> of the MacroDescriptor from the rendering module.
 * 
 * @version $Id$
 */
public class MacroDescriptor implements IsSerializable
{
    /**
     * The macro identifier.
     */
    private String id;

    /**
     * The human-readable name of the macro (e.g. Table of Contents for ToC macro).
     */
    private String name;

    /**
     * The description of the macro.
     */
    private String description;

    /**
     * The category of the macro.
     */
    private String category;

    /**
     * A {@link Map} with descriptors for each parameter supported by the macro. The key is the parameter name.
     */
    private Map<String, ParameterDescriptor> parameterDescriptorMap;

    /**
     * Describes the content of the macro.
     */
    private ParameterDescriptor contentDescriptor;

    /**
     * @return the macro identifier
     */
    public String getId()
    {
        return id;
    }

    /**
     * Sets the identifier of the macro.
     * 
     * @param id a macro identifier
     */
    public void setId(String id)
    {
        this.id = id;
    }

    /**
     * @return the human-readable name of the macro (e.g. Table of Contents for ToC macro)
     */
    public String getName()
    {
        return name;
    }

    /**
     * Sets the human-readable name of the macro (e.g. Table of Contents for ToC macro).
     * 
     * @param name the macro name
     */
    public void setName(String name)
    {
        this.name = name;
    }

    /**
     * @return the description of the macro
     */
    public String getDescription()
    {
        return description;
    }

    /**
     * Sets the macro description.
     * 
     * @param description a {@link String} representing the macro description
     */
    public void setDescription(String description)
    {
        this.description = description;
    }

    /**
     * @return the category of the macro
     */
    public String getCategory()
    {
        return category;
    }

    /**
     * Sets the macro category.
     * 
     * @param category the macro category
     */
    public void setCategory(String category)
    {
        this.category = category;
    }

    /**
     * @return a {@link Map} with parameter descriptors
     */
    public Map<String, ParameterDescriptor> getParameterDescriptorMap()
    {
        return parameterDescriptorMap;
    }

    /**
     * Sets the {@link Map} of parameter descriptors.
     * 
     * @param parameterDescriptorMap a {@link Map} of parameter descriptors
     */
    public void setParameterDescriptorMap(Map<String, ParameterDescriptor> parameterDescriptorMap)
    {
        this.parameterDescriptorMap = parameterDescriptorMap;
    }

    /**
     * @return the content descriptor
     */
    public ParameterDescriptor getContentDescriptor()
    {
        return contentDescriptor;
    }

    /**
     * Sets the content descriptor.
     * 
     * @param contentDescriptor the object describing the content of the macro
     */
    public void setContentDescriptor(ParameterDescriptor contentDescriptor)
    {
        this.contentDescriptor = contentDescriptor;
    }
}

@@ -1939,16 +1939,135 @@
 iptor;%0A%0A
+    /**%0A     * Flag indicating if this macro supports in-line mode.%0A     */%0A    private boolean supportingInlineMode;%0A%0A
     /**%0A
@@ -4380,11 +4380,555 @@
 r;%0A    %7D
+%0A%0A    /**%0A     * @return %7B@code true%7D if this macro supports in-line mode, %7B@code false%7D otherwise%0A     */%0A    public boolean isSupportingInlineMode()%0A    %7B%0A        return supportingInlineMode;%0A    %7D%0A%0A    /**%0A     * Sets the flag which indicates if this macro supports in-line mode.%0A     * %0A     * @param supportingInlineMode %7B@code true%7D if this macro is allowed in-line, %7B@code false%7D otherwise%0A     */%0A    public void setSupportingInlineMode(boolean supportingInlineMode)%0A    %7B%0A        this.supportingInlineMode = supportingInlineMode;%0A    %7D
 %0A%7D%0A

Add a flag in the macro descriptor to specifiy if the macro supports in-line mode.