Debian Codegraph @

basic/source/inc/date.hxx

raw
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20 #pragma once
21
22 #include <com/sun/star/util/Date.hpp>
23 #include <com/sun/star/util/Time.hpp>
24 #include <com/sun/star/util/DateTime.hpp>
25
26 #include <basic/sbxvar.hxx>
27
28 enum class SbDateCorrection
29 {
30 None,
31 RollOver,
32 TruncateToMonth
33 };
34
35 bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bUseTwoDigitYear, SbDateCorrection eCorr, double& rdRet );
36 double implTimeSerial(sal_Int16 nHour, sal_Int16 nMinute, sal_Int16 nSecond,
37 sal_Int32 nMilliSecond);
38 bool implDateTimeSerial(sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, sal_Int16 nHour,
39 sal_Int16 nMinute, sal_Int16 nSecond, sal_Int32 nMilliSecond,
40 double& rdRet);
41
42 sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam = false, sal_Int16 nFirstDay = 0 );
43
44 sal_Int16 implGetDateYear( double aDate );
45 sal_Int16 implGetDateMonth( double aDate );
46 sal_Int16 implGetDateDay( double aDate );
47
48 sal_Int16 implGetHour( double dDate );
49 sal_Int16 implGetMinute( double dDate );
50 sal_Int16 implGetSecond( double dDate );
51 sal_Int32 implGetNanoSecond(double dDate);
52
53 css::util::Date SbxDateToUNODate( const SbxValue* );
54 void SbxDateFromUNODate( SbxValue*, const css::util::Date& );
55 css::util::Time SbxDateToUNOTime( const SbxValue* );
56 void SbxDateFromUNOTime( SbxValue*, const css::util::Time& );
57 css::util::DateTime SbxDateToUNODateTime( const SbxValue* );
58 void SbxDateFromUNODateTime( SbxValue*, const css::util::DateTime& );
59
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */