LUMIERA.clone/src/gui/panel/panel.hpp
Ichthyostega 670c670d55 style-adjustment: GUI indentation, naming and braces
over time, a specific Lumiera code writing style has emerged.
The GUI, as it stood, used somewhat different conventions,
which now have been aligned to the common standard.

Basically we use GNU style, with some adjustments for OO-programming,
we prefer CamelCase, and write TypeNames uppercase, variableNames lowercase
2015-05-29 04:44:58 +02:00

113 lines
3 KiB
C++

/*
PANEL.hpp - common base class for all docking panels
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
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; either version 2 of
the License, or (at your option) any later version.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef GUI_PANEL_PANEL_H
#define GUI_PANEL_PANEL_H
#include "gui/gtk-lumiera.hpp"
#include "gui/widget/panel-bar.hpp"
#include <gdlmm.h>
namespace gui {
namespace workspace {
class PanelManager;
}
namespace panel {
/**
* The base class for all dockable panels.
*/
class Panel
: public Gtk::VBox
{
protected:
/**
* @param panel_manager owner panel manager widget
* @param dock_item GdlDockItem that will host this panel
* @param long_name title of this panel
* @param stock_id ID of this panel
*/
Panel (workspace::PanelManager&
,Gdl::DockItem&
,const gchar* longName
,const gchar* stockID);
public:
~Panel();
/** @return pointer to the underlying GdlDockItem structure */
Gdl::DockItem& getDockItem();
/** Shows or hides the panel. */
void show(bool show = true);
bool is_shown() const;
void iconify();
bool is_iconified() const;
/** Locks or unlocks the panel against modifications */
void lock(bool show = true);
bool is_locked() const;
/** @return the owner */
workspace::PanelManager& getPanelManager();
/** fires when the dock item gets hidden. */
sigc::signal<void>& signal_hidePanel();
protected:
workspace::WorkspaceWindow& getWorkspaceWindow();
model::Project& getProject();
controller::Controller& getController();
private:
/** event handler when dockItem is hidden. */
void on_item_hidden();
protected:
/** The owner panel manager object. */
workspace::PanelManager& panelManager_;
/** owner dock item widget that will host the widgets in this panel. */
Gdl::DockItem& dockItem_;
/** signal that fires when the dock item is hidden. */
sigc::signal<void> hidePanelSignal_;
/** panel bar to attach to the panel grip.*/
widget::PanelBar panelBar_;
};
}}// namespace gui::panel
#endif /*GUI_PANEL_PANEL_H*/