## Emacs, make this -*- mode: R; -*-

import("methods")
importFrom("Rcpp", "Rcpp.plugin.maker", "sourceCpp")
importFrom("stats", "sd")
importFrom("graphics", "par", "plot", "lines", "legend")
importFrom("utils", "compareVersion", "packageVersion")
importFrom("zoo","zoo","na.spline")

useDynLib("RQuantLib", .registration=TRUE)

export(
    ##--arrays.R
    "oldEuropeanOptionArrays",
    "EuropeanOptionArrays",
    "plotOptionSurface",
    "matchParams",
    ##--asian.R
    "AsianOption",
    ##--bermudan.R
    "BermudanSwaption",
    "AffineSwaption",
    #"sabrengine",
    "SabrSwaption",
    "summary.G2Analytic",
    "summary.HWAnalytic",
    "summary.HWTree",
    "summary.BKTree",
    ##--bond.R
    "ZeroCouponBond",
    "ZeroPriceByYield",
    "ZeroYield",
    "FixedRateBond",
    "FixedRateBondYield",
    "FixedRateBondPriceByYield",
    "FloatingRateBond",
    "ConvertibleZeroCouponBond",
    "ConvertibleFixedCouponBond",
    "ConvertibleFloatingCouponBond",
    "CallableBond",
    "FittedBondCurve",
    ##--calendars.R
    "calendars",
    "isBusinessDay", "businessDay",
    "isHoliday",
    "isWeekend",
    "isEndOfMonth",
    "getEndOfMonth", "endOfMonth",
    "adjust",
    "advance",
    "businessDaysBetween",
    "getHolidayList", "holidayList",
    "getBusinessDayList", "businessDayList",
    "setCalendarContext",
    "addHolidays",
    "removeHolidays",
    ##--dayCounter.R
    "dayCount",
    "yearFraction",
    "setEvaluationDate",
    ##--dates.cpp
    "advanceDate",
    ##--discount.R
    "DiscountCurve",
    "plot.DiscountCurve",
    ##--implied.R
    "EuropeanOptionImpliedVolatility",
    "AmericanOptionImpliedVolatility",
    "BinaryOptionImpliedVolatility",
    ##--option.R
    "EuropeanOption",
    "AmericanOption",
    "BinaryOption",
    "BarrierOption",
    ##--schedule.R
    "Schedule",
    ##--utils.R
    "getQuantLibVersion",
    "getQuantLibCapabilities"
)

S3method("AmericanOption", "default")
S3method("AmericanOptionImpliedVolatility", "default")
S3method("AsianOption", "default")
S3method("BarrierOption", "default")
S3method("BermudanSwaption", "default")
S3method("AffineSwaption", "default")
S3method("SabrSwaption", "default")

S3method("BinaryOption", "default")
S3method("BinaryOptionImpliedVolatility", "default")
S3method("CallableBond", "default")
S3method("ConvertibleFixedCouponBond", "default")
S3method("ConvertibleFloatingCouponBond", "default")
S3method("ConvertibleZeroCouponBond", "default")
S3method("DiscountCurve", "default")
S3method("EuropeanOption", "default")
S3method("EuropeanOptionImpliedVolatility", "default")
S3method("FittedBondCurve", "default")
S3method("FixedRateBond", "default")
S3method("FixedRateBondPriceByYield", "default")
S3method("FixedRateBondYield", "default")
S3method("FloatingRateBond", "default")
S3method("plot", "DiscountCurve")
S3method("Schedule", "default")
S3method("summary", "BKTree")
S3method("summary", "G2Analytic")
S3method("summary", "HWAnalytic")
S3method("summary", "HWTree")
S3method("summary", "G2AnalyticAffineSwaption")
S3method("summary", "HWAnalyticAffineSwaption")
S3method("summary", "HWTreeAffineSwaption")
S3method("ZeroCouponBond", "default")
S3method("ZeroPriceByYield", "default")
S3method("ZeroYield", "default")

S3method("plot", "Option")
S3method("print", "Option")
S3method("summary", "Option")

S3method("plot", "Bond")
S3method("print", "Bond")
S3method("summary", "Bond")

S3method("print", "FixedRateBond")
