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

import("methods")

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

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

importFrom("stats", "approx", "as.dist", "coef", "cor", "cutree", "dist",
           "hclust", "lm", "median", "predict", "sd", "smooth.spline")

importFrom("tcltk", ".Tcl", "tclServiceMode", "tclvalue", "tclvalue<-",
           "tclVar", "tkbutton", "tkcheckbutton", "tkchooseDirectory",
           "tkconfigure", "tkdestroy", "tkentry", "tkfocus", "tkframe",
           "tkgetOpenFile", "tkgetSaveFile", "tkgrid", "tklabel",
           "tkmessageBox", "tkpack", "tkradiobutton", "tktitle<-",
           "tktoplevel", "tkwm.deiconify", "tkwm.iconbitmap",
           "tkProgressBar", "setTkProgressBar")

importFrom("utils", "edit", "head", "installed.packages", "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")

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<-",
	"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"
)

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

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