summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/oblique/cmodule.h
blob: 41af7f1433455306162eedd78efa3678f654a3b5 (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;
	TQComboBox *mSchemaList;

	TQCheckBox *mOptionPlayable, *mOptionChildrenVisible, *mOptionAutoOpen;

	TQPushButton *mAdd, *mRemove, *mCopy;

	TQPushButton *mAddSibling, *mAddChild, *mRemoveSelf;

	TQDialog *mRegexpEditor;
	bool mIgnore;

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

	TQMap<TQString, QueryItem> mQueries;

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

	Oblique *oblique() { return mOblique; }

	void reopen();
	void save();

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

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

	void selectSchema(const TQString &title);

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

	void setCurrentModified();

private slots:
	void editValueRegexp();

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

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

private:
	QueryItem *currentQuery();
};

class SliceListItem;

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

public:
	SliceConfig(TQWidget *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
	TQTabWidget *tabs;
	SchemaConfig *schema;
	SliceConfig *slice;

public:
	Configure(Oblique *parent);

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


#endif