KWQEvent.h 15.9 KB
Newer Older
gramps's avatar
gramps committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
gramps's avatar
gramps committed
24
 */
gramps's avatar
gramps committed
25 26 27 28

#ifndef QEVENT_H_
#define QEVENT_H_

29 30 31 32
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

33
#include "qnamespace.h"
34
#include "qregion.h"
35
#include "qpoint.h"
36

37 38
// class QEvent ================================================================

39 40
class QEvent : public Qt {
public:
41 42 43 44

    // typedefs ----------------------------------------------------------------
    // enums -------------------------------------------------------------------

kocienda's avatar
kocienda committed
45
    enum Type {
46
        Timer,
kocienda's avatar
kocienda committed
47 48 49 50
        MouseButtonPress,
        MouseButtonRelease,
        MouseButtonDblClick,
        MouseMove,
51 52 53
        FocusIn,
        FocusOut,
        AccelAvailable,
54
        KeyPress,
55
        Paint,
kocienda's avatar
kocienda committed
56
    };
57 58 59 60 61

    // constants ---------------------------------------------------------------
    // static member functions -------------------------------------------------
    // constructors, copy constructors, and destructors ------------------------
    
62 63 64 65 66
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
    QEvent() {}
#endif

67 68 69 70 71
    QEvent(Type);
    virtual ~QEvent();

    // member functions --------------------------------------------------------

kocienda's avatar
kocienda committed
72
    Type type() const;
73 74 75 76 77 78 79

    // operators ---------------------------------------------------------------

// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------

private:
80 81 82 83

// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
84
    QEvent(const QEvent &);
85 86 87 88 89
#endif

// add assignment operator 
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
90
    QEvent &operator=(const QEvent &);
91
#endif
92 93 94 95 96

}; // class QEvent =============================================================


// class QMouseEvent ===========================================================
97 98 99

class QMouseEvent : public QEvent {
public:
100 101 102 103 104 105 106 107

    // typedefs ----------------------------------------------------------------
    // enums -------------------------------------------------------------------
    // constants ---------------------------------------------------------------
    // static member functions -------------------------------------------------

    // constructors, copy constructors, and destructors ------------------------

108 109 110 111 112
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
    QMouseEvent() {}
#endif

113 114
    QMouseEvent(Type type, const QPoint &pos, int button, int state);

115 116 117 118
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
    ~QMouseEvent() {}
#endif
119

120 121
    // member functions --------------------------------------------------------

kocienda's avatar
kocienda committed
122 123 124 125
    int x();
    int y();
    int globalX();
    int globalY();
126
    const QPoint &pos() const;
kocienda's avatar
kocienda committed
127 128
    ButtonState button();
    ButtonState state();
129
    ButtonState stateAfter();
130 131 132 133 134 135 136

    // operators ---------------------------------------------------------------

// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------

private:
137 138 139 140

// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
141
    QMouseEvent(const QMouseEvent &);
142 143 144 145 146
#endif

// add assignment operator 
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
147
    QMouseEvent &operator=(const QMouseEvent &);
148
#endif
149 150 151 152 153

}; // class QMouseEvent ========================================================


// class QTimerEvent ===========================================================
154

155 156
class QTimerEvent : public QEvent {
public:
157 158 159 160 161 162 163 164

    // typedefs ----------------------------------------------------------------
    // enums -------------------------------------------------------------------
    // constants ---------------------------------------------------------------
    // static member functions -------------------------------------------------
    
    // constructors, copy constructors, and destructors ------------------------
    
165 166 167 168 169
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
    QTimerEvent() {}
#endif

170 171
    QTimerEvent(int timerId);

172
    ~QTimerEvent();
173

174 175
    // member functions --------------------------------------------------------

176
    int timerId() const;
177 178 179 180 181 182 183

    // operators ---------------------------------------------------------------

// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------

private:
184 185 186 187

// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
188
    QTimerEvent(const QTimerEvent &);
189 190 191 192 193
#endif

// add assignment operator 
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
194
    QTimerEvent &operator=(const QTimerEvent &);
195
#endif
196 197 198 199 200

}; // class QTimerEvent ========================================================


// class QKeyEvent =============================================================
201

202 203
class QKeyEvent : public QEvent {
public:
204 205 206 207 208 209 210

    // typedefs ----------------------------------------------------------------
    // enums -------------------------------------------------------------------
    // constants ---------------------------------------------------------------
    // static member functions -------------------------------------------------
    // constructors, copy constructors, and destructors ------------------------

211 212 213 214 215
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
    QKeyEvent() {}
#endif

216
    QKeyEvent(Type, Key, int, int);
217

218 219 220 221
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
    ~QKeyEvent() {}
#endif
222

223 224
    // member functions --------------------------------------------------------

225 226
    int key() const;
    ButtonState state() const;
227
    void accept();
228
    void ignore();
229

230 231 232 233 234 235
    // operators ---------------------------------------------------------------

// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------

private:
236 237 238 239

// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
240
    QKeyEvent(const QKeyEvent &);
241 242 243 244 245
#endif

// add assignment operator 
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
246
    QKeyEvent &operator=(const QKeyEvent &);
247
#endif
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263

}; // class QKeyEvent ==========================================================


// class QFocusEvent ===========================================================

class QFocusEvent : public QEvent {
public:

    // typedefs ----------------------------------------------------------------
    // enums -------------------------------------------------------------------
    // constants ---------------------------------------------------------------
    // static member functions -------------------------------------------------

    // constructors, copy constructors, and destructors ------------------------

264 265 266 267 268 269
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
    QFocusEvent() {}
#endif

    QFocusEvent(Type);
270

271 272 273 274
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
    ~QFocusEvent() {}
#endif
275

276 277 278 279 280 281 282
    // member functions --------------------------------------------------------
    // operators ---------------------------------------------------------------

// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------

private:
283 284 285 286

// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
287
    QFocusEvent(const QFocusEvent &);
288 289 290 291 292
#endif

// add assignment operator 
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
293
    QFocusEvent &operator=(const QFocusEvent &);
294
#endif
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310

}; // class QFocusEvent ========================================================


// class QHideEvent ============================================================

class QHideEvent : public QEvent {
public:

    // typedefs ----------------------------------------------------------------
    // enums -------------------------------------------------------------------
    // constants ---------------------------------------------------------------
    // static member functions -------------------------------------------------
    
    // constructors, copy constructors, and destructors ------------------------
    
311 312 313 314
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
    QHideEvent() {}
#endif
rjw's avatar
rjw committed
315 316 317

    QHideEvent(Type);

318 319 320 321
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
    ~QHideEvent() {}
#endif
322

323 324 325 326 327 328 329
    // member functions --------------------------------------------------------
    // operators ---------------------------------------------------------------

// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------

private:
330 331 332 333

// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
334
    QHideEvent(const QHideEvent &);
335 336 337 338 339
#endif

// add assignment operator 
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
340
    QHideEvent &operator=(const QHideEvent &);
341
#endif
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357

}; // class QHideEvent =========================================================


// class QResizeEvent ==========================================================

class QResizeEvent : public QEvent {
public:

    // typedefs ----------------------------------------------------------------
    // enums -------------------------------------------------------------------
    // constants ---------------------------------------------------------------
    // static member functions -------------------------------------------------
    
    // constructors, copy constructors, and destructors ------------------------
    
358 359 360 361
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
    QResizeEvent() {}
#endif
362

rjw's avatar
rjw committed
363 364
    QResizeEvent(Type);
    
365 366 367 368
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
    ~QResizeEvent() {}
#endif
369 370 371 372 373 374 375 376
    
    // member functions --------------------------------------------------------
    // operators ---------------------------------------------------------------

// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------

private:
377 378 379 380

// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
381
    QResizeEvent(const QResizeEvent &);
382 383 384 385 386
#endif

// add assignment operator 
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
387
    QResizeEvent &operator=(const QResizeEvent &);
388
#endif
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404

}; // class QResizeEvent =======================================================


// class QShowEvent ============================================================

class QShowEvent : public QEvent {
public:

    // typedefs ----------------------------------------------------------------
    // enums -------------------------------------------------------------------
    // constants ---------------------------------------------------------------
    // static member functions -------------------------------------------------
    
    // constructors, copy constructors, and destructors ------------------------
    
405 406 407 408 409
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
    QShowEvent() {}
#endif

rjw's avatar
rjw committed
410 411
    QShowEvent(Type);

412 413 414 415
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
    ~QShowEvent() {}
#endif
416

417 418 419 420 421 422 423
    // member functions --------------------------------------------------------
    // operators ---------------------------------------------------------------

// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------

private:
424 425 426 427

// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
428
    QShowEvent(const QShowEvent &);
429 430 431 432 433
#endif

// add assignment operator 
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
434
    QShowEvent &operator=(const QShowEvent &);
435
#endif
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451

}; // class QShowEvent =========================================================


// class QWheelEvent ===========================================================

class QWheelEvent : public QEvent {
public:

    // typedefs ----------------------------------------------------------------
    // enums -------------------------------------------------------------------
    // constants ---------------------------------------------------------------
    // static member functions -------------------------------------------------
    
    // constructors, copy constructors, and destructors ------------------------
    
452 453 454 455
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
    QWheelEvent() {}
#endif
456

rjw's avatar
rjw committed
457 458
    QWheelEvent(Type);

459 460 461 462
// add no-op destructor
#ifdef _KWQ_PEDANTIC_
    ~QWheelEvent() {}
#endif
463 464
    
    // member functions --------------------------------------------------------
465 466 467 468

    void accept();
    void ignore();
    
469 470 471 472 473 474
    // operators ---------------------------------------------------------------

// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------

private:
475 476 477 478

// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
479
    QWheelEvent(const QWheelEvent &);
480 481 482 483 484
#endif

// add assignment operator 
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
485
    QWheelEvent &operator=(const QWheelEvent &);
486
#endif
487

488
}; // class QWheelEvent ========================================================
489

490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535

// class QCustomEvent ===========================================================

class QCustomEvent : public QEvent {
public:

    // typedefs ----------------------------------------------------------------
    // enums -------------------------------------------------------------------
    // constants ---------------------------------------------------------------
    // static member functions -------------------------------------------------
    
    // constructors, copy constructors, and destructors ------------------------
    
// add no-arg constructor
#ifdef _KWQ_PEDANTIC_
    QCustomEvent() {}
#endif

    QCustomEvent(Type);

// add no-op destructor
#ifdef _KWQ_PEDANTIC_
    ~QCustomEvent() {}
#endif
    
    // member functions --------------------------------------------------------
    // operators ---------------------------------------------------------------

// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------

private:

// add copy constructor
// this private declaration prevents copying
#ifdef _KWQ_PEDANTIC_
    QCustomEvent(const QCustomEvent &);
#endif

// add assignment operator 
// this private declaration prevents assignment
#ifdef _KWQ_PEDANTIC_
    QCustomEvent &operator=(const QCustomEvent &);
#endif

}; // class QWheelEvent ========================================================
gramps's avatar
gramps committed
536
#endif