MySQL Workbench  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tabview.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; version 2 of the
7  * License.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17  * 02110-1301 USA
18  */
19 #ifndef _MFORMS_TABVIEW_H_
20 #define _MFORMS_TABVIEW_H_
21 
22 #include <mforms/view.h>
23 
24 namespace mforms
25 {
26  class TabView;
27 
29  {
32  // performed programmatically only.
35  // and such). unclosable tabs
37  // and such). closable tabs
40  };
41 
42 
43 #ifndef DOXYGEN_SHOULD_SKIP_THIS
44 #ifndef SWIG
45  struct MFORMS_EXPORT TabViewImplPtrs
46  {
47  bool (*create)(TabView*,TabViewType);
48  void (*set_active_tab)(TabView*,int);
49  void (*set_tab_title)(TabView*,int,const std::string&);
50  int (*get_active_tab)(TabView*);
51  int (*add_page)(TabView*,View*,const std::string&);
52  void (*remove_page)(TabView*,View*);
53  };
54 #endif
55 #endif
56 
58  class MFORMS_EXPORT TabView : public View
59  {
60  TabViewImplPtrs *_tabview_impl;
61 
62  boost::signals2::signal<void ()> _signal_tab_changed;
63  boost::signals2::signal<bool (int)> _signal_tab_closing;
64  boost::signals2::signal<void (int)> _signal_tab_closed;
65 
66  public:
71 
73  void set_active_tab(int index);
75  int get_active_tab();
77  int add_page(View *page, const std::string& caption);
79  void remove_page(View *page);
80 
82  void set_tab_title(int page, const std::string& caption);
83 
85  int get_page_index(View *page);
87  View *get_page(int index);
88 
90  bool can_close_tab(int index);
91 
92 #ifndef SWIG
93 
97  boost::signals2::signal<void ()>* signal_tab_changed() { return &_signal_tab_changed; }
98 
100  boost::signals2::signal<bool (int)>* signal_tab_closing() { return &_signal_tab_closing; }
101 
103  boost::signals2::signal<void (int)>* signal_tab_closed() { return &_signal_tab_closed; }
104 #endif
105  };
106 };
107 
108 
109 #endif
boost::signals2::signal< void(int)> _signal_tab_closed
Definition: tabview.h:64
boost::signals2::signal< void()> _signal_tab_changed
Definition: tabview.h:62
WB style tab view (bottom hanging tabs on Win), unclosable tabs.
Definition: tabview.h:38
boost::signals2::signal< void()> * signal_tab_changed()
Signal emitted when the tab is switched by user.
Definition: tabview.h:97
WB style for tabbed documents (top standing tabs, sql editors.
Definition: tabview.h:34
#define MFORMS_EXPORT
Definition: base.h:33
boost::signals2::signal< bool(int)> _signal_tab_closing
Definition: tabview.h:63
WB style for tabbed documents (top standing tabs, sql editors.
Definition: tabview.h:36
WB main style tab view (top hanging tabs on Win), closable tabs.
Definition: tabview.h:33
TabViewType
Definition: tabview.h:28
TabViewImplPtrs * _tabview_impl
Definition: tabview.h:60
boost::signals2::signal< void(int)> * signal_tab_closed()
Callback called when a tab has been closed.
Definition: tabview.h:103
System style tab view without tabs. Switching tabs can then be.
Definition: tabview.h:31
boost::signals2::signal< bool(int)> * signal_tab_closing()
Callback called when a tab is about to close.
Definition: tabview.h:100
Sidebar palette selector style, unclosable tabs.
Definition: tabview.h:39
Normal tab views with tabs on top in the style used by the system.
Definition: tabview.h:30
A Notebook/Tabbed view.
Definition: tabview.h:58
MySQL Workbench 6.1 documentation