You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pytqt/sip/tqt/tqevent.sip

858 lines
15 KiB

// This is the SIP interface definition for TQEvent, TQChildEvent, TQCloseEvent,
// TQIconDragEvent, TQContextMenuEvent, TQCustomEvent, TQDragEnterEvent,
// TQDragLeaveEvent, TQDragMoveEvent, TQDropEvent, TQFocusEvent, TQHideEvent,
// TQIMEvent, TQIMComposeEvent, TQKeyEvent, TQMouseEvent, TQMoveEvent, TQPaintEvent,
// TQResizeEvent, TQShowEvent, TQTabletEvent, TQTimerEvent, TQWheelEvent.
//
// Copyright (c) 2007
// Riverbank Computing Limited <info@riverbankcomputing.co.uk>
//
// This file is part of PyTQt.
//
// This copy of PyTQt 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, or (at your option) any later
// version.
//
// PyTQt is supplied 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
// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
%ExportedDoc
<Sect2><Title>TQEvent</Title>
<Para>
<Literal>TQEvent</Literal> is fully implemented.
</Para>
<Para>
Instances of <Literal>TQEvent</Literal>s are automatically converted to the
correct sub-class.
</Para>
</Sect2>
<Sect2><Title>TQChildEvent</Title>
<Para>
<Literal>TQChildEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQCloseEvent</Title>
<Para>
<Literal>TQCloseEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQIconDragEvent (TQt v3.3+)</Title>
<Para>
<Literal>TQIconDragEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQContextMenuEvent (TQt v3+)</Title>
<Para>
<Literal>TQContextMenuEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQCustomEvent</Title>
<Para>
<Literal>TQCustomEvent</Literal> is fully implemented. Any Python object can be
passed as the event data and its reference count is increased.
</Para>
</Sect2>
<Sect2><Title>TQDragEnterEvent</Title>
<Para>
<Literal>TQDragEnterEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQDragLeaveEvent</Title>
<Para>
<Literal>TQDragLeaveEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQDragMoveEvent</Title>
<Para>
<Literal>TQDragMoveEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQDropEvent</Title>
<Para>
<Literal>TQDropEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQFocusEvent</Title>
<Para>
<Literal>TQFocusEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQHideEvent</Title>
<Para>
<Literal>TQHideEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQIMComposeEvent (TQt v3.1+)</Title>
<Para>
<Literal>TQIMComposeEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQIMEvent (TQt v3+)</Title>
<Para>
<Literal>TQIMEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQKeyEvent</Title>
<Para>
<Literal>TQKeyEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQMouseEvent</Title>
<Para>
<Literal>TQMouseEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQMoveEvent</Title>
<Para>
<Literal>TQMoveEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQPaintEvent</Title>
<Para>
<Literal>TQPaintEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQResizeEvent</Title>
<Para>
<Literal>TQResizeEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQShowEvent</Title>
<Para>
<Literal>TQShowEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQTabletEvent (TQt v3+)</Title>
<Para>
<Literal>TQTabletEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQTimerEvent</Title>
<Para>
<Literal>TQTimerEvent</Literal> is fully implemented.
</Para>
</Sect2>
<Sect2><Title>TQWheelEvent (TQt v2+)</Title>
<Para>
<Literal>TQWheelEvent</Literal> is fully implemented.
</Para>
</Sect2>
%End
%ModuleHeaderCode
#include <tqevent.h>
%End
class TQEvent : TQt
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
enum Type
{
None,
Timer,
MouseButtonPress,
MouseButtonRelease,
MouseButtonDblClick,
MouseMove,
KeyPress,
KeyRelease,
FocusIn,
FocusOut,
Enter,
Leave,
Paint,
Move,
Resize,
Create,
Destroy,
Show,
Hide,
Close,
Quit,
Reparent,
ShowMinimized,
ShowNormal,
WindowActivate,
WindowDeactivate,
ShowToParent,
HideToParent,
ShowMaximized,
ShowFullScreen,
Accel,
Wheel,
AccelAvailable,
CaptionChange,
IconChange,
ParentFontChange,
ApplicationFontChange,
ParentPaletteChange,
ApplicationPaletteChange,
PaletteChange,
Clipboard,
Speech,
SockAct,
AccelOverride,
DeferredDelete,
DragEnter,
DragMove,
DragLeave,
Drop,
DragResponse,
ChildInserted,
ChildRemoved,
LayoutHint,
ShowWindowRequest,
WindowBlocked,
WindowUnblocked,
ActivateControl,
DeactivateControl,
ContextMenu,
IMStart,
IMCompose,
IMEnd,
Accessibility,
TabletMove,
LocaleChange,
LanguageChange,
LayoutDirectionChange,
Style,
TabletPress,
TabletRelease,
OkRequest,
HelpRequest,
IconDrag,
WindowStateChange,
User,
MaxUser,
};
TQEvent(Type);
TQEvent(TQEvent&);
virtual ~TQEvent();
Type type() const;
bool spontaneous() const;
%ConvertToSubClassCode
switch (sipCpp -> type())
{
case TQEvent::Timer:
sipClass = sipClass_TQTimerEvent;
break;
case TQEvent::MouseButtonPress:
case TQEvent::MouseButtonRelease:
case TQEvent::MouseButtonDblClick:
case TQEvent::MouseMove:
sipClass = sipClass_TQMouseEvent;
break;
case TQEvent::Accel:
case TQEvent::AccelOverride:
case TQEvent::KeyPress:
case TQEvent::KeyRelease:
sipClass = sipClass_TQKeyEvent;
break;
case TQEvent::FocusIn:
case TQEvent::FocusOut:
sipClass = sipClass_TQFocusEvent;
break;
case TQEvent::Paint:
sipClass = sipClass_TQPaintEvent;
break;
case TQEvent::Move:
sipClass = sipClass_TQMoveEvent;
break;
case TQEvent::Resize:
sipClass = sipClass_TQResizeEvent;
break;
case TQEvent::Close:
sipClass = sipClass_TQCloseEvent;
break;
case TQEvent::IconDrag:
sipClass = sipClass_TQIconDragEvent;
break;
case TQEvent::Wheel:
sipClass = sipClass_TQWheelEvent;
break;
case TQEvent::Show:
sipClass = sipClass_TQShowEvent;
break;
case TQEvent::Hide:
sipClass = sipClass_TQHideEvent;
break;
#if defined(SIP_FEATURE_TQt_DRAGANDDROP)
case TQEvent::DragMove:
sipClass = sipClass_TQDragMoveEvent;
break;
case TQEvent::DragEnter:
sipClass = sipClass_TQDragEnterEvent;
break;
case TQEvent::DragLeave:
sipClass = sipClass_TQDragLeaveEvent;
break;
case TQEvent::Drop:
sipClass = sipClass_TQDropEvent;
break;
#endif
case TQEvent::ChildInserted:
case TQEvent::ChildRemoved:
sipClass = sipClass_TQChildEvent;
break;
case TQEvent::ContextMenu:
sipClass = sipClass_TQContextMenuEvent;
break;
case TQEvent::IMStart:
case TQEvent::IMEnd:
sipClass = sipClass_TQIMEvent;
break;
case TQEvent::IMCompose:
sipClass = sipClass_TQIMComposeEvent;
break;
case TQEvent::TabletMove:
case TQEvent::TabletPress:
case TQEvent::TabletRelease:
sipClass = sipClass_TQTabletEvent;
break;
default:
sipClass = (sipCpp -> type() < TQEvent::User ?
sipClass_TQEvent :
sipClass_TQCustomEvent);
}
%End
};
class TQTimerEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQTimerEvent(int);
int timerId() const;
};
class TQMouseEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQMouseEvent(Type,const TQPoint &,int,int);
TQMouseEvent(Type,const TQPoint &,const TQPoint &,int,int);
const TQPoint &pos() const;
const TQPoint &globalPos() const;
int x() const;
int y() const;
int globalX() const;
int globalY() const;
ButtonState button() const;
ButtonState state() const;
ButtonState stateAfter() const;
bool isAccepted() const;
void accept();
void ignore();
};
class TQWheelEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQWheelEvent(const TQPoint &,int,int,Orientation = Vertical);
TQWheelEvent(const TQPoint &,const TQPoint &,int,int,
Orientation = Vertical);
int delta() const;
const TQPoint &pos() const;
const TQPoint &globalPos() const;
int x() const;
int y() const;
int globalX() const;
int globalY() const;
ButtonState state() const;
Orientation orientation() const;
bool isAccepted() const;
void accept();
void ignore();
};
class TQTabletEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
enum TabletDevice {
NoDevice,
Puck,
Stylus,
Eraser
};
TQTabletEvent(Type,const TQPoint &,const TQPoint &,int,int,int,int,
const TQPair<int,int> &);
TQTabletEvent(const TQPoint &,const TQPoint &,int,int,int,int,
const TQPair<int,int> &);
int pressure() const;
int xTilt() const;
int yTilt() const;
const TQPoint &pos() const;
const TQPoint &globalPos() const;
int x() const;
int y() const;
int globalX() const;
int globalY() const;
TabletDevice device() const;
int isAccepted() const;
void accept();
void ignore();
TQPair<int,int> uniqueId();
};
class TQKeyEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQKeyEvent(Type,int,int,int,const TQString & = TQString::null,bool = 0,
ushort = 1);
int key() const;
int ascii() const;
bool isAccepted() const;
void accept();
void ignore();
ButtonState state() const;
ButtonState stateAfter() const;
TQString text() const;
bool isAutoRepeat() const;
int count() const;
};
class TQFocusEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQFocusEvent(Type);
bool gotFocus() const;
bool lostFocus() const;
enum Reason {
Mouse,
Tab,
Backtab,
ActiveWindow,
Popup,
Shortcut,
Other
};
static Reason reason();
static void setReason(Reason);
static void resetReason();
};
class TQPaintEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQPaintEvent(const TQRegion &,bool = 1);
TQPaintEvent(const TQRect &,bool = 1);
TQPaintEvent(const TQRegion &,const TQRect &,bool = 1);
const TQRect &rect() const;
const TQRegion &region() const;
bool erased() const;
};
class TQMoveEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQMoveEvent(const TQPoint &,const TQPoint &);
const TQPoint &pos() const;
const TQPoint &oldPos() const;
};
class TQResizeEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQResizeEvent(const TQSize &,const TQSize &);
const TQSize &size() const;
const TQSize &oldSize() const;
};
class TQCloseEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQCloseEvent();
bool isAccepted() const;
void accept();
void ignore();
};
class TQIconDragEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQIconDragEvent();
bool isAccepted() const;
void accept();
void ignore();
};
class TQShowEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQShowEvent();
};
class TQHideEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQHideEvent();
};
class TQContextMenuEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
enum Reason {
Mouse,
Keyboard,
Other
};
TQContextMenuEvent(Reason,const TQPoint &,const TQPoint &,int);
TQContextMenuEvent(Reason,const TQPoint &,int);
int x() const;
int y() const;
int globalX() const;
int globalY() const;
const TQPoint &pos() const;
const TQPoint &globalPos() const;
ButtonState state() const;
bool isAccepted() const;
bool isConsumed() const;
void consume();
void accept();
void ignore();
Reason reason() const;
};
class TQIMEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQIMEvent(Type,const TQString &,int);
const TQString &text() const;
int cursorPos() const;
bool isAccepted() const;
void accept();
void ignore();
int selectionLength() const;
};
class TQIMComposeEvent : TQIMEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQIMComposeEvent(Type,const TQString &,int,int);
};
%If (TQt_DRAGANDDROP)
class TQDropEvent : TQEvent, TQMimeSource
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQDropEvent(const TQPoint &,Type = Drop);
const TQPoint &pos() const;
bool isAccepted() const;
void accept(bool = 1);
void ignore();
bool isActionAccepted() const;
void acceptAction(bool = 1);
enum Action
{
Copy,
Link,
Move,
Private,
UserAction = 100
};
void setAction(Action);
Action action() const;
TQWidget *source() const;
const char *format(int = 0) const;
TQByteArray encodedData(const char *) const;
bool provides(const char *) const;
TQByteArray data(const char *) const;
void setPoint(const TQPoint &);
};
%End
%If (TQt_DRAGANDDROP)
class TQDragMoveEvent : TQDropEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQDragMoveEvent(const TQPoint &,Type = DragMove);
TQRect answerRect() const;
void accept(bool = 1);
void accept(const TQRect &);
void ignore(const TQRect &);
void ignore();
};
class TQDragEnterEvent : TQDragMoveEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQDragEnterEvent(const TQPoint &);
};
class TQDragLeaveEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQDragLeaveEvent();
};
%End
class TQChildEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQChildEvent(Type,TQObject *);
TQObject *child() const;
bool inserted() const;
bool removed() const;
};
class TQCustomEvent : TQEvent
{
%TypeHeaderCode
#include <tqevent.h>
%End
public:
TQCustomEvent(Type,SIP_PYOBJECT /Transfer/);
TQCustomEvent(int);
~TQCustomEvent();
%VirtualCatcherCode
// We need to garbage collect any current data.
PyObject *old = reinterpret_cast<PyObject *>(data());
SIP_BLOCK_THREADS
Py_XDECREF(old);
SIP_UNBLOCK_THREADS
%End
SIP_PYOBJECT data() const;
%MethodCode
// We need to cast the result.
sipRes = reinterpret_cast<PyObject *>(sipCpp -> TQCustomEvent::data());
// In case the event has been created from C++ code.
if (!sipRes)
sipRes = Py_None;
Py_INCREF(sipRes);
%End
void setData(SIP_PYOBJECT /Transfer/);
%MethodCode
// We need to garbage collect any current data.
PyObject *old = reinterpret_cast<PyObject *>(sipCpp -> TQCustomEvent::data());
sipCpp -> TQCustomEvent::setData(a0);
Py_XDECREF(old);
%End
%GCTraverseCode
// Support the Python garbage collector. Although it's not obviously
// documented, we can't release the GIL in traverse code.
PyObject *obj = reinterpret_cast<PyObject *>(sipCpp -> TQCustomEvent::data());
if (obj)
sipRes = sipVisit(obj, sipArg);
else
sipRes = 0;
%End
%GCClearCode
// Support the Python garbage collector.
PyObject *obj = reinterpret_cast<PyObject *>(sipCpp -> TQCustomEvent::data());
sipCpp -> TQCustomEvent::setData(0);
Py_XDECREF(obj);
sipRes = 0;
%End
};