kplato

kptpertview.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003, 2004 Dag Andersen <danders@get2net.dk>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation;
00007    version 2 of the License.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019  
00020 #ifndef KPTPERTVIEW_H
00021 #define KPTPERTVIEW_H
00022 
00023 #include "kptcontext.h"
00024 
00025 #include <qsplitter.h>
00026 
00027 class QLayout;
00028 class QListViewItem;
00029 
00030 class KPrinter;
00031 
00032 namespace KPlato
00033 {
00034 
00035 class View;
00036 class PertCanvas;
00037 class Node;
00038 class Relation;
00039 
00040 class PertView : public QWidget
00041 {
00042     Q_OBJECT
00043     
00044 public:
00045  
00046     PertView( View *view, QWidget *parent, QLayout *layout );
00047 
00048     ~PertView();
00049     
00050     void setZoom(double /*zoom*/) {}
00051 
00052     void draw();
00053     View *mainView() const { return m_mainview; } 
00054 
00055     void print(KPrinter &printer);
00056 
00057     Node *currentNode();
00058 
00059     virtual bool setContext(Context::Pertview &context);
00060     virtual void getContext(Context::Pertview &context) const;
00061 
00062 public slots:
00063     void slotRMBPressed(Node *node, const QPoint & point);
00064     void slotAddRelation(Node *par, Node *child);
00065     void slotModifyRelation(Relation *rel);
00066 
00067 signals:
00068     void addRelation(Node *par, Node *child);
00069     void modifyRelation(Relation *rel);
00070 
00071 private:
00072     void init(QLayout *layout);
00073     View *m_mainview;
00074     PertCanvas *m_canvasview;
00075     Node *m_node;
00076     int m_defaultFontSize;
00077 };
00078 
00079 }  //KPlato namespace
00080 
00081 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys