summaryrefslogtreecommitdiffstats
path: root/noatun/modules/kjofol-skin/kjloader.h
blob: 117545b2ff5366ab169d6136d95f5c1c87581c87 (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
124
125
126
127
128
129
130
#ifndef KJLOADER_H
#define KJLOADER_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

// local includes
#include "parser.h"

// noatun-specific includes
#include <noatun/plugin.h>
#include <noatun/app.h>

// system includes
#include <tqwidget.h>
#include <tqbitmap.h>
#include <tqptrlist.h>
#include <tqcstring.h>

#include <kwinmodule.h>

class TQLabel;
class KJWidget;
class KHelpMenu;
class KJSeeker;
class NoatunPreferences;
class KJToolTip;
class KJFont;
class KJPrefs;


class KJLoader :  public TQWidget, public UserInterface, public Parser
{
Q_OBJECT
  TQ_OBJECT
NOATUNPLUGIND

	friend class KJWidget;
public:
	KJLoader();
	~KJLoader();

public:
	void minimize();
	KHelpMenu *helpMenu() const { return mHelpMenu; }
	TQStringList &item(const TQString &key) { return *Parser::find(key); }

	// returns path to currently loaded configfile
	// can be either a newly loaded one or one of the three below
	TQString currentSkin() { return mCurrentSkin; }

	// returns path to mainskin-configfile
	TQString currentDefaultSkin() { return mCurrentDefaultSkin; }

	//returns path to dockmode-configfile if present
	TQString currentDockModeSkin() { return mCurrentDockModeSkin; }

	//returns path to winshademode-configfile if present (not supported yet)
	TQString currentWinshadeModeSkin() { return mCurrentWinshadeModeSkin; }

	KJPrefs *prefs() const { return mPrefs; }

	TQPtrList<KJWidget> widgetsAt(const TQPoint &pt) const;

	void removeChild(KJWidget *c);
	void addChild(KJWidget *c);

public slots:
	void loadSkin(const TQString &file);
	void readConfig();
	void switchToDockmode();
	void returnFromDockmode();

protected:
	void unloadSkin();
	void showSplash();

public slots:
	void timeUpdate();
	void newSong();

private slots:
	void loadSeeker();
	void slotWindowActivate(WId win);
	void slotWindowRemove(WId win);
	void slotWindowChange(WId win);
	void slotDesktopChange(int);
	void slotStackingChanged();
	void restack();
	void hideSplash();

protected:
	virtual void mouseMoveEvent(TQMouseEvent *e);
	virtual void mousePressEvent(TQMouseEvent *e);
	virtual void mouseReleaseEvent(TQMouseEvent *e);
	virtual void paintEvent(TQPaintEvent *e);
	virtual void closeEvent(TQCloseEvent*e);
	virtual void wheelEvent(TQWheelEvent *e);

	virtual void dragEnterEvent(TQDragEnterEvent *event);
	virtual void dropEvent(TQDropEvent *event);

public:
	static KJLoader* kjofol;

private:
	// ==== docking stuff ====
	KWinModule *mWin;
	WId mDockToWin;
	int mDockPositionX, mDockPositionY, mDockPosition;
	TQRect mDockWindowRect;
	// ==== end of docking stuff ====
	bool moving;
	TQPoint mMousePoint;
	TQPtrList<KJWidget> subwidgets;
	KJWidget *mClickedIn;
	KHelpMenu *mHelpMenu;
	KJFont *mText, *mNumbers, *mVolumeFont, *mPitchFont;
	TQLabel *splashScreen;
	KJToolTip *mTooltips;
	TQString mCurrentSkin;
	TQString mCurrentDefaultSkin;
	TQString mCurrentDockModeSkin;
	TQString mCurrentWinshadeModeSkin;

	KJPrefs *mPrefs;
};

#endif // KJLOADER_H