merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / inc / dsmeta.hxx
blob874e0942785aa5812b1bd6d1ad803f6a9f2308a3
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dsmeta.hxx,v $
10 * $Revision: 1.5.68.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef DBACCESS_DSMETA_HXX
32 #define DBACCESS_DSMETA_HXX
34 #include "dsntypes.hxx"
36 /** === begin UNO includes === **/
37 /** === end UNO includes === **/
39 #include <boost/shared_ptr.hpp>
41 //........................................................................
42 namespace dbaui
44 //........................................................................
46 //====================================================================
47 //= AutheticationMode
48 //====================================================================
49 enum AuthenticationMode
51 AuthNone,
52 AuthUserPwd,
53 AuthPwd
56 //====================================================================
57 //= DataSourceMetaData
58 //====================================================================
59 struct AdvancedSettingsSupport;
60 class DataSourceMetaData_Impl;
61 /** encapsulates meta data for a data source
63 On the long run, this class should a) encapsulate *all* meta data which
64 currently is hard coded somewhere in the program logic and b) be initialized
65 from the configuration.
67 At the moment, the data a) is still hard coded in the, well, code and b)
68 contains meta data about the advanced settings only.
70 class DataSourceMetaData
72 public:
73 DataSourceMetaData( const ::rtl::OUString& _sURL );
74 ~DataSourceMetaData();
76 /// returns a struct describing this data source type's support for our known advanced settings
77 const AdvancedSettingsSupport& getAdvancedSettingsSupport() const;
79 /// determines whether or not the data source requires authentication
80 AuthenticationMode getAuthentication() const;
82 static AuthenticationMode getAuthentication( const ::rtl::OUString& _sURL );
84 private:
85 ::boost::shared_ptr< DataSourceMetaData_Impl > m_pImpl;
88 //====================================================================
89 //= AdvancedSettingsSupport
90 //====================================================================
91 /// struct taking flags for the supported advanced settings
92 struct AdvancedSettingsSupport
94 // auto-generated values
95 bool bGeneratedValues;
96 // various settings as found on the "Special Settings" page in the UI
97 bool bUseSQL92NamingConstraints;
98 bool bAppendTableAliasInSelect;
99 bool bUseKeywordAsBeforeAlias;
100 bool bUseBracketedOuterJoinSyntax;
101 bool bIgnoreDriverPrivileges;
102 bool bParameterNameSubstitution;
103 bool bDisplayVersionColumns;
104 bool bUseCatalogInSelect;
105 bool bUseSchemaInSelect;
106 bool bUseIndexDirectionKeyword;
107 bool bUseDOSLineEnds;
108 bool bBooleanComparisonMode;
109 bool bFormsCheckRequiredFields;
110 bool bIgnoreCurrency;
111 bool bEscapeDateTime;
113 // Note: If you extend this list, you need to adjust the ctor (of course)
114 // and (maybe) the implementation of supportsAnySpecialSetting
116 AdvancedSettingsSupport()
117 :bGeneratedValues ( true )
118 ,bUseSQL92NamingConstraints ( true )
119 ,bAppendTableAliasInSelect ( true )
120 ,bUseKeywordAsBeforeAlias ( true )
121 ,bUseBracketedOuterJoinSyntax ( true )
122 ,bIgnoreDriverPrivileges ( true )
123 ,bParameterNameSubstitution ( true )
124 ,bDisplayVersionColumns ( true )
125 ,bUseCatalogInSelect ( true )
126 ,bUseSchemaInSelect ( true )
127 ,bUseIndexDirectionKeyword ( true )
128 ,bUseDOSLineEnds ( true )
129 ,bBooleanComparisonMode ( true )
130 ,bFormsCheckRequiredFields ( true )
131 ,bIgnoreCurrency ( false )
132 ,bEscapeDateTime ( false )
136 /** determines whether there is support for any of the settings found on the "Special Settings"
139 inline bool supportsAnySpecialSetting() const;
142 //--------------------------------------------------------------------
143 inline bool AdvancedSettingsSupport::supportsAnySpecialSetting() const
145 return ( bUseSQL92NamingConstraints == true )
146 || ( bAppendTableAliasInSelect == true )
147 || ( bUseKeywordAsBeforeAlias == true )
148 || ( bUseBracketedOuterJoinSyntax == true )
149 || ( bIgnoreDriverPrivileges == true )
150 || ( bParameterNameSubstitution == true )
151 || ( bDisplayVersionColumns == true )
152 || ( bUseCatalogInSelect == true )
153 || ( bUseSchemaInSelect == true )
154 || ( bUseIndexDirectionKeyword == true )
155 || ( bUseDOSLineEnds == true )
156 || ( bBooleanComparisonMode == true )
157 || ( bFormsCheckRequiredFields == true )
158 || ( bIgnoreCurrency == true )
159 || ( bEscapeDateTime == true )
163 //........................................................................
164 } // namespace dbaui
165 //........................................................................
167 #endif // DBACCESS_DSMETA_HXX