summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/oblique/view.h
blob: 598c0ccb8c48499dad6fdb556bffe5f9d94a371e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright (c) 2003,2004 Charles Samuels <charles@kde.org>
// See the file COPYING for redistribution terms.

#ifndef VIEW_H
#define VIEW_H

#include <kmainwindow.h>
#include <kaction.h>
#include <klineedit.h>

#include "tree.h"

class SchemaListAction;
class TabWidget;

class View : public KMainWindow
{
Q_OBJECT
	Oblique *mOblique;
	Tree *mTree;
	QValueList<Tree*> mTrees;
	TabWidget *mTabs;
	KAction *mRemoveTabAction;
	SchemaListAction *mSchemaListAction;

public:
	View(Oblique *oblique);
	~View();

	Tree *tree() { return mTree; }

	Oblique *oblique() { return mOblique; }

public slots:
	void addFiles();
	void addDirectory();
	void addTab();
	void removeTab();

signals:
	void listHidden();
	void listShown();

private slots:
	void configureToolBars();
	void newToolBarConfig();
	void jumpTextChanged(const QString &text);
	void use(Slice*);
	void currentTabChanged(QWidget *);
	void setSchema(const QString &file);

protected:
	virtual void showEvent(QShowEvent *) { emit listShown(); }
	virtual void hideEvent(QHideEvent *) { emit listHidden(); }
	void closeEvent(QCloseEvent*);
};


class LineEditAction : public KWidgetAction
{
Q_OBJECT
public:
	LineEditAction(const QString &text, const QObject *reciever, const char *slot, KActionCollection *parent, const char *name);

	KLineEdit *widget() { return static_cast<KLineEdit*>(KWidgetAction::widget()); }
	KLineEdit *lineEdit() { return widget(); }
};


#endif