summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/oblique/menu.h
blob: 793180c1f95c79697ebe05f58b991e447d30e443 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Copyright (c) 2003 Charles Samuels <charles@kde.org>
// See the file COPYING for redistribution terms.

#ifndef MENU_H
#define MENU_H

#include <kpopupmenu.h>
#include <kpropertiesdialog.h>
#include <kaction.h>

#include "file.h"
#include "oblique.h"

/**
 * a context menu for a item in the list
 **/
class FileMenu : public KPopupMenu
{
Q_OBJECT
	QValueList<File> mFiles;

public:
	FileMenu(QWidget *parent, Oblique *oblique, File file);
	/**
	 * @recursively uses everything under @p files
	 **/
	FileMenu(QWidget *parent, Oblique *oblique, TreeItem *files);

private slots:
	void removeFromList();
	void properties();
	void toggleInSlice(Slice *slice);
};

class SliceListAction : public KActionMenu
{
Q_OBJECT
	QMap<int, Slice*> mIndexToSlices;
	QValueList<File> mFiles;
	Oblique *mOblique;

public:
	SliceListAction(
			const QString &text, Oblique *oblique,
			QObject *reciever, const char *slot,
			const QValueList<File> &files = QValueList<File>(), QObject *parent=0, const char *name=0
		);

signals:
	void activated(Slice *slice);

private slots:
	void hit(int index);
	void slicesModified();
};


class SchemaListAction : public KActionMenu
{
Q_OBJECT
	QMap<int, QString> mIndexToSchemas;
	Tree *mTree;

public:
	SchemaListAction(
			const QString &text,
			QObject *reciever, const char *slot,
			QObject *parent, const char *name
		);

	void setTree(Tree *tree) { mTree = tree; }

signals:
	void activated(const QString &);

private slots:
	void hit(int index);
	void prepare();
};


class ObliquePropertiesDialog : public KPropertiesDialog
{
Q_OBJECT
	QValueList<File> mFiles;

public:
	ObliquePropertiesDialog(const QValueList<File> &files, QWidget *parent);

private:
	static KFileItemList makeItems(const QValueList<File> &files);

private slots:
	void modified();
};


#endif