[libgda-uimm] Add Login Class.
- From: José Alburquerque <jaalburqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda-uimm] Add Login Class.
- Date: Tue, 23 Feb 2010 21:37:11 +0000 (UTC)
commit a4b13820e1a4f141631004671b5974f9faa7880f
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Tue Feb 23 16:32:00 2010 -0500
Add Login Class.
* libgda-ui/libgda-uimm.h:
* libgda-ui/src/filelist.am:
* libgda-ui/src/login.ccg:
* libgda-ui/src/login.hg: Add new Login class.
* tools/m4/convert_libgda_uimm.m4: Add conversion for the
GdauiLoginMode enum.
* libgda-ui/src/combo.ccg:
* libgda-ui/src/combo.hg:
* libgda-ui/src/dataselector.ccg:
* libgda-ui/src/dataselector.hg: Use class forward declarations to
avoid including C header files in C++ header files (should speed up
application compilation). Added a couple of TODO's and made minor
const corrections in commented out code.
ChangeLog | 19 +++++++++++++
libgda-ui/libgda-uimm.h | 1 +
libgda-ui/src/combo.ccg | 1 +
libgda-ui/src/combo.hg | 14 +++++++++-
libgda-ui/src/dataselector.ccg | 2 +
libgda-ui/src/dataselector.hg | 14 ++++++++--
libgda-ui/src/filelist.am | 3 +-
libgda-ui/src/login.ccg | 30 +++++++++++++++++++++
libgda-ui/src/login.hg | 55 +++++++++++++++++++++++++++++++++++++++
tools/m4/convert_libgda_uimm.m4 | 2 +-
10 files changed, 135 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0da6d2a..11adf7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2010-02-23 José Alburquerque <jaalburqu svn gnome org>
+
+ Add Login Class.
+
+ * libgda-ui/libgda-uimm.h:
+ * libgda-ui/src/filelist.am:
+ * libgda-ui/src/login.ccg:
+ * libgda-ui/src/login.hg: Add new Login class.
+ * tools/m4/convert_libgda_uimm.m4: Add conversion for the
+ GdauiLoginMode enum.
+
+ * libgda-ui/src/combo.ccg:
+ * libgda-ui/src/combo.hg:
+ * libgda-ui/src/dataselector.ccg:
+ * libgda-ui/src/dataselector.hg: Use class forward declarations to
+ avoid including C header files in C++ header files (should speed up
+ application compilation). Added a couple of TODO's and made minor
+ const corrections in commented out code.
+
2010-02-21 José Alburquerque <jaalburqu svn gnome org>
Wrap DataSelector Interface.
diff --git a/libgda-ui/libgda-uimm.h b/libgda-ui/libgda-uimm.h
index a831847..c6fc693 100644
--- a/libgda-ui/libgda-uimm.h
+++ b/libgda-ui/libgda-uimm.h
@@ -22,5 +22,6 @@
#include <combo.h>
#include <dataselector.h>
+#include <login.h>
#endif /* _LIBGDA_UIMM_H */
diff --git a/libgda-ui/src/combo.ccg b/libgda-ui/src/combo.ccg
index 1e56919..3306858 100644
--- a/libgda-ui/src/combo.ccg
+++ b/libgda-ui/src/combo.ccg
@@ -18,6 +18,7 @@
*/
#include <libgda-ui/gdaui-combo.h>
+#include <libgdamm/datamodel.h>
namespace Gnome
{
diff --git a/libgda-ui/src/combo.hg b/libgda-ui/src/combo.hg
index 1d23e8b..0fa3561 100644
--- a/libgda-ui/src/combo.hg
+++ b/libgda-ui/src/combo.hg
@@ -18,7 +18,6 @@
*/
#include <gtkmm/combobox.h>
-#include <libgdamm/datamodel.h>
#include <libgda-uimm/dataselector.h>
_DEFS(libgda-uimm,libgda_ui)
@@ -27,6 +26,14 @@ _PINCLUDE(gtkmm/private/combobox_p.h)
namespace Gnome
{
+// Gnome::Gda class declartions.
+namespace Gda
+{
+
+class DataModel;
+
+}
+
namespace GdaUI
{
@@ -44,8 +51,13 @@ public:
_WRAP_METHOD_DOCS_ONLY(gdaui_combo_new_with_model)
_WRAP_CTOR(Combo(const Glib::RefPtr<Gnome::Gda::DataModel>& model, int n_cols, const Glib::ArrayHandle<int>& cols_index), gdaui_combo_new_with_model)
+ //TODO?: Combo(const Glib::RefPtr<Gnome::Gda::DataModel>& model, const Glib::ArrayHandle<int>& cols_index);
+
public:
_WRAP_METHOD(void set_model(const Glib::RefPtr<Gnome::Gda::DataModel>& model, int n_cols, const Glib::ArrayHandle<int>& cols_index), gdaui_combo_set_model)
+
+ //TODO?: void set_model(const Glib::RefPtr<Gnome::Gda::DataModel>& model, const Glib::ArrayHandle<int>& cols_index);
+
_WRAP_METHOD(void add_null(bool add_null), gdaui_combo_add_null)
_WRAP_METHOD(bool is_null_selected() const, gdaui_combo_is_null_selected)
diff --git a/libgda-ui/src/dataselector.ccg b/libgda-ui/src/dataselector.ccg
index 31d166a..9bf9b87 100644
--- a/libgda-ui/src/dataselector.ccg
+++ b/libgda-ui/src/dataselector.ccg
@@ -17,6 +17,8 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <libgdamm/datamodel.h>
+
namespace Gnome
{
diff --git a/libgda-ui/src/dataselector.hg b/libgda-ui/src/dataselector.hg
index f811908..ce71b2f 100644
--- a/libgda-ui/src/dataselector.hg
+++ b/libgda-ui/src/dataselector.hg
@@ -19,13 +19,21 @@
#include <libgda-ui/gdaui-data-selector.h>
#include <glibmm/interface.h>
-#include <libgdamm/datamodel.h>
_DEFS(libgda-uimm,libgda_ui)
namespace Gnome
{
+// Gnome::Gda class declarations.
+namespace Gda
+{
+
+class DataModel;
+class DataModelIter;
+
+}
+
namespace GdaUI
{
@@ -43,7 +51,7 @@ public:
//TODO: Docs say that the GArray* should be freed after use. Freeing the underlying data is possible with Glib::ArrayHandle<> but how should the GArray* be freed?
//#m4 _CONVERSION(`GArray*', `Glib::ArrayHandle<int>', `$2($3->data, $3->len, Glib::OWNERSHIP_DEEEP)')
- //_WRAP_METHOD(Glib::ArrayHandle<int> get_selected_rows(), gdaui_data_selector_get_selected_rows)
+ //_WRAP_METHOD(Glib::ArrayHandle<int> get_selected_rows() const, gdaui_data_selector_get_selected_rows)
_WRAP_METHOD(Glib::RefPtr<Gnome::Gda::DataModelIter> get_data_set(), gdaui_data_selector_get_data_set)
_WRAP_METHOD(Glib::RefPtr<const Gnome::Gda::DataModelIter> get_data_set() const, gdaui_data_selector_get_data_set, constversion)
@@ -59,7 +67,7 @@ public:
_WRAP_VFUNC(void set_model(const Glib::RefPtr<Gnome::Gda::DataModel>& model), "set_model")
//TODO: Wrapping GArray is difficult.
- //_WRAP_VFUNC(GArray* get_selected_rows(), "get_selected_rows")
+ //_WRAP_VFUNC(GArray* get_selected_rows() const, "get_selected_rows")
_WRAP_VFUNC(Glib::RefPtr<Gnome::Gda::DataModelIter> get_data_set() const, "get_data_set")
_WRAP_VFUNC(bool select_row(int row), "select_row")
diff --git a/libgda-ui/src/filelist.am b/libgda-ui/src/filelist.am
index cc4f615..34f8663 100644
--- a/libgda-ui/src/filelist.am
+++ b/libgda-ui/src/filelist.am
@@ -10,7 +10,8 @@ files_defs = \
files_hg = \
combo.hg \
- dataselector.hg
+ dataselector.hg \
+ login.hg
files_ccg = $(files_hg:.hg=.ccg)
diff --git a/libgda-ui/src/login.ccg b/libgda-ui/src/login.ccg
new file mode 100644
index 0000000..646b540
--- /dev/null
+++ b/libgda-ui/src/login.ccg
@@ -0,0 +1,30 @@
+/* login.cc
+ *
+ * Copyright (c) 2009 libgda-uimm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <libgda-ui/gdaui-enum-types.h>
+
+namespace Gnome
+{
+
+namespace GdaUI
+{
+
+} /* namespace GdaUI */
+
+} /* namespace Gnome */
diff --git a/libgda-ui/src/login.hg b/libgda-ui/src/login.hg
new file mode 100644
index 0000000..7483c57
--- /dev/null
+++ b/libgda-ui/src/login.hg
@@ -0,0 +1,55 @@
+/* login.h
+ *
+ * Copyright (c) 2009 libgda-uimm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <libgda/gda-config.h>
+#include <libgda-ui/gdaui-login.h>
+#include <gtkmm/box.h>
+
+_DEFS(libgda-uimm,libgda_ui)
+_PINCLUDE(gtkmm/private/box_p.h)
+
+namespace Gnome
+{
+
+namespace GdaUI
+{
+
+_WRAP_ENUM(LoginMode, GdauiLoginMode, s#UI_##)
+
+/** Login - Connection opening dialog.
+ */
+class Login :
+ public Gtk::VBox
+{
+ _CLASS_GTKOBJECT(Login, GdauiLogin, GDAUI_LOGIN, Gtk::VBox, GtkVBox)
+
+public:
+ _WRAP_METHOD_DOCS_ONLY(gdaui_login_new)
+ _WRAP_CTOR(Login(const Glib::ustring& dsn), gdaui_login_new)
+
+public:
+ _WRAP_METHOD(void set_mode(LoginMode mode), gdaui_login_set_mode)
+ _WRAP_METHOD(const GdaDsnInfo* get_connection_information(), gdaui_login_get_connection_information)
+ _WRAP_METHOD(void set_dsn(const Glib::ustring& dsn), gdaui_login_set_dsn)
+ _WRAP_METHOD(void set_connection_information(const GdaDsnInfo *cinfo), gdaui_login_set_connection_information)
+};
+
+} // namespace GdaUI
+
+} // namespace Gnome
diff --git a/tools/m4/convert_libgda_uimm.m4 b/tools/m4/convert_libgda_uimm.m4
index 8546517..fb66e61 100644
--- a/tools/m4/convert_libgda_uimm.m4
+++ b/tools/m4/convert_libgda_uimm.m4
@@ -1,7 +1,7 @@
dnl Copyright (c) 2009 The libgda-uimm Development Team
dnl Enums:
-_CONV_ENUM(Gda,ExampleEnum)
+_CONV_ENUM(Gdaui,LoginMode)
dnl DataModel:
_CONVERSION(`const Glib::RefPtr<Gnome::Gda::DataModel>&', `GdaDataModel*', `Glib::unwrap($3)')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]