kplato

kptpertview.h
1/* This file is part of the KDE project
2 Copyright (C) 2003, 2004 Dag Andersen <danders@get2net.dk>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation;
7 version 2 of the License.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KPTPERTVIEW_H
21#define KPTPERTVIEW_H
22
23#include "kptcontext.h"
24
25#include <tqsplitter.h>
26
27class TQLayout;
28class TQListViewItem;
29
30class KPrinter;
31
32namespace KPlato
33{
34
35class View;
36class PertCanvas;
37class Node;
38class Relation;
39
40class PertView : public TQWidget
41{
42 TQ_OBJECT
43
44
45public:
46
47 PertView( View *view, TQWidget *parent, TQLayout *layout );
48
49 ~PertView();
50
51 void setZoom(double /*zoom*/) {}
52
53 void draw();
54 View *mainView() const { return m_mainview; }
55
56 void print(KPrinter &printer);
57
58 Node *currentNode();
59
60 virtual bool setContext(Context::Pertview &context);
61 virtual void getContext(Context::Pertview &context) const;
62
63public slots:
64 void slotRMBPressed(Node *node, const TQPoint & point);
65 void slotAddRelation(Node *par, Node *child);
66 void slotModifyRelation(Relation *rel);
67
68signals:
69 void addRelation(Node *par, Node *child);
70 void modifyRelation(Relation *rel);
71
72private:
73 void init(TQLayout *layout);
74 View *m_mainview;
75 PertCanvas *m_canvasview;
76 Node *m_node;
77 int m_defaultFontSize;
78};
79
80} //KPlato namespace
81
82#endif