useDynLib(TargetSearch, .registration = TRUE, .fixes = "c_")

import("methods")
import("stats")

importFrom("graphics",
	"abline",
	"axis",
	"box",
	"boxplot",
	"grid",
	"image",
	"layout",
	"lcm",
	"legend",
	"matlines",
	"matplot",
	"mtext",
	"par",
	"plot.new",
	"points",
	"rect",
	"strheight",
	"strwidth",
	"text",
	"title"
)

importFrom("grDevices", "colorRamp", "dev.off", "pdf", "gray", "rgb")

importFrom("utils",
	"combn",
	"head",
	"read.delim",
	"setTxtProgressBar",
	"txtProgressBar",
	"write.table"
)

importFrom("ncdf4", "nc_open", "nc_close", "ncvar_get", "ncvar_put",
           "ncatt_get", "ncatt_put", "ncdim_def", "ncvar_def", "nc_create")

importFrom("assertthat",
	"assert_that",
	"is.count",
	"is.flag",
	"is.number",
	"is.scalar",
	"is.string",
	"noNA",
	"on_failure<-"
)

exportClasses(
	"tsLib",
	"tsRim",
	"tsSample",
	"tsMSdata",
	"tsProfile"
)

exportMethods(
	"rimMass",
	"rimMass<-",
	"rimLimits",
	"rimLimits<-",
	"rimStandard",
	"rimStandard<-",
	"CDFfiles",
	"CDFfiles<-",
	"RIfiles",
	"RIfiles<-",
	"CDFpath",
	"CDFpath<-",
	"RIpath",
	"RIpath<-",
	"sampleData",
	"sampleData<-",
	"sampleNames",
	"sampleNames<-",
	"sampleDays",
	"sampleDays<-",
	"refLib",
	"libId",
	"medRI",
	"medRI<-",
	"selMass",
	"selMass<-",
	"topMass",
	"topMass<-",
	"quantMass",
	"quantMass<-",
	"spectra",
	"spectra<-",
	"libUID",
	"libUID<-",
	"libName",
	"libName<-",
	"libRI",
	"libRI<-",
	"libData",
	"libData<-",
	"RIdev",
	"RIdev<-",
	"retIndex",
	"retIndex<-",
	"retTime",
	"retTime<-",
	"Intensity",
	"Intensity<-",
	"profileInfo",
	"profileInfo<-",
	"profileInt",
	"profileInt<-",
	"profileRI",
	"profileRI<-",
	"profileRT",
	"profileRT<-",
	"fileFormat",
	"fileFormat<-",
	"show",
	"tsUpdate",
	"ncdf4Convert"
)

S3method("as.list", "tsMSdata")
S3method("as.list", "tsProfile")

export(
	"baseline",
	"baselineCorrection",
	"baselineCorrectionQuant",
	"bin2text",
	"checkRimLim",
	"FAMEoutliers",
	"FindAllPeaks",
	"FindPeaks",
	"fixRI",
	"fixRIcorrection",
	"ImportFameSettings",
	"ImportLibrary",
	"ImportLibrary.msp",
	"ImportLibrary.tab",
	"ImportSamples",
	"ImportSamplesFromDir",
	"makeIndex",
	"medianRILib",
	"ncdf4_convert",
	"ncdf4_convert_from_path",
	"ncdf4_data_extract",
	"ncdf4_plot_peak",
	"ncdf4_update_ri",
	"NetCDFPeakFinding",
	"peakCDFextraction",
	"peakFind",
	"plotAllRIdev",
	"plotAllSpectra",
	"plotFAME",
	"plotPeak",
	"plotPeakRI",
	"plotPeakSimple",
	"plotRefSpectra",
	"plotRIdev",
	"plotSpectra",
	"Profile",
	"ProfileCleanUp",
	"quantMatrix",
	"ri2rt",
	"RIcorrect",
	"riMatrix",
	"ri_data_extract",
	"ri_plot_peak",
	"rt2ri",
	"sampleRI",
	"TargetSearchGUI",
	"text2bin",
	"updateRI",
	"Write.Results",
	"writeLibText",
	"writeMSP"
)
