kspread

helper.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 1998-2002 The KSpread Team <koffice-devel@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; only
00007    version 2 of the License.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 #ifndef kspread_functions_helper_h_
00020 #define kspread_functions_helper_h_
00021 // helper functions for other functions
00022 
00023 #include "kspread_export.h"
00024 
00025 class QDate;
00026 
00027 namespace KSpread
00028 {
00029 
00030 /*  0: US 30 / 360
00031  *  1: real days
00032  *  2: real days / 360
00033  *  3: real days / 365
00034  *  4: European 30 / 360
00035  */
00036 KSPREAD_EXPORT int daysPerYear( QDate const & date, int basis );
00037 
00038 /*  0: US 30 / 360
00039  *  1: real days
00040  *  2: real days / 360
00041  *  3: real days / 365
00042  *  4: European 30 / 360
00043  */
00044 KSPREAD_EXPORT int daysBetweenDates( QDate const & date1, QDate const & date2, int basis );
00045 
00046 
00047 // ODF
00048 KSPREAD_EXPORT int days360( const QDate& _date1, const QDate& _date2, bool european );
00049 KSPREAD_EXPORT int days360( int day1, int month1, int year1, bool leapYear1, int  day2, int month2, int year2, bool usa );
00050 KSPREAD_EXPORT long double yearFrac( const QDate& refDate, const QDate& startDate, const QDate& endDate, int basis );
00051 KSPREAD_EXPORT long double duration( const QDate& refDate, const QDate& settlement, const QDate& maturity, const long double& coup_, const long double& yield_, const int& freq, const int& basis, const long double& numOfCoups );
00052 KSPREAD_EXPORT long double pow1p ( const long double& x, const long double& y);
00053 KSPREAD_EXPORT long double pow1pm1 ( const long double& x, const long double& y);
00054 } //namespace KSpread
00055 
00056 #endif