kgantt
KGantt.h00001 #ifndef _KGANTT_H_
00002 #define _KGANTT_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include <qwidget.h>
00038 #include <qsplitter.h>
00039
00040 #include <kpopupmenu.h>
00041 #include <kdepimmacros.h>
00042
00043 #include "KGanttItem.h"
00044 #include "xQGanttListView.h"
00045 #include "xQGanttBarView.h"
00046
00047
00048
00084
00085
00089
00090 class KDE_EXPORT KGantt : public QWidget
00092 {
00093
00094 Q_OBJECT
00095
00096
00097 public:
00098
00099
00101
00104 KGantt(KGanttItem* toplevelitem = 0,
00105 QWidget* parent = 0, const char * name=0, WFlags f=0 );
00106
00107
00109
00112 ~KGantt();
00113
00114
00115
00117
00123 void setToplevelItem(KGanttItem* item) {
00124 if(_deleteItem)
00125 delete _toplevelitem;
00126 _toplevelitem = item;
00127 }
00128
00129
00130
00132
00135 KGanttItem* getToplevelItem() {
00136 return _toplevelitem;
00137 }
00138
00139
00140
00142
00145 xQGanttBarView* barView() {
00146 return _ganttbar;
00147 }
00148
00149
00150
00152
00155 xQGanttListView* listView() {
00156 return _ganttlist;
00157 }
00158
00159
00160
00161 QSplitter* splitter() {
00162 return _splitter;
00163 }
00164
00165
00166
00168
00171 void zoom(double factor) {
00172 barView()->viewport()->zoom(factor);
00173 }
00174
00175
00176
00178
00181 KPopupMenu* menu() {
00182 return _ganttbar->viewport()->menu();
00183 }
00184
00185
00186
00188
00197 KToolBar* toolbar(QMainWindow* mw = 0) {
00198 return _ganttbar->viewport()->toolbar(mw);
00199 }
00200
00201
00202
00204
00205
00206
00207 void dumpItems();
00208
00209
00210
00212
00215 void getSelectedItems(QPtrList<KGanttItem>& list) {
00216 _ganttbar->viewport()->getSelectedItems(list);
00217 }
00218
00219
00220
00221 void addHoliday(int y, int m, int d) {
00222 _ganttbar->viewport()->addHoliday(y,m,d);
00223 }
00224
00225
00226
00227 void removeHoliday(int y, int m, int d) {
00228 _ganttbar->viewport()->addHoliday(y,m,d);
00229 }
00230
00231
00232
00233 public slots:
00234
00235
00236 void setSelect() {
00237 _ganttbar->viewport()->setSelect();
00238 }
00239
00240 void setZoom() {
00241 _ganttbar->viewport()->setZoom();
00242 }
00243
00244 void setMove() {
00245 _ganttbar->viewport()->setMove();
00246 }
00247
00248
00249 void zoomIn() {
00250 _ganttbar->viewport()->zoomIn();
00251 }
00252
00253 void zoomOut() {
00254 _ganttbar->viewport()->zoomOut();
00255 }
00256
00257 void zoomAll() {
00258 _ganttbar->viewport()->zoomAll();
00259 }
00260
00261 void selectAll() {
00262 _ganttbar->viewport()->selectAll();
00263 }
00264
00265 void unselectAll() {
00266 _ganttbar->viewport()->unselectAll();
00267 }
00268
00269 void deleteSelectedItems() {
00270 _ganttbar->viewport()->deleteSelectedItems();
00271 }
00272
00273 void insertIntoSelectedItem() {
00274 _ganttbar->viewport()->insertIntoSelectedItem();
00275 }
00276
00277
00279
00282 void showList() {
00283 _ganttlist->show();
00284 }
00285
00286
00288
00289
00290
00291 void hideList() {
00292 _ganttlist->hide();
00293 }
00294
00295
00296 protected:
00297
00298
00299 void resizeEvent(QResizeEvent* ) {
00300 _splitter->resize(width(),height());
00301 };
00302
00303
00304 private:
00305
00306 KGanttItem* _toplevelitem;
00307
00308 QSplitter *_splitter;
00309
00310 xQGanttBarView* _ganttbar;
00311 xQGanttListView* _ganttlist;
00312
00313 bool _deleteItem;
00314
00315 };
00316
00317
00318 #endif
|