xref: /aoo41x/main/dbaccess/source/ui/inc/WCPage.hxx (revision cdf0e10c)
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_WIZARD_CPAGE_HXX
28 #define DBAUI_WIZARD_CPAGE_HXX
29 
30 #include "WTabPage.hxx"
31 
32 #ifndef DBAUI_ENUMTYPES_HXX
33 #include "QEnumTypes.hxx"
34 #endif
35 #ifndef _SV_FIXED_HXX
36 #include <vcl/fixed.hxx>
37 #endif
38 #ifndef _SV_GROUP_HXX
39 #include <vcl/group.hxx>
40 #endif
41 #ifndef _SV_FIXED_HXX
42 #include <vcl/fixed.hxx>
43 #endif
44 #ifndef _SV_EDIT_HXX
45 #include <vcl/edit.hxx>
46 #endif
47 #ifndef _SV_BUTTON_HXX
48 #include <vcl/button.hxx>
49 #endif
50 
51 namespace dbaui
52 {
53 	class OWizColumnSelect;
54 	class OWizNormalExtend;
55 	//========================================================================
56 	class OCopyTable : public OWizardPage
57 	{
58 	protected:
59 		FixedText								m_ftTableName;
60 		Edit									m_edTableName;
61         FixedLine                               m_aFL_Options;
62 		RadioButton								m_aRB_DefData;
63 		RadioButton								m_aRB_Def;
64 		RadioButton								m_aRB_View;
65 		RadioButton								m_aRB_AppendData;
66         CheckBox								m_aCB_UseHeaderLine;
67 		CheckBox								m_aCB_PrimaryColumn;
68 		FixedText								m_aFT_KeyName;
69 		Edit									m_edKeyName;
70 		sal_Int16                               m_nOldOperation;
71 
72 		OWizColumnSelect*						m_pPage2;
73 		OWizNormalExtend*						m_pPage3;
74 
75 		sal_Bool									m_bPKeyAllowed;
76         sal_Bool                                    m_bUseHeaderAllowed;
77 
78 
79 		DECL_LINK( AppendDataClickHdl, Button* );
80 		DECL_LINK( RadioChangeHdl, Button* );
81 		DECL_LINK( KeyClickHdl, Button* );
82 
83 		sal_Bool checkAppendData();
84 		//--------dyf add
85 		void SetAppendDataRadio();
86 		//--------add end
87 
88 	public:
89 		virtual	void			Reset();
90 		virtual void			ActivatePage();
91 		virtual sal_Bool			LeavePage();
92 		virtual String			GetTitle() const ;
93 
94 		OCopyTable( Window * pParent );
95 		virtual ~OCopyTable();
96 
97 		inline sal_Bool IsOptionDefData()		const { return m_aRB_DefData.IsChecked(); }
98 		inline sal_Bool IsOptionDef()			const { return m_aRB_Def.IsChecked(); }
99 		inline sal_Bool IsOptionAppendData()	const { return m_aRB_AppendData.IsChecked(); }
100 		inline sal_Bool IsOptionView()			const { return m_aRB_View.IsChecked(); }
101         inline sal_Bool UseHeaderLine()			const { return m_aCB_UseHeaderLine.IsChecked(); }
102         String      GetKeyName()            const { return m_edKeyName.GetText(); }
103 
104 		void setCreateStyleAction();
105         inline void disallowViews()
106         {
107             m_aRB_View.Disable();
108         }
109         inline void disallowUseHeaderLine()
110         {
111             m_bUseHeaderAllowed = sal_False;
112             m_aCB_UseHeaderLine.Disable();
113         }
114 
115         void setCreatePrimaryKey( bool _bDoCreate, const ::rtl::OUString& _rSuggestedName );
116 	};
117 }
118 #endif // DBAUI_WIZARD_CPAGE_HXX
119 
120 
121