package com.dniemcu;

import javax.mail.Session;

import de.tsenger.androsmex.data.CANSpecDO;

import android.app.Application;

public class MyAppMcu extends Application {

	public boolean m_started;
	public String m_titulo; 
	
	private String m_pdforigen;
	private String m_pdfdestino;
	
	private int m_notificationsLOAD;
	private int m_notificationsSEND;
	private int m_notificationsCONFIG;
	private Session session;
	
	private CANSpecDO selectedCAN;

	public static final int EVENT_LOAD 	= 0x1;
	public static final int EVENT_SEND  = 0x2;
	public static final int EVENT_CONFIG= 0x3;
	public static final int EVENT_SIGN  = 0x4;
	
	public void setCAN(CANSpecDO can)
	{
		selectedCAN = can;
	}
	
	public CANSpecDO getCAN()
	{
		return selectedCAN;
	}
	
	public void setSession(Session newsession)
	{
		session = newsession;
	}
	
	public Session getSession()
	{
		return session;
	}
	
	public void setPDFs(String origen, String destino)
	{
		m_pdforigen 	= origen;
		m_pdfdestino 	= destino;		
	}
	
	public String getPDF(int tipo)
	{
		if (tipo == 1)
			return m_pdforigen;
		else
			return m_pdfdestino;		
	}
	
	public void setNotifications(int iEvent, int iValue)
	{
		switch(iEvent)
		{
			case EVENT_LOAD:
				m_notificationsLOAD = iValue;
				break;
			case EVENT_SEND:
				m_notificationsSEND = iValue;
				break;
			case EVENT_CONFIG:
				m_notificationsCONFIG = iValue;
				break;
		}
	}
	
	public int getNotifications(int iEvent)
	{
		switch(iEvent)
		{
			case EVENT_LOAD:
				return m_notificationsLOAD;
			case EVENT_SEND:
				return m_notificationsSEND;
			case EVENT_CONFIG:
				return m_notificationsCONFIG;
			default:
				return 0;
		}
	}
	
	public boolean isStarted()
	{
		return m_started;
	}
	
	public void setStarted(boolean state)
	{
		m_started = state;
	}
	
	public String getTitulo(){
		return m_titulo;
	}
	  
}