aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_widget.h
blob: 5f6f46b4ba75c2c10104b81b85f5812d24459e85 (about) (plain) (blame)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef _CLASS_WIDGET_H_
#define _CLASS_WIDGET_H_
//=============================================================================
//
//   File : class_widget.h
//   Creation date : Mon Sep 11 16:35:32 CET 2000 by Krzysztof Godlewski
//
//   This file is part of the KVirc irc client distribution
//   Copyright (C) 2000 Krzysztof Godlewski
//   Copyright (C) 2000-2008 Szymon Stefanek (pragma at kvirc dot net)
//
//   This program is FREE software. You can redistribute it and/or
//   modify it under the terms of the GNU General Public License
//   as published by the Free Software Foundation; either version 2
//   of the License, or (at your opinion) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
//=============================================================================

#include "kvi_string.h"
#include "kvi_tal_tooltip.h"
#include "object_macros.h"

#ifdef COMPILE_WEBKIT_SUPPORT
	#include <QtWebKit/QWebView>
#endif

class KviKvsObject_widget : public KviKvsObject
{
	Q_OBJECT
public:
	KVSO_DECLARE_OBJECT(KviKvsObject_widget)

public:
	QWidget * widget() { return (QWidget *)object(); };

protected:
	virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams);

#ifdef COMPILE_WEBKIT_SUPPORT
	QWebView * m_pWebview;
#endif
	virtual bool eventFilter(QObject *o,QEvent *e);

	// ok, it is clear that we're messing with the naming conventions for the
	// object classes :D
	// let's try to use this one:
	// function_isEnabled
	// function_setEnabled..
	// ... etc
	// so the name of the C++ function matches exactly the name of the KVS function at this point
	
	// let's also try to keep alphabetic order for the functions here.. so one can find them quickly

	bool function_addWidgetToWrappedLayout(KviKvsObjectFunctionCall *c);
	bool function_backgroundColor(KviKvsObjectFunctionCall *c);
	bool function_centerToScreen(KviKvsObjectFunctionCall *c);
	bool function_colorPalette(KviKvsObjectFunctionCall *c);
	bool function_fontAscent(KviKvsObjectFunctionCall * c);
	bool function_fontDescent(KviKvsObjectFunctionCall * c);
	bool function_fontMetricsHeight(KviKvsObjectFunctionCall * c);
	bool function_fontMetricsWidth(KviKvsObjectFunctionCall * c);
	bool function_foregroundColor(KviKvsObjectFunctionCall *c);
	bool function_geometry(KviKvsObjectFunctionCall *c);
	bool function_globalCursorX(KviKvsObjectFunctionCall *c);
	bool function_globalCursorY(KviKvsObjectFunctionCall *c);
	bool function_hasFocus(KviKvsObjectFunctionCall *c);
	bool function_height(KviKvsObjectFunctionCall *);
	bool function_hide(KviKvsObjectFunctionCall *);
	bool function_isEnabled(KviKvsObjectFunctionCall *c);
	bool function_isTopLevel(KviKvsObjectFunctionCall *c);
	bool function_isVisible(KviKvsObjectFunctionCall *c);
	bool function_loadInterface(KviKvsObjectFunctionCall *c);
	bool function_lower(KviKvsObjectFunctionCall *);
	bool function_mapFromGlobal(KviKvsObjectFunctionCall *c);
	bool function_mapToGlobal(KviKvsObjectFunctionCall *c);
	bool function_move(KviKvsObjectFunctionCall *c);
	bool function_parentWidget(KviKvsObjectFunctionCall *c);
	bool function_raise(KviKvsObjectFunctionCall *);
	bool function_repaint(KviKvsObjectFunctionCall *c);
	bool function_insertIntoStatusBar(KviKvsObjectFunctionCall *c);
	bool function_removeFromStatusBar(KviKvsObjectFunctionCall *c);
	bool function_reparent(KviKvsObjectFunctionCall *c);
	bool function_resize(KviKvsObjectFunctionCall *c);
	bool function_screenResolution(KviKvsObjectFunctionCall * c);
	bool function_setAttribute(KviKvsObjectFunctionCall *c);
	bool function_setBackgroundColor(KviKvsObjectFunctionCall *c);
	bool function_setBackgroundImage(KviKvsObjectFunctionCall *c);
	bool function_setEnabled(KviKvsObjectFunctionCall *c);
	bool function_setFocus(KviKvsObjectFunctionCall *c);
	bool function_setFocusPolicy(KviKvsObjectFunctionCall *c);
	bool function_setFont(KviKvsObjectFunctionCall *c);
	bool function_setGeometry(KviKvsObjectFunctionCall *c);
	bool function_setKeyShortcut(KviKvsObjectFunctionCall *c);
	bool function_setMask(KviKvsObjectFunctionCall *c);
	bool function_setMaximumHeight(KviKvsObjectFunctionCall *c);
	bool function_setMaximumWidth(KviKvsObjectFunctionCall *c);
	bool function_setMinimumHeight(KviKvsObjectFunctionCall *c);
	bool function_setMinimumWidth(KviKvsObjectFunctionCall *c);
	bool function_setMouseTracking(KviKvsObjectFunctionCall *c);
	bool function_setPaletteForeground(KviKvsObjectFunctionCall *c);
	bool function_setStyleSheet(KviKvsObjectFunctionCall *c);
	bool function_setToolTip(KviKvsObjectFunctionCall *);
	bool function_setWindowIcon(KviKvsObjectFunctionCall *c);
	bool function_setWindowTitle(KviKvsObjectFunctionCall *c);
	bool function_setWFlags(KviKvsObjectFunctionCall *c);
	bool function_show(KviKvsObjectFunctionCall *c);
	bool function_sizeHint(KviKvsObjectFunctionCall *c);
	bool function_update(KviKvsObjectFunctionCall *c);
	bool function_width(KviKvsObjectFunctionCall *);
	bool function_windowTitle(KviKvsObjectFunctionCall *c);
	bool function_x(KviKvsObjectFunctionCall *);
	bool function_y(KviKvsObjectFunctionCall *);
#ifdef COMPILE_WEBKIT_SUPPORT
	bool function_setWebView(KviKvsObjectFunctionCall *c);
#endif

signals:
	void aboutToDie();
};

class KviKvsWidget : public QWidget
{
	Q_OBJECT
	Q_PROPERTY(QSize sizeHint READ sizeHint)
public:
	KviKvsWidget(KviKvsObject_widget * ob,QWidget * par);
		

	virtual ~KviKvsWidget();
protected:
	KviKvsObject_widget * m_pObject;
public:
	QSize sizeHint() const;
};
#endif //_CLASS_WIDGET_H_