1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef RPTUI_DATETIME_HXX
28 #define RPTUI_DATETIME_HXX
29 
30 #ifndef _DIALOG_HXX //autogen
31 #include <vcl/dialog.hxx>
32 #endif
33 #ifndef _FIXED_HXX //autogen
34 #include <vcl/fixed.hxx>
35 #endif
36 #include <vcl/lstbox.hxx>
37 #include <vcl/field.hxx>
38 #ifndef _SV_BUTTON_HXX
39 #include <vcl/button.hxx>
40 #endif
41 #include <com/sun/star/report/XReportDefinition.hpp>
42 #include <com/sun/star/util/XNumberFormats.hpp>
43 #include <com/sun/star/lang/Locale.hpp>
44 
45 #include <svtools/dialogcontrolling.hxx>
46 
47 namespace rptui
48 {
49 class OReportController;
50 /*************************************************************************
51 |*
52 |* Groups and Sorting dialog
53 |*
54 \************************************************************************/
55 class ODateTimeDialog :	public ModalDialog
56 {
57 	// FixedLine							m_aFLDate;
58 	CheckBox								m_aDate;
59     FixedText                               m_aFTDateFormat;
60     ListBox                                 m_aDateListBox;
61 	FixedLine								m_aFL0;
62 	CheckBox								m_aTime;
63     FixedText                               m_aFTTimeFormat;
64     ListBox                                 m_aTimeListBox;
65 	FixedLine								m_aFL1;
66 	OKButton								m_aPB_OK;
67 	CancelButton							m_aPB_CANCEL;
68 	HelpButton								m_aPB_Help;
69 
70 
71 	svt::ControlDependencyManager           m_aDateControlling;
72 	svt::ControlDependencyManager           m_aTimeControlling;
73 
74 	::rptui::OReportController*				m_pController;
75 	::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>
76 											m_xHoldAlive;
77 	::com::sun::star::lang::Locale			m_nLocale;
78 
79     /** returns the frmat string
80     *
81     * \param _nNumberFormatKey the number format key
82     * \param _xFormats
83     * \param _bTime
84     * \return
85     */
86     ::rtl::OUString getFormatStringByKey(::sal_Int32 _nNumberFormatKey,const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats>& _xFormats,bool _bTime);
87 
88 	/** returns the number format key
89 		@param	_nNumberFormatIndex the number format index @see com::sun::star::i18n::NumberFormatIndex
90 	*/
91 	sal_Int32 getFormatKey(sal_Bool _bDate) const;
92 
93 	DECL_LINK( CBClickHdl, CheckBox* );
94     ODateTimeDialog(const ODateTimeDialog&);
95     void operator =(const ODateTimeDialog&);
96 
97     // fill methods
98     void InsertEntry(sal_Int16 _nNumberFormatId);
99 public:
100 	ODateTimeDialog( Window* pParent
101 						,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xHoldAlive
102 						,::rptui::OReportController* _pController);
103 	virtual ~ODateTimeDialog();
104 	virtual short	Execute();
105 };
106 // =============================================================================
107 } // namespace rptui
108 // =============================================================================
109 #endif // RPTUI_DATETIME_HXX
110