Ananas Library 0.9.5
adateservice.h
1/****************************************************************************
2** $Id: adateservice.h,v 1.4 2008/05/24 13:12:33 app Exp $
3**
4** Header file of Ananas project
5**
6** Copyright (C) 2008. Andrey Paskal
7**
8** This file is part of the Library of the Ananas
9** automation accounting system.
10**
11** This file may be distributed and/or modified under the terms of the
12** GNU General Public License version 2 as published by the Free Software
13** Foundation and appearing in the file LICENSE.GPL included in the
14** packaging of this file.
15**
16** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
17** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18**
19**********************************************************************/
20
21#ifndef ADATESERVICE_H
22#define ADATESERVICE_H
23
24#include <qdatetime.h>
25#include "aextension.h"
26
38class ANANAS_EXPORT aDateService : public AExtension
39{
40 Q_OBJECT
41public:
43 aDateService( int y, int m, int d );
45 aDateService(const QDate&);
47protected:
48 QDate *dateInstance;
49public slots:
50
51
52 bool IsNull () const;
53 bool IsValid () const;
54 bool IsValid ( int y, int m, int d ) ;
55 int Year () const ;
56 int Month () const ;
57 int Day () const ;
58 int DayOfWeek () const ;
59 int DayOfYear () const ;
60 int DaysInMonth () const ;
61 int DaysInYear () const ;
62 int WeekNumber () const ;
63 QString ToString ( const QString & format = QString::null) const;
64 QDate ToDate () const;
65 bool SetYMD ( int y, int m, int d ) ;
66 aDateService* AddDays ( int ndays ) const ;
67 aDateService* AddMonths ( int nmonths ) const;
68 aDateService* AddYears ( int nyears ) const;
69 int DaysTo ( const aDateService& target) const ;
70 int DaysTo ( const QDate& target ) const ;
71
72};
73
74#endif// ADATESERVICE_H
aDateService()
Конструктор, который создает aDateService для работы в ананас скрипте.
Определения adateservice.cpp:36
bool IsValid() const
Returns TRUE if this date is valid; otherwise returns FALSE. .
Определения adateservice.cpp:123
aDateService * AddDays(int ndays) const
Returns a aDateService object containing a date ndays later than the date of this object (or earlier ...
Определения adateservice.cpp:371
int Day() const
Returns the day of the month (1..31) of this date. .
Определения adateservice.cpp:182
int Year() const
Returns the year (1752..8000) of this date. .
Определения adateservice.cpp:152
QString ToString(const QString &format=QString::null) const
Возвращает дату в виде строки.
Определения adateservice.cpp:313
QDate ToDate() const
Возвращает представление даты в объекте сласса QDate. .
Определения adateservice.cpp:331
int DaysInMonth() const
Returns the number of days in the month (28..31) for this date. .
Определения adateservice.cpp:224
bool IsNull() const
Returns TRUE if the date is null; otherwise returns FALSE. A null date is invalid....
Определения adateservice.cpp:109
int DayOfYear() const
Returns the day of the year (1..365) for this date. .
Определения adateservice.cpp:210
aDateService * AddMonths(int nmonths) const
Returns a aDateService object containing a date nmonths later than the date of this object (or earlie...
Определения adateservice.cpp:391
bool SetYMD(int y, int m, int d)
Sets the date's year y, month m and day d.
Определения adateservice.cpp:355
aDateService * AddYears(int nyears) const
Возвращает объект класса aDateService содержащий дату на nyears лет позднее хранимой в объекте даты (...
Определения adateservice.cpp:411
int DayOfWeek() const
Returns the weekday (Monday=1..Sunday=7) for this date. .
Определения adateservice.cpp:196
int WeekNumber() const
Returns the week number (1 to 53) for this date.
Определения adateservice.cpp:258
int DaysInYear() const
Returns the number of days in the year (365 or 366) for this date. .
Определения adateservice.cpp:238
int Month() const
Returns the month (January=1..December=12) of this date. .
Определения adateservice.cpp:168
int DaysTo(const aDateService &target) const
Возвращает количество дней до указанной даты от даты, представленной объектом.
Определения adateservice.cpp:432