Loading...
Searching...
No Matches
modularWidget.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_WIDGETS_MODULARWIDGET_H
#define BALL_VIEW_WIDGETS_MODULARWIDGET_H
#ifndef BALL_CONCEPT_EMBEDDABLE_H
# include <BALL/CONCEPT/embeddable.h>
#endif
#ifndef BALL_VIEW_KERNEL_CONNECTIONOBJECT_H
# include <BALL/VIEW/KERNEL/connectionObject.h>
#endif
#ifndef BALL_VIEW_KERNEL_UIOPERATIONMODE_H
# include <BALL/VIEW/KERNEL/UIOperationMode.h>
#endif
#include <QtGui/QKeySequence>
#include <QtWidgets/QToolBar>
class QObject;
class QMenuBar;
class QWidget;
class QAction;
namespace BALL
{
class INIFile;
class FragmentDB;
namespace VIEW
{
class Preferences;
class MainControl;
class BALL_VIEW_EXPORT ModularWidget
: public Embeddable,
public ConnectionObject
{
public:
BALL_EMBEDDABLE(ModularWidget,Embeddable)
BALL_CREATE(ModularWidget)
//@{
ModularWidget(const char* name = "<ModularWidget>");
ModularWidget(const ModularWidget& widget);
virtual ~ModularWidget();
virtual void destroy()
{ clear(); };
virtual void clear();
static void registerWidget(ModularWidget* mwidget);
virtual void initializeWidget(MainControl& main_control);
virtual void finalizeWidget(MainControl& main_control);
virtual bool canHandle(const String& /*fileformat*/) const { return false;}
virtual bool openFile(const String& /*filename*/) { return false;}
virtual void checkMenu(MainControl& main_control);
QAction* insertMenuEntry(Position parent_id, const QString& name, const QObject* receiver = 0,
const char* slot = 0, const String& description = "", QKeySequence accel = QKeySequence(),
const QString& menu_hint = QString(""),
UIOperationMode::OperationMode minimal_mode = UIOperationMode::MODE_ALL);
BALL_DEPRECATED void setMenuHelp(QAction* /* action */, const String& /* url */);
BALL_DEPRECATED virtual void registerForHelpSystem(const QObject* /* object */, const String& /* url */);
virtual void addToolBarEntries(QToolBar* main_tb);
void setIcon(QAction* action, const String& filename, bool add_to_main_toolbar = true);
virtual void initializePreferencesTab(Preferences& preferences);
virtual void finalizePreferencesTab(Preferences& preferences);
virtual void applyPreferences(){};
virtual void fetchPreferences(INIFile& inifile);
virtual void writePreferences(INIFile& inifile);
bool lockComposites();
bool unlockComposites();
MainControl* getMainControl() const;
virtual void setStatusbarText(const String& text, bool important = false);
virtual void setStatusbarText(const QString& text, bool important = false);
String getWorkingDir();
void setWorkingDir(const String& dir);
FragmentDB& getFragmentDB() const;
virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
void setWorkingDirFromFilename_(String filename);
BALL_DEPRECATED virtual void showHelp(const String& /* url */);
protected:
//_ id in the menubar entry "WINDOWS" for every widget
QAction* window_menu_entry_;
//_ should there be an entry to switch the window on and off?
bool show_window_enty_;
//_ should the widget be visible, if no config file entry exists?
bool default_visible_;
QList<QAction*> main_toolbar_actions_;
};
} // namespace VIEW
} // namespace BALL
#endif // BALL_VIEW_WIDGETS_MODULARWIDGET_H
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition COMMON/global.h:64
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
UIOperationMode.h
BALL::Embeddable::Embeddable
Embeddable(const String &identifier="<Embeddable>")
BALL::FragmentDB
Definition fragmentDB.h:45
BALL::INIFile
Definition INIFile.h:29
BALL::String
Definition string.h:57
BALL::VIEW::ConnectionObject::ConnectionObject
ConnectionObject()
BALL::VIEW::MainControl
Definition mainControl.h:118
BALL::VIEW::ModularWidget::initializePreferencesTab
virtual void initializePreferencesTab(Preferences &preferences)
BALL::VIEW::ModularWidget::checkMenu
virtual void checkMenu(MainControl &main_control)
BALL::VIEW::ModularWidget::setIcon
void setIcon(QAction *action, const String &filename, bool add_to_main_toolbar=true)
BALL::VIEW::ModularWidget::openFile
virtual bool openFile(const String &)
Definition modularWidget.h:146
BALL::VIEW::ModularWidget::finalizePreferencesTab
virtual void finalizePreferencesTab(Preferences &preferences)
BALL::VIEW::ModularWidget::addToolBarEntries
virtual void addToolBarEntries(QToolBar *main_tb)
BALL::VIEW::ModularWidget::canHandle
virtual bool canHandle(const String &) const
Definition modularWidget.h:140
BALL::VIEW::ModularWidget::initializeWidget
virtual void initializeWidget(MainControl &main_control)
BALL::VIEW::ModularWidget::fetchPreferences
virtual void fetchPreferences(INIFile &inifile)
BALL::VIEW::ModularWidget::getWorkingDir
String getWorkingDir()
Implemented for convenience.
BALL::VIEW::ModularWidget::applyPreferences
virtual void applyPreferences()
Definition modularWidget.h:223
BALL::VIEW::ModularWidget::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::VIEW::ModularWidget::main_toolbar_actions_
QList< QAction * > main_toolbar_actions_
Definition modularWidget.h:317
BALL::VIEW::ModularWidget::setStatusbarText
virtual void setStatusbarText(const QString &text, bool important=false)
BALL::VIEW::ModularWidget::setWorkingDir
void setWorkingDir(const String &dir)
Implemented for convenience.
BALL::VIEW::ModularWidget::show_window_enty_
bool show_window_enty_
Definition modularWidget.h:312
BALL::VIEW::ModularWidget::registerForHelpSystem
virtual BALL_DEPRECATED void registerForHelpSystem(const QObject *, const String &)
BALL::VIEW::ModularWidget::setWorkingDirFromFilename_
void setWorkingDirFromFilename_(String filename)
BALL::VIEW::ModularWidget::ModularWidget
ModularWidget(const char *name="<ModularWidget>")
BALL::VIEW::ModularWidget::window_menu_entry_
QAction * window_menu_entry_
Definition modularWidget.h:309
BALL::VIEW::ModularWidget::default_visible_
bool default_visible_
Definition modularWidget.h:315
BALL::VIEW::ModularWidget::setMenuHelp
BALL_DEPRECATED void setMenuHelp(QAction *, const String &)
BALL::VIEW::ModularWidget::finalizeWidget
virtual void finalizeWidget(MainControl &main_control)
BALL::VIEW::ModularWidget::getFragmentDB
FragmentDB & getFragmentDB() const
BALL::VIEW::ModularWidget::setStatusbarText
virtual void setStatusbarText(const String &text, bool important=false)
BALL::VIEW::ModularWidget::destroy
virtual void destroy()
Definition modularWidget.h:94
BALL::VIEW::ModularWidget::lockComposites
bool lockComposites()
BALL::VIEW::ModularWidget::unlockComposites
bool unlockComposites()
Unlock the Composites.
BALL::VIEW::ModularWidget::clear
virtual void clear()
BALL::VIEW::ModularWidget::showHelp
virtual BALL_DEPRECATED void showHelp(const String &)
BALL::VIEW::ModularWidget::registerWidget
static void registerWidget(ModularWidget *mwidget)
BALL::VIEW::ModularWidget::insertMenuEntry
QAction * insertMenuEntry(Position parent_id, const QString &name, const QObject *receiver=0, const char *slot=0, const String &description="", QKeySequence accel=QKeySequence(), const QString &menu_hint=QString(""), UIOperationMode::OperationMode minimal_mode=UIOperationMode::MODE_ALL)
BALL::VIEW::ModularWidget::writePreferences
virtual void writePreferences(INIFile &inifile)
BALL::VIEW::ModularWidget::getMainControl
MainControl * getMainControl() const
BALL::VIEW::Preferences
Definition preferences.h:43
BALL::VIEW::UIOperationMode::OperationMode
OperationMode
Definition UIOperationMode.h:30
BALL::VIEW::UIOperationMode::MODE_ALL
@ MODE_ALL
Definition UIOperationMode.h:34
QObject
QWidget
connectionObject.h
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
embeddable.h
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition embeddable.h:31
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140