creatorextension/com.nokia.s60tools.creator/src/com/nokia/s60tools/creator/components/filetype/FileTypeVariables.java
author dpodwall
Tue, 12 Jan 2010 13:17:53 -0600
changeset 0 61163b28edca
permissions -rw-r--r--
initial EPL conversion
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     1
/*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     2
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     3
* All rights reserved.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     4
* This component and the accompanying materials are made available
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     6
* which accompanies this distribution, and is available
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     8
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     9
* Initial Contributors:
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    11
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    12
* Contributors:
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    13
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    14
* Description:
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    15
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    16
*/
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    17
 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    18
package com.nokia.s60tools.creator.components.filetype;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    19
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    20
import java.util.LinkedHashMap;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    21
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    22
import com.nokia.s60tools.creator.components.AbstractValue;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    23
import com.nokia.s60tools.creator.components.AbstractVariables;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    24
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    25
/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    26
 * Variables for file
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    27
 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    28
public class FileTypeVariables extends AbstractVariables {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    29
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    30
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    31
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    32
	 * UI text for "Encryption Type"
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    33
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    34
	public static final String ENCRYPTION_TYPE = "Encryption Type";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    35
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    36
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    37
	 * XML element "right"
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    38
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    39
	public static final String RIGHT_XML = "right";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    40
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    41
	//Constants for UI, privates because of prefixes (Play, Print...)
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    42
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    43
	private static final String ENDTIME = "Endtime";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    44
	private static final String STARTTIME = "Starttime";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    45
	private static final String ACCUMULATED = "Accumulated";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    46
	private static final String INTERVAL = "Interval";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    47
	private static final String COUNT = "Count";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    48
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    49
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    50
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    51
	//constants for XML element names
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    52
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    53
	public static final String COUNT_XML = "count";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    54
	public static final String INTERVAL_XML = "interval";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    55
	public static final String ENDTIME_XML = "endtime";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    56
	public static final String STARTTIME_XML = "starttime";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    57
	public static final String ACCUMULATED_XML = "accumulated";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    58
	public static final String ENCRYPTION_TYPE_XML = "encryption";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    59
	public static final String TYPE_XML = "type";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    60
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    61
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    62
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    63
	//Constants for print
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    64
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    65
	public static final String PRINT_TYPE = "print";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    66
	public static final String PRINTINTERVAL = PRINT_TYPE + INTERVAL_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    67
	public static final String PRINTENDTIME =  PRINT_TYPE + ENDTIME_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    68
	public static final String PRINTSTARTTIME =  PRINT_TYPE + STARTTIME_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    69
	public static final String PRINTCOUNT =  PRINT_TYPE + COUNT_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    70
	public static final String PRINTACCUMULATED =  PRINT_TYPE + ACCUMULATED_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    71
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    72
	public static final String [][] PRINT_KEYS = {{
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    73
		PRINTCOUNT, PRINTINTERVAL, PRINTSTARTTIME, PRINTENDTIME, PRINTACCUMULATED
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    74
	},{
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    75
		COUNT_XML, INTERVAL_XML, STARTTIME_XML, ENDTIME_XML, ACCUMULATED_XML
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    76
	}};
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    77
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    78
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    79
	//Constants for execute
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    80
	//	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    81
	public static final String EXECUTE_TYPE = "execute";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    82
	public static final String EXECUTEINTERVAL = EXECUTE_TYPE + INTERVAL_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    83
	public static final String EXECUTEENDTIME = EXECUTE_TYPE + ENDTIME_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    84
	public static final String EXECUTESTARTTIME = EXECUTE_TYPE + STARTTIME_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    85
	public static final String EXECUTECOUNT = EXECUTE_TYPE + COUNT_XML; 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    86
	public static final String EXECUTEACCUMULATED = EXECUTE_TYPE + ACCUMULATED_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    87
	public static final String [][] EXECUTE_KEYS = {{
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    88
		EXECUTECOUNT, EXECUTEINTERVAL, EXECUTESTARTTIME, EXECUTEENDTIME, EXECUTEACCUMULATED 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    89
	},{
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    90
		COUNT_XML, INTERVAL_XML, STARTTIME_XML, ENDTIME_XML, ACCUMULATED_XML		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    91
	}};
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    92
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    93
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    94
	//Constants for display
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    95
	//	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    96
	public static final String DISPLAY_TYPE = "display";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    97
	public static final String DISPLAYINTERVAL = DISPLAY_TYPE + INTERVAL_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    98
	public static final String DISPLAYENDTIME = DISPLAY_TYPE + ENDTIME_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    99
	public static final String DISPLAYSTARTTIME = DISPLAY_TYPE + STARTTIME_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   100
	public static final String DISPLAYCOUNT = DISPLAY_TYPE + COUNT_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   101
	public static final String DISPLAYACCUMULATED = DISPLAY_TYPE + ACCUMULATED_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   102
	public static final String [][] DISPLAY_KEYS = {{
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   103
		DISPLAYCOUNT, DISPLAYINTERVAL, DISPLAYSTARTTIME, DISPLAYENDTIME, DISPLAYACCUMULATED
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   104
	},{
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   105
		COUNT_XML, INTERVAL_XML, STARTTIME_XML, ENDTIME_XML, ACCUMULATED_XML	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   106
	}};
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   107
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   108
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   109
	//Constants for play
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   110
	//	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   111
	public static final String PLAY_TYPE = "play";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   112
	public static final String PLAYINTERVAL = PLAY_TYPE + INTERVAL_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   113
	public static final String PLAYENDTIME = PLAY_TYPE + ENDTIME_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   114
	public static final String PLAYSTARTTIME = PLAY_TYPE + STARTTIME_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   115
	public static final String PLAYCOUNT = PLAY_TYPE + COUNT_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   116
	public static final String PLAYACCUMULATED = PLAY_TYPE + ACCUMULATED_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   117
	public static final String [][] PLAY_KEYS = {{
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   118
		PLAYCOUNT, PLAYINTERVAL, PLAYSTARTTIME, PLAYENDTIME,  PLAYACCUMULATED 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   119
	},{
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   120
		COUNT_XML, INTERVAL_XML, STARTTIME_XML, ENDTIME_XML, ACCUMULATED_XML
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   121
	}};	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   122
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   123
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   124
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   125
	 * Prefix for "DRM-CD"
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   126
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   127
	public static final String DRM_CD = "DRM-CD";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   128
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   129
	 * Prefix for "DRM-FL"
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   130
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   131
	public static final String DRM_FL = "DRM-FL";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   132
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   133
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   134
	// Prefixes for DRM-CD variables
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   135
	//
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   136
	private static final String DRM_CD_PRINT = DRM_CD + " Print ";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   137
	private static final String DRM_CD_EXECUTE = DRM_CD + " Execute ";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   138
	private static final String DRM_CD_DISPLAY = DRM_CD + " Display ";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   139
	private static final String DRM_CD_PLAY = DRM_CD + " Play ";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   140
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   141
	public static final String DURATIONS_HELP_TEXT = "For '" +ACCUMULATED + "' and '" +INTERVAL +"' -fields use format: "
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   142
		+"P[n]Y[n]M[n]DT[n]H[n]M[n]S. Where P is start point for duration, Y stands for year, M for month, D for day, " 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   143
		+"T is time part start point, H stands for hour, M for minute and S for second. "
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   144
		+" E.g. P1Y2M3DT4H5M6S.";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   145
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   146
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   147
	private static FileTypeVariables instance;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   148
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   149
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   150
	 * Get Singleton instance of variables
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   151
	 * @return 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   152
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   153
	public static FileTypeVariables getInstance() {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   154
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   155
		if(instance == null){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   156
			instance = new FileTypeVariables();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   157
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   158
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   159
		return instance;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   160
	}	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   161
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   162
	private FileTypeVariables(){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   163
		init();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   164
		initFixedValues();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   165
		initMaxOccurValues();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   166
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   167
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   168
	public static final String TYPE = "Type";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   169
	public static final String DIR = "Directory";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   170
	public static final String [] ALL_FILE_TYPES_AS_COMMA_SEPARATED_STRING = {"3GPP-70kB", "AAC-100kB", "AMR-20kB", "XLS-15kB", "GIF-2kB", "JPEG-200kB", "JPEG-25kB", "JPEG-500kB", "MIDI-10kB", "MP3-250kB", "PNG-15kB", "PPT-40kB", "RM-95kB", "RNG-1kB", "TXT-10kB", "TXT-70kB", "WAV-20kB", "DOC-20kB", "SWF-15kB", "JAD-1kB", "JAR-10kB", "TIF-25kB", "MXMF-40kB", "BMP-25kB", "JP2-65kB", "SVG-15kB", "HTML-20kB", "VCF-1kB", "VCS-1kB", "MP4-200kB", "SISX-10kB", "RAM-1kB", "WMV-200kB", "WMA-50kB"};
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   171
	public static final String [] ALL_PICTURE_FILE_TYPES_AS_COMMA_SEPARATED_STRING = {"GIF-2kB", "JPEG-200kB", "JPEG-25kB", "JPEG-500kB", "PNG-15kB", "TIF-25kB", "BMP-25kB", "JP2-65kB", "SVG-15kB"};
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   172
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   173
	private void init() {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   174
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   175
		items = new LinkedHashMap<String, String>(4);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   176
		items.put(TYPE_XML, TYPE);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   177
		items.put("directory", DIR);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   178
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   179
		items.put(ENCRYPTION_TYPE_XML, ENCRYPTION_TYPE);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   180
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   181
		items.put(PLAYCOUNT, DRM_CD_PLAY + COUNT);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   182
		items.put(PLAYSTARTTIME, DRM_CD_PLAY + STARTTIME);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   183
		items.put(PLAYENDTIME, DRM_CD_PLAY + ENDTIME);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   184
		items.put(PLAYINTERVAL, DRM_CD_PLAY + INTERVAL);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   185
		items.put(PLAYACCUMULATED, DRM_CD_PLAY + ACCUMULATED);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   186
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   187
		items.put(DISPLAYCOUNT, DRM_CD_DISPLAY + COUNT);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   188
		items.put(DISPLAYSTARTTIME, DRM_CD_DISPLAY + STARTTIME);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   189
		items.put(DISPLAYENDTIME, DRM_CD_DISPLAY + ENDTIME);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   190
		items.put(DISPLAYINTERVAL, DRM_CD_DISPLAY + INTERVAL);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   191
		items.put(DISPLAYACCUMULATED, DRM_CD_DISPLAY + ACCUMULATED);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   192
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   193
		items.put(EXECUTECOUNT, DRM_CD_EXECUTE + COUNT);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   194
		items.put(EXECUTESTARTTIME, DRM_CD_EXECUTE + STARTTIME);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   195
		items.put(EXECUTEENDTIME, DRM_CD_EXECUTE + ENDTIME);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   196
		items.put(EXECUTEINTERVAL, DRM_CD_EXECUTE + INTERVAL);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   197
		items.put(EXECUTEACCUMULATED, DRM_CD_EXECUTE + ACCUMULATED);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   198
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   199
		items.put(PRINTCOUNT, DRM_CD_PRINT + COUNT);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   200
		items.put(PRINTSTARTTIME, DRM_CD_PRINT + STARTTIME);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   201
		items.put(PRINTENDTIME, DRM_CD_PRINT + ENDTIME);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   202
		items.put(PRINTINTERVAL, DRM_CD_PRINT + INTERVAL);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   203
		items.put(PRINTACCUMULATED, DRM_CD_PRINT + ACCUMULATED);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   204
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   205
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   206
		additionalItems = new LinkedHashMap<String, String>(4);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   207
		additionalItems.put(COUNT_XML, COUNT_XML);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   208
		additionalItems.put(INTERVAL_XML, INTERVAL_XML);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   209
		additionalItems.put(ENDTIME_XML, ENDTIME_XML);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   210
		additionalItems.put(STARTTIME_XML, STARTTIME_XML);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   211
		additionalItems.put(ACCUMULATED_XML, ACCUMULATED_XML);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   212
		additionalItems.put(RIGHT_XML, RIGHT_XML);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   213
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   214
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   215
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   216
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   217
	 * Inits Max Occur valus for items
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   218
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   219
	private void initMaxOccurValues(){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   220
		maxOccur = new LinkedHashMap<String, Integer>(4);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   221
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   222
		Integer integerOne = new Integer (1);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   223
		maxOccur.put(TYPE, integerOne );//Should it be able to add more than one file? If So, also S60 side must be changed.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   224
		maxOccur.put(DIR, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   225
		maxOccur.put(ENCRYPTION_TYPE, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   226
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   227
		maxOccur.put( DRM_CD_PLAY + COUNT, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   228
		maxOccur.put( DRM_CD_PLAY + STARTTIME, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   229
		maxOccur.put( DRM_CD_PLAY + ENDTIME, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   230
		maxOccur.put( DRM_CD_PLAY + INTERVAL, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   231
		maxOccur.put( DRM_CD_PLAY + ACCUMULATED, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   232
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   233
		maxOccur.put( DRM_CD_DISPLAY + COUNT, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   234
		maxOccur.put( DRM_CD_DISPLAY + STARTTIME, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   235
		maxOccur.put( DRM_CD_DISPLAY + ENDTIME, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   236
		maxOccur.put( DRM_CD_DISPLAY + INTERVAL, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   237
		maxOccur.put( DRM_CD_DISPLAY + ACCUMULATED, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   238
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   239
		maxOccur.put( DRM_CD_EXECUTE + COUNT, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   240
		maxOccur.put( DRM_CD_EXECUTE + STARTTIME, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   241
		maxOccur.put( DRM_CD_EXECUTE + ENDTIME, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   242
		maxOccur.put( DRM_CD_EXECUTE + INTERVAL, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   243
		maxOccur.put( DRM_CD_EXECUTE + ACCUMULATED, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   244
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   245
		maxOccur.put( DRM_CD_PRINT + COUNT, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   246
		maxOccur.put( DRM_CD_PRINT + STARTTIME, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   247
		maxOccur.put( DRM_CD_PRINT + ENDTIME, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   248
		maxOccur.put( DRM_CD_PRINT + INTERVAL, integerOne );
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   249
		maxOccur.put( DRM_CD_PRINT + ACCUMULATED, integerOne );		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   250
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   251
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   252
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   253
	 * Check if this key is a encryption value
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   254
	 * @param key (not a XML key but UI key)
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   255
	 * @return
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   256
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   257
	public static boolean isEncryptionValue(String key){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   258
		return key.startsWith(DRM_CD);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   259
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   260
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   261
	private void initFixedValues(){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   262
		itemsValues = new LinkedHashMap<String, String[]>(4);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   263
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   264
		//For enabling creation of empty type (then directory will be created) we first add a empty slot for list
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   265
		String [] items = new String[ALL_FILE_TYPES_AS_COMMA_SEPARATED_STRING.length + 1];
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   266
		items [0] = AbstractValue.EMPTY_STRING;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   267
		for (int i = 1; i < items.length; i++) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   268
			items[i] = ALL_FILE_TYPES_AS_COMMA_SEPARATED_STRING[i - 1];
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   269
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   270
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   271
		itemsValues.put(TYPE_XML, items);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   272
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   273
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   274
		itemsValues.put(ENCRYPTION_TYPE_XML, new String[] {DRM_FL, DRM_CD});
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   275
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   276
	}	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   277
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   278
	protected AbstractVariables getInstanceImpl() {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   279
		return instance;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   280
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   281
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   282
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   283
	 * Get ID used in editor to <right><[element]> 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   284
	 * @param rightType
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   285
	 * @param elementName
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   286
	 * @return Interal ID for  <right><[element]>
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   287
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   288
	public static String getEncryptionId(String rightType, String elementName) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   289
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   290
		if(rightType.equalsIgnoreCase(DISPLAY_TYPE)){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   291
			return getEncryptionElemnInternalId(DISPLAY_TYPE, elementName);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   292
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   293
		else if(rightType.equalsIgnoreCase(PLAY_TYPE)){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   294
			return getEncryptionElemnInternalId(PLAY_TYPE, elementName);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   295
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   296
		else if(rightType.equalsIgnoreCase(EXECUTE_TYPE)){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   297
			return getEncryptionElemnInternalId(EXECUTE_TYPE, elementName);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   298
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   299
		else if(rightType.equalsIgnoreCase(PRINT_TYPE)){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   300
			return getEncryptionElemnInternalId(PRINT_TYPE, elementName);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   301
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   302
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   303
		return null;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   304
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   305
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   306
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   307
	 * Get id for encryption element used only in object model, not in XML
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   308
	 * @param type
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   309
	 * @param elemn
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   310
	 * @return id
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   311
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   312
	private static String getEncryptionElemnInternalId(String type, String elemn){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   313
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   314
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   315
		if(elemn.equalsIgnoreCase(COUNT_XML)){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   316
			return type + COUNT_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   317
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   318
		else if(elemn.equalsIgnoreCase(INTERVAL_XML)){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   319
			return type + INTERVAL_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   320
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   321
		else if(elemn.equalsIgnoreCase(ENDTIME_XML)){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   322
			return type + ENDTIME_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   323
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   324
		else if(elemn.equalsIgnoreCase(STARTTIME_XML)){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   325
			return type + STARTTIME_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   326
		}		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   327
		else if(elemn.equalsIgnoreCase(ACCUMULATED_XML)){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   328
			return type + ACCUMULATED_XML;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   329
		}			
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   330
		else{
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   331
			return null;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   332
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   333
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   334
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   335
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   336
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   337
	/* (non-Javadoc)
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   338
	 * @see com.nokia.s60tools.creator.components.AbstractVariables#isModeEnabledForKey(java.lang.String)
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   339
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   340
	public boolean isModeEnabledForKey(String key) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   341
		if(key != null && key.equals(ENCRYPTION_TYPE)){
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   342
			return false;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   343
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   344
		else{
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   345
			return true;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   346
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   347
	}		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   348
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   349
}