org.tizen.nativecpp.misc_3.0.0.201311042022

16:50:17.616 INFO  jd.cli.Main - Decompiling org.tizen.nativecpp.misc_3.0.0.201311042022.jar
package org.tizen.nativecpp.misc;

public class IConstants
{
  public static final String[] BOOL_VALUES = { "False", "True" };
  public static final String OLD_BADA_PRJ_FILE = ".badaprj";
  public static final String APP_XML_FILE = "application.xml";
  public static final String MANIFEST_FILE = "manifest.xml";
  public static final String CONFIG_XML_FILE = "config.xml";
  public static final String VERSION_DEFAULT = "1.0";
  public static final String DIR_INCLUDE = "inc";
  public static final String DIR_SOURCE = "src";
  public static final String DIR_RESOURCE = "res";
  public static final String DIR_RESOURCE_BADA = "Res";
  public static final String DIR_LIB = "lib";
  public static final String DIR_DATA = "data";
  public static final String DIR_SHARED_RES = "shared/res";
  public static final String DIR_SHARED_DATA = "shared/data";
  public static final String DIR_SHARED_TRUSTED = "shared/trusted";
  public static final String DEFAULT_LOCALE = "eng-GB";
  public static final String DIR_SCREEN_NORMAL = "screen-size-normal";
  public static final String DIR_SCREEN_DENSITY_XHIGH = "screen-density-xhigh";
  public static final String DIR_SCREEN_DENSITY_HIGH = "screen-density-high";
  public static final String DIR_SCREEN_DENSITY_MIDDLE = "screen-density-middle";
  public static final String DIR_SCREEN_DENSITY_LOW = "screen-density-low";
  public static final String PRIVILIGE_NOTIFICATION = "http://tizen.org/privilege/notification";
  public static final int SCREEN_WVGA = 0;
  public static final int SCREEN_WQVGA = 1;
  public static final int SCREEN_HVGA = 2;
  public static final int SCREEN_QVGA = 3;
  public static final int SCREEN_NORMAL = 4;
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.IConstants
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc;

import org.eclipse.core.runtime.CoreException;
import org.tizen.nativecommon.launch.LaunchInfo;
import org.tizen.nativecommon.launch.LaunchListener;
import org.tizen.nativecpp.misc.core.ManifestManager;

class IdePlugin$1
  implements LaunchListener
{
  IdePlugin$1(IdePlugin paramIdePlugin) {}
  
  public void preLaunched(LaunchInfo info)
    throws CoreException
  {
    ManifestManager.verifyExecutableName(info.getProject());
  }
  
  public void postLaunched(LaunchInfo info)
    throws CoreException
  {}
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.IdePlugin.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc;

import java.io.IOException;
import java.net.URL;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.tizen.nativecommon.launch.AbstractTizenCLaunchDelegate;
import org.tizen.nativecommon.launch.LaunchInfo;
import org.tizen.nativecommon.launch.LaunchListener;
import org.tizen.nativecpp.misc.core.ManifestManager;
import org.tizen.nativecpp.misc.core.NativePackageListener;

public class IdePlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.nativecpp.misc";
  private static IdePlugin sPlugin;
  NativePackageListener fPackageListener;
  
  public IdePlugin()
  {
    sPlugin = this;
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    fPackageListener = new NativePackageListener();
    fPackageListener.installListener();
    
    AbstractTizenCLaunchDelegate.addListener(new LaunchListener()
    {
      public void preLaunched(LaunchInfo info)
        throws CoreException
      {
        ManifestManager.verifyExecutableName(info.getProject());
      }
      
      public void postLaunched(LaunchInfo info)
        throws CoreException
      {}
    });
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    fPackageListener.uninstallListener();
    super.stop(context);
  }
  
  public static IdePlugin getDefault()
  {
    if (sPlugin == null) {
      sPlugin = new IdePlugin();
    }
    return sPlugin;
  }
  
  public URL getResourceLocationURL(String path)
  {
    if (getBundle() != null)
    {
      URL installURL = getBundle().getEntry("/" + path);
      try
      {
        return FileLocator.toFileURL(installURL);
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.IdePlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

public enum AppControl$CATEGORIES
{
  Operation,  MimeType,  Uri;
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.AppControl.CATEGORIES
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class AppControl
{
  public static final String ELEMENT_APPCONTROL = "AppControl";
  
  public static enum CATEGORIES
  {
    Operation,  MimeType,  Uri;
  }
  
  private List<AppControlItem> fItems = new ArrayList();
  
  public void addAppControlItem(AppControlItem item)
  {
    fItems.add(item);
  }
  
  public List<AppControlItem> getAppControlItems()
  {
    return fItems;
  }
  
  public void save(Document dom, Element eParent)
  {
    Collections.sort(fItems);
    
    boolean writeNeeded = false;
    Element eAppControl = dom.createElement("AppControl");
    for (AppControlItem item : fItems)
    {
      Element eSub = dom.createElement(item.getCategory().toString());
      eSub.setTextContent(item.getValue());
      eAppControl.appendChild(eSub);
      writeNeeded = true;
    }
    if (writeNeeded) {
      eParent.appendChild(eAppControl);
    }
  }
  
  public static AppControl load(Node node)
  {
    AppControl ac = new AppControl();
    for (Node childNode = node.getFirstChild(); childNode != null; childNode = childNode.getNextSibling())
    {
      String nodeName = childNode.getNodeName();
      CATEGORIES category = null;
      try
      {
        category = CATEGORIES.valueOf(nodeName);
      }
      catch (IllegalArgumentException localIllegalArgumentException)
      {
        continue;
      }
      AppControlItem item = new AppControlItem();
      item.setCategory(category);
      String v = NewAppXmlStore.getChildValue(childNode);
      item.setValue(v);
      ac.addAppControlItem(item);
    }
    return ac;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.AppControl
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

public class AppControlItem
  implements Comparable<AppControlItem>
{
  private AppControl.CATEGORIES category;
  private String value;
  
  public AppControlItem() {}
  
  public AppControlItem(AppControl.CATEGORIES category, String v)
  {
    this.category = category;
    value = v;
  }
  
  public AppControl.CATEGORIES getCategory()
  {
    return category;
  }
  
  public void setCategory(AppControl.CATEGORIES category)
  {
    this.category = category;
  }
  
  public String getValue()
  {
    return value;
  }
  
  public void setValue(String value)
  {
    this.value = value;
  }
  
  public int hashCode()
  {
    return category.hashCode() | value.hashCode();
  }
  
  public String toString()
  {
    return value.toString();
  }
  
  public boolean equals(Object obj)
  {
    if ((obj instanceof AppControlItem))
    {
      AppControlItem other = (AppControlItem)obj;
      if ((category.equals(category)) && (value.equals(value))) {
        return true;
      }
    }
    return false;
  }
  
  public int compareTo(AppControlItem o)
  {
    String me = category + value;
    String other = o.getCategory() + o.getValue();
    return me.compareTo(other);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.AppControlItem
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

import java.math.BigInteger;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;

public class AppIdGenerator
{
  final char[] PSEUDO_CHARS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
  final BigInteger PSEUDO_CHAR_SIZE = new BigInteger("62");
  static final String[] RESERVED_APPID = {
    "TIZEN", 
    "PRIVT", 
    "WIDGT" };
  static final int RESERVED_APPID_NUMBER = 3;
  
  private String convertBytesToAlphaNumeric(byte[] in, int size)
  {
    BigInteger randomBigInt = new BigInteger(in).abs();
    StringBuffer out = new StringBuffer(size + 1);
    for (int i = 0; i < size; i++)
    {
      BigInteger[] dividedAndremainder = randomBigInt
        .divideAndRemainder(PSEUDO_CHAR_SIZE);
      randomBigInt = dividedAndremainder[0];
      out.append(PSEUDO_CHARS[dividedAndremainder[1].intValue()]);
    }
    String ret = new String(out);
    return ret;
  }
  
  private byte[] generateRandomBytes(int size)
    throws GeneralSecurityException
  {
    SecureRandom random = new SecureRandom();
    KeyGenerator keyGen = KeyGenerator.getInstance("AES");
    keyGen.init(128);
    
    byte[] bytes = new byte[size];
    random.nextBytes(bytes);
    
    SecretKey secretkey = keyGen.generateKey();
    byte[] key = secretkey.getEncoded();
    SecretKeySpec secretkeySpec = new SecretKeySpec(key, "AES");
    
    Cipher cipher = Cipher.getInstance("AES");
    cipher.init(1, secretkeySpec);
    
    return cipher.doFinal(bytes);
  }
  
  private boolean Check(String appId)
  {
    for (int i = 0; i < 3; i++) {
      if (appId.indexOf(RESERVED_APPID[i]) == 0) {
        return false;
      }
    }
    return true;
  }
  
  public String generate(int size)
    throws GeneralSecurityException
  {
    String appId = "";
    do
    {
      appId = convertBytesToAlphaNumeric(generateRandomBytes(size), size);
    } while (!
    
      Check(appId));
    return appId;
  }
  
  public String generate()
    throws GeneralSecurityException
  {
    return generate(10);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.AppIdGenerator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

public class AppNameItem
{
  String lang;
  String name;
  
  public AppNameItem(String lang)
  {
    this.lang = lang;
    name = "";
  }
  
  public AppNameItem(String lang, String value)
  {
    this.lang = lang;
    name = value;
  }
  
  public String getLanugage()
  {
    return lang;
  }
  
  public void setName(String name)
  {
    this.name = name;
  }
  
  public String getName()
  {
    return name;
  }
  
  public AppNameItem clone()
  {
    AppNameItem item = new AppNameItem(lang, name);
    
    return item;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.AppNameItem
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

import java.util.ArrayList;
import java.util.List;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public final class ApplicationData$Account
{
  public static final String ELEMENT_ACCOUNT = "AccountProvider";
  public static final String ELEMENT_CAPABILITIES = "Capabilities";
  public static final String ELEMENT_CAPABILITY = "Capability";
  public static final String ATTR_MULTIPLE_ACCOUNT_SUPPORT = "MultipleAccountsSupport";
  public static final String ACCOUNT_SMALL = "AccountSmall";
  public static final String ACCOUNT = "Account";
  String fIsMultipleAccountSupport;
  Icon fIcon = new Icon(IconType.ACCOUNT);
  Icon fIconSmall = new Icon(IconType.ACCOUNTSMALL);
  List<LocaledValue> fNames;
  List<ApplicationData.AccountCapability> fCapabilities;
  
  public ApplicationData$Account()
  {
    fIsMultipleAccountSupport = "False";
  }
  
  public String toString()
  {
    String def = "Account";
    return def;
  }
  
  public String getMultipleAccountSupport()
  {
    return fIsMultipleAccountSupport;
  }
  
  public void setMultipleAccountSupport(String v)
  {
    fIsMultipleAccountSupport = v;
  }
  
  public Icon getIcon()
  {
    return fIcon;
  }
  
  public void setIcon(String icon)
  {
    fIcon.set(icon);
  }
  
  public Icon getIconSmall()
  {
    return fIconSmall;
  }
  
  public void setIconSmall(String iconSmall)
  {
    fIconSmall.set(iconSmall);
  }
  
  public List<LocaledValue> getNames()
  {
    if (fNames == null) {
      fNames = new ArrayList();
    }
    return fNames;
  }
  
  public boolean isValid()
  {
    if ((fIcon.getFileName() == null) || (fIcon.getFileName().length() == 0)) {
      return false;
    }
    if ((fIconSmall.getFileName() == null) || (fIconSmall.getFileName().length() == 0)) {
      return false;
    }
    if (getNames().size() == 0) {
      return false;
    }
    return true;
  }
  
  public List<ApplicationData.AccountCapability> getCapabilities()
  {
    if (fCapabilities == null) {
      fCapabilities = new ArrayList();
    }
    return fCapabilities;
  }
  
  public static Account load(Node root)
  {
    Account account = new Account();
    Element eAccount = (Element)root;
    String v = eAccount.getAttribute("MultipleAccountsSupport");
    account.setMultipleAccountSupport(v);
    
    NodeList icons = eAccount.getElementsByTagName("Icon");
    for (int i = 0; i < icons.getLength(); i++)
    {
      Element eIcon = (Element)icons.item(i);
      String section = eIcon.getAttribute("Section");
      v = eIcon.getTextContent();
      if (section.equals("Account")) {
        account.setIcon(v);
      } else if (section.equals("AccountSmall")) {
        account.setIconSmall(v);
      }
    }
    NodeList nodes = eAccount.getElementsByTagName("DisplayName");
    for (int i = 0; i < nodes.getLength(); i++)
    {
      Element eName = (Element)nodes.item(i);
      String locale = eName.getAttribute("Locale");
      v = eName.getTextContent();
      account.getNames().add(new LocaledValue(locale, v));
    }
    nodes = eAccount.getElementsByTagName("Capability");
    for (int i = 0; i < nodes.getLength(); i++)
    {
      Element eCap = (Element)nodes.item(i);
      String cap = eCap.getTextContent();
      if ((cap != null) && (cap.length() > 0)) {
        account.getCapabilities().add(new ApplicationData.AccountCapability(cap));
      }
    }
    return account;
  }
  
  public boolean save(Document dom, Element eParent)
  {
    if (!isValid()) {
      return false;
    }
    Element eAccount = dom.createElement("AccountProvider");
    
    eAccount.setAttribute("MultipleAccountsSupport", getMultipleAccountSupport());
    Element eIcons = dom.createElement("Icons");
    if ((fIcon.getFileName() != null) && (fIcon.getFileName().length() > 0))
    {
      Element eIcon = dom.createElement("Icon");
      eIcon.setAttribute("Section", "Account");
      eIcon.setTextContent(fIcon.getFileName());
      eIcons.appendChild(eIcon);
    }
    if ((fIconSmall.getFileName() != null) && (fIconSmall.getFileName().length() > 0))
    {
      Element eIcon = dom.createElement("Icon");
      eIcon.setAttribute("Section", "AccountSmall");
      eIcon.setTextContent(fIconSmall.getFileName());
      eIcons.appendChild(eIcon);
    }
    if (eIcons.hasChildNodes()) {
      eAccount.appendChild(eIcons);
    }
    Element eName;
    if ((fNames != null) && (fNames.size() > 0))
    {
      Element eNames = dom.createElement("DisplayNames");
      eAccount.appendChild(eNames);
      for (LocaledValue locale : fNames)
      {
        eName = dom.createElement("DisplayName");
        eName.setAttribute("Locale", locale.getLocale());
        eName.setTextContent(locale.getValue());
        eNames.appendChild(eName);
      }
    }
    if ((fCapabilities != null) && (fCapabilities.size() > 0))
    {
      Element eCaps = dom.createElement("Capabilities");
      boolean valid = false;
      for (ApplicationData.AccountCapability acc : fCapabilities)
      {
        Element eCap = dom.createElement("Capability");
        if (acc.getCapabilities().length() > 0)
        {
          eCap.setTextContent(acc.getCapabilities());
          eCaps.appendChild(eCap);
          valid = true;
        }
      }
      if (valid) {
        eAccount.appendChild(eCaps);
      }
    }
    eParent.appendChild(eAccount);
    return true;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.ApplicationData.Account
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

public final class ApplicationData$AccountCapability
{
  public static final String[] ACCOUNT_CAPABILITY_PRESETS = {
    "http://tizen.org/account/capability/contact", 
    "http://tizen.org/account/capability/calendar" };
  private String fCapabilities;
  
  public ApplicationData$AccountCapability() {}
  
  public ApplicationData$AccountCapability(String cap)
  {
    fCapabilities = cap;
  }
  
  public String toString()
  {
    String cap = "Capability";
    if ((fCapabilities == null) || (fCapabilities.length() == 0)) {
      return cap;
    }
    return fCapabilities + " (" + cap + ")";
  }
  
  public String getCapabilities()
  {
    return fCapabilities;
  }
  
  public void setCapabilities(String fCapabilities)
  {
    this.fCapabilities = fCapabilities;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.ApplicationData.AccountCapability
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

public final class ApplicationData$AppWidget$Size
{
  public boolean enabled;
  public String name;
  public Icon preview;
  public String decoration;
  
  public ApplicationData$AppWidget$Size(String name, boolean enable)
  {
    this.name = name;
    preview = new Icon();
    enabled = enable;
    decoration = org.tizen.nativecpp.misc.IConstants.BOOL_VALUES[1];
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.ApplicationData.AppWidget.Size
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

import java.util.ArrayList;
import java.util.List;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public final class ApplicationData$AppWidget
{
  public static final String[] SIZE_PRESETS = { "1x1", "2x1", "2x2", "4x1", "4x2", "4x3", "4x4" };
  public static final String ELEMENT_APPWIDGETS = "AppWidgets";
  public static final String ELEMENT_APPWIDGET = "AppWidget";
  public static final String ATTR_PROVIDER_NAME = "ProviderName";
  public static final String ATTR_POPUP_ENABLED = "AppWidgetPopupEnabled";
  public static final String ATTR_UPDATE_PERIOD = "UpdatePeriod";
  public static final String ELEMENT_SIZES = "Sizes";
  public static final String ELEMENT_SIZE = "Size";
  public static final String ATTR_PREVIEW_IMAGE = "PreviewImage";
  public static final String ATTR_USE_DECORATION_FRAME = "UseDecorationFrame";
  public static final String ELEMENT_CONFIGURATION_APP_ID = "ConfigurationAppControlAppId";
  String fID;
  List<LocaledValue> fNames = new ArrayList();
  String fLinkedAppId;
  String fPopupEnabled;
  String fIsMain;
  String fUpdatePeriod;
  Size[] fSizes = { new Size(SIZE_PRESETS[0], true), 
    new Size(SIZE_PRESETS[1], false), 
    new Size(SIZE_PRESETS[2], false), new Size(SIZE_PRESETS[3], false), new Size(SIZE_PRESETS[4], false), 
    new Size(SIZE_PRESETS[5], false), new Size(SIZE_PRESETS[6], false) };
  
  public ApplicationData$AppWidget()
  {
    fPopupEnabled = org.tizen.nativecpp.misc.IConstants.BOOL_VALUES[0];
    fIsMain = org.tizen.nativecpp.misc.IConstants.BOOL_VALUES[1];
  }
  
  public static final class Size
  {
    public boolean enabled;
    public String name;
    public Icon preview;
    public String decoration;
    
    public Size(String name, boolean enable)
    {
      this.name = name;
      preview = new Icon();
      enabled = enable;
      decoration = org.tizen.nativecpp.misc.IConstants.BOOL_VALUES[1];
    }
  }
  
  public Size getSize(String inSize)
  {
    Size[] arrayOfSize;
    int j = (arrayOfSize = fSizes).length;
    for (int i = 0; i < j; i++)
    {
      Size size = arrayOfSize[i];
      if (name.equals(inSize)) {
        return size;
      }
    }
    return null;
  }
  
  public String toString()
  {
    if ((fID == null) || (fID.length() == 0)) {
      return "DynamicBox";
    }
    return fID;
  }
  
  public String getPopupEnabled()
  {
    return fPopupEnabled;
  }
  
  public String getIsMain()
  {
    return fIsMain;
  }
  
  public void setIsMain(String v)
  {
    fIsMain = v;
  }
  
  public void setPopupEnabled(String v)
  {
    fPopupEnabled = v;
  }
  
  public void setAppId(String id)
  {
    fLinkedAppId = id;
  }
  
  public String getAppId()
  {
    return fLinkedAppId;
  }
  
  public String getID()
  {
    return fID;
  }
  
  public void setID(String fID)
  {
    this.fID = fID;
  }
  
  public List<LocaledValue> getNames()
  {
    return fNames;
  }
  
  public String getUpdatePeriod()
  {
    return fUpdatePeriod;
  }
  
  public void setUpdatePeriod(String updatePeriod)
  {
    fUpdatePeriod = updatePeriod;
  }
  
  public static AppWidget loadOldFormat(Node root)
  {
    AppWidget livebox = new AppWidget();
    Element eLivebox = (Element)root;
    String value = eLivebox.getAttribute("ProviderName");
    if (value != null) {
      livebox.setID(value);
    }
    value = eLivebox.getAttribute("UpdatePeriod");
    if (value != null) {
      livebox.setUpdatePeriod(value);
    }
    value = eLivebox.getAttribute("Main");
    if (value != null) {
      livebox.setIsMain(value);
    }
    value = eLivebox.getAttribute("LiveboxPopupEnabled");
    if (value != null) {
      livebox.setPopupEnabled(value);
    }
    NodeList names = eLivebox.getElementsByTagName("DisplayName");
    for (int i = 0; i < names.getLength(); i++)
    {
      Element eName = (Element)names.item(i);
      String locale = eName.getAttribute("Locale");
      value = eName.getTextContent();
      livebox.getNames().add(new LocaledValue(locale, value));
    }
    NodeList nodes = eLivebox.getElementsByTagName("Size");
    for (int i = 0; i < nodes.getLength(); i++)
    {
      Element eSize = (Element)nodes.item(i);
      String sizeString = eSize.getTextContent();
      Size size = livebox.getSize(sizeString);
      if (size != null)
      {
        enabled = true;
        value = eSize.getAttribute("PreviewImage");
        if (value != null) {
          preview.set(value);
        }
      }
    }
    nodes = eLivebox.getElementsByTagName("ConfigurationAppControlAppId");
    for (int i = 0; i < nodes.getLength(); i++)
    {
      Element node = (Element)nodes.item(i);
      value = node.getTextContent();
      if (value != null) {
        livebox.setAppId(value);
      }
    }
    return livebox;
  }
  
  public static AppWidget load(Node root)
  {
    AppWidget livebox = new AppWidget();
    Element eLivebox = (Element)root;
    String value = eLivebox.getAttribute("ProviderName");
    if (value != null) {
      livebox.setID(value);
    }
    value = eLivebox.getAttribute("UpdatePeriod");
    if (value != null) {
      livebox.setUpdatePeriod(value);
    }
    value = eLivebox.getAttribute("Default");
    if (value.isEmpty()) {
      value = eLivebox.getAttribute("Main");
    }
    if (value != null) {
      livebox.setIsMain(value);
    }
    value = eLivebox.getAttribute("AppWidgetPopupEnabled");
    if (value != null) {
      livebox.setPopupEnabled(value);
    }
    NodeList names = eLivebox
      .getElementsByTagName("DisplayName");
    for (int i = 0; i < names.getLength(); i++)
    {
      Element eName = (Element)names.item(i);
      String locale = eName.getAttribute("Locale");
      value = eName.getTextContent();
      livebox.getNames().add(new LocaledValue(locale, value));
    }
    NodeList nodes = eLivebox.getElementsByTagName("Size");
    for (int i = 0; i < nodes.getLength(); i++)
    {
      Element eSize = (Element)nodes.item(i);
      String sizeString = eSize.getTextContent();
      Size size = livebox.getSize(sizeString);
      if (size != null)
      {
        enabled = true;
        value = eSize.getAttribute("PreviewImage");
        if (value != null) {
          preview.set(value);
        }
        value = eSize.getAttribute("UseDecorationFrame");
        if ((value != null) && (value.length() > 0)) {
          decoration = value.trim();
        } else {
          decoration = org.tizen.nativecpp.misc.IConstants.BOOL_VALUES[1];
        }
      }
    }
    nodes = eLivebox.getElementsByTagName("ConfigurationAppControlAppId");
    for (int i = 0; i < nodes.getLength(); i++)
    {
      Element node = (Element)nodes.item(i);
      value = node.getTextContent();
      if (value != null) {
        livebox.setAppId(value);
      }
    }
    return livebox;
  }
  
  public void save(Document dom, Element eParent)
  {
    Element eLivebox = dom.createElement("AppWidget");
    eParent.appendChild(eLivebox);
    if ((fID != null) && (fID.length() > 0)) {
      eLivebox.setAttribute("ProviderName", getID());
    }
    if ((fUpdatePeriod != null) && (fUpdatePeriod.length() > 0)) {
      eLivebox.setAttribute("UpdatePeriod", fUpdatePeriod);
    }
    if ((fIsMain != null) && (fIsMain.length() > 0)) {
      eLivebox.setAttribute("Default", fIsMain);
    }
    if ((fPopupEnabled != null) && (fPopupEnabled.length() > 0)) {
      eLivebox.setAttribute("AppWidgetPopupEnabled", fPopupEnabled);
    }
    if (fNames.size() > 0)
    {
      Element eNames = dom
        .createElement("DisplayNames");
      eLivebox.appendChild(eNames);
      for (LocaledValue locale : fNames)
      {
        Element eName = dom
          .createElement("DisplayName");
        eName.setAttribute("Locale", 
          locale.getLocale());
        eName.setTextContent(locale.getValue());
        eNames.appendChild(eName);
      }
    }
    Element eSizes = dom.createElement("Sizes");
    eLivebox.appendChild(eSizes);
    for (int i = 0; i < fSizes.length; i++)
    {
      Size size = fSizes[i];
      if (enabled)
      {
        Element eSize = dom.createElement("Size");
        if ((preview.getFileName() != null) && 
          (preview.getFileName().length() > 0)) {
          eSize.setAttribute("PreviewImage", 
            preview.getFileName());
        }
        eSize.setAttribute("UseDecorationFrame", decoration);
        eSize.setTextContent(name);
        eSizes.appendChild(eSize);
      }
    }
    if ((fLinkedAppId != null) && (fLinkedAppId.length() > 0))
    {
      Element eAppId = dom
        .createElement("ConfigurationAppControlAppId");
      eAppId.setTextContent(fLinkedAppId);
      eLivebox.appendChild(eAppId);
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.ApplicationData.AppWidget
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public final class ApplicationData$MetaData
{
  public static final String ELEMENT_METADATA_LIST = "MetadataList";
  public static final String ELEMENT_METADATA = "Metadata";
  private static final String ATTR_KEY = "Key";
  private String key;
  private String value;
  
  public ApplicationData$MetaData() {}
  
  public ApplicationData$MetaData(MetaData m)
  {
    key = new String(m.getKey());
    value = new String(m.getValue());
  }
  
  public String getValue()
  {
    return value;
  }
  
  public void setValue(String value)
  {
    this.value = value;
  }
  
  public String getKey()
  {
    return key;
  }
  
  public void setKey(String key)
  {
    this.key = key;
  }
  
  public boolean isValid()
  {
    if ((key == null) || (key.length() == 0)) {
      return false;
    }
    return true;
  }
  
  public static MetaData load(Node node)
  {
    Element eMeta = (Element)node;
    String key = eMeta.getAttribute("Key");
    String v = eMeta.getTextContent();
    
    MetaData m = new MetaData();
    m.setKey(key);
    m.setValue(v);
    
    return m;
  }
  
  public boolean save(Document dom, Element eMetaList)
  {
    if (!isValid()) {
      return false;
    }
    Element eMeta = dom.createElement("Metadata");
    eMeta.setAttribute("Key", getKey());
    if ((value != null) && (value.length() > 0)) {
      eMeta.setTextContent(getValue());
    }
    eMetaList.appendChild(eMeta);
    return true;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.ApplicationData.MetaData
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

public class ApplicationData$UiTheme
{
  String systemTheme;
  String userTheme;
  
  public ApplicationData$UiTheme()
  {
    systemTheme = ApplicationData.SYSTEM_THEMES[1];
  }
  
  public ApplicationData$UiTheme(String system, String user)
  {
    systemTheme = system;
    userTheme = user;
  }
  
  public String getSystemTheme()
  {
    return systemTheme;
  }
  
  public void setSystemTheme(String systemTheme)
  {
    this.systemTheme = systemTheme;
  }
  
  public String getUserTheme()
  {
    return userTheme;
  }
  
  public void setUserTheme(String theme)
  {
    userTheme = theme;
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.misc.core.ApplicationData.UiTheme
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.misc.core;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class ApplicationData
{
  public static final String APPTYPE_UI = "UiApp";
  public static final String APPTYPE_SERVICE = "ServiceApp";
  public static final String[] SYSTEM_THEMES = { "White", "Black", "Default" };
  public static final String[] HW_ACCEL_OPTS = { "System Default", "On", "Off" };
  public static final String[] CATEGORY_PRESETS = { "http://tizen.org/category/ime", 
    "http://tizen.org/category/homeapp", "http://tizen.org/category/lockapp" };
  private String fApplicationType;
  private String fName;
  
  public static class UiTheme
  {
    String systemTheme;
    String userTheme;
    
    public UiTheme()
    {
      systemTheme = ApplicationData.SYSTEM_THEMES[1];
    }
    
    public UiTheme(String system, String user)
    {
      systemTheme = system;
      userTheme = user;
    }
    
    public String getSystemTheme()
    {
      return systemTheme;
    }
    
    public void setSystemTheme(String systemTheme)
    {
      this.systemTheme = systemTheme;
    }
    
    public String getUserTheme()
    {
      return userTheme;
    }
    
    public void setUserTheme(String theme)
    {
      userTheme = theme;
    }
  }
  
  private boolean isDefault = false;
  private boolean isMainmenuVisible = false;
  private boolean fIsLaunchingHistoryVisible;
  private boolean isAutoScaling = false;
  private boolean isLaunchOnBoot = false;
  private boolean isAutoRestart = false;
  private String fHWAccel = HW_ACCEL_OPTS[0];
  private boolean fUseUiInServiceApp;
  private String fLifeDuration;
  private boolean fIsSubMode;
  private String fMemoryLayoutType;
  
  public boolean getSubMode()
  {
    return fIsSubMode;
  }
  
  public void setSubMode(boolean mode)
  {
    fIsSubMode = mode;
  }
  
  public String getLifeDuration()
  {
    return fLifeDuration;
  }
  
  public void setLifeDuration(String fLifeDuration)
  {
    this.fLifeDuration = fLifeDuration;
  }
  
  public boolean isUseUiInServiceApp()
  {
    return fUseUiInServiceApp;
  }
  
  public void setUseUiInServiceApp(boolean useUi)
  {
    fUseUiInServiceApp = useUi;
  }
  
  public boolean isLaunchingHistoryVisible()
  {
    return fIsLaunchingHistoryVisible;
  }
  
  public void setLaunchingHistoryVisible(boolean hide)
  {
    fIsLaunchingHistoryVisible = hide;
  }
  
  private Icon[] fIcons = { new Icon(IconType.MAINMENU) };
  private List<LocaledValue> fDisplayNames = new ArrayList();
  private Set<String> fCategories = new HashSet();
  private Icon fCategoryPreview = new Icon(IconType.ETC);
  private List<ConditionItem> fConditions = new ArrayList();
  private Map<String, String> fNotifications = new HashMap();
  private List<AppControl> fAppControls = new ArrayList();
  private List<DataControl> fDataControlTypes = new ArrayList();
  private UiScalability fUiScalability = new UiScalability();
  private UiTheme fUiTheme = new UiTheme();
  private HashSet<LanguageData> fImeLangs = new HashSet();
  private UUID fImeID;
  private List<Account> fAccounts = new ArrayList();
  private List<AppWidget> fLiveboxes = new ArrayList();
  private boolean fIsPermission;
  private List<MetaData> fMetas;
  
  public Icon getCategoryPreview()
  {
    return fCategoryPreview;
  }
  
  public void setCategoryPreview(String fn)
  {
    fCategoryPreview.set(fn);
  }
  
  public List<MetaData> getMetaData()
  {
    if (fMetas == null) {
      fMetas = new ArrayList();
    }
    return fMetas;
  }
  
  public static final class MetaData
  {
    public static final String ELEMENT_METADATA_LIST = "MetadataList";
    public static final String ELEMENT_METADATA = "Metadata";
    private static final String ATTR_KEY = "Key";
    private String key;
    private String value;
    
    public MetaData() {}
    
    public MetaData(MetaData m)
    {
      key = new String(m.getKey());
      value = new String(m.getValue());
    }
    
    public String getValue()
    {
      return value;
    }
    
    public void setValue(String value)
    {
      this.value = value;
    }
    
    public String getKey()
    {
      return key;
    }
    
    public void setKey(String key)
    {
      this.key = key;
    }
    
    public boolean isValid()
    {
      if ((key == null) || (key.length() == 0)) {
        return false;
      }
      return true;
    }
    
    public static MetaData load(Node node)
    {
      Element eMeta = (Element)node;
      String key = eMeta.getAttribute("Key");
      String v = eMeta.getTextContent();
      
      MetaData m = new MetaData();
      m.setKey(key);
      m.setValue(v);
      
      return m;
    }
    
    public boolean save(Document dom, Element eMetaList)
    {
      if (!isValid()) {
        return false;
      }
      Element eMeta = dom.createElement("Metadata");
      eMeta.setAttribute("Key", getKey());
      if ((value != null) && (value.length() > 0)) {
        eMeta.setTextContent(getValue());
      }
      eMetaList.appendChild(eMeta);
      return true;
    }
  }
  
  public static final class AppWidget
  {
    public static final String[] SIZE_PRESETS = { "1x1", "2x1", "2x2", "4x1", "4x2", "4x3", "4x4" };
    public static final String ELEMENT_APPWIDGETS = "AppWidgets";
    public static final String ELEMENT_APPWIDGET = "AppWidget";
    public static final String ATTR_PROVIDER_NAME = "ProviderName";
    public static final String ATTR_POPUP_ENABLED = "AppWidgetPopupEnabled";
    public static final String ATTR_UPDATE_PERIOD = "UpdatePeriod";
    public static final String ELEMENT_SIZES = "Sizes";
    public static final String ELEMENT_SIZE = "Size";
    public static final String ATTR_PREVIEW_IMAGE = "PreviewImage";
    public static final String ATTR_USE_DECORATION_FRAME = "UseDecorationFrame";
    public static final String ELEMENT_CONFIGURATION_APP_ID = "ConfigurationAppControlAppId";
    String fID;
    List<LocaledValue> fNames = new ArrayList();
    String fLinkedAppId;
    String fPopupEnabled;
    String fIsMain;
    String fUpdatePeriod;
    Size[] fSizes = { new Size(SIZE_PRESETS[0], true), 
      new Size(SIZE_PRESETS[1], false), 
      new Size(SIZE_PRESETS[2], false), new Size(SIZE_PRESETS[3], false), new Size(SIZE_PRESETS[4], false), 
      new Size(SIZE_PRESETS[5], false), new Size(SIZE_PRESETS[6], false) };
    
    public AppWidget()
    {
      fPopupEnabled = org.tizen.nativecpp.misc.IConstants.BOOL_VALUES[0];
      fIsMain = org.tizen.nativecpp.misc.IConstants.BOOL_VALUES[1];
    }
    
    public static final class Size
    {
      public boolean enabled;
      public String name;
      public Icon preview;
      public String decoration;
      
      public Size(String name, boolean enable)
      {
        this.name = name;
        preview = new Icon();
        enabled = enable;
        decoration = org.tizen.nativecpp.misc.IConstants.BOOL_VALUES[1];
      }
    }
    
    public Size getSize(String inSize)
    {
      Size[] arrayOfSize;
      int j = (arrayOfSize = fSizes).length;
      for (int i = 0; i < j; i++)
      {
        Size size = arrayOfSize[i];
        if (name.equals(inSize)) {
          return size;
        }
      }
      return null;
    }
    
    public String toString()
    {
      if ((fID == null) || (fID.length() == 0)) {
        return "DynamicBox";
      }
      return fID;
    }
    
    public String getPopupEnabled()
    {
      return fPopupEnabled;
    }
    
    public String getIsMain()
    {
      return fIsMain;
    }
    
    public void setIsMain(String v)
    {
      fIsMain = v;
    }
    
    public void setPopupEnabled(String v)
    {
      fPopupEnabled = v;
    }
    
    public void setAppId(String id)
    {
      fLinkedAppId = id;
    }
    
    public String getAppId()
    {
      return fLinkedAppId;
    }
    
    public String getID()
    {
      return fID;
    }
    
    public void setID(String fID)
    {
      this.fID = fID;
    }
    
    public List<LocaledValue> getNames()
    {
      return fNames;
    }
    
    public String getUpdatePeriod()
    {
      return fUpdatePeriod;
    }
    
    public void setUpdatePeriod(String updatePeriod)
    {
      fUpdatePeriod = updatePeriod;
    }
    
    public static AppWidget loadOldFormat(Node root)
    {
      AppWidget livebox = new AppWidget();
      Element eLivebox = (Element)root;
      String value = eLivebox.getAttribute("ProviderName");
      if (value != null) {
        livebox.setID(value);
      }
      value = eLivebox.getAttribute("UpdatePeriod");
      if (value != null) {
        livebox.setUpdatePeriod(value);
      }
      value = eLivebox.getAttribute("Main");
      if (value != null) {
        livebox.setIsMain(value);
      }
      value = eLivebox.getAttribute("LiveboxPopupEnabled");
      if (value != null) {
        livebox.setPopupEnabled(value);
      }
      NodeList names = eLivebox.getElementsByTagName("DisplayName");
      for (int i = 0; i < names.getLength(); i++)
      {
        Element eName = (Element)names.item(i);
        String locale = eName.getAttribute("Locale");
        value = eName.getTextContent();
        livebox.getNames().add(new LocaledValue(locale, value));
      }
      NodeList nodes = eLivebox.getElementsByTagName("Size");
      for (int i = 0; i < nodes.getLength(); i++)
      {
        Element eSize = (Element)nodes.item(i);
        String sizeString = eSize.getTextContent();
        Size size = livebox.getSize(sizeString);
        if (size != null)
        {
          enabled = true;
          value = eSize.getAttribute("PreviewImage");
          if (value !=
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd