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