IGNITE-3390: ODBC: Added DSN configuration dialog for Windows. This closes #881.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/60afa372 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/60afa372 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/60afa372 Branch: refs/heads/master Commit: 60afa372906246d43456518e5f76a454ca2bcadf Parents: 4343c73 Author: isapego <[email protected]> Authored: Thu Aug 25 16:37:43 2016 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Thu Aug 25 16:37:43 2016 +0300 ---------------------------------------------------------------------- .../cpp/common/include/ignite/common/utils.h | 7 + .../cpp/common/os/win/src/common/utils.cpp | 20 ++ .../cpp/core/include/ignite/ignition.h | 2 +- modules/platforms/cpp/core/src/ignition.cpp | 8 +- .../cpp/odbc-test/src/configuration_test.cpp | 6 +- modules/platforms/cpp/odbc/Makefile.am | 1 + modules/platforms/cpp/odbc/include/Makefile.am | 1 + .../platforms/cpp/odbc/include/ignite/odbc.h | 1 - .../include/ignite/odbc/config/configuration.h | 93 +++++- .../ignite/odbc/diagnostic/diagnostic_record.h | 2 +- .../cpp/odbc/include/ignite/odbc/dsn_config.h | 61 ++++ .../odbc/include/ignite/odbc/protocol_version.h | 20 +- .../include/ignite/odbc/system/odbc_constants.h | 4 - .../odbc/system/ui/dsn_configuration_window.h | 152 +++++++++ .../ignite/odbc/system/ui/custom_window.h | 189 ++++++++++++ .../win/include/ignite/odbc/system/ui/window.h | 201 ++++++++++++ .../odbc/os/win/src/system/ui/custom_window.cpp | 184 +++++++++++ .../src/system/ui/dsn_configuration_window.cpp | 305 +++++++++++++++++++ .../cpp/odbc/os/win/src/system/ui/window.cpp | 192 ++++++++++++ .../cpp/odbc/os/win/src/system_dsn.cpp | 218 +++++++++++++ .../platforms/cpp/odbc/project/vs/odbc.vcxproj | 25 +- .../cpp/odbc/project/vs/odbc.vcxproj.filters | 30 ++ .../cpp/odbc/src/config/configuration.cpp | 17 +- modules/platforms/cpp/odbc/src/connection.cpp | 2 +- .../odbc/src/diagnostic/diagnostic_record.cpp | 2 +- .../diagnostic/diagnostic_record_storage.cpp | 2 +- modules/platforms/cpp/odbc/src/dsn_config.cpp | 115 +++++++ modules/platforms/cpp/odbc/src/entry_points.cpp | 8 - modules/platforms/cpp/odbc/src/odbc.cpp | 88 ++---- .../platforms/cpp/odbc/src/protocol_version.cpp | 23 +- 30 files changed, 1868 insertions(+), 111 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/common/include/ignite/common/utils.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/common/include/ignite/common/utils.h b/modules/platforms/cpp/common/include/ignite/common/utils.h index 331fcb2..f4d2a9f 100644 --- a/modules/platforms/cpp/common/include/ignite/common/utils.h +++ b/modules/platforms/cpp/common/include/ignite/common/utils.h @@ -60,6 +60,13 @@ namespace ignite } /** + * Strips leading and trailing whitespaces from string. + * + * @param str String to be transformed. + */ + IGNITE_IMPORT_EXPORT void StripSurroundingWhitespaces(std::string& str); + + /** * Get string representation of long in decimal form. * * @param val Long value to be converted to string. http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/common/os/win/src/common/utils.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/common/os/win/src/common/utils.cpp b/modules/platforms/cpp/common/os/win/src/common/utils.cpp index 47d7f43..77c90b8 100644 --- a/modules/platforms/cpp/common/os/win/src/common/utils.cpp +++ b/modules/platforms/cpp/common/os/win/src/common/utils.cpp @@ -40,6 +40,26 @@ namespace ignite return false; } + void StripSurroundingWhitespaces(std::string& str) + { + std::string::size_type newBegin = 0; + while (newBegin < str.size() && ::isspace(str[newBegin])) + ++newBegin; + + if (newBegin == str.size()) + { + str.clear(); + + return; + } + + std::string::size_type newEnd = str.size() - 1; + while (::isspace(str[newEnd])) + --newEnd; + + str.assign(str, newBegin, (newEnd - newBegin) + 1); + } + time_t IgniteTimeGm(const tm& time) { tm tmc = time; http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/core/include/ignite/ignition.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/include/ignite/ignition.h b/modules/platforms/cpp/core/include/ignite/ignition.h index f88efe5..57fd51c 100644 --- a/modules/platforms/cpp/core/include/ignite/ignition.h +++ b/modules/platforms/cpp/core/include/ignite/ignition.h @@ -154,7 +154,7 @@ namespace ignite * @param err Error. */ static void StopAll(bool cancel, IgniteError* err); - }; + }; } #endif //_IGNITE_IGNITION \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/core/src/ignition.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/core/src/ignition.cpp b/modules/platforms/cpp/core/src/ignition.cpp index 4a7d941..83adb4c 100644 --- a/modules/platforms/cpp/core/src/ignition.cpp +++ b/modules/platforms/cpp/core/src/ignition.cpp @@ -216,9 +216,9 @@ namespace ignite int optsLen; char** opts = CreateJvmOptions(cfg, homeFound ? &home : NULL, cp, &optsLen); - + envTarget = new SharedPointer<IgniteEnvironment>(env); - + SharedPointer<JniContext> ctx( JniContext::Create(opts, optsLen, env.Get()->GetJniHandlers(envTarget), &jniErr)); @@ -258,7 +258,7 @@ namespace ignite if (!javaRef) { IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err); - + failed = true; } else { @@ -458,7 +458,7 @@ namespace ignite JniErrorInfo jniErr; SharedPointer<JniContext> ctx(JniContext::Create(NULL, 0, JniHandlers(), &jniErr)); - + IgniteError::SetError(jniErr.code, jniErr.errCls, jniErr.errMsg, err); if (err->GetCode() == IgniteError::IGNITE_SUCCESS) http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc-test/src/configuration_test.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc-test/src/configuration_test.cpp b/modules/platforms/cpp/odbc-test/src/configuration_test.cpp index c0bb439..1851eae 100644 --- a/modules/platforms/cpp/odbc-test/src/configuration_test.cpp +++ b/modules/platforms/cpp/odbc-test/src/configuration_test.cpp @@ -49,7 +49,7 @@ void CheckValidAddress(const char* connectStr, uint16_t port) BOOST_CHECK_NO_THROW(cfg.FillFromConnectString(connectStr)); - BOOST_CHECK_EQUAL(cfg.GetPort(), port); + BOOST_CHECK_EQUAL(cfg.GetTcpPort(), port); } void CheckValidProtocolVersion(const char* connectStr, ignite::odbc::ProtocolVersion version) @@ -92,7 +92,7 @@ void CheckConnectionConfig(const Configuration& cfg) { BOOST_CHECK_EQUAL(cfg.GetDriver(), testDriverName); BOOST_CHECK_EQUAL(cfg.GetHost(), testServerHost); - BOOST_CHECK_EQUAL(cfg.GetPort(), testServerPort); + BOOST_CHECK_EQUAL(cfg.GetTcpPort(), testServerPort); BOOST_CHECK_EQUAL(cfg.GetAddress(), testAddress); BOOST_CHECK_EQUAL(cfg.GetCache(), testCacheName); BOOST_CHECK_EQUAL(cfg.GetDsn(), std::string()); @@ -119,7 +119,7 @@ void CheckDsnConfig(const Configuration& cfg) BOOST_CHECK_EQUAL(cfg.GetCache(), Configuration::DefaultValue::cache); BOOST_CHECK_EQUAL(cfg.GetAddress(), Configuration::DefaultValue::address); BOOST_CHECK_EQUAL(cfg.GetHost(), std::string()); - BOOST_CHECK_EQUAL(cfg.GetPort(), Configuration::DefaultValue::port); + BOOST_CHECK_EQUAL(cfg.GetTcpPort(), Configuration::DefaultValue::port); BOOST_CHECK_EQUAL(cfg.IsDistributedJoins(), false); BOOST_CHECK_EQUAL(cfg.IsEnforceJoinOrder(), false); } http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/Makefile.am ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/Makefile.am b/modules/platforms/cpp/odbc/Makefile.am index 9faa999..1781bc0 100644 --- a/modules/platforms/cpp/odbc/Makefile.am +++ b/modules/platforms/cpp/odbc/Makefile.am @@ -62,6 +62,7 @@ libignite_odbc_la_SOURCES = \ src/meta/table_meta.cpp \ src/odbc.cpp \ src/entry_points.cpp \ + src/dsn_config.cpp \ src/query/column_metadata_query.cpp \ src/query/data_query.cpp \ src/query/foreign_keys_query.cpp \ http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/include/Makefile.am ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/Makefile.am b/modules/platforms/cpp/odbc/include/Makefile.am index 0776548..073dcaa 100644 --- a/modules/platforms/cpp/odbc/include/Makefile.am +++ b/modules/platforms/cpp/odbc/include/Makefile.am @@ -38,6 +38,7 @@ noinst_HEADERS = \ ignite/odbc/row.h \ ignite/odbc/utility.h \ ignite/odbc/environment.h \ + ignite/odbc/dsn_config.h \ ignite/odbc/system/odbc_constants.h \ ignite/odbc/system/socket_client.h \ ignite/odbc/meta/primary_key_meta.h \ http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/include/ignite/odbc.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc.h b/modules/platforms/cpp/odbc/include/ignite/odbc.h index 40158dd..810d186 100644 --- a/modules/platforms/cpp/odbc/include/ignite/odbc.h +++ b/modules/platforms/cpp/odbc/include/ignite/odbc.h @@ -251,7 +251,6 @@ namespace ignite SQLSMALLINT tableNameLen, SQLSMALLINT scope, SQLSMALLINT nullable); - } // namespace ignite #endif //_IGNITE_ODBC \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/include/ignite/odbc/config/configuration.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/config/configuration.h b/modules/platforms/cpp/odbc/include/ignite/odbc/config/configuration.h index 30f9ad6..8e19a6e 100644 --- a/modules/platforms/cpp/odbc/include/ignite/odbc/config/configuration.h +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/config/configuration.h @@ -160,12 +160,19 @@ namespace ignite * * @return Server port. */ - uint16_t GetPort() const + uint16_t GetTcpPort() const { return endPoint.port; } /** + * Set server port. + * + * @param port Server port. + */ + void SetTcpPort(uint16_t port); + + /** * Get DSN. * * @return Data Source Name. @@ -176,6 +183,16 @@ namespace ignite } /** + * Set DSN. + * + * @param dsn Data Source Name. + */ + void SetDsn(const std::string& dsn) + { + arguments[Key::dsn] = dsn; + } + + /** * Get Driver. * * @return Driver name. @@ -196,6 +213,16 @@ namespace ignite } /** + * Set server host. + * + * @param server Server host. + */ + void SetHost(const std::string& server) + { + arguments[Key::server] = server; + } + + /** * Get cache. * * @return Cache name. @@ -206,6 +233,16 @@ namespace ignite } /** + * Set cache. + * + * @param cache Cache name. + */ + void SetCache(const std::string& cache) + { + arguments[Key::cache] = cache; + } + + /** * Get address. * * @return Address. @@ -216,6 +253,16 @@ namespace ignite } /** + * Set address. + * + * @param address Address. + */ + void SetAddress(const std::string& address) + { + arguments[Key::address] = address; + } + + /** * Check distributed joins flag. * * @return True if distributed joins are enabled. @@ -226,6 +273,16 @@ namespace ignite } /** + * Set distributed joins. + * + * @param val Value to set. + */ + void SetDistributedJoins(bool val) + { + SetBoolValue(Key::distributedJoins, val); + } + + /** * Check enforce join order flag. * * @return True if enforcing of join order is enabled. @@ -236,6 +293,26 @@ namespace ignite } /** + * Set enforce joins. + * + * @param val Value to set. + */ + void SetEnforceJoinOrder(bool val) + { + SetBoolValue(Key::enforceJoinOrder, val); + } + + /** + * Get argument map. + * + * @return Argument map. + */ + const ArgumentMap& GetMap() const + { + return arguments; + } + + /** * Get protocol version. * * @return Protocol version. @@ -243,6 +320,13 @@ namespace ignite ProtocolVersion GetProtocolVersion() const; /** + * Set protocol version. + * + * @param version Version to set. + */ + void SetProtocolVersion(const std::string& version); + + /** * Get string value from the config. * * @param key Configuration key. @@ -269,6 +353,13 @@ namespace ignite */ bool GetBoolValue(const std::string& key, bool dflt) const; + /** + * Set bool value to the config. + * + * @param key Configuration key. + * @param val Value to set. + */ + void SetBoolValue(const std::string& key, bool val); private: /** * Parse connect string into key-value storage. http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h index bfb4f4c..670e0aa 100644 --- a/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/diagnostic/diagnostic_record.h @@ -84,7 +84,7 @@ namespace ignite * * @return An informational message on the error or warning. */ - const std::string& GetMessage() const; + const std::string& GetMessageText() const; /** * Get connection name. http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/include/ignite/odbc/dsn_config.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/dsn_config.h b/modules/platforms/cpp/odbc/include/ignite/odbc/dsn_config.h new file mode 100644 index 0000000..dbad9b5 --- /dev/null +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/dsn_config.h @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _IGNITE_ODBC_DSN_CONFIG +#define _IGNITE_ODBC_DSN_CONFIG + +#include "ignite/odbc/config/configuration.h" + +namespace ignite +{ + namespace odbc + { + /** + * Extract last setup error and throw it like IgniteError. + */ + void ThrowLastSetupError(); + + /** + * Add new string to the DSN file. + * + * @param dsn DSN name. + * @param key Key. + * @param value Value. + */ + void WriteDsnString(const char* dsn, const char* key, const char* value); + + /** + * Get string from the DSN file. + * + * @param dsn DSN name. + * @param key Key. + * @param dflt Default value. + * @return Value. + */ + std::string ReadDsnString(const char* dsn, const char* key, const char* dflt); + + /** + * Read DSN to fill the configuration. + * + * @param dsn DSN name. + * @param config Configuration. + */ + void ReadDsnConfiguration(const char* dsn, config::Configuration& config); + } +} + +#endif //_IGNITE_ODBC_DSN_CONFIG \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/include/ignite/odbc/protocol_version.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/protocol_version.h b/modules/platforms/cpp/odbc/include/ignite/odbc/protocol_version.h index 747d78d..d3d288e 100644 --- a/modules/platforms/cpp/odbc/include/ignite/odbc/protocol_version.h +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/protocol_version.h @@ -47,6 +47,13 @@ namespace ignite static const ProtocolVersion VERSION_UNKNOWN; /** + * Get string to version map. + * + * @return String to version map. + */ + static const StringToVersionMap& GetMap(); + + /** * Get current version. * * @return Current version. @@ -86,6 +93,13 @@ namespace ignite bool IsUnknown() const; /** + * Check if the distributed joins supported. + * + * @retuen True if the distributed joins supported. + */ + bool IsDistributedJoinsSupported() const; + + /** * Comparison operator. * * @param val1 First value. @@ -152,10 +166,12 @@ namespace ignite * * @param major Major version. * @param minor Minor version. - * @param maintenance Maintenance version. + * @param revision Revision. * @return Int value for the version. */ - static int64_t MakeVersion(uint16_t major, uint16_t minor, uint16_t maintenance); + static int64_t MakeVersion(uint16_t major, uint16_t minor, uint16_t revision); + + ProtocolVersion(); /** String to version map. */ static const StringToVersionMap stringToVersionMap; http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/include/ignite/odbc/system/odbc_constants.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/system/odbc_constants.h b/modules/platforms/cpp/odbc/include/ignite/odbc/system/odbc_constants.h index 60a6552..ecd1a55 100644 --- a/modules/platforms/cpp/odbc/include/ignite/odbc/system/odbc_constants.h +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/system/odbc_constants.h @@ -27,10 +27,6 @@ # undef min #endif // min -#ifdef GetMessage -# undef GetMessage -#endif // GetMessage - #endif //_WIN32 #define ODBCVER 0x0380 http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h b/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h new file mode 100644 index 0000000..d2cb569 --- /dev/null +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/system/ui/dsn_configuration_window.h @@ -0,0 +1,152 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _IGNITE_ODBC_SYSTEM_UI_DSN_CONFIGURATION_WINDOW +#define _IGNITE_ODBC_SYSTEM_UI_DSN_CONFIGURATION_WINDOW + +#include "ignite/odbc/config/configuration.h" +#include "ignite/odbc/system/ui/custom_window.h" + +namespace ignite +{ + namespace odbc + { + namespace system + { + namespace ui + { + /** + * DSN configuration window class. + */ + class DsnConfigurationWindow : public CustomWindow + { + /** + * Children windows ids. + */ + enum ChildId + { + ID_CONNECTION_SETTINGS_GROUP_BOX, + ID_NAME_EDIT, + ID_NAME_LABEL, + ID_ADDRESS_EDIT, + ID_ADDRESS_LABEL, + ID_CACHE_EDIT, + ID_CACHE_LABEL, + ID_DISTRIBUTED_JOINS_CHECK_BOX, + ID_ENFORCE_JOIN_ORDER_CHECK_BOX, + ID_PROTOCOL_VERSION_LABEL, + ID_PROTOCOL_VERSION_COMBO_BOX, + ID_OK_BUTTON, + ID_CANCEL_BUTTON + }; + + public: + /** + * Constructor. + * + * @param parent Parent window handle. + */ + explicit DsnConfigurationWindow(Window* parent, config::Configuration& config); + + /** + * Destructor. + */ + virtual ~DsnConfigurationWindow(); + + /** + * Create window in the center of the parent window. + */ + void Create(); + + /** + * @copedoc ignite::odbc::system::ui::CustomWindow::OnCreate + */ + virtual void OnCreate(); + + /** + * @copedoc ignite::odbc::system::ui::CustomWindow::OnMessage + */ + virtual bool OnMessage(UINT msg, WPARAM wParam, LPARAM lParam); + + private: + IGNITE_NO_COPY_ASSIGNMENT(DsnConfigurationWindow) + + /** + * Retrieves current values from the children and stores + * them to the specified configuration. + * + * @param cfg Configuration. + */ + void RetrieveParameters(config::Configuration& cfg) const; + + /** Window width. */ + int width; + + /** Window height. */ + int height; + + /** Connection settings group box. */ + std::auto_ptr<Window> connectionSettingsGroupBox; + + /** DSN name edit field label. */ + std::auto_ptr<Window> nameLabel; + + /** DSN name edit field. */ + std::auto_ptr<Window> nameEdit; + + /** DSN address edit field label. */ + std::auto_ptr<Window> addressLabel; + + /** DSN address edit field. */ + std::auto_ptr<Window> addressEdit; + + /** DSN cache edit field label. */ + std::auto_ptr<Window> cacheLabel; + + /** DSN cache edit field. */ + std::auto_ptr<Window> cacheEdit; + + /** Distributed joins CheckBox. */ + std::auto_ptr<Window> distributedJoinsCheckBox; + + /** Enforce join order CheckBox. */ + std::auto_ptr<Window> enforceJoinOrderCheckBox; + + /** Protocol version edit field. */ + std::auto_ptr<Window> protocolVersionLabel; + + /** Protocol verion ComboBox. */ + std::auto_ptr<Window> protocolVersionComboBox; + + /** Ok button. */ + std::auto_ptr<Window> okButton; + + /** Cancel button. */ + std::auto_ptr<Window> cancelButton; + + /** Configuration. */ + config::Configuration& config; + + /** Flag indicating whether OK option was selected. */ + bool accepted; + }; + } + } + } +} + +#endif //_IGNITE_ODBC_SYSTEM_UI_DSN_CONFIGURATION_WINDOW \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/custom_window.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/custom_window.h b/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/custom_window.h new file mode 100644 index 0000000..1502c07 --- /dev/null +++ b/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/custom_window.h @@ -0,0 +1,189 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _IGNITE_ODBC_SYSTEM_UI_CUSTOM_WINDOW +#define _IGNITE_ODBC_SYSTEM_UI_CUSTOM_WINDOW + +#include "ignite/odbc/system/ui/window.h" + +namespace ignite +{ + namespace odbc + { + namespace system + { + namespace ui + { + /** + * Application execution result. + */ + enum Result + { + RESULT_OK, + RESULT_CANCEL + }; + + /** + * Process UI messages in current thread. + * Blocks until quit message has been received. + * + * @param window Main window. + * @return Application execution result. + */ + Result ProcessMessages(Window& window); + + /** + * Window class. + */ + class CustomWindow : public Window + { + public: + /** + * Constructor. + * + * @param parent Parent window. + * @param className Window class name. + * @param title Window title. + * @param callback Event processing function. + */ + CustomWindow(Window* parent, const char* className, const char* title); + + /** + * Destructor. + */ + virtual ~CustomWindow(); + + /** + * Callback which is called upon receiving new message. + * Pure virtual. Should be defined by user. + * + * @param msg Message. + * @param wParam Word-sized parameter. + * @param lParam Long parameter. + * @return Should return true if the message has been + * processed by the handler and false otherwise. + */ + virtual bool OnMessage(UINT msg, WPARAM wParam, LPARAM lParam) = 0; + + /** + * Callback that is called upon window creation. + */ + virtual void OnCreate() = 0; + + /** + * Create child group box window. + * + * @param posX Position by X coordinate. + * @param posY Position by Y coordinate. + * @param sizeX Size by X coordinate. + * @param sizeY Size by Y coordinate. + * @param title Title. + * @param id ID to be assigned to the created window. + * @return Auto pointer containing new window. + */ + std::auto_ptr<Window> CreateGroupBox(int posX, int posY, + int sizeX, int sizeY, const char* title, int id); + + /** + * Create child label window. + * + * @param posX Position by X coordinate. + * @param posY Position by Y coordinate. + * @param sizeX Size by X coordinate. + * @param sizeY Size by Y coordinate. + * @param title Title. + * @param id ID to be assigned to the created window. + * @return Auto pointer containing new window. + */ + std::auto_ptr<Window> CreateLabel(int posX, int posY, + int sizeX, int sizeY, const char* title, int id); + + /** + * Create child Edit window. + * + * @param posX Position by X coordinate. + * @param posY Position by Y coordinate. + * @param sizeX Size by X coordinate. + * @param sizeY Size by Y coordinate. + * @param title Title. + * @param id ID to be assigned to the created window. + * @return Auto pointer containing new window. + */ + std::auto_ptr<Window> CreateEdit(int posX, int posY, + int sizeX, int sizeY, const char* title, int id, int style = 0); + + /** + * Create child button window. + * + * @param posX Position by X coordinate. + * @param posY Position by Y coordinate. + * @param sizeX Size by X coordinate. + * @param sizeY Size by Y coordinate. + * @param title Title. + * @param id ID to be assigned to the created window. + * @return Auto pointer containing new window. + */ + std::auto_ptr<Window> CreateButton(int posX, int posY, + int sizeX, int sizeY, const char* title, int id); + + /** + * Create child CheckBox window. + * + * @param posX Position by X coordinate. + * @param posY Position by Y coordinate. + * @param sizeX Size by X coordinate. + * @param sizeY Size by Y coordinate. + * @param title Title. + * @param id ID to be assigned to the created window. + * @return Auto pointer containing new window. + */ + std::auto_ptr<Window> CreateCheckBox(int posX, int posY, + int sizeX, int sizeY, const char* title, int id, bool state); + + /** + * Create child ComboBox window. + * + * @param posX Position by X coordinate. + * @param posY Position by Y coordinate. + * @param sizeX Size by X coordinate. + * @param sizeY Size by Y coordinate. + * @param title Title. + * @param id ID to be assigned to the created window. + * @return Auto pointer containing new window. + */ + std::auto_ptr<Window> CreateComboBox(int posX, int posY, + int sizeX, int sizeY, const char* title, int id); + private: + IGNITE_NO_COPY_ASSIGNMENT(CustomWindow) + + /** + * Static callback. + * + * @param hwnd Window handle. + * @param msg Message. + * @param wParam Word-sized parameter. + * @param lParam Long parameter. + * @return Operation result. + */ + static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + }; + } + } + } +} + +#endif //_IGNITE_ODBC_SYSTEM_UI_CUSTOM_WINDOW \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/window.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/window.h b/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/window.h new file mode 100644 index 0000000..32a54b2 --- /dev/null +++ b/modules/platforms/cpp/odbc/os/win/include/ignite/odbc/system/ui/window.h @@ -0,0 +1,201 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _IGNITE_ODBC_SYSTEM_UI_WINDOW +#define _IGNITE_ODBC_SYSTEM_UI_WINDOW + +#include "ignite/odbc/utility.h" +#include "ignite/odbc/system/odbc_constants.h" + +namespace ignite +{ + namespace odbc + { + namespace system + { + namespace ui + { + /** + * Get handle for the current module. + * + * @return Handle for the current module. + */ + HINSTANCE GetHInstance(); + + /** + * Window class. + */ + class Window + { + public: + /** + * Constructor for a new window that is going to be created. + * + * @param parent Parent window handle. + * @param className Window class name. + * @param title Window title. + * @param callback Event processing function. + */ + Window(Window* parent, const char* className, const char* title); + + /** + * Constructor for the existing window. + * + * @param handle Window handle. + */ + Window(HWND handle); + + /** + * Destructor. + */ + virtual ~Window(); + + /** + * Create window. + * + * @param style Window style. + * @param posX Window x position. + * @param posY Window y position. + * @param width Window width. + * @param height Window height. + * @param id ID for child window. + */ + void Create(DWORD style, int posX, int posY, int width, int height, int id); + + /** + * Show window. + */ + void Show(); + + /** + * Update window. + */ + void Update(); + + /** + * Destroy window. + */ + void Destroy(); + + /** + * Get window handle. + * + * @return Window handle. + */ + HWND GetHandle() const + { + return handle; + } + + /** + * Get window text. + * + * @param text Text. + */ + void GetText(std::string& text) const; + + /** + * Set window text. + * + * @param text Text. + */ + void SetText(const std::string& text) const; + + /** + * Get CheckBox state. + * + * @param True if checked. + */ + bool IsChecked() const; + + /** + * Set CheckBox state. + * + * @param state True if checked. + */ + void SetChecked(bool state); + + /** + * Add string. + * + * @param str String. + */ + void AddString(const std::string& str); + + /** + * Set current ComboBox selection. + * + * @param idx List index. + */ + void SetSelection(int idx); + + /** + * Get current ComboBox selection. + * + * @return idx List index. + */ + int GetSelection() const; + + /** + * Set enabled. + * + * @param enabled Enable flag. + */ + void SetEnabled(bool enabled); + + /** + * Check if the window is enabled. + * + * @return True if enabled. + */ + bool IsEnabled() const; + + protected: + /** + * Set window handle. + * + * @param value Window handle. + */ + void SetHandle(HWND value) + { + handle = value; + } + + /** Window class name. */ + std::string className; + + /** Window title. */ + std::string title; + + /** Window handle. */ + HWND handle; + + /** Specifies whether window has been created by the thread and needs destruction. */ + bool created; + + /** Window parent. */ + Window* parent; + + private: + IGNITE_NO_COPY_ASSIGNMENT(Window) + }; + } + } + } +} + +#endif //_IGNITE_ODBC_SYSTEM_UI_WINDOW \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/os/win/src/system/ui/custom_window.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/os/win/src/system/ui/custom_window.cpp b/modules/platforms/cpp/odbc/os/win/src/system/ui/custom_window.cpp new file mode 100644 index 0000000..1e855a1 --- /dev/null +++ b/modules/platforms/cpp/odbc/os/win/src/system/ui/custom_window.cpp @@ -0,0 +1,184 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <Windowsx.h> + +#include "ignite/odbc/system/ui/custom_window.h" + +namespace ignite +{ + namespace odbc + { + namespace system + { + namespace ui + { + Result ProcessMessages(Window& window) + { + MSG msg; + + while (GetMessage(&msg, NULL, 0, 0) > 0) + { + if (!IsDialogMessage(window.GetHandle(), &msg)) + { + TranslateMessage(&msg); + + DispatchMessage(&msg); + } + } + + return static_cast<Result>(msg.wParam); + } + + LRESULT CALLBACK CustomWindow::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + CustomWindow* window = reinterpret_cast<CustomWindow*>(GetWindowLongPtr(hwnd, GWLP_USERDATA)); + + switch (msg) + { + case WM_NCCREATE: + { + _ASSERT(lParam != NULL); + + CREATESTRUCT* createStruct = reinterpret_cast<CREATESTRUCT*>(lParam); + + LONG_PTR longSelfPtr = reinterpret_cast<LONG_PTR>(createStruct->lpCreateParams); + + SetWindowLongPtr(hwnd, GWLP_USERDATA, longSelfPtr); + + return DefWindowProc(hwnd, msg, wParam, lParam); + } + + case WM_CREATE: + { + _ASSERT(window != NULL); + + window->SetHandle(hwnd); + + window->OnCreate(); + + return 0; + } + + default: + break; + } + + if (window && window->OnMessage(msg, wParam, lParam)) + return 0; + + return DefWindowProc(hwnd, msg, wParam, lParam); + } + + CustomWindow::CustomWindow(Window* parent, const char* className, const char* title) : + Window(parent, className, title) + { + WNDCLASS wcx; + + wcx.style = CS_HREDRAW | CS_VREDRAW; + wcx.lpfnWndProc = WndProc; + wcx.cbClsExtra = 0; + wcx.cbWndExtra = 0; + wcx.hInstance = GetHInstance(); + wcx.hIcon = NULL; + wcx.hCursor = LoadCursor(NULL, IDC_ARROW); + wcx.hbrBackground = (HBRUSH)COLOR_WINDOW; + wcx.lpszMenuName = NULL; + wcx.lpszClassName = className; + + + if (!RegisterClass(&wcx)) + { + std::stringstream buf; + + buf << "Can not register window class, error code: " << GetLastError(); + + throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, buf.str().c_str()); + } + } + + CustomWindow::~CustomWindow() + { + UnregisterClass(className.c_str(), GetHInstance()); + } + + std::auto_ptr<Window> CustomWindow::CreateGroupBox(int posX, int posY, + int sizeX, int sizeY, const char* title, int id) + { + std::auto_ptr<Window> child(new Window(this, "Button", title)); + + child->Create(WS_CHILD | WS_VISIBLE | BS_GROUPBOX, posX, posY, sizeX, sizeY, id); + + return child; + } + + std::auto_ptr<Window> CustomWindow::CreateLabel(int posX, int posY, + int sizeX, int sizeY, const char* title, int id) + { + std::auto_ptr<Window> child(new Window(this, "Static", title)); + + child->Create(WS_CHILD | WS_VISIBLE, posX, posY, sizeX, sizeY, id); + + return child; + } + + std::auto_ptr<Window> CustomWindow::CreateEdit(int posX, int posY, + int sizeX, int sizeY, const char* title, int id, int style) + { + std::auto_ptr<Window> child(new Window(this, "Edit", title)); + + child->Create(WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL | WS_TABSTOP | style, + posX, posY, sizeX, sizeY, id); + + return child; + } + + std::auto_ptr<Window> CustomWindow::CreateButton(int posX, int posY, + int sizeX, int sizeY, const char* title, int id) + { + std::auto_ptr<Window> child(new Window(this, "Button", title)); + + child->Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP, posX, posY, sizeX, sizeY, id); + + return child; + } + + std::auto_ptr<Window> CustomWindow::CreateCheckBox(int posX, int posY, + int sizeX, int sizeY, const char* title, int id, bool state) + { + std::auto_ptr<Window> child(new Window(this, "Button", title)); + + child->Create(WS_CHILD | WS_VISIBLE | BS_CHECKBOX, posX, posY, sizeX, sizeY, id); + + child->SetChecked(state); + + return child; + } + + std::auto_ptr<Window> CustomWindow::CreateComboBox(int posX, int posY, + int sizeX, int sizeY, const char * title, int id) + { + std::auto_ptr<Window> child(new Window(this, "Combobox", title)); + + child->Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST, posX, posY, sizeX, sizeY, id); + + return child; + } + } + } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp new file mode 100644 index 0000000..663333a --- /dev/null +++ b/modules/platforms/cpp/odbc/os/win/src/system/ui/dsn_configuration_window.cpp @@ -0,0 +1,305 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <Windowsx.h> + +#include "ignite/odbc/system/ui/dsn_configuration_window.h" + +namespace ignite +{ + namespace odbc + { + namespace system + { + namespace ui + { + DsnConfigurationWindow::DsnConfigurationWindow(Window* parent, config::Configuration& config): + CustomWindow(parent, "IgniteConfigureDsn", "Configure Apache Ignite DSN"), + width(360), + height(230), + connectionSettingsGroupBox(), + nameLabel(), + nameEdit(), + addressLabel(), + addressEdit(), + cacheLabel(), + cacheEdit(), + distributedJoinsCheckBox(), + enforceJoinOrderCheckBox(), + protocolVersionLabel(), + protocolVersionComboBox(), + okButton(), + cancelButton(), + config(config), + accepted(false) + { + // No-op. + } + + DsnConfigurationWindow::~DsnConfigurationWindow() + { + // No-op. + } + + void DsnConfigurationWindow::Create() + { + // Finding out parent position. + RECT parentRect; + GetWindowRect(parent->GetHandle(), &parentRect); + + // Positioning window to the center of parent window. + const int posX = parentRect.left + (parentRect.right - parentRect.left - width) / 2; + const int posY = parentRect.top + (parentRect.bottom - parentRect.top - height) / 2; + + RECT desiredRect = {posX, posY, posX + width, posY + height}; + AdjustWindowRect(&desiredRect, WS_BORDER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, FALSE); + + Window::Create(WS_OVERLAPPED | WS_SYSMENU, desiredRect.left, desiredRect.top, + desiredRect.right - desiredRect.left, desiredRect.bottom - desiredRect.top, 0); + + if (!handle) + { + std::stringstream buf; + + buf << "Can not create window, error code: " << GetLastError(); + + throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, buf.str().c_str()); + } + } + + void DsnConfigurationWindow::OnCreate() + { + int margin = 10; + int interval = 10; + + int labelSizeX = 80; + int labelPosX = margin + interval; + + int editSizeX = width - labelSizeX - 2 * margin - 3 * interval; + int editPosX = margin + labelSizeX + 2 * interval; + + int rowSize = 20; + int rowPos = margin + 2 * interval; + + int checkBoxSize = (editSizeX - interval) / 2; + + int sectionBegin = margin; + + const char* val = config.GetDsn().c_str(); + nameLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize, "DSN name:", ID_NAME_LABEL); + nameEdit = CreateEdit(editPosX, rowPos, editSizeX, rowSize, val, ID_NAME_EDIT); + + rowPos += interval + rowSize; + + val = config.GetAddress().c_str(); + addressLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize, "Address:", ID_ADDRESS_LABEL); + addressEdit = CreateEdit(editPosX, rowPos, editSizeX, rowSize, val, ID_ADDRESS_EDIT); + + rowPos += interval + rowSize; + + val = config.GetCache().c_str(); + cacheLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize, "Cache name:", ID_CACHE_LABEL); + cacheEdit = CreateEdit(editPosX, rowPos, editSizeX, rowSize, val, ID_CACHE_EDIT); + + rowPos += interval + rowSize; + + protocolVersionLabel = CreateLabel(labelPosX, rowPos, labelSizeX, rowSize, + "Protocol version:", ID_PROTOCOL_VERSION_LABEL); + protocolVersionComboBox = CreateComboBox(editPosX, rowPos, editSizeX, rowSize, + "Protocol version", ID_PROTOCOL_VERSION_COMBO_BOX); + + int id = 0; + + const ProtocolVersion::StringToVersionMap& versionMap = ProtocolVersion::GetMap(); + + ProtocolVersion::StringToVersionMap::const_iterator it; + for (it = versionMap.begin(); it != versionMap.end(); ++it) + { + protocolVersionComboBox->AddString(it->first); + + if (it->second == config.GetProtocolVersion()) + protocolVersionComboBox->SetSelection(id); + + ++id; + } + + rowPos += interval + rowSize; + + distributedJoinsCheckBox = CreateCheckBox(editPosX, rowPos, checkBoxSize, rowSize, + "Distributed Joins", ID_DISTRIBUTED_JOINS_CHECK_BOX, config.IsDistributedJoins()); + + enforceJoinOrderCheckBox = CreateCheckBox(editPosX + checkBoxSize + interval, rowPos, checkBoxSize, + rowSize, "Enforce Join Order", ID_ENFORCE_JOIN_ORDER_CHECK_BOX, config.IsEnforceJoinOrder()); + + if (!config.GetProtocolVersion().IsDistributedJoinsSupported()) + { + distributedJoinsCheckBox->SetEnabled(false); + enforceJoinOrderCheckBox->SetEnabled(false); + } + + rowPos += interval * 2 + rowSize; + + connectionSettingsGroupBox = CreateGroupBox(margin, sectionBegin, width - 2 * margin, + rowPos - interval - sectionBegin, "Connection settings", ID_CONNECTION_SETTINGS_GROUP_BOX); + + int buttonSizeX = 80; + int cancelPosX = width - margin - buttonSizeX; + int okPosX = cancelPosX - interval - buttonSizeX; + + rowSize = 25; + + okButton = CreateButton(okPosX, rowPos, buttonSizeX, rowSize, "Ok", ID_OK_BUTTON); + cancelButton = CreateButton(cancelPosX, rowPos, buttonSizeX, rowSize, "Cancel", ID_CANCEL_BUTTON); + } + + bool DsnConfigurationWindow::OnMessage(UINT msg, WPARAM wParam, LPARAM lParam) + { + switch (msg) + { + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case ID_OK_BUTTON: + { + try + { + RetrieveParameters(config); + + accepted = true; + + PostMessage(GetHandle(), WM_CLOSE, 0, 0); + } + catch (IgniteError& err) + { + MessageBox(NULL, err.GetText(), "Error!", MB_ICONEXCLAMATION | MB_OK); + } + + break; + } + + case ID_PROTOCOL_VERSION_COMBO_BOX: + { + if (HIWORD(wParam) == CBN_SELCHANGE) + { + std::string text; + + protocolVersionComboBox->GetText(text); + + ProtocolVersion version = ProtocolVersion::FromString(text); + + if (!version.IsUnknown() && !version.IsDistributedJoinsSupported()) + { + distributedJoinsCheckBox->SetEnabled(false); + enforceJoinOrderCheckBox->SetEnabled(false); + } + else + { + distributedJoinsCheckBox->SetEnabled(true); + enforceJoinOrderCheckBox->SetEnabled(true); + } + } + + break; + } + + case IDCANCEL: + case ID_CANCEL_BUTTON: + { + PostMessage(GetHandle(), WM_CLOSE, 0, 0); + + break; + } + + case ID_DISTRIBUTED_JOINS_CHECK_BOX: + { + distributedJoinsCheckBox->SetChecked(!distributedJoinsCheckBox->IsChecked()); + + break; + } + + case ID_ENFORCE_JOIN_ORDER_CHECK_BOX: + { + enforceJoinOrderCheckBox->SetChecked(!enforceJoinOrderCheckBox->IsChecked()); + + break; + } + + default: + return false; + } + + break; + } + + case WM_DESTROY: + { + PostQuitMessage(accepted ? RESULT_OK : RESULT_CANCEL); + + break; + } + + default: + return false; + } + + return true; + } + + void DsnConfigurationWindow::RetrieveParameters(config::Configuration& cfg) const + { + std::string dsn; + std::string address; + std::string cache; + std::string version; + + bool distributedJoins; + bool enforceJoinOrder; + + nameEdit->GetText(dsn); + addressEdit->GetText(address); + cacheEdit->GetText(cache); + protocolVersionComboBox->GetText(version); + + common::StripSurroundingWhitespaces(address); + common::StripSurroundingWhitespaces(dsn); + + distributedJoins = distributedJoinsCheckBox->IsEnabled() && distributedJoinsCheckBox->IsChecked(); + enforceJoinOrder = enforceJoinOrderCheckBox->IsEnabled() && enforceJoinOrderCheckBox->IsChecked(); + + LOG_MSG("Retriving arguments:\n"); + LOG_MSG("DSN: %s\n", dsn.c_str()); + LOG_MSG("Address: %s\n", address.c_str()); + LOG_MSG("Cache: %s\n", cache.c_str()); + LOG_MSG("Protocol version: %s\n", version.c_str()); + LOG_MSG("Distributed Joins: %s\n", distributedJoins ? "true" : "false"); + LOG_MSG("Enforce Join Order: %s\n", enforceJoinOrder ? "true" : "false"); + + if (dsn.empty()) + throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, "DSN name can not be empty."); + + cfg.SetDsn(dsn); + cfg.SetAddress(address); + cfg.SetCache(cache); + cfg.SetProtocolVersion(version); + cfg.SetDistributedJoins(distributedJoins); + cfg.SetEnforceJoinOrder(enforceJoinOrder); + } + } + } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/os/win/src/system/ui/window.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/os/win/src/system/ui/window.cpp b/modules/platforms/cpp/odbc/os/win/src/system/ui/window.cpp new file mode 100644 index 0000000..1143f01 --- /dev/null +++ b/modules/platforms/cpp/odbc/os/win/src/system/ui/window.cpp @@ -0,0 +1,192 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <Windowsx.h> + +#include "ignite/odbc/system/ui/window.h" + +namespace ignite +{ + namespace odbc + { + namespace system + { + namespace ui + { + HINSTANCE GetHInstance() + { + HINSTANCE hInstance = GetModuleHandle(TARGET_MODULE_FULL_NAME); + + if (hInstance == NULL) + { + std::stringstream buf; + + buf << "Can not get hInstance for the module, error code: " << GetLastError(); + + throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, buf.str().c_str()); + } + + return hInstance; + } + + Window::Window(Window* parent, const char* className, const char* title) : + className(className), + title(title), + handle(NULL), + created(false), + parent(parent) + { + // No-op. + } + + Window::Window(HWND handle) : + className(), + title(), + handle(handle), + created(false), + parent(0) + { + // No-op. + } + + Window::~Window() + { + if (created) + Destroy(); + } + + void Window::Create(DWORD style, int posX, int posY, int width, int height, int id) + { + if (handle) + { + std::stringstream buf; + + buf << "Window already created, error code: " << GetLastError(); + + throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, buf.str().c_str()); + } + + handle = CreateWindow( + className.c_str(), + title.c_str(), + style, + posX, + posY, + width, + height, + parent ? parent->GetHandle() : NULL, + reinterpret_cast<HMENU>(id), + GetHInstance(), + this + ); + + if (!handle) + { + std::stringstream buf; + + buf << "Can not create window, error code: " << GetLastError(); + + throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, buf.str().c_str()); + } + + created = true; + + HGDIOBJ hfDefault = GetStockObject(DEFAULT_GUI_FONT); + + SendMessage(GetHandle(), WM_SETFONT, (WPARAM)hfDefault, MAKELPARAM(FALSE, 0)); + } + + void Window::Show() + { + ShowWindow(handle, SW_SHOW); + } + + void Window::Update() + { + UpdateWindow(handle); + } + + void Window::Destroy() + { + if (handle) + DestroyWindow(handle); + + handle = NULL; + } + + void Window::GetText(std::string& text) const + { + int len = GetWindowTextLength(handle); + + if (len <= 0) + { + text.clear(); + + return; + } + + text.resize(len + 1); + + if (!GetWindowText(handle, &text[0], len + 1)) + text.clear(); + + text.resize(len); + } + + void Window::SetText(const std::string& text) const + { + SNDMSG(handle, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(text.c_str())); + } + + bool Window::IsChecked() const + { + return Button_GetCheck(handle) == BST_CHECKED; + } + + void Window::SetChecked(bool state) + { + Button_SetCheck(handle, state ? BST_CHECKED : BST_UNCHECKED); + } + + void Window::AddString(const std::string & str) + { + SNDMSG(handle, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(str.c_str())); + } + + void Window::SetSelection(int idx) + { + SNDMSG(handle, CB_SETCURSEL, static_cast<WPARAM>(idx), 0); + } + + int Window::GetSelection() const + { + return static_cast<int>(SNDMSG(handle, CB_GETCURSEL, 0, 0)); + } + + void Window::SetEnabled(bool enabled) + { + EnableWindow(GetHandle(), enabled); + } + + bool Window::IsEnabled() const + { + return IsWindowEnabled(GetHandle()) != 0; + } + } + } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp b/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp new file mode 100644 index 0000000..f432a40 --- /dev/null +++ b/modules/platforms/cpp/odbc/os/win/src/system_dsn.cpp @@ -0,0 +1,218 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ignite/odbc/utility.h" +#include "ignite/odbc/system/odbc_constants.h" + +#include "ignite/odbc/dsn_config.h" +#include "ignite/odbc/system/ui/window.h" +#include "ignite/odbc/system/ui/dsn_configuration_window.h" + +using ignite::odbc::config::Configuration; + +/** + * Display configuration window for user to configure DSN. + * + * @param hwndParent Parent window handle. + * @param config Output configuration. + * @return True on success and false on fail. + */ +bool DisplayConfigureDsnWindow(HWND hwndParent, Configuration& config) +{ + using namespace ignite::odbc::system::ui; + + if (!hwndParent) + return false; + + try + { + Window parent(hwndParent); + + DsnConfigurationWindow window(&parent, config); + + window.Create(); + + window.Show(); + window.Update(); + + return ProcessMessages(window) == RESULT_OK; + } + catch (const ignite::IgniteError& err) + { + std::stringstream buf; + + buf << "Message: " << err.GetText() << ", Code: " << err.GetCode(); + + std::string message = buf.str(); + + MessageBox(NULL, message.c_str(), "Error!", MB_ICONEXCLAMATION | MB_OK); + + SQLPostInstallerError(err.GetCode(), err.GetText()); + } + + return false; +} + +/** + * Register DSN with specified configuration. + * + * @param config Configuration. + * @param driver Driver. + * @return True on success and false on fail. + */ +bool RegisterDsn(const Configuration& config, LPCSTR driver) +{ + using namespace ignite::odbc::config; + using ignite::common::LexicalCast; + + typedef Configuration::ArgumentMap ArgMap; + + const char* dsn = config.GetDsn().c_str(); + + try + { + if (!SQLWriteDSNToIni(dsn, driver)) + ignite::odbc::ThrowLastSetupError(); + + const ArgMap& map = config.GetMap(); + + std::set<std::string> ignore; + + ignore.insert(Configuration::Key::dsn); + ignore.insert(Configuration::Key::driver); + + for (ArgMap::const_iterator it = map.begin(); it != map.end(); ++it) + { + const std::string& key = it->first; + const std::string& value = it->second; + + if (ignore.find(key) != ignore.end()) + continue; + + ignite::odbc::WriteDsnString(dsn, key.c_str(), value.c_str()); + } + + return true; + } + catch (ignite::IgniteError& err) + { + MessageBox(NULL, err.GetText(), "Error!", MB_ICONEXCLAMATION | MB_OK); + + SQLPostInstallerError(err.GetCode(), err.GetText()); + } + + return false; +} + +/** + * Unregister specified DSN. + * + * @param dsn DSN name. + * @return True on success and false on fail. + */ +bool UnregisterDsn(const char* dsn) +{ + try + { + if (!SQLRemoveDSNFromIni(dsn)) + ignite::odbc::ThrowLastSetupError(); + + return true; + } + catch (ignite::IgniteError& err) + { + MessageBox(NULL, err.GetText(), "Error!", MB_ICONEXCLAMATION | MB_OK); + + SQLPostInstallerError(err.GetCode(), err.GetText()); + } + + return false; +} + +BOOL INSTAPI ConfigDSN(HWND hwndParent, WORD req, LPCSTR driver, LPCSTR attributes) +{ + using namespace ignite::odbc; + + LOG_MSG("ConfigDSN called\n"); + + Configuration config; + + LOG_MSG("Attributes: %s\n", attributes); + + config.FillFromConfigAttributes(attributes); + + if (!SQLValidDSN(config.GetDsn().c_str())) + return FALSE; + + LOG_MSG("Driver: %s\n", driver); + LOG_MSG("Attributes: %s\n", attributes); + + LOG_MSG("DSN: %s\n", config.GetDsn().c_str()); + + switch (req) + { + case ODBC_ADD_DSN: + { + LOG_MSG("ODBC_ADD_DSN\n"); + + if (!DisplayConfigureDsnWindow(hwndParent, config)) + return FALSE; + + if (!RegisterDsn(config, driver)) + return FALSE; + + break; + } + + case ODBC_CONFIG_DSN: + { + LOG_MSG("ODBC_CONFIG_DSN\n"); + + std::string dsn = config.GetDsn(); + + Configuration loaded(config); + + ReadDsnConfiguration(dsn.c_str(), loaded); + + if (!DisplayConfigureDsnWindow(hwndParent, loaded)) + return FALSE; + + if (!RegisterDsn(loaded, driver)) + return FALSE; + + if (loaded.GetDsn() != dsn && !UnregisterDsn(dsn.c_str())) + return FALSE; + + break; + } + + case ODBC_REMOVE_DSN: + { + LOG_MSG("ODBC_REMOVE_DSN\n"); + + if (!UnregisterDsn(config.GetDsn().c_str())) + return FALSE; + + break; + } + + default: + return FALSE; + } + + return TRUE; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj index 0e0f0d3..d48db21 100644 --- a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj +++ b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj @@ -93,8 +93,8 @@ <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <SDLCheck>false</SDLCheck> - <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;TARGET_MODULE_FULL_NAME="$(TargetFileName)";_DEBUG;ODBC_DEBUG;ODBC_LOG_PATH="D:\\odbc.log";%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> <GenerateDebugInformation>true</GenerateDebugInformation> @@ -107,8 +107,8 @@ <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <SDLCheck>false</SDLCheck> - <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;TARGET_MODULE_FULL_NAME="$(TargetFileName)";_DEBUG;ODBC_DEBUG;ODBC_LOG_PATH="D:\\odbc.log";%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> <GenerateDebugInformation>true</GenerateDebugInformation> @@ -123,8 +123,8 @@ <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <SDLCheck>false</SDLCheck> - <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;TARGET_MODULE_FULL_NAME="$(TargetFileName)";%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> <GenerateDebugInformation>true</GenerateDebugInformation> @@ -141,8 +141,8 @@ <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <SDLCheck>false</SDLCheck> - <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win\include;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;TARGET_MODULE_FULL_NAME="$(TargetFileName)";%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> <GenerateDebugInformation>true</GenerateDebugInformation> @@ -153,7 +153,11 @@ </Link> </ItemDefinitionGroup> <ItemGroup> + <ClCompile Include="..\..\os\win\src\system_dsn.cpp" /> <ClCompile Include="..\..\os\win\src\system\socket_client.cpp" /> + <ClCompile Include="..\..\os\win\src\system\ui\custom_window.cpp" /> + <ClCompile Include="..\..\os\win\src\system\ui\dsn_configuration_window.cpp" /> + <ClCompile Include="..\..\os\win\src\system\ui\window.cpp" /> <ClCompile Include="..\..\src\app\application_data_buffer.cpp" /> <ClCompile Include="..\..\src\app\parameter.cpp" /> <ClCompile Include="..\..\src\column.cpp" /> @@ -165,6 +169,7 @@ <ClCompile Include="..\..\src\diagnostic\diagnosable_adapter.cpp" /> <ClCompile Include="..\..\src\diagnostic\diagnostic_record.cpp" /> <ClCompile Include="..\..\src\diagnostic\diagnostic_record_storage.cpp" /> + <ClCompile Include="..\..\src\dsn_config.cpp" /> <ClCompile Include="..\..\src\entry_points.cpp" /> <ClCompile Include="..\..\src\environment.cpp" /> <ClCompile Include="..\..\src\meta\column_meta.cpp" /> @@ -201,6 +206,7 @@ <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnosable_adapter.h" /> <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnostic_record.h" /> <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnostic_record_storage.h" /> + <ClInclude Include="..\..\include\ignite\odbc\dsn_config.h" /> <ClInclude Include="..\..\include\ignite\odbc\environment.h" /> <ClInclude Include="..\..\include\ignite\odbc\message.h" /> <ClInclude Include="..\..\include\ignite\odbc\meta\column_meta.h" /> @@ -221,8 +227,11 @@ <ClInclude Include="..\..\include\ignite\odbc\statement.h" /> <ClInclude Include="..\..\include\ignite\odbc\system\odbc_constants.h" /> <ClInclude Include="..\..\include\ignite\odbc\system\socket_client.h" /> + <ClInclude Include="..\..\include\ignite\odbc\system\ui\dsn_configuration_window.h" /> <ClInclude Include="..\..\include\ignite\odbc\type_traits.h" /> <ClInclude Include="..\..\include\ignite\odbc\utility.h" /> + <ClInclude Include="..\..\os\win\include\ignite\odbc\system\ui\custom_window.h" /> + <ClInclude Include="..\..\os\win\include\ignite\odbc\system\ui\window.h" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\..\binary\project\vs\binary.vcxproj"> http://git-wip-us.apache.org/repos/asf/ignite/blob/60afa372/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters index 9caf483..58764e4 100644 --- a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters +++ b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters @@ -26,6 +26,9 @@ <Filter Include="Code\diagnostic"> <UniqueIdentifier>{df33e506-b5d8-423f-bcc5-1825242a3e28}</UniqueIdentifier> </Filter> + <Filter Include="Code\system\ui"> + <UniqueIdentifier>{ff144e89-0a10-42c3-97dd-d22bfdbc7abb}</UniqueIdentifier> + </Filter> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\src\odbc.cpp"> @@ -115,6 +118,21 @@ <ClCompile Include="..\..\src\entry_points.cpp"> <Filter>Code</Filter> </ClCompile> + <ClCompile Include="..\..\os\win\src\system\ui\window.cpp"> + <Filter>Code\system\ui</Filter> + </ClCompile> + <ClCompile Include="..\..\os\win\src\system\ui\custom_window.cpp"> + <Filter>Code\system\ui</Filter> + </ClCompile> + <ClCompile Include="..\..\os\win\src\system\ui\dsn_configuration_window.cpp"> + <Filter>Code\system\ui</Filter> + </ClCompile> + <ClCompile Include="..\..\os\win\src\system_dsn.cpp"> + <Filter>Code\system</Filter> + </ClCompile> + <ClCompile Include="..\..\src\dsn_config.cpp"> + <Filter>Code</Filter> + </ClCompile> <ClCompile Include="..\..\src\protocol_version.cpp"> <Filter>Code</Filter> </ClCompile> @@ -227,6 +245,18 @@ <ClInclude Include="..\..\include\ignite\odbc.h"> <Filter>Code</Filter> </ClInclude> + <ClInclude Include="..\..\os\win\include\ignite\odbc\system\ui\window.h"> + <Filter>Code\system\ui</Filter> + </ClInclude> + <ClInclude Include="..\..\os\win\include\ignite\odbc\system\ui\custom_window.h"> + <Filter>Code\system\ui</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\system\ui\dsn_configuration_window.h"> + <Filter>Code\system\ui</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\dsn_config.h"> + <Filter>Code</Filter> + </ClInclude> <ClInclude Include="..\..\include\ignite\odbc\protocol_version.h"> <Filter>Code</Filter> </ClInclude>
