1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
23 #include <tools/string.hxx>
60 DF_LMONTH
= DFF_DMMMYY
,
61 DF_LDAYMON
= DFF_DDMMMYY
,
62 DF_LDAYMONTH
= DFF_DDDMMMYY
87 class SwDateTimeFieldType
: public SwValueFieldType
90 SwDateTimeFieldType(SwDoc
* pDoc
);
92 virtual SwFieldType
* Copy() const;
96 class SW_DLLPUBLIC SwDateTimeField
: public SwValueField
99 long nOffset
; // Offset in minutes.
101 virtual String
Expand() const;
102 virtual SwField
* Copy() const;
105 SwDateTimeField(SwDateTimeFieldType
* pType
, sal_uInt16 nSubType
= DATEFLD
,
106 sal_uLong nFmt
= 0, sal_uInt16 nLng
= 0);
108 virtual sal_uInt16
GetSubType() const;
109 virtual void SetSubType(sal_uInt16 nSub
);
111 virtual double GetValue() const;
113 virtual void SetPar2(const OUString
& rStr
);
114 virtual OUString
GetPar2() const;
116 inline sal_Bool
IsDate() const
117 { return (nSubType
& DATEFLD
) != 0; }
119 inline void SetOffset(long nMinutes
) { nOffset
= nMinutes
; }
120 inline long GetOffset() const { return nOffset
; }
122 Date
GetDate(sal_Bool bUseOffset
= sal_False
) const;
123 Time
GetTime(sal_Bool bUseOffset
= sal_False
) const;
124 void SetDateTime(const DateTime
& rDT
);
125 static double GetDateTime(SwDoc
* pDoc
, const DateTime
& rDT
);
127 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt16 nMId
) const;
128 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt16 nMId
);
131 #endif // SW_FLDDAT_HXX
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */