/*	Copyright  (c)	Günter Woigk 2009 - 2012
					mailto:kio@little-bat.de

	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.

	Permission to use, copy, modify, distribute, and sell this software and
	its documentation for any purpose is hereby granted without fee, provided
	that the above copyright notice appear in all copies and that both that
	copyright notice and this permission notice appear in supporting
	documentation, and that the name of the copyright holder not be used
	in advertising or publicity pertaining to distribution of the software
	without specific, written prior permission.  The copyright holder makes no
	representations about the suitability of this software for any purpose.
	It is provided "as is" without express or implied warranty.

	THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
	INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
	EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
	CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
	DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
	TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
	PERFORMANCE OF THIS SOFTWARE.
*/

#include <QEvent>
#include "kio/kio.h"
//#include "h/globals.h"


cstr QEventTypeStr(int /*QEvent::Type*/ n)
{
	switch(n)
	{
	case 0:	return "None = 0: invalid event";
	case 1: return "Timer = 1: timer event";
	case 2: return "MouseButtonPress = 2: mouse button pressed";
	case 3: return "MouseButtonRelease = 3: mouse button released";
	case 4: return "MouseButtonDblClick = 4: mouse button double click";
	case 5: return "MouseMove = 5: mouse move";
	case 6: return "KeyPress = 6: key pressed";
	case 7: return "KeyRelease = 7: key released";
	case 8: return "FocusIn = 8: keyboard focus received";
	case 9: return "FocusOut = 9: keyboard focus lost";
	case 10: return "Enter = 10: mouse enters widget";
	case 11: return "Leave = 11: mouse leaves widget";
	case 12: return "Paint = 12: paint widget";
	case 13: return "Move = 13: move widget";
	case 14: return "Resize = 14: resize widget";
	case 15: return "Create = 15: after widget creation";
	case 16: return "Destroy = 16: during widget destruction";
	case 17: return "Show = 17: widget is shown";
	case 18: return "Hide = 18: widget is hidden";
	case 19: return "Close = 19: request to close widget";
	case 20: return "Quit = 20: request to quit application";
	case 21: return "ParentChange = 21: widget has been reparented";
	case 22: return"ThreadChange = 22: object has changed threads";
	case 24: return"WindowActivate = 24: window was activated";
	case 25: return"WindowDeactivate = 25: window was deactivated";
	case 26: return"ShowToParent = 26: widget is shown to parent";
	case 27: return"HideToParent = 27: widget is hidden to parent";
	case 30: return"30:Accel: accelerator event (QT3)";
	case 31: return"Wheel = 31: wheel event";
	case 32: return"32:AccelAvailable: accelerator available event (QT3)";
	case 33: return"WindowTitleChange = 33: window title changed";
	case 34: return"WindowIconChange = 34: icon changed";
	case 35: return"ApplicationWindowIconChange = 35: application icon changed";
	case 36: return"ApplicationFontChange = 36: application font changed";
	case 37: return"ApplicationLayoutDirectionChange = 37: application layout direction changed";
	case 38: return"ApplicationPaletteChange = 38: application palette changed";
	case 39: return"PaletteChange = 39: widget palette changed";
	case 40: return"Clipboard = 40: internal clipboard event";
	case 42: return"Speech = 42: reserved for speech input";
	case 43: return"MetaCall =  43: meta call event";
	case 50: return"SockAct = 50: socket activation";
	case 51: return"ShortcutOverride = 51: shortcut override request";
	case 52: return"DeferredDelete = 52: deferred delete event";
	case 60: return"DragEnter = 60: drag moves into widget";
	case 61: return"DragMove = 61: drag moves in widget";
	case 62: return"DragLeave = 62: drag leaves or is cancelled";
	case 63: return"Drop = 63: actual drop";
	case 64: return"DragResponse = 64: drag accepted/rejected";
	case 68: return"ChildAdded = 68: new child widget";
	case 69: return"ChildPolished = 69: polished child widget";
	case 67: return"ChildInsertedRequest = 67: send ChildInserted compatibility events to receiver (QT3)";
	case 70: return"ChildInserted = 70: compatibility child inserted (QT3)";
	case 72: return"LayoutHint = 72: compatibility relayout request (QT3)";
	case 71: return"ChildRemoved = 71: deleted child widget";
	case 73: return"ShowWindowRequest = 73: widget's window should be mapped";
	case 74: return"PolishRequest = 74: widget should be polished";
	case 75: return"Polish = 75: widget is polished";
	case 76: return"LayoutRequest = 76: widget should be relayouted";
	case 77: return"UpdateRequest = 77: widget should be repainted";
	case 78: return"UpdateLater = 78: request update() later";
	case 79: return"EmbeddingControl = 79: ActiveX embedding";
	case 80: return"ActivateControl = 80: ActiveX activation";
	case 81: return"DeactivateControl = 81: ActiveX deactivation";
	case 82: return"ContextMenu = 82: context popup menu";
	case 83: return"InputMethod = 83: input method";
	case 86: return"AccessibilityPrepare = 86: accessibility information is requested";
	case 87: return"TabletMove = 87: Wacom tablet event";
	case 88: return"LocaleChange = 88: the system locale changed";
	case 89: return"LanguageChange = 89: the application language changed";
	case 90: return"LayoutDirectionChange = 90: the layout direction changed";
	case 91: return"Style = 91: internal style event";
	case 92: return"TabletPress = 92: tablet press";
	case 93: return"TabletRelease = 93: tablet release";
	case 94: return"OkRequest = 94: CE (Ok) button pressed";
	case 95: return"HelpRequest = 95: CE (?)  button pressed";
	case 96: return"IconDrag = 96: proxy icon dragged";
	case 97: return"FontChange = 97: font has changed";
	case 98: return"EnabledChange = 98: enabled state has changed";
	case 99: return"ActivationChange = 99: window activation has changed";
	case 100:return"StyleChange = 100: style has changed";
	case 101:return"IconTextChange = 101: icon text has changed";
	case 102:return"ModifiedChange = 102: modified state has changed";
	case 109:return"MouseTrackingChange = 109: mouse tracking state has changed";
	case 103:return"WindowBlocked = 103: window is about to be blocked modally";
	case 104:return"WindowUnblocked = 104: windows modal blocking has ended";
	case 105:return"WindowStateChange = 105";
	case 110:return"ToolTip = 110";
	case 111:return"WhatsThis = 111";
	case 112:return"StatusTip = 112";
	case 113:return"ActionChanged = 113";
	case 114:return"ActionAdded = 114";
	case 115:return"ActionRemoved = 115";
	case 116:return"FileOpen = 116: file open request";
	case 117:return"Shortcut = 117: shortcut triggered";
	case 118:return"118:WhatsThisClicked";
	case 120:return"120:ToolBarChange: toolbar visibility toggled";
	case 121:return"121:ApplicationActivate: application has been changed to active";
	case 122:return"122:ApplicationDeactivate: application has been changed to inactive";
	case 123:return"123:QueryWhatsThis: query what's this widget help";
	case 124:return"124:EnterWhatsThisMode";
	case 125:return"125:LeaveWhatsThisMode";
	case 126:return"126:ZOrderChange: child widget has had its z-order changed";
	case 127:return"127:HoverEnter: mouse cursor enters a hover widget";
	case 128:return"128:HoverLeave: mouse cursor leaves a hover widget";
	case 129:return"129:HoverMove: mouse cursor move inside a hover widget";
	case 119:return"119:AccessibilityHelp: accessibility help text request";
	case 130:return"130:AccessibilityDescription: accessibility description text request";
	case 131:return"131:ParentAboutToChange: sent just before the parent change is done";
	case 132:return"132:WinEventAct: win event activation";
	case 150:return"150:EnterEditFocus: enter edit mode in QT_KEYPAD_NAVIGATION";
	case 151:return"151:LeaveEditFocus: leave edit mode in QT_KEYPAD_NAVIGATION";
	case 152:return"152:AcceptDropsChange";
	case 153:return"153:MenubarUpdated: Support event for Q3MainWindow (Qt3)";
	case 154:return"154:ZeroTimerEvent: Used for Windows Zero timer events";
	case 155:return"155:GraphicsSceneMouseMove";
	case 156:return"156:GraphicsSceneMousePress";
	case 157:return"157:GraphicsSceneMouseRelease";
	case 158:return"158:GraphicsSceneMouseDoubleClick";
	case 159:return"159:GraphicsSceneContextMenu";
	case 160:return"160:GraphicsSceneHoverEnter";
	case 161:return"161:GraphicsSceneHoverMove";
	case 162:return"162:GraphicsSceneHoverLeave";
	case 163:return"163:GraphicsSceneHelp";
	case 164:return"164:GraphicsSceneDragEnter";
	case 165:return"165:GraphicsSceneDragMove";
	case 166:return"166:GraphicsSceneDragLeave";
	case 167:return"167:GraphicsSceneDrop";
	case 168:return"168:GraphicsSceneWheel";
	case 169:return"169:KeyboardLayoutChange";
	case 170:return"170:DynamicPropertyChange: A dynamic property was changed through setProperty/property";
	case 171:return"171:TabletEnterProximity";
	case 172:return"172:TabletLeaveProximity";
	case 173:return"173:NonClientAreaMouseMove";
	case 174:return"174:NonClientAreaMouseButtonPress";
	case 175:return"175:NonClientAreaMouseButtonRelease";
	case 176:return"176:NonClientAreaMouseButtonDblClick";
	case 177:return"177:MacSizeChange: when the Qt::WA_Mac{Normal,Small,Mini}Size changes";
	case 178:return"178:ContentsRectChange: sent by QWidget::setContentsMargins (internal)";
	case 179:return"179:MacGLWindowChange: the window of the GLWidget has changed (internal)";
	case 180:return"180:FutureCallOut";
	case 181:return"181:GraphicsSceneResize";
	case 182:return"182:GraphicsSceneMove";
	case 183:return"183:CursorChange";
	case 184:return"184:ToolTipChange";
	case 185:return"185:NetworkReplyUpdated: QNetworkReply (internal)";
	case 186:return"186:GrabMouse";
	case 187:return"187:UngrabMouse";
	case 188:return"188:GrabKeyboard";
	case 189:return"189:UngrabKeyboard";
	case 190:return"190:CocoaRequestModal: requesting an application modal Cocoa Window (internal)";
	case 191:return"191:MacGLClearDrawable: Cocoa, the window has changed, so we must clear (internal)";
	case 512:return"512:reserved for Qt Jambi's MetaCall event";
	case 513:return"513:reserved for Qt Jambi's DeleteOnMainThread event";

//    case event_info:    return "event_info: show 'Info' message box";
//    case event_warn:    return "event_warn: show 'Warn' message box";
//    case event_alert:   return "event_alert: show 'Alert' message box";
	default: return catstr(numstr(n)," = ?");
	}
}





#if 0
//	case ApplicationActivated = ApplicationActivate, // deprecated
//	case ApplicationDeactivated = ApplicationDeactivate, // deprecated
//	case Reparent = ParentChange (QT3)
//	case CaptionChange = WindowTitleChange (QT3)
//	case IconChange = WindowIconChange (QT3)
//	case AccelOverride=ShortcutOverride: accelerator override event (QT3)
//	last event id used = 132
//	User = 1000,                            // first user event id
//	MaxUser = 65535                         // last user event id
#endif


