useDynLib(splusTimeDate, .registration=TRUE)

## Import non-base functions we need explicitly,
## notably for which we define methods:
importFrom("stats", median)

importFrom("methods",
    ## still needed {group generics needed to be explicitly imported} ?
    Ops, Arith, Compare, Logic, Math, Math2, Summary, Complex,
    callGeneric, callNextMethod, getSlots, slot,
    ## generics for which we export new methods:
    coerce, show, is, as, new
)

## Generics and functions defined in this package
export(
    ## generics
    days,
    years,
    hours,
    minutes,
    seconds,
    yeardays,
    mdy,
    hms,
    wdydy,
    timeFloor,
    timeCeiling,
    timeTrunc,
    shiftPositions,
    ## functions
    format.timeDate,
    format.timeSpan,
    groupVec,
    groupVecClasses,
    "groupVecClasses<-",
    groupVecColumn,
    "groupVecColumn<-",
    groupVecData,
    "groupVecData<-",
    groupVecNames,
    "groupVecNames<-",
    groupVecExtValid,
    groupVecNonVec,
    groupVecValid,
    holiday.fixed,
    holidays,
    holiday.weekday.number,
    holiday.nearest.weekday,
    holiday.NewYears,
    holiday.MLK,
    holiday.Presidents,
    holiday.Easter,
    holiday.GoodFriday,
    holiday.Memorial,
    holiday.Independence,
    holiday.Labor,
    holiday.Columbus,
    holiday.Veterans,
    holiday.Thanksgiving,
    holiday.Christmas,
    holiday.USFederal,
    holiday.NYSE,
    holiday.Anzac,
    holiday.Australia,
    holiday.May,
    holiday.VE,
    holiday.Canada,
    holiday.Bastille,
    holiday.AllSaints,
    holiday.Thanksgiving.Canada,
    holiday.Victoria,
    holiday.StPatricks,
    is.monthend,
    numericSequence,
    timeDefaults,
    timeDateFormatChoose,
    timeDate,
    timeEvent,
    timeCalendar,
    timeZoneConvert,
    timeConvert,
    timeSpan,
    timeZoneC,
    timeZoneR,
    timeZoneList,
    timeDateOptions,
    timeAlign,
    timeRelative,
    timeSequence,
    timeSeq,
    .numalign,
    .timealign
)

exportClasses(
    "groupVec",
    "positions",
    "positionsCalendar",
    "positionsNumeric",
    "timeZone",
    "timeZoneC",
    "timeZoneR",
    "numericSequence",
    "timeEvent",
    "timeRelative",
    "timeSpan",
    "timeInterval",
    "timeSequence"
)

exportMethods(## for both own and "other" generics:
    ## Group Methods
    "Compare",
    "Math",
    "Math2",
    "Ops",
    "Summary",
    ## Re-export S4 methods, for "stats"-S3-generics:
    "[",
    "[<-",
    "[[",
    "[[<-",
    "c",
    "coerce",
    "cor",
    "cut",
    "diff",
    "duplicated",
    "format",
    "is.na",
    "is.finite",
    "is.infinite",
    "is.nan",
    "length",
    "length<-",
    "logb",
    "match",
    "mean",
    "median",
    "months",
    "names",
    "quantile",
    "quarters",
    "rev",
    "show",
    "sort",
    "sort.list",
    "summary",
    "unique",
    "weekdays",
    "var"
)
