• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kjs
 

kjs

  • kjs
date_object.h
1 // -*- c-basic-offset: 2 -*-
2 /*
3  * This file is part of the KDE libraries
4  * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  */
21 
22 #ifndef _DATE_OBJECT_H_
23 #define _DATE_OBJECT_H_
24 
25 #include "internal.h"
26 #include "function_object.h"
27 
28 namespace KJS {
29 
30  class DateInstanceImp : public ObjectImp {
31  public:
32  DateInstanceImp(ObjectImp *proto);
33 
34  virtual const ClassInfo *classInfo() const { return &info; }
35  static const ClassInfo info;
36  };
37 
44  class DatePrototypeImp : public DateInstanceImp {
45  public:
46  DatePrototypeImp(ExecState *exec, ObjectPrototypeImp *objectProto);
47  Value get(ExecState *exec, const Identifier &p) const;
48  virtual const ClassInfo *classInfo() const { return &info; }
49  static const ClassInfo info;
50  };
51 
58  class DateProtoFuncImp : public InternalFunctionImp {
59  public:
60  DateProtoFuncImp(ExecState *exec, int i, int len);
61 
62  virtual bool implementsCall() const;
63  virtual Value call(ExecState *exec, Object &thisObj, const List &args);
64 
65 
66  Completion execute(const List &);
67  enum { ToString, ToDateString, ToTimeString, ToLocaleString,
68  ToLocaleDateString, ToLocaleTimeString, ValueOf, GetTime,
69  GetFullYear, GetMonth, GetDate, GetDay, GetHours, GetMinutes,
70  GetSeconds, GetMilliSeconds, GetTimezoneOffset, SetTime,
71  SetMilliSeconds, SetSeconds, SetMinutes, SetHours, SetDate,
72  SetMonth, SetFullYear, ToUTCString,
73  // non-normative properties (Appendix B)
74  GetYear, SetYear, ToGMTString };
75  private:
76  short id;
77  bool utc;
78  };
79 
85  class DateObjectImp : public InternalFunctionImp {
86  public:
87  DateObjectImp(ExecState *exec,
88  FunctionPrototypeImp *funcProto,
89  DatePrototypeImp *dateProto);
90 
91  virtual bool implementsConstruct() const;
92  virtual Object construct(ExecState *exec, const List &args);
93  virtual bool implementsCall() const;
94  virtual Value call(ExecState *exec, Object &thisObj, const List &args);
95 
96  Completion execute(const List &);
97  Object construct(const List &);
98  };
99 
106  class DateObjectFuncImp : public InternalFunctionImp {
107  public:
108  DateObjectFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto,
109  int i, int len);
110 
111  virtual bool implementsCall() const;
112  virtual Value call(ExecState *exec, Object &thisObj, const List &args);
113 
114  enum { Parse, UTC };
115  private:
116  int id;
117  };
118 
119  // helper functions
120  double parseDate(const UString &u);
121  double KRFCDate_parseDate(const UString &_date);
122  double timeClip(double t);
123  double makeTime(struct tm *t, double milli, bool utc);
124 
125 } // namespace
126 
127 #endif

kjs

Skip menu "kjs"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kjs

Skip menu "kjs"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kjs by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |