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 DBAUI_WIZ_COLUMNSELECT_HXX
28 #define DBAUI_WIZ_COLUMNSELECT_HXX
29 
30 #include "WTabPage.hxx"
31 #include "WCopyTable.hxx"
32 
33 #ifndef _SV_FIXED_HXX
34 #include <vcl/fixed.hxx>
35 #endif
36 #ifndef _SV_LSTBOX_HXX
37 #include <vcl/lstbox.hxx>
38 #endif
39 #ifndef _SV_BUTTON_HXX
40 #include <vcl/button.hxx>
41 #endif
42 #include <comphelper/stl_types.hxx>
43 
44 namespace dbaui
45 {
46     class OFieldDescription;
47 
48 	// ========================================================
49 	// Wizard Page: OWizColumnSelect
50 	// ========================================================
51 
52 	class OWizColumnSelect : public OWizardPage
53 	{
54 
55         FixedLine               m_flColumns;
56 		MultiListBox			m_lbOrgColumnNames; // left side
57         ImageButton             m_ibColumn_RH;
58         ImageButton             m_ibColumns_RH;
59         ImageButton             m_ibColumn_LH;
60         ImageButton             m_ibColumns_LH;
61 		MultiListBox			m_lbNewColumnNames; // right side
62 
63 
64 		DECL_LINK( ButtonClickHdl, Button * );
65 		DECL_LINK( ListDoubleClickHdl, MultiListBox * );
66 
67 
68 		void clearListBox(MultiListBox& _rListBox);
69 		void fillColumns(		ListBox* pRight,
70 								::std::vector< ::rtl::OUString> &_rRightColumns);
71 
72 		void createNewColumn(	ListBox* _pListbox,
73 								OFieldDescription* _pSrcField,
74 								::std::vector< ::rtl::OUString>& _rRightColumns,
75 								const ::rtl::OUString&	_sColumnName,
76 								const ::rtl::OUString&	_sExtraChars,
77 								sal_Int32				_nMaxNameLen,
78 								const ::comphelper::TStringMixEqualFunctor& _aCase);
79 
80 		void moveColumn(		ListBox* _pRight,
81 								ListBox* _pLeft,
82 								::std::vector< ::rtl::OUString>& _rRightColumns,
83 								const ::rtl::OUString&	_sColumnName,
84 								const ::rtl::OUString&	_sExtraChars,
85 								sal_Int32				_nMaxNameLen,
86 								const ::comphelper::TStringMixEqualFunctor& _aCase);
87 
88 		void enableButtons();
89 
90 
91 		sal_uInt16 adjustColumnPosition(ListBox* _pLeft,
92                                     const ::rtl::OUString&	_sColumnName,
93                                     ODatabaseExport::TColumnVector::size_type nCurrentPos,
94                                     const ::comphelper::TStringMixEqualFunctor& _aCase);
95 
96 	public:
97 		virtual	void			Reset ( );
98 		virtual void			ActivatePage();
99 		virtual sal_Bool		LeavePage();
100 		virtual String			GetTitle() const ;
101 
102 		OWizColumnSelect(Window* pParent);
103 		virtual ~OWizColumnSelect();
104 	};
105 }
106 #endif // DBAUI_WIZ_COLUMNSELECT_HXX
107 
108 
109 
110