initial kgraphinterface, by Yannick Schpilka
[kgraphinterface.git] / src / contentwindow.h
blob00e408b85971ea1704082cbfa46dc76f309f049a
1 /***************************************************************************
2 * Copyright (C) 2007 by Schpilka Yannick *
3 * schpilka@localhost *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 * *
20 * In addition, as a special exception, the copyright holders give *
21 * permission to link the code of this program with any edition of *
22 * the Qt library by Trolltech AS, Norway (or with modified versions *
23 * of Qt that use the same license as Qt), and distribute linked *
24 * combinations including the two. You must obey the GNU General *
25 * Public License in all respects for all of the code used other than *
26 * Qt. If you modify this file, you may extend this exception to *
27 * your version of the file, but you are not obligated to do so. If *
28 * you do not wish to do so, delete this exception statement from *
29 * your version. *
30 ***************************************************************************/
31 #ifndef CONTENTWINDOW_H
32 #define CONTENTWINDOW_H
34 #include <kapplication.h>
35 #include <kparts/mainwindow.h>
36 #include <kurl.h>
37 /**
38 @author Schpilka Yannick <schpilka@gmail.com>
40 class Node;
42 class ContentWindow : public KParts::MainWindow{
43 Q_OBJECT
44 public:
45 /** Kpart window constructor */
46 ContentWindow(Node *parent, int t);
48 ~ContentWindow();
50 enum WndType{ TypeRK = 0, TypeRWK = 1, TypeWidget = 2 };
52 QWidget* getWidget();
54 void openURL(QString url);
56 bool loadPart (QString pname);
58 static ContentWindow* buildRdKPartWindow(Node *parent,QString kpart_name,QString xml = "");
59 static ContentWindow* buildRwKPartWindow(Node *parent,QString kpart_name,QString xml = "");
60 static ContentWindow* buildWidgetWindow(Node *parent);
62 public slots:
63 void closeWindow();
65 signals:
66 void windowClosed();
67 void partNotFound();
69 protected:
70 void closeEvent(QCloseEvent *event);
72 int wndtype;
74 private:
75 KParts::ReadOnlyPart *r_part;
76 KParts::ReadWritePart *rw_part;
77 QWidget *widget;
83 #endif