Yannick Shpilka , cleaned up
[kgraphinterface.git] / src / kgraphinterface_part.h
blob484f4c68221b39582f76db19c208d3b42d68a88b
2 #ifndef _KGRAPHINTERFACEPART_H_
3 #define _KGRAPHINTERFACEPART_H_
5 #include <kparts/part.h>
6 #include <kparts/factory.h>
8 class QWidget;
9 class QPainter;
10 class KURL;
11 class Graph;
13 /**
14 * This is a "Part". It that does all the real work in a KPart
15 * application.
17 * @short Main Part
18 * @author Schpilka Yannick <schpilka@gmail.com>
19 * @version 0.1
21 class KGraphInterfacePart : public KParts::ReadWritePart
23 Q_OBJECT
24 public:
25 /**
26 * Default constructor
28 KGraphInterfacePart(QWidget *parentWidget, const char *widgetName,
29 QObject *parent, const char *name);
31 /**
32 * Destructor
34 virtual ~KGraphInterfacePart();
36 /**
37 * This is a virtual function inherited from KParts::ReadWritePart.
38 * A shell will use this to inform this Part if it should act
39 * read-only
41 virtual void setReadWrite(bool rw);
43 /**
44 * Reimplemented to disable and enable Save action
46 virtual void setModified(bool modified);
48 protected:
49 /**
50 * This must be implemented by each part
52 virtual bool openFile();
54 /**
55 * This must be implemented by each read-write part
57 virtual bool saveFile();
59 protected slots:
60 void fileOpen();
61 void fileSaveAs();
63 private:
64 Graph *m_widget;
67 class KInstance;
68 class KAboutData;
70 class KGraphInterfacePartFactory : public KParts::Factory
72 Q_OBJECT
73 public:
74 KGraphInterfacePartFactory();
75 virtual ~KGraphInterfacePartFactory();
76 virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName,
77 QObject *parent, const char *name,
78 const char *classname, const QStringList &args );
79 static KInstance* instance();
81 private:
82 static KInstance* s_instance;
83 static KAboutData* s_about;
86 #endif // _KGRAPHINTERFACEPART_H_