1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef RPTUI_DATETIME_HXX
24 #define RPTUI_DATETIME_HXX
25 
26 #ifndef _DIALOG_HXX //autogen
27 #include <vcl/dialog.hxx>
28 #endif
29 #ifndef _FIXED_HXX //autogen
30 #include <vcl/fixed.hxx>
31 #endif
32 #include <vcl/lstbox.hxx>
33 #include <vcl/field.hxx>
34 #ifndef _SV_BUTTON_HXX
35 #include <vcl/button.hxx>
36 #endif
37 #include <com/sun/star/report/XReportDefinition.hpp>
38 #include <com/sun/star/util/XNumberFormats.hpp>
39 #include <com/sun/star/lang/Locale.hpp>
40 
41 #include <svtools/dialogcontrolling.hxx>
42 
43 namespace rptui
44 {
45 class OReportController;
46 /*************************************************************************
47 |*
48 |* Groups and Sorting dialog
49 |*
50 \************************************************************************/
51 class ODateTimeDialog :	public ModalDialog
52 {
53 	// FixedLine							m_aFLDate;
54 	CheckBox								m_aDate;
55     FixedText                               m_aFTDateFormat;
56     ListBox                                 m_aDateListBox;
57 	FixedLine								m_aFL0;
58 	CheckBox								m_aTime;
59     FixedText                               m_aFTTimeFormat;
60     ListBox                                 m_aTimeListBox;
61 	FixedLine								m_aFL1;
62 	OKButton								m_aPB_OK;
63 	CancelButton							m_aPB_CANCEL;
64 	HelpButton								m_aPB_Help;
65 
66 
67 	svt::ControlDependencyManager           m_aDateControlling;
68 	svt::ControlDependencyManager           m_aTimeControlling;
69 
70 	::rptui::OReportController*				m_pController;
71 	::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>
72 											m_xHoldAlive;
73 	::com::sun::star::lang::Locale			m_nLocale;
74 
75     /** returns the frmat string
76     *
77     * \param _nNumberFormatKey the number format key
78     * \param _xFormats
79     * \param _bTime
80     * \return
81     */
82     ::rtl::OUString getFormatStringByKey(::sal_Int32 _nNumberFormatKey,const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats>& _xFormats,bool _bTime);
83 
84 	/** returns the number format key
85 		@param	_nNumberFormatIndex the number format index @see com::sun::star::i18n::NumberFormatIndex
86 	*/
87 	sal_Int32 getFormatKey(sal_Bool _bDate) const;
88 
89 	DECL_LINK( CBClickHdl, CheckBox* );
90     ODateTimeDialog(const ODateTimeDialog&);
91     void operator =(const ODateTimeDialog&);
92 
93     // fill methods
94     void InsertEntry(sal_Int16 _nNumberFormatId);
95 public:
96 	ODateTimeDialog( Window* pParent
97 						,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xHoldAlive
98 						,::rptui::OReportController* _pController);
99 	virtual ~ODateTimeDialog();
100 	virtual short	Execute();
101 };
102 // =============================================================================
103 } // namespace rptui
104 // =============================================================================
105 #endif // RPTUI_DATETIME_HXX
106