#ifndef DATE_OBJECT_H
#define DATE_OBJECT_H
#include "internal.h"
namespace KJS {
class FunctionPrototype;
class ObjectPrototype;
class DateInstance : public JSObject {
public:
DateInstance(JSObject *proto);
bool getTime(tm &t, int &gmtoffset) const;
bool getUTCTime(tm &t) const;
bool getTime(double &ms, int &gmtoffset) const;
bool getUTCTime(double &ms) const;
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
class DatePrototype : public DateInstance {
public:
DatePrototype(ExecState *, ObjectPrototype *);
virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
};
class DateProtoFunc : public InternalFunctionImp {
public:
DateProtoFunc(ExecState *, int i, int len, const Identifier& date);
virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args);
enum { ToString, ToDateString, ToTimeString, ToLocaleString,
ToLocaleDateString, ToLocaleTimeString, ValueOf, GetTime,
GetFullYear, GetMonth, GetDate, GetDay, GetHours, GetMinutes,
GetSeconds, GetMilliSeconds, GetTimezoneOffset, SetTime,
SetMilliSeconds, SetSeconds, SetMinutes, SetHours, SetDate,
SetMonth, SetFullYear, ToUTCString,
GetYear, SetYear, ToGMTString };
private:
int id;
bool utc;
};
class DateObjectImp : public InternalFunctionImp {
public:
DateObjectImp(ExecState *, FunctionPrototype *, DatePrototype *);
virtual bool implementsConstruct() const;
virtual JSObject *construct(ExecState *, const List &args);
virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args);
Completion execute(const List &);
JSObject *construct(const List &);
};
}
#endif