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 
28 #ifndef DBACCESS_ADVANCEDSETTINGS_HXX
29 #define DBACCESS_ADVANCEDSETTINGS_HXX
30 
31 #include "adminpages.hxx"
32 #include "dsmeta.hxx"
33 
34 /** === begin UNO includes === **/
35 /** === end UNO includes === **/
36 
37 #include <svtools/dialogcontrolling.hxx>
38 
39 #include <vcl/lstbox.hxx>
40 #include <vcl/field.hxx>
41 
42 #include <vector>
43 
44 //........................................................................
45 namespace dbaui
46 {
47 //........................................................................
48 
49     struct BooleanSettingDesc;
50     typedef ::std::vector< BooleanSettingDesc > BooleanSettingDescs;
51 
52     //====================================================================
53     //= SpecialSettingsPage
54     //====================================================================
55     /** implements the "Special Settings" page of the advanced database settings
56     */
57     class SpecialSettingsPage : public OGenericAdministrationPage
58     {
59     protected:
60         FixedLine           m_aTopLine;
61         CheckBox*           m_pIsSQL92Check;
62         CheckBox*           m_pAppendTableAlias;
63         CheckBox*           m_pAsBeforeCorrelationName;
64         CheckBox*           m_pEnableOuterJoin;
65         CheckBox*           m_pIgnoreDriverPrivileges;
66         CheckBox*           m_pParameterSubstitution;
67         CheckBox*           m_pSuppressVersionColumn;
68         CheckBox*           m_pCatalog;
69         CheckBox*           m_pSchema;
70         CheckBox*           m_pIndexAppendix;
71         CheckBox*           m_pDosLineEnds;
72         CheckBox*           m_pCheckRequiredFields;
73         CheckBox*			m_pIgnoreCurrency;
74         CheckBox*           m_pEscapeDateTime;
75         CheckBox*           m_pPrimaryKeySupport;
76         CheckBox*           m_pRespectDriverResultSetType;
77 
78         FixedText*          m_pBooleanComparisonModeLabel;
79         ListBox*            m_pBooleanComparisonMode;
80 
81         FixedText*          m_pMaxRowScanLabel;
82         NumericField*       m_pMaxRowScan;
83 
84         ::svt::ControlDependencyManager
85                             m_aControlDependencies;
86 
87         BooleanSettingDescs m_aBooleanSettings;
88 
89         bool                m_bHasBooleanComparisonMode;
90         bool                m_bHasMaxRowScan;
91 
92     public:
93         virtual sal_Bool        FillItemSet ( SfxItemSet& _rCoreAttrs );
94 
95         SpecialSettingsPage(Window* pParent, const SfxItemSet& _rCoreAttrs, const DataSourceMetaData& _rDSMeta );
96 
97     protected:
98         virtual ~SpecialSettingsPage();
99 
100         // OGenericAdministrationPage overridables
101         virtual void implInitControls (const SfxItemSet& _rSet, sal_Bool _bSaveValue );
102 
103         // <method>OGenericAdministrationPage::fillControls</method>
104         virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
105 
106         // <method>OGenericAdministrationPage::fillWindows</method>
107         virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
108 
109     private:
110         void    impl_initBooleanSettings();
111     };
112 
113     //====================================================================
114     //= GeneratedValuesPage
115     //====================================================================
116     class GeneratedValuesPage : public OGenericAdministrationPage
117     {
118     protected:
119 
120         FixedLine   m_aAutoFixedLine;
121         CheckBox    m_aAutoRetrievingEnabled;
122         FixedText   m_aAutoIncrementLabel;
123         Edit        m_aAutoIncrement;
124         FixedText   m_aAutoRetrievingLabel;
125         Edit        m_aAutoRetrieving;
126 
127         ::svt::ControlDependencyManager
128                     m_aControlDependencies;
129 
130     public:
131         virtual sal_Bool        FillItemSet (SfxItemSet& _rCoreAttrs);
132 
133         GeneratedValuesPage( Window* pParent, const SfxItemSet& _rCoreAttrs );
134     protected:
135 
136             // nControlFlags ist eine Kombination der CBTP_xxx-Konstanten
137         virtual ~GeneratedValuesPage();
138 
139         // must be overloaded by subclasses, but it isn't pure virtual
140         virtual void        implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue);
141 
142         // <method>OGenericAdministrationPage::fillControls</method>
143         virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList);
144 
145         // <method>OGenericAdministrationPage::fillWindows</method>
146         virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList);
147 
148     private:
149         DECL_LINK( OnCheckBoxClick, CheckBox * );
150     };
151 
152 //........................................................................
153 } // namespace dbaui
154 //........................................................................
155 
156 #endif // DBACCESS_ADVANCEDSETTINGS_HXX
157