kgantt

KGantt.h

00001 #ifndef _KGANTT_H_
00002 #define _KGANTT_H_
00003  
00004 /*
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 
00021     author  : jh, jochen@ifb.bv.tu-berlin.de
00022 
00023     file    : KGantt.h
00024     date    : 26 oct 2000
00025 
00026 
00027     changelog : 23 nov 2000, jh
00028 
00029                 24 nov 2000, jh
00030 
00031         10 jan 2001m jh, changed to KDE :
00032         xQGantt -> KGantt
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* /*e*/) {
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
KDE Home | KDE Accessibility Home | Description of Access Keys