1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
/*
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of the
* License.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef __DB_SQL_EDITOR_VIEW_H__
#define __DB_SQL_EDITOR_VIEW_H__
#include "mforms/toolbar.h"
#include "sqlide/wb_sql_editor_form.h"
#include "linux_utilities/gtk_helpers.h"
#include "linux_utilities/form_view_base.h"
#include "linux_utilities/notebook_dockingpoint.h"
#include "overview_panel.h"
//#include "gtk_helpers.h"
#include "active_label.h"
#include "sqlide_output_view.h"
#include <glib.h>
class SqlSnippetsView;
class ToolbarManager;
class QueryView;
//==============================================================================
//
//==============================================================================
class DbSqlEditorView : public Gtk::VBox, public FormViewBase
{
public:
DbSqlEditorView(SqlEditorForm::Ref editor_be);
static DbSqlEditorView *create(SqlEditorForm::Ref editor_be);
virtual ~DbSqlEditorView();
virtual void init();
virtual bool on_close();
virtual void dispose();
virtual bec::BaseEditor* get_be() { return NULL; }
virtual bec::UIForm *get_form() const { return _be.get(); }
virtual Gtk::Widget *get_panel() { return this; }
//virtual void toggle_sidebar();
virtual bool perform_command(const std::string &command);
SqlEditorForm::Ref be()
{
return _be;
}
void close_appview_tab(mforms::AppView *aview);
void output_text(const std::string &text, bool bring_to_front);
virtual bool close_focused_tab();
bec::GRTManager* grt_manager() {return _grtm;}
protected:
virtual void plugin_tab_added(PluginEditorBase *plugin);
private:
void polish();
void set_busy_tab(int);
void on_exec_sql_done();
void editor_page_switched(GtkNotebookPage *page, guint index);
void editor_page_reordered(Gtk::Widget *page, guint index);
void editor_page_added(Gtk::Widget *page, guint index);
void editor_page_removed(Gtk::Widget *page, guint index);
mforms::Menu *init_tab_menu(Gtk::Widget *w);
void tab_menu_handler(const std::string& action, ActiveLabel *sender, Gtk::Widget *widget);
void reenable_items_in_tab_menus();
void set_maximized_editor_mode(bool flag);
SqlEditorForm::Ref _be;
Gtk::HPaned _top_pane;
Gtk::HPaned _top_right_pane;
Gtk::VPaned _main_pane;
QueryOutputView _output;
Gtk::Widget *_side_palette;
sigc::connection _polish_conn;
sigc::connection _sig_restore_sidebar;
NotebookDockingPoint _dock_delegate;
mforms::DockingPoint *_dpoint;
ActiveLabel *_busy_tab;
const bool _right_aligned;
bool _editor_maximized;
};
#endif // __DB_SQL_EDITOR_VIEW_H__
|