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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Qwt User's Guide: qwt_event_pattern.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.8 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>qwt_event_pattern.h</h1><pre class="fragment"><div>00001 <span class="comment">/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************</span>
00002 <span class="comment"> * Qwt Widget Library</span>
00003 <span class="comment"> * Copyright (C) 1997 Josef Wilgen</span>
00004 <span class="comment"> * Copyright (C) 2002 Uwe Rathmann</span>
00005 <span class="comment"> * </span>
00006 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
00007 <span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span>
00008 <span class="comment"> *****************************************************************************/</span>
00009
00010 <span class="preprocessor">#ifndef QWT_EVENT_PATTERN</span>
00011 <span class="preprocessor"></span><span class="preprocessor">#define QWT_EVENT_PATTERN 1</span>
00012 <span class="preprocessor"></span>
00013 <span class="preprocessor">#include "qwt_array.h"</span>
00014
00015 <span class="keyword">class </span>QMouseEvent;
00016 <span class="keyword">class </span>QKeyEvent;
00017
<a name="l00027"></a><a class="code" href="class_qwt_event_pattern.html">00027</a> <span class="keyword">class </span>QWT_EXPORT QwtEventPattern
00028 {
00029 <span class="keyword">public</span>:
<a name="l00078"></a><a class="code" href="class_qwt_event_pattern.html#w18">00078</a> <span class="keyword">enum</span> MousePatternCode
00079 {
00080 MouseSelect1,
00081 MouseSelect2,
00082 MouseSelect3,
00083 MouseSelect4,
00084 MouseSelect5,
00085 MouseSelect6,
00086
00087 MousePatternCount
00088 };
00089
<a name="l00117"></a><a class="code" href="class_qwt_event_pattern.html#w19">00117</a> <span class="keyword">enum</span> KeyPatternCode
00118 {
00119 KeySelect1,
00120 KeySelect2,
00121 KeyAbort,
00122
00123 KeyLeft,
00124 KeyRight,
00125 KeyUp,
00126 KeyDown,
00127
00128 KeyRedo,
00129 KeyUndo,
00130 KeyHome,
00131
00132 KeyPatternCount
00133 };
00134
00135 <span class="keyword">class </span>MousePattern
00136 {
00137 <span class="keyword">public</span>:
00138 MousePattern(<span class="keywordtype">int</span> btn = Qt::NoButton, <span class="keywordtype">int</span> st = Qt::NoButton)
00139 {
00140 button = btn;
00141 state = st;
00142 }
00143
00144 <span class="keywordtype">int</span> button;
00145 <span class="keywordtype">int</span> state;
00146 };
00147
00148 <span class="keyword">class </span>KeyPattern
00149 {
00150 <span class="keyword">public</span>:
00151 KeyPattern(<span class="keywordtype">int</span> k = 0, <span class="keywordtype">int</span> st = Qt::NoButton)
00152 {
00153 key = k;
00154 state = st;
00155 }
00156
00157 <span class="keywordtype">int</span> key;
00158 <span class="keywordtype">int</span> state;
00159 };
00160
00161 QwtEventPattern();
00162 <span class="keyword">virtual</span> ~QwtEventPattern();
00163
00164 <span class="keywordtype">void</span> initMousePattern(<span class="keywordtype">int</span> numButtons);
00165 <span class="keywordtype">void</span> initKeyPattern();
00166
00167 <span class="keywordtype">void</span> setMousePattern(uint pattern, <span class="keywordtype">int</span> button, <span class="keywordtype">int</span> state = Qt::NoButton);
00168 <span class="keywordtype">void</span> setKeyPattern(uint pattern, <span class="keywordtype">int</span> key, <span class="keywordtype">int</span> state = Qt::NoButton);
00169
00170 <span class="keywordtype">void</span> setMousePattern(<span class="keyword">const</span> QwtArray<MousePattern> &);
00171 <span class="keywordtype">void</span> setKeyPattern(<span class="keyword">const</span> QwtArray<KeyPattern> &);
00172
00173 <span class="keyword">const</span> QwtArray<MousePattern> &mousePattern() const;
00174 const QwtArray<KeyPattern> &keyPattern() const;
00175
00176 QwtArray<MousePattern> &mousePattern();
00177 QwtArray<KeyPattern> &keyPattern();
00178
00179 <span class="keywordtype">bool</span> mouseMatch(uint pattern, const QMouseEvent *) const;
00180 <span class="keywordtype">bool</span> keyMatch(uint pattern, const QKeyEvent *) const;
00181
00182 protected:
00183 virtual <span class="keywordtype">bool</span> mouseMatch(const MousePattern &, const QMouseEvent *) const;
00184 virtual <span class="keywordtype">bool</span> keyMatch(const KeyPattern &, const QKeyEvent *) const;
00185
00186 private:
00187
00188 #if defined(_MSC_VER)
00189 #pragma warning(push)
00190 #pragma warning(disable: 4251)
00191 #endif
00192 QwtArray<MousePattern> d_mousePattern;
00193 QwtArray<KeyPattern> d_keyPattern;
00194 #if defined(_MSC_VER)
00195 #pragma warning(pop)
00196 #endif
00197 };
00198
00199 #if defined(QWT_TEMPLATEDLL)
00200 <span class="comment">// MOC_SKIP_BEGIN</span>
00201 template class QWT_EXPORT QwtArray<QwtEventPattern::MousePattern>;
00202 template class QWT_EXPORT QwtArray<QwtEventPattern::KeyPattern>;
00203 <span class="comment">// MOC_SKIP_END</span>
00204 #endif
00205
00206 #endif
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Tue Nov 16 21:12:20 2004 for Qwt User's Guide by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.8 </small></address>
</body>
</html>
|