00001
00002
00003
00004
00005
00006 #ifndef BALL_VIEW_DIALOGS_ATOMOVERVIEW_H
00007 #define BALL_VIEW_DIALOGS_ATOMOVERVIEW_H
00008
00009 #ifndef BALL_COMMON_GLOBAL_H
00010 # include <BALL/COMMON/global.h>
00011 #endif
00012
00013 #ifdef BALL_COMPILER_MSVC
00014 # include <BALL/VIEW/UIC/ui_atomOverview.h>
00015 #else
00016 # include <BALL/VIEW/UIC/atomOverviewData.h>
00017 #endif
00018
00019
00020 #ifndef BALL_CONCEPT_COMPOSITE_H
00021 # include <BALL/CONCEPT/composite.h>
00022 #endif
00023
00024 namespace BALL
00025 {
00026 class AtomContainer;
00027
00028 namespace VIEW
00029 {
00030 class MainControl;
00031
00038 class BALL_VIEW_EXPORT AtomOverview
00039 : public QDialog,
00040 public Ui_AtomOverviewData
00041 {
00042 Q_OBJECT
00043
00044 public:
00045
00047 class BALL_VIEW_EXPORT OverviewProcessor
00048 : public UnaryProcessor<Composite>
00049 {
00050 public:
00051
00052 BALL_CREATE(OverviewProcessor)
00053
00054
00055 OverviewProcessor();
00056
00058 OverviewProcessor(const OverviewProcessor& model_processor);
00059
00061 virtual ~OverviewProcessor();
00062
00064 Processor::Result operator() (Composite& composite);
00065
00067 void setTable(QTableWidget* widget) { table_ = widget;}
00068
00070 void showOnlySelection(bool state) {only_selection_ = state;}
00071
00072 protected:
00073
00074 QTableWidget* table_;
00075 bool only_selection_;
00076 };
00077
00079 class BALL_VIEW_EXPORT ApplyProcessor
00080 : public UnaryProcessor<Composite>
00081 {
00082 public:
00083
00084 BALL_CREATE(ApplyProcessor)
00085
00086
00087 ApplyProcessor();
00088
00090 ApplyProcessor(const ApplyProcessor& model_processor);
00091
00093 virtual ~ApplyProcessor();
00094
00096 Processor::Result operator() (Composite& composite);
00097
00099 void setTable(QTableWidget* widget) { table_ = widget; row_ = 0;}
00100
00102 void setMainControl(MainControl* main_control) {main_control_ = main_control;}
00103
00105 void showOnlySelection(bool state) {only_selection_ = state;}
00106
00107 protected:
00108
00109 QTableWidget* table_;
00110 Position row_;
00111 bool only_selection_;
00112 MainControl* main_control_;
00113 };
00114
00115
00119
00124 AtomOverview(QWidget *parent = NULL, const char *name = "AtomOverview");
00125
00127
00130
00133 virtual ~AtomOverview();
00134
00136
00139
00141 void setParent(AtomContainer* ac);
00142
00144 void showOnlySelection(bool state) {only_selection_ = state;}
00145
00147
00150
00151 protected slots:
00152
00158 virtual void accept();
00159
00160 void itemChanged(QTableWidgetItem* item);
00161 void itemActivated(QTableWidgetItem* item);
00162
00163 protected:
00164
00165 void restoreItem_(QTableWidgetItem* item);
00166
00167 AtomContainer* parent_;
00168 OverviewProcessor processor_;
00169 ApplyProcessor apply_processor_;
00170 String item_backup_;
00171 bool ignore_;
00172 bool only_selection_;
00173 };
00174
00175 } }
00176
00177 #endif // BALL_VIEW_DIALOGS_AtomOverview_H