summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/oblique/cmodule.h
blob: f60c6c37764377e04006cf3d8915ee43da07e255 (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Copyright (c) 2003 Charles Samuels <charles@kde.org>
// See the file COPYING for redistribution terms.

#ifndef CMODULE_H
#define CMODULE_H

#include <noatun/pref.h>
#include "query.h"

class KListView;
class KLineEdit;
class QDialog;
class Oblique;
class QCheckBox;
class QComboBox;
class QPushButton;
class QTabWidget;

class SchemaConfig : public QWidget
{
Q_OBJECT
	Oblique *mOblique;

	KListView *mSchemaTree;
	KLineEdit *mPropertyEdit, *mValueEdit, *mPresentationEdit;
	QComboBox *mSchemaList;

	QCheckBox *mOptionPlayable, *mOptionChildrenVisible, *mOptionAutoOpen;

	QPushButton *mAdd, *mRemove, *mCopy;

	QPushButton *mAddSibling, *mAddChild, *mRemoveSelf;

	QDialog *mRegexpEditor;
	bool mIgnore;

	struct QueryItem
	{
		Query query;
		QString title;
		bool changed;
	};

	QMap<QString, QueryItem> mQueries;

public:
	SchemaConfig(QWidget *parent, Oblique *oblique);

	Oblique *oblique() { return mOblique; }

	void reopen();
	void save();

	static QString nameToFilename(const QString &name);
	static QString filenameToName(const QString &filename);

public slots:
	void newSchema();
	void copySchema();
	void removeSchema();

	void selectSchema(const QString &title);

	void addSibling();
	void addChild();
	void removeSelf();

	void setCurrentModified();

private slots:
	void editValueRegexp();

	void setCurrent(QListViewItem *_item);
	void updateCurrent();

	void move(QListViewItem *item, QListViewItem *afterFirst, QListViewItem *afterNow);

private:
	QueryItem *currentQuery();
};

class SliceListItem;

class SliceConfig : public QWidget
{
Q_OBJECT
	Oblique *mOblique;
	KListView *mSliceList;
	QPushButton *mAdd, *mRemove;
	QValueList<SliceListItem*> mAddedItems;
	QValueList<Slice*> mRemovedItems;

public:
	SliceConfig(QWidget *parent, Oblique *oblique);
	Oblique *oblique() { return mOblique; }

	void reopen();
	void save();


	SliceListItem *currentItem();

private slots:
	void addSibling();
	void removeSelf();
};

class Configure : public CModule
{
Q_OBJECT
	QTabWidget *tabs;
	SchemaConfig *schema;
	SliceConfig *slice;

public:
	Configure(Oblique *parent);

	virtual void reopen();
	virtual void save();
};


#endif