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 .
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_DATETIME_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_DATETIME_HXX
22 #include <vcl/weld.hxx>
23 #include <com/sun/star/report/XSection.hpp>
24 #include <com/sun/star/util/XNumberFormats.hpp>
25 #include <com/sun/star/lang/Locale.hpp>
27 #include <svtools/dialogcontrolling.hxx>
31 class OReportController
;
32 /*************************************************************************
34 |* Groups and Sorting dialog
36 \************************************************************************/
37 class ODateTimeDialog
: public weld::GenericDialogController
39 ::rptui::OReportController
* m_pController
;
40 css::uno::Reference
< css::report::XSection
>
42 css::lang::Locale m_nLocale
;
44 std::unique_ptr
<weld::CheckButton
> m_xDate
;
45 std::unique_ptr
<weld::Label
> m_xFTDateFormat
;
46 std::unique_ptr
<weld::ComboBox
> m_xDateListBox
;
47 std::unique_ptr
<weld::CheckButton
> m_xTime
;
48 std::unique_ptr
<weld::Label
> m_xFTTimeFormat
;
49 std::unique_ptr
<weld::ComboBox
> m_xTimeListBox
;
50 std::unique_ptr
<weld::Button
> m_xPB_OK
;
52 /** returns the format string
54 * \param _nNumberFormatKey the number format key
59 OUString
getFormatStringByKey(::sal_Int32 _nNumberFormatKey
,const css::uno::Reference
< css::util::XNumberFormats
>& _xFormats
,bool _bTime
);
61 /** returns the number format key
62 @param _nNumberFormatIndex the number format index @see css::i18n::NumberFormatIndex
64 sal_Int32
getFormatKey(bool _bDate
) const;
66 DECL_LINK(CBClickHdl
, weld::ToggleButton
&, void);
67 ODateTimeDialog(const ODateTimeDialog
&) = delete;
68 void operator =(const ODateTimeDialog
&) = delete;
71 void InsertEntry(sal_Int16 _nNumberFormatId
);
73 ODateTimeDialog(weld::Window
* pParent
,
74 const css::uno::Reference
< css::report::XSection
>& _xHoldAlive
,
75 ::rptui::OReportController
* _pController
);
76 virtual short run() override
;
81 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_DATETIME_HXX
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */