Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / dbaccess / source / ui / inc / dsmeta.hxx
blob0c8646a53cbd79e7692ca06b2d76a8a1f7995493
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <sal/config.h>
24 #include <set>
26 #include "dsitems.hxx"
28 #include <rtl/ustring.hxx>
30 #include <memory>
32 namespace dbaui
35 // AuthenticationMode
36 enum AuthenticationMode
38 AuthNone,
39 AuthUserPwd,
40 AuthPwd
43 // DataSourceMetaData
44 class FeatureSet;
45 /** encapsulates meta data for a data source
47 On the long run, this class should a) encapsulate *all* meta data which
48 currently is hard coded somewhere in the program logic and b) be initialized
49 from the configuration.
51 At the moment, the data a) is still hard coded in the, well, code and b)
52 contains meta data about the advanced settings only.
54 class DataSourceMetaData
56 public:
57 DataSourceMetaData( const OUString& _sURL );
58 ~DataSourceMetaData();
60 /// returns a struct describing this data source type's support for our known advanced settings
61 const FeatureSet& getFeatureSet() const;
63 /// determines whether or not the data source requires authentication
64 static AuthenticationMode getAuthentication( const OUString& _sURL );
66 private:
67 OUString m_sURL;
70 // FeatureSet
71 /** can be used to ask for (UI) support for certain advanced features
73 class FeatureSet
75 public:
76 typedef std::set< ItemID >::const_iterator const_iterator;
78 public:
79 FeatureSet() { }
81 void put( const ItemID _id ) { m_aContent.insert( _id ); }
82 bool has( const ItemID _id ) const { return m_aContent.find( _id ) != m_aContent.end(); }
84 inline bool supportsAnySpecialSetting() const;
85 inline bool supportsGeneratedValues() const;
87 const_iterator begin() const { return m_aContent.begin(); }
88 const_iterator end() const { return m_aContent.end(); }
90 private:
91 std::set< ItemID > m_aContent;
94 inline bool FeatureSet::supportsGeneratedValues() const
96 return has( DSID_AUTORETRIEVEENABLED );
99 inline bool FeatureSet::supportsAnySpecialSetting() const
101 return has( DSID_SQL92CHECK )
102 || has( DSID_APPEND_TABLE_ALIAS )
103 || has( DSID_AS_BEFORE_CORRNAME )
104 || has( DSID_ENABLEOUTERJOIN )
105 || has( DSID_IGNOREDRIVER_PRIV )
106 || has( DSID_PARAMETERNAMESUBST )
107 || has( DSID_SUPPRESSVERSIONCL )
108 || has( DSID_CATALOG )
109 || has( DSID_SCHEMA )
110 || has( DSID_INDEXAPPENDIX )
111 || has( DSID_DOSLINEENDS )
112 || has( DSID_BOOLEANCOMPARISON )
113 || has( DSID_CHECK_REQUIRED_FIELDS )
114 || has( DSID_IGNORECURRENCY )
115 || has( DSID_ESCAPE_DATETIME )
116 || has( DSID_PRIMARY_KEY_SUPPORT )
117 || has( DSID_MAX_ROW_SCAN )
118 || has( DSID_RESPECTRESULTSETTYPE )
122 } // namespace dbaui
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */