kgantt Library API Documentation

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., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, 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 
00042 #include "KGanttItem.h"
00043 #include "xQGanttListView.h"
00044 #include "xQGanttBarView.h"
00045 
00046 
00047 
00083 
00084 
00088 
00089 class KGantt : public QWidget
00091 {
00092 
00093   Q_OBJECT
00094 
00095 
00096 public:  
00097 
00098 
00100 
00103   KGantt(KGanttItem* toplevelitem = 0,
00104      QWidget* parent = 0, const char * name=0, WFlags f=0 );
00105 
00106 
00108 
00111   ~KGantt();
00112 
00113 
00114 
00116 
00122   void setToplevelItem(KGanttItem* item) {
00123     if(_deleteItem)
00124       delete _toplevelitem;
00125     _toplevelitem = item; 
00126   }
00127 
00128 
00129 
00131 
00134   KGanttItem* getToplevelItem() { 
00135     return _toplevelitem; 
00136   }
00137 
00138 
00139 
00141 
00144   xQGanttBarView* barView() {
00145     return _ganttbar;
00146   }
00147 
00148 
00149 
00151 
00154   xQGanttListView* listView() {
00155     return _ganttlist;
00156   }
00157 
00158 
00159 
00160   QSplitter* splitter() {
00161     return _splitter;
00162   }
00163 
00164 
00165   
00167 
00170   void zoom(double factor) {
00171     barView()->viewport()->zoom(factor);
00172   }
00173 
00174 
00175 
00177 
00180   KPopupMenu* menu() {
00181     return _ganttbar->viewport()->menu();
00182   }
00183 
00184 
00185 
00187 
00196   KToolBar* toolbar(QMainWindow* mw = 0) {
00197     return _ganttbar->viewport()->toolbar(mw);
00198   }
00199 
00200 
00201 
00203   /*
00204    *
00205    */
00206   void dumpItems();
00207 
00208 
00209 
00211 
00214   void getSelectedItems(QPtrList<KGanttItem>& list) {
00215     _ganttbar->viewport()->getSelectedItems(list);
00216   }
00217 
00218 
00219 
00220   void addHoliday(int y, int m, int d) {
00221     _ganttbar->viewport()->addHoliday(y,m,d);
00222   }
00223 
00224 
00225 
00226   void removeHoliday(int y, int m, int d) {
00227     _ganttbar->viewport()->addHoliday(y,m,d);
00228   }
00229 
00230 
00231 
00232 public slots:
00233 
00234 
00235   void setSelect() {
00236     _ganttbar->viewport()->setSelect();
00237   }
00238 
00239   void setZoom() {
00240     _ganttbar->viewport()->setZoom();
00241   }
00242 
00243   void setMove() {
00244     _ganttbar->viewport()->setMove();
00245   }
00246 
00247 
00248   void zoomIn() {
00249     _ganttbar->viewport()->zoomIn();
00250   }
00251 
00252   void zoomOut() {
00253     _ganttbar->viewport()->zoomOut();
00254   }
00255 
00256   void zoomAll() {
00257     _ganttbar->viewport()->zoomAll();
00258   }
00259 
00260   void selectAll() {
00261     _ganttbar->viewport()->selectAll();
00262   }
00263 
00264   void unselectAll() {
00265     _ganttbar->viewport()->unselectAll();
00266   }
00267 
00268   void deleteSelectedItems() {
00269     _ganttbar->viewport()->deleteSelectedItems();
00270   }
00271 
00272   void insertIntoSelectedItem() {
00273     _ganttbar->viewport()->insertIntoSelectedItem();
00274   }
00275 
00276 
00278 
00281   void showList() {
00282     _ganttlist->show();
00283   }
00284 
00285 
00287   /*
00288    *
00289    */
00290   void hideList() {
00291     _ganttlist->hide();
00292   }
00293 
00294 
00295 protected:
00296 
00297 
00298   void resizeEvent(QResizeEvent* e) {
00299     _splitter->resize(width(),height());
00300   };
00301 
00302 
00303 private:
00304 
00305   KGanttItem* _toplevelitem;
00306 
00307   QSplitter *_splitter;
00308 
00309   xQGanttBarView* _ganttbar;
00310   xQGanttListView* _ganttlist;
00311 
00312   bool _deleteItem;
00313 
00314 };
00315 
00316 
00317 #endif
KDE Logo
This file is part of the documentation for kgantt Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:37:42 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003