Loading...
Searching...
No Matches
fileObserver.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_WIDGETS_FILEOBSERVER_H
#define BALL_VIEW_WIDGETS_FILEOBSERVER_H
#ifndef BALL_VIEW_WIDGETS_DOCKWIDGET_H
# include <BALL/VIEW/WIDGETS/dockWidget.h>
#endif
#include <QtCore/QTimer>
#include <QtCore/QDateTime>
class QAction;
namespace BALL
{
namespace VIEW
{
class BALL_VIEW_EXPORT FileObserver
: public DockWidget
{
Q_OBJECT
public:
BALL_EMBEDDABLE(FileObserver,DockWidget)
FileObserver(QWidget *parent = 0, const char *name = 0);
virtual ~FileObserver();
//
virtual void initializeWidget(MainControl& main_control);
//
virtual void checkMenu(MainControl& main_control);
void setFileName(String filename);
String getFileName() const;
void setUpdateInterval(Size msec);
public Q_SLOTS:
void updateFile();
void start();
void stop();
void chooseFile();
protected:
QAction* start_action_, *stop_action_;
QTimer timer_;
String file_name_;
QDateTime last_vis_time_;
};
} } // namespaces
#endif // BALL_VIEW_WIDGETS_FILEOBSERVER_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::String
Definition string.h:57
BALL::VIEW::DockWidget::DockWidget
DockWidget(QWidget *parent, const char *title=0)
Use this constructor!
BALL::VIEW::FileObserver::stop
void stop()
Stop the observation.
BALL::VIEW::FileObserver::checkMenu
virtual void checkMenu(MainControl &main_control)
BALL::VIEW::FileObserver::FileObserver
FileObserver(QWidget *parent=0, const char *name=0)
BALL::VIEW::FileObserver::setUpdateInterval
void setUpdateInterval(Size msec)
Set the update interval in milli seconds.
BALL::VIEW::FileObserver::getFileName
String getFileName() const
BALL::VIEW::FileObserver::file_name_
String file_name_
Definition fileObserver.h:83
BALL::VIEW::FileObserver::start_action_
QAction * start_action_
Definition fileObserver.h:80
BALL::VIEW::FileObserver::last_vis_time_
QDateTime last_vis_time_
Definition fileObserver.h:84
BALL::VIEW::FileObserver::chooseFile
void chooseFile()
Choose a file and start the observer.
BALL::VIEW::FileObserver::timer_
QTimer timer_
Definition fileObserver.h:82
BALL::VIEW::FileObserver::start
void start()
Start the observation.
BALL::VIEW::FileObserver::updateFile
void updateFile()
Look for updates in the file.
BALL::VIEW::FileObserver::initializeWidget
virtual void initializeWidget(MainControl &main_control)
BALL::VIEW::FileObserver::setFileName
void setFileName(String filename)
Set the name of the molecular file to be observed.
BALL::VIEW::FileObserver::stop_action_
QAction * stop_action_
Definition fileObserver.h:80
BALL::VIEW::MainControl
Definition mainControl.h:118
QWidget
dockWidget.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