uidesigner/com.nokia.sdt.sourcegen/src/com/nokia/sdt/sourcegen/IComponentSourceMapping.java
author fturovic <frank.turovich@nokia.com>
Tue, 07 Apr 2009 15:28:30 -0500
changeset 72 5464a0b24d87
parent 2 d760517a8095
permissions -rw-r--r--
removed license page and TOC entry for 2.1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
/*
cawthron
parents:
diff changeset
     2
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
cawthron
parents:
diff changeset
     3
* All rights reserved.
cawthron
parents:
diff changeset
     4
* This component and the accompanying materials are made available
cawthron
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
cawthron
parents:
diff changeset
     6
* which accompanies this distribution, and is available
cawthron
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
cawthron
parents:
diff changeset
     8
*
cawthron
parents:
diff changeset
     9
* Initial Contributors:
cawthron
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
cawthron
parents:
diff changeset
    11
*
cawthron
parents:
diff changeset
    12
* Contributors:
cawthron
parents:
diff changeset
    13
*
cawthron
parents:
diff changeset
    14
* Description: 
cawthron
parents:
diff changeset
    15
*
cawthron
parents:
diff changeset
    16
*/
cawthron
parents:
diff changeset
    17
cawthron
parents:
diff changeset
    18
package com.nokia.sdt.sourcegen;
cawthron
parents:
diff changeset
    19
cawthron
parents:
diff changeset
    20
import com.nokia.sdt.component.adapter.IComponentAdapter;
cawthron
parents:
diff changeset
    21
import com.nokia.sdt.datamodel.adapter.IComponentInstance;
cawthron
parents:
diff changeset
    22
import com.nokia.sdt.sourcegen.doms.rss.IRssModelGenerator;
cawthron
parents:
diff changeset
    23
cawthron
parents:
diff changeset
    24
/**
cawthron
parents:
diff changeset
    25
 * This interface defines a source mapping, whereby component
cawthron
parents:
diff changeset
    26
 * instances are transformed into RSS DOM, and
cawthron
parents:
diff changeset
    27
 * RSS DOM into component instances.  This is inherently
cawthron
parents:
diff changeset
    28
 * a two-way mapping, although the specific rules used to
cawthron
parents:
diff changeset
    29
 * define a mapping may need special handling for each
cawthron
parents:
diff changeset
    30
 * direction (i.e. resulting in a pair of one-way mappings).
cawthron
parents:
diff changeset
    31
 * 
cawthron
parents:
diff changeset
    32
 * 
cawthron
parents:
diff changeset
    33
 *
cawthron
parents:
diff changeset
    34
 */
cawthron
parents:
diff changeset
    35
public interface IComponentSourceMapping extends IComponentAdapter {
cawthron
parents:
diff changeset
    36
    /**
cawthron
parents:
diff changeset
    37
     * The maximum number of times to rename an identifier to
cawthron
parents:
diff changeset
    38
     * avoid conflicts with read-only or pre-existing but 
cawthron
parents:
diff changeset
    39
     * differently-typed identifiers with the same base name
cawthron
parents:
diff changeset
    40
     * (e.g. for r_rsrc: r_rsrc_1, r_rsrc_2, ...)  
cawthron
parents:
diff changeset
    41
     */
cawthron
parents:
diff changeset
    42
    public static final int MAX_NAME_CONFLICTS = 100;
cawthron
parents:
diff changeset
    43
    
cawthron
parents:
diff changeset
    44
    /**
cawthron
parents:
diff changeset
    45
     * This algorithm is used (via &lt;mapEnum &gt; nameAlgorithm="...")
cawthron
parents:
diff changeset
    46
     * to name Command enums
cawthron
parents:
diff changeset
    47
     */
cawthron
parents:
diff changeset
    48
    public static final Object NAME_ALGORITHM_COMMANDS = "com.nokia.sdt.component.symbian.NAME_ALG_COMMANDS"; //$NON-NLS-1$
cawthron
parents:
diff changeset
    49
cawthron
parents:
diff changeset
    50
    /**
cawthron
parents:
diff changeset
    51
     * This algorithm is used (via &lt;mapEnum &gt; nameAlgorithm="...")
cawthron
parents:
diff changeset
    52
     * to get the identifier of the dialog-control-type attribute
cawthron
parents:
diff changeset
    53
     */
cawthron
parents:
diff changeset
    54
    public static final Object NAME_ALGORITHM_CONTROL_TYPE = "com.nokia.sdt.component.symbian.NAME_ALG_CONTROL_TYPE"; //$NON-NLS-1$
cawthron
parents:
diff changeset
    55
cawthron
parents:
diff changeset
    56
    /**
cawthron
parents:
diff changeset
    57
     * This algorithm is used (via &lt;mapEnum &gt; nameAlgorithm="...")
cawthron
parents:
diff changeset
    58
     * to create an enum for a dialog line entry
cawthron
parents:
diff changeset
    59
     */
cawthron
parents:
diff changeset
    60
    public static final Object NAME_ALGORITHM_DIALOG_LINE_ID = "com.nokia.sdt.component.symbian.NAME_ALG_DIALOG_LINE_ID"; //$NON-NLS-1$
cawthron
parents:
diff changeset
    61
cawthron
parents:
diff changeset
    62
    /**
cawthron
parents:
diff changeset
    63
     * This algorithm is used (via &lt;mapEnum &gt; nameAlgorithm="...")
cawthron
parents:
diff changeset
    64
     * to create an enum for a status pane
cawthron
parents:
diff changeset
    65
     */
cawthron
parents:
diff changeset
    66
    public static final Object NAME_ALGORITHM_STATUS_PANE_ID = "com.nokia.sdt.component.symbian.NAME_ALG_STATUS_PANE_ID"; //$NON-NLS-1$
cawthron
parents:
diff changeset
    67
cawthron
parents:
diff changeset
    68
    /**
cawthron
parents:
diff changeset
    69
     * This algorithm is used (via &lt;mapEnum &gt; nameAlgorithm="...")
cawthron
parents:
diff changeset
    70
     * to create an enum for the view UID
cawthron
parents:
diff changeset
    71
     */
cawthron
parents:
diff changeset
    72
    public static final Object NAME_ALGORITHM_VIEW_UID = "com.nokia.sdt.component.symbian.NAME_ALG_VIEW_UID"; //$NON-NLS-1$
cawthron
parents:
diff changeset
    73
    
cawthron
parents:
diff changeset
    74
    /** 
cawthron
parents:
diff changeset
    75
     * Export the component instance, creating or updating 
cawthron
parents:
diff changeset
    76
     * resources in the translation unit
cawthron
parents:
diff changeset
    77
     * @param instance the component instance to export
cawthron
parents:
diff changeset
    78
     * @param generator
cawthron
parents:
diff changeset
    79
     */
cawthron
parents:
diff changeset
    80
    public void exportInstance(IRssModelGenerator generator, IComponentInstance instance);
cawthron
parents:
diff changeset
    81
}